Skip to main content

EventData

Struct EventData 

Source
pub struct EventData<'a> {
    pub path: EventPath,
    pub number: u64,
    pub priority: u8,
    pub timestamp: EventTimestamp,
    pub data: &'a [u8],
}
Expand description

EventDataIB (§10.6.9).

§The timestamp is a choice of four, and exactly one is present

§10.6.9’s schema wraps tags 3 to 6 in a one-of, and the two delta forms say so twice over: “When this tag is present, all other timestamp tags SHALL be omitted.” A record therefore carries an absolute epoch time, an absolute system time, or a delta against the previous record in the same report — never two of them, and never none.

The delta forms exist because a burst of events reported together differ by milliseconds: §7.14.1.2 requires a timestamp on every record “at the time it was created (and not when it is reported to a client)”, and encoding forty of them as full 64-bit values is forty times eight octets where a delta is usually one or two.

Fields§

§path: EventPath

Path [0].

§number: u64

EventNumber [1] — §7.14.1.1’s node-scoped number, “monotonically increasing for the life of the node”, preserved across restarts.

§priority: u8

Priority [2].

§timestamp: EventTimestamp

The timestamp, in one of §10.6.9’s four forms.

§data: &'a [u8]

Data [7] — the encoded TLV element, tag included, exactly as the cluster wrote it.

§10.6.9.3: “If the cluster does not define any payload for the given event instance, this Data field SHALL be encoded as a struct with no member elements” — an empty structure, not an absent field.

Implementations§

Source§

impl<'a> EventData<'a>

Source

pub fn encode(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()>

Writes the block as a Structure under tag.

Source

pub fn decode(reader: &mut TlvReader<'a>) -> Result<Self>

Reads a block whose opening Structure element the caller has just taken.

Trait Implementations§

Source§

impl<'a> Clone for EventData<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for EventData<'a>

Source§

impl<'a> Debug for EventData<'a>

Source§

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

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

impl<'a> Eq for EventData<'a>

Source§

impl<'a> PartialEq for EventData<'a>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for EventData<'a>

Auto Trait Implementations§

§

impl<'a> Forget for EventData<'a>

§

impl<'a> Freeze for EventData<'a>

§

impl<'a> Move for EventData<'a>

§

impl<'a> RefUnwindSafe for EventData<'a>

§

impl<'a> Send for EventData<'a>

§

impl<'a> Sync for EventData<'a>

§

impl<'a> Unpin for EventData<'a>

§

impl<'a> UnsafeUnpin for EventData<'a>

§

impl<'a> UnwindSafe for EventData<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.