pub(crate) trait Buildable: Sized {
type Chan: Send + Sync;
// Required methods
fn open_channel<'life0, 'life1, 'life2, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
ct: &'life1 OwnedChanTarget,
guard_status: &'life2 GuardStatusHandle,
usage: ChannelUsage,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::Chan>>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn create_chantarget<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedChanTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedCircTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn extend<'life0, 'life1, 'life2, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: CircParameters,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Represents an objects that can be constructed in a circuit-like way.
This is only a separate trait for testing purposes, so that we can swap our some other type when we’re testing Builder.
TODO: I’d like to have a simpler testing strategy here; this one complicates things a bit.
Required Associated Types§
Required Methods§
Sourcefn open_channel<'life0, 'life1, 'life2, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
ct: &'life1 OwnedChanTarget,
guard_status: &'life2 GuardStatusHandle,
usage: ChannelUsage,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::Chan>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn open_channel<'life0, 'life1, 'life2, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
ct: &'life1 OwnedChanTarget,
guard_status: &'life2 GuardStatusHandle,
usage: ChannelUsage,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::Chan>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Use a channel manager to open a new channel (or find an existing channel)
to a provided [OwnedChanTarget
].
Sourcefn create_chantarget<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedChanTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_chantarget<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedChanTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Launch a new one-hop circuit to a given relay, given only a
channel target ct
specifying that relay.
(Since we don’t have a CircTarget here, we can’t extend the circuit to be multihop later on.)
Sourcefn create<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedCircTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait, RT>(
chan: Arc<Self::Chan>,
rt: &'life0 RT,
ct: &'life1 OwnedCircTarget,
params: CircParameters,
timeouts: Arc<dyn TimeoutEstimator>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Launch a new circuit through a given relay, given a circuit target
ct
specifying that relay.
Sourcefn extend<'life0, 'life1, 'life2, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: CircParameters,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn extend<'life0, 'life1, 'life2, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: CircParameters,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Extend this circuit-like object by one hop, to the location described
in ct
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.