Skip to main content

Window

Trait Window 

Source
pub trait Window<I> {
    // Required method
    fn window(
        &self,
        current: usize,
        size: NonZero<usize>,
    ) -> Result<Option<Vec<I>>, DatasetError>;
}
Available on crate features dataset and std only.
Expand description

Functionality to create a window.

Required Methods§

Source

fn window( &self, current: usize, size: NonZero<usize>, ) -> Result<Option<Vec<I>>, DatasetError>

Creates a window of a collection.

§Returns

A Vec<I> representing the window, or None if the window doesn’t fit within the collection.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<I, T> Window<I> for T
where T: Dataset<I> + ?Sized,