pub struct Migration {
pub iri: String,
pub from: ChartVersion,
pub to: ChartVersion,
pub configurations: Vec<(BTreeSet<String>, BTreeSet<String>)>,
pub states: BTreeMap<String, String>,
pub transform: Transform,
}Expand description
A declared migration between two chart versions: a configuration mapping and a datamodel
transform. Configurations not listed explicitly map state by state through
Migration::states, and a state not listed there maps to the state with the same id in the
new version, if it has one (the derived identity mapping).
Fields§
§iri: StringThe migration’s IRI.
from: ChartVersionThe version it migrates from.
to: ChartVersionThe version it migrates to.
configurations: Vec<(BTreeSet<String>, BTreeSet<String>)>Explicit configuration mappings (old active state ids to new active state ids).
states: BTreeMap<String, String>State renames applied to configurations without an explicit mapping.
transform: TransformThe datamodel transform.
Implementations§
Source§impl Migration
impl Migration
Sourcepub fn identity(
iri: impl Into<String>,
from: ChartVersion,
to: ChartVersion,
) -> Self
pub fn identity( iri: impl Into<String>, from: ChartVersion, to: ChartVersion, ) -> Self
A migration with only the derived identity mapping and an identity transform.
Sourcepub fn map_configuration<I: IntoIterator<Item = S>, S: Into<String>>(
self,
from: I,
to: I,
) -> Self
pub fn map_configuration<I: IntoIterator<Item = S>, S: Into<String>>( self, from: I, to: I, ) -> Self
This migration with an explicit configuration mapping.
Sourcepub fn rename_state(
self,
from: impl Into<String>,
to: impl Into<String>,
) -> Self
pub fn rename_state( self, from: impl Into<String>, to: impl Into<String>, ) -> Self
This migration with a state rename.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Migration
impl !UnwindSafe for Migration
impl Forget for Migration
impl Freeze for Migration
impl Move for Migration
impl Send for Migration
impl Sync for Migration
impl Unpin for Migration
impl UnsafeUnpin for Migration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more