Enum epserde::deser::mem_case::MemBackend
source · pub enum MemBackend {
None,
Memory(Box<[MemoryAlignment]>),
Mmap(Mmap),
}
Expand description
Possible backends of a MemCase
. The None
variant is used when the data structure is
created in memory; the Memory
variant is used when the data structure is deserialized
from a file loaded into a heap-allocated memory region; the Mmap
variant is used when
the data structure is deserialized from a mmap()
-based region, either coming from
an allocation or a from mapping a file.
Variants§
None
No backend. The data structure is a standard Rust data structure.
This variant is returned by MemCase::encase
.
Memory(Box<[MemoryAlignment]>)
The backend is a heap-allocated in a memory region aligned to 16 bytes.
This variant is returned by crate::deser::Deserialize::load_mem
.
Mmap(Mmap)
The backend is the result to a call to mmap()
.
This variant is returned by crate::deser::Deserialize::load_mmap
and crate::deser::Deserialize::mmap
.
Implementations§
Trait Implementations§
source§impl CopyType for MemBackend
impl CopyType for MemBackend
source§impl Debug for MemBackend
impl Debug for MemBackend
source§impl MemDbgImpl for MemBackend
impl MemDbgImpl for MemBackend
Auto Trait Implementations§
impl Freeze for MemBackend
impl RefUnwindSafe for MemBackend
impl Send for MemBackend
impl Sync for MemBackend
impl Unpin for MemBackend
impl UnwindSafe for MemBackend
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
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
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>
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>
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>
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>
core::fmt::Write
debug infos about the structure memory usage,
but expanding only up to max_depth
levels of nested structures.