pub fn metadata_as_json<P>(self, payload: P) -> serde_json::Result<EventData>
    where
        P: Serialize,
    {
        let custom_metadata = Some(Bytes::from(serde_json::to_vec(&payload)?));
        Ok(EventData {
            custom_metadata,
            ..self
        })
    }
/// Assigns a JSON metadata to this event.
Assigns a JSON metadata to this event.
Assigns a JSON metadata to this event .
pub fn metadata_as_json<P>(self, payload: P) -> serde_json::Result<EventData>
    where
        P: Serialize,
    {
        let custom_metadata = Some(Bytes::from(serde_json::to_vec(&payload)?));
        Ok(EventData {
            custom_metadata,
            ..self
        })
    }
pub fn metadata_as_json < P > ( self , payload : P ) -> serde_json :: Result < EventData > where P : Serialize , { let custom_metadata = Some ( Bytes :: from ( serde_json :: to_vec ( & payload ) ? ) ) ; Ok ( EventData { custom_metadata , .. self } ) }
Assigns a JSON metadata to this event.
Assigns a JSON metadata to this event .
self
payload
P
self
payload
P