[−][src]Struct rowan::TextRange
A range in the text, represented as a pair of TextUnit
s.
Panics
Slicing a &str
with TextRange
panics if the result is
not a valid utf8 string.
Methods
impl TextRange
[src]
impl TextRange
pub fn checked_sub(self, other: TextUnit) -> Option<TextRange> | [src] |
impl TextRange
[src]
impl TextRange
pub fn from_to(from: TextUnit, to: TextUnit) -> TextRange | [src] |
The left-inclusive range ([from..to)
) between to points in the text
pub fn offset_len(offset: TextUnit, len: TextUnit) -> TextRange | [src] |
The left-inclusive range ([offset..offset + len)
) between to points in the text
pub fn start(&self) -> TextUnit | [src] |
The inclusive start of this range
pub fn end(&self) -> TextUnit | [src] |
The exclusive end of this range
pub fn len(&self) -> TextUnit | [src] |
The length of this range
pub fn is_empty(&self) -> bool | [src] |
Is this range empty of any content?
pub fn is_subrange(&self, other: &TextRange) -> bool | [src] |
pub fn intersection(&self, other: &TextRange) -> Option<TextRange> | [src] |
pub fn contains(&self, offset: TextUnit) -> bool | [src] |
pub fn contains_inclusive(&self, offset: TextUnit) -> bool | [src] |
Trait Implementations
impl Hash for TextRange
[src]
impl Hash for TextRange
fn hash<__H>(&self, state: &mut __H) where | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl Copy for TextRange
[src]
impl Copy for TextRange
impl<'a> AddAssign<&'a TextUnit> for TextRange
[src]
impl<'a> AddAssign<&'a TextUnit> for TextRange
fn add_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl AddAssign<TextUnit> for TextRange
[src]
impl AddAssign<TextUnit> for TextRange
fn add_assign(&mut self, rhs: TextUnit) | [src] |
impl Clone for TextRange
[src]
impl Clone for TextRange
fn clone(&self) -> TextRange | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Index<TextRange> for str
[src]
impl Index<TextRange> for str
impl<'a, 'b> Add<&'a TextUnit> for &'b TextRange
[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextRange
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextRange | [src] |
impl Add<TextUnit> for TextRange
[src]
impl Add<TextUnit> for TextRange
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextRange | [src] |
impl<'a> Add<&'a TextUnit> for TextRange
[src]
impl<'a> Add<&'a TextUnit> for TextRange
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextRange | [src] |
impl<'a> Add<TextUnit> for &'a TextRange
[src]
impl<'a> Add<TextUnit> for &'a TextRange
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextRange | [src] |
impl Eq for TextRange
[src]
impl Eq for TextRange
impl PartialEq<TextRange> for TextRange
[src]
impl PartialEq<TextRange> for TextRange
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRange
[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRange
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextRange | [src] |
impl<'a> Sub<&'a TextUnit> for TextRange
[src]
impl<'a> Sub<&'a TextUnit> for TextRange
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextRange | [src] |
impl Sub<TextUnit> for TextRange
[src]
impl Sub<TextUnit> for TextRange
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextRange | [src] |
impl<'a> Sub<TextUnit> for &'a TextRange
[src]
impl<'a> Sub<TextUnit> for &'a TextRange
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextRange | [src] |
impl Display for TextRange
[src]
impl Display for TextRange
impl<'a> SubAssign<&'a TextUnit> for TextRange
[src]
impl<'a> SubAssign<&'a TextUnit> for TextRange
fn sub_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl SubAssign<TextUnit> for TextRange
[src]
impl SubAssign<TextUnit> for TextRange
fn sub_assign(&mut self, rhs: TextUnit) | [src] |
impl Debug for TextRange
[src]
impl Debug for TextRange
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Erased for T
impl<T> Erased for T