pub struct Marble { /* private fields */ }
Expand description

Garbage-collecting object store. A nice solution to back a pagecache, for people building their own databases.

ROWEX-style concurrency: readers rarely block on other readers or writers, but serializes writes to be friendlier for SSD GC. This means that writes should generally be performed by some background process whose job it is to clean logs etc…

Implementations

Read a object out of storage. If this object is unknown or has been removed, returns Ok(None).

May be called concurrently with background calls to maintenance and write_batch.

Statistics about current files.

Write a batch of objects to disk. This function is crash-atomic but NOT runtime atomic. If you are concurrently serving reads, and require atomic batch semantics, you should serve reads out of an in-memory cache until this function returns. Creates at least one file per call. Performs several fsync calls per call. Ideally, you will heavily batch objects being written using a logger of some sort before calling this function occasionally in the background, then deleting corresponding logs after this function returns.

Defragments backing storage files, blocking concurrent calls to write_batch but not blocking concurrent calls to read. Returns the number of rewritten objects.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.