pub struct BrTable<'a> { /* private fields */ }
Expand description

A br_table entries representation.

Implementations

Returns the number of br_table entries, not including the default label

Returns whether BrTable doesn’t have any labels apart from the default one.

Returns the default target of this br_table instruction.

Returns the list of targets that this br_table instruction will be jumping to.

This method will return an iterator which parses each target of this br_table except the default target. The returned iterator will yield self.len() elements.

Examples
let buf = [0x0e, 0x02, 0x01, 0x02, 0x00];
let mut reader = wasmparser_nostd::BinaryReader::new(&buf);
let op = reader.read_operator().unwrap();
if let wasmparser_nostd::Operator::BrTable { table } = op {
    let targets = table.targets().collect::<Result<Vec<_>, _>>().unwrap();
    assert_eq!(targets, [1, 2]);
}

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.