[−][src]Struct parity_wasm::elements::Module
WebAssembly module
Methods
impl Module
[src]
impl Module
pub fn new(sections: Vec<Section>) -> Self
[src]
pub fn new(sections: Vec<Section>) -> Self
New module with sections
pub fn into_sections(self) -> Vec<Section>
[src]
pub fn into_sections(self) -> Vec<Section>
Destructure the module, yielding sections
pub fn version(&self) -> u32
[src]
pub fn version(&self) -> u32
Version of module.
pub fn sections(&self) -> &[Section]
[src]
pub fn sections(&self) -> &[Section]
Sections list. Each known section is optional and may appear at most once.
pub fn sections_mut(&mut self) -> &mut Vec<Section>
[src]
pub fn sections_mut(&mut self) -> &mut Vec<Section>
Sections list (mutable) Each known section is optional and may appear at most once.
pub fn code_section(&self) -> Option<&CodeSection>
[src]
pub fn code_section(&self) -> Option<&CodeSection>
Code section reference, if any.
pub fn code_section_mut(&mut self) -> Option<&mut CodeSection>
[src]
pub fn code_section_mut(&mut self) -> Option<&mut CodeSection>
Code section mutable reference, if any.
pub fn type_section(&self) -> Option<&TypeSection>
[src]
pub fn type_section(&self) -> Option<&TypeSection>
Types section reference, if any.
pub fn type_section_mut(&mut self) -> Option<&mut TypeSection>
[src]
pub fn type_section_mut(&mut self) -> Option<&mut TypeSection>
Types section mutable reference, if any.
pub fn import_section(&self) -> Option<&ImportSection>
[src]
pub fn import_section(&self) -> Option<&ImportSection>
Imports section reference, if any.
pub fn import_section_mut(&mut self) -> Option<&mut ImportSection>
[src]
pub fn import_section_mut(&mut self) -> Option<&mut ImportSection>
Imports section mutable reference, if any.
pub fn global_section(&self) -> Option<&GlobalSection>
[src]
pub fn global_section(&self) -> Option<&GlobalSection>
Globals section reference, if any.
pub fn global_section_mut(&mut self) -> Option<&mut GlobalSection>
[src]
pub fn global_section_mut(&mut self) -> Option<&mut GlobalSection>
Globals section mutable reference, if any.
pub fn export_section(&self) -> Option<&ExportSection>
[src]
pub fn export_section(&self) -> Option<&ExportSection>
Exports section reference, if any.
pub fn export_section_mut(&mut self) -> Option<&mut ExportSection>
[src]
pub fn export_section_mut(&mut self) -> Option<&mut ExportSection>
Exports section mutable reference, if any.
pub fn table_section(&self) -> Option<&TableSection>
[src]
pub fn table_section(&self) -> Option<&TableSection>
Table section reference, if any.
pub fn table_section_mut(&mut self) -> Option<&mut TableSection>
[src]
pub fn table_section_mut(&mut self) -> Option<&mut TableSection>
Table section mutable reference, if any.
pub fn data_section(&self) -> Option<&DataSection>
[src]
pub fn data_section(&self) -> Option<&DataSection>
Data section reference, if any.
pub fn data_section_mut(&mut self) -> Option<&mut DataSection>
[src]
pub fn data_section_mut(&mut self) -> Option<&mut DataSection>
Data section mutable reference, if any.
pub fn elements_section(&self) -> Option<&ElementSection>
[src]
pub fn elements_section(&self) -> Option<&ElementSection>
Element section reference, if any.
pub fn elements_section_mut(&mut self) -> Option<&mut ElementSection>
[src]
pub fn elements_section_mut(&mut self) -> Option<&mut ElementSection>
Element section mutable reference, if any.
pub fn memory_section(&self) -> Option<&MemorySection>
[src]
pub fn memory_section(&self) -> Option<&MemorySection>
Memory section reference, if any.
pub fn memory_section_mut(&mut self) -> Option<&mut MemorySection>
[src]
pub fn memory_section_mut(&mut self) -> Option<&mut MemorySection>
Memory section mutable reference, if any.
pub fn function_section(&self) -> Option<&FunctionSection>
[src]
pub fn function_section(&self) -> Option<&FunctionSection>
Functions signatures section reference, if any.
pub fn function_section_mut(&mut self) -> Option<&mut FunctionSection>
[src]
pub fn function_section_mut(&mut self) -> Option<&mut FunctionSection>
Functions signatures section mutable reference, if any.
pub fn start_section(&self) -> Option<u32>
[src]
pub fn start_section(&self) -> Option<u32>
Start section, if any.
pub fn names_section(&self) -> Option<&NameSection>
[src]
pub fn names_section(&self) -> Option<&NameSection>
Functions signatures section reference, if any.
NOTE: name section is not parsed by default so names_section
could return None even if name section exists.
Call parse_names
to parse name section
pub fn names_section_mut(&mut self) -> Option<&mut NameSection>
[src]
pub fn names_section_mut(&mut self) -> Option<&mut NameSection>
Functions signatures section mutable reference, if any.
NOTE: name section is not parsed by default so names_section
could return None even if name section exists.
Call parse_names
to parse name section
pub fn parse_names(self) -> Result<Self, (Vec<(usize, Error)>, Self)>
[src]
pub fn parse_names(self) -> Result<Self, (Vec<(usize, Error)>, Self)>
Try to parse name section in place Corresponding custom section with proper header will convert to name sections If some of them will fail to be decoded, Err variant is returned with the list of (index, Error) tuples of failed sections.
pub fn parse_reloc(self) -> Result<Self, (Vec<(usize, Error)>, Self)>
[src]
pub fn parse_reloc(self) -> Result<Self, (Vec<(usize, Error)>, Self)>
Try to parse reloc section in place Corresponding custom section with proper header will convert to reloc sections If some of them will fail to be decoded, Err variant is returned with the list of (index, Error) tuples of failed sections.
pub fn import_count(&self, count_type: ImportCountType) -> usize
[src]
pub fn import_count(&self, count_type: ImportCountType) -> usize
Count imports by provided type
pub fn functions_space(&self) -> usize
[src]
pub fn functions_space(&self) -> usize
Query functions space
pub fn globals_space(&self) -> usize
[src]
pub fn globals_space(&self) -> usize
Query globals space
pub fn table_space(&self) -> usize
[src]
pub fn table_space(&self) -> usize
Query table space
pub fn memory_space(&self) -> usize
[src]
pub fn memory_space(&self) -> usize
Query memory space
Trait Implementations
impl Deserialize for Module
[src]
impl Deserialize for Module
type Error = Error
Serialization error produced by deserialization routine.
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, Self::Error>
[src]
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, Self::Error>
Deserialize type from serial i/o
impl Serialize for Module
[src]
impl Serialize for Module
type Error = Error
Serialization error produced by serialization routine.
fn serialize<W: Write>(self, w: &mut W) -> Result<(), Self::Error>
[src]
fn serialize<W: Write>(self, w: &mut W) -> Result<(), Self::Error>
Serialize type to serial i/o
impl Clone for Module
[src]
impl Clone for Module
fn clone(&self) -> Module
[src]
fn clone(&self) -> Module
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for Module
[src]
impl Default for Module
impl PartialEq<Module> for Module
[src]
impl PartialEq<Module> for Module
fn eq(&self, other: &Module) -> bool
[src]
fn eq(&self, other: &Module) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Module) -> bool
[src]
fn ne(&self, other: &Module) -> bool
This method tests for !=
.
impl Debug for Module
[src]
impl Debug for Module
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,