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§
Trait Implementations§
Source§impl Clone for ValidationConfig
impl Clone for ValidationConfig
Source§fn clone(&self) -> ValidationConfig
fn clone(&self) -> ValidationConfig
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 moreSource§impl Debug for ValidationConfig
impl Debug for ValidationConfig
Source§impl<'a> Parseable<'a, ValidationConfig> for Global
impl<'a> Parseable<'a, ValidationConfig> for Global
Source§fn parse(
ctx: ValidationConfig,
cursor: &mut Cursor<&'a [u8]>,
) -> ParseResult<Self>
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
impl<'a> Parseable<'a, ValidationConfig> for GlobalSection
Source§fn parse(
ctx: ValidationConfig,
cursor: &mut Cursor<&'a [u8]>,
) -> ParseResult<Self>
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.
impl Copy for ValidationConfig
Auto Trait Implementations§
impl Freeze for ValidationConfig
impl RefUnwindSafe for ValidationConfig
impl Send for ValidationConfig
impl Sync for ValidationConfig
impl Unpin for ValidationConfig
impl UnwindSafe for ValidationConfig
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