pub struct BatchProcessor { /* private fields */ }Expand description
批量处理器
Implementations§
Source§impl BatchProcessor
impl BatchProcessor
Sourcepub fn new(strategy: BatchStrategy) -> Self
pub fn new(strategy: BatchStrategy) -> Self
创建新的批量处理器
Sourcepub fn process_batches<F>(
&mut self,
data: Vec<HashMap<String, Value>>,
processor: F,
) -> Result<()>
pub fn process_batches<F>( &mut self, data: Vec<HashMap<String, Value>>, processor: F, ) -> Result<()>
处理数据批次
Sourcepub fn current_batch_size(&self) -> usize
pub fn current_batch_size(&self) -> usize
获取当前批次大小
Sourcepub fn get_performance_stats(&self) -> BatchPerformanceStats
pub fn get_performance_stats(&self) -> BatchPerformanceStats
获取性能统计
Auto Trait Implementations§
impl Freeze for BatchProcessor
impl RefUnwindSafe for BatchProcessor
impl Send for BatchProcessor
impl Sync for BatchProcessor
impl Unpin for BatchProcessor
impl UnwindSafe for BatchProcessor
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<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