Skip to main content

CompatKind

Enum CompatKind 

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

Fields

§required: bool

Whether the added field is required in the new schema.

§

FieldRemoved

A field was removed. was_required says whether it was required in the old schema (a required removal breaks forward compatibility).

Fields

§was_required: bool

Whether the removed field was required in the old schema.

§

FieldRenamed

A field changed its serialized name (same original Rust name).

Fields

§old: &'static str

Old serialized name.

§new: &'static str

New serialized name.

§

TypeChanged

The type family changed (string → number, struct → seq, …).

Fields

§old: &'static str

Old type name.

§new: &'static str

New type name.

§

RangeNarrowed

The inclusive integer range was narrowed (old values may not fit).

Fields

§old: (i128, i128)

Old inclusive range (min, max).

§new: (i128, i128)

New inclusive range (min, max).

§

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

Fields

§name: &'static str

The added variant’s serialized name.

§

VariantRemoved

An enum variant was removed (new readers may see an unknown variant).

Fields

§name: &'static str

The removed variant’s serialized name.

§

VariantRenamed

An enum variant changed its serialized name.

Fields

§old: &'static str

Old serialized variant name.

§new: &'static str

New serialized variant name.

§

TagChanged

The enum tag / content / untagged representation changed.

Fields

§old: Option<&'static str>

Old tag name.

§new: Option<&'static str>

New tag name.

§

ShapeChanged

The overall value shape changed (struct → enum, tuple arity, …).

Fields

§old: &'static str

Old shape name.

§new: &'static str

New shape name.

§

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.

Fields

§field: &'static str

The field whose default changed.

§

PolicyChanged

A field’s safety policy changed (never wire-breaking).

Fields

§field: &'static str

The field whose policy changed.

Trait Implementations§

Source§

impl Clone for CompatKind

Source§

fn clone(&self) -> CompatKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompatKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CompatKind

Source§

impl PartialEq for CompatKind

Source§

fn eq(&self, other: &CompatKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompatKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.