[−][src]Struct unsegen::base::basic_types::LineIndex
A type for enumerating lines by index (rather than by number), i.e., starting from 0. Conversions between LineNumber and LineIndex are always safe.
Implementations
impl LineIndex
[src]
pub fn new(val: usize) -> Self
[src]
Create a new LineIndex from a raw value.
pub fn raw_value(self) -> usize
[src]
Unpack the LineIndex and yield the underlying value.
pub fn checked_sub(&self, rhs: usize) -> Option<LineIndex>
[src]
Checked integer subtraction. Computes self - rhs, returning None if the result is invalid (i.e., smaller than 0).
Examples:
use unsegen::base::LineIndex; assert_eq!(LineIndex::new(37).checked_sub(27), Some(LineIndex::new(10))); assert_eq!(LineIndex::new(27).checked_sub(37), None);
Trait Implementations
impl Add<usize> for LineIndex
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: usize) -> Self
[src]
impl AddAssign<usize> for LineIndex
[src]
fn add_assign(&mut self, rhs: usize)
[src]
impl Clone for LineIndex
[src]
impl Copy for LineIndex
[src]
impl Debug for LineIndex
[src]
impl Display for LineIndex
[src]
impl Eq for LineIndex
[src]
impl From<LineIndex> for LineNumber
[src]
impl From<LineNumber> for LineIndex
[src]
fn from(LineNumber: LineNumber) -> Self
[src]
impl Hash for LineIndex
[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 Into<usize> for LineIndex
[src]
impl PartialEq<LineIndex> for LineIndex
[src]
impl PartialOrd<LineIndex> for LineIndex
[src]
fn partial_cmp(&self, other: &LineIndex) -> Option<Ordering>
[src]
fn lt(&self, other: &LineIndex) -> bool
[src]
fn le(&self, other: &LineIndex) -> bool
[src]
fn gt(&self, other: &LineIndex) -> bool
[src]
fn ge(&self, other: &LineIndex) -> bool
[src]
impl StructuralEq for LineIndex
[src]
impl StructuralPartialEq for LineIndex
[src]
impl Sub<usize> for LineIndex
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: usize) -> Self
[src]
impl SubAssign<usize> for LineIndex
[src]
fn sub_assign(&mut self, rhs: usize)
[src]
Auto Trait Implementations
impl RefUnwindSafe for LineIndex
impl Send for LineIndex
impl Sync for LineIndex
impl Unpin for LineIndex
impl UnwindSafe for LineIndex
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>,