Struct wasmparser::BrTable
source · pub struct BrTable<'a> { /* private fields */ }
Expand description
A br_table entries representation.
Implementations
sourceimpl<'a> BrTable<'a>
impl<'a> BrTable<'a>
sourcepub fn read_table(&self) -> Result<(Box<[u32]>, u32)>
pub fn read_table(&self) -> Result<(Box<[u32]>, u32)>
Reads br_table entries.
Examples
let buf = vec![0x0e, 0x02, 0x01, 0x02, 0x00];
let mut reader = wasmparser::BinaryReader::new(&buf);
let op = reader.read_operator().unwrap();
if let wasmparser::Operator::BrTable { ref table } = op {
let br_table_depths = table.read_table().unwrap();
assert!(br_table_depths.0 == vec![1,2].into_boxed_slice() &&
br_table_depths.1 == 0);
} else {
unreachable!();
}
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for BrTable<'a>
impl<'a> Send for BrTable<'a>
impl<'a> Sync for BrTable<'a>
impl<'a> Unpin for BrTable<'a>
impl<'a> UnwindSafe for BrTable<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more