pub struct MiddlewareBinaryReader<'a> {
state: MiddlewareReaderState<'a>,
chain: Vec<Box<dyn FunctionMiddleware>>,
}
Expand description
A Middleware binary reader of the WebAssembly structures and types.
Fields§
§state: MiddlewareReaderState<'a>
Parsing state.
chain: Vec<Box<dyn FunctionMiddleware>>
The backing middleware chain for this reader.
Implementations§
source§impl<'a> MiddlewareBinaryReader<'a>
impl<'a> MiddlewareBinaryReader<'a>
sourcepub fn new_with_offset(data: &'a [u8], original_offset: usize) -> Self
pub fn new_with_offset(data: &'a [u8], original_offset: usize) -> Self
Constructs a MiddlewareBinaryReader
with an explicit starting offset.
sourcepub fn set_middleware_chain(&mut self, stages: Vec<Box<dyn FunctionMiddleware>>)
pub fn set_middleware_chain(&mut self, stages: Vec<Box<dyn FunctionMiddleware>>)
Replaces the middleware chain with a new one.
Trait Implementations§
source§impl<'a> Debug for MiddlewareBinaryReader<'a>
impl<'a> Debug for MiddlewareBinaryReader<'a>
source§impl<'a> FunctionBinaryReader<'a> for MiddlewareBinaryReader<'a>
impl<'a> FunctionBinaryReader<'a> for MiddlewareBinaryReader<'a>
source§fn read_local_count(&mut self) -> WasmResult<u32>
fn read_local_count(&mut self) -> WasmResult<u32>
Read a
count
indicating the number of times to call read_local_decl
.source§fn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>
fn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>
Read a
(count, value_type)
declaration of local variables of the same type.source§fn read_operator(&mut self) -> WasmResult<Operator<'a>>
fn read_operator(&mut self) -> WasmResult<Operator<'a>>
Reads the next available
Operator
.source§fn current_position(&self) -> usize
fn current_position(&self) -> usize
Returns the current position.
source§fn original_position(&self) -> usize
fn original_position(&self) -> usize
Returns the original position (with the offset)
source§fn bytes_remaining(&self) -> usize
fn bytes_remaining(&self) -> usize
Returns the number of bytes remaining.
Auto Trait Implementations§
impl<'a> Freeze for MiddlewareBinaryReader<'a>
impl<'a> !RefUnwindSafe for MiddlewareBinaryReader<'a>
impl<'a> !Send for MiddlewareBinaryReader<'a>
impl<'a> !Sync for MiddlewareBinaryReader<'a>
impl<'a> Unpin for MiddlewareBinaryReader<'a>
impl<'a> !UnwindSafe for MiddlewareBinaryReader<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.