pub struct AddressSpaceManagerBuilder<'a, I: Iterator<Item = MemoryRange>> {
manager: &'a mut AddressSpaceManager,
vtl2_ram: &'a [MemoryEntry],
bootshim_used: MemoryRange,
vtl2_config: I,
reserved_range: Option<MemoryRange>,
sidecar_image: Option<MemoryRange>,
page_tables: Option<MemoryRange>,
}
Expand description
A builder used to initialize an AddressSpaceManager
.
Fields§
§manager: &'a mut AddressSpaceManager
§vtl2_ram: &'a [MemoryEntry]
§bootshim_used: MemoryRange
§vtl2_config: I
§reserved_range: Option<MemoryRange>
§sidecar_image: Option<MemoryRange>
§page_tables: Option<MemoryRange>
Implementations§
Source§impl<'a, I: Iterator<Item = MemoryRange>> AddressSpaceManagerBuilder<'a, I>
impl<'a, I: Iterator<Item = MemoryRange>> AddressSpaceManagerBuilder<'a, I>
Sourcepub fn new(
manager: &'a mut AddressSpaceManager,
vtl2_ram: &'a [MemoryEntry],
bootshim_used: MemoryRange,
vtl2_config: I,
) -> AddressSpaceManagerBuilder<'a, I>
pub fn new( manager: &'a mut AddressSpaceManager, vtl2_ram: &'a [MemoryEntry], bootshim_used: MemoryRange, vtl2_config: I, ) -> AddressSpaceManagerBuilder<'a, I>
Create a new builder to initialize an AddressSpaceManager
.
vtl2_ram
is the list of ram ranges for VTL2, which must be sorted.
bootshim_used
is the range used by the bootshim, but may be reclaimed
as ram by the kernel.
Other ranges described by other methods must lie within bootshim_used
.
Sourcepub fn with_reserved_range(self, reserved_range: MemoryRange) -> Self
pub fn with_reserved_range(self, reserved_range: MemoryRange) -> Self
A reserved range reported as type [MemoryVtlType::VTL2_RESERVED
].
Sourcepub fn with_sidecar_image(self, sidecar_image: MemoryRange) -> Self
pub fn with_sidecar_image(self, sidecar_image: MemoryRange) -> Self
The sidecar image, reported as type [MemoryVtlType::VTL2_SIDECAR_IMAGE
].
Sourcepub fn with_page_tables(self, page_tables: MemoryRange) -> Self
pub fn with_page_tables(self, page_tables: MemoryRange) -> Self
Pagetables that are reported as type [MemoryVtlType::VTL2_TDX_PAGE_TABLES
].
Sourcepub fn init(self) -> Result<&'a mut AddressSpaceManager, Error>
pub fn init(self) -> Result<&'a mut AddressSpaceManager, Error>
Consume the builder and initialize the address space manager.
Auto Trait Implementations§
impl<'a, I> Freeze for AddressSpaceManagerBuilder<'a, I>where
I: Freeze,
impl<'a, I> RefUnwindSafe for AddressSpaceManagerBuilder<'a, I>where
I: RefUnwindSafe,
impl<'a, I> Send for AddressSpaceManagerBuilder<'a, I>where
I: Send,
impl<'a, I> Sync for AddressSpaceManagerBuilder<'a, I>where
I: Sync,
impl<'a, I> Unpin for AddressSpaceManagerBuilder<'a, I>where
I: Unpin,
impl<'a, I> !UnwindSafe for AddressSpaceManagerBuilder<'a, I>
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