[][src]Trait sophia::quad::stream::QuadSource

pub trait QuadSource<'a> {
    type Quad: Quad<'a>;
    type Error: CoercibleWith<Error> + CoercibleWith<Never>;
    type Iter: Iterator<Item = Result<Self::Quad, Self::Error>>;
    fn as_iter(&mut self) -> &mut Self::Iter;

    fn in_sink<TS: QuadSink>(
        &mut self,
        sink: &mut TS
    ) -> CoercedResult<TS::Outcome, Self::Error, TS::Error>
    where
        Self::Error: CoercibleWith<TS::Error>
, { ... }
fn in_dataset<D: MutableDataset>(
        &mut self,
        dataset: &mut D
    ) -> CoercedResult<usize, Self::Error, <D as MutableDataset>::MutationError>
    where
        Self::Error: CoercibleWith<<D as MutableDataset>::MutationError>
, { ... } }

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

A quad source is castable, with the as_iter method, to an iterator yielding quads wrapped in results, and any such iterator implements the QuadSource trait. It also has additional methods dedicated to interacting with QuadSinks.

Associated Types

type Quad: Quad<'a>

The type of quads produced by this source.

type Error: CoercibleWith<Error> + CoercibleWith<Never>

The type of errors produced by this source.

type Iter: Iterator<Item = Result<Self::Quad, Self::Error>>

The type of iterator this quad source casts to.

Loading content...

Required methods

fn as_iter(&mut self) -> &mut Self::Iter

Cast to iterator.

Loading content...

Provided methods

fn in_sink<TS: QuadSink>(
    &mut self,
    sink: &mut TS
) -> CoercedResult<TS::Outcome, Self::Error, TS::Error> where
    Self::Error: CoercibleWith<TS::Error>, 

Feed all quads from this source into the given sink.

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

fn in_dataset<D: MutableDataset>(
    &mut self,
    dataset: &mut D
) -> CoercedResult<usize, Self::Error, <D as MutableDataset>::MutationError> where
    Self::Error: CoercibleWith<<D as MutableDataset>::MutationError>, 

Insert all quads from this source into the given dataset.

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

Loading content...

Implementors

impl<'a, I, T, E> QuadSource<'a> for I where
    I: Iterator<Item = Result<T, E>> + 'a,
    T: Quad<'a>,
    E: CoercibleWith<Error> + CoercibleWith<Never>, 
[src]

type Quad = T

type Error = E

type Iter = Self

Loading content...