#[non_exhaustive]pub struct PendingNotification {
pub id: Uuid,
pub request: NotificationRequested,
pub aggregate_type: String,
pub aggregate_id: String,
pub company_id: Uuid,
pub org_unit_id: Option<Uuid>,
pub correlation_id: Option<String>,
pub causation_id: Option<String>,
pub occurred_at: DateTime<Utc>,
pub attempt: u32,
}Expand description
One staged request, as a delivery sees it.
Built from the outbox record by the dispatcher. Marked non_exhaustive: it can gain fields
without breaking an implementation, which reads it and never builds it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: UuidThe outbox row id: unique to this request, and the same on every redelivery. Give it to the
provider as the idempotency key; cite it as the causation_id of anything the delivery stages.
request: NotificationRequestedWhat was asked: channel, template or body, recipients, variables, and the trigger that asked.
aggregate_type: StringThe aggregate type the staging write was about.
aggregate_id: StringThe aggregate it was about.
company_id: UuidThe company the request belongs to.
org_unit_id: Option<Uuid>The org unit it was staged under, when one was bound.
correlation_id: Option<String>The correlation id of the write (or request) that staged it.
causation_id: Option<String>The id of what caused the request: the event, trigger or workflow step that staged it.
occurred_at: DateTime<Utc>When the request was staged.
attempt: u32Which attempt this is, counting from 1.
Implementations§
Source§impl PendingNotification
impl PendingNotification
Sourcepub fn from_record(record: &OutboxRecord, attempt: u32) -> Result<Self, Error>
pub fn from_record(record: &OutboxRecord, attempt: u32) -> Result<Self, Error>
The request of an outbox record of type NotificationRequested::NAME, as attempt
attempt.
§Errors
The payload is not a NotificationRequested: nothing offered it again would change that.
Trait Implementations§
Source§impl Clone for PendingNotification
impl Clone for PendingNotification
Auto Trait Implementations§
impl Freeze for PendingNotification
impl RefUnwindSafe for PendingNotification
impl Send for PendingNotification
impl Sync for PendingNotification
impl Unpin for PendingNotification
impl UnsafeUnpin for PendingNotification
impl UnwindSafe for PendingNotification
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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