#[non_exhaustive]pub enum DetokenizeError {
TokenToBytes(TokenToStringError),
InvalidUtf8(Utf8Error),
IncompleteUtf8(Vec<u8>),
}Expand description
An error produced while streaming detokenization.
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.
TokenToBytes(TokenToStringError)
A token could not be converted to its raw piece bytes.
InvalidUtf8(Utf8Error)
The accumulated bytes contained a genuinely invalid UTF-8 sequence, as opposed to a merely incomplete trailing sequence (which is buffered).
IncompleteUtf8(Vec<u8>)
StreamDetokenizer::finish was called while an incomplete trailing
UTF-8 sequence was still buffered. Carries the leftover bytes.
Trait Implementations§
Source§impl Debug for DetokenizeError
impl Debug for DetokenizeError
Source§impl Display for DetokenizeError
impl Display for DetokenizeError
Source§impl Error for DetokenizeError
impl Error for DetokenizeError
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<TokenToStringError> for DetokenizeError
impl From<TokenToStringError> for DetokenizeError
Source§fn from(source: TokenToStringError) -> Self
fn from(source: TokenToStringError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DetokenizeError
impl RefUnwindSafe for DetokenizeError
impl Send for DetokenizeError
impl Sync for DetokenizeError
impl Unpin for DetokenizeError
impl UnsafeUnpin for DetokenizeError
impl UnwindSafe for DetokenizeError
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