pub struct OrderedBinaryTreeMapper<SA, T, A = CurrentStorage>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
T: NestedEncode + NestedDecode + PartialOrd + PartialEq + Clone,{ /* private fields */ }
Implementations§
Source§impl<SA, T, A> OrderedBinaryTreeMapper<SA, T, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
T: NestedEncode + NestedDecode + PartialOrd + PartialEq + Clone,
impl<SA, T, A> OrderedBinaryTreeMapper<SA, T, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
T: NestedEncode + NestedDecode + PartialOrd + PartialEq + Clone,
pub fn get_root(&self) -> Option<OrderedBinaryTreeNode<T>>
pub fn get_depth(&self, node: &OrderedBinaryTreeNode<T>) -> usize
pub fn recursive_search( &self, opt_node: Option<OrderedBinaryTreeNode<T>>, data: &T, ) -> Option<OrderedBinaryTreeNode<T>>
pub fn iterative_search( &self, opt_node: Option<OrderedBinaryTreeNode<T>>, data: &T, ) -> Option<OrderedBinaryTreeNode<T>>
pub fn find_max( &self, node: OrderedBinaryTreeNode<T>, ) -> OrderedBinaryTreeNode<T>
pub fn find_min( &self, node: OrderedBinaryTreeNode<T>, ) -> OrderedBinaryTreeNode<T>
pub fn find_successor( &self, node: OrderedBinaryTreeNode<T>, ) -> Option<OrderedBinaryTreeNode<T>>
pub fn find_predecessor( &self, node: OrderedBinaryTreeNode<T>, ) -> Option<OrderedBinaryTreeNode<T>>
pub fn insert_element(&mut self, new_data: T) -> u64
pub fn delete_node(&mut self, data: T)
Trait Implementations§
Source§impl<SA, T> StorageMapper<SA> for OrderedBinaryTreeMapper<SA, T>where
SA: StorageMapperApi,
T: NestedEncode + NestedDecode + PartialOrd + PartialEq + Clone + 'static,
impl<SA, T> StorageMapper<SA> for OrderedBinaryTreeMapper<SA, T>where
SA: StorageMapperApi,
T: NestedEncode + NestedDecode + PartialOrd + PartialEq + Clone + 'static,
Source§fn new(base_key: StorageKey<SA>) -> OrderedBinaryTreeMapper<SA, T>
fn new(base_key: StorageKey<SA>) -> OrderedBinaryTreeMapper<SA, T>
Will be called automatically by the
#[storage_mapper]
annotation generated code.Auto Trait Implementations§
impl<SA, T, A> Freeze for OrderedBinaryTreeMapper<SA, T, A>
impl<SA, T, A> RefUnwindSafe for OrderedBinaryTreeMapper<SA, T, A>where
A: RefUnwindSafe,
SA: RefUnwindSafe,
T: RefUnwindSafe,
<SA as HandleTypeInfo>::ManagedBufferHandle: RefUnwindSafe,
impl<SA, T, A> Send for OrderedBinaryTreeMapper<SA, T, A>
impl<SA, T, A> Sync for OrderedBinaryTreeMapper<SA, T, A>
impl<SA, T, A> Unpin for OrderedBinaryTreeMapper<SA, T, A>
impl<SA, T, A> UnwindSafe for OrderedBinaryTreeMapper<SA, T, A>where
A: UnwindSafe,
SA: UnwindSafe,
T: UnwindSafe,
<SA as HandleTypeInfo>::ManagedBufferHandle: UnwindSafe,
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
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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