pub struct BatchEngine { /* private fields */ }Expand description
Wraps Engine for concurrent multi-document processing with backpressure.
The underlying Engine is shared via Arc; cloning BatchEngine is cheap.
Implementations§
Source§impl BatchEngine
impl BatchEngine
pub fn new(engine: Engine, options: BatchOptions) -> Self
Sourcepub fn lint_many(
&self,
docs: impl IntoIterator<Item = (String, Vec<u8>)>,
) -> impl Stream<Item = (String, Result<LintResult, BatchError>)>
pub fn lint_many( &self, docs: impl IntoIterator<Item = (String, Vec<u8>)>, ) -> impl Stream<Item = (String, Result<LintResult, BatchError>)>
Lint many documents concurrently. Yields (id, Result) in
completion order; an Err indicates the per-document task panicked
or was cancelled — it does not abort the batch.
Sourcepub fn fix_many(
&self,
docs: impl IntoIterator<Item = (String, Vec<u8>)>,
) -> impl Stream<Item = (String, Result<FixResult, BatchError>)>
pub fn fix_many( &self, docs: impl IntoIterator<Item = (String, Vec<u8>)>, ) -> impl Stream<Item = (String, Result<FixResult, BatchError>)>
Fix many documents concurrently. Yields (id, Result) in
completion order; an Err indicates the per-document task panicked
or was cancelled — it does not abort the batch.
Auto Trait Implementations§
impl Freeze for BatchEngine
impl !RefUnwindSafe for BatchEngine
impl Send for BatchEngine
impl Sync for BatchEngine
impl Unpin for BatchEngine
impl UnsafeUnpin for BatchEngine
impl !UnwindSafe for BatchEngine
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