rousan / streamify-rs

Conversions from Rust values to Stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Streamify

Convert a Rust value to a Stream. [WIP].

Usage

Add this to your Cargo.toml:

[dependencies]
streamify = "0.1.0"

Examples

Convert a Future to a Stream:

use streamify;

fn main() {
  let fut = async { 10 };
  let stream = streamify::from_future(fut);
}

Convert any value to a Stream:

use streamify;

fn main() {
  let val = 10;
  let stream = streamify::from_any(val);

  let val = "Testing".to_owned();
  let stream = streamify::from_any(val);
}

About

Conversions from Rust values to Stream

License:MIT License


Languages

Language:Rust 100.0%