Struct nebari::TransactionTree
source · [−]pub struct TransactionTree<Root: Root, File: ManagedFile> { /* private fields */ }Expand description
A tree that is modifiable during a transaction.
Implementations
impl<File: ManagedFile, Index> TransactionTree<VersionedTreeRoot<Index>, File> where
Index: Clone + Reducer<Index> + EmbeddedIndex + Debug + 'static,
impl<File: ManagedFile, Index> TransactionTree<VersionedTreeRoot<Index>, File> where
Index: Clone + Reducer<Index> + EmbeddedIndex + Debug + 'static,
Returns the latest sequence id.
Sets key to value.
Executes a modification.
Sets key to value. If a value already exists, it will be returned.
Returns the current value of key. This will return updated information
if it has been previously updated within this transaction.
Removes key and returns the existing value, if present.
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.
Retrieves the values of keys. If any keys are not found, they will be
omitted from the results. Keys are required to be pre-sorted.
Retrieves all of the values of keys within range.
pub fn scan<'b, 'keys, CallerError, KeyRangeBounds, NodeEvaluator, KeyEvaluator, DataCallback>(
&mut self,
range: &'keys KeyRangeBounds,
forwards: bool,
node_evaluator: NodeEvaluator,
key_evaluator: KeyEvaluator,
callback: DataCallback
) -> Result<(), AbortError<CallerError>> where
KeyRangeBounds: RangeBounds<&'keys [u8]> + Debug + ?Sized,
NodeEvaluator: FnMut(&ArcBytes<'static>, &Root::ReducedIndex, usize) -> bool,
KeyEvaluator: FnMut(&ArcBytes<'static>, &Root::Index) -> KeyEvaluation,
DataCallback: FnMut(ArcBytes<'static>, &Root::Index, ArcBytes<'static>) -> Result<(), AbortError<CallerError>>,
CallerError: Display + Debug,
pub fn scan<'b, 'keys, CallerError, KeyRangeBounds, NodeEvaluator, KeyEvaluator, DataCallback>(
&mut self,
range: &'keys KeyRangeBounds,
forwards: bool,
node_evaluator: NodeEvaluator,
key_evaluator: KeyEvaluator,
callback: DataCallback
) -> Result<(), AbortError<CallerError>> where
KeyRangeBounds: RangeBounds<&'keys [u8]> + Debug + ?Sized,
NodeEvaluator: FnMut(&ArcBytes<'static>, &Root::ReducedIndex, usize) -> bool,
KeyEvaluator: FnMut(&ArcBytes<'static>, &Root::Index) -> KeyEvaluation,
DataCallback: FnMut(ArcBytes<'static>, &Root::Index, ArcBytes<'static>) -> Result<(), AbortError<CallerError>>,
CallerError: Display + Debug,
Scans the tree. Each key that is contained range will be passed to
key_evaluator, which can opt to read the data for the key, skip, or
stop scanning. If KeyEvaluation::ReadData is returned, callback will
be invoked with the key and stored value. The order in which callback
is invoked is not necessarily the same order in which the keys are
found.
Returns the last of the tree.