[][src]Struct loco_protocol::network::ChannelConnection

pub struct ChannelConnection<A: Read + Write> { /* fields omitted */ }

ChannelConnection wrap command stream and process it. The response command will only send to sender channel. If response command doesn't have sender, It will treat as broadcast command and will be sent to every channel attached.

Implementations

impl<A: Read + Write> ChannelConnection<A>[src]

pub fn new(processor: CommandProcessor<A>) -> Self[src]

pub fn processor(&self) -> &CommandProcessor<A>[src]

pub fn channel_map(&self) -> &HashMap<u32, ConnectionChannel>[src]

pub fn create_channel(&mut self) -> ConnectionChannel[src]

Attach channel between instance. The returned ConnectionChannel struct is user side Channel.

pub fn detach_channel(
    &mut self,
    channel: ConnectionChannel
) -> (ConnectionChannel, Option<ConnectionChannel>)
[src]

pub fn process(&mut self) -> Result<(), Error>[src]

Auto Trait Implementations

impl<A> !RefUnwindSafe for ChannelConnection<A>

impl<A> Send for ChannelConnection<A> where
    A: Send

impl<A> !Sync for ChannelConnection<A>

impl<A> Unpin for ChannelConnection<A> where
    A: Unpin

impl<A> !UnwindSafe for ChannelConnection<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.