aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src/simple_time.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* rtcompat, rtmock: Port to web-time-compat.Nick Mathewson2026-03-261-4/+4
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-rtmock-simple-time-typos: Fix typosNiel Duysters2025-10-011-3/+3
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-041-1/+1
| | | | | | | | | | We're going to distinguish top-level runtime entry, from *re*-entry to an existing executor. It is most convenient to rename this trait first. Documentation of the distinction will come later. (We're going to retain the function name `block_on`, but we want the trait to be more obviously a top-level only thing, though, so we give it a name that will hopefully avoid it peroulating throughout the codebase..)
* Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-2/+2
|
* tor-rtmock: Introduce MockTimeCoreIan Jackson2024-03-251-23/+12
| | | | | | | | | | | | | It bothered me that when I added a `MockCoarseTimeProvider` to the mock time providers, I had to manually grep to check that there weren't places the time was updated where I ought to also update the coarse time. Prove that the code is right by hiding all the times together in a struct that prevents un-synchronised updates. This is part 1, where we move the fields from simple_time::State to the new struct.
* tor-rtmock: time_core: rename from coarse_timeIan Jackson2024-03-251-1/+1
| | | | | | We're going to put more in here. (Yes, I know we just invented this...)
* tor-rtmock: Rename coarsetime module to coarse_timeIan Jackson2024-03-251-1/+1
| | | | | Modules with the same name as external crates don't work well with our MSRV.
* tor-rtmock: impl CoarseTimeProvider for mocked time providersIan Jackson2024-03-251-0/+15
|
* tor-rtmock: Implement from_real in terms of from_wallclockIan Jackson2024-03-251-1/+1
| | | | This reduces duplication a little.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-rtmock: simple_time: Don't export StateIan Jackson2023-10-051-1/+1
| | | | This was a slip.
* tor-rtmock: simple_time: Rename `wakers` to `futures` (fmt)Ian Jackson2023-10-051-1/+4
|
* tor-rtmock: simple_time: Rename `wakers` to `futures`Ian Jackson2023-10-051-11/+11
| | | | This is clearer, I think.
* tor-rtmock: simple_time: Rename `pq` to `unready`Ian Jackson2023-10-051-13/+13
| | | | This is clearer, I think.
* tor-rtmock: simple_time: Expand on advance and task orderingIan Jackson2023-10-051-2/+8
|
* tor-rtmock: simple_time: Clarify/correct comments about invariantIan Jackson2023-10-051-2/+2
|
* tor-rtmock: simple_time: Clarify some things in time_until_next_timeoutIan Jackson2023-10-051-0/+6
|
* tor-rtmock: simple_time: Give formal names to the statesIan Jackson2023-10-051-2/+21
| | | | And introduce a table showing the situations.
* tor-rtmock: simple_time: take() the waker when we wakeIan Jackson2023-10-051-2/+5
| | | | | We don't need it any more; we won't call wake again. So, call .wake() rather than .wake_by_ref().
* tor-rtmock: Provide SimpleTimeProvider: clarify .sleep() innardsIan Jackson2023-10-031-4/+6
| | | | | | Making the SleepFuture first means we don't call .wake_any() with the other invariants violated. This doesn't actually matter with the code as it stands, but it's less confusing this way.
* tor-rtmock: Switch MockRuntime to SimpleMockSleepProviderIan Jackson2023-10-031-0/+3
| | | | | | | | | | | | | | | | For now we do this by changing the meaning of the name `MockSleepProvider` in runtime.rs. This is a bodge to reduce noise in this diff. Consequences at call sites: * If the type is named somehow, the other type must be used. * SimpleMockTimeProvider calls it jump_wallclock rather than jump_to, which is IMO a better name. (MockRuntime will change in a moment.) * SimpleMockTimeProvider's advance() function isn't async and doesn't yield. But none of the call sites actually mind that.
* tor-rtmock: Provide SimpleTimeProviderIan Jackson2023-10-031-0/+347