Skip to main content

TryFromBeBytes

Trait TryFromBeBytes 

Source
pub trait TryFromBeBytes: Sized {
    const SIZE: usize;

    // Required method
    fn try_parse_from_be_bytes(data: &[u8]) -> Option<Self>;
}
Expand description

A trait for parsing raw binary data of fixed size.

This is a low-level, internal trait that should not be used directly.

Required Associated Constants§

Source

const SIZE: usize

Object’s raw data size.

Not always the same as mem::size_of.

Required Methods§

Source

fn try_parse_from_be_bytes(data: &[u8]) -> Option<Self>

Parses an object from a raw data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TryFromBeBytes for ()

Source§

impl TryFromBeBytes for i8

Source§

impl TryFromBeBytes for i16

Source§

impl TryFromBeBytes for i32

Source§

impl TryFromBeBytes for i64

Source§

impl TryFromBeBytes for u8

Source§

impl TryFromBeBytes for u16

Source§

impl TryFromBeBytes for u32

Source§

impl TryFromBeBytes for u64

Implementors§