pub struct QueueCreatedEvent {
pub queue_name: String,
pub namespace: String,
pub created_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
Event emitted when a new PGMQ queue is created
This event is triggered when a new queue is created in the PGMQ system. It includes the queue name, extracted namespace, and creation timestamp.
§Examples
use tasker_pgmq::QueueCreatedEvent;
use chrono::Utc;
use std::collections::HashMap;
let event = QueueCreatedEvent {
queue_name: "orders_queue".to_string(),
namespace: "orders".to_string(),
created_at: Utc::now(),
metadata: HashMap::new(),
};
assert_eq!(event.queue_name, "orders_queue");
assert_eq!(event.namespace, "orders");Fields§
§queue_name: StringName of the queue that was created
namespace: StringExtracted namespace from the queue name
created_at: DateTime<Utc>When the queue was created
metadata: HashMap<String, String>Optional metadata about the queue
Implementations§
Source§impl QueueCreatedEvent
impl QueueCreatedEvent
Sourcepub fn new<S: Into<String>>(queue_name: S, namespace: S) -> Self
pub fn new<S: Into<String>>(queue_name: S, namespace: S) -> Self
Create a new queue created event
Sourcepub fn with_timestamp<S: Into<String>>(
queue_name: S,
namespace: S,
created_at: DateTime<Utc>,
) -> Self
pub fn with_timestamp<S: Into<String>>( queue_name: S, namespace: S, created_at: DateTime<Utc>, ) -> Self
Create with custom timestamp
Sourcepub fn with_metadata(self, metadata: HashMap<String, String>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, String>) -> Self
Add metadata to the event
Trait Implementations§
Source§impl Clone for QueueCreatedEvent
impl Clone for QueueCreatedEvent
Source§fn clone(&self) -> QueueCreatedEvent
fn clone(&self) -> QueueCreatedEvent
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 QueueCreatedEvent
impl Debug for QueueCreatedEvent
Source§impl<'de> Deserialize<'de> for QueueCreatedEvent
impl<'de> Deserialize<'de> for QueueCreatedEvent
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 PartialEq for QueueCreatedEvent
impl PartialEq for QueueCreatedEvent
Source§impl Serialize for QueueCreatedEvent
impl Serialize for QueueCreatedEvent
impl StructuralPartialEq for QueueCreatedEvent
Auto Trait Implementations§
impl Freeze for QueueCreatedEvent
impl RefUnwindSafe for QueueCreatedEvent
impl Send for QueueCreatedEvent
impl Sync for QueueCreatedEvent
impl Unpin for QueueCreatedEvent
impl UnwindSafe for QueueCreatedEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more