Module internal_prelude

Source
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 from tor_proto::stream other than the high-level DataStream.

Modules§

fmt 🔒
Utilities for formatting and printing Strings.
mem 🔒
Basic functions for dealing with memory.
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 err at level ERROR
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 err at level TRACE (or higher if it is a bug).

Structs§

Arc 🔒
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AssertUnwindSafe 🔒
A simple wrapper around a type to assert that it is unwind safe.
BinaryHeap 🔒
A priority queue implemented with a binary heap.
Bug 🔒
Programming error (a bug)
CoarseInstant 🔒
A monotonic timestamp with reduced precision, and, in the future, saturating arithmetic
DynTimeProvider 🔒
Type-erased SleepProvider and CoarseTimeProvider
HashSet 🔒
A hash set implemented as a HashMap where the value is ().
Mutex 🔒
A mutual exclusion primitive useful for protecting shared data
MutexGuard 🔒
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
PhantomData 🔒
Zero-sized type used to mark things that “act like” they own a T.
Pin 🔒
A pointer which pins its pointee in place.
PoisonError 🔒
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::SlotMap that can never give the same key for multiple objects.
SpawnError 🔒
An error that occurred during spawning.
StreamUnobtrusivePeeker 🔒
Wraps Stream and provides \[poll_]peek and unobtrusive_peek
Weak 🔒
Weak is a version of Arc that holds a non-owning reference to the managed allocation.

Enums§

ConfigBuildError 🔒
An error related to an option passed to Arti via a configuration builder.
ErrorKind 🔒
Classification of an error arising from Arti’s Tor operations
Ordering 🔒
An Ordering is the result of a comparison between two values.
ReconfigureError 🔒
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§

CoarseTimeProvider 🔒
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].
FusedStream 🔒
A stream which tracks whether or not the underlying stream should no longer be polled.
Future 🔒
A future represents an asynchronous computation obtained by use of async.
HasKind 🔒
Errors that can be categorized as belonging to an ErrorKind
Serialize 🔒
A data structure that can be serialized into any data format supported by Serde.
Sink 🔒
A Sink is a value into which other values can be sent, asynchronously.
Spawn 🔒
The Spawn trait allows for pushing futures onto an executor that will run them to completion.
Stream 🔒
A stream of values produced asynchronously.
_ 🔒
Extension trait for Spawn.
_ 🔒
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>

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
noop_waker_ref 🔒
Get a static reference to a Waker which does nothing when wake() is called on it.
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)]
DerefMut 🔒
What #[derive(DerefMut)] generates
Deserialize 🔒
Educe 🔒
Error 🔒
Serialize 🔒