pub enum ListTree<T> {
Empty,
Leaf(T),
Node(Rc<ListNode<T>>),
}Variants§
Implementations§
Source§impl<T: Clone> ListTree<T>
impl<T: Clone> ListTree<T>
pub fn empty() -> Self
pub fn singleton(value: T) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn view(&self) -> ListView<T>
pub fn index(&self, index: usize) -> Option<T>
pub fn index_range(&self, start: usize, end: usize) -> Option<Self>
pub fn splice(&self, start: usize, end: usize, insert: Self) -> Option<Self>
pub fn split_at(&self, index: usize) -> Option<(Self, Self)>
pub fn concat(left: Self, right: Self) -> Self
pub fn black_height(&self) -> usize
pub fn is_red_black_well_formed(&self) -> bool
pub fn from_items(items: impl IntoIterator<Item = T>) -> Self
pub fn to_vec(&self) -> Vec<T>
Trait Implementations§
Source§impl<T: PartialEq> PartialEq for ListTree<T>
impl<T: PartialEq> PartialEq for ListTree<T>
impl<T: Eq> Eq for ListTree<T>
impl<T> StructuralPartialEq for ListTree<T>
Auto Trait Implementations§
impl<T> Freeze for ListTree<T>where
T: Freeze,
impl<T> RefUnwindSafe for ListTree<T>where
T: RefUnwindSafe,
impl<T> !Send for ListTree<T>
impl<T> !Sync for ListTree<T>
impl<T> Unpin for ListTree<T>where
T: Unpin,
impl<T> UnsafeUnpin for ListTree<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ListTree<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more