falco_event::events

Struct RawEvent

source
pub struct RawEvent<'a> {
    pub metadata: EventMetadata,
    pub len: u32,
    pub event_type: u16,
    pub nparams: u32,
    pub payload: &'a [u8],
}

Fields§

§metadata: EventMetadata§len: u32§event_type: u16§nparams: u32§payload: &'a [u8]

Implementations§

source§

impl RawEvent<'_>

source

pub fn from(buf: &[u8]) -> Result<RawEvent<'_>>

source

pub unsafe fn from_ptr<'a>(buf: *const u8) -> Result<RawEvent<'a>>

§Safety

buf must point to a complete event, i.e.

  • include the length field
  • include nparams lengths
  • have enough data bytes for all the fields (sum of lengths)
source

pub fn load<'a, T: PayloadFromBytes<'a> + EventPayload>( &'a self, ) -> Result<Event<T>, PayloadFromBytesError>

source

pub unsafe fn params<T>( &self, ) -> Result<impl Iterator<Item = Result<&[u8], FromBytesError>>, PayloadFromBytesError>

§Safety

T must correspond to the type of the length field (u16 or u32, depending on event type)

source§

impl RawEvent<'_>

source

pub fn load_any(&self) -> Result<Event<AnyEvent<'_>>, PayloadFromBytesError>

Trait Implementations§

source§

impl<'a> Debug for RawEvent<'a>

source§

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

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

impl EventToBytes for RawEvent<'_>

source§

fn write<W: Write>(&self, writer: W) -> Result<()>

Auto Trait Implementations§

§

impl<'a> Freeze for RawEvent<'a>

§

impl<'a> RefUnwindSafe for RawEvent<'a>

§

impl<'a> Send for RawEvent<'a>

§

impl<'a> Sync for RawEvent<'a>

§

impl<'a> Unpin for RawEvent<'a>

§

impl<'a> UnwindSafe for RawEvent<'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> 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>,

source§

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>,

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.