#[non_exhaustive]pub enum SpanError {
OutOfBounds {
faulty_index: usize,
source_len: usize,
},
Overflow,
MismatchedSource,
}Expand description
The Error enum used by Span
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.
OutOfBounds
Triggered when constructing a Span
or a SpanLocation
if it would result in an instance that is
partially, or fully, out of bounds.
Fields
§
source_len: usizeThe length of the source of the Span
or the SpanLocation where
the error occured.
Overflow
Triggered when constructing a Span
and seeing an overflow occur when calculating
the end of the span.
MismatchedSource
Trait Implementations§
Source§impl Error for SpanError
impl Error for SpanError
1.30.0§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§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl Eq for SpanError
impl StructuralPartialEq for SpanError
Auto Trait Implementations§
impl Freeze for SpanError
impl RefUnwindSafe for SpanError
impl Send for SpanError
impl Sync for SpanError
impl Unpin for SpanError
impl UnwindSafe for SpanError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
OutOfBounds: 16 bytesOverflow: 0 bytesMismatchedSource: 0 bytes