Struct rowan::TextUnit [−][src]
pub struct TextUnit(_);
An offset into text.
Offset is represented as u32 storing number of utf8-bytes,
but most of the clients should treat it like opaque measure.
Methods
impl TextUnit[src]
impl TextUnitpub fn of_char(c: char) -> TextUnit[src]
pub fn of_char(c: char) -> TextUnitTextUnit equal to the length of this char.
pub fn of_str(s: &str) -> TextUnit[src]
pub fn of_str(s: &str) -> TextUnitTextUnit equal to the length of this string.
Panics
Panics if the length of the string is greater than u32::max_value()
pub fn checked_sub(self, other: TextUnit) -> Option<TextUnit>[src]
pub fn checked_sub(self, other: TextUnit) -> Option<TextUnit>Trait Implementations
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<&'a TextUnit> for TextUnit[src]
impl<'a> Add<&'a TextUnit> for TextUnittype Output = TextUnit
The resulting type after applying the + operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit[src]
fn add(self, rhs: &'a TextUnit) -> TextUnitPerforms 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 TextUnit[src]
impl Add<TextUnit> for TextUnittype Output = TextUnit
The resulting type after applying the + operator.
fn add(self, rhs: TextUnit) -> TextUnit[src]
fn add(self, rhs: TextUnit) -> TextUnitPerforms the + operation.
impl<'a, 'b> Add<&'a TextUnit> for &'b TextUnit[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextUnittype Output = TextUnit
The resulting type after applying the + operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit[src]
fn add(self, rhs: &'a TextUnit) -> TextUnitPerforms 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<'a> Add<TextUnit> for &'a TextUnit[src]
impl<'a> Add<TextUnit> for &'a TextUnittype Output = TextUnit
The resulting type after applying the + operator.
fn add(self, rhs: TextUnit) -> TextUnit[src]
fn add(self, rhs: TextUnit) -> TextUnitPerforms the + operation.
impl PartialOrd<TextUnit> for TextUnit[src]
impl PartialOrd<TextUnit> for TextUnitfn partial_cmp(&self, other: &TextUnit) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &TextUnit) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &TextUnit) -> bool[src]
fn lt(&self, other: &TextUnit) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &TextUnit) -> bool[src]
fn le(&self, other: &TextUnit) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &TextUnit) -> bool[src]
fn gt(&self, other: &TextUnit) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &TextUnit) -> bool[src]
fn ge(&self, other: &TextUnit) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Hash for TextUnit[src]
impl Hash for TextUnitfn 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> Sub<&'a TextUnit> for TextUnit[src]
impl<'a> Sub<&'a TextUnit> for TextUnittype Output = TextUnit
The resulting type after applying the - operator.
fn sub(self, rhs: &'a TextUnit) -> TextUnit[src]
fn sub(self, rhs: &'a TextUnit) -> TextUnitPerforms the - operation.
impl<'a> Sub<TextUnit> for &'a TextUnit[src]
impl<'a> Sub<TextUnit> for &'a TextUnittype Output = TextUnit
The resulting type after applying the - operator.
fn sub(self, rhs: TextUnit) -> TextUnit[src]
fn sub(self, rhs: TextUnit) -> TextUnitPerforms 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 Sub<TextUnit> for TextUnit[src]
impl Sub<TextUnit> for TextUnittype Output = TextUnit
The resulting type after applying the - operator.
fn sub(self, rhs: TextUnit) -> TextUnit[src]
fn sub(self, rhs: TextUnit) -> TextUnitPerforms the - operation.
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextUnit[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextUnittype Output = TextUnit
The resulting type after applying the - operator.
fn sub(self, rhs: &'a TextUnit) -> TextUnit[src]
fn sub(self, rhs: &'a TextUnit) -> TextUnitPerforms 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 TextUnit[src]
impl Display for TextUnitfn 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 TextUnit[src]
impl Clone for TextUnitfn clone(&self) -> TextUnit[src]
fn clone(&self) -> TextUnitReturns 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 Default for TextUnit[src]
impl Default for TextUnitimpl Debug for TextUnit[src]
impl Debug for TextUnitfn 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> Sum<&'a TextUnit> for TextUnit[src]
impl<'a> Sum<&'a TextUnit> for TextUnitfn sum<I>(iter: I) -> TextUnit where
I: Iterator<Item = &'a TextUnit>, [src]
fn sum<I>(iter: I) -> TextUnit where
I: Iterator<Item = &'a TextUnit>, Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more
impl Sum<TextUnit> for TextUnit[src]
impl Sum<TextUnit> for TextUnitfn sum<I>(iter: I) -> TextUnit where
I: Iterator<Item = TextUnit>, [src]
fn sum<I>(iter: I) -> TextUnit where
I: Iterator<Item = TextUnit>, Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more
impl SubAssign<TextUnit> for TextUnit[src]
impl SubAssign<TextUnit> for TextUnitfn sub_assign(&mut self, rhs: TextUnit)[src]
fn sub_assign(&mut self, rhs: TextUnit)Performs the -= operation.
impl<'a> SubAssign<&'a TextUnit> for TextUnit[src]
impl<'a> SubAssign<&'a TextUnit> for TextUnitfn sub_assign(&mut self, rhs: &'a TextUnit)[src]
fn sub_assign(&mut self, rhs: &'a TextUnit)Performs the -= operation.
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 TextUnit[src]
impl Copy for TextUnitimpl Ord for TextUnit[src]
impl Ord for TextUnitfn cmp(&self, other: &TextUnit) -> Ordering[src]
fn cmp(&self, other: &TextUnit) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Eq for TextUnit[src]
impl Eq for TextUnitimpl PartialEq<TextUnit> for TextUnit[src]
impl PartialEq<TextUnit> for TextUnitfn eq(&self, other: &TextUnit) -> bool[src]
fn eq(&self, other: &TextUnit) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &TextUnit) -> bool[src]
fn ne(&self, other: &TextUnit) -> boolThis method tests for !=.
impl AddAssign<TextUnit> for TextUnit[src]
impl AddAssign<TextUnit> for TextUnitfn add_assign(&mut self, rhs: TextUnit)[src]
fn add_assign(&mut self, rhs: TextUnit)Performs the += operation.
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.
impl<'a> AddAssign<&'a TextUnit> for TextUnit[src]
impl<'a> AddAssign<&'a TextUnit> for TextUnitfn add_assign(&mut self, rhs: &'a TextUnit)[src]
fn add_assign(&mut self, rhs: &'a TextUnit)Performs the += operation.
impl From<u32> for TextUnit[src]
impl From<u32> for TextUnitimpl From<TextUnit> for u32[src]
impl From<TextUnit> for u32