Skip to main content

settings_do_not_disturb/
types.rs

1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use serde::{Deserialize, Serialize};
6use settings_common::inspect::event::Nameable;
7
8#[derive(PartialEq, Debug, Clone, Copy, Serialize, Deserialize)]
9pub struct DoNotDisturbInfo {
10    pub user_dnd: Option<bool>,
11    pub night_mode_dnd: Option<bool>,
12}
13
14impl DoNotDisturbInfo {
15    pub(crate) const fn new(user_dnd: bool, night_mode_dnd: bool) -> DoNotDisturbInfo {
16        DoNotDisturbInfo { user_dnd: Some(user_dnd), night_mode_dnd: Some(night_mode_dnd) }
17    }
18}
19
20impl Nameable for DoNotDisturbInfo {
21    const NAME: &str = "DoNotDisturb";
22}