blob: 444efb35ab44b19ca50f65448bf5d438b92f1ca3 [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 _},
endpoints::{ControlHandle as _, Responder 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 Bits: u32 {
const B = 8;
}
}
impl Bits {
#[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: Bits,
prim_ty: u32,
strict: true,
}
bitflags! {
pub struct BitsType: u32 {
const VALUE = 1;
const SECOND_VALUE = UINT32;
const THIRD_VALUE = 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 BOOL: bool = true;
pub const FLOAT32: f32 = 3.14159;
pub const FLOAT64: f64 = 3.14159;
pub const INT16: i16 = 4;
pub const INT32: i32 = 4;
pub const INT64: i64 = 4;
pub const INT8: i8 = 4;
pub const STRING: &str = r###"string"###;
pub const UINT16: u16 = 4;
pub const UINT32: u32 = 4;
pub const UINT64: u64 = 4;
pub const UINT8: u8 = 4;
pub const BITS_PRIMITIVE_VAL: u32 = BitsType::VALUE.bits();
pub const BITS_VAL: BitsType = BitsType::VALUE;
pub const ENUM_PRIMITIVE_VAL: i32 = EnumType::Value.into_primitive();
pub const ENUM_VAL: EnumType = EnumType::Value;
pub const OR_RESULT: BitsType = BitsType::from_bits_truncate(7);
pub const OR_RESULT_PRIMITIVE_VAL: u32 = 5;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Enum {
E = 170,
}
impl Enum {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
170 => Some(Self::E),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `validate`"]
#[inline]
pub fn validate(self) -> std::result::Result<Self, u32> {
Ok(self)
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
fidl_enum! {
name: Enum,
prim_ty: u32,
strict: true,
min_member: E,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(i32)]
pub enum EnumType {
Value = 3,
SecondValue = 4,
}
impl EnumType {
#[inline]
pub fn from_primitive(prim: i32) -> Option<Self> {
match prim {
3 => Some(Self::Value),
4 => Some(Self::SecondValue),
_ => None,
}
}
#[inline]
pub const 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,
}
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Struct {
pub int64_with_default: i64,
pub string_with_default: String,
pub bool_with_default: bool,
pub enum_with_default: Enum,
pub bits_with_default: Bits,
}
impl fidl::encoding::Persistable for Struct {}
fidl_struct! {
name: Struct,
members: [
int64_with_default {
ty: i64,
offset_v1: 0,
offset_v2: 0,
},
string_with_default {
ty: String,
offset_v1: 8,
offset_v2: 8,
},
bool_with_default {
ty: bool,
offset_v1: 24,
offset_v2: 24,
},
enum_with_default {
ty: Enum,
offset_v1: 28,
offset_v2: 28,
},
bits_with_default {
ty: Bits,
offset_v1: 32,
offset_v2: 32,
},
],
padding_v1: [
{
ty: u64,
offset: 24,
mask: 0x00000000ffffff00u64,
},
{
ty: u64,
offset: 32,
mask: 0xffffffff00000000u64,
},],
padding_v2: [
{
ty: u64,
offset: 24,
mask: 0x00000000ffffff00u64,
},
{
ty: u64,
offset: 32,
mask: 0xffffffff00000000u64,
},],
size_v1: 40,
size_v2: 40,
align_v1: 8,
align_v2: 8,
}