Struct FunctionBody
pub struct FunctionBody<'a> { /* private fields */ }
Expand description
Represents a WebAssembly function body.
Implementations§
§impl<'a> FunctionBody<'a>
impl<'a> FunctionBody<'a>
pub fn new(reader: BinaryReader<'a>) -> FunctionBody<'a>
pub fn new(reader: BinaryReader<'a>) -> FunctionBody<'a>
Constructs a new FunctionBody
for the given data and offset.
pub fn get_binary_reader(&self) -> BinaryReader<'a>
pub fn get_binary_reader(&self) -> BinaryReader<'a>
Gets a binary reader for this function body.
pub fn get_locals_reader(&self) -> Result<LocalsReader<'a>, BinaryReaderError>
pub fn get_locals_reader(&self) -> Result<LocalsReader<'a>, BinaryReaderError>
Gets the locals reader for this function body.
pub fn get_binary_reader_for_operators(
&self,
) -> Result<BinaryReader<'a>, BinaryReaderError>
pub fn get_binary_reader_for_operators( &self, ) -> Result<BinaryReader<'a>, BinaryReaderError>
Gets a binary reader for this function body, after skipping locals.
pub fn get_operators_reader(
&self,
) -> Result<OperatorsReader<'a>, BinaryReaderError>
pub fn get_operators_reader( &self, ) -> Result<OperatorsReader<'a>, BinaryReaderError>
Uses FunctionBody::get_binary_reader_for_operators
and then converts
that to an OperatorsReader
.
Trait Implementations§
§impl<'a> Clone for FunctionBody<'a>
impl<'a> Clone for FunctionBody<'a>
§fn clone(&self) -> FunctionBody<'a>
fn clone(&self) -> FunctionBody<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<'a> Debug for FunctionBody<'a>
impl<'a> Debug for FunctionBody<'a>
§impl<'a> FromReader<'a> for FunctionBody<'a>
impl<'a> FromReader<'a> for FunctionBody<'a>
§fn from_reader(
reader: &mut BinaryReader<'a>,
) -> Result<FunctionBody<'a>, BinaryReaderError>
fn from_reader( reader: &mut BinaryReader<'a>, ) -> Result<FunctionBody<'a>, BinaryReaderError>
Attempts to read
Self
from the provided binary reader, returning an
error if it is unable to do so.Auto Trait Implementations§
impl<'a> Freeze for FunctionBody<'a>
impl<'a> RefUnwindSafe for FunctionBody<'a>
impl<'a> Send for FunctionBody<'a>
impl<'a> Sync for FunctionBody<'a>
impl<'a> Unpin for FunctionBody<'a>
impl<'a> UnwindSafe for FunctionBody<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more