Macro fbxcel::tree_v7400
source · [−]macro_rules! tree_v7400 {
(@__node, $tree:ident, $parent:ident,) => { ... };
(@__node, $tree:ident, $parent:ident, , $($rest:tt)*) => { ... };
(@__node, $tree:ident, $parent:ident,
$name:ident: {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
(@__node, $tree:ident, $parent:ident,
$name:ident: [$($attr:expr),* $(,)?] {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
(@__node, $tree:ident, $parent:ident,
$name:ident: ($attrs:expr) {
$($subtree:tt)*
}
$($rest:tt)*
) => { ... };
($($rest:tt)*) => { ... };
}
Available on crate feature
tree
only.Expand description
Constructs a tree.
Enabled by tree
feature.
Examples
let empty_tree = tree_v7400! {};
let tree = tree_v7400! {
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"[..]] {}
};