pub struct ByteIndex(pub RawIndex);
Expand description
A byte position in a source file.
Tuple Fields
0: RawIndex
Implementations
Trait Implementations
sourceimpl Add<ByteOffset> for ByteIndex
impl Add<ByteOffset> for ByteIndex
sourceimpl AddAssign<ByteOffset> for ByteIndex
impl AddAssign<ByteOffset> for ByteIndex
sourcefn add_assign(&mut self, rhs: ByteOffset)
fn add_assign(&mut self, rhs: ByteOffset)
Performs the +=
operation. Read more
sourceimpl<'de> Deserialize<'de> for ByteIndex
impl<'de> Deserialize<'de> for ByteIndex
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Index for ByteIndex
impl Index for ByteIndex
type Offset = ByteOffset
sourceimpl Ord for ByteIndex
impl Ord for ByteIndex
sourceimpl PartialOrd<ByteIndex> for ByteIndex
impl PartialOrd<ByteIndex> for ByteIndex
sourcefn partial_cmp(&self, other: &ByteIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &ByteIndex) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl Sub<ByteIndex> for ByteIndex
impl Sub<ByteIndex> for ByteIndex
type Output = ByteOffset
type Output = ByteOffset
The resulting type after applying the -
operator.
sourcefn sub(self, rhs: ByteIndex) -> ByteOffset
fn sub(self, rhs: ByteIndex) -> ByteOffset
Performs the -
operation. Read more
sourceimpl Sub<ByteOffset> for ByteIndex
impl Sub<ByteOffset> for ByteIndex
sourceimpl SubAssign<ByteOffset> for ByteIndex
impl SubAssign<ByteOffset> for ByteIndex
sourcefn sub_assign(&mut self, rhs: ByteOffset)
fn sub_assign(&mut self, rhs: ByteOffset)
Performs the -=
operation. Read more
impl Copy for ByteIndex
impl Eq for ByteIndex
impl StructuralEq for ByteIndex
impl StructuralPartialEq for ByteIndex
Auto Trait Implementations
impl RefUnwindSafe for ByteIndex
impl Send for ByteIndex
impl Sync for ByteIndex
impl Unpin for ByteIndex
impl UnwindSafe for ByteIndex
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more