pub struct EventLine {
pub kind: String,
pub timestamp: Option<String>,
pub data: Option<Value>,
pub payload: Option<Value>,
pub extra: HashMap<String, Value>,
}Expand description
One line of events.jsonl.
The payload location is uncertain (see module docs), so we keep data
and payload separately and flatten everything else into extra. Use
EventLine::payload to get the effective payload regardless of where
it landed.
Fields§
§kind: String§timestamp: Option<String>§data: Option<Value>§payload: Option<Value>§extra: HashMap<String, Value>Anything else on the line (e.g. an inline payload whose keys sit directly on the envelope, or fields we don’t model yet).
Implementations§
Source§impl EventLine
impl EventLine
Sourcepub fn payload(&self) -> Value
pub fn payload(&self) -> Value
The effective payload, regardless of where it was carried.
Priority: data, then payload, then an object synthesized from the
inline extra keys.
pub fn parsed_timestamp(&self) -> Option<DateTime<Utc>>
Sourcepub fn event(&self) -> CopilotEvent
pub fn event(&self) -> CopilotEvent
Classify this line into a CopilotEvent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventLine
impl<'de> Deserialize<'de> for EventLine
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 EventLine
impl RefUnwindSafe for EventLine
impl Send for EventLine
impl Sync for EventLine
impl Unpin for EventLine
impl UnsafeUnpin for EventLine
impl UnwindSafe for EventLine
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