ext4_read_only::structs

Struct INode

Source
#[repr(C)]
pub struct INode {
Show 23 fields pub e2di_mode: U16, pub e2di_uid: U16, pub e2di_size: U32, pub e2di_atime: U32, pub e2di_ctime: U32, pub e2di_mtime: U32, pub e2di_dtime: U32, pub e2di_gid: U16, pub e2di_nlink: U16, pub e2di_nblock: U32, pub e2di_flags: U32, pub e2di_version: [u8; 4], pub e2di_blocks: [u8; 60], pub e2di_gen: U32, pub e2di_facl: U32, pub e2di_size_high: U32, pub e2di_faddr: U32, pub e2di_nblock_high: U16, pub e2di_facl_high: U16, pub e2di_uid_high: U16, pub e2di_gid_high: U16, pub e2di_chksum_lo: U16, pub e2di_lx_reserved: U16, /* private fields */
}

Fields§

§e2di_mode: U16

Access permission flags.

§e2di_uid: U16

Owner UID.

§e2di_size: U32

Size (in bytes).

§e2di_atime: U32

Access time.

§e2di_ctime: U32

Change time.

§e2di_mtime: U32

Modification time.

§e2di_dtime: U32

Deletion time.

§e2di_gid: U16

Owner GID.

§e2di_nlink: U16

File link count.

§e2di_nblock: U32

Block count.

§e2di_flags: U32

Status flags.

§e2di_version: [u8; 4]

INode version.

§e2di_blocks: [u8; 60]

Extent tree.

§e2di_gen: U32

Generation.

§e2di_facl: U32

EA block.

§e2di_size_high: U32

High bits for file size.

§e2di_faddr: U32

Fragment address (obsolete).

§e2di_nblock_high: U16

High bits for block count.

§e2di_facl_high: U16

High bits for EA block.

§e2di_uid_high: U16

High bits for Owner UID.

§e2di_gid_high: U16

High bits for Owner GID.

§e2di_chksum_lo: U16

High bits for INode checksum.

§e2di_lx_reserved: U16

Implementations§

Source§

impl INode

Source

pub fn extent_tree_node(&self) -> Result<ExtentTreeNode<&[u8]>, ParsingError>

INode contains the root of its Extent tree within e2di_blocks. Read e2di_blocks and return the root Extent Header.

Source

pub fn size(&self) -> u64

Size of the file/directory/entry represented by this INode.

Source

pub fn facl(&self) -> u64

Source

pub fn e4di_extra_isize(&self, sb: &SuperBlock) -> Result<LEU16, ParsingError>

Source

pub fn e4di_chksum_hi(&self, sb: &SuperBlock) -> Result<LEU16, ParsingError>

Source

pub fn e4di_ctime_extra(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_mtime_extra(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_atime_extra(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_crtime(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_crtime_extra(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_version_hi(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Source

pub fn e4di_projid(&self, sb: &SuperBlock) -> Result<LEU32, ParsingError>

Trait Implementations§

Source§

impl FromBytes for INode
where U16: FromBytes, U32: FromBytes, [u8; 4]: FromBytes, [u8; 60]: 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
§

fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the given source. Read more
§

fn read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the prefix of the given source. Read more
§

fn read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the suffix of the given source. Read more
Source§

impl FromZeros for INode
where U16: FromZeros, U32: FromZeros, [u8; 4]: FromZeros, [u8; 60]: FromZeros,

§

fn zero(&mut self)

Overwrites self with zeros. Read more
§

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
Source§

impl KnownLayout for INode
where U32: KnownLayout,

Source§

type PointerMetadata = <U32<LittleEndian> as KnownLayout>::PointerMetadata

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

impl TryFromBytes for INode
where U16: TryFromBytes, U32: TryFromBytes, [u8; 4]: TryFromBytes, [u8; 60]: 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_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout,

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

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

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

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

Attempts to interpret the suffix of the given source as a &mut 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
§

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

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

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

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

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

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

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

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

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
§

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
Source§

impl Immutable for INode
where U16: Immutable, U32: Immutable, [u8; 4]: Immutable, [u8; 60]: Immutable,

Source§

impl Unaligned for INode
where U16: Unaligned, U32: Unaligned, [u8; 4]: Unaligned, [u8; 60]: Unaligned,

Auto Trait Implementations§

§

impl Freeze for INode

§

impl RefUnwindSafe for INode

§

impl Send for INode

§

impl Sync for INode

§

impl Unpin 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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Cast the given object into a dyn std::any::Any.
Source§

impl<T> ParseToStruct for T
where T: FromBytes + KnownLayout + Immutable + Unaligned,

Source§

fn from_reader_with_offset( reader: &dyn Reader, offset: u64, ) -> Result<Self, ParsingError>

Source§

fn to_struct_ref( data: &[u8], error_type: ParsingError, ) -> Result<&Self, ParsingError>

Casts the &u8 data to &Self. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more