Struct jtd_infer::Inferrer [−][src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,