Struct nuts_container::memory::MemoryBackend
source · pub struct MemoryBackend { /* private fields */ }
Implementations§
source§impl MemoryBackend
impl MemoryBackend
sourcepub fn new() -> MemoryBackend
pub fn new() -> MemoryBackend
Creates a new instance of the MemoryBackend
type.
sourcepub fn get(&self, id: &Id) -> Option<&[u8]>
pub fn get(&self, id: &Id) -> Option<&[u8]>
Receives the content of the block with the given id
.
Returns None
if the block does not exist.
Trait Implementations§
source§impl Backend for MemoryBackend
impl Backend for MemoryBackend
§type CreateOptions = MemoryBackend
type CreateOptions = MemoryBackend
Options used to create a backend instance. Read more
§type OpenOptions = MemoryBackend
type OpenOptions = MemoryBackend
Options used to open a backend instance. Read more
§type Id = Id
type Id = Id
The id identifies a block in the storage. It is used everywhere you
need a pointer to a block.
source§fn block_size(&self) -> u32
fn block_size(&self) -> u32
Returns the block size of the backend.
source§impl Create<MemoryBackend> for MemoryBackend
impl Create<MemoryBackend> for MemoryBackend
source§impl Debug for MemoryBackend
impl Debug for MemoryBackend
source§impl HeaderGet<MemoryBackend> for MemoryBackend
impl HeaderGet<MemoryBackend> for MemoryBackend
source§impl HeaderSet<MemoryBackend> for MemoryBackend
impl HeaderSet<MemoryBackend> for MemoryBackend
source§impl Open<MemoryBackend> for MemoryBackend
impl Open<MemoryBackend> for MemoryBackend
source§impl PartialEq for MemoryBackend
impl PartialEq for MemoryBackend
source§fn eq(&self, other: &MemoryBackend) -> bool
fn eq(&self, other: &MemoryBackend) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for MemoryBackend
Auto Trait Implementations§
impl RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnwindSafe for MemoryBackend
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