[][src]Struct rowan::TextRange

pub struct TextRange { /* fields omitted */ }

A range in the text, represented as a pair of TextUnits.

Panics

Slicing a &str with TextRange panics if the result is not a valid utf8 string.

Methods

impl TextRange
[src]

pub fn checked_sub(self, other: TextUnit) -> Option<TextRange>
[src]

impl TextRange
[src]

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]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Copy for TextRange
[src]

impl<'a> AddAssign<&'a TextUnit> for TextRange
[src]

impl AddAssign<TextUnit> for TextRange
[src]

impl Clone for 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]

type Output = str

The returned type after indexing.

impl<'a, 'b> Add<&'a TextUnit> for &'b TextRange
[src]

type Output = TextRange

The resulting type after applying the + operator.

impl Add<TextUnit> for TextRange
[src]

type Output = TextRange

The resulting type after applying the + operator.

impl<'a> Add<&'a TextUnit> for TextRange
[src]

type Output = TextRange

The resulting type after applying the + operator.

impl<'a> Add<TextUnit> for &'a TextRange
[src]

type Output = TextRange

The resulting type after applying the + operator.

impl Eq for TextRange
[src]

impl PartialEq<TextRange> for TextRange
[src]

impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRange
[src]

type Output = TextRange

The resulting type after applying the - operator.

impl<'a> Sub<&'a TextUnit> for TextRange
[src]

type Output = TextRange

The resulting type after applying the - operator.

impl Sub<TextUnit> for TextRange
[src]

type Output = TextRange

The resulting type after applying the - operator.

impl<'a> Sub<TextUnit> for &'a TextRange
[src]

type Output = TextRange

The resulting type after applying the - operator.

impl Display for TextRange
[src]

impl<'a> SubAssign<&'a TextUnit> for TextRange
[src]

impl SubAssign<TextUnit> for TextRange
[src]

impl Debug for TextRange
[src]

Auto Trait Implementations

impl Send for TextRange

impl Sync for TextRange

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Erased for T