[−][src]Struct codespan::ColumnIndex
A zero-indexed column offset into a source file
Methods
impl ColumnIndex
[src]
pub 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 fn to_usize(self) -> usize
[src]
Convert the index into a usize
, for use in array indexing
Trait Implementations
impl Index for ColumnIndex
[src]
type Offset = ColumnOffset
impl PartialEq<ColumnIndex> for ColumnIndex
[src]
fn eq(&self, other: &ColumnIndex) -> bool
[src]
fn ne(&self, other: &ColumnIndex) -> bool
[src]
impl Default for ColumnIndex
[src]
fn default() -> ColumnIndex
[src]
impl Ord for ColumnIndex
[src]
fn cmp(&self, other: &ColumnIndex) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for ColumnIndex
[src]
fn clone(&self) -> ColumnIndex
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<u32> for ColumnIndex
[src]
impl Eq for ColumnIndex
[src]
impl Copy for ColumnIndex
[src]
impl PartialOrd<ColumnIndex> for ColumnIndex
[src]
fn partial_cmp(&self, other: &ColumnIndex) -> Option<Ordering>
[src]
fn lt(&self, other: &ColumnIndex) -> bool
[src]
fn le(&self, other: &ColumnIndex) -> bool
[src]
fn gt(&self, other: &ColumnIndex) -> bool
[src]
fn ge(&self, other: &ColumnIndex) -> bool
[src]
impl Hash for ColumnIndex
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Add<ColumnOffset> for ColumnIndex
[src]
type Output = ColumnIndex
The resulting type after applying the +
operator.
fn add(self, rhs: ColumnOffset) -> ColumnIndex
[src]
impl Sub<ColumnIndex> for ColumnIndex
[src]
type Output = ColumnOffset
The resulting type after applying the -
operator.
fn sub(self, rhs: ColumnIndex) -> ColumnOffset
[src]
impl Sub<ColumnOffset> for ColumnIndex
[src]
type Output = ColumnIndex
The resulting type after applying the -
operator.
fn sub(self, rhs: ColumnOffset) -> ColumnIndex
[src]
impl AddAssign<ColumnOffset> for ColumnIndex
[src]
fn add_assign(&mut self, rhs: ColumnOffset)
[src]
impl SubAssign<ColumnOffset> for ColumnIndex
[src]
fn sub_assign(&mut self, rhs: ColumnOffset)
[src]
impl Debug for ColumnIndex
[src]
Auto Trait Implementations
impl Send for ColumnIndex
impl Sync for ColumnIndex
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,