Struct partiql_source_map::location::CharOffset
source · [−]pub struct CharOffset(pub u32);Expand description
A 0-indexed char offset, relative to some other position.
This value represents the number of unicode codepoints seen, so will differ
from ByteOffset for a given location in a &str if the string contains
non-ASCII unicode characters
Tuple Fields
0: u32Implementations
sourceimpl CharOffset
impl CharOffset
Trait Implementations
sourceimpl Add<CharOffset> for CharOffset
impl Add<CharOffset> for CharOffset
sourceimpl Add<u32> for CharOffset
impl Add<u32> for CharOffset
sourceimpl Clone for CharOffset
impl Clone for CharOffset
sourcefn clone(&self) -> CharOffset
fn clone(&self) -> CharOffset
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 CharOffset
impl Debug for CharOffset
sourceimpl Default for CharOffset
impl Default for CharOffset
sourcefn default() -> CharOffset
fn default() -> CharOffset
Returns the “default value” for a type. Read more
sourceimpl From<usize> for CharOffset
impl From<usize> for CharOffset
sourceimpl Hash for CharOffset
impl Hash for CharOffset
sourceimpl Ord for CharOffset
impl Ord for CharOffset
sourcefn cmp(&self, other: &CharOffset) -> Ordering
fn cmp(&self, other: &CharOffset) -> 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<CharOffset> for CharOffset
impl PartialEq<CharOffset> for CharOffset
sourcefn eq(&self, other: &CharOffset) -> bool
fn eq(&self, other: &CharOffset) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &CharOffset) -> bool
fn ne(&self, other: &CharOffset) -> bool
This method tests for !=.
sourceimpl PartialOrd<CharOffset> for CharOffset
impl PartialOrd<CharOffset> for CharOffset
sourcefn partial_cmp(&self, other: &CharOffset) -> Option<Ordering>
fn partial_cmp(&self, other: &CharOffset) -> 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
sourceimpl Sub<CharOffset> for CharOffset
impl Sub<CharOffset> for CharOffset
sourceimpl Sub<u32> for CharOffset
impl Sub<u32> for CharOffset
impl Copy for CharOffset
impl Eq for CharOffset
impl StructuralEq for CharOffset
impl StructuralPartialEq for CharOffset
Auto Trait Implementations
impl RefUnwindSafe for CharOffset
impl Send for CharOffset
impl Sync for CharOffset
impl Unpin for CharOffset
impl UnwindSafe for CharOffset
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