Skip to main content

ClientRequest

Struct ClientRequest 

Source
pub struct ClientRequest<'call, 'state> { /* private fields */ }
Expand description

Borrowed request wrapper exposed to client middleware.

This allows middleware to add dynamic metadata while keeping the backing storage alive until the wrapped caller finishes sending the request.

Implementations§

Source§

impl<'call, 'state> ClientRequest<'call, 'state>

Source

pub fn call(&self) -> &RequestCall<'call>

Source

pub fn metadata(&self) -> &[MetadataEntry<'call>]

Source

pub fn metadata_mut(&mut self) -> &mut Metadata<'call>

Source

pub fn push_string_metadata( &mut self, key: &'static str, value: impl Into<String>, flags: MetadataFlags, )

Source

pub fn push_bytes_metadata( &mut self, key: &'static str, value: impl Into<Vec<u8>>, flags: MetadataFlags, )

Source

pub fn push_u64_metadata( &mut self, key: &'static str, value: u64, flags: MetadataFlags, )

Auto Trait Implementations§

§

impl<'call, 'state> Freeze for ClientRequest<'call, 'state>

§

impl<'call, 'state> RefUnwindSafe for ClientRequest<'call, 'state>

§

impl<'call, 'state> Send for ClientRequest<'call, 'state>

§

impl<'call, 'state> !Sync for ClientRequest<'call, 'state>

§

impl<'call, 'state> Unpin for ClientRequest<'call, 'state>

§

impl<'call, 'state> UnsafeUnpin for ClientRequest<'call, 'state>

§

impl<'call, 'state> !UnwindSafe for ClientRequest<'call, 'state>

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.
Source§

impl<T> MaybeSend for T
where T: Send,