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,

source

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.

source

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).

source

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.

source

pub fn flags(&self) -> NtfsIndexEntryFlags

Returns flags set for this attribute as specified by NtfsIndexEntryFlags.

source

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).

source

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.

source

pub fn key_length(&self) -> u16

Returns the length of the key of this Index Entry.

source

pub fn position(&self) -> NtfsPosition

Returns the absolute position of this NTFS Index Entry within the filesystem, in bytes.

source

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.

source

pub fn to_file<'n, T>(&self, ntfs: &'n Ntfs, fs: &mut T) -> Result<NtfsFile<'n>>where E: NtfsIndexEntryHasFileReference, T: Read + Seek,

Returns an NtfsFile for the file referenced by this Index Entry.

Trait Implementations§

source§

impl<'s, E> Clone for NtfsIndexEntry<'s, E>where E: NtfsIndexEntryType + Clone,

source§

fn clone(&self) -> NtfsIndexEntry<'s, E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'s, E> Debug for NtfsIndexEntry<'s, E>where E: NtfsIndexEntryType + Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s, E> RefUnwindSafe for NtfsIndexEntry<'s, E>where E: RefUnwindSafe,

§

impl<'s, E> Send for NtfsIndexEntry<'s, E>where E: Send,

§

impl<'s, E> Sync for NtfsIndexEntry<'s, E>where E: Sync,

§

impl<'s, E> Unpin for NtfsIndexEntry<'s, E>where E: Unpin,

§

impl<'s, E> UnwindSafe for NtfsIndexEntry<'s, E>where E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.