pub struct ResponseMetadataSlot(/* private fields */);Expand description
Thread-safe slot for sharing ResponseMetadata between transport and error layers.
The broker creates a fresh slot for each token request and reads the captured
metadata immediately after oauth2 resolves. Transport implementations borrow
the slot just long enough to call store and must
keep ownership with the broker.
Implementations§
Source§impl ResponseMetadataSlot
impl ResponseMetadataSlot
Sourcepub fn store(&self, meta: ResponseMetadata)
pub fn store(&self, meta: ResponseMetadata)
Stores new metadata for the current request.
Sourcepub fn take(&self) -> Option<ResponseMetadata>
pub fn take(&self) -> Option<ResponseMetadata>
Returns the captured metadata, if any, consuming it from the slot.
Custom HTTP clients should invoke this helper before performing a request to ensure traces from prior attempts never leak into the new invocation.
Trait Implementations§
Source§impl Clone for ResponseMetadataSlot
impl Clone for ResponseMetadataSlot
Source§fn clone(&self) -> ResponseMetadataSlot
fn clone(&self) -> ResponseMetadataSlot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseMetadataSlot
impl Debug for ResponseMetadataSlot
Source§impl Default for ResponseMetadataSlot
impl Default for ResponseMetadataSlot
Source§fn default() -> ResponseMetadataSlot
fn default() -> ResponseMetadataSlot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResponseMetadataSlot
impl !RefUnwindSafe for ResponseMetadataSlot
impl Send for ResponseMetadataSlot
impl Sync for ResponseMetadataSlot
impl Unpin for ResponseMetadataSlot
impl !UnwindSafe for ResponseMetadataSlot
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