enum VariantSchemaNode {
Leaf(ShreddingField),
Struct(BTreeMap<String, VariantSchemaNode>),
List(Box<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
List(Box<VariantSchemaNode>)
An inner list node with a shared element schema
Implementations§
Source§impl VariantSchemaNode
impl VariantSchemaNode
Sourcefn insert_path(
&mut self,
path: &VariantPath<'_>,
field: ShreddingField,
) -> Result<()>
fn insert_path( &mut self, path: &VariantPath<'_>, field: ShreddingField, ) -> Result<()>
Insert a path into this node with the given data type.
fn insert_path_elements( &mut self, segments: &[VariantPathElement<'_>], field: ShreddingField, ) -> Result<()>
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
Auto Trait Implementations§
impl Freeze for VariantSchemaNode
impl RefUnwindSafe for VariantSchemaNode
impl Send for VariantSchemaNode
impl Sync for VariantSchemaNode
impl Unpin for VariantSchemaNode
impl UnsafeUnpin for VariantSchemaNode
impl UnwindSafe for VariantSchemaNode
Blanket Implementations§
impl<T> Allocation for T
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