Skip to main content

resources/
resources.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 `zither.resources` by zither, a Fuchsia platform tool.
7
8use zerocopy::{FromBytes, IntoBytes, TryFromBytes};
9
10#[repr(u32)]
11#[derive(Clone, Copy, Debug, Eq, Hash, IntoBytes, PartialEq, TryFromBytes)]
12pub enum Subtype {
13    A = 0,
14    B = 1,
15}
16
17impl Subtype {
18    pub fn from_raw(raw: u32) -> Option<Self> {
19        match raw {
20            0 => Some(Self::A),
21
22            1 => Some(Self::B),
23
24            _ => None,
25        }
26    }
27}
28
29impl From<Subtype> for u32 {
30    fn from(val: Subtype) -> Self {
31        val as Self
32    }
33}
34
35/// This is a handle.
36pub type Handle = u32;
37
38#[repr(C)]
39#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
40pub struct StructWithHandleMembers {
41    pub untyped_handle: Handle,
42    pub handle_a: Handle,
43    pub handle_b: Handle,
44}