Crate snkrj

Crate snkrj 

Source

Modules§

btree
An implementation of B trees. The core operations on B trees (lookup, iterate, put and del) are generic in the actual implementation of nodes, via the BTreePage and BTreeMutPage. This allows for a simpler code for the high-level functions, as well as specialised, high-performance implementations for the nodes.

Macros§

direct_repr
A macro to implement Storable on “plain” types, i.e. fixed-sized types that are repr(C) and don’t hold references.

Structs§

CRCError
A CRC check failed
CowPage
Representation of a mutable or shared page. This is an owned page (like Vec in Rust’s std), but we do not know whether we can mutate it or not.
Database
A simple wrapper around Sanakirja aatabase that acts as a very fast on disk BTreeMap.
Env
An environment, which may be either a memory-mapped file, or memory allocated with std::alloc.
L64
A 64-bit unsigned integer in little-endian ordering.
MutPage
An owned page on which we can write. This is just a wrapper around CowPage to avoid checking the “dirty” bit at runtime.
MutTxn
A mutable transaction.
Page
Representation of a borrowed, or immutable page, like a slice in Rust.
Txn
An immutable transaction.

Enums§

Error
Errors that can occur while transacting.

Traits§

AllocPage
Trait for allocating and freeing pages.
AnyDatabase
Commit
Transactions that can be committed. This trait is an abstraction over mutable transactions and their subtransactions.
LoadPage
Trait for loading a page.
RootDb
The trait, implemented by Txn and MutTxn, for treating the 4064 bytes after the header of root pages as pointers to B trees (well, actually Option of pointers to databases, where None is encoded by 0).
RootPage
Access the root page of a transaction.
Storable
Types that can be stored on disk. This trait may be used in conjunction with Sized in order to determine the on-disk size, or with UnsizedStorable when special arrangements are needed.
UnsizedStorable
Types that can be stored on disk.

Unions§

Slice