Struct mft::attribute::x20::AttributeListAttr
source · pub struct AttributeListAttr {
pub entries: Vec<AttributeListEntry>,
}
Expand description
The AttributeListAttr represents the $20 attribute, which contains a list of attribute entries in child entries.
Fields§
§entries: Vec<AttributeListEntry>
A list of AttributeListEntry that make up this AttributeListAttr
Implementations§
source§impl AttributeListAttr
impl AttributeListAttr
sourcepub fn from_stream<S: Read + Seek>(
stream: &mut S,
stream_size: Option<u64>
) -> Result<AttributeListAttr>
pub fn from_stream<S: Read + Seek>( stream: &mut S, stream_size: Option<u64> ) -> Result<AttributeListAttr>
Read AttributeListAttr from stream. Stream should be the size of the attribute’s data itself if no stream_size is passed in.
Example
Parse a raw buffer.
use mft::attribute::x20::AttributeListAttr;
let attribute_content_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,
0x30,0x00,0x00,0x00,0x20,0x00,0x00,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x23,0x27,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x69,0x00,0x6E,0x00,
0x30,0x00,0x00,0x00,0x20,0x00,0x00,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0xCF,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x8A,0x0C,0xA0,0xF8,0xFF,0xFF,
0x90,0x00,0x00,0x00,0x28,0x00,0x04,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0xCF,0x01,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x24,0x00,0x49,0x00,0x33,0x00,
0x30,0x00,0x79,0x00,0x73,0x00,0xAD,0xEF,0xA0,0x00,0x00,0x00,0x28,0x00,0x04,0x1A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xCF,0x01,0x00,0x00,0x00,0x02,0x00,
0x02,0x00,0x24,0x00,0x49,0x00,0x33,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x78,0x56,
0xB0,0x00,0x00,0x00,0x28,0x00,0x04,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0xCF,0x01,0x00,0x00,0x00,0x02,0x00,0x03,0x00,0x24,0x00,0x49,0x00,0x33,0x00,
0x30,0x00,0x00,0x00,0x00,0x00,0x65,0x00,0x00,0x01,0x00,0x00,0x30,0x00,0x09,0x1A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x27,0x00,0x00,0x00,0x00,0x01,0x00,
0x08,0x00,0x24,0x00,0x54,0x00,0x58,0x00,0x46,0x00,0x5F,0x00,0x44,0x00,0x41,0x00,
0x54,0x00,0x41,0x00,0x00,0x00,0x00,0x00
];
let attribute_list = AttributeListAttr::from_stream(
&mut Cursor::new(attribute_content_buffer),
None
).unwrap();
assert_eq!(attribute_list.entries.len(), 7);
Trait Implementations§
source§impl Clone for AttributeListAttr
impl Clone for AttributeListAttr
source§fn clone(&self) -> AttributeListAttr
fn clone(&self) -> AttributeListAttr
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more