pub struct AugmentedRBTreeFactory<G> { /* private fields */ }Expand description
A factory for creating AugmentedRBTree instances with default parameters.
Implementations§
Source§impl<G> AugmentedRBTreeFactory<G>
impl<G> AugmentedRBTreeFactory<G>
Sourcepub fn new_tree<K, V>() -> AugmentedRBTree<K, V, G, Global>
pub fn new_tree<K, V>() -> AugmentedRBTree<K, V, G, Global>
Creates a tree using the Global allocator.
§Examples
let mut tree = AugmentedRBTreeFactory::<SubtreeSize>::new_tree();
tree.insert(1, 100);
assert!(tree.contains_key(&1));Type inference for K and V works automatically here!
Sourcepub fn new_tree_in<K, V, A: Allocator>(alloc: A) -> AugmentedRBTree<K, V, G, A>
pub fn new_tree_in<K, V, A: Allocator>(alloc: A) -> AugmentedRBTree<K, V, G, A>
Creates a tree using a custom allocator.
§Examples
#![cfg_attr(feature = "nightly", feature(allocator_api))]
use augmented_rbtree::{AugmentedRBTreeFactory, augmentations::SubtreeSize, Global};
let mut tree = AugmentedRBTreeFactory::<SubtreeSize>::new_tree_in(Global);
tree.insert(1, 100);
assert!(tree.contains_key(&1));Trait Implementations§
Auto Trait Implementations§
impl<G> Freeze for AugmentedRBTreeFactory<G>
impl<G> RefUnwindSafe for AugmentedRBTreeFactory<G>
impl<G> Send for AugmentedRBTreeFactory<G>
impl<G> Sync for AugmentedRBTreeFactory<G>
impl<G> Unpin for AugmentedRBTreeFactory<G>
impl<G> UnsafeUnpin for AugmentedRBTreeFactory<G>
impl<G> UnwindSafe for AugmentedRBTreeFactory<G>
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