Struct Oneshot

pub struct Oneshot<S: Service<Req>, Req> { /* private fields */ }

A Future consuming a Service and request, waiting until the Service is ready, and then calling Service::call with the request, and waiting for that Future.

Implementations

impl<S, Req> Oneshot<S, Req> where S: Service<Req>,

const fn new(svc: S, req: Req) -> Self

Trait Implementations

impl<'__pin, S: Service<Req>, Req> Unpin for Oneshot<S, Req> where PinnedFieldsOf<__Origin<'__pin, S, Req>>: Unpin,

impl<S, Req> Future for Oneshot<S, Req> where S: Service<Req>,

type Output = Result<<S as Service<Req>>::Response, <S as Service<Req>>::Error>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

impl<S: Debug + Service<Req>, Req: Debug> Debug for Oneshot<S, Req>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<S, Req> Freeze for Oneshot<S, Req> where State<S, Req>: Freeze,

impl<S, Req> RefUnwindSafe for Oneshot<S, Req> where State<S, Req>: RefUnwindSafe,

impl<S, Req> Send for Oneshot<S, Req> where State<S, Req>: Send,

impl<S, Req> Sync for Oneshot<S, Req> where State<S, Req>: Sync,

impl<S, Req> UnsafeUnpin for Oneshot<S, Req> where State<S, Req>: UnsafeUnpin,

impl<S, Req> UnwindSafe for Oneshot<S, Req> where State<S, Req>: UnwindSafe,

Blanket Implementations

impl<F> IntoFuture for Oneshot<S, Req> where F: Future,

type Output = <F as Future>::Output;
type IntoFuture = F;
fn into_future(self) -> <F as IntoFuture>::IntoFuture

impl<F, T, E> TryFuture for Oneshot<S, Req> where F: Future<Output = Result<T, E>> + ?Sized,

type Ok = T;
type Error = E;
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>

impl<Fut> TryFutureExt for Oneshot<S, Req> where Fut: TryFuture + ?Sized,

impl<T> Any for Oneshot<S, Req> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Oneshot<S, Req> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Oneshot<S, Req> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Oneshot<S, Req>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FutureExt for Oneshot<S, Req> where T: Future + ?Sized,

impl<T> FutureExt for Oneshot<S, Req> where T: Future + ?Sized,

impl<T> Instrument for Oneshot<S, Req>

impl<T> WithSubscriber for Oneshot<S, Req>

impl<T, U> Into<U> for Oneshot<S, Req> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Oneshot<S, Req> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for Oneshot<S, Req> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>