pub struct Streamer<In, Out>where
    In: Iterator<Item = Result<String, Box<dyn Error>>>,
    Out: FnMut(String) -> Result<(), Box<dyn Error>>,
{ /* private fields */ }
Expand description

Reads data form In source and writes model to Out sink.

use std::{error::Error, io};

use fluent_data::{algorithm::Algo, model::Model, space, streamer::{Streamer, self}};

fn main() -> Result<(), Box<dyn Error>> {
    let algo = Algo::new(space::euclid_dist, space::real_combine);
    let mut model = Model::new(space::euclid_dist);
    let (points, write) = streamer::stdio();
    let streamer = Streamer::new(points, write);
    Streamer::run(streamer, algo, &mut model)?;
    Ok(())
}

Implementations

builds a new streamer instance.

Infinitely reads points from In source and write model changes to Out sink.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.