pub struct SimdDsonProcessor { /* private fields */ }Expand description
SIMD-accelerated DSON processor implementing all DSON traits
Implementations§
Source§impl SimdDsonProcessor
impl SimdDsonProcessor
Sourcepub fn with_schema(
replica_id: &str,
input_schema: Vec<String>,
output_schema: Vec<String>,
) -> Self
pub fn with_schema( replica_id: &str, input_schema: Vec<String>, output_schema: Vec<String>, ) -> Self
Create with schema filtering
Sourcepub const fn with_parallel(self, enabled: bool) -> Self
pub const fn with_parallel(self, enabled: bool) -> Self
Enable parallel processing
Sourcepub const fn is_parallel(&self) -> bool
pub const fn is_parallel(&self) -> bool
Check if parallel processing is enabled
Source§impl SimdDsonProcessor
impl SimdDsonProcessor
Sourcepub fn process_batch_parallel(
&self,
documents: Vec<String>,
) -> Result<Vec<String>>
pub fn process_batch_parallel( &self, documents: Vec<String>, ) -> Result<Vec<String>>
Process multiple documents in parallel
§Errors
Returns an error if parallel processing is not enabled or if any document fails to process.
Sourcepub fn apply_operations_parallel(
&mut self,
ops: Vec<DsonOperation>,
) -> Result<Vec<Option<MergeConflict>>>
pub fn apply_operations_parallel( &mut self, ops: Vec<DsonOperation>, ) -> Result<Vec<Option<MergeConflict>>>
Apply operations in parallel where order-independent
§Errors
Returns an error if any operation fails to apply.
Sourcepub fn merge_replicas_parallel(
&mut self,
replica_ops: Vec<(String, Vec<CrdtOperation>)>,
_strategy: &MergeStrategy,
) -> Result<Vec<MergeConflict>>
pub fn merge_replicas_parallel( &mut self, replica_ops: Vec<(String, Vec<CrdtOperation>)>, _strategy: &MergeStrategy, ) -> Result<Vec<MergeConflict>>
Merge operations from multiple replicas in parallel
§Errors
Returns an error if any merge operation fails.
Trait Implementations§
Source§impl ArrayOperations for SimdDsonProcessor
impl ArrayOperations for SimdDsonProcessor
Source§fn array_insert(
&mut self,
path: &str,
index: usize,
value: OperationValue,
) -> Result<()>
fn array_insert( &mut self, path: &str, index: usize, value: OperationValue, ) -> Result<()>
Insert value at index in array at path Read more
Source§fn array_remove(&mut self, path: &str, index: usize) -> Result<()>
fn array_remove(&mut self, path: &str, index: usize) -> Result<()>
Remove element at index from array at path Read more
Source§fn array_replace(
&mut self,
path: &str,
index: usize,
value: OperationValue,
) -> Result<()>
fn array_replace( &mut self, path: &str, index: usize, value: OperationValue, ) -> Result<()>
Replace element at index in array at path Read more
Source§fn array_build(
&mut self,
path: &str,
elements: Vec<OperationValue>,
) -> Result<()>
fn array_build( &mut self, path: &str, elements: Vec<OperationValue>, ) -> Result<()>
Build array from elements Read more
Source§fn array_filter(
&mut self,
path: &str,
predicate: &FilterPredicate,
) -> Result<()>
fn array_filter( &mut self, path: &str, predicate: &FilterPredicate, ) -> Result<()>
Filter array elements Read more
Source§fn array_map(&mut self, path: &str, transform: &TransformFunction) -> Result<()>
fn array_map(&mut self, path: &str, transform: &TransformFunction) -> Result<()>
Map over array elements Read more
Source§fn array_reduce(
&mut self,
path: &str,
initial: OperationValue,
reducer: &ReduceFunction,
) -> Result<OperationValue>
fn array_reduce( &mut self, path: &str, initial: OperationValue, reducer: &ReduceFunction, ) -> Result<OperationValue>
Reduce array to single value Read more
Source§impl CrdtMerge for SimdDsonProcessor
impl CrdtMerge for SimdDsonProcessor
Source§fn merge_operation(
&mut self,
op: CrdtOperation,
) -> Result<Option<MergeConflict>>
fn merge_operation( &mut self, op: CrdtOperation, ) -> Result<Option<MergeConflict>>
Merge a remote operation into local state Read more
Source§fn merge_field(
&mut self,
path: &str,
value: OperationValue,
timestamp: u64,
strategy: &MergeStrategy,
) -> Result<Option<MergeConflict>>
fn merge_field( &mut self, path: &str, value: OperationValue, timestamp: u64, strategy: &MergeStrategy, ) -> Result<Option<MergeConflict>>
Merge field with CRDT semantics Read more
Source§fn vector_clock(&self) -> &VectorClock
fn vector_clock(&self) -> &VectorClock
Get the current vector clock
Source§fn replica_id(&self) -> &str
fn replica_id(&self) -> &str
Get the replica ID
Source§fn resolve_conflict(
&mut self,
conflict: &MergeConflict,
strategy: &MergeStrategy,
) -> Result<OperationValue>
fn resolve_conflict( &mut self, conflict: &MergeConflict, strategy: &MergeStrategy, ) -> Result<OperationValue>
Resolve a conflict using the specified strategy Read more
Source§impl DeltaCrdt for SimdDsonProcessor
impl DeltaCrdt for SimdDsonProcessor
Source§fn generate_delta(&self, since: &VectorClock) -> Self::Delta
fn generate_delta(&self, since: &VectorClock) -> Self::Delta
Generate delta since given vector clock
Source§fn apply_delta(&mut self, delta: Self::Delta) -> Result<Vec<MergeConflict>>
fn apply_delta(&mut self, delta: Self::Delta) -> Result<Vec<MergeConflict>>
Apply delta from remote replica Read more
Source§impl DocumentProcessor for SimdDsonProcessor
impl DocumentProcessor for SimdDsonProcessor
Source§fn process(&mut self, input: &str) -> Result<String>
fn process(&mut self, input: &str) -> Result<String>
Process input JSON and return transformed output Read more
Source§fn apply_operation(&mut self, op: &DsonOperation) -> Result<()>
fn apply_operation(&mut self, op: &DsonOperation) -> Result<()>
Apply a single operation Read more
Source§fn apply_operations(&mut self, ops: &[DsonOperation]) -> Result<()>
fn apply_operations(&mut self, ops: &[DsonOperation]) -> Result<()>
Apply a batch of operations Read more
Source§impl FieldOperations for SimdDsonProcessor
impl FieldOperations for SimdDsonProcessor
Source§fn field_add(&mut self, path: &str, value: OperationValue) -> Result<()>
fn field_add(&mut self, path: &str, value: OperationValue) -> Result<()>
Add a field at path with value Read more
Source§fn field_modify(&mut self, path: &str, value: OperationValue) -> Result<()>
fn field_modify(&mut self, path: &str, value: OperationValue) -> Result<()>
Modify existing field at path Read more
Source§fn field_read(&self, path: &str) -> Result<Option<OperationValue>>
fn field_read(&self, path: &str) -> Result<Option<OperationValue>>
Read field value at path Read more
Source§fn field_exists(&self, path: &str) -> bool
fn field_exists(&self, path: &str) -> bool
Check if field exists at path
Source§impl OpBasedCrdt for SimdDsonProcessor
impl OpBasedCrdt for SimdDsonProcessor
Source§fn prepare(&self, op: &DsonOperation) -> Result<CrdtOperation>
fn prepare(&self, op: &DsonOperation) -> Result<CrdtOperation>
Prepare an operation for broadcast (downstream precondition) Read more
Source§fn effect(&mut self, op: CrdtOperation) -> Result<Option<MergeConflict>>
fn effect(&mut self, op: CrdtOperation) -> Result<Option<MergeConflict>>
Effect an operation (apply after delivery) Read more
Source§fn is_causally_ready(&self, op: &CrdtOperation) -> bool
fn is_causally_ready(&self, op: &CrdtOperation) -> bool
Check if operation is causally ready to be applied
Source§fn buffer_operation(&mut self, op: CrdtOperation)
fn buffer_operation(&mut self, op: CrdtOperation)
Buffer operation until causally ready
Source§fn process_buffered(&mut self) -> Result<Vec<MergeConflict>>
fn process_buffered(&mut self) -> Result<Vec<MergeConflict>>
Process buffered operations that are now ready Read more
Source§impl SchemaAware for SimdDsonProcessor
impl SchemaAware for SimdDsonProcessor
Source§fn matches_input_schema(&self, path: &str) -> bool
fn matches_input_schema(&self, path: &str) -> bool
Check if a path matches the input schema
Source§fn matches_output_schema(&self, path: &str) -> bool
fn matches_output_schema(&self, path: &str) -> bool
Check if a path matches the output schema
Source§fn input_schema(&self) -> Vec<String>
fn input_schema(&self) -> Vec<String>
Get input schema paths
Source§fn output_schema(&self) -> Vec<String>
fn output_schema(&self) -> Vec<String>
Get output schema paths
Auto Trait Implementations§
impl Freeze for SimdDsonProcessor
impl !RefUnwindSafe for SimdDsonProcessor
impl Send for SimdDsonProcessor
impl Sync for SimdDsonProcessor
impl Unpin for SimdDsonProcessor
impl UnwindSafe for SimdDsonProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more