[−][src]Struct holochain_tracing::SpanWrap
SpanWrap is a simple way to couple some data along with a struct. It is common to send some data on a channel which will be used as arguments to a function on the receiving side, where we also want to continue the trace on the receiving side. This struct helps keep that data together with minimal boilerplate.
The use of shrinkwrap allows the entire struct to be used as if it were a bare T (in most situations), but the RjSpan can also be extracted.
Fields
data: T
span_context: Option<HSpanContext>
Methods
impl<T> SpanWrap<T>
[src]
pub fn new(data: T, span_context: Option<HSpanContext>) -> Self
[src]
pub fn follower<S: Into<Cow<'static, str>>>(
&self,
tracer: &Tracer,
operation_name: S
) -> Option<HSpan>
[src]
&self,
tracer: &Tracer,
operation_name: S
) -> Option<HSpan>
pub fn follower_or_null<S: Into<Cow<'static, str>>>(
&self,
tracer: &Tracer,
operation_name: S
) -> HSpan
[src]
&self,
tracer: &Tracer,
operation_name: S
) -> HSpan
pub fn follower_<'a, N: Into<Cow<'static, str>>, F>(
&'a self,
tracer: &Tracer,
operation_name: N,
f: F
) -> Option<HSpan> where
F: FnOnce(StartSpanOptions<BoxSampler<SpanContextState>, SpanContextState>) -> RjSpan,
[src]
&'a self,
tracer: &Tracer,
operation_name: N,
f: F
) -> Option<HSpan> where
F: FnOnce(StartSpanOptions<BoxSampler<SpanContextState>, SpanContextState>) -> RjSpan,
pub fn map<F, U>(self, f: F) -> SpanWrap<U> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
Map the data field to a new value while keeping the same span_context
Trait Implementations
impl<T> AsMut<T> for SpanWrap<T>
[src]
impl<T> AsRef<T> for SpanWrap<T>
[src]
impl<T> Borrow<T> for SpanWrap<T>
[src]
impl<T> BorrowMut<T> for SpanWrap<T>
[src]
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T: Debug> Debug for SpanWrap<T>
[src]
impl<T> Deref for SpanWrap<T>
[src]
impl<T> DerefMut for SpanWrap<T>
[src]
impl<'a, T> From<EncodedSpanWrap<T>> for SpanWrap<T> where
T: Serialize + DeserializeOwned + Clone,
[src]
T: Serialize + DeserializeOwned + Clone,
fn from(swe: EncodedSpanWrap<T>) -> Self
[src]
impl<'a, T> From<SpanWrap<T>> for EncodedSpanWrap<T> where
T: Serialize + DeserializeOwned + Clone,
[src]
T: Serialize + DeserializeOwned + Clone,
impl<T: PartialEq> PartialEq<SpanWrap<T>> for SpanWrap<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for SpanWrap<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for SpanWrap<T> where
T: Send,
T: Send,
impl<T> Sync for SpanWrap<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SpanWrap<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SpanWrap<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,