Struct jtd_infer::HintSet[][src]

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

A set of paths to parts of the input that are subject to a hint in Hints.

Implementations

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

pub fn new(values: Vec<&'a [String]>) -> Self[src]

Constructs a new HintSet.

Each element of values is a separate "path". Each element of a path is treated as a path "segment". So, for example, this:

use jtd_infer::HintSet;

let path1 = vec!["foo".to_string(), "bar".to_string()];
let path2 = vec!["baz".to_string()];
HintSet::new(vec![&path1, &path2]);

Creates a set of paths pointing to /foo/bar and /baz in an input.

The - path segment value is special, and acts as a wildcard, matching any property name. It also matches array elements, unlike ordinary path segments.

Auto Trait Implementations

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

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

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

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

impl<'a> UnwindSafe for HintSet<'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.