Blob storage improvements
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user