summaryrefslogtreecommitdiff
path: root/crates/tor-basic-utils/src/intern.rs
Commit message (Collapse)AuthorAgeFilesLines
* Make &Arc comment less controverisalClara Engler2026-06-241-1/+1
|
* Improve GloballyInternable::intern_cache() rustdocClara Engler2026-06-241-0/+3
|
* Fix GloballyInternable rustdoc commentClara Engler2026-06-241-1/+1
|
* Remove no longer required AsRef implClara Engler2026-06-241-9/+0
| | | | This is no longer required due to Deref
* Derive Clone for InternClara Engler2026-06-241-7/+1
| | | | We can do so now directly.
* Derive Deref for InternClara Engler2026-06-241-10/+2
| | | | If we derive it, we get access to Arc<T>, which is okay.
* Add Intern::new_uncached_uninterned()Clara Engler2026-06-241-1/+13
| | | | If one really wants to circumvent the guarantees ...
* tor-basic-utils: Add GloballyInternable::into_intern()Clara Engler2026-06-241-0/+10
| | | | As a shorthand for T::intern_cache().intern(value).
* Derive From Intern for Arc using derive-moreClara Engler2026-06-241-11/+2
|
* tor-netdoc: Intern rational improvementClara Engler2026-06-241-2/+5
|
* Add derive-deftly for GloballyInternableClara Engler2026-06-241-0/+16
| | | | | | Adds a derive-deftly based macro so that interfacing code can derive GloballyInternable on structs in order to save redundant and repetitive implementation calls.
* Define GloballyInternable traitClara Engler2026-06-241-0/+8
| | | | | | | | This defines a trait called GloballyInternable with a single method `.intern_cache()` returning a static reference to the globally available cache. The next commit will add a derive-deftly based macro for it.
* Use Intern<T>Clara Engler2026-06-241-12/+12
| | | | | This commit modifies the codebase to actually return Intern<T> in InternCache<T> and adds calls to .into() accordingly.
* Introduce Intern<T>Clara Engler2026-06-241-0/+58
| | | | | | | | | | | | | This commit introduces a new type for use with InternCache<T>: Intern<T>. Right now, we have the problem that this cache returns a general Arc<T>, which leads to the issue that we quickly loose overview from where values originate. With this type, it becomes clearer from where they come. In the next commit, we will adjust InternCache and the remaining codebase accordingly.
* 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.
* Force use of standard hasher with weak_tables.Nick Mathewson2026-03-241-1/+5
| | | | | | | | | | | | | Closes #2418. Fixes TROVE-2026-005, where we would use a less cryptographically secure (and probably less DoS resistant) hash function for these tables if: - We are built alongside another crate that uses `weak-table` - That crate enables the `weak-table/ahash` feature. - We are running on a system without hardware AES. Severity: Low
* Move intern from tor-netdir to tor-basic-utils and make it pubNick Mathewson2025-12-031-0/+131