Macro soroban_sdk::vec

source ·
macro_rules! vec {
    ($env:expr $(,)?) => { ... };
    ($env:expr, $($x:expr),+ $(,)?) => { ... };
}
Expand description

Create a Vec with the given items.

The first argument in the list must be a reference to an Env, then the items follow.

Examples

use soroban_sdk::{Env, vec};

let env = Env::default();
let vec = vec![&env, 0, 1, 2, 3];
assert_eq!(vec.len(), 4);