[][src]Trait tracers_core::argtypes::ProbeArgWrapper

pub trait ProbeArgWrapper: Debug where
    Self::CType: ProbeArgNativeType<Self::CType>, 
{ type 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 ProbeArgWrapper for bool[src]

type CType = i32

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

type CType = *const c_char

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

type CType = *const c_char

impl ProbeArgWrapper for usize[src]

type CType = size_t

impl ProbeArgWrapper for isize[src]

type CType = ssize_t

impl ProbeArgWrapper for u64[src]

type CType = c_ulonglong

impl ProbeArgWrapper for i64[src]

type CType = c_longlong

impl ProbeArgWrapper for u32[src]

type CType = c_uint

impl ProbeArgWrapper for i32[src]

type CType = c_int

impl ProbeArgWrapper for u16[src]

type CType = c_ushort

impl ProbeArgWrapper for i16[src]

type CType = c_short

impl ProbeArgWrapper for u8[src]

type CType = c_uchar

impl ProbeArgWrapper for i8[src]

type CType = c_char

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

type CType = <T as ProbeArgWrapper>::CType

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

type CType = *const c_void

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

type CType = *const c_char

Loading content...

Implementors

Loading content...