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 Forget for VariantSchemaNode
impl Freeze for VariantSchemaNodewhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Field> is !null: Freeze,
PhantomData<ArcInner<Field>>: Freeze,
*const ArcInner<[Arc<Field>]> is !null: Freeze,
PhantomData<ArcInner<[Arc<Field>]>>: Freeze,
*const ArcInner<[(i8, Arc<Field>)]> is !null: Freeze,
PhantomData<ArcInner<[(i8, Arc<Field>)]>>: Freeze,
*const DataType is !null: Freeze,
PhantomData<DataType>: Freeze,
*const LeafNode<String, VariantSchemaNode> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, VariantSchemaNode)>>: Freeze,
*const VariantSchemaNode is !null: Freeze,
PhantomData<VariantSchemaNode>: Freeze,
impl Move for VariantSchemaNode
impl RefUnwindSafe for VariantSchemaNode
impl Send for VariantSchemaNode
impl Sync for VariantSchemaNode
impl Unpin for VariantSchemaNode
impl UnsafeUnpin for VariantSchemaNodewhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Field> is !null: UnsafeUnpin,
PhantomData<ArcInner<Field>>: UnsafeUnpin,
*const ArcInner<[Arc<Field>]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[Arc<Field>]>>: UnsafeUnpin,
*const ArcInner<[(i8, Arc<Field>)]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[(i8, Arc<Field>)]>>: UnsafeUnpin,
*const DataType is !null: UnsafeUnpin,
PhantomData<DataType>: UnsafeUnpin,
*const LeafNode<String, VariantSchemaNode> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, VariantSchemaNode)>>: UnsafeUnpin,
*const VariantSchemaNode is !null: UnsafeUnpin,
PhantomData<VariantSchemaNode>: UnsafeUnpin,
impl UnwindSafe for VariantSchemaNodewhere
Arc<str>: UnwindSafe,
Arc<Field>: UnwindSafe,
Arc<[Arc<Field>]>: UnwindSafe,
Arc<[(i8, Arc<Field>)]>: UnwindSafe,
BoxRaw<DataType>: UnwindSafe,
BTreeMap<String, VariantSchemaNode>: UnwindSafe,
BoxRaw<VariantSchemaNode>: UnwindSafe,
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