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§

Deserialization of a new schema using a context, returns a InferredSchemaWithContext that can be used to deserialize further files and reuse the context.

Returns a fresh context for null schemas.

Returns a fresh context for boolean schemas.

Returns a fresh context for integer schemas.

Returns a fresh context for floating point schemas.

Returns a fresh context for string schemas.

Returns a fresh context for bytes schemas.

Returns a fresh context for sequence schemas.

Returns a fresh context for struct schemas.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert 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.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.