Enum spirit::fragment::driver::Instruction[][src]

pub enum Instruction<Resource> {
    DropAll,
    DropSpecific(CacheId),
    Install {
        id: CacheId,
        resource: Resource,
    },
}
Expand description

One instruction from the Driver.

The Driver issues instructions to the rest of the Pipeline. They either ask it to install a new resource or to remove some previous resources.

Variants

DropAll

Instruction for the Pipeline to remove all active resources produced by this driver.

This is legal to use even in cases when the set of active resources is empty (this drops nothing) or if the resources are not uniquely separately identifiable.

DropSpecific

Instruction for the Pipeline to remove a specific resource.

It is a contract violation if this ID doesn’t correspond to exactly one active resource and the Pipeline may panic or misbehave under such circumstances. Specifically, it is not allowed to refer to resource that is no longer active (was dropped previously), never existed or to use a non-unique ID here.

Tuple Fields of DropSpecific

0: CacheId
Install

Installs another resource.

The resource is identified with an id, so it can be referenced in the future. It is allowed to reuse a no longer used ID. It is not allowed to produce non-unique IDs for active resources.

Fields of Install

id: CacheId

The ID this resource will be identified as.

resource: Resource

The resource to install.

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

Performs the conversion.

Performs the conversion.

Turns self into the result.

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.