Module 0xdee9::critbit
- Struct
Leaf
- Struct
InternalNode
- Struct
CritbitTree
- Constants
- Function
new
- Function
size
- Function
is_empty
- Function
min_leaf
- Function
max_leaf
- Function
previous_leaf
- Function
next_leaf
- Function
left_most_leaf
- Function
right_most_leaf
- Function
insert_leaf
- Function
find_leaf
- Function
find_closest_key
- Function
remove_leaf_by_index
- Function
borrow_mut_leaf_by_index
- Function
borrow_leaf_by_index
- Function
borrow_leaf_by_key
- Function
drop
- Function
destroy_empty
- Function
get_closest_leaf_index_by_key
- Function
update_child
- Function
is_left_child
use 0x2::table;
use 0x2::tx_context;
use 0xdee9::math;
Struct Leaf
struct Leaf<V> has drop, store
Click to open
Fields
- key: u64
- value: V
- parent: u64
Struct InternalNode
struct InternalNode has drop, store
Click to open
Fields
- mask: u64
- left_child: u64
- right_child: u64
- parent: u64
Struct CritbitTree
struct CritbitTree<V: store> has store
Click to open
Fields
- root: u64
- internal_nodes: table::Table<u64, critbit::InternalNode>
- leaves: table::Table<u64, critbit::Leaf<V>>
- min_leaf: u64
- max_leaf: u64
- next_internal_node_index: u64
- next_leaf_index: u64
Constants
const EExceedCapacity: u64 = 2;
const EIndexOutOfRange: u64 = 7;
const EKeyAlreadyExist: u64 = 4;
const ELeafNotExist: u64 = 5;
const ENullParent: u64 = 8;
const ETreeNotEmpty: u64 = 3;
const MAX_CAPACITY: u64 = 9223372036854775807;
const MAX_U64: u64 = 18446744073709551615;
const PARTITION_INDEX: u64 = 9223372036854775808;