Trait cnfs::Inode

source ·
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§

source

fn read(&self, _offset: u64, _buffer: &mut [u8]) -> CNFSResult<usize>

Read data from file to buffer at a given offset

source

fn write(&self, _offset: u64, _buffer: &[u8]) -> CNFSResult<usize>

Write data from buffer to file at a given offset

source

fn sync(&self) -> CNFSResult

Synchronize the data to filesystem.

source

fn lookup(&self, _name: &str) -> CNFSResult<InodeRef>

Lookup a inode with a given name

source

fn create(&self, _name: &str, _inode_type: InodeType) -> CNFSResult<InodeRef>

Create a new inode with a given name

source

fn remove(&self, _name: &str) -> CNFSResult

Remove an inode with a given name

Implementors§