Struct rat_widget::textarea::core::TextRange
source · pub struct TextRange {
pub start: (usize, usize),
pub end: (usize, usize),
}Expand description
Range for text ranges.
Fields§
§start: (usize, usize)§end: (usize, usize)Implementations§
source§impl TextRange
impl TextRange
sourcepub fn new(start: (usize, usize), end: (usize, usize)) -> Self
pub fn new(start: (usize, usize), end: (usize, usize)) -> Self
New text range.
Panic Panics if start > end.
sourcepub fn contains_range(&self, range: TextRange) -> bool
pub fn contains_range(&self, range: TextRange) -> bool
Range contains the other range.
sourcepub fn ordering(&self, pos: (usize, usize)) -> Ordering
pub fn ordering(&self, pos: (usize, usize)) -> Ordering
What place is the range respective to the given position.
sourcepub fn ordering_inclusive(&self, pos: (usize, usize)) -> Ordering
pub fn ordering_inclusive(&self, pos: (usize, usize)) -> Ordering
What place is the range respective to the given position.
This one includes the range.end.
sourcepub fn expand_all(&self, it: Skip<IterMut<'_, (TextRange, usize)>>)
pub fn expand_all(&self, it: Skip<IterMut<'_, (TextRange, usize)>>)
Modify all positions in place.
sourcepub fn shrink_all(&self, it: Skip<IterMut<'_, (TextRange, usize)>>)
pub fn shrink_all(&self, it: Skip<IterMut<'_, (TextRange, usize)>>)
Modify all positions in place.
Trait Implementations§
source§impl Ord for TextRange
impl Ord for TextRange
source§impl PartialEq for TextRange
impl PartialEq for TextRange
source§impl PartialOrd for TextRange
impl PartialOrd for TextRange
1.0.0 · source§fn 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 moreimpl Copy for TextRange
impl Eq 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 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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