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: u32
Implementations§
source§impl CharOffset
impl CharOffset
Trait Implementations§
source§impl Add<u32> for CharOffset
impl Add<u32> for CharOffset
source§impl Add<CharOffset> for CharOffset
impl Add<CharOffset> for CharOffset
source§impl Clone for CharOffset
impl Clone for CharOffset
source§fn clone(&self) -> CharOffset
fn clone(&self) -> CharOffset
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 CharOffset
impl Debug for CharOffset
source§impl Default for CharOffset
impl Default for CharOffset
source§fn default() -> CharOffset
fn default() -> CharOffset
Returns the “default value” for a type. Read more
source§impl From<usize> for CharOffset
impl From<usize> for CharOffset
source§impl Hash for CharOffset
impl Hash for CharOffset
source§impl Ord for CharOffset
impl Ord for CharOffset
source§fn cmp(&self, other: &CharOffset) -> Ordering
fn cmp(&self, other: &CharOffset) -> 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<CharOffset> for CharOffset
impl PartialEq<CharOffset> for CharOffset
source§fn 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 ==
.source§impl PartialOrd<CharOffset> for CharOffset
impl PartialOrd<CharOffset> for CharOffset
source§fn partial_cmp(&self, other: &CharOffset) -> Option<Ordering>
fn partial_cmp(&self, other: &CharOffset) -> 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 moresource§impl Sub<u32> for CharOffset
impl Sub<u32> for CharOffset
source§impl Sub<CharOffset> for CharOffset
impl Sub<CharOffset> 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§
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.