Crate tor_basic_utils

Source
Expand description

§tor-basic-utils

Utilities (low-level) for Tor

Miscellaneous utilities for tor-* and arti-*.

This crate lives at the bottom of the Tor crate stack. So it contains only utilities which have no tor-* (or arti-*) dependencies.

There is no particular theme. More substantial sets of functionality with particular themes are to be found in other tor-* crates.

License: MIT OR Apache-2.0

Modules§

byte_qty 🔒
ByteQty, Quantity of memory used, measured in bytes.
iter
Iterator helpers for Arti.
n_key_list
Declaration for an n-keyed list type, allowing access to each of its members by each of N different keys.
n_key_set
Declaration for an n-keyed set type, allowing access to each of its members by each of N different keys.
rangebounds
This module exposes helpers for working with types that implement RangeBounds.
retry
An implementation of the “decorrelated jitter” algorithm for scheduling retries.
sealed 🔒
Sealed
test_rng
Code for deterministic and/or reproducible use of PRNGs in tests.

Macros§

define_accessor_trait
Define an “accessor trait”, which describes structs that have fields of certain types
derive_serde_raw
Helper for defining a struct which can be (de)serialized several ways, including “natively”
impl_debug_hex
Define Debug to print as hex
macro_first_nonempty
Helper for assisting with macro “argument” defaulting
n_key_list
Declare a structure that can hold elements with multiple unique keys.
n_key_set
Declare a structure that can hold elements with multiple unique keys.
paste

Structs§

ByteQty
Quantity of memory used, measured in bytes.

Traits§

BinaryHeapExt
Implementation of BinaryHeap::retain that doesn’t require Nightly
GenRangeInfallible
Types that can be infallibly sampled using gen_range_infallible
IoErrorExt
Implementation of ErrorKind::NotADirectory that doesn’t require Nightly
PathExt
Renaming of Path::display as display_lossy
RngExt
Extension trait to provide .gen_range_checked()
StrExt
Extension trait to provide .strip_suffix_ignore_ascii_case() etc.

Functions§

flatten
Flatten a Result<Result<T, E>, E> into a Result<T, E>.
skip_fmt
Function with the signature of Debug::fmt that just prints ".."