pub struct Request<T> { /* private fields */ }
Expand description
A hRPC request.
Implementations
sourceimpl<T> Request<T>
impl<T> Request<T>
sourcepub fn header_map(&self) -> Option<&HeaderMap>
pub fn header_map(&self) -> Option<&HeaderMap>
Get an immutable reference to the header map.
sourcepub fn header_map_mut(&mut self) -> Option<&mut HeaderMap>
pub fn header_map_mut(&mut self) -> Option<&mut HeaderMap>
Get a mutable reference to the header map.
sourcepub fn get_or_insert_header_map(&mut self) -> &mut HeaderMap
pub fn get_or_insert_header_map(&mut self) -> &mut HeaderMap
Get a mutable reference to the header map, inserting a new one if it doesn’t already exist.
sourcepub fn http_extensions(&self) -> Option<&Extensions>
pub fn http_extensions(&self) -> Option<&Extensions>
Get an immutable reference to the HTTP extensions.
sourcepub fn http_extensions_mut(&mut self) -> Option<&mut Extensions>
pub fn http_extensions_mut(&mut self) -> Option<&mut Extensions>
Get a mutable reference to the HTTP extensions.
sourcepub fn get_or_insert_http_extensions(&mut self) -> &mut Extensions
pub fn get_or_insert_http_extensions(&mut self) -> &mut Extensions
Get a mutable reference to the HTTP extensions, inserting a new one if it doesn’t already exist.
sourceimpl<T> Request<T>
impl<T> Request<T>
sourcepub fn new_with_body(body: Body) -> Self
pub fn new_with_body(body: Body) -> Self
Creates a new request using the provided body.
sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Get a mutable reference to the extensions of this response.
sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Get an immutable reference to the extensions of this response.
sourcepub fn endpoint_mut(&mut self) -> &mut Cow<'static, str>
pub fn endpoint_mut(&mut self) -> &mut Cow<'static, str>
Get a mutable reference to the endpoint of this response.
sourceimpl<T: PbMsg + Default> Request<T>
impl<T: PbMsg + Default> Request<T>
sourcepub async fn into_message(self) -> Result<T, DecodeBodyError>
pub async fn into_message(self) -> Result<T, DecodeBodyError>
Extract the body from the request and decode it into the message.
Trait Implementations
sourceimpl<T> IntoRequest<T> for Request<T>
impl<T> IntoRequest<T> for Request<T>
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Convert this to a hRPC request.
sourceimpl Service<Request<()>> for BoxedTransport
impl Service<Request<()>> for BoxedTransport
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = TransportError<BoxedTransportError>
type Error = TransportError<BoxedTransportError>
Errors produced by the service.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, Err> Service<Request<()>> for Backoff<S> where
S: Service<BoxRequest, Error = TransportError<Err>> + Clone,
impl<S, Err> Service<Request<()>> for Backoff<S> where
S: Service<BoxRequest, Error = TransportError<Err>> + Clone,
type Future = BackoffFuture<Err, S>
type Future = BackoffFuture<Err, S>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Service<Request<()>> for Trace<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
S: Service<BoxRequest, Response = BoxResponse>,
SpanFn: Fn(&BoxRequest) -> Span,
OnRequestFn: Fn(&BoxRequest, &Span),
OnSuccessFn: Fn(&BoxResponse, &Span) + Clone,
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError) + Clone,
impl<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Service<Request<()>> for Trace<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
S: Service<BoxRequest, Response = BoxResponse>,
SpanFn: Fn(&BoxRequest) -> Span,
OnRequestFn: Fn(&BoxRequest, &Span),
OnSuccessFn: Fn(&BoxResponse, &Span) + Clone,
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError) + Clone,
type Future = TraceFuture<S::Future, OnSuccessFn, OnErrorFn>
type Future = TraceFuture<S::Future, OnSuccessFn, OnErrorFn>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl Service<Request<()>> for Hyper
impl Service<Request<()>> for Hyper
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = TransportError<HyperError>
type Error = TransportError<HyperError>
Errors produced by the service.
type Future = HyperCallFuture
type Future = HyperCallFuture
The future response value.
sourcefn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl Service<Request<()>> for Wasm
impl Service<Request<()>> for Wasm
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = TransportError<WasmError>
type Error = TransportError<WasmError>
Errors produced by the service.
type Future = CallFuture
type Future = CallFuture
The future response value.
sourcefn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl Service<Request<()>> for Mock
impl Service<Request<()>> for Mock
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = TransportError<MockError>
type Error = TransportError<MockError>
Errors produced by the service.
type Future = MockCallFuture
type Future = MockCallFuture
The future response value.
sourcefn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, ExtractKey, BypassForKey, Key> Service<Request<()>> for RateLimit<S, ExtractKey, BypassForKey, Key> where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible>,
ExtractKey: Fn(&mut BoxRequest) -> Option<Key>,
BypassForKey: Fn(&Key) -> bool,
Key: Eq + Hash,
impl<S, ExtractKey, BypassForKey, Key> Service<Request<()>> for RateLimit<S, ExtractKey, BypassForKey, Key> where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible>,
ExtractKey: Fn(&mut BoxRequest) -> Option<Key>,
BypassForKey: Fn(&Key) -> bool,
Key: Eq + Hash,
type Future = RateLimitFuture<S::Future>
type Future = RateLimitFuture<S::Future>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, request: BoxRequest) -> Self::Future
fn call(&mut self, request: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl Service<Request<()>> for RoutesFinalized
impl Service<Request<()>> for RoutesFinalized
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = BoxFuture<'static, Result<BoxResponse, Infallible>>
type Future = BoxFuture<'static, Result<BoxResponse, Infallible>>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl Service<Request<()>> for HrpcService
impl Service<Request<()>> for HrpcService
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = BoxFuture<'static, Result<BoxResponse, Infallible>>
type Future = BoxFuture<'static, Result<BoxResponse, Infallible>>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl<ToStatus, S> Service<Request<()>> for ErrorIdentifierToStatus<ToStatus, S> where
S: Service<BoxRequest, Response = BoxResponse>,
ToStatus: Fn(&str) -> Option<StatusCode> + Clone,
impl<ToStatus, S> Service<Request<()>> for ErrorIdentifierToStatus<ToStatus, S> where
S: Service<BoxRequest, Response = BoxResponse>,
ToStatus: Fn(&str) -> Option<StatusCode> + Clone,
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Future = ErrorIdentifierToStatusFuture<ToStatus, S::Future>
type Future = ErrorIdentifierToStatusFuture<ToStatus, S::Future>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
sourceimpl<ModifyReq, ModifyResp, S> Service<Request<()>> for Modify<ModifyReq, ModifyResp, S> where
S: Service<BoxRequest, Response = BoxResponse>,
ModifyReq: Fn(&mut BoxRequest),
ModifyResp: Fn(&mut BoxResponse) + Clone,
impl<ModifyReq, ModifyResp, S> Service<Request<()>> for Modify<ModifyReq, ModifyResp, S> where
S: Service<BoxRequest, Response = BoxResponse>,
ModifyReq: Fn(&mut BoxRequest),
ModifyResp: Fn(&mut BoxResponse) + Clone,
type Response = BoxResponse
type Response = BoxResponse
Responses given by the service.
type Future = ModifyFuture<ModifyResp, S::Future>
type Future = ModifyFuture<ModifyResp, S::Future>
The future response value.
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
sourcefn call(&mut self, req: BoxRequest) -> Self::Future
fn call(&mut self, req: BoxRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for Request<T>
impl<T> Send for Request<T> where
T: Send,
impl<T> Sync for Request<T> where
T: Sync,
impl<T> Unpin for Request<T> where
T: Unpin,
impl<T> !UnwindSafe for Request<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more