Struct OutgoingMultiChannel

Source
pub struct OutgoingMultiChannel<P, R> { /* private fields */ }
Expand description

An OutgoingMultiChannel is established for each outgoing TCP connection. The local party will be the client of the remote server.

The mux part listens to multiple sessions initiated by this side and relay their messages to the common outgoing channel.

The demux part listens to the incoming replies from the server on the connection and dispatches the messages to their corresponding protocol handlers.

Implementations§

Source§

impl<P: Ord + Copy, R: 'static + Send + Sync> OutgoingMultiChannel<P, R>

Source

pub fn new( tx: Sender<MultiMessage<P, R>>, rx: Receiver<MultiMessage<P, R>>, ) -> Self

Create a new MultiChannel by passing it the channels it can use to send/receive messages to/from the underlying network connection.

Source

pub fn control(&self) -> Control<P, R>

Get a handler that can be used to send signals to the channel.

Call this before the channel is run.

Source

pub async fn run(self)

Start consuming messages from the remote server, relaying them to the local client side of the protocols.

We must also listen to an internal channel that signals the abortion of the whole connection due to some protocol violation.

Yet another internal channel must be used to receive registration requests.

Auto Trait Implementations§

§

impl<P, R> Freeze for OutgoingMultiChannel<P, R>

§

impl<P, R> RefUnwindSafe for OutgoingMultiChannel<P, R>
where P: RefUnwindSafe,

§

impl<P, R> Send for OutgoingMultiChannel<P, R>
where P: Send, R: Send,

§

impl<P, R> Sync for OutgoingMultiChannel<P, R>
where P: Sync + Send, R: Send,

§

impl<P, R> Unpin for OutgoingMultiChannel<P, R>

§

impl<P, R> UnwindSafe for OutgoingMultiChannel<P, R>
where P: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.