Struct racer::BytePos [−][src]
pub struct BytePos(pub usize);
0-based byte offset in a file.
Methods
impl BytePos
[src]
impl BytePos
pub const ZERO: BytePos
ZERO: BytePos = BytePos(0)
pub fn decrement(&self) -> Self
[src]
pub fn decrement(&self) -> Self
returns self - 1
pub fn increment(&self) -> Self
[src]
pub fn increment(&self) -> Self
returns self + 1
Trait Implementations
impl Clone for BytePos
[src]
impl Clone for BytePos
fn clone(&self) -> BytePos
[src]
fn clone(&self) -> BytePos
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for BytePos
[src]
impl Copy for BytePos
impl Debug for BytePos
[src]
impl Debug for BytePos
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for BytePos
[src]
impl Default for BytePos
impl Eq for BytePos
[src]
impl Eq for BytePos
impl PartialEq for BytePos
[src]
impl PartialEq for BytePos
fn eq(&self, other: &BytePos) -> bool
[src]
fn eq(&self, other: &BytePos) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BytePos) -> bool
[src]
fn ne(&self, other: &BytePos) -> bool
This method tests for !=
.
impl Ord for BytePos
[src]
impl Ord for BytePos
fn cmp(&self, other: &BytePos) -> Ordering
[src]
fn cmp(&self, other: &BytePos) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialOrd for BytePos
[src]
impl PartialOrd for BytePos
fn partial_cmp(&self, other: &BytePos) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BytePos) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &BytePos) -> bool
[src]
fn lt(&self, other: &BytePos) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &BytePos) -> bool
[src]
fn le(&self, other: &BytePos) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &BytePos) -> bool
[src]
fn gt(&self, other: &BytePos) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &BytePos) -> bool
[src]
fn ge(&self, other: &BytePos) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for BytePos
[src]
impl Hash for BytePos
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<__IdxT> Index<__IdxT> for BytePos where
usize: Index<__IdxT>,
[src]
impl<__IdxT> Index<__IdxT> for BytePos where
usize: Index<__IdxT>,
type Output = <usize as Index<__IdxT>>::Output
The returned type after indexing.
fn index(&self, idx: __IdxT) -> &Self::Output
[src]
fn index(&self, idx: __IdxT) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl From<usize> for BytePos
[src]
impl From<usize> for BytePos
impl Add for BytePos
[src]
impl Add for BytePos
type Output = BytePos
The resulting type after applying the +
operator.
fn add(self, rhs: BytePos) -> BytePos
[src]
fn add(self, rhs: BytePos) -> BytePos
Performs the +
operation.
impl Sub for BytePos
[src]
impl Sub for BytePos
type Output = BytePos
The resulting type after applying the -
operator.
fn sub(self, rhs: BytePos) -> BytePos
[src]
fn sub(self, rhs: BytePos) -> BytePos
Performs the -
operation.
impl AddAssign for BytePos
[src]
impl AddAssign for BytePos
fn add_assign(&mut self, rhs: BytePos)
[src]
fn add_assign(&mut self, rhs: BytePos)
Performs the +=
operation.
impl SubAssign for BytePos
[src]
impl SubAssign for BytePos
fn sub_assign(&mut self, rhs: BytePos)
[src]
fn sub_assign(&mut self, rhs: BytePos)
Performs the -=
operation.
impl From<u32> for BytePos
[src]
impl From<u32> for BytePos
impl Display for BytePos
[src]
impl Display for BytePos
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq<BytePos> for ByteRange
[src]
impl PartialEq<BytePos> for ByteRange
fn eq(&self, other: &BytePos) -> bool
[src]
fn eq(&self, other: &BytePos) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialOrd<BytePos> for ByteRange
[src]
impl PartialOrd<BytePos> for ByteRange
fn partial_cmp(&self, other: &BytePos) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BytePos) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl From<BytePos> for Location
[src]
impl From<BytePos> for Location