CoreExtern

Enum CoreExtern 

Source
pub enum CoreExtern {
    Func(CoreFuncType),
    Table {
        element_type: CoreRefType,
        initial: u64,
        maximum: Option<u64>,
        table64: bool,
        shared: bool,
    },
    Memory {
        memory64: bool,
        shared: bool,
        initial: u64,
        maximum: Option<u64>,
        page_size_log2: Option<u32>,
    },
    Global {
        val_type: CoreType,
        mutable: bool,
        shared: bool,
    },
    Tag(CoreFuncType),
}
Expand description

Represents a core extern imported or exported from a core module.

Variants§

§

Func(CoreFuncType)

The item is a function.

§

Table

The item is a table.

Fields

§element_type: CoreRefType

The table’s element type.

§initial: u64

Initial size of this table, in elements.

§maximum: Option<u64>

Optional maximum size of the table, in elements.

§table64: bool

Whether or not this is a 64-bit table, using i64 as an index. If this is false it’s a 32-bit memory using i32 as an index.

This is part of the memory64 proposal in WebAssembly.

§shared: bool

Whether or not this is a “shared” memory, indicating that it should be send-able across threads and the maximum field is always present for valid types.

This is part of the threads proposal in WebAssembly.

§

Memory

The item is a memory.

Fields

§memory64: bool

Whether or not this is a 64-bit memory, using i64 as an index. If this is false it’s a 32-bit memory using i32 as an index.

This is part of the memory64 proposal in WebAssembly.

§shared: bool

Whether or not this is a “shared” memory, indicating that it should be send-able across threads and the maximum field is always present for valid types.

This is part of the threads proposal in WebAssembly.

§initial: u64

Initial size of this memory, in wasm pages.

For 32-bit memories (when memory64 is false) this is guaranteed to be at most u32::MAX for valid types.

§maximum: Option<u64>

Optional maximum size of this memory, in wasm pages.

For 32-bit memories (when memory64 is false) this is guaranteed to be at most u32::MAX for valid types. This field is always present for valid wasm memories when shared is true.

§page_size_log2: Option<u32>

The log base 2 of the memory’s custom page size.

Memory pages are, by default, 64KiB large (i.e. 216 or 65536).

The custom-page-sizes proposal allows changing it to other values.

§

Global

The item is a global.

Fields

§val_type: CoreType

The global’s type.

§mutable: bool

Whether or not the global is mutable.

§shared: bool

Whether or not this is a “shared” memory, indicating that it should be send-able across threads and the maximum field is always present for valid types.

This is part of the threads proposal in WebAssembly.

§

Tag(CoreFuncType)

The item is a tag.

Trait Implementations§

Source§

impl Clone for CoreExtern

Source§

fn clone(&self) -> CoreExtern

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 CoreExtern

Source§

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

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

impl Display for CoreExtern

Source§

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

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

impl From<GlobalType> for CoreExtern

Source§

fn from(ty: GlobalType) -> Self

Converts to this type from the input type.
Source§

impl From<MemoryType> for CoreExtern

Source§

fn from(ty: MemoryType) -> Self

Converts to this type from the input type.
Source§

impl From<TableType> for CoreExtern

Source§

fn from(ty: TableType) -> Self

Converts to this type from the input type.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.