pub struct Event<'a, 'ser> { /* private fields */ }
Expand description
A wrapper struct for Falco events that implements Serialize
.
§Example
ⓘ
// Take an arbitrary Falco event
let event: falco_event_schema::events::Event<falco_event_schema::events::types::AnyEvent> = todo!();
// Wrap a reference to it for serialization
let serializable_event = falco_event_serde::ser::Event::from(&event);
// Serialize the event to a JSON string
let json = serde_json::to_string(&serializable_event).unwrap();
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'ser> Freeze for Event<'a, 'ser>
impl<'a, 'ser> RefUnwindSafe for Event<'a, 'ser>
impl<'a, 'ser> Send for Event<'a, 'ser>
impl<'a, 'ser> Sync for Event<'a, 'ser>
impl<'a, 'ser> Unpin for Event<'a, 'ser>
impl<'a, 'ser> UnwindSafe for Event<'a, 'ser>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more