Struct schema_analysis::context::Context
source · pub struct Context {
pub null: NullContext,
pub boolean: BooleanContext,
pub integer: NumberContext<i128>,
pub float: NumberContext<f64>,
pub string: StringContext,
pub bytes: BytesContext,
pub sequence: SequenceContext,
pub map_struct: MapStructContext,
}
Expand description
The Context holds a fresh copy of the context that each Schema copies when it’s first created and then fills as the analysis proceeds.
All default context should respect a constant memory bound on each node. This will allow analysis of arbitraryly large amounts of data as long as the schema does not grow out of proportion.
Fields§
§null: NullContext
The context for null values.
boolean: BooleanContext
The context for boolean values.
integer: NumberContext<i128>
The context for integer values.
float: NumberContext<f64>
The context for floating point values.
string: StringContext
The context for string values.
bytes: BytesContext
The context for bytes values.
sequence: SequenceContext
The context for sequence values.
map_struct: MapStructContext
The context for struct values.
Implementations§
source§impl Context
impl Context
sourcepub fn deserialize_schema<'de, D>(
self,
deserializer: D
) -> Result<InferredSchemaWithContext, D::Error>where
D: Deserializer<'de>,
pub fn deserialize_schema<'de, D>(
self,
deserializer: D
) -> Result<InferredSchemaWithContext, D::Error>where
D: Deserializer<'de>,
Deserialization of a new schema using a context, returns a InferredSchemaWithContext that can be used to deserialize further files and reuse the context.
source§impl Context
impl Context
sourcepub fn for_null(&self) -> NullContext
pub fn for_null(&self) -> NullContext
Returns a fresh context for null schemas.
sourcepub fn for_boolean(&self) -> BooleanContext
pub fn for_boolean(&self) -> BooleanContext
Returns a fresh context for boolean schemas.
sourcepub fn for_integer(&self) -> NumberContext<i128>
pub fn for_integer(&self) -> NumberContext<i128>
Returns a fresh context for integer schemas.
sourcepub fn for_float(&self) -> NumberContext<f64>
pub fn for_float(&self) -> NumberContext<f64>
Returns a fresh context for floating point schemas.
sourcepub fn for_string(&self) -> StringContext
pub fn for_string(&self) -> StringContext
Returns a fresh context for string schemas.
sourcepub fn for_bytes(&self) -> BytesContext
pub fn for_bytes(&self) -> BytesContext
Returns a fresh context for bytes schemas.
sourcepub fn for_sequence(&self) -> SequenceContext
pub fn for_sequence(&self) -> SequenceContext
Returns a fresh context for sequence schemas.
sourcepub fn for_map_struct(&self) -> MapStructContext
pub fn for_map_struct(&self) -> MapStructContext
Returns a fresh context for struct schemas.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq<Context> for Context
impl PartialEq<Context> for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.