pub trait QuadSource {
    type Error: 'static + Error;
    type Quad: QuadStreamingMode;
    fn try_for_some_quad<F, E>(
        &mut self,
        f: &mut F
    ) -> Result<bool, StreamError<Self::Error, E>>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>) -> Result<(), E>,
        E: Error
; fn try_for_each_quad<F, E>(
        &mut self,
        f: F
    ) -> Result<(), StreamError<Self::Error, E>>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>) -> Result<(), E>,
        E: Error
, { ... }
fn for_some_quad<F>(&mut self, f: &mut F) -> Result<bool, Self::Error>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>)
, { ... }
fn for_each_quad<F>(&mut self, f: F) -> Result<(), Self::Error>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>)
, { ... }
fn filter_quads<F>(self, filter: F) -> FilterSource<Self, F>
    where
        F: FnMut(&StreamedQuad<'_, Self::Quad>) -> bool
, { ... }
fn filter_map_quads<F, T>(self, filter_map: F) -> FilterMapSource<Self, F>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>) -> Option<T>
, { ... }
fn map_quads<F, T>(self, map: F) -> MapSource<Self, F>
    where
        F: FnMut(StreamedQuad<'_, Self::Quad>) -> T
, { ... }
fn size_hint_quads(&self) -> (usize, Option<usize>) { ... }
fn collect_quads<D>(
        self
    ) -> Result<D, StreamError<Self::Error, <D as Dataset>::Error>>
    where
        D: CollectibleDataset
, { ... }
fn add_to_dataset<D>(
        self,
        dataset: &mut D
    ) -> Result<usize, StreamError<Self::Error, <D as MutableDataset>::MutationError>>
    where
        D: MutableDataset
, { ... } }
Expand description

A quad source produces Quads, and may also fail in the process.

Any iterator yielding Quads wrapped in Result implements the QuadSource trait.

Associated Types

The type of errors produced by this source.

Determine the type of Quads that this quad source yields. (see streaming_mode

Required methods

Call f for at least one quad from this quad source, if any.

Return false if there are no more quads in this source.

Provided methods

Call f for all quads from this quad source.

Call f for at least one quad from this quad source, if any.

Return false if there are no more quads in this source.

Call f for all quads from this quad source.

Creates a quad source which uses a closure to determine if a quad should be yielded.

Creates a quad source that both filters and maps.

Takes a closure and creates quad source which yield the result of that closure for each quad.

Returns the bounds on the remaining length of the quad source.

This method has the same contract as Iterator::size_hint.

Collect these quads into a new dataset.

Insert all quads from this source into the given MutableDataset.

Stop on the first error (in the source or in the dataset).

Implementations on Foreign Types

Implementors