fidl_data_zither_aliases/
aliases.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.aliases` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use zerocopy::{FromBytes, IntoBytes};
11
12pub type BoolAlias = bool;
13
14pub type Int8Alias = i8;
15
16pub type Int16Alias = i16;
17
18pub type Int32Alias = i32;
19
20pub type Int64Alias = i64;
21
22pub type Uint8Alias = u8;
23
24pub type Uint16Alias = u16;
25
26pub type Uint32Alias = u32;
27
28pub type Uint64Alias = u64;
29
30/// TODO(https://fxbug.dev/42057022): The IR currently does not propagate enough
31/// information for bindings to express this type as an alias.
32pub const CONST_FROM_ALIAS: u8 = 0xff;
33
34#[repr(i16)]
35#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
36pub enum Enum {
37    Member = 0,
38}
39
40impl Enum {
41    pub fn from_raw(raw: i16) -> Option<Self> {
42        match raw {
43            0 => Some(Self::Member),
44
45            _ => None,
46        }
47    }
48}
49
50pub type EnumAlias = Enum;
51
52#[repr(u16)]
53#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
54pub enum Bits {
55    One = 1,
56}
57
58impl Bits {
59    pub fn from_raw(raw: u16) -> Option<Self> {
60        match raw {
61            1 => Some(Self::One),
62
63            _ => None,
64        }
65    }
66}
67
68pub type BitsAlias = Bits;
69
70#[repr(C)]
71#[derive(Clone, Copy, Debug, Eq, PartialEq)]
72pub struct Struct {
73    pub x: u64,
74    pub y: u64,
75    pub e: EnumAlias,
76}
77
78pub type StructAlias = Struct;
79
80pub type ArrayAlias = [u32; 4];
81
82pub type NestedArrayAlias = [[Struct; 8]; 4];
83
84/// Alias with a one-line comment.
85pub type AliasWithOneLineComment = bool;
86
87/// Alias
88///     with
89///         a
90///           many-line
91///             comment.
92pub type AliasWithManyLineComment = u8;