pub struct BTreeSlice<'a, A>(/* private fields */);Expand description
View of a slice as a balanced binary tree.
Each node is labelled with a slice. Leaves contain single elements.
The tree is right-associative:
&[a b c] becomes &[a] (&[b] &[c]).
The tree is empty if the slice is empty.
Implementations§
Source§impl<'a, A> BTreeSlice<'a, A>
impl<'a, A> BTreeSlice<'a, A>
Sourcepub fn from_slice(slice: &'a [A]) -> Self
pub fn from_slice(slice: &'a [A]) -> Self
View the slice as a balanced binary tree.
Source§impl<A: Clone> BTreeSlice<'_, A>
impl<A: Clone> BTreeSlice<'_, A>
Trait Implementations§
Source§impl<'a, A: Clone> Clone for BTreeSlice<'a, A>
impl<'a, A: Clone> Clone for BTreeSlice<'a, A>
Source§fn clone(&self) -> BTreeSlice<'a, A>
fn clone(&self) -> BTreeSlice<'a, A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a, A: Copy> Copy for BTreeSlice<'a, A>
Source§impl<'a, A: Debug> Debug for BTreeSlice<'a, A>
impl<'a, A: Debug> Debug for BTreeSlice<'a, A>
impl<'a, A: Eq> Eq for BTreeSlice<'a, A>
Source§impl<'a, A: Hash> Hash for BTreeSlice<'a, A>
impl<'a, A: Hash> Hash for BTreeSlice<'a, A>
Source§impl<'a, A: PartialEq> PartialEq for BTreeSlice<'a, A>
impl<'a, A: PartialEq> PartialEq for BTreeSlice<'a, A>
Source§fn eq(&self, other: &BTreeSlice<'a, A>) -> bool
fn eq(&self, other: &BTreeSlice<'a, A>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a, A: PartialEq> StructuralPartialEq for BTreeSlice<'a, A>
Source§impl<A: Clone> TreeLike for BTreeSlice<'_, A>
impl<A: Clone> TreeLike for BTreeSlice<'_, A>
Source§fn n_children(&self) -> usize
fn n_children(&self) -> usize
Accessor for the number of children this node has.
Source§fn nth_child(&self, n: usize) -> Option<Self>
fn nth_child(&self, n: usize) -> Option<Self>
Accessor for the nth child of the node, if a child with that index exists.
Source§fn pre_order_iter(self) -> PreOrderIter<Self>
fn pre_order_iter(self) -> PreOrderIter<Self>
Obtains an iterator of all the nodes rooted at the node, in pre-order.
Source§fn verbose_pre_order_iter(self) -> VerbosePreOrderIter<Self>
fn verbose_pre_order_iter(self) -> VerbosePreOrderIter<Self>
Obtains a verbose iterator of all the nodes rooted at the DAG, in pre-order. Read more
Source§fn post_order_iter(self) -> PostOrderIter<Self>
fn post_order_iter(self) -> PostOrderIter<Self>
Obtains an iterator of all the nodes rooted at the DAG, in post order. Read more
Auto Trait Implementations§
impl<'a, A> Freeze for BTreeSlice<'a, A>
impl<'a, A> RefUnwindSafe for BTreeSlice<'a, A>where
A: RefUnwindSafe,
impl<'a, A> Send for BTreeSlice<'a, A>where
A: Sync,
impl<'a, A> Sync for BTreeSlice<'a, A>where
A: Sync,
impl<'a, A> Unpin for BTreeSlice<'a, A>
impl<'a, A> UnsafeUnpin for BTreeSlice<'a, A>
impl<'a, A> UnwindSafe for BTreeSlice<'a, A>where
A: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more