Struct google_cloud_gax::grpc::Extensions
source · pub struct Extensions { /* private fields */ }Expand description
A type map of protocol extensions.
Extensions can be used by Interceptor and Request to store extra data derived from
the underlying protocol.
Implementations
sourceimpl Extensions
impl Extensions
sourcepub fn insert<T>(&mut self, val: T) -> Option<T>where
T: 'static + Send + Sync,
pub fn insert<T>(&mut self, val: T) -> Option<T>where
T: 'static + Send + Sync,
Insert a type into this Extensions.
If a extension of this type already existed, it will be returned.
sourcepub fn get<T>(&self) -> Option<&T>where
T: 'static + Send + Sync,
pub fn get<T>(&self) -> Option<&T>where
T: 'static + Send + Sync,
Get a reference to a type previously inserted on this Extensions.
sourcepub fn get_mut<T>(&mut self) -> Option<&mut T>where
T: 'static + Send + Sync,
pub fn get_mut<T>(&mut self) -> Option<&mut T>where
T: 'static + Send + Sync,
Get a mutable reference to a type previously inserted on this Extensions.
sourcepub fn remove<T>(&mut self) -> Option<T>where
T: 'static + Send + Sync,
pub fn remove<T>(&mut self) -> Option<T>where
T: 'static + Send + Sync,
Remove a type from this Extensions.
If a extension of this type existed, it will be returned.
sourcepub fn into_http(self) -> Extensions
pub fn into_http(self) -> Extensions
Convert to http::Extensions and consume self.
Trait Implementations
sourceimpl Debug for Extensions
impl Debug for Extensions
sourceimpl Default for Extensions
impl Default for Extensions
sourcefn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl !UnwindSafe for Extensions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request