Macro fbxcel::write_v7400_binary
source · [−]macro_rules! write_v7400_binary {
(
writer=$writer:expr,
tree={$($tree:tt)*},
) => { ... };
(@__node, $writer:ident,) => { ... };
(@__node, $writer:ident, , $($tree:tt)*) => { ... };
(@__node, $writer:ident,
$name:ident: {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
(@__node, $writer:ident,
$name:ident: [$($attr:expr),* $(,)?] {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
(@__node, $writer:ident,
$name:ident: ($attrs:expr) {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
(@__attr, $attrs:ident, $attr:expr) => { ... };
}
Available on crate feature
writer
only.Expand description
Drives the given writer to write the given tree as FBX binary, and returns
the fbxcel::writer::v7400::binary::Result<()>
.
Enabled by writer
feature.
Examples
use fbxcel::{low::FbxVersion, writer::v7400::binary::Writer};
let mut writer = Writer::new(std::io::Cursor::new(Vec::new()), FbxVersion::V7_4)?;
write_v7400_binary!(
writer=writer,
tree={
Node0: {
Node0_0: {}
Node0_1: {}
}
Node1: {
// You can use trailing comma.
Node1_0: {},
Node1_1: {},
}
// Use parens to specify attributes by single array.
// Note that the expression inside parens should implement
// `IntoIterator<Item = AttributeValue>`.
Node2: (vec!["hello".into(), "world".into(), 42i32.into()]) {}
// Use brackets to specify attributes one by one.
Node3: ["hello", "world", 1.234f32, &b"BINARY"[..]] {}
},
)?;
let _buf = writer.finalize_and_flush(&Default::default())?;