Skip to main content

LogosItems

Trait LogosItems 

Source
pub trait LogosItems<T> {
    // Required methods
    fn logos_item(&self, index: i64) -> &T;
    fn logos_item_mut(&mut self, index: i64) -> &mut T;
    fn logos_item_front(&self, index: i64) -> &T;
    fn logos_item_front_mut(&mut self, index: i64) -> &mut T;
    fn logos_slice(&self, start: i64, end: i64) -> &[T];
    fn logos_run_through(&self, first: i64, last: i64) -> &[T];
    fn logos_run_before(&self, first: i64, stop: i64) -> &[T];
    fn logos_reverse_between(&mut self, lo: i64, hi: i64);
}
Expand description

Borrowing access to the item a 1-based LOGOS index names, under resolve_logos_index. A generated program reads and writes a sequence’s items through this, so its fast path costs one compare and every other index means what it means on the interpreter.

Required Methods§

Source

fn logos_item(&self, index: i64) -> &T

The item index names.

Source

fn logos_item_mut(&mut self, index: i64) -> &mut T

The item index names, to write.

Source

fn logos_item_front(&self, index: i64) -> &T

logos_item for an index the caller has proven is at least 1: the item, counted from the front, or the failure past the end. With no index from the back to resolve, a miss only fails, and a loop whose indices are proven in range compiles to plain loads.

Source

fn logos_item_front_mut(&mut self, index: i64) -> &mut T

logos_item_front, to write.

Source

fn logos_slice(&self, start: i64, end: i64) -> &[T]

Items start through end, under logos_slice_range.

Source

fn logos_run_through(&self, first: i64, last: i64) -> &[T]

The items a counted loop from first through last reads, under logos_run_through.

Source

fn logos_run_before(&self, first: i64, stop: i64) -> &[T]

The items a counted loop from first up to, not including, stop reads, under logos_run_before.

Source

fn logos_reverse_between(&mut self, lo: i64, hi: i64)

While lo < hi: swap items lo and hi, then step lo up and hi down, under the one index rule: the slice’s own (vectorized) reversal when both ends count from the front and name items, and the loop itself, index by index, otherwise.

Implementations on Foreign Types§

Source§

impl<T> LogosItems<T> for [T]

Source§

fn logos_item(&self, index: i64) -> &T

Source§

fn logos_item_mut(&mut self, index: i64) -> &mut T

Source§

fn logos_item_front(&self, index: i64) -> &T

Source§

fn logos_item_front_mut(&mut self, index: i64) -> &mut T

Source§

fn logos_slice(&self, start: i64, end: i64) -> &[T]

Source§

fn logos_run_through(&self, first: i64, last: i64) -> &[T]

Source§

fn logos_run_before(&self, first: i64, stop: i64) -> &[T]

Source§

fn logos_reverse_between(&mut self, lo: i64, hi: i64)

Implementors§