Enum im_ternary_tree::TernaryTreeList
source · [−]pub enum TernaryTreeList<T> {
Empty,
Tree(TernaryTree<T>),
}Variants
Empty
Tree(TernaryTree<T>)
Implementations
sourceimpl<'a, T> TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<'a, T> TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
sourcepub fn format_inline(&self) -> String
pub fn format_inline(&self) -> String
turn into a compare representation, with _ for holes
pub fn get(&self, idx: usize) -> Option<&T>
pub fn find_index(&self, f: Arc<dyn Fn(&T) -> bool>) -> Option<i64>
pub fn index_of(&self, item: &T) -> Option<usize>
sourcepub fn is_shape_same(&self, ys: &Self) -> bool
pub fn is_shape_same(&self, ys: &Self) -> bool
recursively check structure
pub fn ref_get(&self, idx: usize) -> Option<&T>
sourcepub fn loop_get(&self, original_idx: usize) -> Option<T>
pub fn loop_get(&self, original_idx: usize) -> Option<T>
get via go down the branch with a mutable loop
pub fn first(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
pub fn assoc(&self, idx: usize, item: T) -> Result<Self, String>
pub fn dissoc(&self, idx: usize) -> Result<Self, String>
pub fn rest(&self) -> Result<Self, String>
pub fn butlast(&self) -> Result<Self, String>
pub fn insert(&self, idx: usize, item: T, after: bool) -> Result<Self, String>
pub fn assoc_before(&self, idx: usize, item: T) -> Result<Self, String>
pub fn assoc_after(&self, idx: usize, item: T) -> Result<Self, String>
pub fn force_inplace_balancing(&mut self) -> Result<(), String>
pub fn unshift(&self, item: T) -> Self
pub fn prepend(&self, item: T) -> Self
pub fn push(&self, item: T) -> Self
pub fn append(&self, item: T) -> Self
pub fn push_right(&self, item: T) -> Self
pub fn drop_left(&self) -> Self
pub fn concat(raw: &[TernaryTreeList<T>]) -> Self
pub fn check_structure(&self) -> Result<(), String>
pub fn slice(&self, start_idx: usize, end_idx: usize) -> Result<Self, String>
pub fn skip(&self, idx: usize) -> Result<Self, String>
pub fn take(&self, idx: usize) -> Result<Self, String>
pub fn reverse(&self) -> Self
pub fn map<V>(&self, f: Arc<dyn Fn(&T) -> V>) -> TernaryTreeList<V>
pub fn to_vec(&self) -> Vec<T>
pub fn iter(&self) -> TernaryTreeListRefIntoIterator<'_, T>ⓘNotable traits for TernaryTreeListRefIntoIterator<'a, T>impl<'a, T> Iterator for TernaryTreeListRefIntoIterator<'a, T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash, type Item = &'a T;
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash, type Item = &'a T;
Trait Implementations
sourceimpl<T: Clone> Clone for TernaryTreeList<T>
impl<T: Clone> Clone for TernaryTreeList<T>
sourcefn clone(&self) -> TernaryTreeList<T>
fn clone(&self) -> TernaryTreeList<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T: Debug> Debug for TernaryTreeList<T>
impl<T: Debug> Debug for TernaryTreeList<T>
sourceimpl<T> Display for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> Display for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T, const N: usize> From<&'_ [T; N]> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T, const N: usize> From<&'_ [T; N]> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T> From<&'_ Vec<T, Global>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> From<&'_ Vec<T, Global>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T> From<Vec<T, Global>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> From<Vec<T, Global>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T> Hash for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> Hash for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T> Index<usize> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> Index<usize> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<'a, T> IntoIterator for &'a TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<'a, T> IntoIterator for &'a TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T> Ord for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> Ord for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourceimpl<T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash> PartialEq<TernaryTreeList<T>> for TernaryTreeList<T>
impl<T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash> PartialEq<TernaryTreeList<T>> for TernaryTreeList<T>
sourceimpl<T> PartialOrd<TernaryTreeList<T>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
impl<T> PartialOrd<TernaryTreeList<T>> for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<T> Eq for TernaryTreeList<T> where
T: Clone + Display + Eq + PartialEq + Debug + Ord + PartialOrd + Hash,
Auto Trait Implementations
impl<T> RefUnwindSafe for TernaryTreeList<T> where
T: RefUnwindSafe,
impl<T> Send for TernaryTreeList<T> where
T: Send + Sync,
impl<T> Sync for TernaryTreeList<T> where
T: Send + Sync,
impl<T> Unpin for TernaryTreeList<T>
impl<T> UnwindSafe for TernaryTreeList<T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more