pub struct StandardInfoAttr {
    pub created: DateTime<Utc>,
    pub modified: DateTime<Utc>,
    pub mft_modified: DateTime<Utc>,
    pub accessed: DateTime<Utc>,
    pub file_flags: FileAttributeFlags,
    pub max_version: u32,
    pub version: u32,
    pub class_id: u32,
    pub owner_id: u32,
    pub security_id: u32,
    pub quota: u64,
    pub usn: u64,
}

Fields§

§created: DateTime<Utc>§modified: DateTime<Utc>§mft_modified: DateTime<Utc>§accessed: DateTime<Utc>§file_flags: FileAttributeFlags

DOS File Permissions

§max_version: u32§version: u32§class_id: u32§owner_id: u32§security_id: u32§quota: u64§usn: u64

Implementations§

source§

impl StandardInfoAttr

source

pub fn from_reader<S: Read + Seek>(reader: &mut S) -> Result<StandardInfoAttr>

Parse a Standard Information attrbiute buffer.

Example

Parse a raw buffer.

use mft::attribute::x10::StandardInfoAttr;
use mft::attribute::FileAttributeFlags;
let attribute_buffer: &[u8] = &[
    0x2F,0x6D,0xB6,0x6F,0x0C,0x97,0xCE,0x01,0x56,0xCD,0x1A,0x75,0x73,0xB5,0xCE,0x01,
    0x56,0xCD,0x1A,0x75,0x73,0xB5,0xCE,0x01,0x56,0xCD,0x1A,0x75,0x73,0xB5,0xCE,0x01,
    0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0xB0,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x68,0x58,0xA0,0x0A,0x02,0x00,0x00,0x00
];

let attribute = StandardInfoAttr::from_reader(&mut Cursor::new(attribute_buffer)).unwrap();

assert_eq!(attribute.created.timestamp(), 1376278290);
assert_eq!(attribute.modified.timestamp(), 1379621073);
assert_eq!(attribute.mft_modified.timestamp(), 1379621073);
assert_eq!(attribute.accessed.timestamp(), 1379621073);
assert_eq!(attribute.file_flags.bits(), 32);
assert_eq!(attribute.max_version, 0);
assert_eq!(attribute.version, 0);
assert_eq!(attribute.class_id, 0);
assert_eq!(attribute.security_id, 1456);
assert_eq!(attribute.quota, 0);
assert_eq!(attribute.usn, 8768215144);

Trait Implementations§

source§

impl Clone for StandardInfoAttr

source§

fn clone(&self) -> StandardInfoAttr

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 StandardInfoAttr

source§

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

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

impl Serialize for StandardInfoAttr

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.