pub struct AttributeListEntry {
    pub attribute_type: u32,
    pub record_length: u16,
    pub name_length: u8,
    pub name_offset: u8,
    pub lowest_vcn: u64,
    pub segment_reference: MftReference,
    pub reserved: u16,
    pub name: String,
}
Expand description

An AttributeListAttr is made up off multiple AttributeListEntry structs. https://docs.microsoft.com/en-us/windows/win32/devnotes/attribute-list-entry

Fields§

§attribute_type: u32

The attribute code

§record_length: u16

This entry length

§name_length: u8

Attribute name length (0 means no name)

§name_offset: u8

Attribute name offset

§lowest_vcn: u64

This member is zero unless the attribute requires multiple file record segments and unless this entry is a reference to a segment other than the first one. In this case, this value is the lowest VCN that is described by the referenced segment.

§segment_reference: MftReference

The segments MFT reference

§reserved: u16

The attribute’s id

§name: String

The attribute’s name

Implementations§

source§

impl AttributeListEntry

source

pub fn from_stream<S: Read + Seek>(stream: &mut S) -> Result<AttributeListEntry>

Create AttributeListEntry from a stream.

Example

Parse a raw buffer.

use mft::attribute::x20::AttributeListEntry;
let attribute_buffer: &[u8] = &[
    0x10,0x00,0x00,0x00,0x20,0x00,0x00,0x1A,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x23,0x27,0x00,0x00,0x00,0x00,0x01,0x00,
    0x00,0x00,0x12,0x07,0x80,0xF8,0xFF,0xFF
];

let attribute_entry = AttributeListEntry::from_stream(
    &mut Cursor::new(attribute_buffer)
).unwrap();

assert_eq!(attribute_entry.attribute_type, 16);
assert_eq!(attribute_entry.record_length, 32);
assert_eq!(attribute_entry.name_length, 0);
assert_eq!(attribute_entry.name_offset, 26);
assert_eq!(attribute_entry.lowest_vcn, 0);
assert_eq!(attribute_entry.segment_reference.entry, 10019);
assert_eq!(attribute_entry.segment_reference.sequence, 1);
assert_eq!(attribute_entry.reserved, 0);
assert_eq!(attribute_entry.name, "".to_string());

Trait Implementations§

source§

impl Clone for AttributeListEntry

source§

fn clone(&self) -> AttributeListEntry

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 AttributeListEntry

source§

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

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

impl Serialize for AttributeListEntry

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.