Trait StrCursorTrait

Source
pub trait StrCursorTrait<'s, E = NoneExtras<char>>
where Self: Iterator<Item = char>, E: Extras<char>,
{
Show 65 methods // Required methods fn len(&mut self) -> usize; fn is_len(&self) -> bool; fn is_init(&self) -> bool; fn noeffects(&self) -> bool; fn noeffects_mut(&mut self) -> &mut bool; fn backwards(&self) -> bool; fn turnaround(&mut self); fn pos(&self) -> usize; fn pos_as_bytes(&self) -> usize; fn char_start_pos(&self) -> usize; fn extras(&self) -> &E; fn extras_mut(&mut self) -> &mut E; fn reset(&mut self); fn save(&mut self); fn saved(&self) -> &StrCursorInfo<E>; fn load(&mut self); fn as_bytes(&self) -> &'s [u8] ; fn current(&self) -> char; fn jump(&mut self, pos: usize) -> Option<char>; fn jump_to_last(&mut self) -> char; // Provided methods fn item_size(&self) -> usize { ... } fn range(&mut self) -> Range<usize> { ... } fn len_as_bytes(&self) -> usize { ... } fn is_empty(&self) -> bool { ... } fn noeffects_on(&mut self) { ... } fn noeffects_off(&mut self) { ... } fn head_to_left(&mut self) { ... } fn head_to_right(&mut self) { ... } fn head_to_pos(&mut self, pos: usize) { ... } fn to_range_extras(&self) -> Range<E> { ... } fn as_bytes_loaded(&self) -> &'s [u8] { ... } fn as_char_bytes_loaded(&self) -> &'s [u8] { ... } fn as_preserved_bytes(&self) -> &'s [u8] { ... } fn as_preserved_bytes_include_current(&self) -> &'s [u8] { ... } fn current_byte(&self) -> u8 { ... } fn as_remaining_bytes(&self) -> &'s [u8] { ... } fn as_remaining_bytes_include_current(&self) -> &'s [u8] { ... } fn as_left_side_bytes(&self) -> &'s [u8] { ... } fn as_right_side_bytes(&self) -> &'s [u8] { ... } fn as_left_side_bytes_include_current(&self) -> &'s [u8] { ... } fn as_right_side_bytes_include_current(&self) -> &'s [u8] { ... } fn as_str(&self) -> &'s str { ... } fn as_str_loaded(&self) -> &'s str { ... } fn as_preserved_str(&self) -> &'s str { ... } fn as_remaining_str(&self) -> &'s str { ... } fn as_left_side_str(&self) -> &'s str { ... } fn as_right_side_str(&self) -> &'s str { ... } fn jump_to_offset(&mut self, offset: isize) -> Option<char> { ... } fn jump_to_first(&mut self) -> char { ... } fn first_to_last(&mut self) { ... } fn jump_to_load(&mut self) -> char { ... } fn jump_cycle(&mut self, pos: isize) -> char { ... } fn jump_to_offset_cycle(&mut self, offset: isize) -> char { ... } fn next_to_pos(&mut self, pos: usize) -> Option<char> { ... } fn next_to_offset(&mut self, offset: isize) -> Option<char> { ... } fn next_to_first(&mut self) -> char { ... } fn next_to_last(&mut self) -> char { ... } fn next_to_left(&mut self) -> Option<char> { ... } fn next_to_right(&mut self) -> Option<char> { ... } fn next_to_until(&mut self, f: fn(char) -> bool) -> Option<char> { ... } fn next_to_while(&mut self, f: fn(char) -> bool) -> Option<char> { ... } fn next_to_load(&mut self) -> char { ... } fn next_cycle(&mut self) -> char { ... } fn prev(&mut self) -> Option<char> { ... } fn next_to_offset_cycle(&mut self, offset: isize) -> char { ... }
}

Required Methods§

Source

fn len(&mut self) -> usize

Source

fn is_len(&self) -> bool

Source

fn is_init(&self) -> bool

Source

fn noeffects(&self) -> bool

Source

fn noeffects_mut(&mut self) -> &mut bool

Source

fn backwards(&self) -> bool

Source

fn turnaround(&mut self)

Source

fn pos(&self) -> usize

Source

fn pos_as_bytes(&self) -> usize

Source

fn char_start_pos(&self) -> usize

Source

fn extras(&self) -> &E

Source

fn extras_mut(&mut self) -> &mut E

Source

fn reset(&mut self)

Source

fn save(&mut self)

Source

fn saved(&self) -> &StrCursorInfo<E>

Source

fn load(&mut self)

Source

fn as_bytes(&self) -> &'s [u8]

Source

fn current(&self) -> char

Source

fn jump(&mut self, pos: usize) -> Option<char>

Source

fn jump_to_last(&mut self) -> char

Provided Methods§

Source

fn item_size(&self) -> usize

Source

fn range(&mut self) -> Range<usize>

if you’ve never tried len() before, this method will excute len() method.

Source

fn len_as_bytes(&self) -> usize

Source

fn is_empty(&self) -> bool

Source

fn noeffects_on(&mut self)

Source

fn noeffects_off(&mut self)

Source

fn head_to_left(&mut self)

Source

fn head_to_right(&mut self)

Source

fn head_to_pos(&mut self, pos: usize)

Source

fn to_range_extras(&self) -> Range<E>

cloning saved().extras to self.extras().

Source

fn as_bytes_loaded(&self) -> &'s [u8]

saved pos to current pos.

Source

fn as_char_bytes_loaded(&self) -> &'s [u8]

saved pos to current char start pos.

Source

fn as_preserved_bytes(&self) -> &'s [u8]

Source

fn as_preserved_bytes_include_current(&self) -> &'s [u8]

Source

fn current_byte(&self) -> u8

Source

fn as_remaining_bytes(&self) -> &'s [u8]

Source

fn as_remaining_bytes_include_current(&self) -> &'s [u8]

Source

fn as_left_side_bytes(&self) -> &'s [u8]

Source

fn as_right_side_bytes(&self) -> &'s [u8]

Source

fn as_left_side_bytes_include_current(&self) -> &'s [u8]

Source

fn as_right_side_bytes_include_current(&self) -> &'s [u8]

Source

fn as_str(&self) -> &'s str

Source

fn as_str_loaded(&self) -> &'s str

saved pos to current pos.

Source

fn as_preserved_str(&self) -> &'s str

Source

fn as_remaining_str(&self) -> &'s str

Source

fn as_left_side_str(&self) -> &'s str

Source

fn as_right_side_str(&self) -> &'s str

Source

fn jump_to_offset(&mut self, offset: isize) -> Option<char>

if abs == 1, initial coordinate is -1 or just 0

Source

fn jump_to_first(&mut self) -> char

Source

fn first_to_last(&mut self)

same with

{
    self.jump_to_first();
    self.next_to_last();
}
Source

fn jump_to_load(&mut self) -> char

jump to the saved pos.

Source

fn jump_cycle(&mut self, pos: isize) -> char

  • WARNING: isize
  • if you’ve never tried it before,
  • this method will create Chars Iterator and then
  • consume it to count number of chars.
Source

fn jump_to_offset_cycle(&mut self, offset: isize) -> char

  • WARNING: isize
  • if you’ve never tried it before,
  • this method will create Chars Iterator and then
  • consume it to count number of chars.
Source

fn next_to_pos(&mut self, pos: usize) -> Option<char>

Source

fn next_to_offset(&mut self, offset: isize) -> Option<char>

Source

fn next_to_first(&mut self) -> char

Source

fn next_to_last(&mut self) -> char

Source

fn next_to_left(&mut self) -> Option<char>

Source

fn next_to_right(&mut self) -> Option<char>

Source

fn next_to_until(&mut self, f: fn(char) -> bool) -> Option<char>

bump until meets f() = true.

Source

fn next_to_while(&mut self, f: fn(char) -> bool) -> Option<char>

bump while f() = true.

Source

fn next_to_load(&mut self) -> char

bump until meets saved pos.

Source

fn next_cycle(&mut self) -> char

bump until meets saved pos.

Source

fn prev(&mut self) -> Option<char>

next_back() without turnaround()

Source

fn next_to_offset_cycle(&mut self, offset: isize) -> char

bump until meets saved pos.

Implementors§

Source§

impl<'s, E: Extras<char>> StrCursorTrait<'s, E> for StrCursor<'s, E>