use crate::error::InternalError;
use super::Batch;
use super::PublishingContext;
pub trait BatchExecutionResult: Send {}
pub trait BatchVerifierFactory {
type Batch: Batch;
type Context: PublishingContext;
type ExecutionResult: BatchExecutionResult;
#[allow(clippy::type_complexity)]
fn start(
&mut self,
context: Self::Context,
) -> Result<
Box<
dyn BatchVerifier<
Batch = Self::Batch,
Context = Self::Context,
ExecutionResult = Self::ExecutionResult,
>,
>,
InternalError,
>;
}
pub trait BatchVerifier: Send {
type Batch: Batch;
type Context: PublishingContext;
type ExecutionResult: BatchExecutionResult;
fn add_batch(&mut self, batch: Self::Batch) -> Result<(), InternalError>;
fn finalize(&mut self) -> Result<Vec<Self::ExecutionResult>, InternalError>;
fn cancel(&mut self) -> Result<(), InternalError>;
}