Struct makods::jostletree::JostleTree
[−]
[src]
pub struct JostleTree<T> { /* fields omitted */ }
The JostleTree can be thought of as efficiently modelling a sequence of items of variable widths. It allows operations such as * jumping to a position and getting whatever item is there, * resizing items, in so doing, repositioning every one of the items after it. * inserting and removing
Operations generally have logarithmic runtime.
Methods
impl<T> JostleTree<T>
[src]
fn new() -> JostleTree<T>
[src]
fn is_empty(&self) -> bool
[src]
fn len(&self) -> usize
[src]
fn total_span(&self) -> u32
[src]
returns the sum of the spans of all of the items (logarithmic runtime)
fn insert_at<'a>(
&'a mut self,
v: T,
span: u32,
at_offset: u32
) -> SlotHandle<'a, T>
[src]
&'a mut self,
v: T,
span: u32,
at_offset: u32
) -> SlotHandle<'a, T>
inserts at or before whatever is at_offset.
fn insert_back<'a>(&'a mut self, v: T, span: u32) -> SlotHandle<'a, T>
[src]
inserts at the back
fn insert_front<'a>(&'a mut self, v: T, span: u32) -> SlotHandle<'a, T>
[src]
inserts at the front
fn get_slot_mut<'a>(&'a mut self, o: u32) -> Option<SlotHandle<'a, T>>
[src]
returns the bucket at the offset o
negative or out of bounds o values will get first and last thing respectively. returns None if tree is empty.
fn get_item(&self, o: u32) -> Option<&T>
[src]
fn remove_at(&mut self, o: u32) -> Option<T>
[src]
negative or out of bounds o values will hit the first and last thing respectively. returns None if tree is empty.
fn clear(&mut self)
[src]
negative or out of bounds o values will get first and last thing respectively. returns None if tree is empty.
fn slot_iter<'a>(&'a self) -> JostleTreeIter<'a, T>
[src]
Iterates over the buckets
Trait Implementations
impl<T: Debug> Debug for JostleTree<T>
[src]
impl<T: Display> Display for JostleTree<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<T: Hash> Hash for JostleTree<T>
[src]
fn hash<H: Hasher>(&self, h: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: PartialEq> PartialEq for JostleTree<T>
[src]
fn eq(&self, other: &JostleTree<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &JostleTree<T>) -> bool
[src]
This method tests for !=
.