pub struct RequestContext { /* private fields */ }Expand description
An ordered set of string key/value pairs propagated with a grain call.
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn with(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with(self, key: impl Into<String>, value: impl Into<String>) -> Self
Builder-style insert.
Sourcepub fn set(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> &mut Self
pub fn set( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> &mut Self
Insert or replace an entry.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over the entries in key order.
Sourcepub fn merged_with(&self, other: &RequestContext) -> RequestContext
pub fn merged_with(&self, other: &RequestContext) -> RequestContext
Return a new context with other’s entries overlaid on top of this
one’s. Used to apply per-call overrides over client defaults.
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§fn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RequestContext
impl Debug for RequestContext
Source§impl Default for RequestContext
impl Default for RequestContext
Source§fn default() -> RequestContext
fn default() -> RequestContext
Returns the “default value” for a type. Read more
Source§impl<K, V> FromIterator<(K, V)> for RequestContext
impl<K, V> FromIterator<(K, V)> for RequestContext
Source§impl PartialEq for RequestContext
impl PartialEq for RequestContext
Source§fn eq(&self, other: &RequestContext) -> bool
fn eq(&self, other: &RequestContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RequestContext
impl StructuralPartialEq for RequestContext
Auto Trait Implementations§
impl Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnsafeUnpin for RequestContext
impl UnwindSafe for RequestContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request