pub struct NewsItemPayload {
pub id: String,
pub title: String,
pub message: String,
pub notification_type: NewsNotificationType,
pub created_at: DateTime<Utc>,
pub expires_at: Option<DateTime<Utc>>,
pub auto_hide_seconds: u32,
pub refresh_on_every_login: bool,
pub priority: i32,
}Expand description
A news/notification item as sent over the wire (server → client).
Mirrors the backend’s NewsItem model but stripped of fields that
shouldn’t leave the server (created_by user id).
Used in ServerMessage::NewsAnnounced for live push
and is shape-compatible with what /api/news returns, so the same UI code path can render
either source.
Fields§
§id: String§title: String§message: String§notification_type: NewsNotificationType§created_at: DateTime<Utc>§expires_at: Option<DateTime<Utc>>§auto_hide_seconds: u320 = popup stays until dismissed; > 0 = auto-hide after N seconds.
refresh_on_every_login: boolWhen true the frontend re-shows the popup every page load even if the user has dismissed it (dismissal becomes session-scoped only).
priority: i32Higher priority wins when multiple items are active.
Trait Implementations§
Source§impl Clone for NewsItemPayload
impl Clone for NewsItemPayload
Source§fn clone(&self) -> NewsItemPayload
fn clone(&self) -> NewsItemPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NewsItemPayload
impl Debug for NewsItemPayload
Source§impl<'de> Deserialize<'de> for NewsItemPayload
impl<'de> Deserialize<'de> for NewsItemPayload
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 NewsItemPayload
Source§impl PartialEq for NewsItemPayload
impl PartialEq for NewsItemPayload
Source§impl Serialize for NewsItemPayload
impl Serialize for NewsItemPayload
impl StructuralPartialEq for NewsItemPayload
Auto Trait Implementations§
impl Freeze for NewsItemPayload
impl RefUnwindSafe for NewsItemPayload
impl Send for NewsItemPayload
impl Sync for NewsItemPayload
impl Unpin for NewsItemPayload
impl UnsafeUnpin for NewsItemPayload
impl UnwindSafe for NewsItemPayload
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