Module tor_circmgr::mgr
source Β· Expand description
Abstract code to manage a set of circuits.
This module implements the real logic for deciding when and how to launch circuits, and for which circuits to hand out in response to which requests.
For testing and abstraction purposes, this module does not actually know anything about circuits per se. Instead, everything is handled using a set of traits that are internal to this crate:
AbstractCirc
is a view of a circuit.AbstractSpec
represents a circuitβs possible usages.AbstractCircBuilder
knows how to build anAbstractCirc
.
Using these traits, the AbstractCircMgr
object manages a set of
circuits, launching them as necessary, and keeping track of the
restrictions on their use.
Modules§
- streams πStream utilities to help implement
AbstractCircMgr
Structs§
- AbstractCircMgr πAbstract implementation for circuit management.
- CircBuildPlan πWrapper type to represent the state between planning to build a circuit and constructing it.
- CircList πThe inner state of an
AbstractCircMgr
. - OpenEntry πAn entry for an open circuit held by an
AbstractCircMgr
. - PendingEntry πAn entry for an under-construction in-progress circuit tracked by an
AbstractCircMgr
. - PendingRequest πAn in-progress circuit request tracked by an
AbstractCircMgr
. - UnusedTimings πTiming information for circuits that have been built but never used.
Enums§
- Action πAn action to take in order to satisfy a request for a circuit.
- CircProvenance πDescription of how we got a circuit.
- ExpirationInfo πEnumeration to track the expiration state of a circuit.
- An error type returned by
AbstractSpec::restrict_mut
Traits§
- AbstractCirc πMinimal abstract view of a circuit.
- AbstractCircBuilder πAn object that knows how to build circuits.
- AbstractSpec πRepresents restrictions on circuit usage.
- MockablePlan πA plan for an
AbstractCircBuilder
that can maybe be mutated by tests.
Functions§
- Default implementation of
AbstractSpec::find_supported
; provided as a separate function so it can be used in overridden implementations. - Spawn an expiration task that expires a circuit at given instant.
Type Aliases§
- PendResult πA result type whose βOkβ value is the Id for a circuit from B.