Struct rocket::http::hyper::Server [−][src]
pub struct Server<L = HttpListener> { /* fields omitted */ }
Expand description
A server can listen on a TCP socket.
Once listening, it will create a Request/Response pair for each
incoming connection, and hand them to the provided handler.
Implementations
impl<L> Server<L> where
L: NetworkListener, [src]
impl<L> Server<L> where
L: NetworkListener, [src]pub fn keep_alive(&mut self, timeout: Option<Duration>)[src]
pub fn keep_alive(&mut self, timeout: Option<Duration>)[src]Controls keep-alive for this server.
The timeout duration passed will be used to determine how long to keep the connection alive before dropping it.
Passing None will disable keep-alive.
Default is enabled with a 5 second timeout.
pub fn set_read_timeout(&mut self, dur: Option<Duration>)[src]
pub fn set_read_timeout(&mut self, dur: Option<Duration>)[src]Sets the read timeout for all Request reads.
pub fn set_write_timeout(&mut self, dur: Option<Duration>)[src]
pub fn set_write_timeout(&mut self, dur: Option<Duration>)[src]Sets the write timeout for all Response writes.
pub fn local_addr(&mut self) -> Result<SocketAddr, Error>[src]
pub fn local_addr(&mut self) -> Result<SocketAddr, Error>[src]Get the address that the server is listening on.
impl Server<HttpListener>[src]
impl Server<HttpListener>[src]pub fn http<To>(addr: To) -> Result<Server<HttpListener>, Error> where
To: ToSocketAddrs, [src]
pub fn http<To>(addr: To) -> Result<Server<HttpListener>, Error> where
To: ToSocketAddrs, [src]Creates a new server that will handle HttpStreams.
impl<S> Server<HttpsListener<S>> where
S: SslServer<HttpStream> + Clone + Send, [src]
impl<S> Server<HttpsListener<S>> where
S: SslServer<HttpStream> + Clone + Send, [src]pub fn https<A>(addr: A, ssl: S) -> Result<Server<HttpsListener<S>>, Error> where
A: ToSocketAddrs, [src]
pub fn https<A>(addr: A, ssl: S) -> Result<Server<HttpsListener<S>>, Error> where
A: ToSocketAddrs, [src]Creates a new server that will handle HttpStreams over SSL.
You can use any SSL implementation, as long as implements hyper::net::Ssl.
impl<L> Server<L> where
L: 'static + NetworkListener + Send, [src]
impl<L> Server<L> where
L: 'static + NetworkListener + Send, [src]Trait Implementations
Auto Trait Implementations
impl<L> RefUnwindSafe for Server<L> where
L: RefUnwindSafe,
L: RefUnwindSafe,
impl<L> Send for Server<L> where
L: Send,
L: Send,
impl<L> Sync for Server<L> where
L: Sync,
L: Sync,
impl<L> Unpin for Server<L> where
L: Unpin,
L: Unpin,
impl<L> UnwindSafe for Server<L> where
L: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T[src]
impl<T> IntoCollection<T> for T[src]pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>, [src]
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>, [src]Converts self into a collection.
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>, [src]
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,