[−][src]Module tracers_core::argtypes
This module and its submodules implement a type-safe wrapper around Rust types such that any suitable type can be passed as a parameter to the C probing libraries with a minimum of overhead.
In order to be able to use a type as a probe argument, that type T
must implement
ProbeArgType<T>
, and there must be an implementation of ProbeArgWrapper
suitable for that
type.
This library provides implementations for all of the following:
- All integer types from
u8/i8
tou64/i64
bool
(passed as ani32
1
meanstrue
and0
meansfalse
)- String references
&str
- C-style string references
&CStr
Option<T>
for anyT
which is itself a supported probe argument type and implementsCopy
- Any pointer type, which is passed as either a 32- or 64-bit unsigned int depending upon architecture
Re-exports
pub use self::bool::*; |
pub use cstring::*; |
pub use int::*; |
pub use native::*; |
pub use option::*; |
pub use pointer::*; |
pub use refs::*; |
pub use string::*; |
Modules
bool | |
cstring | This module provides an implementation of the arg type plumbing which passes a rust |
int | |
native | This module implements the marker trait |
option | This module implements |
pointer | |
refs | This module ensures that if |
string | This module implements ProbeArgType and ProbeArgWrapper for Rust's string types. This
implementation will be available for |
Enums
CType |
Traits
ProbeArgNativeType | The other half of |
ProbeArgNativeTypeInfo | Marker trait which decorates only those std::os::raw types which correspond to C types
supported by the C probing APIs. Due to limitations of Rust's type system, this trait is split
into two parts: |
ProbeArgType | This trait is defined on any type which is supported as an argument to a probe. |
ProbeArgWrapper | This trait, a companion to ProbeArgType |
Functions
wrap | Helper function to wrap a probe arg in its correspondong wrapper without contorting one's fingers typing angle brackets |