Trait tor_circmgr::build::Buildable
source · pub(crate) trait Buildable: Sized {
// Required methods
fn create_chantarget<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedChanTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn create<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedCircTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>
where RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn extend<'life0, 'life1, 'life2, 'life3, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: &'life3 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,
'life3: '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 Methods§
sourcefn create_chantarget<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedChanTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn create_chantarget<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedChanTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: '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, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedCircTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn create<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, RT>(
chanmgr: &'life0 ChanMgr<RT>,
rt: &'life1 RT,
guard_status: &'life2 GuardStatusHandle,
ct: &'life3 OwnedCircTarget,
params: &'life4 CircParameters,
usage: ChannelUsage
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>>> + Send + 'async_trait>>where
RT: 'async_trait + Runtime,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Launch a new circuit through a given relay, given a circuit target
ct
specifying that relay.
sourcefn extend<'life0, 'life1, 'life2, 'life3, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: &'life3 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,
'life3: 'async_trait,
fn extend<'life0, 'life1, 'life2, 'life3, 'async_trait, RT>(
&'life0 self,
rt: &'life1 RT,
ct: &'life2 OwnedCircTarget,
params: &'life3 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,
'life3: 'async_trait,
Extend this circuit-like object by one hop, to the location described
in ct
.
Object Safety§
This trait is not object safe.