Trait CursorTrait

Source
pub trait CursorTrait<'s, T: 's, E = NoneExtras<T>>
where Self: Iterator<Item = &'s T>, E: Extras<T>,
{
Show 55 methods // Required methods fn is_init(&self) -> bool; fn noeffects(&self) -> bool; fn noeffects_mut(&mut self) -> &mut bool; fn backwards(&self) -> bool; fn backwards_mut(&mut self) -> &mut bool; fn 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) -> &CursorInfo<T, E>; fn load(&mut self); fn as_slice(&self) -> &'s [T]; fn jump(&mut self, pos: usize) -> Option<&'s T>; // Provided methods fn item_size(&self) -> usize { ... } fn range(&self) -> Range<usize> { ... } fn len(&self) -> usize { ... } fn is_empty(&self) -> bool { ... } fn noeffects_on(&mut self) { ... } fn noeffects_off(&mut self) { ... } fn turnaround(&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_slice_loaded(&self) -> &'s [T] { ... } fn as_preserved_slice(&self) -> &'s [T] { ... } fn as_preserved_slice_include_current(&self) -> &'s [T] { ... } fn current(&self) -> &'s T { ... } fn current_deref(&self) -> T where T: Copy { ... } fn as_remaining_slice(&self) -> &'s [T] { ... } fn as_remaining_slice_include_current(&self) -> &'s [T] { ... } fn as_left_side_slice(&self) -> &'s [T] { ... } fn as_right_side_slice(&self) -> &'s [T] { ... } fn as_left_side_slice_include_current(&self) -> &'s [T] { ... } fn as_right_side_slice_include_current(&self) -> &'s [T] { ... } fn jump_to_offset(&mut self, offset: isize) -> Option<&'s T> { ... } fn jump_to_first(&mut self) -> &'s T { ... } fn jump_to_last(&mut self) -> &'s T { ... } fn first_to_last(&mut self) { ... } fn jump_to_load(&mut self) -> &'s T { ... } fn jump_cycle(&mut self, pos: isize) -> &'s T { ... } fn jump_to_offset_cycle(&mut self, offset: isize) -> &'s T { ... } fn next_to_pos(&mut self, pos: usize) -> Option<&'s T> { ... } fn next_to_offset(&mut self, offset: isize) -> Option<&'s T> { ... } fn next_to_first(&mut self) -> &'s T { ... } fn next_to_last(&mut self) -> &'s T { ... } fn next_to_left(&mut self) -> Option<&'s T> { ... } fn next_to_right(&mut self) -> Option<&'s T> { ... } fn next_to_until(&mut self, f: fn(&T) -> bool) -> Option<&'s T> { ... } fn next_to_while(&mut self, f: fn(&T) -> bool) -> Option<&'s T> { ... } fn next_to_load(&mut self) -> &'s T { ... } fn next_cycle(&mut self) -> &'s T { ... } fn prev(&mut self) -> Option<&'s T> { ... } fn next_to_offset_cycle(&mut self, offset: isize) -> &'s T { ... }
}

Required Methods§

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 backwards_mut(&mut self) -> &mut bool

Source

fn 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) -> &CursorInfo<T, E>

Source

fn load(&mut self)

Source

fn as_slice(&self) -> &'s [T]

Source

fn jump(&mut self, pos: usize) -> Option<&'s T>

Provided Methods§

Source

fn item_size(&self) -> usize

Source

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

Source

fn len(&self) -> usize

Source

fn is_empty(&self) -> bool

Source

fn noeffects_on(&mut self)

Source

fn noeffects_off(&mut self)

Source

fn turnaround(&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_slice_loaded(&self) -> &'s [T]

saved pos to current pos.

Source

fn as_preserved_slice(&self) -> &'s [T]

Source

fn as_preserved_slice_include_current(&self) -> &'s [T]

Source

fn current(&self) -> &'s T

Source

fn current_deref(&self) -> T
where T: Copy,

Source

fn as_remaining_slice(&self) -> &'s [T]

Source

fn as_remaining_slice_include_current(&self) -> &'s [T]

Source

fn as_left_side_slice(&self) -> &'s [T]

Source

fn as_right_side_slice(&self) -> &'s [T]

Source

fn as_left_side_slice_include_current(&self) -> &'s [T]

Source

fn as_right_side_slice_include_current(&self) -> &'s [T]

Source

fn jump_to_offset(&mut self, offset: isize) -> Option<&'s T>

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

Source

fn jump_to_first(&mut self) -> &'s T

Source

fn jump_to_last(&mut self) -> &'s T

Source

fn first_to_last(&mut self)

same with

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

fn jump_to_load(&mut self) -> &'s T

jump to the saved pos.

Source

fn jump_cycle(&mut self, pos: isize) -> &'s T

WARNING: isize

Source

fn jump_to_offset_cycle(&mut self, offset: isize) -> &'s T

WARNING: isize

Source

fn next_to_pos(&mut self, pos: usize) -> Option<&'s T>

Source

fn next_to_offset(&mut self, offset: isize) -> Option<&'s T>

Source

fn next_to_first(&mut self) -> &'s T

Source

fn next_to_last(&mut self) -> &'s T

Source

fn next_to_left(&mut self) -> Option<&'s T>

Source

fn next_to_right(&mut self) -> Option<&'s T>

Source

fn next_to_until(&mut self, f: fn(&T) -> bool) -> Option<&'s T>

bump until meets f() = true.

Source

fn next_to_while(&mut self, f: fn(&T) -> bool) -> Option<&'s T>

bump while f() = true.

Source

fn next_to_load(&mut self) -> &'s T

bump until meets saved pos.

Source

fn next_cycle(&mut self) -> &'s T

bump until meets saved pos.

Source

fn prev(&mut self) -> Option<&'s T>

next_back() without turnaround()

Source

fn next_to_offset_cycle(&mut self, offset: isize) -> &'s T

bump until meets saved pos.

Implementors§

Source§

impl<'s, T: 's, E: Extras<T>> CursorTrait<'s, T, E> for Cursor<'s, T, E>