Setup virtual Cargo workspace
Diff
Cargo.toml | 9 +++++++++
examples/Cargo.toml | 21 +++++++++++++++++++++
examples/two-deep-http.rs | 30 ++++++++++++++++++++++++++++++
examples/one_level_http/Cargo.toml | 17 -----------------
examples/one_level_http/src/main.rs | 30 ------------------------------
5 files changed, 60 insertions(+), 47 deletions(-)
@@ -1,0 +1,9 @@
[workspace]
members = [
"stork",
"stork_http",
"examples",
]
@@ -1,0 +1,21 @@
[package]
name = "examples"
version = "0.0.0"
publish = false
edition = "2018"
[dev-dependencies]
tokio = { version = "0.2", features = ["full"] }
futures = "0.3"
failure = ""
digest = ""
meowhash = ""
generic-array = ""
stork_http = { path = "../stork_http" }
[[example]]
name = "two-deep-http"
path = "two-deep-http.rs"
@@ -1,0 +1,30 @@
use futures::pin_mut;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() -> failure::Fallible<()> {
let args: Vec<String> = std::env::args().collect();
let url = args
.get(1)
.expect("Expecting URL parameter")
.parse()
.unwrap();
let stream = stork_http::HttpStorkable::new(url).exec();
pin_mut!(stream);
while let Some(link) = stream.next().await {
let link = link?;
println!("{:?}", link.val());
let stream = link.exec();
pin_mut!(stream);
while let Some(link) = stream.next().await {
println!("> {:?}", link?.val());
}
}
Ok(())
}
@@ -1,17 +1,0 @@
[package]
name = "stork-cli"
version = "0.1.0"
authors = ["Jordan Doyle <jordan@doyle.la>"]
edition = "2018"
[dependencies]
tokio = { version = "0.2", features = ["full"] }
futures = "0.3"
failure = ""
digest = ""
meowhash = ""
generic-array = ""
stork_http = { path = "../../stork_http" }
@@ -1,30 +1,0 @@
use futures::pin_mut;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() -> failure::Fallible<()> {
let args: Vec<String> = std::env::args().collect();
let url = args
.get(1)
.expect("Expecting URL parameter")
.parse()
.unwrap();
let stream = stork_http::HttpStorkable::new(url).exec();
pin_mut!(stream);
while let Some(link) = stream.next().await {
let link = link?;
println!("{:?}", link.val());
let stream = link.exec();
pin_mut!(stream);
while let Some(link) = stream.next().await {
println!("> {:?}", link?.val());
}
}
Ok(())
}