pub struct ParallelPipeline { /* private fields */ }Expand description
Parallel preprocessing pipeline
Implementations§
Source§impl ParallelPipeline
impl ParallelPipeline
Sourcepub fn new(config: ParallelConfig, preprocess_fn: PreprocessFn) -> Self
pub fn new(config: ParallelConfig, preprocess_fn: PreprocessFn) -> Self
Sourcepub fn submit_dataset(&mut self, dataset: &Dataset) -> Result<usize>
pub fn submit_dataset(&mut self, dataset: &Dataset) -> Result<usize>
Submit a dataset for processing
Sourcepub fn submit_chunk(&mut self, chunk: &DataChunk) -> Result<usize>
pub fn submit_chunk(&mut self, chunk: &DataChunk) -> Result<usize>
Submit a data chunk for processing
Sourcepub fn receive(&mut self) -> Result<Option<Dataset>>
pub fn receive(&mut self) -> Result<Option<Dataset>>
Receive a processed result
§Returns
Ok(Some(Dataset))- Processed datasetOk(None)- No more results (all workers finished)Err(DatasetsError)- If receive fails
Sourcepub fn try_receive(&mut self) -> Result<Option<Dataset>>
pub fn try_receive(&mut self) -> Result<Option<Dataset>>
Try to receive a result without blocking
Sourcepub fn process_batch(&mut self, datasets: &[Dataset]) -> Result<Vec<Dataset>>
pub fn process_batch(&mut self, datasets: &[Dataset]) -> Result<Vec<Dataset>>
Process a batch of datasets
Sourcepub fn items_processed(&self) -> usize
pub fn items_processed(&self) -> usize
Get number of items processed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParallelPipeline
impl !RefUnwindSafe for ParallelPipeline
impl Send for ParallelPipeline
impl Sync for ParallelPipeline
impl Unpin for ParallelPipeline
impl UnsafeUnpin for ParallelPipeline
impl !UnwindSafe for ParallelPipeline
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.