Skip to content

Commit

Permalink
chore(fetcher): example for looking into expand
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Dec 28, 2024
1 parent fb9656b commit 782d929
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
73 changes: 73 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fetcher-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ syn = { version = "2.0", features = ["full"] }
quote = "1.0"
proc-macro2 = "1.0"

[dev-dependencies]
fetcher = { path = "../fetcher" }
tokio = { version = "1.0", features = ["full"] }

[lib]
proc-macro = true
15 changes: 15 additions & 0 deletions fetcher-macros/examples/fetch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use fetcher::{fetch, Request};

#[tokio::main]
async fn main () {
let request = Request {
url: "https://example.com".parse().unwrap(),
method: fetcher::Method::GET,
headers: Default::default(),
body: None,
follow: None,
};

let response = fetch!(request);
println!("Received {} !", response.status);
}

0 comments on commit 782d929

Please sign in to comment.