Skip to content

algermissen/rustbits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustbits

Rust examples from my journey to clarity.

A Tokio futures stream that produces a sequence

The original inspiration of this was to zip a stream with an index sequence to have a counter of stream items within the stream, as opposed to maintaining a counter outside.

let seq1 = SeqStream::new(0);
let seq2 = SeqStream::new(0);

let s = seq1.zip(seq2).for_each(|(a, b)| {
    println!("Seq: {},{}", a, b);
    Ok(())
});

let mut core = Core::new().unwrap();
core.run(s).unwrap();

Code

About

Rust examples derived from my journey to clarity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages