AppendRle

Trait AppendRle 

Source
pub trait AppendRle<T: MergableSpan> {
    // Required methods
    fn push_rle(&mut self, item: T) -> bool;
    fn push_reversed_rle(&mut self, item: T) -> bool;
}

Required Methods§

Source

fn push_rle(&mut self, item: T) -> bool

Push a new item to this list-like object. If the passed item can be merged into the last item in the list, do so instead of inserting a new item.

Returns true if the item was merged into the previous last item, false if it was inserted.

Source

fn push_reversed_rle(&mut self, item: T) -> bool

Push a new item to the end of this list-like object. If the passed object can be merged to the front of the previously last item, do so. This is useful for appending to a list which is sorted in reverse.

Implementations on Foreign Types§

Source§

impl<T: MergableSpan> AppendRle<T> for Vec<T>

Source§

fn push_rle(&mut self, item: T) -> bool

Source§

fn push_reversed_rle(&mut self, item: T) -> bool

Implementors§