pub struct SkiffSchema {
pub wire_type: WireType,
pub name: Option<String>,
pub children: Vec<Schema>,
}Expand description
One node in a Skiff schema tree.
Fields§
§wire_type: WireTypeHow this node is encoded.
name: Option<String>Optional name used to map a table field to a table column.
children: Vec<Schema>Child schema nodes, in wire order.
Implementations§
Source§impl Schema
impl Schema
Sourcepub const fn leaf(wire_type: WireType) -> Schema
pub const fn leaf(wire_type: WireType) -> Schema
Creates an unnamed schema node with no children.
Sourcepub fn named(name: impl Into<String>, wire_type: WireType) -> Schema
pub fn named(name: impl Into<String>, wire_type: WireType) -> Schema
Creates a named schema node with no children.
Sourcepub fn tuple(children: impl IntoIterator<Item = Schema>) -> Schema
pub fn tuple(children: impl IntoIterator<Item = Schema>) -> Schema
Creates a tuple schema from children in their wire order.
Sourcepub fn optional(self) -> Schema
pub fn optional(self) -> Schema
Wraps this schema as variant8<nothing; self>, the table encoding for
an optional simple column.
Sourcepub fn validate(&self) -> Result<(), SchemaError>
pub fn validate(&self) -> Result<(), SchemaError>
Validates this schema independently of a table or format.
This deliberately checks structural safety only. Table-specific rules such as dense/sparse columns are validated by the job/client layer that knows which format direction it is configuring.
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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