| // 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 FlexibleBits: u64 { |
| const SMALLEST = 1; |
| const BIGGEST = 9223372036854775808; |
| } |
| } |
| |
| impl FlexibleBits { |
| #[inline(always)] |
| pub fn from_bits_allow_unknown(bits: u64) -> Self { |
| unsafe { Self::from_bits_unchecked(bits) } |
| } |
| |
| #[inline(always)] |
| pub fn has_unknown_bits(&self) -> bool { |
| self.get_unknown_bits() != 0 |
| } |
| |
| #[inline(always)] |
| pub fn get_unknown_bits(&self) -> u64 { |
| self.bits & !Self::all().bits |
| } |
| } |
| |
| fidl_bits! { |
| name: FlexibleBits, |
| prim_ty: u64, |
| flexible: true, |
| } |
| |
| bitflags! { |
| pub struct MyBits: u32 { |
| const MY_FIRST_BIT = 1; |
| const MY_OTHER_BIT = 2; |
| const MASK = 4; |
| } |
| } |
| |
| impl MyBits { |
| #[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: MyBits, |
| prim_ty: u32, |
| strict: true, |
| } |
| |
| bitflags! { |
| pub struct StrictBits: u64 { |
| const SMALLEST = 1; |
| const BIGGEST = 9223372036854775808; |
| } |
| } |
| |
| impl StrictBits { |
| #[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) -> u64 { |
| 0 |
| } |
| } |
| |
| fidl_bits! { |
| name: StrictBits, |
| prim_ty: u64, |
| strict: true, |
| } |