Skip to main content

FixedLengthFromBytes

Trait FixedLengthFromBytes 

Source
pub trait FixedLengthFromBytes<const N: usize>: Sized {
    // Required method
    fn from_bytes(bytes: &[u8]) -> Result<Self>;
}

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self>

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 FixedLengthFromBytes<0> for ()

Source§

fn from_bytes(_: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<1> for i8

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<1> for u8

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<2> for i16

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<2> for u16

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<4> for f32

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<4> for i32

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<4> for u32

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<8> for f64

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<8> for i64

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl FixedLengthFromBytes<8> for u64

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Source§

impl<const N: usize> FixedLengthFromBytes<N> for [u8; N]

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self>

Implementors§