Skip to main content

BlkFS

Struct BlkFS 

Source
pub struct BlkFS { /* private fields */ }
Expand description

The persistent block-backed filesystem.

Implementations§

Source§

impl BlkFS

Source

pub fn create(dev: Arc<dyn BlockDevice>) -> Result<BlkFS, FileError>

Create a new BlkFS on the given block device, formatting it.

Source

pub fn open(dev: Arc<dyn BlockDevice>) -> Result<BlkFS, FileError>

Open an existing BlkFS on the given device (no formatting).

Source

pub fn device(&self) -> Arc<dyn BlockDevice> ⓘ

Source

pub fn sync(&self) -> Result<(), FileError>

Source

pub fn root_inode(&self) -> Result<BlkInode, FileError>

Get the root inode.

Source

pub fn create_file( &self, parent: &mut BlkInode, name: &str, ) -> Result<BlkInode, FileError>

Create a regular file in a parent directory.

Source

pub fn create_directory( &self, parent: &mut BlkInode, name: &str, ) -> Result<BlkInode, FileError>

Create a directory in a parent directory.

Source

pub fn lookup( &self, parent: &BlkInode, name: &str, ) -> Result<BlkInode, FileError>

Look up a child in a directory.

Source

pub fn open_file(&self, inode: BlkInode) -> Result<BlkFile, FileError>

Open a regular file for reading/writing.

Auto Trait Implementations§

§

impl !Freeze for BlkFS

§

impl !RefUnwindSafe for BlkFS

§

impl !UnwindSafe for BlkFS

§

impl Forget for BlkFS

§

impl Send for BlkFS

§

impl Sync for BlkFS

§

impl Unpin for BlkFS

§

impl UnsafeUnpin for BlkFS

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.