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

pub struct IdMapping { /* fields omitted */ }
Expand description

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:

  • One mapping per slave driver, but sharing the IdGen.
  • All instructions from the slave are translated through the mapping.
  • The mapping is only stored and cached if confirm is called.

TODO Example

Implementations

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

Turns self into the result.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.