pub struct SchemaDepthChecker { /* private fields */ }Expand description
A schema “transform” that doesn’t actually change the schema at all. Instead, it measures the maximum depth of a schema, with a depth limit to prevent stack overflow. Useful for verifying that a schema has reasonable depth before attempting to work with it.
Implementations§
Trait Implementations§
Source§impl<'a> SchemaTransform<'a> for SchemaDepthChecker
impl<'a> SchemaTransform<'a> for SchemaDepthChecker
Source§fn transform_struct(
&mut self,
stype: &'a StructType,
) -> Option<Cow<'a, StructType>>
fn transform_struct( &mut self, stype: &'a StructType, ) -> Option<Cow<'a, StructType>>
Called for each struct encountered during the traversal. The provided implementation just
forwards to
Self::recurse_into_struct.Source§fn transform_struct_field(
&mut self,
field: &'a StructField,
) -> Option<Cow<'a, StructField>>
fn transform_struct_field( &mut self, field: &'a StructField, ) -> Option<Cow<'a, StructField>>
Called for each struct field encountered during the traversal. The provided implementation
forwards to
Self::recurse_into_struct_field.Source§fn transform_array(
&mut self,
atype: &'a ArrayType,
) -> Option<Cow<'a, ArrayType>>
fn transform_array( &mut self, atype: &'a ArrayType, ) -> Option<Cow<'a, ArrayType>>
Called for each array encountered during the traversal. The provided implementation just
forwards to
Self::recurse_into_array.Source§fn transform_map(&mut self, mtype: &'a MapType) -> Option<Cow<'a, MapType>>
fn transform_map(&mut self, mtype: &'a MapType) -> Option<Cow<'a, MapType>>
Called for each map encountered during the traversal. The provided implementation just
forwards to
Self::recurse_into_map.Source§fn transform_primitive(
&mut self,
ptype: &'a PrimitiveType,
) -> Option<Cow<'a, PrimitiveType>>
fn transform_primitive( &mut self, ptype: &'a PrimitiveType, ) -> Option<Cow<'a, PrimitiveType>>
Called for each primitive encountered during the traversal (leaf).
Source§fn transform_array_element(
&mut self,
etype: &'a DataType,
) -> Option<Cow<'a, DataType>>
fn transform_array_element( &mut self, etype: &'a DataType, ) -> Option<Cow<'a, DataType>>
Called for each array element type encountered during the traversal. The provided
implementation forwards to
Self::transform.Source§fn transform_map_key(
&mut self,
etype: &'a DataType,
) -> Option<Cow<'a, DataType>>
fn transform_map_key( &mut self, etype: &'a DataType, ) -> Option<Cow<'a, DataType>>
Called for each map key encountered during the traversal. The provided implementation
forwards to
Self::transform.Source§fn transform_map_value(
&mut self,
etype: &'a DataType,
) -> Option<Cow<'a, DataType>>
fn transform_map_value( &mut self, etype: &'a DataType, ) -> Option<Cow<'a, DataType>>
Called for each map value encountered during the traversal. The provided implementation
forwards to
Self::transform.Source§fn transform_variant(
&mut self,
stype: &'a StructType,
) -> Option<Cow<'a, StructType>>
fn transform_variant( &mut self, stype: &'a StructType, ) -> Option<Cow<'a, StructType>>
Called for each variant value encountered. The provided implementation just
forwards to
Self::recurse_into_struct.Source§fn transform(&mut self, data_type: &'a DataType) -> Option<Cow<'a, DataType>>
fn transform(&mut self, data_type: &'a DataType) -> Option<Cow<'a, DataType>>
General entry point for a recursive traversal over any data type. Also invoked internally to
dispatch on nested data types encountered during the traversal.
Source§fn recurse_into_struct_field(
&mut self,
field: &'a StructField,
) -> Option<Cow<'a, StructField>>
fn recurse_into_struct_field( &mut self, field: &'a StructField, ) -> Option<Cow<'a, StructField>>
Recursively transforms a struct field’s data type (unary).
Source§fn recurse_into_struct(
&mut self,
stype: &'a StructType,
) -> Option<Cow<'a, StructType>>
fn recurse_into_struct( &mut self, stype: &'a StructType, ) -> Option<Cow<'a, StructType>>
Recursively transforms a struct’s fields (variadic).
Auto Trait Implementations§
impl Freeze for SchemaDepthChecker
impl RefUnwindSafe for SchemaDepthChecker
impl Send for SchemaDepthChecker
impl Sync for SchemaDepthChecker
impl Unpin for SchemaDepthChecker
impl UnsafeUnpin for SchemaDepthChecker
impl UnwindSafe for SchemaDepthChecker
Blanket Implementations§
Source§impl<T> AsAny for T
impl<T> AsAny for T
Source§fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
Obtains a
dyn Any reference to the object: Read moreSource§fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
Obtains an
Arc<dyn Any> reference to the object: Read moreSource§fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
Converts the object to
Box<dyn Any>: Read moreSource§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Convenient wrapper for
std::any::type_name, since Any does not provide it and
Any::type_id is useless as a debugging aid (its Debug is just a mess of hex digits).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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more