Struct ntfs::NtfsAttribute
source[−]pub struct NtfsAttribute<'n, 'f> { /* private fields */ }Expand description
A single NTFS Attribute of an NtfsFile.
Not to be confused with NtfsFileAttributeFlags.
This structure is returned by the NtfsAttributesRaw iterator as well as NtfsAttributeItem::to_attribute.
Reference: https://flatcap.github.io/linux-ntfs/ntfs/concepts/attribute_header.html
Implementations
Returns the length of this NTFS Attribute, in bytes.
This denotes the length of the attribute structure on disk. Apart from various headers, this structure also includes the name and, for resident attributes, the actual value.
Returns flags set for this attribute as specified by NtfsAttributeFlags.
Returns the identifier of this attribute that is unique within the NtfsFile.
Returns true if this is a resident attribute, i.e. one where its value
is part of the attribute structure.
Gets the name of this NTFS Attribute (if any) and returns it wrapped in an NtfsString.
Note that most NTFS attributes have no name and are distinguished by their types.
Use NtfsAttribute::ty to get the attribute type.
Returns the length of the name of this NTFS Attribute, in bytes.
An attribute name has a maximum length of 255 UTF-16 code points (510 bytes).
It is always part of the attribute itself and hence also of the length
returned by NtfsAttribute::attribute_length.
Returns the absolute position of this NTFS Attribute within the filesystem, in bytes.
pub fn resident_structured_value<S>(&self) -> Result<S> where
S: NtfsStructuredValueFromResidentAttributeValue<'n, 'f>,
pub fn resident_structured_value<S>(&self) -> Result<S> where
S: NtfsStructuredValueFromResidentAttributeValue<'n, 'f>,
Attempts to parse the value data as the given resident structured value type and returns that.
This is a fast path for attributes that are always resident. It doesn’t need a reference to the filesystem reader.
This function first checks that the attribute is of the required type for that structured value and if it’s a resident attribute. It returns with an error if that is not the case. It also returns an error for any parsing problem.
pub fn structured_value<T, S>(&self, fs: &mut T) -> Result<S> where
T: Read + Seek,
S: NtfsStructuredValue<'n, 'f>,
pub fn structured_value<T, S>(&self, fs: &mut T) -> Result<S> where
T: Read + Seek,
S: NtfsStructuredValue<'n, 'f>,
Attempts to parse the value data as the given structured value type and returns that.
This function first checks that the attribute is of the required type for that structured value. It returns with an error if that is not the case. It also returns an error for any parsing problem.
Returns the type of this NTFS Attribute, or NtfsError::UnsupportedAttributeType
if it’s an unknown type.
Returns an NtfsAttributeValue structure to read the value of this NTFS Attribute.
Returns the length of the value data of this NTFS Attribute, in bytes.
Trait Implementations
Auto Trait Implementations
impl<'n, 'f> RefUnwindSafe for NtfsAttribute<'n, 'f>
impl<'n, 'f> Send for NtfsAttribute<'n, 'f>
impl<'n, 'f> Sync for NtfsAttribute<'n, 'f>
impl<'n, 'f> Unpin for NtfsAttribute<'n, 'f> where
'n: 'f,
impl<'n, 'f> UnwindSafe for NtfsAttribute<'n, 'f>
Blanket Implementations
Mutably borrows from an owned value. Read more
