[−][src]Struct spirit::fragment::driver::IdMapping
An object to map Instruction
s 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:
- One mapping per slave driver, but sharing the
IdGen
. - All instructions from the slave are
translate
d through the mapping. - The mapping is only stored and cached if
confirm
is called.
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]
&'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,
Assigns new IDs so they are unique within the IdMapping
s 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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,