pub enum SyntaxError {
Empty,
Format(usize),
}Expand description
A type for reporting simple string syntax errors.
This type is used within the syntax crate to restrict the number of errors
we can report. When validating syntax, it’s usually only one of two things;
- An empty input, where we expected non-empty
- An invalid character at a specific byte-offset
Variants§
Empty
The value is an empty string, and an empty string is not allowed.
Format(usize)
The format of the string is invalid at the provided byte offset.
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SyntaxError
Source§impl Debug for SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
impl Eq for SyntaxError
Source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
Source§fn from(orig: SyntaxError) -> Self
fn from(orig: SyntaxError) -> Self
Converts to this type from the input type.
Source§impl Hash for SyntaxError
impl Hash for SyntaxError
Source§impl Ord for SyntaxError
impl Ord for SyntaxError
Source§fn cmp(&self, other: &SyntaxError) -> Ordering
fn cmp(&self, other: &SyntaxError) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
Source§impl PartialOrd for SyntaxError
impl PartialOrd for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnsafeUnpin for SyntaxError
impl UnwindSafe for SyntaxError
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