Struct codespan::ColumnIndex[][src]

pub struct ColumnIndex(pub RawIndex);

A zero-indexed column offset into a source file

Implementations

impl ColumnIndex[src]

pub const fn number(self) -> ColumnNumber[src]

The 1-indexed column number. Useful for pretty printing source locations.

use codespan::{ColumnIndex, ColumnNumber};

assert_eq!(format!("{}", ColumnIndex(0).number()), "1");
assert_eq!(format!("{}", ColumnIndex(3).number()), "4");

pub const fn to_usize(self) -> usize[src]

Convert the index into a usize, for use in array indexing

Trait Implementations

impl Add<ColumnOffset> for ColumnIndex[src]

type Output = ColumnIndex

The resulting type after applying the + operator.

impl AddAssign<ColumnOffset> for ColumnIndex[src]

impl Clone for ColumnIndex[src]

impl Copy for ColumnIndex[src]

impl Debug for ColumnIndex[src]

impl Default for ColumnIndex[src]

impl Display for ColumnIndex[src]

impl Eq for ColumnIndex[src]

impl From<ColumnIndex> for RawIndex[src]

impl From<u32> for ColumnIndex[src]

impl Hash for ColumnIndex[src]

impl Index for ColumnIndex[src]

impl Ord for ColumnIndex[src]

impl PartialEq<ColumnIndex> for ColumnIndex[src]

impl PartialOrd<ColumnIndex> for ColumnIndex[src]

impl StructuralEq for ColumnIndex[src]

impl StructuralPartialEq for ColumnIndex[src]

impl Sub<ColumnIndex> for ColumnIndex[src]

type Output = ColumnOffset

The resulting type after applying the - operator.

impl Sub<ColumnOffset> for ColumnIndex[src]

type Output = ColumnIndex

The resulting type after applying the - operator.

impl SubAssign<ColumnOffset> for ColumnIndex[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.