Struct mft::entry::MftEntry

source ·
pub struct MftEntry {
    pub header: EntryHeader,
    pub data: Vec<u8>,
    pub valid_fixup: Option<bool>,
}

Fields§

§header: EntryHeader§data: Vec<u8>§valid_fixup: Option<bool>

Valid fixup allows you to check if the fixup value in the entry’s blocks matched the fixup array value. It is optional because in the case of from_buffer_skip_fixup(), no fixup is even checked, thus, valid_fixup is None

Implementations§

source§

impl MftEntry

source

pub fn from_buffer(buffer: Vec<u8>, entry_number: u64) -> Result<MftEntry>

Initializes an MFT Entry from a buffer. Since the parser is the entity responsible for knowing the entry size, we take ownership of the buffer instead of trying to read it from stream.

source

pub fn from_buffer_skip_fixup( buffer: Vec<u8>, entry_number: u64 ) -> Result<MftEntry>

Initializes an MFT Entry from a buffer but skips checking and fixing the fixup array. This will throw InvalidEntrySignature error if the entry header is not valid.

source

pub fn find_best_name_attribute(&self) -> Option<FileNameAttr>

Retrieves most human-readable representation of a file path entry. Will prefer Win32 file name attributes, and fallback to Dos paths.

source

pub fn is_allocated(&self) -> bool

source

pub fn is_dir(&self) -> bool

source

pub fn iter_attributes(&self) -> impl Iterator<Item = Result<MftAttribute>> + '_

Returns an iterator over all the attributes of the entry.

source

pub fn iter_attributes_matching( &self, types: Option<Vec<MftAttributeType>> ) -> impl Iterator<Item = Result<MftAttribute>> + '_

Returns an iterator over the attributes in the list given in types, skips other attributes.

Trait Implementations§

source§

impl Clone for MftEntry

source§

fn clone(&self) -> MftEntry

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 Debug for MftEntry

source§

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

Formats the value using the given formatter. Read more
source§

impl Serialize for MftEntry

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.