Struct partiql_source_map::location::BytePosition
source · pub struct BytePosition(pub ByteOffset);
Expand description
A 0-indexed byte absolute position (i.e., relative to the start of a &str)
This type is small (u32 currently) to allow it to be included in ASTs and other data structures.
Tuple Fields§
§0: ByteOffset
Trait Implementations§
source§impl Clone for BytePosition
impl Clone for BytePosition
source§fn clone(&self) -> BytePosition
fn clone(&self) -> BytePosition
Returns a copy 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 BytePosition
impl Debug for BytePosition
source§impl Display for BytePosition
impl Display for BytePosition
source§impl From<ByteOffset> for BytePosition
impl From<ByteOffset> for BytePosition
source§fn from(offset: ByteOffset) -> Self
fn from(offset: ByteOffset) -> Self
Converts to this type from the input type.
source§impl From<usize> for BytePosition
impl From<usize> for BytePosition
source§impl Hash for BytePosition
impl Hash for BytePosition
source§impl Ord for BytePosition
impl Ord for BytePosition
source§fn cmp(&self, other: &BytePosition) -> Ordering
fn cmp(&self, other: &BytePosition) -> Ordering
1.21.0 · 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 PartialEq<BytePosition> for BytePosition
impl PartialEq<BytePosition> for BytePosition
source§fn eq(&self, other: &BytePosition) -> bool
fn eq(&self, other: &BytePosition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<BytePosition> for BytePosition
impl PartialOrd<BytePosition> for BytePosition
source§fn partial_cmp(&self, other: &BytePosition) -> Option<Ordering>
fn partial_cmp(&self, other: &BytePosition) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for BytePosition
impl Eq for BytePosition
impl StructuralEq for BytePosition
impl StructuralPartialEq for BytePosition
Auto Trait Implementations§
impl RefUnwindSafe for BytePosition
impl Send for BytePosition
impl Sync for BytePosition
impl Unpin for BytePosition
impl UnwindSafe for BytePosition
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.