pub struct UnionSchema {
pub variants: IndexMap<String, SchemaNodeId>,
pub unambiguous: IndexSet<String>,
pub repr: VariantRepr,
pub deny_untagged: IndexSet<String>,
}Expand description
Union type with named variants
Spec: lines 415-423
@variants.union
variants = { $variant: map, key => .text, value => .$types.type }
$ext-type.variant-repr = .$types.variant-repr (optional)Fields§
§variants: IndexMap<String, SchemaNodeId>Variant definitions (variant name -> schema)
unambiguous: IndexSet<String>Variants that use unambiguous semantics (try all, detect conflicts). All other variants use short-circuit semantics (first match wins).
repr: VariantReprVariant representation strategy (default: External)
deny_untagged: IndexSet<String>Variants that deny untagged matching (require explicit $variant)
Trait Implementations§
Source§impl Clone for UnionSchema
impl Clone for UnionSchema
Source§fn clone(&self) -> UnionSchema
fn clone(&self) -> UnionSchema
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 UnionSchema
impl Debug for UnionSchema
Source§impl PartialEq for UnionSchema
impl PartialEq for UnionSchema
impl StructuralPartialEq for UnionSchema
Auto Trait Implementations§
impl Freeze for UnionSchema
impl RefUnwindSafe for UnionSchema
impl Send for UnionSchema
impl Sync for UnionSchema
impl Unpin for UnionSchema
impl UnwindSafe for UnionSchema
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