#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type CategoryDescription = String;
pub type CategoryName = String;
pub type EnabledCategoryList = Vec<String>;
pub type ProviderId = u32;
pub type ProviderName = String;
pub const MAX_CATEGORY_DESCRIPTION_LENGTH: u32 = 400;
pub const MAX_CATEGORY_NAME_LENGTH: u32 = 100;
pub const MAX_NUM_ENABLED_CATEGORIES: u32 = 5000;
pub const MAX_NUM_KNOWN_CATEGORIES: u32 = 5000;
pub const MAX_PROVIDER_NAME_LENGTH: u32 = 100;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum BufferDisposition {
ClearEntire = 1,
ClearNondurable = 2,
Retain = 3,
}
impl BufferDisposition {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::ClearEntire),
2 => Some(Self::ClearNondurable),
3 => Some(Self::Retain),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum BufferingMode {
Oneshot = 1,
Circular = 2,
Streaming = 3,
}
impl BufferingMode {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Oneshot),
2 => Some(Self::Circular),
3 => Some(Self::Streaming),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct KnownCategory {
pub name: String,
pub description: String,
}
impl fidl::Persistable for KnownCategory {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for BufferDisposition {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for BufferDisposition {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for BufferDisposition
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferDisposition {
#[inline(always)]
fn new_empty() -> Self {
Self::ClearEntire
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BufferingMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for BufferingMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BufferingMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferingMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Oneshot
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for KnownCategory {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for KnownCategory {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<KnownCategory, D>
for &KnownCategory
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<KnownCategory>(offset);
fidl::encoding::Encode::<KnownCategory, D>::encode(
(
<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<fidl::encoding::BoundedString<400> as fidl::encoding::ValueTypeMarker>::borrow(
&self.description,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<400>, D>,
> fidl::encoding::Encode<KnownCategory, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<KnownCategory>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KnownCategory {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<100>, D),
description: fidl::new_empty!(fidl::encoding::BoundedString<400>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<100>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<400>,
D,
&mut self.description,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
}