pub async fn run<R, I, W>(config: Config, stdin: R, inbox: I, outbox: W) -> Result<Option<Text>>
where
    R: io::Read + Send + Unpin + 'static,
    I: io::Read + Send + Unpin + 'static,
    W: io::Write + Send + Unpin + 'static,
{
    // channels
    let (input_sender, input_recv) = channel();
    let (output_sender, output_recv) = channel();

    let screen_task = task::spawn(screen::task(config.clone(), outbox, output_recv));
    let person_task = task::spawn(person_input::task(
        config,
        inbox,
        input_sender.clone(),
        output_sender.clone(),
    ));
    let engine_task = task::spawn(engine::task(input_recv, output_sender));
    let data_task = task::spawn(data_input::task(stdin, input_sender));

    let selection = screen_task.await;

    // Stop all remaining tasks
    drop(data_task);
    drop(person_task);
    drop(engine_task);

    selection
}
/// Run the program's tasks.
Run the program's tasks.
Run the program ' s tasks .
pub async fn run<R, I, W>(config: Config, stdin: R, inbox: I, outbox: W) -> Result<Option<Text>>
where
    R: io::Read + Send + Unpin + 'static,
    I: io::Read + Send + Unpin + 'static,
    W: io::Write + Send + Unpin + 'static,
{
    // channels
    let (input_sender, input_recv) = channel();
    let (output_sender, output_recv) = channel();
    let screen_task = task::spawn(screen::task(config.clone(), outbox, output_recv));
    let person_task = task::spawn(person_input::task(
        config,
        inbox,
        input_sender.clone(),
        output_sender.clone(),
    ));
    let engine_task = task::spawn(engine::task(input_recv, output_sender));
    let data_task = task::spawn(data_input::task(stdin, input_sender));
    let selection = screen_task.await;
    // Stop all remaining tasks
    drop(data_task);
    drop(person_task);
    drop(engine_task);
    selection
}
pub async fn run < R , I , W > ( config : Config , stdin : R , inbox : I , outbox : W ) -> Result < Option < Text > > where R : io :: Read + Send + Unpin + ' static , I : io :: Read + Send + Unpin + ' static , W : io :: Write + Send + Unpin + ' static , { // channels let ( input_sender , input_recv ) = channel ( ) ; let ( output_sender , output_recv ) = channel ( ) ; let screen_task = task :: spawn ( screen :: task ( config . clone ( ) , outbox , output_recv ) ) ; let person_task = task :: spawn ( person_input :: task ( config , inbox , input_sender . clone ( ) , output_sender . clone ( ) , ) ) ; let engine_task = task :: spawn ( engine :: task ( input_recv , output_sender ) ) ; let data_task = task :: spawn ( data_input :: task ( stdin , input_sender ) ) ; let selection = screen_task . await ; // Stop all remaining tasks drop ( data_task ) ; drop ( person_task ) ; drop ( engine_task ) ; selection }
Run the program's tasks.
Run the program ' s tasks .
config
Config
stdin
R
inbox
I
outbox
W