aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* 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.
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* memquota: Extract HasMemoryCost and derive to new crate.Nick Mathewson2026-02-021-6/+7
| | | | This will help resolve some dependencies in our graph.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* Merge branch 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-061-1/+1
|/
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-0/+1
| | | | Fixes a TODO.
* memquota: Further docs tweaksIan Jackson2024-10-091-2/+3
|
* mq docs: Add some cross-references from tor-memquota to tor-protoIan Jackson2024-10-071-0/+3
| | | | These can't be rustdoc links because they point up the crate hierarchy.
* mq docs: Add a linkIan Jackson2024-10-071-1/+1
|
* mq docs: Uncomment docs about mq_queue, and remove the TODOIan Jackson2024-10-071-4/+4
|
* Merge branch 'mcost' into 'main'Ian Jackson2024-10-021-1/+7
|\ | | | | | | | | Implement tor_memquota:HasMemory cost for a lot of types See merge request tpo/core/arti!2459
| * tor-memquota: Replace MemoryCostStructuralCopy with assert_copy_static (fmt)Ian Jackson2024-10-021-1/+1
| |
| * tor-memquota: Replace MemoryCostStructuralCopy with assert_copy_staticIan Jackson2024-10-021-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086841
| * tor-memquota: Export Account at the toplevelIan Jackson2024-10-021-1/+1
| | | | | | | | | | It turns out we're mostly going to want to deal in Accounts, not Arc<MemoryQuotaaTracker>s.
| * tor-memquota: Provide facilities for deriving HasMemoryCostIan Jackson2024-10-021-0/+6
| |
* | memquota: Note a TODO about overheadsIan Jackson2024-10-021-0/+5
|/
* tor-memquota: queue plan: Add a cross-referenceIan Jackson2024-09-101-0/+3
|
* tor-memquota: Worsify formatting to stop rustfmt making it even worseIan Jackson2024-09-101-1/+3
|
* tor-memquota: Use clippy::arithmetic_side_effects, against panicsIan Jackson2024-09-101-0/+9
| | | | | | This detect possibly-panicking operations. Empirically this lint seems rather better now.
* tor-memquota: Document that we're panic-freeIan Jackson2024-09-101-0/+10
|
* tor-memquota: Move some information into the proper docsIan Jackson2024-09-101-0/+8
| | | | | This sentence is very important piece of overall explanation, but didn't make it into the crate level docs.
* tor-memquota: Unstable cargo feature for exposing info for testingIan Jackson2024-09-041-0/+7
|
* Fix typosDimitris Apostolou2024-09-031-1/+1
|
* Move stream_peek into tor-async-utilsJim Newsome2024-08-291-2/+0
|
* byte_qty: Move to tor-basic-utilsIan Jackson2024-08-271-1/+0
| | | | Code motion of byte_qty.rs, and minimal necessary supporting changes.
* byte_qty: Move Qty into its own module, byte_qty.Ian Jackson2024-08-271-0/+1
| | | | | | | Code motion, part 1. Also explain in comments at the top of the new module why we are doing this at all rather than using an existing thing.
* tor-memquota: Move the macro-containing modules earlier in the lib.rsIan Jackson2024-08-271-2/+3
| | | | | | This makes more sense than having them alphabetical. Noticed while I was working on moving other code.
* Merge branch 'peekable-poll-set' into 'main'Jim Newsome2024-08-211-1/+2
|\ | | | | | | | | Add and use `PeekableStream` and `UnobtrusivePeekableStream` See merge request tpo/core/arti!2345
| * Expose stream_peekJim Newsome2024-08-211-1/+2
| |
* | tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-191-0/+1
| | | | | | | | | | | | | | This will hopefully allow much caller code to be compiled out. The users (IsParticipant impls) don't generally need to bother with it - they can just ignore it.
* | tor-memquota: Put EnabledToken in various structs, including the reclaimerIan Jackson2024-08-191-1/+0
| |
* | tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-191-0/+2
| | | | | | | | | | | | | | Now if we run doctests without the feature enabled, we test that a no-op MemoryQuotaTracker works. Those tests aren't currently run in CI, but they will be after !2350.
* | tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-191-2/+0
| | | | | | | | | | | | | | | | | | | | Wrap up most of the structures in IfEnabled. Sadly this diff is very noisy. I experimented with macros for the little enabled check at the start of each function but they didn't really help. We don't test this yet. We'll do a smoke test of this later.
* | tor-memquota: Introduce IfEnabled and EnabledTokenIan Jackson2024-08-191-0/+3
|/ | | | EnabledToken is pub because it's going to appear in public APIs.
* tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queueIan Jackson2024-08-151-0/+1
|
* tor-memquota: Add a Sealed traitIan Jackson2024-08-151-0/+6
| | | | We'll use this in a moment.
* tor-memquota: Provide StreamUnobtrusivePeekerIan Jackson2024-07-241-0/+1
| | | | | | I'm not particularly pleased with this name. We need names for both the type, and the trait we'll almost certainly want to introduce in the future.
* Merge branch 'memquota-typed' into 'main'Ian Jackson2024-07-241-1/+7
|\ | | | | | | | | tor-memquota: HasMemoryCost trait, and type-safe methods See merge request tpo/core/arti!2282
| * tor-memquota: memory_cost: New trait and typed wrappersIan Jackson2024-07-241-0/+2
| |
| * tor-memquota: Add get_used_approx accessorIan Jackson2024-07-241-1/+5
| | | | | | | | | | I just want this for a test right now, bui it seems like it would be good to expose it publicly.
* | tor-memquota: Tidy up a minor formatting glitch in a doc commentIan Jackson2024-07-241-1/+1
|/