[][src]Struct redoxfs::FileSystem

pub struct FileSystem<D: Disk> {
    pub disk: D,
    pub block: u64,
    pub header: (u64, Header),
}

A file system

Fields

disk: Dblock: u64header: (u64, Header)

Methods

impl<D: Disk> FileSystem<D>[src]

pub fn open(disk: D) -> Result<Self>[src]

Open a file system on a disk

pub fn create(disk: D, ctime: u64, ctime_nsec: u32) -> Result<Self>[src]

Create a file system on a disk

pub fn create_reserved(
    disk: D,
    reserved: &[u8],
    ctime: u64,
    ctime_nsec: u32
) -> Result<Self>
[src]

Create a file system on a disk, with reserved data at the beginning Reserved data will be zero padded up to the nearest block We need to pass ctime and ctime_nsec in order to initialize the unix timestamps

pub fn read_at(&mut self, block: u64, buffer: &mut [u8]) -> Result<usize>[src]

Read at a certain spot in the disk, returning data into buffer

pub fn write_at(&mut self, block: u64, buffer: &[u8]) -> Result<usize>[src]

pub fn allocate(&mut self, length: u64) -> Result<u64>[src]

pub fn deallocate(&mut self, block: u64, length: u64) -> Result<()>[src]

pub fn node(&mut self, block: u64) -> Result<(u64, Node)>[src]

pub fn ex_node(&mut self, block: u64) -> Result<(u64, ExNode)>[src]

pub fn child_nodes(
    &mut self,
    children: &mut Vec<(u64, Node)>,
    parent_block: u64
) -> Result<()>
[src]

pub fn find_node(
    &mut self,
    name: &str,
    parent_block: u64
) -> Result<(u64, Node)>
[src]

pub fn insert_blocks(
    &mut self,
    block: u64,
    length: u64,
    parent_block: u64
) -> Result<()>
[src]

pub fn create_node(
    &mut self,
    mode: u16,
    name: &str,
    parent_block: u64,
    ctime: u64,
    ctime_nsec: u32
) -> Result<(u64, Node)>
[src]

pub fn remove_blocks(
    &mut self,
    block: u64,
    length: u64,
    parent_block: u64
) -> Result<()>
[src]

pub fn remove_node(
    &mut self,
    mode: u16,
    name: &str,
    parent_block: u64
) -> Result<()>
[src]

pub fn node_set_len(&mut self, block: u64, length: u64) -> Result<()>[src]

pub fn read_node(
    &mut self,
    block: u64,
    offset: u64,
    buf: &mut [u8]
) -> Result<usize>
[src]

pub fn write_node(
    &mut self,
    block: u64,
    offset: u64,
    buf: &[u8],
    mtime: u64,
    mtime_nsec: u32
) -> Result<usize>
[src]

pub fn node_len(&mut self, block: u64) -> Result<u64>[src]

Auto Trait Implementations

impl<D> Send for FileSystem<D> where
    D: Send

impl<D> Sync for FileSystem<D> where
    D: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]