[][src]Struct rowan::TextUnit

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]

pub fn of_char(c: char) -> TextUnit[src]

TextUnit equal to the length of this char.

pub fn of_str(s: &str) -> TextUnit[src]

TextUnit 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 from_usize(size: usize) -> TextUnit[src]

pub fn to_usize(self) -> usize[src]

Trait Implementations

impl Clone for TextUnit[src]

impl SubAssign<TextUnit> for TextRange[src]

impl SubAssign<TextUnit> for TextUnit[src]

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

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

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

type Output = TextUnit

The resulting type after applying the - operator.

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

type Output = TextUnit

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<'a, 'b> Sub<&'a TextUnit> for &'b 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 Sub<TextUnit> for TextUnit[src]

type Output = TextUnit

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 TextUnit[src]

type Output = TextUnit

The resulting type after applying the - operator.

impl StructuralEq for TextUnit[src]

impl PartialOrd<TextUnit> for TextUnit[src]

impl Eq for TextUnit[src]

impl Ord for TextUnit[src]

impl Default for TextUnit[src]

impl Debug for TextUnit[src]

impl Display for TextUnit[src]

impl Hash for TextUnit[src]

impl Sum<TextUnit> for TextUnit[src]

impl<'a> Sum<&'a TextUnit> for TextUnit[src]

impl StructuralPartialEq for TextUnit[src]

impl AddAssign<TextUnit> for TextRange[src]

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

impl AddAssign<TextUnit> for TextUnit[src]

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

impl From<u32> for TextUnit[src]

impl Copy for TextUnit[src]

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<'a, 'b> Add<&'a TextUnit> for &'b TextRange[src]

type Output = TextRange

The resulting type after applying the + operator.

impl Add<TextUnit> for TextUnit[src]

type Output = TextUnit

The resulting type after applying the + operator.

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

type Output = TextUnit

The resulting type after applying the + operator.

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

type Output = TextUnit

The resulting type after applying the + operator.

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

type Output = TextUnit

The resulting type after applying the + operator.

impl PartialEq<TextUnit> for TextUnit[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = !

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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