Trait cursor::StrCursorTrait [−][src]
pub trait StrCursorTrait<'s, E = NoneExtras<char>> where
Self: Iterator<Item = char>,
E: Extras<char>, {
Show 65 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;
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
fn noeffects_mut(&mut self) -> &mut bool
fn turnaround(&mut self)
fn pos_as_bytes(&self) -> usize
fn char_start_pos(&self) -> usize
fn extras_mut(&mut self) -> &mut E
fn saved(&self) -> &StrCursorInfo<E>
fn jump_to_last(&mut self) -> char
Provided methods
if you’ve never tried len()
before,
this method will excute len()
method.
fn len_as_bytes(&self) -> usize
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)
cloning saved().extras
to self.extras()
.
saved pos to current pos.
saved pos to current char start pos.
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_loaded(&self) -> &'s str
fn as_str_loaded(&self) -> &'s str
saved pos to current pos.
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_offset(&mut self, offset: isize) -> Option<char>
if abs == 1, initial coordinate is -1 or just 0
fn jump_to_first(&mut self) -> char
fn first_to_last(&mut self)
fn first_to_last(&mut self)
same with
ⓘ
{
self.jump_to_first();
self.next_to_last();
}
fn jump_to_load(&mut self) -> char
fn jump_to_load(&mut self) -> char
jump to the saved pos.
fn jump_cycle(&mut self, pos: isize) -> char
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.
fn jump_to_offset_cycle(&mut self, offset: isize) -> char
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.
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>
bump until meets f() = true
.
fn next_to_load(&mut self) -> char
fn next_to_load(&mut self) -> char
bump until meets saved pos.
fn next_cycle(&mut self) -> char
fn next_cycle(&mut self) -> char
bump until meets saved pos.
fn next_to_offset_cycle(&mut self, offset: isize) -> char
fn next_to_offset_cycle(&mut self, offset: isize) -> char
bump until meets saved pos.