pub struct MsgWrap<T> { /* private fields */ }Expand description
Wrap a channel message in a span context.
The context is automatically propagated to
the current span by calling msg_wrap.inner().
The context is automatically propagated from
the current span by calling t.into().
If you wish to avoid either of these propagations
you can use msg_wrap.without_context() and
MsgWrap::from_no_context(t) respectively.
Implementations§
Source§impl<T> MsgWrap<T>
impl<T> MsgWrap<T>
Sourcepub fn new(t: T, context: Context) -> Self
pub fn new(t: T, context: Context) -> Self
Create a T wrapped in a Context.
If you just need the current context use
t.into().
Sourcepub fn without_context(self) -> T
pub fn without_context(self) -> T
Get the inner type without propagating the context.
Sourcepub fn from_no_context(t: T) -> Self
pub fn from_no_context(t: T) -> Self
Create a wrapped T with no Context.
Sourcepub fn into_parts(self) -> (T, Context)
pub fn into_parts(self) -> (T, Context)
Unwrap the wrapped T into a T and Context.
If you just need to propagate the context to
the current span use msg_wrap.inner()
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MsgWrap<T>where
T: Freeze,
impl<T> RefUnwindSafe for MsgWrap<T>where
T: RefUnwindSafe,
impl<T> Send for MsgWrap<T>where
T: Send,
impl<T> Sync for MsgWrap<T>where
T: Sync,
impl<T> Unpin for MsgWrap<T>where
T: Unpin,
impl<T> UnwindSafe for MsgWrap<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more