Skip to main content

Inode

Struct Inode 

Source
#[non_exhaustive]
pub struct Inode {
Show 15 fields pub oid: u64, pub parent_id: u64, pub private_id: u64, pub create_time: u64, pub mod_time: u64, pub change_time: u64, pub access_time: u64, pub internal_flags: u64, pub nlink_or_nchildren: i32, pub bsd_flags: u32, pub uid: u32, pub gid: u32, pub mode: u16, pub name: Option<String>, pub size: Option<u64>,
}
Expand description

A parsed inode.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§oid: u64

File-system object id of this inode (the j_key oid).

§parent_id: u64

parent_id — the inode of the containing directory.

§private_id: u64

private_id — the data-stream object id (file extents are keyed by it).

§create_time: u64

create_time (ns since 1970-01-01 UTC).

§mod_time: u64

mod_time (ns since 1970-01-01 UTC).

§change_time: u64

change_time (ns since 1970-01-01 UTC).

§access_time: u64

access_time (ns since 1970-01-01 UTC).

§internal_flags: u64

internal_flags (e.g. INODE_WAS_CLONED, INODE_NO_RSRC_FORK).

§nlink_or_nchildren: i32

nchildren (directories) or nlink (files) — the same union field.

§bsd_flags: u32

bsd_flags — BSD file entry flags.

§uid: u32

owner — owner user id (uid).

§gid: u32

group — group id (gid).

§mode: u16

mode — POSIX file mode (type bits + permissions).

§name: Option<String>

Filename from the INO_EXT_TYPE_NAME xfield, if present.

§size: Option<u64>

Logical file size (the data-stream used_size) from the INO_EXT_TYPE_DSTREAM xfield, if present (directories have none).

Implementations§

Source§

impl Inode

Source

pub fn parse(oid: u64, value: &[u8]) -> Result<Self>

Parse a j_inode_val_t value (+ xfields) for oid. Bounds-checked: a truncated value reads missing fields as 0 rather than panicking.

§Errors

Never fails for a well-formed slice today; the Result is reserved for future stricter validation (kept for API stability).

Source

pub fn created(&self) -> Option<DateTime<Utc>>

create_time as a UTC datetime.

Source

pub fn modified(&self) -> Option<DateTime<Utc>>

mod_time as a UTC datetime.

Source

pub fn changed(&self) -> Option<DateTime<Utc>>

change_time as a UTC datetime.

Source

pub fn accessed(&self) -> Option<DateTime<Utc>>

access_time as a UTC datetime.

Trait Implementations§

Source§

impl Clone for Inode

Source§

fn clone(&self) -> Inode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Inode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Inode

§

impl RefUnwindSafe for Inode

§

impl Send for Inode

§

impl Sync for Inode

§

impl Unpin for Inode

§

impl UnsafeUnpin for Inode

§

impl UnwindSafe for Inode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.