use crate::err::Result;
use crate::ReadSeek;
use byteorder::{LittleEndian, ReadBytesExt};
use serde::Serialize;
#[derive(Serialize, Clone, Debug)]
pub struct IndexRootAttr {
pub attribute_type: u32,
pub collation_rule: u32,
pub index_entry_size: u32,
pub index_entry_number_of_cluster_blocks: u32,
}
impl IndexRootAttr {
pub fn from_stream<S: ReadSeek>(stream: &mut S) -> Result<IndexRootAttr> {
Ok(IndexRootAttr {
attribute_type: stream.read_u32::<LittleEndian>()?,
collation_rule: stream.read_u32::<LittleEndian>()?,
index_entry_size: stream.read_u32::<LittleEndian>()?,
index_entry_number_of_cluster_blocks: stream.read_u32::<LittleEndian>()?,
})
}
}