pub enum NewsNotificationType {
Maintenance,
Announcement,
Update,
Unknown,
}Expand description
Type of news notification. Mirrors the canonical values the backend
stores in news.notification_type (validated against the
ALLOWED_NOTIFICATION_TYPES list at the API boundary).
#[serde(other)] keeps old clients functional when the server
introduces a new variant — unknown values deserialize to
Unknown instead of erroring out. Mirrors the
AdventureEventKind::Unknown pattern already in this crate.
Variants§
Maintenance
Announcement
Update
Unknown
Fallback for variants the server adds after this client was built.
Implementations§
Source§impl NewsNotificationType
impl NewsNotificationType
Sourcepub fn from_wire_str(s: &str) -> Self
pub fn from_wire_str(s: &str) -> Self
Parse a wire-string into the typed enum. Unknown / unrecognized
strings map to Unknown so callers don’t have to handle parse
errors — backend’s validate_news_payload already rejects
unknown values at the API boundary, so this only kicks in
defensively for forward-compat.
Trait Implementations§
Source§impl Clone for NewsNotificationType
impl Clone for NewsNotificationType
Source§fn clone(&self) -> NewsNotificationType
fn clone(&self) -> NewsNotificationType
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 moreimpl Copy for NewsNotificationType
Source§impl Debug for NewsNotificationType
impl Debug for NewsNotificationType
Source§impl<'de> Deserialize<'de> for NewsNotificationType
impl<'de> Deserialize<'de> for NewsNotificationType
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 NewsNotificationType
Source§impl From<&String> for NewsNotificationType
impl From<&String> for NewsNotificationType
Source§impl From<&str> for NewsNotificationType
impl From<&str> for NewsNotificationType
Source§impl PartialEq for NewsNotificationType
impl PartialEq for NewsNotificationType
Source§impl Serialize for NewsNotificationType
impl Serialize for NewsNotificationType
impl StructuralPartialEq for NewsNotificationType
Auto Trait Implementations§
impl Freeze for NewsNotificationType
impl RefUnwindSafe for NewsNotificationType
impl Send for NewsNotificationType
impl Sync for NewsNotificationType
impl Unpin for NewsNotificationType
impl UnsafeUnpin for NewsNotificationType
impl UnwindSafe for NewsNotificationType
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