Blob storage improvements

This commit is contained in:
mdecimus
2023-11-12 10:54:04 +01:00
parent 0e25f3d12c
commit cbcd6d0916
108 changed files with 2649 additions and 2155 deletions

View File

@@ -21,9 +21,12 @@
* for more details.
*/
use crate::BlobHash;
use super::{
assert::ToAssertValue, Batch, BatchBuilder, BitmapClass, HasFlag, IntoOperations, Operation,
Serialize, TagValue, ToBitmaps, ValueClass, ValueOp, F_BITMAP, F_CLEAR, F_INDEX, F_VALUE,
assert::ToAssertValue, Batch, BatchBuilder, BitmapClass, BlobOp, HasFlag, IntoOperations,
Operation, Serialize, TagValue, ToBitmaps, ValueClass, ValueOp, F_BITMAP, F_CLEAR, F_INDEX,
F_VALUE,
};
impl BatchBuilder {
@@ -140,6 +143,15 @@ impl BatchBuilder {
self
}
pub fn blob(&mut self, hash: BlobHash, op: BlobOp, options: u32) -> &mut Self {
self.ops.push(Operation::Blob {
hash,
op,
set: !options.has_flag(F_CLEAR),
});
self
}
pub fn add(&mut self, class: impl Into<ValueClass>, value: i64) -> &mut Self {
self.ops.push(Operation::Value {
class: class.into(),