pub struct SchemaComparisonSettings { /* private fields */ }
Implementations§
Source§impl SchemaComparisonSettings
impl SchemaComparisonSettings
Sourcepub const fn require_equality() -> SchemaComparisonSettings
pub const fn require_equality() -> SchemaComparisonSettings
A set of defaults intended to enforce effective equality of the schemas, but with clear error messages if they diverge
Sourcepub const fn allow_extension() -> SchemaComparisonSettings
pub const fn allow_extension() -> SchemaComparisonSettings
A set of defaults intended to capture a pretty tight definition of structural extension.
This captures that:
- Payloads which are valid/decodable against the old schema are valid against the new schema
- Programmatic SBOR JSON is unchanged (that is, type/field/variant names are also unchanged)
Notably:
- Type roots can be added in the compared schema, but we check that the type roots provided completely cover both schemas
- Types must be structurally identical on their intersection, except new enum variants can be added
- Type metadata (e.g. names) must be identical on their intersection
- Type validation must be equal or strictly weaker in the new schema
pub fn with_completeness( self, builder: impl FnOnce(SchemaComparisonCompletenessSettings) -> SchemaComparisonCompletenessSettings, ) -> SchemaComparisonSettings
pub const fn set_completeness( self, settings: SchemaComparisonCompletenessSettings, ) -> SchemaComparisonSettings
pub fn with_structure( self, builder: impl FnOnce(SchemaComparisonStructureSettings) -> SchemaComparisonStructureSettings, ) -> SchemaComparisonSettings
pub const fn set_structure( self, settings: SchemaComparisonStructureSettings, ) -> SchemaComparisonSettings
pub fn with_metadata( self, builder: impl FnOnce(SchemaComparisonMetadataSettings) -> SchemaComparisonMetadataSettings, ) -> SchemaComparisonSettings
pub const fn set_metadata( self, settings: SchemaComparisonMetadataSettings, ) -> SchemaComparisonSettings
Sourcepub const fn allow_all_name_changes(self) -> SchemaComparisonSettings
pub const fn allow_all_name_changes(self) -> SchemaComparisonSettings
An easy method for a common setting change
pub fn with_validation( self, builder: impl FnOnce(SchemaComparisonValidationSettings) -> SchemaComparisonValidationSettings, ) -> SchemaComparisonSettings
pub const fn set_validation( self, settings: SchemaComparisonValidationSettings, ) -> SchemaComparisonSettings
Trait Implementations§
Source§impl Clone for SchemaComparisonSettings
impl Clone for SchemaComparisonSettings
Source§fn clone(&self) -> SchemaComparisonSettings
fn clone(&self) -> SchemaComparisonSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SchemaComparisonSettings
impl Debug for SchemaComparisonSettings
Source§impl PartialEq for SchemaComparisonSettings
impl PartialEq for SchemaComparisonSettings
impl Copy for SchemaComparisonSettings
impl Eq for SchemaComparisonSettings
impl StructuralPartialEq for SchemaComparisonSettings
Auto Trait Implementations§
impl Freeze for SchemaComparisonSettings
impl RefUnwindSafe for SchemaComparisonSettings
impl Send for SchemaComparisonSettings
impl Sync for SchemaComparisonSettings
impl Unpin for SchemaComparisonSettings
impl UnwindSafe for SchemaComparisonSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.