pub struct AnonArea { /* private fields */ }Implementations
sourceimpl AnonArea
impl AnonArea
Anonymous memory which can be shared by multiple threads with RwLock protection. Accesses to memory positions only require read locking for both reads and writes.
pub fn new(size: usize, comp: f64) -> Self
pub fn size(&self) -> usize
pub fn resize(&mut self, size: usize)
sourcepub fn rel_to_page_idx(rel: f64, size: usize) -> usize
pub fn rel_to_page_idx(rel: f64, size: usize) -> usize
Determine the page given the relative position rel and size of
the anon area. rel is in the range [-1.0, 1.0] with the position
0.0 mapping to the first page, positive positions to even slots and
negative odd so that modulating the amplitude of rel changes how
much area is accessed without shifting the center.
sourcepub fn access_page<'a, T>(&'a self, page_idx: usize) -> &'a mut [T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn access_page<'a, T>(&'a self, page_idx: usize) -> &'a mut [T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Return a mutable u8 reference to the position specified by the page index. The anon area is shared and there’s no access control.
pub fn fill_page_with_random(&self, page_idx: usize)
Auto Trait Implementations
impl RefUnwindSafe for AnonArea
impl Send for AnonArea
impl Sync for AnonArea
impl Unpin for AnonArea
impl UnwindSafe for AnonArea
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more