pub struct OrderedSpan(pub Span);Expand description
A wrapper around Span that properly implements Eq and Ord
installed of always being Ordering::Equal.
A Span::MISSING is considered greater than all other spans.
Tuple Fields§
§0: SpanImplementations§
Source§impl OrderedSpan
impl OrderedSpan
Sourcepub const MISSING: Self
pub const MISSING: Self
The OrderedSpan corresponding to Span::MISSING.
Methods from Deref<Target = Span>§
pub const MISSING: Span
Sourcepub fn is_missing(&self) -> bool
pub fn is_missing(&self) -> bool
Check if the span is Self::MISSING.
Sourcepub fn byte_range(&self) -> Result<Range<u64>, MissingLocationError>
pub fn byte_range(&self) -> Result<Range<u64>, MissingLocationError>
Return the range of bytes in the original file,
or a MissingLocationError if missing.
Sourcepub fn byte_len(&self) -> Result<u64, MissingLocationError>
pub fn byte_len(&self) -> Result<u64, MissingLocationError>
Returns the length of the span in bytes,
or a MissingLocationError if missing.
Sourcepub fn start(&self) -> Location
pub fn start(&self) -> Location
The starting location of the span (inclusive),
or Location::MISSING if missing.
Sourcepub fn end(&self) -> Location
pub fn end(&self) -> Location
The ending location of the span (exclusive),
or Location::MISSING if missing.
Trait Implementations§
Source§impl Clone for OrderedSpan
impl Clone for OrderedSpan
Source§fn clone(&self) -> OrderedSpan
fn clone(&self) -> OrderedSpan
Returns a duplicate of the value. Read more
1.0.0 · 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 OrderedSpan
impl Debug for OrderedSpan
Source§impl Deref for OrderedSpan
impl Deref for OrderedSpan
Source§impl From<OrderedSpan> for Span
impl From<OrderedSpan> for Span
Source§fn from(value: OrderedSpan) -> Self
fn from(value: OrderedSpan) -> Self
Converts to this type from the input type.
Source§impl From<Span> for OrderedSpan
impl From<Span> for OrderedSpan
Source§impl Hash for OrderedSpan
impl Hash for OrderedSpan
Source§impl Ord for OrderedSpan
impl Ord for OrderedSpan
Source§impl PartialEq<Span> for OrderedSpan
impl PartialEq<Span> for OrderedSpan
Source§impl PartialEq for OrderedSpan
impl PartialEq for OrderedSpan
Source§impl PartialOrd<Span> for OrderedSpan
impl PartialOrd<Span> for OrderedSpan
Source§impl PartialOrd for OrderedSpan
impl PartialOrd for OrderedSpan
impl Copy for OrderedSpan
impl Eq for OrderedSpan
Auto Trait Implementations§
impl Freeze for OrderedSpan
impl RefUnwindSafe for OrderedSpan
impl Send for OrderedSpan
impl Sync for OrderedSpan
impl Unpin for OrderedSpan
impl UnwindSafe for OrderedSpan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.