pub trait VolatileMemory {
    type B: Bitmap;
    fn len(&self) -> usize;
    fn get_slice(
        &self,
        offset: usize,
        count: usize
    ) -> Result<VolatileSlice<'_, BS<'_, Self::B>>>; fn is_empty(&self) -> bool { ... } fn as_volatile_slice(&self) -> VolatileSlice<'_, BS<'_, Self::B>> { ... } fn get_ref<T: ByteValued>(
        &self,
        offset: usize
    ) -> Result<VolatileRef<'_, T, BS<'_, Self::B>>> { ... } fn get_array_ref<T: ByteValued>(
        &self,
        offset: usize,
        n: usize
    ) -> Result<VolatileArrayRef<'_, T, BS<'_, Self::B>>> { ... } unsafe fn aligned_as_ref<T: ByteValued>(&self, offset: usize) -> Result<&T> { ... } unsafe fn aligned_as_mut<T: ByteValued>(
        &self,
        offset: usize
    ) -> Result<&mut T> { ... } fn get_atomic_ref<T: AtomicInteger>(&self, offset: usize) -> Result<&T> { ... } fn compute_end_offset(&self, base: usize, offset: usize) -> Result<usize> { ... } }
Expand description

Types that support raw volatile access to their data.

Associated Types

Type used for dirty memory tracking.

Required methods

Gets the size of this slice.

Returns a VolatileSlice of count bytes starting at offset.

Provided methods

Check whether the region is empty.

Gets a slice of memory for the entire region that supports volatile access.

Gets a VolatileRef at offset.

Returns a VolatileArrayRef of n elements starting at offset.

Returns a reference to an instance of T at offset.

Safety

To use this safely, the caller must guarantee that there are no other users of the given chunk of memory for the lifetime of the result.

Errors

If the resulting pointer is not aligned, this method will return an Error.

Returns a mutable reference to an instance of T at offset. Mutable accesses performed using the resulting reference are not automatically accounted for by the dirty bitmap tracking functionality.

Safety

To use this safely, the caller must guarantee that there are no other users of the given chunk of memory for the lifetime of the result.

Errors

If the resulting pointer is not aligned, this method will return an Error.

Returns a reference to an instance of T at offset. Mutable accesses performed using the resulting reference are not automatically accounted for by the dirty bitmap tracking functionality.

Errors

If the resulting pointer is not aligned, this method will return an Error.

Returns the sum of base and offset if the resulting address is valid.

Implementations on Foreign Types

Implementors