pub struct BounceBuffer { /* private fields */ }Expand description
A page-aligned temporary buffer used to double-buffer IO data.
When guest-provided buffers are not aligned to the disk’s sector size
(or when the PagedRange constraints prevent direct IO), data is
copied through a BounceBuffer:
- Reads: IO is performed into the bounce buffer, then copied to
guest memory via
RequestBuffers::writer(). - Writes: Data is copied from guest memory via
RequestBuffers::reader()into the bounce buffer, then IO is performed from the bounce buffer.
The buffer is always page-aligned (4096 bytes), satisfying the alignment requirements of O_DIRECT and io_uring.
Implementations§
Source§impl BounceBuffer
impl BounceBuffer
Sourcepub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
Returns the bounce buffer memory.
Auto Trait Implementations§
impl Freeze for BounceBuffer
impl RefUnwindSafe for BounceBuffer
impl Send for BounceBuffer
impl Sync for BounceBuffer
impl Unpin for BounceBuffer
impl UnwindSafe for BounceBuffer
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