[−][src]Struct rowan::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 TextUnit
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 PartialOrd<TextUnit> for TextUnit
[src]
impl PartialOrd<TextUnit> for TextUnit
fn partial_cmp(&self, other: &TextUnit) -> Option<Ordering> | [src] |
fn lt(&self, other: &TextUnit) -> bool | [src] |
fn le(&self, other: &TextUnit) -> bool | [src] |
fn gt(&self, other: &TextUnit) -> bool | [src] |
fn ge(&self, other: &TextUnit) -> bool | [src] |
impl Hash for TextUnit
[src]
impl Hash for TextUnit
fn hash<__H>(&self, state: &mut __H) where | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl Copy for TextUnit
[src]
impl Copy for TextUnit
impl<'a> AddAssign<&'a TextUnit> for TextRange
[src]
impl<'a> AddAssign<&'a TextUnit> for TextRange
fn add_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl AddAssign<TextUnit> for TextRange
[src]
impl AddAssign<TextUnit> for TextRange
fn add_assign(&mut self, rhs: TextUnit) | [src] |
impl AddAssign<TextUnit> for TextUnit
[src]
impl AddAssign<TextUnit> for TextUnit
fn add_assign(&mut self, rhs: TextUnit) | [src] |
impl<'a> AddAssign<&'a TextUnit> for TextUnit
[src]
impl<'a> AddAssign<&'a TextUnit> for TextUnit
fn add_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl Clone for TextUnit
[src]
impl Clone for TextUnit
fn clone(&self) -> TextUnit | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Default for TextUnit
[src]
impl Default for TextUnit
impl<'a> Sum<&'a TextUnit> for TextUnit
[src]
impl<'a> Sum<&'a TextUnit> for TextUnit
impl Sum<TextUnit> for TextUnit
[src]
impl Sum<TextUnit> for TextUnit
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] |
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] |
impl Add<TextUnit> for TextUnit
[src]
impl Add<TextUnit> for TextUnit
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextUnit | [src] |
impl<'a> Add<&'a TextUnit> for TextUnit
[src]
impl<'a> Add<&'a TextUnit> for TextUnit
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit | [src] |
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] |
impl<'a, 'b> Add<&'a TextUnit> for &'b TextUnit
[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextUnit
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit | [src] |
impl<'a> Add<TextUnit> for &'a TextUnit
[src]
impl<'a> Add<TextUnit> for &'a TextUnit
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextUnit | [src] |
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] |
impl Ord for TextUnit
[src]
impl Ord for TextUnit
fn cmp(&self, other: &TextUnit) -> Ordering | [src] |
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
impl Eq for TextUnit
[src]
impl Eq for TextUnit
impl PartialEq<TextUnit> for TextUnit
[src]
impl PartialEq<TextUnit> for TextUnit
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] |
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] |
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextUnit
[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextUnit
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextUnit | [src] |
impl<'a> Sub<TextUnit> for &'a TextUnit
[src]
impl<'a> Sub<TextUnit> for &'a TextUnit
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextUnit | [src] |
impl Sub<TextUnit> for TextUnit
[src]
impl Sub<TextUnit> for TextUnit
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextUnit | [src] |
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] |
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] |
impl<'a> Sub<&'a TextUnit> for TextUnit
[src]
impl<'a> Sub<&'a TextUnit> for TextUnit
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextUnit | [src] |
impl Display for TextUnit
[src]
impl Display for TextUnit
impl SubAssign<TextUnit> for TextUnit
[src]
impl SubAssign<TextUnit> for TextUnit
fn sub_assign(&mut self, rhs: TextUnit) | [src] |
impl<'a> SubAssign<&'a TextUnit> for TextUnit
[src]
impl<'a> SubAssign<&'a TextUnit> for TextUnit
fn sub_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl<'a> SubAssign<&'a TextUnit> for TextRange
[src]
impl<'a> SubAssign<&'a TextUnit> for TextRange
fn sub_assign(&mut self, rhs: &'a TextUnit) | [src] |
impl SubAssign<TextUnit> for TextRange
[src]
impl SubAssign<TextUnit> for TextRange
fn sub_assign(&mut self, rhs: TextUnit) | [src] |
impl Debug for TextUnit
[src]
impl Debug for TextUnit
impl From<u32> for TextUnit
[src]
impl From<u32> for TextUnit
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Erased for T
impl<T> Erased for T