[][src]Macro fbxcel::tree_v7400

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)*) => { ... };
}

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", 3.14f32, &b"BINARY"[..]] {}
};