Struct ValidationConfig

Source
pub struct ValidationConfig {
    pub allow_globals_in_init: bool,
    pub allow_sign_extension_instr: bool,
}
Expand description

Configuration for module validation. This determines the features of Wasm we support or not, depending on the protocol version.

Some Wasm features are not supported in any protocol versions, so are not part of this configuration. These include imported globals, floating point types, floating point operations, etc.

Fields§

§allow_globals_in_init: bool

Allow locally defined globals in constant expressions when initializing data and element sections. In protocols 1-5 this was allowed, but we need to disallow it in following protocols since the Wasm spec has been updated to not allow this anymore. See issue on the Wasm spec repository.

§allow_sign_extension_instr: bool

Allow sign extension instructions. See proposal.

Implementations§

Source§

impl ValidationConfig

Source

pub const V0: Self

Validation configuration valid in protocols 1-5.

Source

pub const V1: Self

Validation configuration valid in protocol 6 and onward.

Trait Implementations§

Source§

impl Clone for ValidationConfig

Source§

fn clone(&self) -> ValidationConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidationConfig

Source§

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

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

impl<'a> Parseable<'a, ValidationConfig> for Global

Source§

fn parse( ctx: ValidationConfig, cursor: &mut Cursor<&'a [u8]>, ) -> ParseResult<Self>

Read a value from the cursor, or signal error. This function is responsible for advancing the cursor in-line with the data it has read.
Source§

impl<'a> Parseable<'a, ValidationConfig> for GlobalSection

Source§

fn parse( ctx: ValidationConfig, cursor: &mut Cursor<&'a [u8]>, ) -> ParseResult<Self>

Read a value from the cursor, or signal error. This function is responsible for advancing the cursor in-line with the data it has read.
Source§

impl Copy for ValidationConfig

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> 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.