pub struct Request { /* private fields */ }
Expand description

Operation request type that associates a property bag with an underlying HTTP request. This type represents the request in the Tower Service in middleware so that middleware can share information with each other via the properties.

Implementations§

source§

impl Request

source

pub fn new(inner: Request<SdkBody>) -> Self

Creates a new operation Request with the given inner HTTP request.

source

pub fn from_parts( inner: Request<SdkBody>, properties: SharedPropertyBag ) -> Self

Creates a new operation Request from its parts.

source

pub fn augment<T>( self, f: impl FnOnce(Request<SdkBody>, &mut PropertyBag) -> Result<Request<SdkBody>, T> ) -> Result<Request, T>

Allows modification of the HTTP request and associated properties with a fallible closure.

source

pub fn properties_mut(&mut self) -> impl DerefMut<Target = PropertyBag> + '_

Gives mutable access to the properties.

source

pub fn properties(&self) -> impl Deref<Target = PropertyBag> + '_

Gives readonly access to the properties.

source

pub fn http_mut(&mut self) -> &mut Request<SdkBody>

Gives mutable access to the underlying HTTP request.

source

pub fn http(&self) -> &Request<SdkBody>

Gives readonly access to the underlying HTTP request.

source

pub fn try_clone(&self) -> Option<Request>

Attempts to clone the operation Request. This can fail if the request body can’t be cloned, such as if it is being streamed and the stream can’t be recreated.

source

pub fn into_parts(self) -> (Request<SdkBody>, SharedPropertyBag)

Consumes the operation Request and returns the underlying HTTP request and properties.

Trait Implementations§

source§

impl Debug for Request

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more