[−][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]
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 Eq for TextUnit
[src]
impl Default for TextUnit
[src]
impl Copy for TextUnit
[src]
impl SubAssign<TextUnit> for TextRange
[src]
fn sub_assign(&mut self, rhs: TextUnit)
[src]
impl<'a> SubAssign<&'a TextUnit> for TextRange
[src]
fn sub_assign(&mut self, rhs: &'a TextUnit)
[src]
impl SubAssign<TextUnit> for TextUnit
[src]
fn sub_assign(&mut self, rhs: TextUnit)
[src]
impl<'a> SubAssign<&'a TextUnit> for TextUnit
[src]
fn sub_assign(&mut self, rhs: &'a TextUnit)
[src]
impl<'a> Sub<TextUnit> for &'a TextRange
[src]
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextRange
[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextRange
[src]
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]
type Output = TextRange
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextRange
[src]
impl Sub<TextUnit> for TextUnit
[src]
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextUnit
[src]
impl<'a, 'b> Sub<&'a TextUnit> for &'b TextUnit
[src]
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a TextUnit) -> TextUnit
[src]
impl Sub<TextUnit> for TextRange
[src]
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]
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]
type Output = TextUnit
The resulting type after applying the -
operator.
fn sub(self, rhs: TextUnit) -> TextUnit
[src]
impl Hash for TextUnit
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> AddAssign<&'a TextUnit> for TextUnit
[src]
fn add_assign(&mut self, rhs: &'a TextUnit)
[src]
impl AddAssign<TextUnit> for TextUnit
[src]
fn add_assign(&mut self, rhs: TextUnit)
[src]
impl AddAssign<TextUnit> for TextRange
[src]
fn add_assign(&mut self, rhs: TextUnit)
[src]
impl<'a> AddAssign<&'a TextUnit> for TextRange
[src]
fn add_assign(&mut self, rhs: &'a TextUnit)
[src]
impl Clone for TextUnit
[src]
fn clone(&self) -> TextUnit
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for TextUnit
[src]
impl Ord for TextUnit
[src]
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
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialEq<TextUnit> for TextUnit
[src]
impl Add<TextUnit> for TextUnit
[src]
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextUnit
[src]
impl Add<TextUnit> for TextRange
[src]
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextRange
[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextRange
[src]
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextRange
[src]
impl<'a> Add<TextUnit> for &'a TextUnit
[src]
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextUnit
[src]
impl<'a> Add<&'a TextUnit> for TextRange
[src]
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextRange
[src]
impl<'a> Add<TextUnit> for &'a TextRange
[src]
type Output = TextRange
The resulting type after applying the +
operator.
fn add(self, rhs: TextUnit) -> TextRange
[src]
impl<'a> Add<&'a TextUnit> for TextUnit
[src]
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit
[src]
impl<'a, 'b> Add<&'a TextUnit> for &'b TextUnit
[src]
type Output = TextUnit
The resulting type after applying the +
operator.
fn add(self, rhs: &'a TextUnit) -> TextUnit
[src]
impl From<u32> for TextUnit
[src]
impl<'a> Sum<&'a TextUnit> for TextUnit
[src]
impl Sum<TextUnit> for TextUnit
[src]
impl Display for TextUnit
[src]
impl RangeBounds<TextUnit> for TextRange
[src]
fn start_bound(&self) -> Bound<&TextUnit>
[src]
fn end_bound(&self) -> Bound<&TextUnit>
[src]
fn contains<U>(&self, item: &U) -> bool where
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
1.35.0[src]
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
Returns true
if item
is contained in the range. Read more
impl PartialOrd<TextUnit> for TextUnit
[src]
Auto Trait Implementations
impl Send for TextUnit
impl Unpin for TextUnit
impl Sync for TextUnit
impl UnwindSafe for TextUnit
impl RefUnwindSafe for TextUnit
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,