Struct devices::virtio::media::GuestMemoryShadowMapping
source · struct GuestMemoryShadowMapping {
data: Vec<u8>,
mem: GuestMemory,
sgs: Vec<SgEntry>,
dirty: bool,
}
Expand description
Copy of sparse guest memory that is written back upon destruction.
Contrary to GuestMemoryMapping
which re-maps guest memory to make it appear linear to the
host, this copies the sparse guest memory into a linear vector that is copied back upon
destruction. Doing so can be faster than a costly mapping operation if the guest area is small
enough.
Fields§
§data: Vec<u8>
Sparse data copied from the guest.
mem: GuestMemory
Guest memory to read from.
sgs: Vec<SgEntry>
SG entries describing the sparse guest area.
dirty: bool
Whether the data has potentially been modified and requires to be written back to the guest.
Implementations§
source§impl GuestMemoryShadowMapping
impl GuestMemoryShadowMapping
fn new(mem: &GuestMemory, sgs: Vec<SgEntry>) -> Result<Self>
Trait Implementations§
source§impl Drop for GuestMemoryShadowMapping
impl Drop for GuestMemoryShadowMapping
Write the potentially modified shadow buffer back into the guest memory.
Auto Trait Implementations§
impl RefUnwindSafe for GuestMemoryShadowMapping
impl Send for GuestMemoryShadowMapping
impl Sync for GuestMemoryShadowMapping
impl Unpin for GuestMemoryShadowMapping
impl UnwindSafe for GuestMemoryShadowMapping
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.