Enum serv::reply::ServiceReply
source · pub enum ServiceReply<T: Serialize, E> {
Ok {
result: T,
},
Err {
reason: String,
msg: Option<String>,
_e: E,
},
}
Variants§
Trait Implementations§
source§impl<T, E> From<E> for ServiceReply<T, E>where
T: Serialize,
E: Debug + Error,
impl<T, E> From<E> for ServiceReply<T, E>where
T: Serialize,
E: Debug + Error,
source§fn from(e: E) -> ServiceReply<T, E>
fn from(e: E) -> ServiceReply<T, E>
Converts to this type from the input type.
source§impl<T, E> From<Result<T, E>> for ServiceReply<T, E>where
T: Serialize,
E: Debug + Error,
impl<T, E> From<Result<T, E>> for ServiceReply<T, E>where
T: Serialize,
E: Debug + Error,
source§fn from(res: Result<T, E>) -> ServiceReply<T, E>
fn from(res: Result<T, E>) -> ServiceReply<T, E>
Converts to this type from the input type.
source§impl<T, E> Reply<T, E> for ServiceReply<T, E>where
T: Serialize + 'static,
E: From<Error> + Debug + Error + 'static,
impl<T, E> Reply<T, E> for ServiceReply<T, E>where
T: Serialize + 'static,
E: From<Error> + Debug + Error + 'static,
source§fn reply(&self, status: StatusCode) -> HyperFuture
fn reply(&self, status: StatusCode) -> HyperFuture
write reply body
source§fn serv_state<F, S, Req>(state: S, f: F) -> HyperServicewhere
Self: 'static,
F: for<'a> Fn(&'a S, Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
S: 'static,
Req: for<'de> Deserialize<'de> + 'static,
fn serv_state<F, S, Req>(state: S, f: F) -> HyperServicewhere
Self: 'static,
F: for<'a> Fn(&'a S, Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
S: 'static,
Req: for<'de> Deserialize<'de> + 'static,
serv_state
build HyperService
with given function F
and state S
.source§fn serv<F, Req>(f: F) -> HyperServicewhere
Self: 'static,
F: Fn(Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
Req: for<'de> Deserialize<'de> + 'static,
fn serv<F, Req>(f: F) -> HyperServicewhere
Self: 'static,
F: Fn(Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
Req: for<'de> Deserialize<'de> + 'static,
service
builds HyperService
with given function F
.source§fn serv_state_sync<F, S, Req>(state: S, f: F) -> HyperServicewhere
Self: 'static,
F: for<'a> Fn(&'a S, Req) -> Result<T, E> + 'static,
S: 'static,
Req: for<'de> Deserialize<'de> + 'static,
fn serv_state_sync<F, S, Req>(state: S, f: F) -> HyperServicewhere
Self: 'static,
F: for<'a> Fn(&'a S, Req) -> Result<T, E> + 'static,
S: 'static,
Req: for<'de> Deserialize<'de> + 'static,
serv_state
builds HyperService
with given function F
and state S
.source§fn serv_sync<F, Req>(f: F) -> HyperServicewhere
Self: 'static,
F: Fn(Req) -> Result<T, E> + 'static,
Req: for<'de> Deserialize<'de> + 'static,
fn serv_sync<F, Req>(f: F) -> HyperServicewhere
Self: 'static,
F: Fn(Req) -> Result<T, E> + 'static,
Req: for<'de> Deserialize<'de> + 'static,
serv
build HyperService
with given function F
.