pub struct ColumnIndex(pub RawIndex);
Expand description
A zero-indexed column offset into a source file
Tuple Fields§
§0: RawIndex
Implementations§
Source§impl ColumnIndex
impl ColumnIndex
Sourcepub const fn number(self) -> ColumnNumber
pub const fn number(self) -> ColumnNumber
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");
Trait Implementations§
Source§impl Add<ColumnOffset> for ColumnIndex
impl Add<ColumnOffset> for ColumnIndex
Source§type Output = ColumnIndex
type Output = ColumnIndex
The resulting type after applying the
+
operator.Source§fn add(self, rhs: ColumnOffset) -> ColumnIndex
fn add(self, rhs: ColumnOffset) -> ColumnIndex
Performs the
+
operation. Read moreSource§impl AddAssign<ColumnOffset> for ColumnIndex
impl AddAssign<ColumnOffset> for ColumnIndex
Source§fn add_assign(&mut self, rhs: ColumnOffset)
fn add_assign(&mut self, rhs: ColumnOffset)
Performs the
+=
operation. Read moreSource§impl Clone for ColumnIndex
impl Clone for ColumnIndex
Source§fn clone(&self) -> ColumnIndex
fn clone(&self) -> ColumnIndex
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ColumnIndex
impl Debug for ColumnIndex
Source§impl Default for ColumnIndex
impl Default for ColumnIndex
Source§fn default() -> ColumnIndex
fn default() -> ColumnIndex
Returns the “default value” for a type. Read more
Source§impl Display for ColumnIndex
impl Display for ColumnIndex
Source§impl From<ColumnIndex> for RawIndex
impl From<ColumnIndex> for RawIndex
Source§fn from(index: ColumnIndex) -> RawIndex
fn from(index: ColumnIndex) -> RawIndex
Converts to this type from the input type.
Source§impl From<ColumnIndex> for usize
impl From<ColumnIndex> for usize
Source§fn from(index: ColumnIndex) -> usize
fn from(index: ColumnIndex) -> usize
Converts to this type from the input type.
Source§impl From<u32> for ColumnIndex
impl From<u32> for ColumnIndex
Source§impl Hash for ColumnIndex
impl Hash for ColumnIndex
Source§impl Index for ColumnIndex
impl Index for ColumnIndex
type Offset = ColumnOffset
Source§impl Ord for ColumnIndex
impl Ord for ColumnIndex
Source§fn cmp(&self, other: &ColumnIndex) -> Ordering
fn cmp(&self, other: &ColumnIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ColumnIndex
impl PartialEq for ColumnIndex
Source§impl PartialOrd for ColumnIndex
impl PartialOrd for ColumnIndex
Source§impl Sub<ColumnOffset> for ColumnIndex
impl Sub<ColumnOffset> for ColumnIndex
Source§type Output = ColumnIndex
type Output = ColumnIndex
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: ColumnOffset) -> ColumnIndex
fn sub(self, rhs: ColumnOffset) -> ColumnIndex
Performs the
-
operation. Read moreSource§impl Sub for ColumnIndex
impl Sub for ColumnIndex
Source§type Output = ColumnOffset
type Output = ColumnOffset
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: ColumnIndex) -> ColumnOffset
fn sub(self, rhs: ColumnIndex) -> ColumnOffset
Performs the
-
operation. Read moreSource§impl SubAssign<ColumnOffset> for ColumnIndex
impl SubAssign<ColumnOffset> for ColumnIndex
Source§fn sub_assign(&mut self, rhs: ColumnOffset)
fn sub_assign(&mut self, rhs: ColumnOffset)
Performs the
-=
operation. Read moreimpl Copy for ColumnIndex
impl Eq for ColumnIndex
impl StructuralPartialEq for ColumnIndex
Auto Trait Implementations§
impl Freeze for ColumnIndex
impl RefUnwindSafe for ColumnIndex
impl Send for ColumnIndex
impl Sync for ColumnIndex
impl Unpin for ColumnIndex
impl UnwindSafe for ColumnIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more