Struct Compilation

Source
pub struct Compilation { /* private fields */ }
Expand description

The result of compiling a WebAssembly module’s functions.

Implementations§

Source§

impl Compilation

Source

pub fn new( functions: Functions, custom_sections: CustomSections, function_call_trampolines: PrimaryMap<SignatureIndex, FunctionBody>, dynamic_function_trampolines: PrimaryMap<FunctionIndex, FunctionBody>, debug: Option<Dwarf>, trampolines: Option<TrampolinesSection>, ) -> Self

Creates a compilation artifact from a contiguous function buffer and a set of ranges

Source

pub fn get(&self, func: LocalFunctionIndex) -> &CompiledFunction

Gets the bytes of a single function

Source

pub fn len(&self) -> usize

Gets the number of functions defined.

Source

pub fn is_empty(&self) -> bool

Returns whether there are no functions defined.

Source

pub fn get_relocations(&self) -> PrimaryMap<LocalFunctionIndex, Vec<Relocation>>

Gets functions relocations.

Source

pub fn get_function_bodies( &self, ) -> PrimaryMap<LocalFunctionIndex, FunctionBody>

Gets functions bodies.

Source

pub fn get_jt_offsets(&self) -> PrimaryMap<LocalFunctionIndex, JumpTableOffsets>

Gets functions jump table offsets.

Source

pub fn get_frame_info( &self, ) -> PrimaryMap<LocalFunctionIndex, CompiledFunctionFrameInfo>

Gets functions frame info.

Source

pub fn get_function_call_trampolines( &self, ) -> PrimaryMap<SignatureIndex, FunctionBody>

Gets function call trampolines.

Source

pub fn get_dynamic_function_trampolines( &self, ) -> PrimaryMap<FunctionIndex, FunctionBody>

Gets function call trampolines.

Source

pub fn get_custom_sections(&self) -> PrimaryMap<SectionIndex, CustomSection>

Gets custom section data.

Source

pub fn get_custom_section_relocations( &self, ) -> PrimaryMap<SectionIndex, Vec<Relocation>>

Gets relocations that apply to custom sections.

Source

pub fn get_debug(&self) -> Option<Dwarf>

Returns the Dwarf info.

Source

pub fn get_trampolines(&self) -> Option<TrampolinesSection>

Returns the Trampolines info.

Trait Implementations§

Source§

impl Debug for Compilation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> IntoIterator for &'a Compilation

Source§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
Source§

type Item = <<&'a Compilation as IntoIterator>::IntoIter as Iterator>::Item

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for Compilation

Source§

fn eq(&self, other: &Compilation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Compilation

Source§

impl StructuralPartialEq for Compilation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.