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
sourceimpl Clone for BytePosition
impl Clone for BytePosition
sourcefn clone(&self) -> BytePosition
fn clone(&self) -> BytePosition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BytePosition
impl Debug for BytePosition
sourceimpl Display for BytePosition
impl Display for BytePosition
sourceimpl From<ByteOffset> for BytePosition
impl From<ByteOffset> for BytePosition
sourcefn from(offset: ByteOffset) -> Self
fn from(offset: ByteOffset) -> Self
Converts to this type from the input type.
sourceimpl From<usize> for BytePosition
impl From<usize> for BytePosition
sourceimpl Hash for BytePosition
impl Hash for BytePosition
sourceimpl Ord for BytePosition
impl Ord for BytePosition
sourcefn cmp(&self, other: &BytePosition) -> Ordering
fn cmp(&self, other: &BytePosition) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<BytePosition> for BytePosition
impl PartialEq<BytePosition> for BytePosition
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &BytePosition) -> bool
fn ne(&self, other: &BytePosition) -> bool
This method tests for !=
.
sourceimpl PartialOrd<BytePosition> for BytePosition
impl PartialOrd<BytePosition> for BytePosition
sourcefn partial_cmp(&self, other: &BytePosition) -> Option<Ordering>
fn partial_cmp(&self, other: &BytePosition) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more