pub struct BatchPrefetcher<T> { /* private fields */ }Expand description
Background prefetcher that fills a bounded queue with sample batches.
Implementations§
Source§impl<T: Send + 'static> BatchPrefetcher<T>
impl<T: Send + 'static> BatchPrefetcher<T>
Sourcepub fn next(&self) -> Result<T, SamplerError>
pub fn next(&self) -> Result<T, SamplerError>
Block until the next prefetched batch is available.
Sourcepub fn produced_count(&self) -> usize
pub fn produced_count(&self) -> usize
Total number of batches produced by the background worker.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Total number of errors produced by the background worker.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for BatchPrefetcher<T>
impl<T> !RefUnwindSafe for BatchPrefetcher<T>
impl<T> Send for BatchPrefetcher<T>where
T: Send,
impl<T> !Sync for BatchPrefetcher<T>
impl<T> Unpin for BatchPrefetcher<T>
impl<T> UnsafeUnpin for BatchPrefetcher<T>
impl<T> !UnwindSafe for BatchPrefetcher<T>
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