metacall_untyped

Function metacall_untyped 

Source
pub fn metacall_untyped(
    func: impl ToString,
    args: impl IntoIterator<Item = impl MetaCallValue>,
) -> Result<Box<dyn MetaCallValue>, MetaCallError>
Expand description

Calls a function same as metacall but returns a trait object of MetaCallValue. This is useful when you don’t know the return type of that function or the function may return multiple types. Checkout match_metacall_value for unwrapping the inner value. For example: …

let sum = metacall::metacall_untyped("sum", [1, 2]).unwrap();