Trait iceberg::spec::SchemaVisitor
source · pub trait SchemaVisitor {
type T;
Show 14 methods
// Required methods
fn schema(&mut self, schema: &Schema, value: Self::T) -> Result<Self::T>;
fn field(
&mut self,
field: &NestedFieldRef,
value: Self::T,
) -> Result<Self::T>;
fn struct(
&mut self,
struct: &StructType,
results: Vec<Self::T>,
) -> Result<Self::T>;
fn list(&mut self, list: &ListType, value: Self::T) -> Result<Self::T>;
fn map(
&mut self,
map: &MapType,
key_value: Self::T,
value: Self::T,
) -> Result<Self::T>;
fn primitive(&mut self, p: &PrimitiveType) -> Result<Self::T>;
// Provided methods
fn before_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn after_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn before_list_element(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn after_list_element(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn before_map_key(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn after_map_key(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn before_map_value(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
fn after_map_value(&mut self, _field: &NestedFieldRef) -> Result<()> { ... }
}
Expand description
A post order schema visitor.
For order of methods called, please refer to visit_schema
.
Required Associated Types§
Required Methods§
sourcefn schema(&mut self, schema: &Schema, value: Self::T) -> Result<Self::T>
fn schema(&mut self, schema: &Schema, value: Self::T) -> Result<Self::T>
Called after schema’s type visited.
sourcefn field(&mut self, field: &NestedFieldRef, value: Self::T) -> Result<Self::T>
fn field(&mut self, field: &NestedFieldRef, value: Self::T) -> Result<Self::T>
Called after struct’s field type visited.
sourcefn struct(
&mut self,
struct: &StructType,
results: Vec<Self::T>,
) -> Result<Self::T>
fn struct( &mut self, struct: &StructType, results: Vec<Self::T>, ) -> Result<Self::T>
Called after struct’s fields visited.
sourcefn list(&mut self, list: &ListType, value: Self::T) -> Result<Self::T>
fn list(&mut self, list: &ListType, value: Self::T) -> Result<Self::T>
Called after list fields visited.
sourcefn map(
&mut self,
map: &MapType,
key_value: Self::T,
value: Self::T,
) -> Result<Self::T>
fn map( &mut self, map: &MapType, key_value: Self::T, value: Self::T, ) -> Result<Self::T>
Called after map’s key and value fields visited.
sourcefn primitive(&mut self, p: &PrimitiveType) -> Result<Self::T>
fn primitive(&mut self, p: &PrimitiveType) -> Result<Self::T>
Called when see a primitive type.
Provided Methods§
sourcefn before_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()>
fn before_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()>
Called before struct field.
sourcefn after_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()>
fn after_struct_field(&mut self, _field: &NestedFieldRef) -> Result<()>
Called after struct field.
sourcefn before_list_element(&mut self, _field: &NestedFieldRef) -> Result<()>
fn before_list_element(&mut self, _field: &NestedFieldRef) -> Result<()>
Called before list field.
sourcefn after_list_element(&mut self, _field: &NestedFieldRef) -> Result<()>
fn after_list_element(&mut self, _field: &NestedFieldRef) -> Result<()>
Called after list field.
sourcefn before_map_key(&mut self, _field: &NestedFieldRef) -> Result<()>
fn before_map_key(&mut self, _field: &NestedFieldRef) -> Result<()>
Called before map key field.
sourcefn after_map_key(&mut self, _field: &NestedFieldRef) -> Result<()>
fn after_map_key(&mut self, _field: &NestedFieldRef) -> Result<()>
Called after map key field.
sourcefn before_map_value(&mut self, _field: &NestedFieldRef) -> Result<()>
fn before_map_value(&mut self, _field: &NestedFieldRef) -> Result<()>
Called before map value field.
sourcefn after_map_value(&mut self, _field: &NestedFieldRef) -> Result<()>
fn after_map_value(&mut self, _field: &NestedFieldRef) -> Result<()>
Called after map value field.