pub struct Event {
pub id: String,
pub data: EventData,
pub timestamp: i64,
pub tracking_id: String,
pub alert_type: Option<AlertType>,
pub headers: HashMap<String, String>,
pub sequence_number: i64,
pub filter_message: bool,
}
Expand description
Returned from WebexEventStream::next()
. Contains information about the received event.
Fields§
§id: String
Event ID, may be UUID or base64-encoded. Please do not use this directly, prefer to use
Event::get_global_id()
.
data: EventData
§timestamp: i64
Timestamp in milliseconds since epoch.
tracking_id: String
§alert_type: Option<AlertType>
§headers: HashMap<String, String>
§sequence_number: i64
§filter_message: bool
Implementations§
Source§impl Event
impl Event
Sourcepub fn activity_type(&self) -> ActivityType
pub fn activity_type(&self) -> ActivityType
Get the type of resource the event corresponds to.
Also contains details about the event action for some event types.
For more details, check ActivityType
.
§Panics
Will panic if conversation activity is not set
Sourcepub fn get_global_id(&self) -> GlobalId
👎Deprecated since 0.10.0: please use try_global_id
instead
pub fn get_global_id(&self) -> GlobalId
try_global_id
insteadExtract a global ID from an activity.
§Panics
Will panic if the event is malformed and a global ID cannot be obtained.
Sourcepub fn try_global_id(&self) -> Result<GlobalId, Error>
pub fn try_global_id(&self) -> Result<GlobalId, Error>
Extract a global ID from an activity.
event.data.activity.id
is a UUID, which can no longer be used for API requests, meaning any attempt
at using this as an ID in a Webex::get_*
will fail.
Users should use this function to get a GlobalId
, which works with the updated API.
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>,
impl Eq for Event
impl StructuralPartialEq for Event
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§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.