Trait guestmem::MemoryRead

source ·
pub trait MemoryRead {
    // Required methods
    fn read(&mut self, data: &mut [u8]) -> Result<&mut Self, AccessError>;
    fn skip(&mut self, len: usize) -> Result<&mut Self, AccessError>;
    fn len(&self) -> usize;

    // Provided methods
    fn read_plain<T: AsBytes + FromBytes>(&mut self) -> Result<T, AccessError> { ... }
    fn read_n<T: AsBytes + FromBytes + Copy>(
        &mut self,
        len: usize,
    ) -> Result<Vec<T>, AccessError> { ... }
    fn read_all(&mut self) -> Result<Vec<u8>, AccessError> { ... }
    fn limit(self, len: usize) -> Limit<Self>
       where Self: Sized { ... }
}

Required Methods§

source

fn read(&mut self, data: &mut [u8]) -> Result<&mut Self, AccessError>

source

fn skip(&mut self, len: usize) -> Result<&mut Self, AccessError>

source

fn len(&self) -> usize

Provided Methods§

source

fn read_plain<T: AsBytes + FromBytes>(&mut self) -> Result<T, AccessError>

source

fn read_n<T: AsBytes + FromBytes + Copy>( &mut self, len: usize, ) -> Result<Vec<T>, AccessError>

source

fn read_all(&mut self) -> Result<Vec<u8>, AccessError>

source

fn limit(self, len: usize) -> Limit<Self>
where Self: Sized,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MemoryRead for &[u8]

source§

fn read(&mut self, data: &mut [u8]) -> Result<&mut Self, AccessError>

source§

fn skip(&mut self, len: usize) -> Result<&mut Self, AccessError>

source§

fn len(&self) -> usize

Implementors§