settings/setup/
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 bitflags::bitflags;
6use serde::{Deserialize, Serialize};
7
8#[derive(PartialEq, Default, Debug, Clone, Copy, Deserialize, Serialize)]
9pub struct SetupInfo {
10    pub configuration_interfaces: ConfigurationInterfaceFlags,
11}
12
13bitflags! {
14    #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
15    pub struct ConfigurationInterfaceFlags: u32 {
16        const ETHERNET = 1 << 0;
17        const WIFI = 1 << 1;
18        const DEFAULT = Self::WIFI.bits();
19    }
20}
21
22impl Default for ConfigurationInterfaceFlags {
23    fn default() -> Self {
24        Self::DEFAULT
25    }
26}
27
28bitflags_serde_legacy::impl_traits!(ConfigurationInterfaceFlags);
29
30#[derive(Debug, PartialEq, Copy, Clone)]
31pub struct SetConfigurationInterfacesParams {
32    pub config_interfaces_flags: ConfigurationInterfaceFlags,
33    // Set true to reboot the device, otherwise, set it as false.
34    pub should_reboot: bool,
35}