pub enum GrammarSamplerError {
MissingTriggers,
TriggerWordNotPreserved(String),
TokenizationFailed(String),
GrammarInitFailed(GrammarError),
}Expand description
Error type for grammar sampler construction.
Variants§
MissingTriggers
Lazy grammar mode is enabled but no triggers were provided.
TriggerWordNotPreserved(String)
A trigger word is not in the preserved tokens set.
TokenizationFailed(String)
Failed to tokenize a trigger or preserved token.
GrammarInitFailed(GrammarError)
Failed to initialize the grammar sampler.
Trait Implementations§
Source§impl Debug for GrammarSamplerError
impl Debug for GrammarSamplerError
Source§impl Display for GrammarSamplerError
impl Display for GrammarSamplerError
Source§impl Error for GrammarSamplerError
impl Error for GrammarSamplerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<GrammarError> for GrammarSamplerError
impl From<GrammarError> for GrammarSamplerError
Source§fn from(source: GrammarError) -> Self
fn from(source: GrammarError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GrammarSamplerError
impl RefUnwindSafe for GrammarSamplerError
impl Send for GrammarSamplerError
impl Sync for GrammarSamplerError
impl Unpin for GrammarSamplerError
impl UnsafeUnpin for GrammarSamplerError
impl UnwindSafe for GrammarSamplerError
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