pub struct MemCase<S>(/* private fields */);
Expand description
A wrapper keeping together an immutable structure and the memory
it was deserialized from. MemCase
instances can not be cloned, but references
to such instances can be shared freely.
MemCase
implements Deref
and AsRef
to the
wrapped type, so it can be used almost transparently and
with no performance cost. However,
if you need to use a memory-mapped structure as a field in
a struct and you want to avoid dyn
, you will have
to use MemCase
as the type of the field.
MemCase
implements From
for the
wrapped type, using the no-op None
variant
of MemBackend
, so a structure can be encased
almost transparently.
Implementations§
Trait Implementations§
source§impl<S> MemDbgImpl for MemCase<S>
impl<S> MemDbgImpl for MemCase<S>
impl<S: Send> Send for MemCase<S>
impl<S: Sync> Sync for MemCase<S>
Auto Trait Implementations§
impl<S> Freeze for MemCase<S>where
S: Freeze,
impl<S> RefUnwindSafe for MemCase<S>where
S: RefUnwindSafe,
impl<S> Unpin for MemCase<S>where
S: Unpin,
impl<S> UnwindSafe for MemCase<S>where
S: 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
source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
source§impl<T> MemDbg for Twhere
T: MemDbgImpl,
impl<T> MemDbg for Twhere
T: MemDbgImpl,
source§fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, expanding
all levels of nested structures.
source§fn mem_dbg_on(
&self,
writer: &mut impl Write,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags ) -> Result<(), Error>
Write to a
core::fmt::Write
debug infos about the structure memory usage,
expanding all levels of nested structures.source§fn mem_dbg_depth(
&self,
total_size: usize,
max_depth: usize,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_depth( &self, total_size: usize, max_depth: usize, flags: DbgFlags ) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, but expanding only
up to
max_depth
levels of nested structures.source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
total_size: usize,
max_depth: usize,
prefix: &mut String,
field_name: Option<&str>,
is_last: bool,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, flags: DbgFlags ) -> Result<(), Error>
Write to a
core::fmt::Write
debug infos about the structure memory usage,
but expanding only up to max_depth
levels of nested structures.source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.