IdentifierPacket

Trait IdentifierPacket 

Source
pub trait IdentifierPacket:
    Sized
    + Send
    + 'static {
    // Required methods
    fn id(&self) -> &str;
    fn from_slice<'life0, 'life1, 'async_trait>(
        src: &'life0 mut Cursor<&'life1 [u8]>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn into_bytes(self) -> Vec<u8> ;
}

Required Methods§

Source

fn id(&self) -> &str

Source

fn from_slice<'life0, 'life1, 'async_trait>( src: &'life0 mut Cursor<&'life1 [u8]>, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

return Ok(None) if need more bytes

Source

fn into_bytes(self) -> Vec<u8>

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§