pub struct CustomEvent {
pub base: BaseEvent,
pub name: String,
pub value: Value,
}Expand description
Event for custom application-specific data.
This event allows sending arbitrary named events with custom payloads.
Fields§
§base: BaseEventCommon event fields (timestamp, rawEvent).
name: StringName of the custom event.
value: ValueCustom event payload.
Implementations§
Source§impl CustomEvent
impl CustomEvent
Sourcepub fn new(name: impl Into<String>, value: Value) -> CustomEvent
pub fn new(name: impl Into<String>, value: Value) -> CustomEvent
Creates a new CustomEvent with the given name and value.
Sourcepub fn with_timestamp(self, timestamp: f64) -> CustomEvent
pub fn with_timestamp(self, timestamp: f64) -> CustomEvent
Sets the timestamp for this event.
Trait Implementations§
Source§impl Clone for CustomEvent
impl Clone for CustomEvent
Source§fn clone(&self) -> CustomEvent
fn clone(&self) -> CustomEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomEvent
impl Debug for CustomEvent
Source§impl<'de> Deserialize<'de> for CustomEvent
impl<'de> Deserialize<'de> for CustomEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CustomEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CustomEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CustomEvent
impl PartialEq for CustomEvent
Source§impl Serialize for CustomEvent
impl Serialize for CustomEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for CustomEvent
Auto Trait Implementations§
impl Freeze for CustomEvent
impl RefUnwindSafe for CustomEvent
impl Send for CustomEvent
impl Sync for CustomEvent
impl Unpin for CustomEvent
impl UnsafeUnpin for CustomEvent
impl UnwindSafe for CustomEvent
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