[−][src]Struct exonum_api::With
API endpoint handler extractor which can extract a 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. This structure allows applying anonymous functions to endpoints.
For example, for a handler with signature:
Fn(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.
actuality: Actuality
Endpoint actuality.
Trait Implementations
impl<Q: Debug, I: Debug, R: Debug, F: Debug> Debug for With<Q, I, R, F>
[src]
impl<'a, Q, I, R, F> From<Deprecated<Q, I, R, F>> for With<Q, I, R, F>
[src]
fn from(deprecated: Deprecated<Q, I, R, F>) -> Self
[src]
impl<Q, I, R, F> From<F> for With<Q, I, R, F> where
F: Fn(Q) -> R,
R: Future<Output = Result<I>>,
[src]
F: Fn(Q) -> R,
R: Future<Output = Result<I>>,
Auto Trait Implementations
impl<Q, I, R, F> RefUnwindSafe for With<Q, I, R, F> where
F: RefUnwindSafe,
I: RefUnwindSafe,
Q: RefUnwindSafe,
R: RefUnwindSafe,
F: RefUnwindSafe,
I: RefUnwindSafe,
Q: RefUnwindSafe,
R: RefUnwindSafe,
impl<Q, I, R, F> Send for With<Q, I, R, F> where
F: Send,
I: Send,
Q: Send,
R: Send,
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,
F: Sync,
I: Sync,
Q: Sync,
R: Sync,
impl<Q, I, R, F> Unpin for With<Q, I, R, F> where
F: Unpin,
I: Unpin,
Q: Unpin,
R: Unpin,
F: Unpin,
I: Unpin,
Q: Unpin,
R: Unpin,
impl<Q, I, R, F> UnwindSafe for With<Q, I, R, F> where
F: UnwindSafe,
I: UnwindSafe,
Q: UnwindSafe,
R: UnwindSafe,
F: UnwindSafe,
I: UnwindSafe,
Q: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,