Struct conduit_hyper::Service [−][src]
pub struct Service<H> { /* fields omitted */ }
Serve a conduit::Handler
on a thread pool
Methods
impl<H: Handler> Service<H>
[src]
impl<H: Handler> Service<H>
pub fn new(handler: H, threads: usize) -> Service<H>
[src]
pub fn new(handler: H, threads: usize) -> Service<H>
Create a multi-threaded Service
from a Handler
pub fn run(&self, addr: SocketAddr)
[src]
pub fn run(&self, addr: SocketAddr)
Run the Service
bound to a given SocketAddr
Trait Implementations
impl<H> Clone for Service<H>
[src]
impl<H> Clone for Service<H>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<H: Handler> NewService for Service<H>
[src]
impl<H: Handler> NewService for Service<H>
type ReqBody = Body
The Payload
body of the http::Request
.
type ResBody = Body
The Payload
body of the http::Response
.
type Error = Error
The error type that can be returned by Service
s.
type Service = Service<H>
The resolved Service
from new_service()
.
type Future = Box<Future<Item = Self::Service, Error = Self::InitError> + Send>
The future returned from new_service
of a Service
.
type InitError = Error
The error type that can be returned when creating a new Service
.
fn new_service(&self) -> Self::Future
[src]
fn new_service(&self) -> Self::Future
Create a new Service
.
impl<H: Handler> Service for Service<H>
[src]
impl<H: Handler> Service for Service<H>
type ReqBody = Body
The Payload
body of the http::Request
.
type ResBody = Body
The Payload
body of the http::Response
.
type Error = Error
The error type that can occur within this Service
. Read more
type Future = Box<Future<Item = Response<Self::ResBody>, Error = Self::Error> + Send>
The Future
returned by this Service
.
fn call(&mut self, request: Request<Self::ReqBody>) -> Self::Future
[src]
fn call(&mut self, request: Request<Self::ReqBody>) -> Self::Future
Returns a future which buffers the response body and then calls the conduit handler from a thread pool