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

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

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(CacheId)

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.

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

impl<Resource> RefUnwindSafe for Instruction<Resource> where
    Resource: RefUnwindSafe

impl<Resource> Send for Instruction<Resource> where
    Resource: Send

impl<Resource> Sync for Instruction<Resource> where
    Resource: Sync

impl<Resource> Unpin for Instruction<Resource> where
    Resource: Unpin

impl<Resource> UnwindSafe for Instruction<Resource> where
    Resource: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.