pub enum CompatKind {
Show 16 variants
FieldAdded {
required: bool,
},
FieldRemoved {
was_required: bool,
},
FieldRenamed {
old: &'static str,
new: &'static str,
},
TypeChanged {
old: &'static str,
new: &'static str,
},
RangeNarrowed {
old: (i128, i128),
new: (i128, i128),
},
IntToFloat,
FloatToInt,
VariantAdded {
name: &'static str,
},
VariantRemoved {
name: &'static str,
},
VariantRenamed {
old: &'static str,
new: &'static str,
},
TagChanged {
old: Option<&'static str>,
new: Option<&'static str>,
},
ShapeChanged {
old: &'static str,
new: &'static str,
},
OptionalAdded,
OptionalRemoved,
DefaultChanged {
field: &'static str,
},
PolicyChanged {
field: &'static str,
},
}Expand description
The class of a compatibility issue.
Variants§
FieldAdded
A field was added. required says whether it is required in the new
schema (a required addition breaks backward compatibility).
FieldRemoved
A field was removed. was_required says whether it was required in
the old schema (a required removal breaks forward compatibility).
FieldRenamed
A field changed its serialized name (same original Rust name).
TypeChanged
The type family changed (string → number, struct → seq, …).
RangeNarrowed
The inclusive integer range was narrowed (old values may not fit).
Fields
IntToFloat
An integer became a float (fractional new values may break old readers).
FloatToInt
A float became an integer (fractional old values may break new readers).
VariantAdded
An enum variant was added (old readers may see an unknown variant).
VariantRemoved
An enum variant was removed (new readers may see an unknown variant).
VariantRenamed
An enum variant changed its serialized name.
TagChanged
The enum tag / content / untagged representation changed.
ShapeChanged
The overall value shape changed (struct → enum, tuple arity, …).
OptionalAdded
A required field became optional (new data may contain null).
OptionalRemoved
An optional field became required (old data may lack it).
DefaultChanged
A field’s default value changed.
PolicyChanged
A field’s safety policy changed (never wire-breaking).
Trait Implementations§
Source§impl Clone for CompatKind
impl Clone for CompatKind
Source§fn clone(&self) -> CompatKind
fn clone(&self) -> CompatKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more