enum VariantSchemaNode {
Leaf(ShreddingField),
Struct(BTreeMap<String, VariantSchemaNode>),
}Expand description
Internal tree node structure for building variant schemas.
Variants§
Leaf(ShreddingField)
A leaf node with a primitive/scalar type (and nullability)
Struct(BTreeMap<String, VariantSchemaNode>)
An inner struct node with nested fields
Implementations§
Source§impl VariantSchemaNode
impl VariantSchemaNode
Sourcefn insert_path(&mut self, path: &VariantPath<'_>, field: ShreddingField)
fn insert_path(&mut self, path: &VariantPath<'_>, field: ShreddingField)
Insert a path into this node with the given data type.
fn insert_path_elements( &mut self, segments: &[VariantPathElement<'_>], field: ShreddingField, )
Sourcefn to_shredding_type(&self) -> Option<DataType>
fn to_shredding_type(&self) -> Option<DataType>
Convert this node to a shredding type.
Returns the [DataType] for passing to shred_variant.
fn to_shredding_field(&self, name: &str) -> Option<FieldRef>
Trait Implementations§
Source§impl Clone for VariantSchemaNode
impl Clone for VariantSchemaNode
Source§fn clone(&self) -> VariantSchemaNode
fn clone(&self) -> VariantSchemaNode
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 moreAuto Trait Implementations§
impl Freeze for VariantSchemaNode
impl RefUnwindSafe for VariantSchemaNode
impl Send for VariantSchemaNode
impl Sync for VariantSchemaNode
impl Unpin for VariantSchemaNode
impl UnwindSafe for VariantSchemaNode
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