use alloc::string::String;
use crate::parser::{ByteOrder, Format, Parser};
use crate::{Error, Head};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BootSpec {
pub device_type: u16,
pub status_flag: u16,
pub description: String,
}
impl TryFrom<Head<'_>> for BootSpec {
type Error = Error;
fn try_from(mut node: Head<'_>) -> Result<Self, Self::Error> {
Ok(Self {
device_type: node.data.parse(ByteOrder::Little)?,
status_flag: node.data.parse(ByteOrder::Little)?,
description: node.data.finish(Format::Utf8(None))?,
})
}
}