#[non_exhaustive]pub enum AstSpanError {
InvalidSpan {
start: usize,
end: usize,
},
OverlappingSpans {
start: usize,
end: usize,
parent_start: usize,
parent_end: usize,
},
OverlappingTile {
start: usize,
end: usize,
previous_end: usize,
},
UncoveredBytes {
start: usize,
end: usize,
text: String,
},
UncoveredTail {
start: usize,
text: String,
},
ReconstructionMismatch {
reconstructed_len: usize,
source_len: usize,
},
IntervalStartAfterEnd {
start: usize,
end: usize,
},
IntervalExceedsSource {
start: usize,
end: usize,
source_len: usize,
},
IntervalNotUtf8Boundary {
start: usize,
end: usize,
},
}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.
InvalidSpan
An AST span had start > end; both fields are byte offsets.
OverlappingSpans
Two AST spans overlapped without one containing the other.
Fields
OverlappingTile
A reconstruction tile overlapped bytes already emitted.
Fields
UncoveredBytes
A non-empty source byte interval was not covered by AST or trivia.
Fields
UncoveredTail
Source bytes after the final AST/trivia interval were not covered.
Fields
ReconstructionMismatch
Reconstructed source length differed from the original source length.
Fields
IntervalStartAfterEnd
A token/trivia interval had start > end; both fields are byte offsets.
IntervalExceedsSource
A token/trivia interval extended past source_len.
Fields
IntervalNotUtf8Boundary
A token/trivia interval boundary was not a UTF-8 boundary in source.
Trait Implementations§
Source§impl Clone for AstSpanError
impl Clone for AstSpanError
Source§fn clone(&self) -> AstSpanError
fn clone(&self) -> AstSpanError
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 moreSource§impl Debug for AstSpanError
impl Debug for AstSpanError
Source§impl Display for AstSpanError
impl Display for AstSpanError
impl Eq for AstSpanError
Source§impl Error for AstSpanError
impl Error for AstSpanError
1.30.0 · 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 PartialEq for AstSpanError
impl PartialEq for AstSpanError
Source§fn eq(&self, other: &AstSpanError) -> bool
fn eq(&self, other: &AstSpanError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AstSpanError
Auto Trait Implementations§
impl Freeze for AstSpanError
impl RefUnwindSafe for AstSpanError
impl Send for AstSpanError
impl Sync for AstSpanError
impl Unpin for AstSpanError
impl UnsafeUnpin for AstSpanError
impl UnwindSafe for AstSpanError
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