pub enum InstanceKind<'a> {
    Import {
        import: InlineImport<'a>,
        ty: ComponentTypeUse<'a, InstanceType<'a>>,
    },
    Instantiate {
        component: ItemRef<'a, component>,
        args: Vec<InstantiationArg<'a>>,
    },
    BundleOfExports(Vec<ComponentExport<'a>>),
}
Expand description

The kinds of instances in the text format.

Variants

Import

Fields

import: InlineImport<'a>

The name of the import

ty: ComponentTypeUse<'a, InstanceType<'a>>

The type of the instance being imported

The (instance (import "x")) sugar syntax

Instantiate

Fields

component: ItemRef<'a, component>

The component being instantiated.

args: Vec<InstantiationArg<'a>>

Arguments used to instantiate the instance.

Instantiate a component.

BundleOfExports(Vec<ComponentExport<'a>>)

The instance is defined by exporting local items as an instance.

Trait Implementations

Formats the value using the given formatter. Read more

Attempts to parse Self from parser, returning an error if it could not be parsed. Read more

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 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.