tvm_ffi

Macro match_any

match_any!() { /* proc-macro */ }
Expand description

Match payloads in Any, AnyView, object references or MutationView.

Write Type(value) to bind an owned or scalar result, NodeObj(ref node) to borrow an object node, or MutationView<Type>(capability) to transfer a mutation capability. Rust type aliases and qualified types are accepted. Arms are tried in order; end with an unguarded _ => ... fallback.

The input is evaluated and taken by value once. Use &value to retain its owner. Matching is strict: it does not coerce between value categories or truncate stored numeric values. Guards may reject a match and try the next arm.

Typed mutation capabilities do not support Map payloads, including nested Maps; use MutationView<Any> for those. Ordinary Map<K, V> arms are supported.