Skip to main content

WireDecode

Trait WireDecode 

Source
pub trait WireDecode: Sized {
    // Required method
    fn wire_decode(data: &[u8]) -> Option<(Self, usize)>;
}
Expand description

Decode a value from a byte slice in conduit’s binary wire format.

Returns the decoded value together with the number of bytes consumed, or None if the data is too short or malformed.

Required Methods§

Source

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Attempt to decode from the start of data.

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.

Implementations on Foreign Types§

Source§

impl WireDecode for bool

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for f32

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for f64

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for i8

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for i16

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for i32

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for i64

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for u8

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for u16

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for u32

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for u64

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for String

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Source§

impl WireDecode for Vec<u8>

Source§

fn wire_decode(data: &[u8]) -> Option<(Self, usize)>

Implementors§