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>
impl<T, E> From<E> for ServiceReply<T, E>
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>
impl<T, E> From<Result<T, E>> for ServiceReply<T, E>
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>
impl<T, E> Reply<T, E> for ServiceReply<T, E>
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.Auto Trait Implementations§
impl<T, E> Freeze for ServiceReply<T, E>
impl<T, E> RefUnwindSafe for ServiceReply<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for ServiceReply<T, E>
impl<T, E> Sync for ServiceReply<T, E>
impl<T, E> Unpin for ServiceReply<T, E>
impl<T, E> UnwindSafe for ServiceReply<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more