Struct ntfs::NtfsIndexEntry
source · pub struct NtfsIndexEntry<'s, E>where
E: NtfsIndexEntryType,{ /* private fields */ }
Expand description
A single entry of an NTFS index.
NTFS uses B-tree indexes to quickly look up files, Object IDs, Reparse Points, Security Descriptors, etc.
They are described via NtfsIndexRoot
and NtfsIndexAllocation
attributes, which can be comfortably
accessed via NtfsIndex
.
The E
type parameter of NtfsIndexEntryType
specifies the type of the Index Entry.
The most common one is NtfsFileNameIndex
for file name indexes, commonly known as “directories”.
Check out NtfsFile::directory_index
to return an NtfsIndex
object for a directory without
any hassles.
Reference: https://flatcap.github.io/linux-ntfs/ntfs/concepts/index_entry.html
Implementations§
source§impl<'s, E> NtfsIndexEntry<'s, E>where
E: NtfsIndexEntryType,
impl<'s, E> NtfsIndexEntry<'s, E>where E: NtfsIndexEntryType,
sourcepub fn data(&self) -> Option<Result<E::DataType>>where
E: NtfsIndexEntryHasData,
pub fn data(&self) -> Option<Result<E::DataType>>where E: NtfsIndexEntryHasData,
Returns the data of this Index Entry, if any and if supported by this Index Entry type.
This function is mutually exclusive with NtfsIndexEntry::file_reference
.
An Index Entry can either have data or a file reference.
sourcepub fn data_length(&self) -> u16where
E: NtfsIndexEntryHasData,
pub fn data_length(&self) -> u16where E: NtfsIndexEntryHasData,
Returns the length of the data of this Index Entry (if supported by this Index Entry type).
sourcepub fn file_reference(&self) -> NtfsFileReferencewhere
E: NtfsIndexEntryHasFileReference,
pub fn file_reference(&self) -> NtfsFileReferencewhere E: NtfsIndexEntryHasFileReference,
Returns an NtfsFileReference
for the file referenced by this Index Entry
(if supported by this Index Entry type).
This function is mutually exclusive with NtfsIndexEntry::data
.
An Index Entry can either have data or a file reference.
sourcepub fn flags(&self) -> NtfsIndexEntryFlags
pub fn flags(&self) -> NtfsIndexEntryFlags
Returns flags set for this attribute as specified by NtfsIndexEntryFlags
.
sourcepub fn index_entry_length(&self) -> u16
pub fn index_entry_length(&self) -> u16
Returns the total length of this Index Entry, in bytes.
The next Index Entry is exactly at NtfsIndexEntry::position
+ NtfsIndexEntry::index_entry_length
on the filesystem, unless this is the last entry (NtfsIndexEntry::flags
contains
NtfsIndexEntryFlags::LAST_ENTRY
).
sourcepub fn key(&self) -> Option<Result<E::KeyType>>
pub fn key(&self) -> Option<Result<E::KeyType>>
Returns the structured value of the key of this Index Entry,
or None
if this Index Entry has no key.
The last Index Entry never has a key.
sourcepub fn key_length(&self) -> u16
pub fn key_length(&self) -> u16
Returns the length of the key of this Index Entry.
sourcepub fn position(&self) -> NtfsPosition
pub fn position(&self) -> NtfsPosition
Returns the absolute position of this NTFS Index Entry within the filesystem, in bytes.
sourcepub fn subnode_vcn(&self) -> Option<Result<Vcn>>
pub fn subnode_vcn(&self) -> Option<Result<Vcn>>
Returns the Virtual Cluster Number (VCN) of the subnode of this Index Entry,
or None
if this Index Entry has no subnode.
Trait Implementations§
source§impl<'s, E> Clone for NtfsIndexEntry<'s, E>where
E: NtfsIndexEntryType + Clone,
impl<'s, E> Clone for NtfsIndexEntry<'s, E>where E: NtfsIndexEntryType + Clone,
source§fn clone(&self) -> NtfsIndexEntry<'s, E>
fn clone(&self) -> NtfsIndexEntry<'s, E>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more