pub struct EventData { /* private fields */ }Expand description
A generic key/value payload attached to an event.
The Engine does not interpret payload values; listeners may attach what they need.
Implementations§
Source§impl EventData
impl EventData
Sourcepub fn insert(
&mut self,
key: impl Into<String>,
value: MetadataValue,
) -> Option<MetadataValue>
pub fn insert( &mut self, key: impl Into<String>, value: MetadataValue, ) -> Option<MetadataValue>
Inserts a value, returning the previous value if any.
Sourcepub fn remove(&mut self, key: &str) -> Option<MetadataValue>
pub fn remove(&mut self, key: &str) -> Option<MetadataValue>
Removes a key, returning its value if present.
Sourcepub fn get(&self, key: &str) -> Option<&MetadataValue>
pub fn get(&self, key: &str) -> Option<&MetadataValue>
Returns the value for a key, if present.
Sourcepub fn fields(&self) -> &BTreeMap<String, MetadataValue>
pub fn fields(&self) -> &BTreeMap<String, MetadataValue>
Returns all fields.
Trait Implementations§
impl StructuralPartialEq for EventData
Auto Trait Implementations§
impl Freeze for EventData
impl RefUnwindSafe for EventData
impl Send for EventData
impl Sync for EventData
impl Unpin for EventData
impl UnsafeUnpin for EventData
impl UnwindSafe for EventData
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