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§
fn id(&self) -> &str
Sourcefn 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 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
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.