fidl_data_zx/
clock.rs

1// Copyright 2022 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// DO NOT EDIT.
6// Generated from FIDL library `zx` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use zerocopy::IntoBytes;
11
12use crate::zx_common::*;
13
14#[repr(u32)]
15#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
16pub enum Clock {
17    Monotonic = 0,
18    Utc = 1,
19    Thread = 2,
20}
21
22impl Clock {
23    pub fn from_raw(raw: u32) -> Option<Self> {
24        match raw {
25            0 => Some(Self::Monotonic),
26
27            1 => Some(Self::Utc),
28
29            2 => Some(Self::Thread),
30
31            _ => None,
32        }
33    }
34}