pub struct TestMapper { /* private fields */ }
Expand description
A mapper that uses an internal buffer to map pages. This is meant to be used
for tests that use PagePool
.
Implementations§
Source§impl TestMapper
impl TestMapper
Sourcepub fn new(size_pages: u64) -> Result<Self>
pub fn new(size_pages: u64) -> Result<Self>
Create a new test mapper that holds an internal buffer of size_pages
.
Sourcepub fn sparse_mapping(&self) -> SparseMapping
pub fn sparse_mapping(&self) -> SparseMapping
Returns SparseMapping
that maps starting at page 0.
Trait Implementations§
Source§impl PoolSource for TestMapper
impl PoolSource for TestMapper
Source§fn address_bias(&self) -> u64
fn address_bias(&self) -> u64
The bias to apply to the physical address of each allocation.
Source§fn file_offset(&self, address: u64) -> u64
fn file_offset(&self, address: u64) -> u64
Translates a physical address into the file offset to use when mapping
the page.
Source§fn mappable(&self) -> MappableRef<'_>
fn mappable(&self) -> MappableRef<'_>
Returns the OS object to map pages from.
Auto Trait Implementations§
impl Freeze for TestMapper
impl RefUnwindSafe for TestMapper
impl Send for TestMapper
impl Sync for TestMapper
impl Unpin for TestMapper
impl UnwindSafe for TestMapper
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