pub struct Module { /* private fields */ }Expand description
A partially compiled grammar.
Implementations§
Source§impl Module
impl Module
Sourcepub fn bind(&mut self, name: &str, value: impl Into<Expr>) -> Result<()>
pub fn bind(&mut self, name: &str, value: impl Into<Expr>) -> Result<()>
Binds an extern by name.
Sourcepub fn precompile(&mut self, vocab: &Vocab) -> Result<()>
pub fn precompile(&mut self, vocab: &Vocab) -> Result<()>
Compiles what it can now, even with externs unbound. Further compilation must use the same vocab.
Sourcepub fn precompile_with(
&mut self,
vocab: &Vocab,
options: CompileOptions,
) -> Result<()>
pub fn precompile_with( &mut self, vocab: &Vocab, options: CompileOptions, ) -> Result<()>
Like precompile(), with options.
Sourcepub fn compile(&self, vocab: &Vocab) -> Result<Constraint>
pub fn compile(&self, vocab: &Vocab) -> Result<Constraint>
Finishes compiling the module 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 Module
impl !RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl !UnwindSafe for Module
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