Skip to main content

ClientResponse

Struct ClientResponse 

Source
pub struct ClientResponse<'request, 'buffer> { /* private fields */ }
Expand description

Bounded response coupled to the prepared policy that admitted it.

Raw body access is closure-scoped. Success decoding first applies the full operation success policy. Error decoding requires a 4xx/5xx status and applies the operation request-ID policy before invoking provider code.

Implementations§

Source§

impl<'request, 'buffer> ClientResponse<'request, 'buffer>

Source

pub fn status(&self) -> Result<StatusCode, ResponseWriterError>

Returns the committed status without exposing response bytes.

Source

pub fn kind(&self) -> Result<ClientResponseKind, ResponseWriterError>

Classifies the committed status without applying a decoder.

Source

pub fn decode_success_owned<R, E>( self, decode: impl for<'response> FnOnce(CheckedResponse<'response>, &mut ResponseDecodeWorkspace) -> Result<R, E>, ) -> Result<R, CheckedDecodeError<E>>

Applies success policy, decodes an owned value, and clears all storage.

Source

pub fn decode_error_owned<R, E>( self, decode: impl for<'response> FnOnce(TransportResponse<'response, 'buffer>, &mut ResponseDecodeWorkspace) -> Result<R, E>, ) -> Result<R, CheckedDecodeError<E>>

Applies error metadata policy, decodes an owned value, and clears all storage.

Trait Implementations§

Source§

impl Debug for ClientResponse<'_, '_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'request, 'buffer> !RefUnwindSafe for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> !UnwindSafe for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> Freeze for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> Send for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> Sync for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> Unpin for ClientResponse<'request, 'buffer>

§

impl<'request, 'buffer> UnsafeUnpin for ClientResponse<'request, 'buffer>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.