pub enum Error<'t> {
MissingSemicolon,
UnsupportedVersion,
SourceError,
MissingReal,
MissingInt,
MissingIdentifier,
MissingVersion,
UnexpectedToken(TokenType<'t>, TokenType<'t>),
}Expand description
Represents Errors that can occur during parsing.
The name of each corresponds to the type of error. This enum implements the display trait, thus there is nice outputs when printing:
extern crate qasm;
println!("Got an error: {}", qasm::Error::UnsupportedVersion);
// "Got an error: Unsupported Version. Please Use OpenQASM Version 2.0"Variants§
MissingSemicolon
UnsupportedVersion
SourceError
MissingReal
MissingInt
MissingIdentifier
MissingVersion
UnexpectedToken(TokenType<'t>, TokenType<'t>)
Trait Implementations§
impl<'t> StructuralPartialEq for Error<'t>
Auto Trait Implementations§
impl<'t> Freeze for Error<'t>
impl<'t> RefUnwindSafe for Error<'t>
impl<'t> Send for Error<'t>
impl<'t> Sync for Error<'t>
impl<'t> Unpin for Error<'t>
impl<'t> UnwindSafe for Error<'t>
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