pub struct Point { /* private fields */ }Expand description
A position in Text
Implementations§
Source§impl Point
impl Point
Sourcepub const fn to_two_points_before(self) -> TwoPoints
pub const fn to_two_points_before(self) -> TwoPoints
Sourcepub const fn to_two_points_after(self) -> TwoPoints
pub const fn to_two_points_after(self) -> TwoPoints
Sourcepub const fn byte(&self) -> usize
pub const fn byte(&self) -> usize
Returns the byte (relative to the beginning of the buffer) of self. Indexed at 0
You can use byte indices to index the Text or Bytes
with the Bytes::point_at_byte function.
Sourcepub const fn char(&self) -> usize
pub const fn char(&self) -> usize
Returns the char index (relative to the beginning of the buffer). Indexed at 0
This is the primary value used when indexing the Text and
Bytes. That is, the Bytes::point_at_byte,
Bytes::strs, and most other Bytes functions rely
on a character indices (or Points) for indexing a
Text.
Trait Implementations§
Source§impl AddAssign for Point
impl AddAssign for Point
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Point
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Point
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Ord for Point
impl Ord for Point
Source§impl PartialOrd for Point
impl PartialOrd for Point
Source§impl SubAssign for Point
impl SubAssign for Point
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl Tag<Point> for ExtraCaret
impl Tag<Point> for ExtraCaret
Source§impl TextIndex for Point
impl TextIndex for Point
Source§fn to_byte_index(self) -> usize
fn to_byte_index(self) -> usize
Converts this type into a byte index.
Source§impl TextRangeOrIndex for Point
impl TextRangeOrIndex for Point
impl CaretOrRange for Point
impl Copy for Point
impl Eq for Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations§
Source§impl<D> AsBuilderPart<D, D> for Dwhere
D: Display,
impl<D> AsBuilderPart<D, D> for Dwhere
D: Display,
Source§fn as_builder_part(&self) -> BuilderPart<'_, D, D>
fn as_builder_part(&self) -> BuilderPart<'_, D, D>
Gets a
BuilderPart fro this valueSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.