pub struct Attribute {
pub type_code: u32,
pub length: u32,
pub non_resident: bool,
pub name: Option<String>,
pub flags: u16,
pub attribute_id: u16,
pub offset: usize,
pub body: AttributeBody,
}Expand description
A parsed MFT attribute (common header + body discriminant).
Fields§
§type_code: u32Attribute type code (e.g. 0x80 for $DATA).
length: u32Total on-disk length of this attribute, including its header.
non_resident: booltrue when the value is stored out-of-line via a runlist.
name: Option<String>Decoded attribute name (e.g. an ADS stream name), or None when unnamed.
flags: u16Attribute flags (compressed / encrypted / sparse).
attribute_id: u16Attribute id, unique within the record.
offset: usizeByte offset of this attribute within the record.
body: AttributeBodyResident or non-resident body.
Implementations§
Source§impl Attribute
impl Attribute
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
true if the attribute is compressed.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
true if the attribute is encrypted (EFS).
Sourcepub fn type_name(&self) -> Option<&'static str>
pub fn type_name(&self) -> Option<&'static str>
Canonical $NAME of this attribute type, if known.
Sourcepub fn resident_content<'a>(&self, record: &'a [u8]) -> Option<&'a [u8]>
pub fn resident_content<'a>(&self, record: &'a [u8]) -> Option<&'a [u8]>
For a resident attribute, its value bytes within record. Returns None
for non-resident attributes or if the slice is out of bounds.
Trait Implementations§
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
impl UnwindSafe for Attribute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more