Skip to main content

GroveDbOpBatchV0Methods

Trait GroveDbOpBatchV0Methods 

Source
pub trait GroveDbOpBatchV0Methods {
Show 18 methods // Required methods fn new() -> Self; fn len(&self) -> usize; fn is_empty(&self) -> bool; fn push(&mut self, op: QualifiedGroveDbOp); fn append(&mut self, other: &mut Self); fn extend<I: IntoIterator<Item = QualifiedGroveDbOp>>( &mut self, other_ops: I, ); fn from_operations(operations: Vec<QualifiedGroveDbOp>) -> Self; fn add_insert_empty_tree(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>); fn add_insert_empty_tree_with_flags( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, storage_flags: &Option<Cow<'_, StorageFlags>>, ); fn add_insert_empty_sum_tree(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>); fn add_insert_empty_sum_tree_with_flags( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, storage_flags: &Option<Cow<'_, StorageFlags>>, ); fn add_delete(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>); fn add_delete_tree( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, tree_type: TreeType, ); fn add_insert(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>, element: Element); fn verify_consistency_of_operations(&self) -> GroveDbOpConsistencyResults; fn contains<'c, P>(&self, path: P, key: &[u8]) -> Option<&GroveOp> where P: IntoIterator<Item = &'c [u8]>, <P as IntoIterator>::IntoIter: ExactSizeIterator + DoubleEndedIterator + Clone; fn remove<'c, P>(&mut self, path: P, key: &[u8]) -> Option<GroveOp> where P: IntoIterator<Item = &'c [u8]>, <P as IntoIterator>::IntoIter: ExactSizeIterator + DoubleEndedIterator + Clone; fn remove_if_insert( &mut self, path: Vec<Vec<u8>>, key: &[u8], ) -> Option<GroveOp>;
}
Expand description

Trait defining a batch of GroveDB operations.

Required Methods§

Source

fn new() -> Self

Creates a new empty batch of GroveDB operations.

Source

fn len(&self) -> usize

Gets the number of operations from a list of GroveDB ops.

Source

fn is_empty(&self) -> bool

Checks to see if the operation batch is empty.

Source

fn push(&mut self, op: QualifiedGroveDbOp)

Pushes an operation into a list of GroveDB ops.

Source

fn append(&mut self, other: &mut Self)

Appends operations into a list of GroveDB ops.

Source

fn extend<I: IntoIterator<Item = QualifiedGroveDbOp>>(&mut self, other_ops: I)

Extend operations into a list of GroveDB ops.

Source

fn from_operations(operations: Vec<QualifiedGroveDbOp>) -> Self

Puts a list of GroveDB operations into a batch.

Source

fn add_insert_empty_tree(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>)

Adds an Insert operation with an empty tree at the specified path and key to a list of GroveDB ops.

Source

fn add_insert_empty_tree_with_flags( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, storage_flags: &Option<Cow<'_, StorageFlags>>, )

Adds an Insert operation with an empty tree with storage flags to a list of GroveDB ops.

Source

fn add_insert_empty_sum_tree(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>)

Adds an Insert operation with an empty sum tree at the specified path and key to a list of GroveDB ops.

Source

fn add_insert_empty_sum_tree_with_flags( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, storage_flags: &Option<Cow<'_, StorageFlags>>, )

Adds an Insert operation with an empty sum tree with storage flags to a list of GroveDB ops.

Source

fn add_delete(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>)

Adds a Delete operation to a list of GroveDB ops.

Source

fn add_delete_tree( &mut self, path: Vec<Vec<u8>>, key: Vec<u8>, tree_type: TreeType, )

Adds a Delete tree operation to a list of GroveDB ops.

Source

fn add_insert(&mut self, path: Vec<Vec<u8>>, key: Vec<u8>, element: Element)

Adds an Insert operation with an element to a list of GroveDB ops.

Source

fn verify_consistency_of_operations(&self) -> GroveDbOpConsistencyResults

Verify consistency of operations

Source

fn contains<'c, P>(&self, path: P, key: &[u8]) -> Option<&GroveOp>

Check if the batch contains a specific path and key.

§Arguments
  • path - The path to search for.
  • key - The key to search for.
§Returns
  • Option<&Op> - Returns a reference to the Op if found, or None otherwise.
Source

fn remove<'c, P>(&mut self, path: P, key: &[u8]) -> Option<GroveOp>

Remove a specific path and key from the batch and return the removed Op.

§Arguments
  • path - The path to search for.
  • key - The key to search for.
§Returns
  • Option<Op> - Returns the removed Op if found, or None otherwise.
Source

fn remove_if_insert( &mut self, path: Vec<Vec<u8>>, key: &[u8], ) -> Option<GroveOp>

Find and remove a specific path and key from the batch if it is an GroveOp::InsertOrReplace, GroveOp::Replace, or GroveOp::Patch. Return the found Op regardless of whether it was removed.

§Arguments
  • path - The path to search for.
  • key - The key to search for.
§Returns
  • Option<Op> - Returns the found Op if it exists. If the Op is an GroveOp::InsertOrReplace, GroveOp::Replace, or GroveOp::Patch, it will be removed from the batch.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§