Struct measureme::RawEvent

source ·
#[repr(C)]
pub struct RawEvent { pub event_kind: StringId, pub event_id: EventId, pub thread_id: u32, pub payload1_lower: u32, pub payload2_lower: u32, pub payloads_upper: u32, }
Expand description

RawEvent is how events are stored on-disk. If you change this struct, make sure that you increment file_header::CURRENT_FILE_FORMAT_VERSION.

Fields§

§event_kind: StringId§event_id: EventId§thread_id: u32§payload1_lower: u32§payload2_lower: u32§payloads_upper: u32

Implementations§

source§

impl RawEvent

source

pub fn new_interval( event_kind: StringId, event_id: EventId, thread_id: u32, start: u64, end: u64 ) -> Self

source

pub fn new_instant( event_kind: StringId, event_id: EventId, thread_id: u32, instant: u64 ) -> Self

source

pub fn new_integer( event_kind: StringId, event_id: EventId, thread_id: u32, value: u64 ) -> Self

source

pub fn start_value(&self) -> u64

The start value assuming self is an interval

source

pub fn end_value(&self) -> u64

The end value assuming self is an interval

source

pub fn value(&self) -> u64

The value assuming self is an interval or integer.

source

pub fn is_instant(&self) -> bool

source

pub fn is_integer(&self) -> bool

source

pub fn serialize(&self, bytes: &mut [u8])

source

pub fn deserialize(bytes: &[u8]) -> RawEvent

Trait Implementations§

source§

impl Debug for RawEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RawEvent

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for RawEvent

source§

fn eq(&self, other: &RawEvent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for RawEvent

source§

impl StructuralEq for RawEvent

source§

impl StructuralPartialEq for RawEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.