#[repr(C)]pub struct StableStorage<M: Memory> { /* private fields */ }
Implementations§
Source§impl<M: Memory> StableStorage<M>
impl<M: Memory> StableStorage<M>
pub fn new(memory: M) -> Self
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>
impl<M: Memory> Storage for StableStorage<M>
Source§fn get_version(&self) -> u32
fn get_version(&self) -> u32
Get version of the file system.
Source§fn get_metadata(&self, node: Node) -> Result<Metadata, Error>
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>
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>
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,
el: &(Node, FileName),
) -> Option<DirEntryIndex>
fn get_direntry_index_by_name( &self, el: &(Node, FileName), ) -> Option<DirEntryIndex>
Retrieve the DirEntryIndex instance given the Node and DirEntryIndex.
Source§fn new_direntry_index(&self, node: Node) -> DirEntryIndex
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,
)
fn with_direntries( &self, node: Node, initial_index: Option<DirEntryIndex>, f: &mut dyn FnMut(&DirEntryIndex, &DirEntry) -> bool, )
get entries iterator
fn put_direntry(&mut self, node: Node, index: DirEntryIndex, entry: DirEntry)
fn rm_direntry(&mut self, node: Node, index: DirEntryIndex)
fn read( &mut self, node: Node, offset: FileSize, buf: &mut [u8], ) -> Result<FileSize, Error>
fn write( &mut self, node: Node, offset: FileSize, buf: &[u8], ) -> Result<FileSize, Error>
fn resize_file(&mut self, node: Node, new_size: FileSize) -> Result<(), Error>
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>
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>
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
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>
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>
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>
fn store_mounted_memory(&mut self, node: Node) -> Result<(), Error>
store mounted memory state back to host file.
fn set_chunk_size(&mut self, chunk_size: ChunkSize) -> Result<(), Error>
fn chunk_size(&self) -> usize
fn set_chunk_type(&mut self, chunk_type: ChunkType)
fn chunk_type(&self) -> ChunkType
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> 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