[][src]Struct redoxfs::Node

#[repr(packed)]
pub struct Node {
    pub mode: u16,
    pub uid: u32,
    pub gid: u32,
    pub ctime: u64,
    pub ctime_nsec: u32,
    pub mtime: u64,
    pub mtime_nsec: u32,
    pub atime: u64,
    pub atime_nsec: u32,
    pub name: [u8; 226],
    pub parent: u64,
    pub next: u64,
    pub extents: [Extent; 238],
}

A file/folder node

Fields

mode: u16uid: u32gid: u32ctime: u64ctime_nsec: u32mtime: u64mtime_nsec: u32atime: u64atime_nsec: u32name: [u8; 226]parent: u64next: u64extents: [Extent; 238]

Methods

impl Node[src]

pub const MODE_TYPE: u16[src]

pub const MODE_FILE: u16[src]

pub const MODE_DIR: u16[src]

pub const MODE_PERM: u16[src]

pub const MODE_EXEC: u16[src]

pub const MODE_WRITE: u16[src]

pub const MODE_READ: u16[src]

pub fn default() -> Node[src]

pub fn new(
    mode: u16,
    name: &str,
    parent: u64,
    ctime: u64,
    ctime_nsec: u32
) -> Result<Node>
[src]

pub fn name(&self) -> Result<&str, Utf8Error>[src]

pub fn set_name(&mut self, name: &str) -> Result<()>[src]

pub fn is_dir(&self) -> bool[src]

pub fn is_file(&self) -> bool[src]

pub fn owner(&self, uid: u32) -> bool[src]

Tests if UID is the owner of that file, only true when uid=0 or when the UID stored in metadata is equal to the UID you supply

pub fn permission(&self, uid: u32, gid: u32, op: u16) -> bool[src]

Tests if the current user has enough permissions to view the file, op is the operation, like read and write, these modes are MODE_EXEC, MODE_READ, and MODE_WRITE

pub fn size(&self) -> u64[src]

Trait Implementations

impl Debug for Node[src]

impl Deref for Node[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for Node[src]

Auto Trait Implementations

impl RefUnwindSafe for Node

impl Send for Node

impl Sync for Node

impl Unpin for Node

impl UnwindSafe for Node

Blanket Implementations

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

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

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

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.