pub struct VirtualMemory<T> { /* private fields */ }Implementations§
Source§impl<T: Copy + Default> VirtualMemory<T>
impl<T: Copy + Default> VirtualMemory<T>
pub fn new(memory_size: usize, segment_size: usize) -> Self
Sourcepub fn iter(&self) -> impl Iterator<Item = &T>
pub fn iter(&self) -> impl Iterator<Item = &T>
Returns an iterator over values in mapped memory segments.
Note that the iterator does not cover un-mapped segments (i.e. segments that have not been
written to before). This essentially skips over segments that would exclusively contain
[T::default()] values. It also means that iteration likely yields fewer elements than
calls of [size()] report.
pub fn size(&self) -> usize
Trait Implementations§
Source§impl<T: Clone> Clone for VirtualMemory<T>
impl<T: Clone> Clone for VirtualMemory<T>
Source§fn clone(&self) -> VirtualMemory<T>
fn clone(&self) -> VirtualMemory<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for VirtualMemory<T>
impl<T: Debug> Debug for VirtualMemory<T>
Auto Trait Implementations§
impl<T> Freeze for VirtualMemory<T>where
T: Freeze,
impl<T> RefUnwindSafe for VirtualMemory<T>where
T: RefUnwindSafe,
impl<T> Send for VirtualMemory<T>where
T: Send,
impl<T> Sync for VirtualMemory<T>where
T: Sync,
impl<T> Unpin for VirtualMemory<T>where
T: Unpin,
impl<T> UnwindSafe for VirtualMemory<T>where
T: UnwindSafe,
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