[−][src]Struct win_etw_provider::EventDataDescriptor
Contains a reference to the data for an event field. The type of the data is not specified in
this structure; instead, the type of the data is stored in the event's metadata.
(See win_etw_metadata::InFlag
.)
The data that this type points to must have a well-defined (stable) byte representation. For
example, u32
has a well-defined byte representation, as long as there is agreement about
whether the value is stored in big-endian or little-endian order. Similarly, [u8]
and
[u32]
have well-defined byte representations. However, types such as [bool]
do not have a
stable byte representation, and so EventDataDescriptor
cannot point to &[bool]
.
This type provides implementations of From
that can be used to point to event data.
All of the EventDataDescriptor::From
implementations for types require that the types have a
stable, guaranteed byte representation, and that is legal (meaningful) to read that byte
representation.
This type is equivalent to the Win32 structure EVENT_DATA_DESCRIPTOR
, and its representation
is guaranteed to be equivalent.
Implementation warning!
This code is responsible for ensuring memory safety. Even though it contains only simple
primitives, these primitives are actually native pointers and pointer bounds. This data
structure is passed to the ETW implementation, which dereferences those pointers. The Rust
type checker cannot "see" these dereferences, since they occur in non-Rust code, so the borrow
checker does not know that EventDataDescriptor
deals with memory safety. This is why the
phantom_ref
field exists, and it is crucial that this code be used and encapsulated
correctly.
For type safety to be conserved, the following invariants must be maintained:
-
The
'a
lifetime parameter ofEventDataDescriptor<'a>
must be correctly associated with the lifetime of any reference that is used to construct an instance ofEventDataDescriptor
. -
The fields of
EventDataDescriptor
must remain private. Arbitrary user code cannot be permitted to construct instances ofEventDataDescriptor
with arbitrary values for these fields. -
EventDataDescriptor
should only be used to pass to ETW functions.
Implementations
impl EventDataDescriptor<'static>
[src]
pub fn empty() -> Self
[src]
Returns an empty data descriptor.
pub fn for_provider_metadata(s: &'static [u8]) -> Self
[src]
Creates an EventDataDescriptor
for provider metadata.
Provider metadata is required to have 'static
lifetime.
pub fn for_event_metadata(s: &'static [u8]) -> Self
[src]
Creates an EventDataDescriptor
for the metadata that describes a single event.
Event metadata is required to have 'static
lifetime.
impl<'a> EventDataDescriptor<'a>
[src]
Trait Implementations
impl<'a> Clone for EventDataDescriptor<'a>
[src]
fn clone(&self) -> EventDataDescriptor<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> From<&'a [bool]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [f32]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [f64]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [i16]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [i32]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [i64]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [i8]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [isize]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [u16]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [u32]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [u64]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [u8]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a [usize]> for EventDataDescriptor<'a>
[src]
impl<'a> From<&'a GUID> for EventDataDescriptor<'a>
[src]
fn from(value: &'a GUID) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a UCStr<u16>> for EventDataDescriptor<'a>
[src]
fn from(value: &'a U16CStr) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a bool> for EventDataDescriptor<'a>
[src]
fn from(value: &'a bool) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a f32> for EventDataDescriptor<'a>
[src]
fn from(value: &'a f32) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a f64> for EventDataDescriptor<'a>
[src]
fn from(value: &'a f64) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a i16> for EventDataDescriptor<'a>
[src]
fn from(value: &'a i16) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a i32> for EventDataDescriptor<'a>
[src]
fn from(value: &'a i32) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a i64> for EventDataDescriptor<'a>
[src]
fn from(value: &'a i64) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a i8> for EventDataDescriptor<'a>
[src]
fn from(value: &'a i8) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a isize> for EventDataDescriptor<'a>
[src]
fn from(value: &'a isize) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a str> for EventDataDescriptor<'a>
[src]
fn from(value: &'a str) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a u16> for EventDataDescriptor<'a>
[src]
fn from(value: &'a u16) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a u32> for EventDataDescriptor<'a>
[src]
fn from(value: &'a u32) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a u64> for EventDataDescriptor<'a>
[src]
fn from(value: &'a u64) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a u8> for EventDataDescriptor<'a>
[src]
fn from(value: &'a u8) -> EventDataDescriptor<'a>
[src]
impl<'a> From<&'a usize> for EventDataDescriptor<'a>
[src]
fn from(value: &'a usize) -> EventDataDescriptor<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for EventDataDescriptor<'a>
impl<'a> Send for EventDataDescriptor<'a>
impl<'a> Sync for EventDataDescriptor<'a>
impl<'a> Unpin for EventDataDescriptor<'a>
impl<'a> UnwindSafe for EventDataDescriptor<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,