[][src]Struct opentracingrust::ImplContextBox

pub struct ImplContextBox<T: Any + Clone + Send + SpanReferenceAware> { /* fields omitted */ }

Utility structure to create ImplContexts.

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]

Auto Trait Implementations

impl<T> RefUnwindSafe for ImplContextBox<T> where
    T: RefUnwindSafe

impl<T> Send for ImplContextBox<T>

impl<T> Sync for ImplContextBox<T> where
    T: Sync

impl<T> Unpin for ImplContextBox<T> where
    T: Unpin

impl<T> UnwindSafe for ImplContextBox<T> where
    T: UnwindSafe

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<T> 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>,