TransientStorage

Struct TransientStorage 

Source
pub struct TransientStorage { /* private fields */ }

Implementations§

Source§

impl TransientStorage

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for TransientStorage

Source§

fn default() -> TransientStorage

Returns the “default value” for a type. Read more
Source§

impl Storage for TransientStorage

Source§

fn root_node(&self) -> Node

Get the root node ID of the storage.
Source§

fn get_version(&self) -> u32

Get version of the file system.
Source§

fn new_node(&mut self) -> Node

Generate the next available node ID.
Source§

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

Get the metadata associated with the node.
Source§

fn put_metadata(&mut self, node: Node, metadata: &Metadata) -> Result<(), Error>

Update the metadata associated with the node.
Source§

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

Retrieve the DirEntry instance given the Node and DirEntryIndex.
Source§

fn get_direntry_index_by_name( &self, entry: &(Node, FileName), ) -> Option<DirEntryIndex>

Retrieve the DirEntryIndex instance given the Node and DirEntryIndex.
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 resize_file(&mut self, node: Node, new_size: FileSize) -> Result<(), Error>

Source§

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

Source§

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

mark node as mounted.
Source§

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

mark note as not mounted.
Source§

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

return true if the node is mounted.
Source§

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

return mounted memory related to the node, or None.
Source§

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

initialize memory with the contents from file.
Source§

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

store mounted memory state back to host file.
Source§

fn write( &mut self, node: Node, offset: FileSize, buf: &[u8], ) -> Result<FileSize, 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)

Source§

fn new_direntry_index(&self, node: Node) -> DirEntryIndex

Return the DirEntryIndex that can be used for a new entry
Source§

fn with_direntries( &self, node: Node, initial_index: Option<DirEntryIndex>, f: &mut dyn FnMut(&DirEntryIndex, &DirEntry) -> bool, )

get entries iterator

Auto Trait Implementations§

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.