pub struct TextRange { /* private fields */ }Implementations§
Source§impl TextRange
impl TextRange
pub const fn new(start: TextSize, end: TextSize) -> TextRange
pub const fn at(offset: TextSize, len: TextSize) -> TextRange
pub const fn empty(offset: TextSize) -> TextRange
pub const fn up_to(end: TextSize) -> TextRange
pub const fn start(self) -> TextSize
pub const fn end(self) -> TextSize
pub const fn len(self) -> TextSize
pub const fn is_empty(self) -> bool
pub fn contains(self, offset: TextSize) -> bool
pub fn contains_inclusive(self, offset: TextSize) -> bool
pub fn contains_range(self, other: TextRange) -> bool
pub fn intersect(self, other: TextRange) -> Option<TextRange>
pub fn cover(self, other: TextRange) -> TextRange
pub fn cover_offset(self, offset: TextSize) -> TextRange
pub fn checked_add(self, offset: TextSize) -> Option<TextRange>
pub fn checked_sub(self, offset: TextSize) -> Option<TextRange>
pub fn ordering(self, other: TextRange) -> Ordering
Trait Implementations§
Source§impl<A> AddAssign<A> for TextRange
impl<A> AddAssign<A> for TextRange
Source§fn add_assign(&mut self, rhs: A)
fn add_assign(&mut self, rhs: A)
Performs the
+= operation. Read moreimpl Copy for TextRange
impl Eq for TextRange
Source§impl RangeBounds<TextSize> for TextRange
impl RangeBounds<TextSize> for TextRange
impl StructuralPartialEq for TextRange
Auto Trait Implementations§
impl Freeze for TextRange
impl RefUnwindSafe for TextRange
impl Send for TextRange
impl Sync for TextRange
impl Unpin for TextRange
impl UnsafeUnpin for TextRange
impl UnwindSafe for TextRange
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