#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOne NATS subject token: [a-z0-9][a-z0-9_]{0,62}.
This is the event token rule in cortexkit-bus-naming 0.2.0,
token.rs, lines 91–143.
version: u32Event schema version, at least 1.
headers: Vec<String>Header names every notice carries, for filtering only, never authority.
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 carried by every notice of this event.
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.
Trait Implementations§
Source§impl Clone for EventDeclaration
impl Clone for EventDeclaration
Source§impl Debug for EventDeclaration
impl Debug for EventDeclaration
Source§impl<'de> Deserialize<'de> for EventDeclaration
impl<'de> Deserialize<'de> for EventDeclaration
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
impl Eq for EventDeclaration
Source§impl PartialEq for EventDeclaration
impl PartialEq for EventDeclaration
Source§impl Serialize for EventDeclaration
impl Serialize for EventDeclaration
impl StructuralPartialEq for EventDeclaration
Auto Trait Implementations§
impl Freeze for EventDeclaration
impl RefUnwindSafe for EventDeclaration
impl Send for EventDeclaration
impl Sync for EventDeclaration
impl Unpin for EventDeclaration
impl UnsafeUnpin for EventDeclaration
impl UnwindSafe for EventDeclaration
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