Struct nebari::tree::TreeFile[][src]

pub struct TreeFile<Root: Root, File: ManagedFile> {
    pub state: State<Root>,
    // some fields omitted
}
Expand description

An append-only tree file.

Generics

Fields

state: State<Root>

The state of the file.

Implementations

Returns a tree as contained in file.

state should already be initialized using Self::initialize_state if the file exists.

Opens a tree file with read-only permissions.

Opens a tree file with the ability to read and write.

Attempts to load the last saved state of this tree into state.

Pushes a key/value pair. Replaces any previous value if set.

Executes a modification.

Compares the value of key against old. If the values match, key will be set to the new value if new is Some or removed if new is None.

Removes key and returns the existing value, if present.

Sets key to value. If a value already exists, it will be returned.

Gets the value stored for key.

Gets the values stored in keys. Does not error if a key is missing. Returns key/value pairs in an unspecified order. Keys are required to be pre-sorted.

Retrieves all keys and values with keys that are contained by range.

Scans the tree for keys that are contained within range. If forwards is true, scanning starts at the lowest sort-order key and scans forward. Otherwise, scanning starts at the highest sort-order key and scans backwards. key_evaluator is invoked for each key as it is encountered. For all KeyEvaluation::ReadData results returned, callback will be invoked with the key and values. The callback may not be invoked in the same order as the keys are scanned.

Returns the last key of the tree.

Returns the last key and value of the tree.

Commits the tree. This is only needed if writes were done with a transaction id. This will fully flush the tree and publish the transactional state to be available to readers.

Rewrites the database, removing all unused data in the process. For a VersionedTreeRoot, this will remove old version information.

This process is done atomically by creating a new file containing the active data. Once the new file has all the current file’s data, the file contents are swapped using atomic file operations.

Scans the tree for keys that are contained within range. If forwards is true, scanning starts at the lowest sort-order key and scans forward. Otherwise, scanning starts at the highest sort-order key and scans backwards. key_evaluator is invoked for each key as it is encountered. For all KeyEvaluation::ReadData results returned, callback will be invoked with the key and values. The callback may not be invoked in the same order as the keys are scanned.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more