Skip to main content

DirEntry

Struct DirEntry 

Source
pub struct DirEntry {
    pub record: DirectoryRecord,
    pub rrip: Option<RripMetadata>,
    pub additional_extents: Vec<Extent>,
    pub associated_file: Option<Extent>,
}
Available on crate feature alloc and crate feature sync and (crate features alloc or read) only.
Expand description

A directory entry that may be enriched with RRIP metadata.

For multi-extent files (using the NOT_FINAL flag for files >4 GiB), additional_extents contains the extents beyond the first one stored in the primary record.

Fields§

§record: DirectoryRecord

The record field.

§rrip: Option<RripMetadata>

The rrip field.

§additional_extents: Vec<Extent>

Additional extents for multi-extent files. Empty for single-extent files.

§associated_file: Option<Extent>

Associated file record, if one precedes this entry (ASSOCIATED_FILE flag).

ISO 9660 allows an “associated file” record with the same identifier to appear before the primary record. This is commonly used for resource forks or metadata streams.

Implementations§

Source§

impl DirEntry

Source

pub fn name(&self) -> &[u8]

Performs the name operation.

Source

pub fn display_name(&self) -> Cow<'_, str>

Returns the display name: RRIP alternate name if available, else decoded raw name.

Source

pub fn matches_name(&self, name: &str) -> bool

Returns whether this entry matches a path component.

Rock Ridge alternate names are matched exactly. Plain ISO 9660 names are matched case-insensitively after removing trailing NUL bytes and a numeric version suffix such as ;1.

Source

pub fn header(&self) -> &DirectoryRecordHeader

Performs the header operation.

Source

pub fn is_directory(&self) -> bool

Returns true if this entry represents a directory. CL-aware: a child link means the entry points to a directory.

Source

pub fn is_special(&self) -> bool

Performs the is_special operation.

Source

pub fn is_file(&self) -> bool

Performs the is_file operation.

Source

pub fn size(&self) -> usize

Returns the record size (directory record length), NOT the file data size. For the file’s total data size, use total_size.

Source

pub fn total_size(&self) -> u64

Returns the total file data size across all extents.

For single-extent files this is the same as header().data_len.read(). For multi-extent files this sums all extent lengths.

Source

pub fn is_multi_extent(&self) -> bool

Returns true if this is a multi-extent file.

Source

pub fn extents(&self) -> impl Iterator<Item = Extent> + '_

Returns an iterator over all extents of this file.

The first extent comes from the primary record; additional extents follow in order.

Source

pub fn has_associated_file(&self) -> bool

Returns true if this entry has an associated file (e.g., resource fork).

Source

pub fn extended_attr_len(&self) -> Option<u8>

Returns the length of the extended attribute record in logical sectors, or None if no extended attributes are present.

When present (extended_attr_record > 0), the XA record is located at the start of the file’s extent (before the file data) and occupies this many logical sectors.

Source

pub fn system_use(&self) -> &[u8]

Performs the system_use operation.

Source§

impl DirEntry

Source

pub fn as_dir_ref<DATA: Read + Seek>( &self, image: &IsoImage<DATA>, ) -> Result<DirectoryRef>

Get a DirectoryRef for navigating into this directory.

For CL entries, this follows the child link to the relocated directory. For regular directories, it uses the ISO 9660 extent/size.

Trait Implementations§

Source§

impl Clone for DirEntry

Source§

fn clone(&self) -> DirEntry

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 DirEntry

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

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

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

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.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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