[][src]Struct tari_service_framework::LazyService

#[must_use = "futures do nothing unless you `.await` or poll them"]pub struct LazyService<TFn, F, S> { /* fields omitted */ }

LazyService

Implements the tower_service::Service trait. The poll_ready function will poll the given future. Once that future is ready, the resulting value is passed into the given service_fn function which must return a service. Subsequent calls to poll_ready and call are delegated to that service.

This is instantiated by the lazy_service combinator in ServiceHandlesFuture.

Implementations

impl<TFn, F, S> LazyService<TFn, F, S>[src]

pub fn new(future: F, service_fn: TFn) -> Self[src]

Create a new LazyService

Trait Implementations

impl<TFn, F, S, TReq> Service<TReq> for LazyService<TFn, F, S> where
    F: Future + Unpin,
    TFn: FnOnce(F::Output) -> S,
    S: Service<TReq>, 
[src]

type Error = S::Error

Errors produced by the service.

type Future = S::Future

The future response value.

type Response = S::Response

Responses given by the service.

Auto Trait Implementations

impl<TFn, F, S> RefUnwindSafe for LazyService<TFn, F, S> where
    F: RefUnwindSafe,
    S: RefUnwindSafe,
    TFn: RefUnwindSafe

impl<TFn, F, S> Send for LazyService<TFn, F, S> where
    F: Send,
    S: Send,
    TFn: Send

impl<TFn, F, S> Sync for LazyService<TFn, F, S> where
    F: Sync,
    S: Sync,
    TFn: Sync

impl<TFn, F, S> Unpin for LazyService<TFn, F, S> where
    F: Unpin,
    S: Unpin,
    TFn: Unpin

impl<TFn, F, S> UnwindSafe for LazyService<TFn, F, S> where
    F: UnwindSafe,
    S: UnwindSafe,
    TFn: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.