Struct rustful::server::ServerInstance
[−]
[src]
pub struct ServerInstance<R> { /* fields omitted */ }
A runnable instance of a server.
It's not meant to be used directly, unless additional control is required.
let server_instance = Server { host: 8080.into(), handlers: router, ..Server::default() }.build();
Methods
impl<R: HandleRequest + 'static> ServerInstance<R>
[src]
impl<R: HandleRequest + 'static> ServerInstance<R>
pub fn new(config: Server<R>) -> ServerInstance<R>
[src]
pub fn new(config: Server<R>) -> ServerInstance<R>
Create a new server instance, with the provided configuration. This is
the same as Server{...}.build()
.
pub fn run(self) -> HttpResult<Listening>
[src]
pub fn run(self) -> HttpResult<Listening>
Start the server.
pub fn run_https<S: SslServer + Clone + Send + 'static>(
self,
ssl: S
) -> HttpResult<Listening>
[src]
pub fn run_https<S: SslServer + Clone + Send + 'static>(
self,
ssl: S
) -> HttpResult<Listening>
Start the server with SSL.
Trait Implementations
impl<R: HandleRequest + 'static> HyperHandler for ServerInstance<R>
[src]
impl<R: HandleRequest + 'static> HyperHandler for ServerInstance<R>
fn handle<'a, 'b>(&'a self, request: Request<'a, 'b>, writer: Response<'a>)
[src]
fn handle<'a, 'b>(&'a self, request: Request<'a, 'b>, writer: Response<'a>)
Receives a Request
/Response
pair, and should perform some action on them. Read more
fn on_connection_start(&self)
[src]
fn on_connection_start(&self)
This is run after a connection is received, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more
fn on_connection_end(&self)
[src]
fn on_connection_end(&self)
This is run before a connection is closed, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
Called when a Request includes a Expect: 100-continue
header. Read more
Auto Trait Implementations
impl<R> Send for ServerInstance<R> where
R: Send,
impl<R> Send for ServerInstance<R> where
R: Send,
impl<R> Sync for ServerInstance<R> where
R: Sync,
impl<R> Sync for ServerInstance<R> where
R: Sync,