pub struct Formations {
    pub formations: Vec<Formation>,
    pub configurations: Vec<FormationConfiguration>,
    /* private fields */
}
Expand description

This struct represents a Local Formation. I.e. one the user can interact with on the CLI and can be (de)serialized locally.

A somewhat counter-intuitive thing about “Formations” and their models is the there is no “Formation Model” only a “Formation Configuration Model” This is because a “Formation” so to speak is really just a named collection of configurations and info about their traffic weights/activation statuses.

Fields§

§formations: Vec<Formation>

A list of “Formation“s

§configurations: Vec<FormationConfiguration>

A list of “Formation Configuration“s

We keep these separate from the Formation themselves because multiple formations can reference the same configuration.

Implementations§

Returns the removed FormationConfiguration by ID or None if there was no match

DANGER: this will invalidate any previously held indices after the removed item

Either updates a matching local Formation Configurations, or creates a new one. Returns the existing ID of the config that was updated if any

Either updates a matching local Formations by replacing the local IDs, or creates a new one. Returns NEW Formations IDs

Returns true if there is a Formation with the given name

Removes an exact name match, returning the removed Formation or None if nothing matched.

DANGER: this will invalidate any previously held indices after the removed item

Returns the index of an exact name match

Returns all indices of an exact name or partial ID match

Returns all indices of a partial name or ID match

Removes all indices

Removes the given flight from all formations that reference it

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
Deserialize this value from the given Serde deserializer. Read more
Allows one to save or deserialize what path the item was loaded from
If saved, get the path the item was loaded from
Only load from disk if yes is true, otherwise return None
Deserialize from some given path
Serialize this value into the given Serde serializer. Read more
Persist to path only if yes is true
Serializes itself to the given path

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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more