Skip to main content

ChannelProvider

Trait ChannelProvider 

Source
pub trait ChannelProvider {
    type BuildSpec: HasRelayIds;

    // Required method
    fn get_or_launch(
        self: Arc<Self>,
        reactor_id: UniqId,
        target: Self::BuildSpec,
        tx: OutboundChanSender,
    ) -> Result<()>;
}
Expand description

An object that can fulfill outbound channel requests issued by the relay circuit reactor.

The implementor is responsible for imposing a limit on the number of outbound channels that can be opened on a given circuit.

Required Associated Types§

Source

type BuildSpec: HasRelayIds

Type that explains how to build an outgoing channel.

Required Methods§

Source

fn get_or_launch( self: Arc<Self>, reactor_id: UniqId, target: Self::BuildSpec, tx: OutboundChanSender, ) -> Result<()>

Get a channel corresponding to the identities of target, for the circuit reactor with the specified reactor_id which should only be used for logging purposes.

Returns the requested channel via the specified OutboundChanSender.

Implementors§