pub struct GuestMemorySharing { /* private fields */ }Expand description
Opaque control object for accessing the shareable backing of guest
memory. Not all GuestMemory instances support this — those backed
by private memory or heap allocations return None.
§Contract
- The regions returned by
get_regionsmust have fully committed backing — the consumer will map them directly, without guestmem-managed fault handling. - The set of regions is currently static for the lifetime of the VM. Hotplug and hot-remove of shareable regions are not yet supported; once they are, additional methods will be added here to notify consumers of changes.
Implementations§
Source§impl GuestMemorySharing
impl GuestMemorySharing
Sourcepub fn new(inner: impl ProvideShareableRegions + 'static) -> Self
pub fn new(inner: impl ProvideShareableRegions + 'static) -> Self
Construct from a trait implementation. Called by GuestMemoryAccess
implementations (e.g., VaMapper in membacking).
Sourcepub async fn get_regions(
&self,
) -> Result<Vec<ShareableRegion>, ShareableRegionError>
pub async fn get_regions( &self, ) -> Result<Vec<ShareableRegion>, ShareableRegionError>
Return the current set of shareable backing regions.
Auto Trait Implementations§
impl Freeze for GuestMemorySharing
impl !RefUnwindSafe for GuestMemorySharing
impl Send for GuestMemorySharing
impl Sync for GuestMemorySharing
impl Unpin for GuestMemorySharing
impl !UnwindSafe for GuestMemorySharing
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