Channel

Trait Channel 

Source
pub trait Channel: ChannelError + for<'a> ChannelFuture<'a> {
    // Required methods
    fn send<'a, S, P>(
        &'a mut self,
        packet: P,
        scope: &'a Scope<'_>,
    ) -> <Self as ChannelFuture<'a>>::Send
       where S: Schema,
             P: Pack<S>;
    fn send_reliable<'a, S, P>(
        &'a mut self,
        packet: P,
        scope: &'a Scope<'_>,
    ) -> <Self as ChannelFuture<'a>>::Send
       where S: Schema,
             P: Pack<S>;
    fn recv_ready(&mut self) -> <Self as ChannelFuture<'_>>::Ready;
    fn recv<'a, S>(
        &mut self,
        scope: &'a Scope<'_>,
    ) -> Result<Option<Unpacked<'a, S>>, Self::Error>
       where S: Schema;
}
Expand description

Abstract raw bytes channel that can be used by evoke sessions.

Required Methods§

Source

fn send<'a, S, P>( &'a mut self, packet: P, scope: &'a Scope<'_>, ) -> <Self as ChannelFuture<'a>>::Send
where S: Schema, P: Pack<S>,

Attempts to send packet through the channel unreliably. Packet either arrives complete or lost.

Source

fn send_reliable<'a, S, P>( &'a mut self, packet: P, scope: &'a Scope<'_>, ) -> <Self as ChannelFuture<'a>>::Send
where S: Schema, P: Pack<S>,

Attempts to send packet through the channel reliabliy. Packet will arrive unless channel connection is lost.

Source

fn recv_ready(&mut self) -> <Self as ChannelFuture<'_>>::Ready

Waits until channel is ready for recv call.

Source

fn recv<'a, S>( &mut self, scope: &'a Scope<'_>, ) -> Result<Option<Unpacked<'a, S>>, Self::Error>
where S: Schema,

Attempts to receive packet from the channel. If no new packets arrived Ok(None) is returned.

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.

Implementors§