Struct rowan::TextRange [−][src]
pub struct TextRange { /* fields omitted */ }
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]
pub fn checked_sub(self, other: TextUnit) -> Option<TextRange>
impl TextRange
[src]
impl TextRange
pub fn from_to(from: TextUnit, to: TextUnit) -> TextRange
[src]
pub fn from_to(from: TextUnit, to: TextUnit) -> TextRange
The left-inclusive range ([from..to)
) between to points in the text
pub fn offset_len(offset: TextUnit, len: TextUnit) -> TextRange
[src]
pub fn offset_len(offset: TextUnit, len: TextUnit) -> TextRange
The left-inclusive range ([offset..offset + len)
) between to points in the text
pub fn start(&self) -> TextUnit
[src]
pub fn start(&self) -> TextUnit
The inclusive start of this range
pub fn end(&self) -> TextUnit
[src]
pub fn end(&self) -> TextUnit
The exclusive end of this range
pub fn len(&self) -> TextUnit
[src]
pub fn len(&self) -> TextUnit
The length of this range
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Is this range empty of any content?
Trait Implementations
impl Index<TextRange> for str
[src]
impl Index<TextRange> for str
type Output = str
The returned type after indexing.
fn index(&self, index: TextRange) -> &str
[src]
fn index(&self, index: TextRange) -> &str
Performs the indexing (container[index]
) operation.
impl Index<TextRange> for String
[src]
impl Index<TextRange> for String
type Output = str
The returned type after indexing.
fn index(&self, index: TextRange) -> &str
[src]
fn index(&self, index: TextRange) -> &str
Performs the indexing (container[index]
) operation.
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]
fn add(self, rhs: &'a TextUnit) -> TextRange
Performs the +
operation.
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]
fn add(self, rhs: TextUnit) -> TextRange
Performs the +
operation.
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]
fn add(self, rhs: &'a TextUnit) -> TextRange
Performs the +
operation.
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]
fn add(self, rhs: TextUnit) -> TextRange
Performs the +
operation.
impl Hash for TextRange
[src]
impl Hash for TextRange
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
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]
fn sub(self, rhs: &'a TextUnit) -> TextRange
Performs the -
operation.
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]
fn sub(self, rhs: &'a TextUnit) -> TextRange
Performs the -
operation.
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]
fn sub(self, rhs: TextUnit) -> TextRange
Performs the -
operation.
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]
fn sub(self, rhs: TextUnit) -> TextRange
Performs the -
operation.
impl Display for TextRange
[src]
impl Display for TextRange
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Clone for TextRange
[src]
impl Clone for TextRange
fn clone(&self) -> TextRange
[src]
fn clone(&self) -> TextRange
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for TextRange
[src]
impl Debug for TextRange
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a> SubAssign<&'a TextUnit> for TextRange
[src]
impl<'a> SubAssign<&'a TextUnit> for TextRange
fn sub_assign(&mut self, rhs: &'a TextUnit)
[src]
fn sub_assign(&mut self, rhs: &'a TextUnit)
Performs the -=
operation.
impl SubAssign<TextUnit> for TextRange
[src]
impl SubAssign<TextUnit> for TextRange
fn sub_assign(&mut self, rhs: TextUnit)
[src]
fn sub_assign(&mut self, rhs: TextUnit)
Performs the -=
operation.
impl Copy for TextRange
[src]
impl Copy for TextRange
impl Eq for TextRange
[src]
impl Eq for TextRange
impl PartialEq<TextRange> for TextRange
[src]
impl PartialEq<TextRange> for TextRange
fn eq(&self, other: &TextRange) -> bool
[src]
fn eq(&self, other: &TextRange) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TextRange) -> bool
[src]
fn ne(&self, other: &TextRange) -> bool
This method tests for !=
.
impl<'a> AddAssign<&'a TextUnit> for TextRange
[src]
impl<'a> AddAssign<&'a TextUnit> for TextRange
fn add_assign(&mut self, rhs: &'a TextUnit)
[src]
fn add_assign(&mut self, rhs: &'a TextUnit)
Performs the +=
operation.
impl AddAssign<TextUnit> for TextRange
[src]
impl AddAssign<TextUnit> for TextRange
fn add_assign(&mut self, rhs: TextUnit)
[src]
fn add_assign(&mut self, rhs: TextUnit)
Performs the +=
operation.