pub struct Grammar { /* private fields */ }Implementations§
Source§impl Grammar
impl Grammar
Sourcepub fn from_json_schema(source: &str) -> Result<Self>
pub fn from_json_schema(source: &str) -> Result<Self>
Parses a JSON Schema, given as JSON text.
Sourcepub fn compile(&self, vocab: &Vocab) -> Result<Constraint>
pub fn compile(&self, vocab: &Vocab) -> Result<Constraint>
Compiles the grammar into a constraint.
Sourcepub fn compile_with(
&self,
vocab: &Vocab,
options: CompileOptions,
) -> Result<Constraint>
pub fn compile_with( &self, vocab: &Vocab, options: CompileOptions, ) -> Result<Constraint>
Like compile(), with options.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Grammar
impl !RefUnwindSafe for Grammar
impl Send for Grammar
impl Sync for Grammar
impl Unpin for Grammar
impl UnsafeUnpin for Grammar
impl !UnwindSafe for Grammar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more