pub struct Event {
pub data: Value,
pub metadata: Option<BTreeMap<String, Value>>,
}Expand description
Represents a structured event in the pipeline. Owned, mutable data, supports JSON-like types, typed field access, optional metadata.
Fields§
§data: ValueThe main data payload, JSON-like.
metadata: Option<BTreeMap<String, Value>>Optional metadata associated with the event.
Implementations§
Source§impl Event
impl Event
Sourcepub fn from_raw_input(input: &str) -> Result<Self>
pub fn from_raw_input(input: &str) -> Result<Self>
Create a new event from raw input (assuming JSON for now).
Sourcepub fn get_string(&self, key: &str) -> Option<&str>
pub fn get_string(&self, key: &str) -> Option<&str>
Typed field access for strings.
Sourcepub fn get_number(&self, key: &str) -> Option<f64>
pub fn get_number(&self, key: &str) -> Option<f64>
Typed field access for numbers.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)