[−][src]Struct codespan::ColumnIndex
A zero-indexed column offset into a source file
Methods
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 Index for ColumnIndex
[src]
type Offset = ColumnOffset
impl From<u32> for 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
fn clamp(self, min: Self, max: Self) -> Self
[src]
🔬 This is a nightly-only experimental API. (
clamp
)Restrict a value to a certain interval. Read more
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 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 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 Eq for ColumnIndex
[src]
impl Copy for ColumnIndex
[src]
impl Display for ColumnIndex
[src]
impl Debug for ColumnIndex
[src]
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 Hash for ColumnIndex
[src]
Auto Trait Implementations
impl Send for ColumnIndex
impl Unpin for ColumnIndex
impl Sync for ColumnIndex
impl RefUnwindSafe for ColumnIndex
impl UnwindSafe for ColumnIndex
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,