summaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-memquota: Use a const to hoist a panic to compile-timeIan Jackson2024-09-101-1/+3
|
* Fix typo in tor_memquota::ConfigBuilder docIan Jackson2024-09-041-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2374#note_3070500
* tor-memquota: Unstable cargo feature for exposing info for testingIan Jackson2024-09-041-2/+16
|
* tor-memquota: Rework optionality configurationIan Jackson2024-09-041-22/+78
| | | | | | | | | | | | | | | | | | Allow a `Config` to represent "this is supposed to be disabled". This involves wrapping the actual built configuration in an IfEnabled. We treat max = usize::MAX, or max being unspecified, as "disable". We can now reporting an error during config building if max is set but we're compiling the feature out. Conversely, we can now make `MemoryQuotaTracker::new()` unconditional, since enabled confiogurations are uninhabited when the feature is compiled out. We change how we derive the setters, deriving them from the Builder. I chose to abolish the use of derive_builder. See the new comment on ConfigBuilder.
* tor-memquota: Add unit tests for config handlingIan Jackson2024-09-041-0/+56
| | | | | We're about to change the config behaviour; adding these tests first allows us to demonstrate the changes.
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Rename tor-memtrack to tor-memquotaIan Jackson2024-04-291-0/+103