pub struct Server<S> { /* fields omitted */ }
A Warp Server ready to filter requests.
Run this Server
forever on the current thread.
Run this Server
forever on the current thread with a specific stream
of incoming connections.
This can be used for Unix Domain Sockets, or TLS, etc.
Bind to a socket address, returning a Future
that can be
executed on any runtime.
Bind to a possibly ephemeral socket address.
Returns the bound address and a Future
that can be executed on
any runtime.
Create a server with graceful shutdown signal.
When the signal completes, the server will start the graceful shutdown
process.
Returns the bound address and a Future
that can be executed on
any runtime.
extern crate futures;
extern crate warp;
use futures::sync::oneshot;
use warp::Filter;
let routes = warp::any()
.map(|| "Hello, World!");
let (tx, rx) = oneshot::channel();
let (addr, server) = warp::serve(routes)
.bind_with_graceful_shutdown(([127, 0, 0, 1], 3030), rx);
warp::spawn(server);
let _ = tx.send(());
Setup this Server
with a specific stream of incoming connections.
This can be used for Unix Domain Sockets, or TLS, etc.
Returns a Future
that can be executed on any runtime.
Configure a server to use TLS with the supplied certificate and key files.
This function requires the "tls"
feature.
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static