Macro type_row

Source
macro_rules! type_row {
    () => { ... };
    ($($t:expr),+ $(,)?) => { ... };
    ($t:expr; $n:expr) => { ... };
}
Expand description

Creates a TypeRow backed by statically defined data, avoiding allocations.

The parameters must be constants of type Type.

For type rows that cannot be statically defined, use a vector or slice with TypeRow::from instead.

Example:

const U: Type = Type::UNIT;
let static_row: TypeRow = type_row![U, U];
let dynamic_row: TypeRow = vec![U, U, U].into();
let sig = Signature::new(static_row, dynamic_row);

let repeated_row: TypeRow = type_row![U; 3];
assert_eq!(repeated_row, *sig.output());