pub struct EventView {
pub kind: Option<EventKindView>,
pub title: String,
pub detail: String,
pub severity: i32,
}Expand description
Something that happened while nobody was looking: a plugin dropped, a broker session ended (#150).
Every other view answers a question a front end asked. This is the other direction, so it arrives on a stream rather than as a reply.
§Why the text is in the payload
title and detail are filled in by the engine rather than derived from
the kind by whoever renders it. There are two renderers — the OS
notification and the in-app alerts list — and text derived twice is text
that drifts. The kind is left for what a renderer needs structurally:
the status bar needs to know a feed is down, not how to phrase it.
Fields§
§kind: Option<EventKindView>§title: String§detail: String§severity: i32Implementations§
Source§impl EventView
impl EventView
Sourcepub fn severity(&self) -> SeverityView
pub fn severity(&self) -> SeverityView
Returns the enum value of severity, or the default if the field is set to an invalid enum value.
Sourcepub fn set_severity(&mut self, value: SeverityView)
pub fn set_severity(&mut self, value: SeverityView)
Sets severity to the provided enum value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventView
impl<'de> Deserialize<'de> for EventView
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 EventView
Source§impl Message for EventView
impl Message for EventView
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for EventView
Auto Trait Implementations§
impl Freeze for EventView
impl RefUnwindSafe for EventView
impl Send for EventView
impl Sync for EventView
impl Unpin for EventView
impl UnsafeUnpin for EventView
impl UnwindSafe for EventView
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