Trait ProtocolObject

Source
pub trait ProtocolObject<'a>: ProtocolObjectInner<'a> {
    // Provided methods
    fn version() -> (u16, u16) { ... }
    fn to_bytes(&self) -> Box<[u8]> { ... }
    fn from_bytes(bytes: &'a [u8]) -> Result<Self, DeserializationError> { ... }
}
Expand description

This is a versioned protocol object.

Provided Methods§

Source

fn version() -> (u16, u16)

supported by the current implementation.

Source

fn to_bytes(&self) -> Box<[u8]>

Serializes the object.

Source

fn from_bytes(bytes: &'a [u8]) -> Result<Self, DeserializationError>

Attempts to deserialize the object.

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§