osom_lib_btree/btree/config.rs
1use osom_lib_alloc::traits::Allocator;
2use osom_lib_reprc::traits::ReprC;
3
4/// The configuration trait for the [`BTree`][crate::btree::BTree].
5#[must_use]
6pub trait BTreeConfig: ReprC + Sized {
7 /// The concrete allocator type.
8 type ConcreteAllocator: Allocator;
9
10 /// The number of children that a node can have. This has
11 /// to be an even number.
12 const CHILDREN_COUNT: usize;
13
14 /// Returns the allocator for the [`BTree`][crate::btree::BTree].
15 fn allocator_mut(&mut self) -> &mut Self::ConcreteAllocator;
16}