AtPosition

Struct AtPosition 

Source
pub struct AtPosition<'a> { /* private fields */ }
Expand description

Fluent API builder for document operations at a specific position

Implementations§

Source§

impl<'a> AtPosition<'a>

Source

pub fn insert_text(self, text: &str) -> Result<&'a mut EditorDocument>

Insert text at the current position

Source

pub fn insert_line(self) -> Result<&'a mut EditorDocument>

Insert a line break at the current position

Source

pub fn delete(self, count: usize) -> Result<&'a mut EditorDocument>

Delete a number of characters forward from position

Source

pub fn backspace(self, count: usize) -> Result<&'a mut EditorDocument>

Delete characters backward from position (backspace)

Source

pub fn replace_to_line_end(self, text: &str) -> Result<&'a mut EditorDocument>

Replace text from position to end of line

Source

pub const fn position(&self) -> Position

Get the current position

Source

pub fn to_line_column(&self) -> Result<(usize, usize)>

Available on crate feature rope only.

Convert position to line/column

Auto Trait Implementations§

§

impl<'a> Freeze for AtPosition<'a>

§

impl<'a> !RefUnwindSafe for AtPosition<'a>

§

impl<'a> Send for AtPosition<'a>

§

impl<'a> !Sync for AtPosition<'a>

§

impl<'a> Unpin for AtPosition<'a>

§

impl<'a> !UnwindSafe for AtPosition<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.