pub struct Span {
pub start: usize,
pub end: usize,
}Expand description
A half-open byte range into a UTF-8 source string.
start is inclusive and end is exclusive. Offsets are bytes, rather
than character or display columns, so a span can be used directly to slice
the original query after checking that both endpoints are UTF-8 boundaries.
Fields§
§start: usizeInclusive byte offset.
end: usizeExclusive byte offset.
Implementations§
Source§impl Span
impl Span
Trait Implementations§
impl Copy for Span
impl Eq for Span
Source§impl Ord for Span
impl Ord for Span
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
Source§impl PartialOrd for Span
impl PartialOrd for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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