[−][src]Struct racer::ByteRange
0-based byte range in a file.
Fields
start: BytePos
start of byte position in codes(inclusive)
end: BytePos
end of byte position in codes(exclusive)
Implementations
impl ByteRange
[src]
pub fn new<P: Into<BytePos>>(start: P, end: P) -> Self
[src]
returns new ByteRange from start and end
pub fn len(&self) -> usize
[src]
returns the length of the range
pub fn contains(&self, point: BytePos) -> bool
[src]
returns if the range contains point
or not
pub fn contains_exclusive(&self, point: BytePos) -> bool
[src]
returns if the range contains point
(except its start point)
pub fn shift<P: Into<BytePos>>(&self, shift: P) -> Self
[src]
returns the new range with which its start is self.start + shift
,
its end is self.end + shift
pub fn to_range(&self) -> Range<usize>
[src]
convert the range to std::ops::Range
Trait Implementations
impl Clone for ByteRange
[src]
impl Copy for ByteRange
[src]
impl Debug for ByteRange
[src]
impl Default for ByteRange
[src]
impl Eq for ByteRange
[src]
impl From<Span> for ByteRange
[src]
impl Hash for ByteRange
[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 PartialEq<BytePos> for ByteRange
[src]
impl PartialEq<ByteRange> for ByteRange
[src]
impl PartialOrd<BytePos> for ByteRange
[src]
fn partial_cmp(&self, other: &BytePos) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for ByteRange
[src]
impl StructuralPartialEq for ByteRange
[src]
Auto Trait Implementations
impl RefUnwindSafe for ByteRange
impl Send for ByteRange
impl Sync for ByteRange
impl Unpin for ByteRange
impl UnwindSafe for ByteRange
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for 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> MaybeResult<T> for T
[src]
type Error = !
fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T
[src]
fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
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> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,