federation/push: Make all pub enums non_exhaustive
This commit is contained in:
parent
c55dab7122
commit
1489b5e1f1
@ -69,7 +69,11 @@ impl Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Profile fields to specify in query.
|
/// Profile fields to specify in query.
|
||||||
|
///
|
||||||
|
/// This type can hold an arbitrary string. To check for formats that are not available as a
|
||||||
|
/// documented variant here, use its string representation, obtained through `.as_str()`.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum ProfileField {
|
pub enum ProfileField {
|
||||||
/// Display name of the user.
|
/// Display name of the user.
|
||||||
#[ruma_enum(rename = "displayname")]
|
#[ruma_enum(rename = "displayname")]
|
||||||
@ -82,3 +86,10 @@ pub enum ProfileField {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
_Custom(String),
|
_Custom(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ProfileField {
|
||||||
|
/// Creates a string slice from this `ProfileField`.
|
||||||
|
pub fn as_str(&self) -> &str {
|
||||||
|
self.as_ref()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -136,8 +136,12 @@ impl<'a> Notification<'a> {
|
|||||||
///
|
///
|
||||||
/// This may be used by push gateways to deliver less time-sensitive
|
/// This may be used by push gateways to deliver less time-sensitive
|
||||||
/// notifications in a way that will preserve battery power on mobile devices.
|
/// notifications in a way that will preserve battery power on mobile devices.
|
||||||
|
///
|
||||||
|
/// This type can hold an arbitrary string. To check for formats that are not available as a
|
||||||
|
/// documented variant here, use its string representation, obtained through `.as_str()`.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||||
#[ruma_enum(rename_all = "snake_case")]
|
#[ruma_enum(rename_all = "snake_case")]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum NotificationPriority {
|
pub enum NotificationPriority {
|
||||||
/// A high priority notification
|
/// A high priority notification
|
||||||
High,
|
High,
|
||||||
@ -149,6 +153,13 @@ pub enum NotificationPriority {
|
|||||||
_Custom(String),
|
_Custom(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl NotificationPriority {
|
||||||
|
/// Creates a string slice from this `NotificationPriority`.
|
||||||
|
pub fn as_str(&self) -> &str {
|
||||||
|
self.as_ref()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for NotificationPriority {
|
impl Default for NotificationPriority {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::High
|
Self::High
|
||||||
|
Loading…
x
Reference in New Issue
Block a user