Struct ppom::mdb::OMap[][src]

pub struct OMap<K, V> { /* fields omitted */ }
Expand description

Partially persistent ordered-map type using left-leaning-red-black tree.

OMap type allow concurrent read and write access at API level, while behind the scenes, all write-operations are serialized into single thread, but the key difference is that OMap map allow concurrent-reads without using locks. To serialize concurrent writes OMap uses a spin-lock implementation.

Implementations

Return number of entries in this instance.

Return whether index is empty.

Return current sequence-no for index.

Update index to a new sequence-no, future mutations shall start from this value.

Set key, value into index. If an older entry exist with same key, it shall be overwritten.

Set key, value into index. If already an entry in present with key, cas should match entry’s sequence-number. If index don’t have an entry with key, cas must be ZERO.

Remove the entry, matching the key, from the index.

Remove the entry, with matching key and matching entry’s sequencey-number with cas.

Get entry from index for key. An entry is returned as (value, seqno). If key is not found return Error::KeyNotFound

For full table scan.

Iterate over entries within the specifed range.

Reverse iterate over entries withing specified range. While range method iterate entries from start_bound to end_bound reverse method iterate entries from end_bound to start_bound.

Validate OMap tree with following rules:

  • Root node is always black in color.
  • Verify the sort order between a node and its left/right child.
  • No node has RIGHT RED child and LEFT BLACK child (or NULL child).
  • Make sure there are no consecutive reds.
  • Make sure number of blacks are same on both left and right arm.
  • Make sure that the maximum depth do not exceed MAX_TREE_DEPTH.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.