pub enum ChangeKind {
    TypeAdd {
        added: JsonSchemaType,
    },
    TypeRemove {
        removed: JsonSchemaType,
    },
    PropertyAdd {
        lhs_additional_properties: bool,
        added: String,
    },
    PropertyRemove {
        lhs_additional_properties: bool,
        removed: String,
    },
    TupleToArray {
        old_length: usize,
    },
    ArrayToTuple {
        new_length: usize,
    },
    TupleChange {
        new_length: usize,
    },
}
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.

§

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.

§

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.

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 Eq for ChangeKind

source§

impl StructuralEq for ChangeKind

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.