pub struct RawEvent {
pub event: Option<String>,
pub transaction_id: Option<String>,
pub identifier: Option<String>,
pub guid: Option<String>,
pub data: Option<Value>,
pub error: Option<String>,
pub process: Option<String>,
pub extra: HashMap<String, Value>,
}Expand description
A raw event received from the helper dylib over TCP.
Fields§
§event: Option<String>Event type (e.g., “ping”, “started-typing”, “facetime-call-status-changed”)
transaction_id: Option<String>Transaction ID (present if this is a response to an outgoing action)
identifier: Option<String>Message/entity identifier returned in transaction responses
guid: Option<String>Chat GUID (for typing events, etc.)
data: Option<Value>Event data payload
error: Option<String>Error message (for failed transactions)
process: Option<String>Process bundle identifier (for ping events)
extra: HashMap<String, Value>Extra fields not covered above (e.g. “url”, “silenced”, “available”). The dylib often puts response data as top-level keys rather than inside a “data” wrapper. This captures those fields so we can merge them into the transaction result.
Implementations§
Source§impl RawEvent
impl RawEvent
Sourcepub fn is_transaction_response(&self) -> bool
pub fn is_transaction_response(&self) -> bool
Check if this is a transaction response (has transactionId).
Sourcepub fn extract_data(&self) -> Option<Value>
pub fn extract_data(&self) -> Option<Value>
Extract the response data.
The dylib puts data in one of two shapes:
{"transactionId": "…", "data": { … }}— explicitdatawrapper{"transactionId": "…", "url": "…"}— top-level fields
If an explicit data field exists, use it. Otherwise collect all extra
fields (those not consumed by named struct fields) into a JSON object.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawEvent
impl<'de> Deserialize<'de> for RawEvent
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>,
Auto Trait Implementations§
impl Freeze for RawEvent
impl RefUnwindSafe for RawEvent
impl Send for RawEvent
impl Sync for RawEvent
impl Unpin for RawEvent
impl UnsafeUnpin for RawEvent
impl UnwindSafe for RawEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more