pub struct UnicastContext { /* private fields */ }Expand description
A recognition context paired with a single subscriber that can be awaited for recognition.
Implementations§
Source§impl UnicastContext
impl UnicastContext
Sourcepub fn new(
recognizer: &Recognizer,
buffer: usize,
) -> Result<(Self, UnicastSubscriber)>
pub fn new( recognizer: &Recognizer, buffer: usize, ) -> Result<(Self, UnicastSubscriber)>
Creates a new recognition context for the given recognizer, configured to buffer up to the given number of recognized phrases. If a new phrase is recognized while the buffer is full, it will be silently dropped.
Methods from Deref<Target = Context>§
Sourcepub fn set_enabled(&self, enabled: bool) -> Result<()>
pub fn set_enabled(&self, enabled: bool) -> Result<()>
Enables or disables the recognition of rules from all grammars loaded into this context.
Sourcepub fn grammar_builder(&self) -> GrammarBuilder<'_>
pub fn grammar_builder(&self) -> GrammarBuilder<'_>
Creates a GrammarBuilder that will construct and load a grammar into this context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UnicastContext
impl RefUnwindSafe for UnicastContext
impl Send for UnicastContext
impl Sync for UnicastContext
impl Unpin for UnicastContext
impl UnwindSafe for UnicastContext
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