pub struct SourceRange {
pub start_offset: usize,
pub length: usize,
}Fields§
§start_offset: usize§length: usizeImplementations§
Source§impl SourceRange
impl SourceRange
pub const EMPTY: SourceRange
pub fn new(start_offset: usize, length: usize) -> SourceRange
pub fn from_start_end(start_offset: usize, end_offset: usize) -> Self
pub fn end_offset(&self) -> usize
pub fn contains(&self, offset: usize) -> bool
pub fn contains_inclusive(&self, offset: usize) -> bool
pub fn contain_range(&self, range: &SourceRange) -> bool
pub fn intersect(&self, range: &SourceRange) -> bool
pub fn moved(&self, offset: usize) -> SourceRange
pub fn merge(&self, range: &SourceRange) -> SourceRange
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for SourceRange
impl Clone for SourceRange
Source§fn clone(&self) -> SourceRange
fn clone(&self) -> SourceRange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceRange
impl Debug for SourceRange
Source§impl Display for SourceRange
impl Display for SourceRange
Source§impl From<SourceRange> for TextRange
impl From<SourceRange> for TextRange
Source§fn from(val: SourceRange) -> Self
fn from(val: SourceRange) -> Self
Converts to this type from the input type.
Source§impl From<TextRange> for SourceRange
impl From<TextRange> for SourceRange
Source§impl PartialEq for SourceRange
impl PartialEq for SourceRange
impl Copy for SourceRange
impl Eq for SourceRange
impl StructuralPartialEq for SourceRange
Auto Trait Implementations§
impl Freeze for SourceRange
impl RefUnwindSafe for SourceRange
impl Send for SourceRange
impl Sync for SourceRange
impl Unpin for SourceRange
impl UnwindSafe for SourceRange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more