Struct jtd_infer::Inferrer[][src]

pub struct Inferrer<'a> { /* fields omitted */ }

Keeps track of a sequence of example inputs, and can be converted into an inferred schema.

Implementations

impl<'a> Inferrer<'a>[src]

pub fn new(hints: Hints<'a>) -> Self[src]

Constructs a new inferrer with a given set of hints.

See the documentation for Hints for details on what affect they have on Inferrer::infer.

pub fn infer(self, value: Value) -> Self[src]

"Updates" the inference given an example data.

Note that though the previous sentence uses the word "update", in Rust ownership terms this method moves self.

pub fn into_schema(self) -> Schema[src]

Converts the inference to a JSON Type Definition schema.

It is guaranteed that the resulting schema will accept all of the inputs previously provided via Inferrer::infer.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Inferrer<'a>[src]

impl<'a> Send for Inferrer<'a>[src]

impl<'a> Sync for Inferrer<'a>[src]

impl<'a> Unpin for Inferrer<'a>[src]

impl<'a> UnwindSafe for Inferrer<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.