summaryrefslogtreecommitdiff
path: root/crates/tor-checkable/src/timed.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-251-5/+16
| | | | Fixes: #1691
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-checkable: Use checked arithmeticTobias Stoeckmann2024-03-051-2/+14
| | | | | | | | | Make sure that arithmetic with SystemTime and Duration fits into SystemTime. If the result does not fit, set the affected boundary to None. After all it implies that this point in time is not reachable on the system. Avoids integer overflow or panic, depending on debug or release build.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* netdoc: Use the RangeBoundsExt impl of TimerangeBound.Gabriela Moldovan2023-05-131-71/+0
| | | | | | We can now get rid of the standalone `intersect_bounds` function. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-checkable: Implement RangeBounds for TimerangeBound.Gabriela Moldovan2023-05-131-4/+17
| | | | | | | | By implementing `RangeBounds` for `TimerangeBound`, we get `RangeBoundsExt` for free. This will enable `parse_decrypt_validate` to easily compute the intersection of the `TimerangeBound`s its layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-checkable: Add a way to compute the intersection of 2 RangeBounds.Gabriela Moldovan2023-05-131-0/+71
| | | | | | | This will be used for computing the final `TimerangeBound` of a `HsDesc` from the `TimerangeBound`s of its inner and outer layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Build cached descriptor TimerangeBounds from descriptor lifetime.Gabriela Moldovan2023-05-131-7/+11
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if it has been cached for longer than `descriptor-lifetime` minutes. Signed-off-by: Gabriela Moldovan <[email protected]>
* TimerangeBound: Provide .as_ref() and .as_deref()Ian Jackson2023-04-031-1/+33
|
* TimerangeBound: derive Debug and Clone, and Eq/PartialEq in testsIan Jackson2023-04-031-0/+2
|
* Use humantime in tor-checkableSaksham Mittal2023-02-271-5/+8
| | | | | | The four values of times taken in a particular test were changed to both be human readable and have comments explaining their significance (they are all important moments after the Unix Epoch for freedom)
* tor-checkable: Add dangerously_map() functions.Nick Mathewson2023-02-071-1/+31
| | | | | | | | | | | These functions consume a checkable wrapper, and return a new checkable wrapper with mapped contents but the same not-yet-checked constraints. As documented, They are "dangerous" because the provided function gets access to the contents before they are checked; the caller has to make sure that the provided function doesn't expose their contents inappropriately.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+9
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Tackling issue #663 (Use humantime in tests)coral2022-12-121-5/+7
|/
* tor-checkable: Make TimerangeBound::dangerously* non-experimentalIan Jackson2022-10-271-10/+0
| | | | | I want one of these for the bridge descriptor downloader, and they seem reasonable to me.
* checkable: additional unit tests for more APIs.Nick Mathewson2022-04-021-0/+28
|
* tor-checkable: add experimental api for exposing wrapped objects.Nick Mathewson2022-03-311-0/+35
|
* address clippy's latest lintDaniel Eades2021-12-201-0/+2
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+181
This will cause some pain for now, but now is really the best time to do this kind of thing.