Struct observability::MsgWrap[][src]

pub struct MsgWrap<T> { /* fields omitted */ }

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

impl<T> MsgWrap<T>[src]

pub fn new(t: T, context: Context) -> Self[src]

Create a T wrapped in a Context. If you just need the current context use t.into().

pub fn inner(self) -> T[src]

Get the inner type and propagate the context to the current span.

pub fn without_context(self) -> T[src]

Get the inner type without propagating the context.

pub fn from_no_context(t: T) -> Self[src]

Create a wrapped T with no Context.

pub fn into_parts(self) -> (T, Context)[src]

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

impl<T> Debug for MsgWrap<T> where
    T: Debug
[src]

impl<T> From<T> for MsgWrap<T>[src]

fn from(t: T) -> Self[src]

Create a wrapped T with the context from the current span.

Auto Trait Implementations

impl<T> !RefUnwindSafe for MsgWrap<T>[src]

impl<T> Send for MsgWrap<T> where
    T: Send
[src]

impl<T> Sync for MsgWrap<T> where
    T: Sync
[src]

impl<T> Unpin for MsgWrap<T> where
    T: Unpin
[src]

impl<T> !UnwindSafe for MsgWrap<T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,