pub struct BatchEvent {
pub name: String,
pub channel: String,
pub data: String,
pub socket_id: Option<String>,
pub info: Option<String>,
pub tags: Option<HashMap<String, String>>,
pub idempotency_key: Option<String>,
pub extras: Option<MessageExtras>,
}Expand description
Batch event data
Fields§
§name: String§channel: String§data: String§socket_id: Option<String>§info: Option<String>§idempotency_key: Option<String>§extras: Option<MessageExtras>Implementations§
Source§impl BatchEvent
impl BatchEvent
Sourcepub fn new(
name: impl Into<String>,
channel: impl Into<String>,
data: impl Into<EventData>,
) -> Self
pub fn new( name: impl Into<String>, channel: impl Into<String>, data: impl Into<EventData>, ) -> Self
Creates a new batch event with EventData
Sourcepub fn with_socket_id(self, socket_id: impl Into<String>) -> Self
pub fn with_socket_id(self, socket_id: impl Into<String>) -> Self
Sets the socket ID to exclude
Sets the tags for tag filtering
Sourcepub fn with_idempotency_key(self, key: impl Into<String>) -> Self
pub fn with_idempotency_key(self, key: impl Into<String>) -> Self
Sets the idempotency key for deduplication
Sourcepub fn with_auto_idempotency_key(self) -> Self
pub fn with_auto_idempotency_key(self) -> Self
Sets a randomly generated idempotency key (UUID v4)
Sourcepub fn with_extras(self, extras: MessageExtras) -> Self
pub fn with_extras(self, extras: MessageExtras) -> Self
Sets the V2 extras
Sourcepub fn with_ephemeral(self, ephemeral: bool) -> Self
pub fn with_ephemeral(self, ephemeral: bool) -> Self
Sets the ephemeral flag in extras
Trait Implementations§
Source§impl Debug for BatchEvent
impl Debug for BatchEvent
Source§impl<'de> Deserialize<'de> for BatchEvent
impl<'de> Deserialize<'de> for BatchEvent
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
Auto Trait Implementations§
impl !RefUnwindSafe for BatchEvent
impl !UnwindSafe for BatchEvent
impl Freeze for BatchEvent
impl Send for BatchEvent
impl Sync for BatchEvent
impl Unpin for BatchEvent
impl UnsafeUnpin for BatchEvent
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