use crate::parser::{ByteOrder, Parser};
use crate::{Error, Head};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct RamDisk {
pub start: u64,
pub end: u64,
pub guid: [u8; 16],
pub instance: u16,
}
impl<'a> TryFrom<Head<'a>> for RamDisk {
type Error = Error;
fn try_from(mut node: Head<'a>) -> Result<Self, Self::Error> {
Ok(Self {
start: node.data.parse(ByteOrder::Little)?,
end: node.data.parse(ByteOrder::Little)?,
guid: node.data.parse(())?,
instance: node.data.finish(ByteOrder::Little)?,
})
}
}