[−][src]Struct opentracingrust::ImplContextBox
Utility structure to create ImplContext
s.
Generic structure that creates a wrapper around structures to make them
compatible with ImplContext
trait objects.
The wrapped structure requires the following traits to be implemented:
Any
Clone
Send
SpanReferenceAware
Examples
extern crate opentracingrust; use opentracingrust::ImplContext; use opentracingrust::ImplContextBox; use opentracingrust::SpanReference; use opentracingrust::SpanReferenceAware; #[derive(Clone)] struct Context { // ... snip ... } impl SpanReferenceAware for Context { fn reference_span(&mut self, reference: &SpanReference) { // ... snip ... } } fn main() { let context: Box<ImplContext> = Box::new(ImplContextBox::new(Context{})); // ... snip ... }
Methods
impl<T: Any + Clone + Send + SpanReferenceAware> ImplContextBox<T>
[src]
pub fn new(inner: T) -> ImplContextBox<T>
[src]
Wrap a compatible value into a ImplContextBox
.
Trait Implementations
impl<T: Any + Clone + Send + SpanReferenceAware> ImplContext for ImplContextBox<T>
[src]
fn impl_context(&self) -> &dyn Any
[src]
fn clone(&self) -> Box<dyn ImplContext>
[src]
fn reference_span(&mut self, reference: &SpanReference)
[src]
Auto Trait Implementations
impl<T> Sync for ImplContextBox<T> where
T: Sync,
T: Sync,
impl<T> Send for ImplContextBox<T>
impl<T> Unpin for ImplContextBox<T> where
T: Unpin,
T: Unpin,
impl<T> RefUnwindSafe for ImplContextBox<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for ImplContextBox<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,