pub enum ChangeKind {
TypeChanged,
TypeRenamed,
FieldAdded,
FieldRemoved,
FieldRenamed,
FieldsReordered,
FieldTypeChanged,
VariantAdded,
VariantRemoved,
VariantRenamed,
VectorChanged,
}Expand description
The kinds of difference worth naming separately.
Variants§
TypeChanged
One type became a different kind of type, or one primitive another.
TypeRenamed
A struct or an enum kept its shape and changed its name.
FieldAdded
A struct gained a field.
FieldRemoved
A struct lost a field.
FieldRenamed
A field kept its position and changed its name.
FieldsReordered
The same fields came back in a different order.
FieldTypeChanged
A field kept its name and changed its type.
VariantAdded
An enum gained a variant.
VariantRemoved
An enum lost a variant.
VariantRenamed
A variant kept its position and changed its name.
VectorChanged
A vector changed its width or the way it is compared.
Implementations§
Source§impl ChangeKind
impl ChangeKind
Sourcepub const fn is_additive(self) -> bool
pub const fn is_additive(self) -> bool
Whether a change of this kind can be read through (15 section 5).
Only growth is additive: a new field reads as its default and a new
variant is simply never seen in old elements. Everything else either
moves bytes or drops them, and both need migrate.
A rename annotated #[yo(was = "old")] is additive, and it is additive
because the annotation makes the description keep the old name, so it
never reaches this function as a rename at all.
Trait Implementations§
Source§impl Clone for ChangeKind
impl Clone for ChangeKind
Source§fn clone(&self) -> ChangeKind
fn clone(&self) -> ChangeKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more