[][src]Struct mft::attribute::x30::FileNameAttr

pub struct FileNameAttr {
    pub parent: MftReference,
    pub created: DateTime<Utc>,
    pub modified: DateTime<Utc>,
    pub mft_modified: DateTime<Utc>,
    pub accessed: DateTime<Utc>,
    pub logical_size: u64,
    pub physical_size: u64,
    pub flags: FileAttributeFlags,
    pub reparse_value: u32,
    pub name_length: u8,
    pub namespace: FileNamespace,
    pub name: String,
}

Fields

parent: MftReferencecreated: DateTime<Utc>modified: DateTime<Utc>mft_modified: DateTime<Utc>accessed: DateTime<Utc>logical_size: u64physical_size: u64flags: FileAttributeFlagsreparse_value: u32name_length: u8namespace: FileNamespacename: String

Methods

impl FileNameAttr[src]

pub fn from_stream<S: ReadSeek>(stream: &mut S) -> Result<FileNameAttr>[src]

Parse a Filename attrbiute buffer.

Example

Parse a raw buffer.

use mft::attribute::x30::{FileNameAttr, FileNamespace};
let attribute_buffer: &[u8] = &[
	0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,
	0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,
	0xD5,0x2D,0x48,0x58,0x43,0x5F,0xCE,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x08,0x03,0x24,0x00,0x4C,0x00,0x6F,0x00,0x67,0x00,0x46,0x00,0x69,0x00,0x6C,0x00,
	0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00
];

let attribute = FileNameAttr::from_stream(&mut Cursor::new(attribute_buffer)).unwrap();

assert_eq!(attribute.parent.entry, 5);
assert_eq!(attribute.created.timestamp(), 1370144608);
assert_eq!(attribute.modified.timestamp(), 1370144608);
assert_eq!(attribute.mft_modified.timestamp(), 1370144608);
assert_eq!(attribute.accessed.timestamp(), 1370144608);
assert_eq!(attribute.logical_size, 67108864);
assert_eq!(attribute.physical_size, 67108864);
assert_eq!(attribute.flags.bits(), 6);
assert_eq!(attribute.reparse_value, 0);
assert_eq!(attribute.name_length, 8);
assert_eq!(attribute.namespace, FileNamespace::Win32AndDos);
assert_eq!(attribute.name, "$LogFile");

Trait Implementations

impl Clone for FileNameAttr[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for FileNameAttr[src]

impl Serialize for FileNameAttr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]