clone_solana_instruction/
wasm.rs1use {crate::Instruction, wasm_bindgen::prelude::*};
5
6#[wasm_bindgen]
7#[derive(Default)]
8pub struct Instructions {
9 instructions: std::vec::Vec<Instruction>,
10}
11
12#[wasm_bindgen]
13impl Instructions {
14 #[wasm_bindgen(constructor)]
15 pub fn constructor() -> Instructions {
16 Instructions::default()
17 }
18
19 pub fn push(&mut self, instruction: Instruction) {
20 self.instructions.push(instruction);
21 }
22}
23
24impl From<Instructions> for std::vec::Vec<Instruction> {
25 fn from(instructions: Instructions) -> Self {
26 instructions.instructions
27 }
28}