MessageProtocolApi

Trait MessageProtocolApi 

Source
pub trait MessageProtocolApi
where Self: Debug + Send + Sync,
{
Show 13 methods // Required methods fn write_with_fixed_16bit_header<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 [u8], delay_flush: bool, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn write_with_fixed_32bit_header<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 [u8], delay_flush: bool, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, wire_encryption: &'life1 Option<EncryptKey>, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn read_with_fixed_16bit_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read_with_fixed_32bit_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read_buf_with_header<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, wire_encryption: &'life1 Option<EncryptKey>, total_read: &'life2 mut u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn flush<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn split(&mut self, ek: Option<EncryptKey>) -> (StreamRx, StreamTx); fn rx( &mut self, ) -> Option<&mut (dyn AsyncRead + Send + Sync + Unpin + 'static)>; fn tx( &mut self, ) -> Option<&mut (dyn AsyncWrite + Send + Sync + Unpin + 'static)>; fn take_rx( &mut self, ) -> Option<Box<dyn AsyncRead + Send + Sync + Unpin + 'static>>; fn take_tx( &mut self, ) -> Option<Box<dyn AsyncWrite + Send + Sync + Unpin + 'static>>;
}

Required Methods§

Source

fn write_with_fixed_16bit_header<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 [u8], delay_flush: bool, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn write_with_fixed_32bit_header<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 [u8], delay_flush: bool, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, wire_encryption: &'life1 Option<EncryptKey>, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn read_with_fixed_16bit_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn read_with_fixed_32bit_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn read_buf_with_header<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, wire_encryption: &'life1 Option<EncryptKey>, total_read: &'life2 mut u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn flush<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn split(&mut self, ek: Option<EncryptKey>) -> (StreamRx, StreamTx)

Source

fn rx(&mut self) -> Option<&mut (dyn AsyncRead + Send + Sync + Unpin + 'static)>

Source

fn tx( &mut self, ) -> Option<&mut (dyn AsyncWrite + Send + Sync + Unpin + 'static)>

Source

fn take_rx( &mut self, ) -> Option<Box<dyn AsyncRead + Send + Sync + Unpin + 'static>>

Source

fn take_tx( &mut self, ) -> Option<Box<dyn AsyncWrite + Send + Sync + Unpin + 'static>>

Trait Implementations§

Source§

impl AsyncRead for dyn MessageProtocolApi + Unpin + Send + Sync

Source§

fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<()>>

Attempts to read from the AsyncRead into buf. Read more
Source§

impl AsyncWrite for dyn MessageProtocolApi + Unpin + Send + Sync

Source§

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
Source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>

Attempts to flush the object, ensuring that any buffered data reach their destination. Read more
Source§

fn poll_shutdown( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>

Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. Read more
Source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>

Like poll_write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored implementation. Read more

Implementors§