settings/base.rs
1// Copyright 2020 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
5//! Service-wide definitions.
6//!
7//! # Summary
8//!
9//! The base mod houses the core definitions for communicating information
10//! across the service. Note that there are currently references to types in
11//! other nested base mods. It is the long-term intention that the common
12//! general (non-domain specific or overarching) definitions are migrated here,
13//! while particular types, such as setting-specific definitions, are moved to
14//! a common base mod underneath the parent setting mod.
15
16use crate::ingress::fidl;
17use serde::Serialize;
18use std::collections::HashSet;
19
20/// The setting types supported by the service.
21#[derive(PartialEq, Debug, Eq, Hash, Clone, Copy, Serialize)]
22pub enum SettingType {
23 Accessibility,
24 Audio,
25 Display,
26 DoNotDisturb,
27 FactoryReset,
28 Input,
29 Intl,
30 Keyboard,
31 Light,
32 NightMode,
33 Privacy,
34 Setup,
35}
36
37/// Returns the default interfaces supported by any product if none are supplied.
38pub fn get_default_interfaces() -> HashSet<fidl::InterfaceSpec> {
39 [
40 fidl::InterfaceSpec::Accessibility,
41 fidl::InterfaceSpec::Intl,
42 fidl::InterfaceSpec::Privacy,
43 fidl::InterfaceSpec::Setup,
44 ]
45 .into()
46}