pub struct Executor { /* private fields */ }Expand description
Executes a plan or individual actions.
Consumers drive execution by calling Executor::execute_operation for each operation.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(
storage_a: Arc<dyn Storage>,
storage_b: Arc<dyn Storage>,
status: Arc<StatusDatabase>,
) -> Executor
pub fn new( storage_a: Arc<dyn Storage>, storage_b: Arc<dyn Storage>, status: Arc<StatusDatabase>, ) -> Executor
Create a new instance with default concurrency.
Default concurrency is 4. Use with_concurrency to
customize it.
Sourcepub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Set the concurrency level for operation execution.
Controls how many operations can execute in parallel. Higher values may improve performance but increase resource usage.
Sourcepub async fn execute_operation(
&self,
operation: Operation,
) -> Result<Result<(), SyncError>, StatusError>
pub async fn execute_operation( &self, operation: Operation, ) -> Result<Result<(), SyncError>, StatusError>
Execute a single operation.
Dispatches to the appropriate handler based on operation type.
§Errors
- Returns
Err(_)for a fatal error interacting with the status database. The caller must stop execution. - Returns
Ok(Err(_))for a non-fatal error. The caller may continue with further operations.
Sourcepub fn execute_item_status_action(
&self,
action: StatusAction,
mapping_uid: MappingUid,
) -> Result<(), StatusError>
pub fn execute_item_status_action( &self, action: StatusAction, mapping_uid: MappingUid, ) -> Result<(), StatusError>
Execute a status-only action (no storage operations).
This should only be used after manually updating an item in both storages, typically, after a manual conflict resolution.
§Errors
Returns Err(_) for a fatal error interacting with the status database.
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Freeze for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.