pub enum SourcePositionError {
ByteOffsetOutOfBounds {
offset: usize,
len: usize,
},
ByteOffsetInsideCodePoint {
offset: usize,
},
Utf16PositionOutOfBounds {
position: Utf16Pos,
len: Utf16Pos,
},
Utf16PositionInsideSurrogatePair {
position: Utf16Pos,
},
RangeStartAfterEnd {
start: Utf16Pos,
end: Utf16Pos,
},
}Expand description
A failed checked source-position operation.
This enum is deliberately closed: callers can exhaustively distinguish an out-of-bounds coordinate from a coordinate that splits one encoded character.
Variants§
ByteOffsetOutOfBounds
ByteOffsetInsideCodePoint
Utf16PositionOutOfBounds
Utf16PositionInsideSurrogatePair
RangeStartAfterEnd
Trait Implementations§
Source§impl Clone for SourcePositionError
impl Clone for SourcePositionError
Source§fn clone(&self) -> SourcePositionError
fn clone(&self) -> SourcePositionError
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 SourcePositionError
Source§impl Debug for SourcePositionError
impl Debug for SourcePositionError
Source§impl Display for SourcePositionError
impl Display for SourcePositionError
impl Eq for SourcePositionError
Source§impl Error for SourcePositionError
impl Error for SourcePositionError
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 SourcePositionError
impl PartialEq for SourcePositionError
impl StructuralPartialEq for SourcePositionError
Auto Trait Implementations§
impl Freeze for SourcePositionError
impl RefUnwindSafe for SourcePositionError
impl Send for SourcePositionError
impl Sync for SourcePositionError
impl Unpin for SourcePositionError
impl UnsafeUnpin for SourcePositionError
impl UnwindSafe for SourcePositionError
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