blob: 33c19dcca40ce216aaeffe83b006cb4d8678c11f [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#![allow(
unused_parens, // one-element-tuple-case is not a tuple
unused_mut, // not all args require mutation, but many do
nonstandard_style, // auto-caps does its best, but is not always successful
)]
#![recursion_limit = "512"]
#[cfg(target_os = "fuchsia")]
#[allow(unused_imports)]
use fuchsia_zircon as zx;
#[allow(unused_imports)]
use {
bitflags::bitflags,
fidl::{
client::{decode_transaction_body_fut, QueryResponseFut},
encoding::{Decodable as _, Encodable as _},
fidl_bits, fidl_empty_struct, fidl_enum, fidl_struct, fidl_struct_copy, fidl_table,
fidl_union, wrap_handle_metadata,
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
bitflags! {
pub struct BitsType: u32 {
const Value = 1;
const True_ = 2;
}
}
impl BitsType {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
fidl_bits! {
name: BitsType,
prim_ty: u32,
strict: true,
}
pub const ENABLED_FLAG: bool = true;
pub const OFFSET: i8 = -33;
pub const ANSWER: u16 = 42;
pub const ANSWER_IN_BINARY: u16 = 42;
pub const POPULATION_USA_2018: u32 = 330000000;
pub const DIAMOND: u64 = 1746410393481133080;
pub const FUCHSIA: u64 = 4054509061583223046;
pub const USERNAME: &str = r###""squeenze""###;
pub const MIN_TEMP: f32 = -273.15;
pub const CONVERSION_FACTOR: f64 = 1.41421;
pub const ENUM_VAL: EnumType = EnumType::Value;
pub const ENUM_PRIMITIVE_VAL: i32 = EnumType::Value;
pub const ENUM_TRUE: EnumType = EnumType::True_;
pub const ENUM_PRIMITIVE_TRUE: i32 = EnumType::True_;
pub const BITS_VAL: BitsType = BitsType::Value;
pub const BITS_PRIMITIVE_VAL: i32 = BitsType::Value;
pub const BITS_TRUE: BitsType = BitsType::True_;
pub const BITS_PRIMITIVE_TRUE: i32 = BitsType::True_;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(i32)]
pub enum EnumType {
Value = 1,
True_ = 2,
}
impl EnumType {
#[inline]
pub fn from_primitive(prim: i32) -> Option<Self> {
match prim {
1 => Some(Self::Value),
2 => Some(Self::True_),
_ => None,
}
}
#[inline]
pub fn into_primitive(self) -> i32 {
self as i32
}
#[deprecated = "Strict enums should not use `validate`"]
#[inline]
pub fn validate(self) -> std::result::Result<Self, i32> {
Ok(self)
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
fidl_enum! {
name: EnumType,
prim_ty: i32,
strict: true,
min_member: Value,
}