Expand description
Internal prelude
This file contains most of the imports we wish to use, throughout this crate.
Every module does use crate::internal_prelude::*;
Exceptions:
-
Names that are private to a module and its submodules are imported to the sub-modules via
use super::*. (Thus, the sub-module inherits the prelude from its parent.) -
Broad names from specific contexts, that are unsuitable for wide imports. For example, individual cell and message names from
tor-cell, and the types fromtor_proto::streamother than the high-levelDataStream.
ModulesΒ§
- fmt π
- Utilities for formatting and printing
Strings. - mem π
- Basic functions for dealing with memory, values, and types.
- mpsc π
- A multi-producer, single-consumer queue for sending values across asynchronous tasks.
MacrosΒ§
- assert_
not_ πimpl_ any - Asserts that the type does not implement any of the given traits.
- chain π
- Chain zero or more iterators together into one sequence.
- debug π
- Constructs an event at the debug level.
- define_
derive_ πdeftly - Define a reuseable template
- derive_
deftly_ πadhoc - Expand an ad-hoc template, on a data structure decorated
#[derive_deftly_adhoc] - error π
- Constructs an event at the error level.
- error_
report π - Log a report for
errat levelERROR - info π
- Constructs an event at the info level.
- internal π
- Create an internal error, including a message like
format!, and capturing this call site - into_
internal π - Helper for converting an error into an internal error
- log_
ratelim π - Log a rate-limited failure message.
- paste π
- trace_
report π - Log a report for
errat levelTRACE(or higher if it is a bug).
StructsΒ§
- Arc π
- A thread-safe reference-counting pointer. βArcβ stands for βAtomically Reference Countedβ.
- Assert
Unwind πSafe - A simple wrapper around a type to assert that it is unwind safe.
- Binary
Heap π - A priority queue implemented with a binary heap.
- Bug π
- Programming error (a bug)
- Coarse
Instant π - A monotonic timestamp with reduced precision, and, in the future, saturating arithmetic
- DynTime
Provider π - Type-erased
SleepProviderandCoarseTimeProvider - Enabled
Token π - Token indicating that memory quota tracking is enabled, at both compile and runtime
- HashSet π
- A hash set implemented as a
HashMapwhere the value is(). - Mutex π
- A mutual exclusion primitive useful for protecting shared data
- Mutex
Guard π - An RAII implementation of a βscoped lockβ of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Phantom
Data π - Zero-sized type used to mark things that βact likeβ they own a
T. - Pin π
- A pointer which pins its pointee in place.
- Poison
Error π - A type of error which can be returned whenever a lock is acquired.
- Qty π
- Quantity of memory used, measured in bytes.
- Reverse π
- A helper struct for reverse ordering.
- SlotMap π
- A variation of
slotmap::SlotMapthat can never give the same key for multiple objects. - Spawn
Error π - An error that occurred during spawning.
- Stream
Unobtrusive πPeeker - Wraps
Streamand provides\[poll_]peekandunobtrusive_peek - Waker π
- A
Wakeris a handle for waking up a task by notifying its executor that it is ready to be run. - Weak π
Weakis a version ofArcthat holds a non-owning reference to the managed allocation.
EnumsΒ§
- Config
Build πError - An error related to an option passed to Arti via a configuration builder.
- Error
Kind π - Classification of an error arising from Artiβs Tor operations
- Explicit
OrAuto π - A serializable value, or auto.
- Ordering π
- An
Orderingis the result of a comparison between two values. - Reconfigure
Error π - An error caused when attempting to reconfigure an existing Arti client, or one of its modules.
- Void π
- The empty type for cases which canβt occur.
TraitsΒ§
- Coarse
Time πProvider - A provider of reduced-precision timestamps
- Debug π
?formatting.- Deserialize π
- A data structure that can be deserialized from any data format supported by Serde.
- DynClone π
- This trait is implemented by any type that implements [
std::clone::Clone]. - Fused
Stream π - A stream which tracks whether or not the underlying stream should no longer be polled.
- Future π
- A future represents an asynchronous computation, commonly obtained by use of
async. - HasKind π
- Errors that can be categorized as belonging to an
ErrorKind - HasMemory
Cost π - Types whose memory usage is known (and stable)
- Serialize π
- A data structure that can be serialized into any data format supported by Serde.
- Sink π
- A
Sinkis a value into which other values can be sent, asynchronously. - Spawn π
- The
Spawntrait allows for pushing futures onto an executor that will run them to completion. - Stream π
- A stream of values produced asynchronously.
- _ π
- An extension trait for
Futures that provides a variety of convenient adapters. - _ π
- An extension trait for
Sinks that provides a variety of convenient combinator functions. - _ π
- An extension trait for
Streams that provides a variety of convenient combinator functions. - _ π
- Extensions to
Result<T, Void> - _ π
- Extension trait for
Spawn.
FunctionsΒ§
- catch_
unwind π - Invokes a closure, capturing the cause of an unwinding panic if one occurs.
- chain π
- Takes two iterables and creates a new iterator over both in sequence.
- mpsc_
channel_ πno_ memquota - Precisely
futures::channel::mpsc::channel - size_of π
- Returns the size of a type in bytes.
Attribute MacrosΒ§
- pin_
project π - An attribute that creates projection types covering all the fields of struct or enum.
Derive MacrosΒ§
- Constructor π
- What
#[derive(Constructor)]generates - Debug π
- Derive macro generating an impl of the trait
Debug. - Deftly π
- Perform ad-hoc templating driven by a data structure
- Deref π
- Using
#[derive(Deref)] - Deref
Mut π - What
#[derive(DerefMut)]generates - Deserialize π
- Educe π
- Error π
- Serialize π