Struct syntex_syntax::codemap::CharPos
[−]
[src]
pub struct CharPos(pub usize);
A character offset. Because of multibyte utf8 characters, a byte offset is not equivalent to a character offset. The CodeMap will convert BytePos values to CharPos values as necessary.
Trait Implementations
impl Pos for CharPos
[src]
fn from_usize(n: usize) -> CharPos
fn to_usize(&self) -> usize
impl Add for CharPos
[src]
type Output = CharPos
The resulting type after applying the +
operator
fn add(self, rhs: CharPos) -> CharPos
The method for the +
operator
impl Sub for CharPos
[src]
type Output = CharPos
The resulting type after applying the -
operator
fn sub(self, rhs: CharPos) -> CharPos
The method for the -
operator
Derived Implementations
impl Debug for CharPos
[src]
impl PartialOrd for CharPos
[src]
fn partial_cmp(&self, __arg_0: &CharPos) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &CharPos) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &CharPos) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &CharPos) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &CharPos) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for CharPos
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Eq for CharPos
[src]
impl PartialEq for CharPos
[src]
fn eq(&self, __arg_0: &CharPos) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CharPos) -> bool
This method tests for !=
.
impl Clone for CharPos
[src]
fn clone(&self) -> CharPos
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more