pub struct CustomStreamEvent {
pub base: BaseStreamEvent,
pub name: String,
pub data: Value,
}Expand description
Custom stream event created by the user.
Fields§
§base: BaseStreamEventThe base event fields.
name: StringUser defined name for the event.
data: ValueThe data associated with the event. Free form and can be anything.
Implementations§
Source§impl CustomStreamEvent
impl CustomStreamEvent
Sourcepub fn new(
run_id: impl Into<String>,
name: impl Into<String>,
data: Value,
) -> Self
pub fn new( run_id: impl Into<String>, name: impl Into<String>, data: Value, ) -> Self
Create a new CustomStreamEvent.
The event type is automatically set to “on_custom_event”.
Set the tags for this event.
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
Set the metadata for this event.
Sourcepub fn with_parent_ids(self, parent_ids: Vec<String>) -> Self
pub fn with_parent_ids(self, parent_ids: Vec<String>) -> Self
Set the parent IDs for this event.
Trait Implementations§
Source§impl Clone for CustomStreamEvent
impl Clone for CustomStreamEvent
Source§fn clone(&self) -> CustomStreamEvent
fn clone(&self) -> CustomStreamEvent
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 CustomStreamEvent
impl Debug for CustomStreamEvent
Source§impl<'de> Deserialize<'de> for CustomStreamEvent
impl<'de> Deserialize<'de> for CustomStreamEvent
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
Source§impl From<CustomStreamEvent> for StreamEvent
impl From<CustomStreamEvent> for StreamEvent
Source§fn from(event: CustomStreamEvent) -> Self
fn from(event: CustomStreamEvent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CustomStreamEvent
impl RefUnwindSafe for CustomStreamEvent
impl Send for CustomStreamEvent
impl Sync for CustomStreamEvent
impl Unpin for CustomStreamEvent
impl UnwindSafe for CustomStreamEvent
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