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

  • Iterator helpers for Arti.
  • Declaration for an n-keyed set type, allowing access to each of its members by each of N different keys.
  • An implementation of the “decorrelated jitter” algorithm for scheduling retries.
  • Code for deterministic and/or reproducible use of PRNGs in tests.

Macros

  • Define an “accessor trait”, which describes structs that have fields of certain types
  • Helper for defining a struct which can be (de)serialized several ways, including “natively”
  • Helper for assisting with macro “argument” defaulting
  • Declare a structure that can hold elements with multiple unique keys.

Traits

  • Implementation of BinaryHeap::retain that doesn’t require Nightly
  • Implementation of ErrorKind::NotADirectory that doesn’t require Nightly
  • Extension trait to provide .strip_suffix_ignore_ascii_case() etc.

Functions

  • Function with the signature of Debug::fmt that just prints ".."