[][src]Trait gdbstub::internal::BeBytes

pub trait BeBytes: Sized {
    fn to_be_bytes(self, buf: &mut [u8]) -> Option<usize>;
fn from_be_bytes(buf: &[u8]) -> Option<Self>; }

A trait for working with structs as big-endian byte arrays. Automatically implemented for all built-in signed/unsigned integers.

Required methods

fn to_be_bytes(self, buf: &mut [u8]) -> Option<usize>

Write the memory representation of self as a byte array in big-endian (network) byte order into the provided buffer.

fn from_be_bytes(buf: &[u8]) -> Option<Self>

Parse self from a byte array in big-endian (network) byte order. Returns None upon overflow.

Loading content...

Implementations on Foreign Types

impl BeBytes for u8[src]

impl BeBytes for u16[src]

impl BeBytes for u32[src]

impl BeBytes for u64[src]

impl BeBytes for u128[src]

impl BeBytes for usize[src]

impl BeBytes for i8[src]

impl BeBytes for i16[src]

impl BeBytes for i32[src]

impl BeBytes for i64[src]

impl BeBytes for i128[src]

impl BeBytes for isize[src]

Loading content...

Implementors

Loading content...