#[non_exhaustive]pub struct EventDeclaration {
pub name: String,
pub version: u32,
pub headers: Vec<String>,
pub summary: Option<String>,
}Expand description
A versioned bus event notice whose body is served by the publisher.
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.name: StringOne to four dot-separated NATS subject tokens, each
[a-z0-9][a-z0-9_]{0,62}. Levels shaped like v followed by digits
are reserved for the event subject’s version.
This matches cortexkit-bus-naming 0.2.6,
token.rs, lines 91–121.
version: u32Event schema version, at least 1.
headers: Vec<String>Header names a notice of this event may carry, for filtering only, never
authority. A notice omits a header it has no value for, and never sends
one empty or invented, so a filter on a missing header does not match.
Names match [a-z][a-z0-9_]{0,31} and are unique within the declaration.
summary: Option<String>Short human line for consent cards, at most 200 characters without controls.
Implementations§
Source§impl EventDeclaration
impl EventDeclaration
Sourcepub fn new(name: impl Into<String>, version: u32) -> Self
pub fn new(name: impl Into<String>, version: u32) -> Self
Starts an event declaration with no filter headers or summary. Validation happens when decoding a manifest or admitting its HELLO.
Sourcepub fn with_headers(self, headers: Vec<String>) -> Self
pub fn with_headers(self, headers: Vec<String>) -> Self
Sets the header names a notice of this event may carry.
Sourcepub fn with_summary(self, summary: Option<String>) -> Self
pub fn with_summary(self, summary: Option<String>) -> Self
Sets or removes the short human summary.