pub struct Baggage { /* private fields */ }Expand description
Baggage is key-value pairs that propagate across the network
Implementations§
Source§impl Baggage
impl Baggage
Sourcepub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
Insert or replace a baggage entry by key
Sourcepub fn set_with_metadata(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
metadata: impl Into<String>,
)
pub fn set_with_metadata( &mut self, key: impl Into<String>, value: impl Into<String>, metadata: impl Into<String>, )
Insert or replace a baggage entry with associated metadata properties
Sourcepub fn get_with_metadata(&self, key: &str) -> Option<(&str, Option<&str>)>
pub fn get_with_metadata(&self, key: &str) -> Option<(&str, Option<&str>)>
Look up a baggage value and its optional metadata by key
Sourcepub fn remove(&mut self, key: &str) -> Option<String>
pub fn remove(&mut self, key: &str) -> Option<String>
Remove a baggage entry by key and return its value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Baggage
impl<'de> Deserialize<'de> for Baggage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Baggage
impl RefUnwindSafe for Baggage
impl Send for Baggage
impl Sync for Baggage
impl Unpin for Baggage
impl UnsafeUnpin for Baggage
impl UnwindSafe for Baggage
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