pub struct StringCursor<'a> { /* private fields */ }
Expand description
A cursor type that implements EditableTextCursor for String
Implementations§
§impl<'a> StringCursor<'a>
impl<'a> StringCursor<'a>
pub fn new(text: &'a str) -> StringCursor<'a>
pub fn new(text: &'a str) -> StringCursor<'a>
Create a new cursor.
Trait Implementations§
§impl<'a> Debug for StringCursor<'a>
impl<'a> Debug for StringCursor<'a>
§impl<'a> EditableTextCursor<&'a String> for StringCursor<'a>
impl<'a> EditableTextCursor<&'a String> for StringCursor<'a>
§fn is_boundary(&self) -> bool
fn is_boundary(&self) -> bool
Check if cursor position is at a codepoint boundary.
§fn prev(&mut self) -> Option<usize>
fn prev(&mut self) -> Option<usize>
Move cursor to previous codepoint boundary, if it exists.
Returns previous codepoint as usize offset.
§fn next(&mut self) -> Option<usize>
fn next(&mut self) -> Option<usize>
Move cursor to next codepoint boundary, if it exists.
Returns current codepoint as usize offset.
§fn peek_next_codepoint(&self) -> Option<char>
fn peek_next_codepoint(&self) -> Option<char>
Get the next codepoint after the cursor position, without advancing
the cursor.
§fn prev_codepoint(&mut self) -> Option<char>
fn prev_codepoint(&mut self) -> Option<char>
Return codepoint preceding cursor offset and move cursor backward.
§fn next_codepoint(&mut self) -> Option<char>
fn next_codepoint(&mut self) -> Option<char>
Return codepoint at cursor offset and move cursor forward.
§fn at_or_next(&mut self) -> Option<usize>
fn at_or_next(&mut self) -> Option<usize>
Return current offset if it’s a boundary, else next.
§fn at_or_prev(&mut self) -> Option<usize>
fn at_or_prev(&mut self) -> Option<usize>
Return current offset if it’s a boundary, else previous.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for StringCursor<'a>
impl<'a> Send for StringCursor<'a>
impl<'a> Sync for StringCursor<'a>
impl<'a> Unpin for StringCursor<'a>
impl<'a> UnwindSafe for StringCursor<'a>
Blanket Implementations§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.