Skip to content

Commit ca719de

Browse files
committed
Enhance the GuestMemory trait to support Clone
Enhance the GuestMemory trait to support Clone, so guest memory consumers could hold a local guest memory object by calling guest_memory.clone(). Signed-off-by: Liu Jiang <[email protected]>
1 parent a5ef4b7 commit ca719de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/guest_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub trait GuestMemoryRegion: Bytes<MemoryRegionAddress, E = Error> {
193193
/// - handle cases where an access request spanning two or more GuestMemoryRegion objects.
194194
///
195195
/// Note: all regions in a GuestMemory object must not intersect with each other.
196-
pub trait GuestMemory<'a> {
196+
pub trait GuestMemory<'a>: Clone {
197197
/// True if the guest memory is mapped into the current process and supports direct access.
198198
const DIRECT_ACCESS: bool = Self::R::DIRECT_ACCESS;
199199

0 commit comments

Comments
 (0)