Implement bc make ext xml

This commit is contained in:
QuantumEntangledAndy authored and Andrew committed 2020-10-15 10:59:22 +07:00
1 parent affc0d9b94
commit 5baacbeeed
2 files changed
+13 -1

No files matched your search

+11 -1
View File
@@ -1,4 +1,4 @@
use super::xml::BcXml;
use super::xml::{BcXml, Extension, TopBcXmls};
use std::collections::HashSet;
pub(super) const MAGIC_HEADER: u32 = 0xabcdef0;
@@ -81,6 +81,16 @@ impl Bc {
}),
}
}
pub fn new_from_ext_xml(meta: BcMeta, xml: Extension) -> Bc {
Bc {
meta,
body: BcBody::ModernMsg(ModernMsg {
xml: Some(TopBcXmls::Extension(xml)),
binary: None,
}),
}
}
}
impl Default for BcContext {
+2
View File
@@ -125,6 +125,8 @@ pub struct Preview {
#[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)]
pub struct Extension {
#[yaserde(attribute)]
pub version: String,
#[yaserde(rename = "binaryData")]
pub binary_data: u32,
}