[][src]Struct spirit::fragment::driver::IdMapping

pub struct IdMapping { /* fields omitted */ }

An object to map Instructions from multiple drivers into instruction sequences not containing duplicate IDs.

If one Driver uses services of some other slave drivers, it is up to the master to make sure instructions gathered from the slaves don't collide on IDs. This helps in that regard.

It is expected to be used as:

TODO Example

Implementations

impl IdMapping[src]

pub fn translate<'a, R, I>(
    &'a mut self,
    id_gen: &'a mut IdGen,
    instructions: I
) -> impl Iterator<Item = Instruction<R>> + 'a where
    R: 'a,
    I: IntoIterator<Item = Instruction<R>> + 'a, 
[src]

Assigns new IDs so they are unique within the IdMappings sharing the same id_gen.

This changes the IDs so they are unique. It also changes the IDs used in the drop instructions to reflect the original changes and DropAll is expanded to separate instructions (because in the bigger context of the master, all might mean resources from other slave drivers).

pub fn active_target_ids(&self) -> impl Iterator<Item = &CacheId>[src]

Lists the IDs that are active in the target (translated).

This can be used to, for example, generate instructions to completely „wipe“ the corresponding driver.

Trait Implementations

impl Clone for IdMapping[src]

impl Debug for IdMapping[src]

impl Default for IdMapping[src]

Auto Trait Implementations

impl RefUnwindSafe for IdMapping

impl Send for IdMapping

impl Sync for IdMapping

impl Unpin for IdMapping

impl UnwindSafe for IdMapping

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.