#[non_exhaustive]pub enum SessionError {
Compile(CompileError),
Matcher(MatcherError),
Structured(StructuredMatcherError),
IllegalToken {
token: TokenId,
},
UnknownToken {
token: TokenId,
},
SessionStopped,
MaskBufferLength {
expected: usize,
actual: usize,
},
MaskByteBufferLength {
expected: usize,
actual: usize,
},
MaskWidthOverflow {
mask_vocab_size: usize,
},
}Expand description
Errors from binding a schema or driving a Session.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Compile(CompileError)
Schema compilation or artifact-binding failed.
Matcher(MatcherError)
The regular-backend matcher rejected a token.
Structured(StructuredMatcherError)
The structured-backend matcher hit a resource limit or a compile error.
IllegalToken
A token was rejected: no path from the current position (either backend).
UnknownToken
advance was given a token id absent from the bound vocabulary.
SessionStopped
advance was called on a session that already committed EOS; call reset() first.
MaskBufferLength
write_mask’s output buffer length did not match the vocabulary’s word count.
Fields
MaskByteBufferLength
write_mask_le_bytes’s output buffer length did not match the vocabulary’s byte width.
Fields
MaskWidthOverflow
The vocabulary is too wide for its packed mask to be addressed on this target.
Trait Implementations§
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
Source§impl Error for SessionError
impl Error for SessionError
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<CompileError> for SessionError
impl From<CompileError> for SessionError
Source§fn from(e: CompileError) -> Self
fn from(e: CompileError) -> Self
Converts to this type from the input type.
Source§impl From<MatcherError> for SessionError
impl From<MatcherError> for SessionError
Source§fn from(e: MatcherError) -> Self
fn from(e: MatcherError) -> Self
Converts to this type from the input type.
Source§impl From<StructuredMatcherError> for SessionError
impl From<StructuredMatcherError> for SessionError
Source§fn from(e: StructuredMatcherError) -> Self
fn from(e: StructuredMatcherError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SessionError
impl RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionError
impl UnwindSafe for SessionError
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