stable_fs::storage::stable

Struct StableStorage

source
#[repr(C)]
pub struct StableStorage<M: Memory> { /* private fields */ }

Implementations§

source§

impl<M: Memory> StableStorage<M>

source

pub fn new(memory: M) -> Self

source

pub fn new_with_memory_manager( memory_manager: &MemoryManager<M>, memory_indices: Range<u8>, ) -> StableStorage<M>

Trait Implementations§

source§

impl<M: Memory> Storage for StableStorage<M>

source§

fn root_node(&self) -> Node

source§

fn new_node(&mut self) -> Node

source§

fn get_version(&self) -> u32

source§

fn get_metadata(&self, node: Node) -> Result<Metadata, Error>

source§

fn put_metadata(&mut self, node: Node, metadata: Metadata)

source§

fn get_direntry( &self, node: Node, index: DirEntryIndex, ) -> Result<DirEntry, Error>

source§

fn put_direntry(&mut self, node: Node, index: DirEntryIndex, entry: DirEntry)

source§

fn rm_direntry(&mut self, node: Node, index: DirEntryIndex)

source§

fn read( &mut self, node: Node, offset: FileSize, buf: &mut [u8], ) -> Result<FileSize, Error>

source§

fn write( &mut self, node: Node, offset: FileSize, buf: &[u8], ) -> Result<FileSize, Error>

source§

fn rm_file(&mut self, node: Node) -> Result<(), Error>

source§

fn mount_node( &mut self, node: Node, memory: Box<dyn Memory>, ) -> Result<(), Error>

source§

fn unmount_node(&mut self, node: Node) -> Result<Box<dyn Memory>, Error>

source§

fn is_mounted(&self, node: Node) -> bool

source§

fn get_mounted_memory(&self, node: Node) -> Option<&dyn Memory>

source§

fn init_mounted_memory(&mut self, node: Node) -> Result<(), Error>

source§

fn store_mounted_memory(&mut self, node: Node) -> Result<(), Error>

source§

fn set_chunk_size(&mut self, chunk_size: ChunkSize) -> Result<(), Error>

source§

fn chunk_size(&self) -> usize

source§

fn set_chunk_type(&mut self, chunk_type: ChunkType)

source§

fn chunk_type(&self) -> ChunkType

source§

fn flush(&mut self, _node: Node)

Auto Trait Implementations§

§

impl<M> Freeze for StableStorage<M>

§

impl<M> !RefUnwindSafe for StableStorage<M>

§

impl<M> !Send for StableStorage<M>

§

impl<M> !Sync for StableStorage<M>

§

impl<M> Unpin for StableStorage<M>

§

impl<M> !UnwindSafe for StableStorage<M>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.