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§
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,
Object Safety§
This trait is not object safe.