pub enum AstError {
Empty,
NoEof,
UnexpectedToken {
token: Token,
additional: Option<Cow<'static, str>>,
},
}
Expand description
An error that occurs when creating the ast after tokenizing
Variants
Empty
There were no tokens passed, which shouldn’t happen normally
NoEof
Tokens passed had no end of file token, which shouldn’t happen normally
UnexpectedToken
Fields
token: Token
The token that caused the error
An unexpected token, the most likely scenario when getting an AstError
Trait Implementations
sourceimpl<'de> Deserialize<'de> for AstError
impl<'de> Deserialize<'de> for AstError
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Error for AstError
impl Error for AstError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for AstError
Auto Trait Implementations
impl RefUnwindSafe for AstError
impl Send for AstError
impl Sync for AstError
impl Unpin for AstError
impl UnwindSafe for AstError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more