pub struct Server<E = ThreadPool> { /* private fields */ }
Expand description
The server implementation.
Implementations§
source§impl Server<()>
impl Server<()>
sourcepub fn new() -> Server<ThreadPool>
pub fn new() -> Server<ThreadPool>
Constructs a new server.
sourcepub fn with_executor<E: Executor>(executor: E) -> Server<E>
pub fn with_executor<E: Executor>(executor: E) -> Server<E>
Constructs a new server with the given executor.
source§impl<E> Server<E>
impl<E> Server<E>
sourcepub fn include_date_header(self, include: bool) -> Self
pub fn include_date_header(self, include: bool) -> Self
Whether if include the Date
header.
sourcepub fn max_body_size(self, max_body_size_bytes: Option<usize>) -> Self
pub fn max_body_size(self, max_body_size_bytes: Option<usize>) -> Self
The max size in bytes the body is allowed to have, if the body surpasses that size the request will be rejected.
sourcepub fn include_conn_info(self, insert_conn_info: bool) -> Self
pub fn include_conn_info(self, insert_conn_info: bool) -> Self
Include connection information to the request extensions.
sourcepub fn include_server_info(self, include_server_info: bool) -> Self
pub fn include_server_info(self, include_server_info: bool) -> Self
Include the server config to the request extensions.
sourcepub fn on_ready<F>(self, f: F) -> Self
pub fn on_ready<F>(self, f: F) -> Self
Adds a callback that will be executed right after the server starts.
sourcepub fn handle(&self) -> ServerHandle
pub fn handle(&self) -> ServerHandle
Returns a handle to the server.
Auto Trait Implementations§
impl<E> Freeze for Server<E>where
E: Freeze,
impl<E = ThreadPool> !RefUnwindSafe for Server<E>
impl<E> Send for Server<E>where
E: Send,
impl<E = ThreadPool> !Sync for Server<E>
impl<E> Unpin for Server<E>where
E: Unpin,
impl<E = ThreadPool> !UnwindSafe for Server<E>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more