diff options
Diffstat (limited to 'ipfs-api/examples/get_version.rs')
-rw-r--r-- | ipfs-api/examples/get_version.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ipfs-api/examples/get_version.rs b/ipfs-api/examples/get_version.rs index 41a4ee5..6fb9c7e 100644 --- a/ipfs-api/examples/get_version.rs +++ b/ipfs-api/examples/get_version.rs @@ -6,7 +6,10 @@ // copied, modified, or distributed except according to those terms. // +#[cfg(feature = "actix")] +extern crate actix_web; extern crate futures; +#[cfg(feature = "hyper")] extern crate hyper; extern crate ipfs_api; @@ -23,5 +26,15 @@ fn main() { .version() .map(|version| println!("version: {:?}", version.version)); - hyper::rt::run(req.map_err(|e| eprintln!("{}", e))); + let fut = req.map_err(|e| eprintln!("{}", e)); + + #[cfg(feature = "hyper")] + hyper::rt::run(fut); + #[cfg(feature = "actix")] + actix_web::actix::run(|| { + fut.then(|_| { + actix_web::actix::System::current().stop(); + Ok(()) + }) + }); } |