[−][src]Struct codespan::ColumnIndex
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.
fn add(self, rhs: ColumnOffset) -> ColumnIndex
[src]
impl AddAssign<ColumnOffset> for ColumnIndex
[src]
fn add_assign(&mut self, rhs: ColumnOffset)
[src]
impl Clone for ColumnIndex
[src]
fn clone(&self) -> ColumnIndex
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ColumnIndex
[src]
impl Debug for ColumnIndex
[src]
impl Default for ColumnIndex
[src]
fn default() -> ColumnIndex
[src]
impl Display for ColumnIndex
[src]
impl Eq for ColumnIndex
[src]
impl From<ColumnIndex> for RawIndex
[src]
fn from(index: ColumnIndex) -> RawIndex
[src]
impl From<ColumnIndex> for usize
[src]
fn from(index: ColumnIndex) -> usize
[src]
impl From<u32> for ColumnIndex
[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,
impl Index for ColumnIndex
[src]
type Offset = ColumnOffset
impl Ord for ColumnIndex
[src]
fn cmp(&self, other: &ColumnIndex) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ColumnIndex> for ColumnIndex
[src]
fn eq(&self, other: &ColumnIndex) -> bool
[src]
fn ne(&self, other: &ColumnIndex) -> bool
[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 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.
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 SubAssign<ColumnOffset> for ColumnIndex
[src]
fn sub_assign(&mut self, rhs: ColumnOffset)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ColumnIndex
impl Send for ColumnIndex
impl Sync for ColumnIndex
impl Unpin for ColumnIndex
impl UnwindSafe for ColumnIndex
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,