snarkvm_utilities::bytes

Trait FromBytes

Source
pub trait FromBytes {
    // Required method
    fn read_le<R: Read>(reader: R) -> IoResult<Self>
       where Self: Sized;

    // Provided method
    fn from_bytes_le(bytes: &[u8]) -> Result<Self>
       where Self: Sized { ... }
}

Required Methods§

Source

fn read_le<R: Read>(reader: R) -> IoResult<Self>
where Self: Sized,

Reads Self from reader as little-endian bytes.

Provided Methods§

Source

fn from_bytes_le(bytes: &[u8]) -> Result<Self>
where Self: Sized,

Returns Self from a byte array in little-endian order.

Implementations on Foreign Types§

Source§

impl FromBytes for SocketAddr

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for bool

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for i8

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for i16

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for i32

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for i64

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for i128

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for u8

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for u16

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for u32

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for u64

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for u128

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl FromBytes for ()

Source§

fn read_le<R: Read>(_bytes: R) -> IoResult<Self>

Source§

impl<L: FromBytes, R: FromBytes> FromBytes for (L, R)

Source§

fn read_le<Reader: Read>(reader: Reader) -> IoResult<Self>

Source§

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

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl<const N: usize> FromBytes for [u16; N]

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl<const N: usize> FromBytes for [u32; N]

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Source§

impl<const N: usize> FromBytes for [u64; N]

Source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Implementors§