#[non_exhaustive]pub struct Notification {
pub event_type: String,
pub sequence: u64,
pub identifier: BTreeMap<String, String>,
pub payload: Value,
pub cloudevent: Option<Value>,
}Expand description
A notification received from the server.
Constructed from the wire-format CloudEvent envelope, which is hidden per D9. New envelope
fields will appear here as the streaming surface lands; the type is #[non_exhaustive] so
additions do not break downstream code.
Serialize is derived so trigger dispatchers (and any downstream consumer) can render the
notification as JSON without bespoke serialisation code. The wire shape on serialisation is
the public field layout: event_type, sequence, identifier, payload.
The SSE watch stream does NOT carry a per-notification request_id correlation field; the
sequence is the stream-level correlation identifier (monotonic, server-assigned, suitable
for resume cursors). The session-level X-Request-ID returned when a watch is opened is
emitted as a client.watch.subscribed tracing event from the supervisor; that is the value
to quote in support tickets for a running watch.
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.event_type: StringSchema event-type, parsed from the CloudEvent id (the part before @).
sequence: u64Per-stream monotonic sequence, parsed from the CloudEvent id (the part after @).
identifier: BTreeMap<String, String>Identifier key/value pairs as published.
payload: ValuePayload as published. JSON null is preserved as serde_json::Value::Null.
cloudevent: Option<Value>Raw CloudEvent envelope as the server emitted it on the SSE wire,
preserved verbatim (parsed as JSON, never re-serialised through a
schema-narrowing intermediate). Some in the production watch path
(the supervisor captures the envelope before narrowing to the lib’s
internal fields); None when the notification was synthesised
outside the watch path (test fixtures, library callers building
notifications directly).
Triggers needing the exact server-emitted envelope (post trigger,
any future CloudEvent-aware forwarder) MUST read this field rather
than reconstructing one from the other fields, because the lib
otherwise discards envelope metadata (D9: CloudEvent envelope
hidden) and a reconstruction would synthesise values for time,
source, type that do not match the server’s actual emission.
The field is #[serde(skip)] so the published serialisation of
Notification (echo trigger output, log trigger lines, default
webhook body, the AVISO_NOTIFICATION_JSON env var the command
trigger injects) keeps the historical 4-field shape. Consumers
reading this field by name on the public Rust struct are the
supported access path; JSON consumers should not expect to see
it on the wire.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Notification
impl Debug for Notification
impl Eq for Notification
Source§impl PartialEq for Notification
impl PartialEq for Notification
Source§fn eq(&self, other: &Notification) -> bool
fn eq(&self, other: &Notification) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Notification
impl Serialize for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.