pub struct DirEntry {
pub record: DirectoryRecord,
pub rrip: Option<RripMetadata>,
pub additional_extents: Vec<Extent>,
pub associated_file: Option<Extent>,
}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: DirectoryRecordThe 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
impl DirEntry
Sourcepub fn display_name(&self) -> Cow<'_, str>
pub fn display_name(&self) -> Cow<'_, str>
Returns the display name: RRIP alternate name if available, else decoded raw name.
Sourcepub fn matches_name(&self, name: &str) -> bool
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.
Sourcepub fn header(&self) -> &DirectoryRecordHeader
pub fn header(&self) -> &DirectoryRecordHeader
Performs the header operation.
Sourcepub fn is_directory(&self) -> bool
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.
Sourcepub fn is_special(&self) -> bool
pub fn is_special(&self) -> bool
Performs the is_special operation.
Sourcepub fn size(&self) -> usize
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.
Sourcepub fn total_size(&self) -> u64
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.
Sourcepub fn is_multi_extent(&self) -> bool
pub fn is_multi_extent(&self) -> bool
Returns true if this is a multi-extent file.
Sourcepub fn extents(&self) -> impl Iterator<Item = Extent> + '_
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.
Sourcepub fn has_associated_file(&self) -> bool
pub fn has_associated_file(&self) -> bool
Returns true if this entry has an associated file (e.g., resource fork).
Sourcepub fn extended_attr_len(&self) -> Option<u8>
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.
Sourcepub fn system_use(&self) -> &[u8] ⓘ
pub fn system_use(&self) -> &[u8] ⓘ
Performs the system_use operation.
Source§impl DirEntry
impl DirEntry
Sourcepub fn as_dir_ref<DATA: Read + Seek>(
&self,
image: &IsoImage<DATA>,
) -> Result<DirectoryRef>
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.