use crate::parser::{ByteOrder, Parser};
use crate::{Error, Head};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct CdRom {
pub boot_entry: u32,
pub partition_start: u64,
pub partition_size: u64,
}
impl<'a> TryFrom<Head<'a>> for CdRom {
type Error = Error;
fn try_from(mut node: Head<'a>) -> Result<Self, Self::Error> {
Ok(Self {
boot_entry: node.data.parse(ByteOrder::Little)?,
partition_start: node.data.parse(ByteOrder::Little)?,
partition_size: node.data.finish(ByteOrder::Little)?,
})
}
}