Enum wasm_encoder::Alias

source ·
pub enum Alias<'a> {
    InstanceExport {
        instance: u32,
        kind: ComponentExportKind,
        name: &'a str,
    },
    CoreInstanceExport {
        instance: u32,
        kind: ExportKind,
        name: &'a str,
    },
    Outer {
        kind: ComponentOuterAliasKind,
        count: u32,
        index: u32,
    },
}
Expand description

Different forms of aliases that can be inserted into a ComponentAliasSection.

Variants§

§

InstanceExport

Fields

§instance: u32

The index of the component instance that’s being aliased from.

§kind: ComponentExportKind

The kind of item that’s being extracted from the component instance.

§name: &'a str

The name of the export that’s being aliased.

An alias of a component instance export.

§

CoreInstanceExport

Fields

§instance: u32
§name: &'a str

Same as InstanceExport, but for core instances.

§

Outer

Fields

§kind: ComponentOuterAliasKind

The kind of item being aliased, either a type or a component.

§count: u32

Number of levels “up” to go to lookup the index within. Level 0 is the current scope and level 1 is the enclosing scope, and so on.

§index: u32

The index of the item to alias within the scope referenced by count.

Aliasing an item from an outer component.

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.