pub trait Inode: Send + Sync {
// Provided methods
fn read(&self, _offset: u64, _buffer: &mut [u8]) -> CNFSResult<usize> { ... }
fn write(&self, _offset: u64, _buffer: &[u8]) -> CNFSResult<usize> { ... }
fn sync(&self) -> CNFSResult { ... }
fn lookup(&self, _name: &str) -> CNFSResult<InodeRef> { ... }
fn create(
&self,
_name: &str,
_inode_type: InodeType,
) -> CNFSResult<InodeRef> { ... }
fn remove(&self, _name: &str) -> CNFSResult { ... }
}
Expand description
Trait for inode
Provided Methods§
sourcefn read(&self, _offset: u64, _buffer: &mut [u8]) -> CNFSResult<usize>
fn read(&self, _offset: u64, _buffer: &mut [u8]) -> CNFSResult<usize>
Read data from file to buffer at a given offset
sourcefn write(&self, _offset: u64, _buffer: &[u8]) -> CNFSResult<usize>
fn write(&self, _offset: u64, _buffer: &[u8]) -> CNFSResult<usize>
Write data from buffer to file at a given offset
sourcefn sync(&self) -> CNFSResult
fn sync(&self) -> CNFSResult
Synchronize the data to filesystem.
sourcefn lookup(&self, _name: &str) -> CNFSResult<InodeRef>
fn lookup(&self, _name: &str) -> CNFSResult<InodeRef>
Lookup a inode with a given name
sourcefn create(&self, _name: &str, _inode_type: InodeType) -> CNFSResult<InodeRef>
fn create(&self, _name: &str, _inode_type: InodeType) -> CNFSResult<InodeRef>
Create a new inode with a given name
sourcefn remove(&self, _name: &str) -> CNFSResult
fn remove(&self, _name: &str) -> CNFSResult
Remove an inode with a given name