Skip to main content

AsyncSource

Trait AsyncSource 

Source
pub trait AsyncSource: Send + Sync {
    // Required methods
    fn open_async(&self) -> BoxFuture<'_, Result<Box<dyn AsyncSourceIterator>>>;
    fn name(&self) -> &str;

    // Provided method
    fn len_hint(&self) -> Option<u64> { ... }
}
Expand description

Async-capable source of training data.

Required Methods§

Source

fn open_async(&self) -> BoxFuture<'_, Result<Box<dyn AsyncSourceIterator>>>

Open the source asynchronously and return an async iterator.

Source

fn name(&self) -> &str

Human-readable name for this source.

Provided Methods§

Source

fn len_hint(&self) -> Option<u64>

Optional hint about the total number of samples.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> AsyncSource for T
where T: Source,