Struct happy::Server
[−]
[src]
pub struct Server { /* fields omitted */ }
Methods
impl Server
[src]
fn api<P, F, I, O>(self, path: P, f: F) -> Self where
F: Fn(RequestInfo, I) -> O + 'static + Send + Sync,
I: Deserialize<'de> + 'static,
O: Serialize + Send + 'static,
P: Into<String>,
F: Fn(RequestInfo, I) -> O + 'static + Send + Sync,
I: Deserialize<'de> + 'static,
O: Serialize + Send + 'static,
P: Into<String>,
fn result_api<P, F, I, O, E>(self, path: P, f: F) -> Self where
F: Fn(RequestInfo, I) -> Result<O, E> + 'static + Send + Sync,
I: Deserialize<'de> + 'static,
O: Serialize + Send + 'static,
E: Error + Send + 'static,
P: Into<String>,
F: Fn(RequestInfo, I) -> Result<O, E> + 'static + Send + Sync,
I: Deserialize<'de> + 'static,
O: Serialize + Send + 'static,
E: Error + Send + 'static,
P: Into<String>,
fn async_api<P, FT, F, I, O, E>(self, path: P, f: F) -> Self where
F: Fn(RequestInfo, I) -> FT + 'static + Send + Sync,
FT: Future<Item = O, Error = E> + Send + 'static,
I: Deserialize<'de> + 'static,
O: Serialize + 'static,
E: Error + Send + 'static,
P: Into<String>,
F: Fn(RequestInfo, I) -> FT + 'static + Send + Sync,
FT: Future<Item = O, Error = E> + Send + 'static,
I: Deserialize<'de> + 'static,
O: Serialize + 'static,
E: Error + Send + 'static,
P: Into<String>,
fn custom<P, F>(self, path: P, f: F) -> Self where
P: Into<String>,
F: Fn(Request) -> BoxFuture<Response, ErrorKind> + Send + Sync + 'static,
P: Into<String>,
F: Fn(Request) -> BoxFuture<Response, ErrorKind> + Send + Sync + 'static,
fn static_dir<S: Into<String>>(self, path: S) -> Self
fn port(self, port: usize) -> Self
fn address<S: Into<String>>(self, addr: S) -> Self
fn run(self)
Trait Implementations
impl Clone for Server
[src]
fn clone(&self) -> Server
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more