gear_core::code

Struct TryNewCodeConfig

Source
pub struct TryNewCodeConfig {
Show 13 fields pub version: u32, pub stack_height: Option<u32>, pub data_segments_amount_limit: Option<u32>, pub table_number_limit: Option<u32>, pub export_stack_height: bool, pub check_exports: bool, pub check_imports: bool, pub check_and_canonize_stack_end: bool, pub check_mut_global_exports: bool, pub check_start_section: bool, pub check_data_section: bool, pub check_table_section: bool, pub make_validation: bool,
}
Expand description

Configuration for Code::try_new_mock_. By default all checks enabled.

Fields§

§version: u32

Instrumentation version

§stack_height: Option<u32>

Stack height limit

§data_segments_amount_limit: Option<u32>

Limit of data section amount

§table_number_limit: Option<u32>

Limit on the number of tables.

§export_stack_height: bool

Export STACK_HEIGHT_EXPORT_NAME global

§check_exports: bool

Check exports (wasm contains init or handle exports)

§check_imports: bool

Check imports (check that all imports are valid syscalls with correct signature)

§check_and_canonize_stack_end: bool

Check and canonize stack end

§check_mut_global_exports: bool

Check mutable global exports

§check_start_section: bool

Check start section (not allowed for programs)

§check_data_section: bool

Check data section

§check_table_section: bool

Check table section

§make_validation: bool

Make wasmparser validation

Implementations§

Source§

impl TryNewCodeConfig

Source

pub fn new_no_exports_check() -> Self

New default config without exports checks.

Trait Implementations§

Source§

impl Default for TryNewCodeConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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, 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.
Source§

impl<T> JsonSchemaMaybe for T