pub struct NotificationEvent {
pub kind: NotificationKind,
pub actor: UserId,
pub actor_is_agent: bool,
pub via_agent: Option<String>,
pub subjects: Vec<SubjectRef>,
pub stream: Option<NotificationStreamId>,
pub direct_recipients: Vec<DirectRecipient>,
pub sender_attention: Option<Attention>,
pub excerpt: Option<String>,
pub payload: Value,
pub occurred_at: DateTime<Utc>,
}Expand description
One thing that happened, before routing decides who hears about it.
Fields§
§kind: NotificationKind§actor: UserId§actor_is_agent: bool§via_agent: Option<String>§subjects: Vec<SubjectRef>§stream: Option<NotificationStreamId>§direct_recipients: Vec<DirectRecipient>§sender_attention: Option<Attention>§excerpt: Option<String>§payload: Value§occurred_at: DateTime<Utc>Implementations§
Source§impl NotificationEvent
impl NotificationEvent
pub const fn new( kind: NotificationKind, actor: UserId, occurred_at: DateTime<Utc>, ) -> Self
pub const fn with_actor_is_agent(self, actor_is_agent: bool) -> Self
pub fn with_via_agent(self, via_agent: impl Into<String>) -> Self
pub fn with_subject(self, subject: SubjectRef) -> Self
pub fn with_subjects( self, subjects: impl IntoIterator<Item = SubjectRef>, ) -> Self
pub fn with_stream(self, stream: NotificationStreamId) -> Self
pub fn with_direct_recipient( self, user: UserId, attention: Option<Attention>, ) -> Self
pub fn with_direct_recipients( self, recipients: impl IntoIterator<Item = DirectRecipient>, ) -> Self
pub const fn with_sender_attention(self, attention: Attention) -> Self
pub fn with_excerpt(self, excerpt: impl Into<String>) -> Self
pub fn with_payload(self, payload: Value) -> Self
Trait Implementations§
Source§impl Clone for NotificationEvent
impl Clone for NotificationEvent
Source§impl Debug for NotificationEvent
impl Debug for NotificationEvent
Source§impl<'de> Deserialize<'de> for NotificationEvent
impl<'de> Deserialize<'de> for NotificationEvent
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 JsonSchema for NotificationEvent
impl JsonSchema for NotificationEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for NotificationEvent
impl PartialEq for NotificationEvent
Source§impl Serialize for NotificationEvent
impl Serialize for NotificationEvent
impl StructuralPartialEq for NotificationEvent
Auto Trait Implementations§
impl Freeze for NotificationEvent
impl RefUnwindSafe for NotificationEvent
impl Send for NotificationEvent
impl Sync for NotificationEvent
impl Unpin for NotificationEvent
impl UnsafeUnpin for NotificationEvent
impl UnwindSafe for NotificationEvent
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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