pub enum ChangeKind {
Show 14 variants TypeAdd { added: JsonSchemaType, }, TypeRemove { removed: JsonSchemaType, }, ConstAdd { added: Value, }, ConstRemove { removed: Value, }, PropertyAdd { lhs_additional_properties: bool, added: String, }, PropertyRemove { lhs_additional_properties: bool, removed: String, }, RangeAdd { added: Range, value: f64, }, RangeRemove { removed: Range, value: f64, }, RangeChange { changed: Range, old_value: f64, new_value: f64, }, TupleToArray { old_length: usize, }, ArrayToTuple { new_length: usize, }, TupleChange { new_length: usize, }, RequiredRemove { property: String, }, RequiredAdd { property: String, },
}
Expand description

The kind of change + data relevant to the change.

Variants§

§

TypeAdd

Fields

§added: JsonSchemaType

The type in question.

A type has been added and is now additionally allowed.

§

TypeRemove

Fields

§removed: JsonSchemaType

The type in question.

A type has been removed and is no longer allowed.

§

ConstAdd

Fields

§added: Value

The value of the added const.

A const value has been added as an allowed value.

§

ConstRemove

Fields

§removed: Value

The value of the removed const.

A const has been removed as an allowed value.

§

PropertyAdd

Fields

§lhs_additional_properties: bool

The value of additionalProperties within the current JSON object.

§added: String

The name of the added property.

A property has been added and (depending on additionalProperties) is now additionally allowed.

§

PropertyRemove

Fields

§lhs_additional_properties: bool

The value of additionalProperties within the current JSON object.

§removed: String

The name of the added property.

A property has been removed and (depending on additionalProperties) might now no longer be allowed.

§

RangeAdd

Fields

§added: Range

The name of the added constraint.

§value: f64

The value of the added constraint.

A minimum/maximum constraint has been added.

§

RangeRemove

Fields

§removed: Range

The name of the removed constraint.

§value: f64

The value of the removed constraint.

A minimum/maximum constraint has been removed.

§

RangeChange

Fields

§changed: Range

The name of the changed constraint.

§old_value: f64

The old constraint value.

§new_value: f64

The new constraint value.

A minimum/maximum constraint has been updated.

§

TupleToArray

Fields

§old_length: usize

The length of the (old) tuple

An array-type item has been changed from tuple validation to array validation.

See https://json-schema.org/understanding-json-schema/reference/array.html

Changes will still be emitted for inner items.

§

ArrayToTuple

Fields

§new_length: usize

The length of the (new) tuple

An array-type item has been changed from array validation to tuple validation.

See https://json-schema.org/understanding-json-schema/reference/array.html

Changes will still be emitted for inner items.

§

TupleChange

Fields

§new_length: usize

The new length of the tuple

An array-type item with tuple validation has changed its length (“items” array got longer or shorter.

See https://json-schema.org/understanding-json-schema/reference/array.html

Changes will still be emitted for inner items.

§

RequiredRemove

Fields

§property: String

The property that is no longer required

A previously required property has been removed

§

RequiredAdd

Fields

§property: String

The property that is now required

A previously optional property has been made required

Implementations§

source§

impl ChangeKind

source

pub fn is_breaking(&self) -> bool

Whether the change is breaking.

What is considered breaking is WIP. Changes are intentionally exposed as-is in public API so that the user can develop their own logic as to what they consider breaking.

Currently the rule of thumb is, a change is breaking if it would cause messages that used to validate fine under RHS to no longer validate under LHS.

Trait Implementations§

source§

impl Debug for ChangeKind

source§

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

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

impl PartialEq<ChangeKind> for ChangeKind

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ChangeKind

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ChangeKind

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.