pub enum MmapBacking {
ReadOnly(Mmap),
ReadWrite(MmapMut),
Owned(Vec<u8>),
}Expand description
Owns the backing memory for a TRX data array.
May be a read-only mmap, a read-write mmap, or an owned heap buffer (used for converted offsets, deep copies, etc.).
Variants§
Implementations§
Source§impl MmapBacking
impl MmapBacking
Sourcepub fn as_bytes_mut(&mut self) -> Result<&mut [u8]>
pub fn as_bytes_mut(&mut self) -> Result<&mut [u8]>
Mutable raw bytes view (only for ReadWrite and Owned).
pub fn is_mapped(&self) -> bool
Sourcepub fn cast_slice<T: Pod>(&self) -> &[T]
pub fn cast_slice<T: Pod>(&self) -> &[T]
Cast the raw bytes to a typed slice.
Panics if the bytes are not aligned or the length is not a multiple
of size_of::<T>().
Sourcepub fn cast_slice_mut<T: Pod>(&mut self) -> Result<&mut [T]>
pub fn cast_slice_mut<T: Pod>(&mut self) -> Result<&mut [T]>
Cast the raw bytes to a mutable typed slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MmapBacking
impl RefUnwindSafe for MmapBacking
impl Send for MmapBacking
impl Sync for MmapBacking
impl Unpin for MmapBacking
impl UnsafeUnpin for MmapBacking
impl UnwindSafe for MmapBacking
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.