Skip to main content

Crate rax

Crate rax 

Source

Structs§

GenericError
RaxIterator
RaxMap
Redis has a beautiful Radix Tree implementation in ANSI C. This brings it to Rust and creates a safe Map like wrapper for it. This is very similar in utility to a BTreeMap, but RAX is likely much faster and more efficient. Naive testing showed a 2x-4x improvement for all common operations. The only disadvantage to BTreeMap is that BTree’s allow much more flexibility in regards to comparing keys. Radix trees are lexicographically only. Composite keys where the non-last member is variable length could be something BTrees could handle much easier.
RaxSet
RaxMap but without the values. The “isnull” bit will be set for all entries. #Examples
rax
raxIterator
raxNode
raxStack

Enums§

RaxError

Constants§

BEGIN
END
EQUAL
GREATER
GREATER_EQUAL
LESSER
LESSER_EQUAL
RAX_ITER_EOF
RAX_ITER_JUST_SEEKED
RAX_ITER_SAFE
RAX_ITER_STATIC_LEN
RAX_NODE_MAX_SIZE
RAX_STACK_STATIC_ITEMS

Statics§

raxNotFound
rax_free
rax_malloc
rax_realloc

Traits§

RaxKey

Functions§

allocator
Return the existing Rax allocator.
raxCompare
raxEOF
raxFind
raxFree
raxFreeWithCallback
raxInsert
raxIteratorNew
raxIteratorSize
raxNew
raxNext
raxPrev
raxRandomWalk
raxRemove
raxSeek
raxShow
raxSize
raxStart
raxStop
raxTryInsert
set_allocator
Rax internally makes calls to “malloc”, “realloc” and “free” for all of it’s heap memory needs. These calls can be patched with the supplied hooks. Do not call this method after Rax has been used at all. This must be called before using or calling any other Rax API function.