pub struct Event {
pub version: u32,
pub id: Uuid,
pub event: EventKind,
pub occurred_at: DateTime<Utc>,
pub server_version: String,
pub link: Option<String>,
pub person: Option<Person>,
pub alert: Option<AlertPayload>,
pub day: Option<DayPayload>,
pub by: Option<String>,
}Expand description
One thing that happened, as every destination is told it.
This is the json kind’s body verbatim, and what the chat kinds render
their text from - so a Slack message can never say something the payload
does not.
Fields§
§version: u32§id: UuidThe same for every destination this event went to, and for every retry to one. What a receiver deduplicates on.
event: EventKind§occurred_at: DateTime<Utc>§server_version: StringThe server that said it, so a receiver fed by several can tell them apart and a message can name the version that sent it.
link: Option<String>Where to look, when the installation knows its own address.
person: Option<Person>Who it is about. Absent from a test.
alert: Option<AlertPayload>§day: Option<DayPayload>§by: Option<String>Who answered an alert, by name - on alert.acknowledged only. So the
channel knows it has been looked at and two managers do not both
chase it.
Implementations§
Source§impl Event
impl Event
Sourcepub fn alert(
event: EventKind,
alert: AlertPayload,
person: Person,
by: Option<String>,
webhooks: &Webhooks,
now: DateTime<Utc>,
) -> Self
pub fn alert( event: EventKind, alert: AlertPayload, person: Person, by: Option<String>, webhooks: &Webhooks, now: DateTime<Utc>, ) -> Self
A step in an alert’s life.
Sourcepub fn day_closed(
workday_id: Uuid,
day: DayPayload,
person: Person,
webhooks: &Webhooks,
now: DateTime<Utc>,
) -> Self
pub fn day_closed( workday_id: Uuid, day: DayPayload, person: Person, webhooks: &Webhooks, now: DateTime<Utc>, ) -> Self
A day that has just arrived finished.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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