Trait Dataset

Source
pub trait Dataset<I>: Send + Sync {
    // Required methods
    fn get(&self, index: usize) -> Option<I>;
    fn len(&self) -> usize;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn iter(&self) -> DatasetIterator<'_, I> 
       where Self: Sized { ... }
}
Expand description

The dataset trait defines a basic collection of items with a predefined size.

Required Methods§

Source

fn get(&self, index: usize) -> Option<I>

Gets the item at the given index.

Source

fn len(&self) -> usize

Gets the number of items in the dataset.

Provided Methods§

Source

fn is_empty(&self) -> bool

Checks if the dataset is empty.

Source

fn iter(&self) -> DatasetIterator<'_, I>
where Self: Sized,

Returns an iterator over the dataset.

Trait Implementations§

Source§

impl<I> Dataset<I> for Box<dyn Dataset<I>>

Source§

fn get(&self, index: usize) -> Option<I>

Gets the item at the given index.
Source§

fn len(&self) -> usize

Gets the number of items in the dataset.
Source§

fn is_empty(&self) -> bool

Checks if the dataset is empty.
Source§

fn iter(&self) -> DatasetIterator<'_, I>
where Self: Sized,

Returns an iterator over the dataset.

Implementations on Foreign Types§

Source§

impl<D, I> Dataset<I> for Box<D>
where D: Dataset<I>,

Source§

fn get(&self, index: usize) -> Option<I>

Source§

fn len(&self) -> usize

Source§

impl<D, I> Dataset<I> for Arc<D>
where D: Dataset<I>,

Source§

fn get(&self, index: usize) -> Option<I>

Source§

fn len(&self) -> usize

Source§

impl<I> Dataset<I> for Box<dyn Dataset<I>>

Source§

fn get(&self, index: usize) -> Option<I>

Source§

fn len(&self) -> usize

Source§

impl<I> Dataset<I> for Arc<dyn Dataset<I>>

Source§

fn get(&self, index: usize) -> Option<I>

Source§

fn len(&self) -> usize

Implementors§

Source§

impl<D, I> Dataset<Vec<I>> for WindowsDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

Source§

impl<D, I> Dataset<I> for ComposedDataset<D>
where D: Dataset<I>, I: Clone,

Source§

impl<D, I> Dataset<I> for PartialDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

Source§

impl<D, I> Dataset<I> for SamplerDataset<D, I>
where D: Dataset<I>, I: Send + Sync,

Source§

impl<D, I> Dataset<I> for ShuffledDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

Source§

impl<D, M, I, O> Dataset<O> for MapperDataset<D, M, I>
where D: Dataset<I>, M: Mapper<I, O> + Send + Sync, I: Send + Sync, O: Send + Sync,

Source§

impl<I> Dataset<I> for InMemDataset<I>
where I: Clone + Send + Sync,

Source§

impl<I> Dataset<I> for SqliteDataset<I>

Available on crate features sqlite or sqlite-bundled only.