pub trait MessageProtocolApi{
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§
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>>
Trait Implementations§
Source§impl AsyncWrite for dyn MessageProtocolApi + Unpin + Send + Sync
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>>
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 moreSource§fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
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>>
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>>
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 moreSource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read more