Struct Ufs

Source
pub struct Ufs<R: Backend> { /* private fields */ }
Expand description

Berkley Unix (Fast) Filesystem v2

Implementations§

Source§

impl<R: Backend> Ufs<R>

Source

pub fn dir_lookup(&mut self, pinr: InodeNum, name: &OsStr) -> IoResult<InodeNum>

Find a file named name in the directory referenced by pinr.

Source

pub fn dir_iter<T>( &mut self, inr: InodeNum, f: impl FnMut(&OsStr, InodeNum, InodeType) -> Option<T>, ) -> IoResult<Option<T>>

Iterate through a directory referenced by inr, and call f for each entry.

Source

pub fn rmdir(&mut self, dinr: InodeNum, name: &OsStr) -> IoResult<()>

Source

pub fn mknod( &mut self, dinr: InodeNum, name: &OsStr, kind: InodeType, perm: u16, uid: u32, gid: u32, ) -> IoResult<InodeAttr>

Source

pub fn mkdir( &mut self, dinr: InodeNum, name: &OsStr, perm: u16, uid: u32, gid: u32, ) -> IoResult<InodeAttr>

Source§

impl<R: Backend> Ufs<R>

Source

pub fn inode_truncate(&mut self, inr: InodeNum, new_size: u64) -> IoResult<()>

Source§

impl<R: Backend> Ufs<R>

Source

pub fn inode_attr(&mut self, inr: InodeNum) -> IoResult<InodeAttr>

Get metadata about an inode.

Source

pub fn inode_read( &mut self, inr: InodeNum, offset: u64, buffer: &mut [u8], ) -> IoResult<usize>

Read data from an inode.

Source

pub fn inode_write( &mut self, inr: InodeNum, offset: u64, buffer: &[u8], ) -> IoResult<usize>

Source

pub fn inode_modify( &mut self, inr: InodeNum, f: impl FnOnce(InodeAttr) -> InodeAttr, ) -> IoResult<InodeAttr>

Source§

impl<R: Backend> Ufs<R>

Read the contents of a symbolic link.

Source§

impl<R: Backend> Ufs<R>

Source

pub fn xattr_list_len(&mut self, inr: InodeNum) -> IoResult<u32>

Get the size of the extended attribute area of inode inr.

Source

pub fn xattr_list(&mut self, inr: InodeNum) -> IoResult<Vec<u8>>

Get the list of extended attribyte names. Each entry follows the following format: "namespace.name\0"

Source

pub fn xattr_len(&mut self, inr: InodeNum, name: &OsStr) -> IoResult<u32>

Get the size of an extended attribute.

Source

pub fn xattr_read(&mut self, inr: InodeNum, name: &OsStr) -> IoResult<Vec<u8>>

Read the value of an extended attribute.

Source§

impl Ufs<File>

Source

pub fn open(path: &Path, rw: bool) -> IoResult<Self>

Source§

impl<R: Backend> Ufs<R>

Source

pub fn new(file: BlockReader<R>) -> IoResult<Self>

Source

pub fn write_enabled(&self) -> bool

Source

pub fn info(&self) -> Info

Get filesystem metadata.

Auto Trait Implementations§

§

impl<R> Freeze for Ufs<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Ufs<R>
where R: RefUnwindSafe,

§

impl<R> Send for Ufs<R>
where R: Send,

§

impl<R> Sync for Ufs<R>
where R: Sync,

§

impl<R> Unpin for Ufs<R>
where R: Unpin,

§

impl<R> UnwindSafe for Ufs<R>
where R: UnwindSafe,

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 = 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.