Struct syntax::codemap::CharPosUnstable [-] [+] [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

fn from_usize(n: usize) -> CharPos

fn to_usize(&self) -> usize

impl Add for CharPos

type Output = CharPos

fn add(self, rhs: CharPos) -> CharPos

impl Sub for CharPos

type Output = CharPos

fn sub(self, rhs: CharPos) -> CharPos

Derived Implementations

impl Debug for CharPos

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl PartialOrd for CharPos

fn partial_cmp(&self, __arg_0: &CharPos) -> Option<Ordering>

fn lt(&self, __arg_0: &CharPos) -> bool

fn le(&self, __arg_0: &CharPos) -> bool

fn gt(&self, __arg_0: &CharPos) -> bool

fn ge(&self, __arg_0: &CharPos) -> bool

impl Hash for CharPos

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl PartialEq for CharPos

fn eq(&self, __arg_0: &CharPos) -> bool

fn ne(&self, __arg_0: &CharPos) -> bool

impl Copy for CharPos