Struct rowan::TextRange [−][src]
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]
impl TextRangepub fn checked_sub(self, other: TextUnit) -> Option<TextRange>[src]
pub fn checked_sub(self, other: TextUnit) -> Option<TextRange>impl TextRange[src]
impl TextRangepub fn from_to(from: TextUnit, to: TextUnit) -> TextRange[src]
pub fn from_to(from: TextUnit, to: TextUnit) -> TextRangeThe 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) -> TextRangeThe left-inclusive range ([offset..offset + len)) between to points in the text
pub fn start(&self) -> TextUnit[src]
pub fn start(&self) -> TextUnitThe inclusive start of this range
pub fn end(&self) -> TextUnit[src]
pub fn end(&self) -> TextUnitThe exclusive end of this range
pub fn len(&self) -> TextUnit[src]
pub fn len(&self) -> TextUnitThe length of this range
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolIs this range empty of any content?
Trait Implementations
impl Index<TextRange> for str[src]
impl Index<TextRange> for strtype Output = str
The returned type after indexing.
fn index(&self, index: TextRange) -> &str[src]
fn index(&self, index: TextRange) -> &strPerforms the indexing (container[index]) operation.
impl Index<TextRange> for String[src]
impl Index<TextRange> for Stringtype Output = str
The returned type after indexing.
fn index(&self, index: TextRange) -> &str[src]
fn index(&self, index: TextRange) -> &strPerforms the indexing (container[index]) operation.
impl<'a> Add<&'a TextUnit> for TextRange[src]
impl<'a> Add<&'a TextUnit> for TextRangetype Output = TextRange
The resulting type after applying the + operator.
fn add(self, rhs: &'a TextUnit) -> TextRange[src]
fn add(self, rhs: &'a TextUnit) -> TextRangePerforms the + operation.
impl<'a> Add<TextUnit> for &'a TextRange[src]
impl<'a> Add<TextUnit> for &'a TextRangetype Output = TextRange
The resulting type after applying the + operator.
fn add(self, rhs: TextUnit) -> TextRange[src]
fn add(self, rhs: TextUnit) -> TextRangePerforms the + operation.
impl<'a, 'b> Add<&'a TextUnit> for &'b TextRange[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextRangetype Output = TextRange
The resulting type after applying the + operator.
fn add(self, rhs: &'a TextUnit) -> TextRange[src]
fn add(self, rhs: &'a TextUnit) -> TextRangePerforms the + operation.
impl Add<TextUnit> for TextRange[src]
impl Add<TextUnit> for TextRangetype Output = TextRange
The resulting type after applying the + operator.
fn add(self, rhs: TextUnit) -> TextRange[src]
fn add(self, rhs: TextUnit) -> TextRangePerforms the + operation.
impl Hash for TextRange[src]
impl Hash for TextRangefn 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 TextRangetype Output = TextRange
The resulting type after applying the - operator.
fn sub(self, rhs: &'a TextUnit) -> TextRange[src]
fn sub(self, rhs: &'a TextUnit) -> TextRangePerforms the - operation.
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRange[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRangetype Output = TextRange
The resulting type after applying the - operator.
fn sub(self, rhs: &'a TextUnit) -> TextRange[src]
fn sub(self, rhs: &'a TextUnit) -> TextRangePerforms the - operation.
impl Sub<TextUnit> for TextRange[src]
impl Sub<TextUnit> for TextRangetype Output = TextRange
The resulting type after applying the - operator.
fn sub(self, rhs: TextUnit) -> TextRange[src]
fn sub(self, rhs: TextUnit) -> TextRangePerforms the - operation.
impl<'a> Sub<TextUnit> for &'a TextRange[src]
impl<'a> Sub<TextUnit> for &'a TextRangetype Output = TextRange
The resulting type after applying the - operator.
fn sub(self, rhs: TextUnit) -> TextRange[src]
fn sub(self, rhs: TextUnit) -> TextRangePerforms the - operation.
impl Display for TextRange[src]
impl Display for TextRangefn 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 TextRangefn clone(&self) -> TextRange[src]
fn clone(&self) -> TextRangeReturns 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 TextRangefn 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 TextRangefn 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 TextRangefn 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 TextRangeimpl Eq for TextRange[src]
impl Eq for TextRangeimpl PartialEq<TextRange> for TextRange[src]
impl PartialEq<TextRange> for TextRangefn eq(&self, other: &TextRange) -> bool[src]
fn eq(&self, other: &TextRange) -> boolThis 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) -> boolThis method tests for !=.
impl<'a> AddAssign<&'a TextUnit> for TextRange[src]
impl<'a> AddAssign<&'a TextUnit> for TextRangefn 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 TextRangefn add_assign(&mut self, rhs: TextUnit)[src]
fn add_assign(&mut self, rhs: TextUnit)Performs the += operation.