[][src]Trait tracers::runtime::ProbeArgWrapper

pub trait ProbeArgWrapper: Debug {
    type CType: ProbeArgNativeType<Self::CType> + ProbeArgNativeTypeInfo;
    fn as_c_type(&self) -> Self::CType;

    fn default_c_value() -> Self::CType { ... }
}

This trait, a companion to ProbeArgType, wraps a supported type and on demand converts it to its equivalent C type. For scalar types that are directly supported there is no overhead to this wrapping, but many more complicated types, including Rust string types, need additional logic to produce a NULL-terminated byte array.

Associated Types

Loading content...

Required methods

fn as_c_type(&self) -> Self::CType

Convert the probe argument from it's Rust type to one compatible with the native tracing library infrastructure.

Loading content...

Provided methods

fn default_c_value() -> Self::CType

This is ugly but unavoidable. The underlying C type for an Opt is the same C type as T. We will use the default value for T to indicate a value of None. That will have to be good enough.

Loading content...

Implementations on Foreign Types

impl<'a> ProbeArgWrapper for &'a CString[src]

impl<T> ProbeArgWrapper for Option<T> where
    T: ProbeArgWrapper + Debug
[src]

impl ProbeArgWrapper for i64[src]

type CType = i64

impl ProbeArgWrapper for i32[src]

type CType = i32

impl ProbeArgWrapper for u16[src]

type CType = u16

impl<'a> ProbeArgWrapper for &'a CStr[src]

impl ProbeArgWrapper for usize[src]

impl ProbeArgWrapper for i16[src]

type CType = i16

impl<T> ProbeArgWrapper for *const T[src]

impl ProbeArgWrapper for bool[src]

impl ProbeArgWrapper for isize[src]

impl<'a> ProbeArgWrapper for Option<CString>[src]

impl ProbeArgWrapper for i8[src]

type CType = i8

impl ProbeArgWrapper for u32[src]

type CType = u32

impl ProbeArgWrapper for u64[src]

type CType = u64

impl ProbeArgWrapper for u8[src]

type CType = u8

Loading content...

Implementors

Loading content...