Struct wasm_encoder::MemArg

source ·
pub struct MemArg {
    pub offset: u64,
    pub align: u32,
    pub memory_index: u32,
}
Expand description

The immediate for a memory instruction.

Fields

offset: u64

A static offset to add to the instruction’s dynamic address operand.

This is a u64 field for the memory64 proposal, but 32-bit memories limit offsets to at most u32::MAX bytes. This will be encoded as a LEB but it won’t generate a valid module if an offset is specified which is larger than the maximum size of the index space for the memory indicated by memory_index.

align: u32

The expected alignment of the instruction’s dynamic address operand (expressed the exponent of a power of two).

memory_index: u32

The index of the memory this instruction is operating upon.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Encode the type into the given byte sink.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.