Settings
Help

Buildable

Trait Buildable 

Source
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§

Source

type Chan: Send + Sync

Our equivalent to a tor_proto::Channel.

Required Methods§

Source

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].

Source

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.)

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl Buildable for ClientTunnel

Source§

type Chan = Channel

Source§

fn open_channel<'life0, 'life1, 'life2, 'async_trait, RT>( chanmgr: &'life0 ChanMgr<RT>, target: &'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,

Source§

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,

Source§

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,

Source§

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,

Implementors§