pub struct Request<'a, Req, Res = ()> { /* private fields */ }
Expand description
This struct encapsulates the parameters for a request to a service.
Implementations§
Source§impl<'a, Req, Res> Request<'a, Req, Res>
impl<'a, Req, Res> Request<'a, Req, Res>
pub fn header(self, key: String, value: String) -> Self
Sourcepub fn idempotency_key(self, idempotency_key: impl Into<String>) -> Self
pub fn idempotency_key(self, idempotency_key: impl Into<String>) -> Self
Add idempotency key to the request
Sourcepub fn call(self) -> impl CallFuture<Response = Res> + Sendwhere
Req: Serialize + 'static,
Res: Deserialize + 'static,
pub fn call(self) -> impl CallFuture<Response = Res> + Sendwhere
Req: Serialize + 'static,
Res: Deserialize + 'static,
Call a service. This returns a future encapsulating the response.
Sourcepub fn send(self) -> impl InvocationHandlewhere
Req: Serialize + 'static,
pub fn send(self) -> impl InvocationHandlewhere
Req: Serialize + 'static,
Send the request to the service, without waiting for the response.
Sourcepub fn send_after(self, delay: Duration) -> impl InvocationHandlewhere
Req: Serialize + 'static,
pub fn send_after(self, delay: Duration) -> impl InvocationHandlewhere
Req: Serialize + 'static,
Schedule the request to the service, without waiting for the response.
Auto Trait Implementations§
impl<'a, Req, Res> Freeze for Request<'a, Req, Res>where
Req: Freeze,
impl<'a, Req, Res> RefUnwindSafe for Request<'a, Req, Res>where
Req: RefUnwindSafe,
Res: RefUnwindSafe,
impl<'a, Req, Res> Send for Request<'a, Req, Res>
impl<'a, Req, Res> Sync for Request<'a, Req, Res>
impl<'a, Req, Res> Unpin for Request<'a, Req, Res>
impl<'a, Req, Res> UnwindSafe for Request<'a, Req, Res>where
Req: UnwindSafe,
Res: 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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