Inode

Struct Inode 

Source
#[repr(C)]
pub struct Inode<Header: InodeHeader> { pub header: Header, pub data: [u8], }
Expand description

Inode structure with header and variable-length data

Fields§

§header: Header

Inode header (compact or extended)

§data: [u8]

Variable-length data containing xattrs and inline content

Trait Implementations§

Source§

impl<T: Debug + InodeHeader> Debug for Inode<T>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Header> FromBytes for Inode<Header>
where Header: FromBytes + InodeHeader, [u8]: FromBytes,

§

fn ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the given source as a &Self. Read more
§

fn ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the prefix of the given source as a &Self without copying. Read more
§

fn ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: Immutable + KnownLayout,

Interprets the suffix of the given bytes as a &Self. Read more
§

fn ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Interprets the given source as a &Self with a DST length equal to count. Read more
§

fn ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Interprets the prefix of the given source as a DST &Self with length equal to count. Read more
§

fn ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Interprets the suffix of the given source as a DST &Self with length equal to count. Read more
Source§

impl<Header> FromZeros for Inode<Header>
where Header: FromZeros + InodeHeader, [u8]: FromZeros,

§

fn zero(&mut self)

Overwrites self with zeros. Read more
§

fn new_box_zeroed_with_elems(count: usize) -> Result<Box<Self>, AllocError>
where Self: KnownLayout<PointerMetadata = usize>,

Creates a Box<[Self]> (a boxed slice) from zeroed bytes. Read more
Source§

impl<Header: InodeHeader> InodeHeader for &Inode<Header>

Source§

fn data_layout(&self) -> DataLayout

Returns the data layout method used by this inode
Source§

fn xattr_icount(&self) -> u16

Returns the extended attribute inode count
Source§

fn mode(&self) -> ModeField

Returns the file mode
Source§

fn size(&self) -> u64

Returns the file size in bytes
Source§

fn u(&self) -> u32

Returns the union field value (block address, device number, etc.)
Source§

fn additional_bytes(&self, blkszbits: u8) -> usize

Calculates the number of additional bytes after the header
Source§

fn xattr_size(&self) -> usize

Calculates the size of the extended attributes section
Source§

impl<Header: InodeHeader> InodeOps for &Inode<Header>

Source§

fn xattrs(&self) -> Option<&InodeXAttrs>

Returns the extended attributes section if present
Source§

fn inline(&self) -> Option<&[u8]>

Returns the inline data portion
Source§

fn blocks(&self, blkszbits: u8) -> Range<u64>

Returns the range of block IDs used by this inode
Source§

impl<Header: InodeHeader> KnownLayout for Inode<Header>
where [u8]: KnownLayout,

Source§

type PointerMetadata = <[u8] as KnownLayout>::PointerMetadata

The type of metadata stored in a pointer to Self. Read more
§

fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>

Computes the size of an object of type Self with the given pointer metadata. Read more
Source§

impl<Header> TryFromBytes for Inode<Header>
where Header: TryFromBytes + InodeHeader, [u8]: TryFromBytes,

§

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
§

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
§

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
§

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count. Read more
§

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count. Read more
§

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count. Read more
Source§

impl<Header> Immutable for Inode<Header>
where Header: Immutable + InodeHeader, [u8]: Immutable,

Auto Trait Implementations§

§

impl<Header> Freeze for Inode<Header>
where Header: Freeze,

§

impl<Header> RefUnwindSafe for Inode<Header>
where Header: RefUnwindSafe,

§

impl<Header> Send for Inode<Header>
where Header: Send,

§

impl<Header> !Sized for Inode<Header>

§

impl<Header> Sync for Inode<Header>
where Header: Sync,

§

impl<Header> Unpin for Inode<Header>
where Header: Unpin,

§

impl<Header> UnwindSafe for Inode<Header>
where Header: 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