pub struct NotificationPreferences {
pub user_id: String,
pub enabled_types: Vec<NotificationType>,
pub email_enabled: bool,
pub push_enabled: bool,
}Expand description
User notification preferences.
Fields§
§user_id: StringUser ID.
enabled_types: Vec<NotificationType>Enabled notification types.
email_enabled: boolWhether to receive email notifications.
push_enabled: boolWhether to receive web push notifications.
Implementations§
Source§impl NotificationPreferences
impl NotificationPreferences
Sourcepub fn is_enabled(&self, notification_type: NotificationType) -> bool
pub fn is_enabled(&self, notification_type: NotificationType) -> bool
Check if a notification type is enabled.
Trait Implementations§
Source§impl Clone for NotificationPreferences
impl Clone for NotificationPreferences
Source§fn clone(&self) -> NotificationPreferences
fn clone(&self) -> NotificationPreferences
Returns a duplicate of the value. Read more
1.0.0 · 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 NotificationPreferences
impl Debug for NotificationPreferences
Source§impl Default for NotificationPreferences
impl Default for NotificationPreferences
Source§impl<'de> Deserialize<'de> for NotificationPreferences
impl<'de> Deserialize<'de> for NotificationPreferences
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
Auto Trait Implementations§
impl Freeze for NotificationPreferences
impl RefUnwindSafe for NotificationPreferences
impl Send for NotificationPreferences
impl Sync for NotificationPreferences
impl Unpin for NotificationPreferences
impl UnwindSafe for NotificationPreferences
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