fidl_data_zither_structs/
structs.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.structs` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use bitflags::bitflags;
11use zerocopy::{FromBytes, IntoBytes};
12
13#[repr(C)]
14#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
15pub struct Empty {}
16
17#[repr(C)]
18#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
19pub struct Singleton {
20    pub value: u8,
21}
22
23#[repr(C)]
24#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
25pub struct Doubtleton {
26    pub first: Singleton,
27    pub second: Singleton,
28}
29
30#[repr(C)]
31#[derive(Clone, Copy, Debug, Eq, PartialEq)]
32pub struct PrimitiveMembers {
33    pub i64: i64,
34    pub u64: u64,
35    pub i32: i32,
36    pub u32: u32,
37    pub i16: i16,
38    pub u16: u16,
39    pub i8: i8,
40    pub u8: u8,
41    pub b: bool,
42}
43
44#[repr(C)]
45#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
46pub struct ArrayMembers {
47    pub u8s: [u8; 10],
48    pub singletons: [Singleton; 6],
49    pub nested_arrays1: [[u8; 10]; 20],
50    pub nested_arrays2: [[[i8; 1]; 2]; 3],
51}
52
53#[repr(i32)]
54#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
55pub enum Enum {
56    Zero = 0,
57    One = 1,
58}
59
60#[repr(C)]
61#[derive(IntoBytes, FromBytes, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
62pub struct Bits(u16);
63
64bitflags! {
65    impl Bits : u16 {
66        const ONE = 1 << 0;
67        const TWO = 1 << 1;
68  }
69}
70
71#[repr(C)]
72#[derive(Clone, Copy, Debug, Eq, PartialEq)]
73pub struct EnumAndBitsMembers {
74    pub e: Enum,
75    pub b: Bits,
76}
77
78/// Struct with a one-line comment.
79#[repr(C)]
80#[derive(Clone, Copy, Debug, Eq, PartialEq)]
81pub struct StructWithOneLineComment {
82    /// Struct member with one-line comment.
83    pub member_with_one_line_comment: u32,
84
85    /// Struct member
86    ///     with a
87    ///         many-line
88    ///           comment.
89    pub member_with_many_line_comment: bool,
90}
91
92/// Struct
93///
94///     with a
95///         many-line
96///           comment.
97#[repr(C)]
98#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
99pub struct StructWithManyLineComment {
100    pub member: u16,
101}