[−][src]Struct exonum::api::With
API endpoint handler extractor which can extract handler from various entities. The basic idea of this structure is to extract type parameters from the given handler, thus, it becomes possible to distinguish different types of closures in compile time.
For example for handler with signature:
Fn(state: &ServiceApiState, query: MyQuery) -> Result<MyResponse, api::Error>
Extracted types are:
Q
isMyQuery
, i.e. type of query.I
isMyResponse
, i.e. type of response item.R
isResult<I, api::Error>
, i.e. complete type of result.
Fields
handler: F
Underlying API handler.
Trait Implementations
impl<Q, I, F> From<F> for With<Q, I, Result<I>, F> where
F: for<'r> Fn(&'r ServiceApiState, Q) -> Result<I>,
[src]
impl<Q, I, F> From<F> for With<Q, I, Result<I>, F> where
F: for<'r> Fn(&'r ServiceApiState, Q) -> Result<I>,
impl<Q, I, F> From<F> for With<Q, I, FutureResult<I>, F> where
F: for<'r> Fn(&'r ServiceApiState, Q) -> FutureResult<I>,
[src]
impl<Q, I, F> From<F> for With<Q, I, FutureResult<I>, F> where
F: for<'r> Fn(&'r ServiceApiState, Q) -> FutureResult<I>,
impl<Q: Debug, I: Debug, R: Debug, F: Debug> Debug for With<Q, I, R, F>
[src]
impl<Q: Debug, I: Debug, R: Debug, F: Debug> Debug for With<Q, I, R, F>
Auto Trait Implementations
impl<Q, I, R, F> Send for With<Q, I, R, F> where
F: Send,
I: Send,
Q: Send,
R: Send,
impl<Q, I, R, F> Send for With<Q, I, R, F> where
F: Send,
I: Send,
Q: Send,
R: Send,
impl<Q, I, R, F> Sync for With<Q, I, R, F> where
F: Sync,
I: Sync,
Q: Sync,
R: Sync,
impl<Q, I, R, F> Sync for With<Q, I, R, F> where
F: Sync,
I: Sync,
Q: Sync,
R: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self