[][src]Struct gluon_base::pos::BytePos

pub struct BytePos(pub u32);

A byte position in a source file

Methods

impl ByteIndex[src]

pub fn none() -> ByteIndex[src]

A byte position that will never point to a valid file

pub fn to_usize(self) -> usize[src]

Convert the position into a usize, for use in array indexing

Trait Implementations

impl Eq for ByteIndex[src]

impl Sub<ByteOffset> for ByteIndex[src]

type Output = ByteIndex

The resulting type after applying the - operator.

impl Sub<ByteIndex> for ByteIndex[src]

type Output = ByteOffset

The resulting type after applying the - operator.

impl PartialEq<ByteIndex> for ByteIndex[src]

impl Default for ByteIndex[src]

impl Index for ByteIndex[src]

impl Display for ByteIndex[src]

impl AddAssign<ByteOffset> for ByteIndex[src]

impl Hash for ByteIndex[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl SubAssign<ByteOffset> for ByteIndex[src]

impl Clone for ByteIndex[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Add<ByteOffset> for ByteIndex[src]

type Output = ByteIndex

The resulting type after applying the + operator.

impl PartialOrd<ByteIndex> for ByteIndex[src]

impl From<u32> for ByteIndex[src]

impl Debug for ByteIndex[src]

impl Copy for ByteIndex[src]

impl Ord for ByteIndex[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)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

Auto Trait Implementations

impl Send for ByteIndex

impl Sync for ByteIndex

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]