Module internal_prelude

Source
Expand description

Imports used internally within this crate

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 (eg, publish) 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§

broadcast 🔒
Provides a lossless, MPMC channel. All receivers are guaranteed to recieve each message.
curve25519 🔒
Re-exporting Curve25519 implementations.
ed25519 🔒
Re-exporting Ed25519 implementations, and related utilities.
fmt 🔒
Utilities for formatting and printing Strings.
fs 🔒
Filesystem manipulation operations.
future 🔒
Asynchronous values.
io 🔒
Traits, helpers, and type definitions for core I/O functionality.
iter 🔒
Composable external iteration.
mpsc 🔒
A multi-producer, single-consumer queue for sending values across asynchronous tasks.
watch 🔒
A state distribution channel. The internal state can be borrowed or cloned, but receivers do not observe every value.

Macros§

bad_api_usage 🔒
Create a bad API usage error, including a message like format!, and capturing this call site
chain 🔒
Chain zero or more iterators together into one sequence.
debug 🔒
Constructs an event at the debug level.
debug_report 🔒
Log a report for err at level DEBUG (or higher if it is a bug).
define_asref_dyn_std_error 🔒
Defines AsRef<dyn StdError + 'static> for a type implementing StdError
define_derive_deftly 🔒
Define a reuseable template
derive_deftly_template_KeySpecifier 🔒
A helper for implementing KeySpecifiers.
error 🔒
Constructs an event at the error level.
error_report 🔒
Log a report for err at level ERROR
impl_debug_hex 🔒
Define Debug to print as hex
info 🔒
Constructs an event at the info level.
info_report 🔒
Log a report for err at level INFO (or higher if it is a bug).
internal 🔒
Create an internal error, including a message like format!, and capturing this call site
into_bad_api_usage 🔒
Helper for converting an error into an bad API usage error
into_internal 🔒
Helper for converting an error into an internal error
log_ratelim 🔒
Log a rate-limited failure message.
select_biased 🔒
Polls multiple futures and streams simultaneously, executing the branch for the future that finishes first. Unlike select!, if multiple futures are ready, one will be selected in order of declaration. Futures directly passed to select_biased! must be Unpin and implement FusedFuture.
trace 🔒
Constructs an event at the trace level.
warn 🔒
Constructs an event at the warn level.
warn_report 🔒
Log a report for err at level WARN

Structs§

AesOpeKey 🔒
Key for a simple order-preserving encryption on the offset from the start of an SRV protocol run.
Arc 🔒
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
ArtiPathRange 🔒
A range specifying a substring of a [KeyPath].
AssertUnwindSafe 🔒
A simple wrapper around a type to assert that it is unwind safe.
BinaryHeap 🔒
A priority queue implemented with a binary heap.
BufReader 🔒
The BufReader<R> struct adds buffering to any reader.
BufWriter 🔒
Wraps a writer and buffers its output.
Bug 🔒
Programming error (a bug)
ClientCirc 🔒
A circuit that we have constructed over the Tor network.
DataStream 🔒
An anonymized stream over the Tor network.
DropNotifyWatchSender 🔒
Wrapper for postage::watch::Sender that sends DropNotifyEof::eof() when dropped
Duration 🔒
A Duration type to represent a span of time, typically used for system timeouts.
File 🔒
An object providing access to an open file on the filesystem.
HashMap 🔒
A hash map implemented with quadratic probing and SIMD lookup.
HashSet 🔒
A hash set implemented as a HashMap where the value is ().
HsBlindId 🔒
A blinded onion service identity, represented in a compact format. (KP_hs_blind_id)
HsBlindIdKey 🔒
The “blinded” identity of a v3 onion service. (KP_hs_blind_id)
HsBlindIdKeypair 🔒
The private counterpart of a [`HsBlindIdKeyKey’].
HsCircPool 🔒
An object to provide circuits for implementing onion services.
HsClientDescEncKey 🔒
Client service discovery key, used for onion descriptor decryption. (KP_hsc_desc_enc)
HsDescBuilder 🔒
Builder for HsDesc.
HsDescSigningKeypair 🔒
The private counterpart of a [`HsDescSigningKeyKey’].
HsDescUploadRequest 🔒
A request to upload a hidden service descriptor
HsDirParams 🔒
Parameters for generating and using an HsDir ring.
HsIdKey 🔒
The identity of a v3 onion service, expanded into a public key. (KP_hs_id)
HsIdKeypair 🔒
The private counterpart of a [`HsIdKeyKey’].
HsIntroPtSessionIdKey 🔒
A key used to identify and authenticate an onion service at a single introduction point. (KP_hs_ipt_sid)
HsIntroPtSessionIdKeypair 🔒
The private counterpart of a [`HsIntroPtSessionIdKeyKey’].
HsNickname 🔒
Nickname (local identifier) for a Tor hidden service
HsSvcNtorKeypair 🔒
A pair of a public and private components for a [HsSvcNtorKey].
InstanceRawSubdir 🔒
Subdirectory within an instance’s state, for raw filesystem operations
Instant 🔒
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
KeyMgr 🔒
A key manager that acts as a frontend to a primary Keystore and any number of secondary Keystores.
LockFileGuard 🔒
A lock-file for which we hold the lock.
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.
OpenOptions 🔒
Options and flags which can be used to configure how a file is opened.
OsStr 🔒
Borrowed reference to an OS string (see OsString).
OwnedChanTargetBuilder 🔒
Builder for OwnedChanTarget.
OwnedCircTarget 🔒
OwnedCircTarget is a summary of a CircTarget that owns all its members.
Path 🔒
A slice of a path (akin to str).
PathBuf 🔒
An owned, mutable path (akin to String).
PhantomData 🔒
Zero-sized type used to mark things that “act like” they own a T.
Relay 🔒
A view of a relay on the Tor network, suitable for building circuits.
RelayIds 🔒
RelayIds is an owned copy of the set of known identities of a relay.
RequestFailedError 🔒
An error that has occurred after we have contacted a directory cache and made a circuit to it.
RetryDelay 🔒
An implementation for retrying a remote operation based on a decorrelated jitter schedule.
RetryError 🔒
An error type for use when we’re going to do something a few times, and they might all fail.
RevisionCounter 🔒
Counts which revision of an onion service descriptor is which, within a given time period.
Slug 🔒
An owned slug, checked for syntax
SpawnError 🔒
An error that occurred during spawning.
StateDirectory 🔒
The whole program’s state directory
SystemTime 🔒
A measurement of the system clock, useful for talking to external entities like the file system or other processes.
TimePeriod 🔒
A period of time, as used in the onion service system.
VecDeque 🔒
A double-ended queue implemented with a growable ring buffer.

Enums§

AnyRelayMsg 🔒
A single parsed relay message, sent or received along a circuit
ConfigBuildError 🔒
An error related to an option passed to Arti via a configuration builder.
Cow 🔒
A clone-on-write smart pointer.
DirClientError 🔒
An error originating from the tor-dirclient crate.
Either 🔒
Combines two different futures, streams, or sinks having the same associated types into a single type.
ErrorKind 🔒
Classification of an error arising from Arti’s Tor operations
HsCircKind 🔒
The (onion-service-related) purpose for which a given circuit is going to be used.
KeystoreSelector 🔒
Specifies which keystores a KeyMgr operation should apply to.
MetaCellDisposition 🔒
A possible successful outcome of giving a message to a MsgHandler.
Ordering 🔒
An Ordering is the result of a comparison between two values.
Reconfigure 🔒
Rules for reconfiguring a running Arti instance.
ReconfigureError 🔒
An error caused when attempting to reconfigure an existing Arti client, or one of its modules.
SeekFrom 🔒
Enumeration of possible methods to seek within an I/O object.
Timeliness 🔒
How “timely” must a network directory be?
Void 🔒
The empty type for cases which can’t occur.

Traits§

Any 🔒
A trait to emulate dynamic typing.
AsyncRead 🔒
Read bytes asynchronously.
AsyncWrite 🔒
Write bytes asynchronously.
CircTarget 🔒
Information about a Tor relay used to extend a circuit to it.
CryptoRng 🔒
A marker trait over RngCore for securely unpredictable RNGs
Debug 🔒
? formatting.
Deserialize 🔒
A data structure that can be deserialized from any data format supported by Serde.
Deserializer 🔒
A data format that can deserialize any data structure supported by Serde.
Display 🔒
Format trait for an empty format, {}.
FromStr 🔒
Parse a value from a string
Future 🔒
A future represents an asynchronous computation obtained by use of async.
HasKind 🔒
Errors that can be categorized as belonging to an ErrorKind
Hash 🔒
A hashable type.
KeySpecifier 🔒
The “specifier” of a key, which identifies an instance of a key.
KeySpecifierComponent 🔒
A trait for serializing and deserializing specific types of Slugs.
KeySpecifierComponentViaDisplayFromStr 🔒
Implement KeySpecifierComponent in terms of Display and FromStr (helper trait)
NetDirProvider 🔒
An object that can provide [NetDir]s, as well as inform consumers when they might have changed.
NetdocBuilder 🔒
A trait for building and signing netdocs.
Read 🔒
The Read trait allows for reading bytes from a source.
Rng 🔒
User-level interface for RNGs
RngCore 🔒
Implementation-level interface for RNGs
Runtime 🔒
A runtime for use by Tor client library code.
Seek 🔒
The Seek trait provides a cursor which can be moved within a stream of bytes.
Serialize 🔒
A data structure that can be serialized into any data format supported by Serde.
Serializer 🔒
A data format that can serialize any data structure supported by Serde.
SleepProvider 🔒
Trait for a runtime that can wait until a timer has expired.
StdError 🔒
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>.
Stream 🔒
A stream of values produced asynchronously.
Write 🔒
A trait for objects which are byte-oriented sinks.
_ 🔒
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.
_ 🔒
Adapters specific to Result-returning streams
_ 🔒
An Iterator blanket implementation that provides extra adaptors and methods.
_ 🔒
Extensions to Result<Void, E>
_ 🔒
A redactable object is one where we know a way to display part of it when we are running with safe logging enabled.
_ 🔒
Extension trait for some postage::watch::Sender to provide maybe_send
_ 🔒
Renaming of Path::display as display_lossy
_ 🔒
Extension trait to provide .gen_range_checked()
_ 🔒
Trait implemented by anything that can serve as a relay message.
_ 🔒
Extension trait providing .report() method on concrete errors
_ 🔒
A pattern specifying some or all of a kind of key
_ 🔒
An object containing information about a relay’s identity keys.
_ 🔒
Objects that co-own a lock on an instance
_ 🔒
An extension trait on SleepProvider for timeouts and clock delays.

Functions§

chain 🔒
Takes two iterables and creates a new iterator over both in sequence.
create_desc_sign_key_cert 🔒
Create the descriptor signing key certificate.
max 🔒
Compares and returns the maximum of two values.
mpsc_channel_no_memquota 🔒
Precisely futures::channel::mpsc::channel
send_request 🔒
Fetch or upload a Tor directory object using the provided stream.
sensitive 🔒
Wrap a value as Sensitive.

Type Aliases§

BoxStream 🔒
An owned dynamically typed Stream for use in cases where you can’t statically type your result or need to add some indirection.

Attribute Macros§

async_trait 🔒

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 🔒
From 🔒
What #[derive(From)] generates
Hash 🔒
Derive macro generating an impl of the trait Hash.
Into 🔒
What #[derive(Into)] generates
Serialize 🔒