pub struct VolatileSliceGuard<'a, PtrGuardType, BitmapType: Bitmap> {
_ptr_guards: Vec<PtrGuardType>,
dirty_on_drop: Option<Vec<(&'a BitmapType, usize)>>,
}
Expand description
Ensures an I/O vector’s validity when created from [VolatileSlice]
.
[VolatileSlice]
arrays may require being explicitly mapped before use (and unmapped after),
and this guard ensures that the memory is mapped until it is dropped.
Further, for mutable vectors (IoVectorMut
), it will also dirty the corresponding bitmap
slices when dropped, assuming the whole vector has been written.
Fields§
§_ptr_guards: Vec<PtrGuardType>
vm-memory’s pointer guards ensuring the memory remains mapped while used.
dirty_on_drop: Option<Vec<(&'a BitmapType, usize)>>
If given, mark the given dirty bitmap range as dirty when dropping this guard.
.1
is the length of the respective VolatileSlice
(i.e. the length of the area to
dirty).
Trait Implementations§
Auto Trait Implementations§
impl<'a, PtrGuardType, BitmapType> Freeze for VolatileSliceGuard<'a, PtrGuardType, BitmapType>
impl<'a, PtrGuardType, BitmapType> RefUnwindSafe for VolatileSliceGuard<'a, PtrGuardType, BitmapType>where
PtrGuardType: RefUnwindSafe,
BitmapType: RefUnwindSafe,
impl<'a, PtrGuardType, BitmapType> Send for VolatileSliceGuard<'a, PtrGuardType, BitmapType>
impl<'a, PtrGuardType, BitmapType> Sync for VolatileSliceGuard<'a, PtrGuardType, BitmapType>
impl<'a, PtrGuardType, BitmapType> Unpin for VolatileSliceGuard<'a, PtrGuardType, BitmapType>where
PtrGuardType: Unpin,
impl<'a, PtrGuardType, BitmapType> UnwindSafe for VolatileSliceGuard<'a, PtrGuardType, BitmapType>where
PtrGuardType: UnwindSafe,
BitmapType: RefUnwindSafe,
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