pub struct RequestBuffers<'a> { /* private fields */ }
Expand description
An accessor for the memory associated with an IO request.
Implementations§
Source§impl<'a> RequestBuffers<'a>
impl<'a> RequestBuffers<'a>
Sourcepub fn new(
guest_memory: &'a GuestMemory,
range: PagedRange<'a>,
is_write: bool,
) -> Self
pub fn new( guest_memory: &'a GuestMemory, range: PagedRange<'a>, is_write: bool, ) -> Self
Creates a new request buffer from the given memory ranges.
Sourcepub fn guest_memory(&self) -> &GuestMemory
pub fn guest_memory(&self) -> &GuestMemory
Returns the guest memory accessor.
Sourcepub fn is_aligned(&self, alignment: usize) -> bool
pub fn is_aligned(&self, alignment: usize) -> bool
Returns whether the buffers are all aligned to at least alignment
bytes.
alignment
must be a power of two.
Sourcepub fn writer(&self) -> impl MemoryWrite + '_
pub fn writer(&self) -> impl MemoryWrite + '_
Gets a memory writer for the buffers.
Returns an empty writer if the buffers are only available for read access.
Trait Implementations§
Source§impl<'a> Clone for RequestBuffers<'a>
impl<'a> Clone for RequestBuffers<'a>
Source§fn clone(&self) -> RequestBuffers<'a>
fn clone(&self) -> RequestBuffers<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for RequestBuffers<'a>
impl<'a> !RefUnwindSafe for RequestBuffers<'a>
impl<'a> Send for RequestBuffers<'a>
impl<'a> Sync for RequestBuffers<'a>
impl<'a> Unpin for RequestBuffers<'a>
impl<'a> !UnwindSafe for RequestBuffers<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more