Add mount builder

master
D4VID 4 weeks ago
parent 77ff0310b4
commit 1d31d2d8e0

@ -145,6 +145,7 @@ impl CircuitBoard {
return custom_data;
}
}
pub struct Label<'a> {
text: &'a str,
color: Vec<u8>,
@ -225,6 +226,18 @@ impl<'a> Label<'a> {
}
}
pub struct Mount {
height: Int,
}
impl Mount {
pub fn new(height: Int) -> Self {
Self { height }
}
pub fn custom_data(&self) -> Vec<u8> {
return Vec::from(self.height.to_le_bytes());
}
}
impl<T: BinarySerializable> BinarySerializable for Vec<T> {
fn write_to<W: Write>(&self, writer: &mut W) -> io::Result<()> {
writer.write_all(&(self.len() as Int).to_le_bytes())?;

Loading…
Cancel
Save