#![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 const LIGHT_NAME_LEN: u8 = 32;
pub const METADATA_TYPE_NAME: &str = "fuchsia.hardware.light.Metadata";
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Capability {
Brightness = 1,
Rgb = 2,
Simple = 3,
}
impl Capability {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Brightness),
2 => Some(Self::Rgb),
3 => Some(Self::Simple),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[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(u32)]
pub enum LightError {
Ok = 0,
NotSupported = 1,
InvalidIndex = 2,
Failed = 3,
}
impl LightError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Ok),
1 => Some(Self::NotSupported),
2 => Some(Self::InvalidIndex),
3 => Some(Self::Failed),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[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 GroupInfo {
pub name: String,
pub count: u32,
pub capability: Capability,
}
impl fidl::Persistable for GroupInfo {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Info {
pub name: String,
pub capability: Capability,
}
impl fidl::Persistable for Info {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetCurrentBrightnessValueRequest {
pub index: u32,
}
impl fidl::Persistable for LightGetCurrentBrightnessValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetCurrentRgbValueRequest {
pub index: u32,
}
impl fidl::Persistable for LightGetCurrentRgbValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetCurrentSimpleValueRequest {
pub index: u32,
}
impl fidl::Persistable for LightGetCurrentSimpleValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetGroupCurrentBrightnessValueRequest {
pub group_id: u32,
}
impl fidl::Persistable for LightGetGroupCurrentBrightnessValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetGroupCurrentRgbValueRequest {
pub group_id: u32,
}
impl fidl::Persistable for LightGetGroupCurrentRgbValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetGroupCurrentSimpleValueRequest {
pub group_id: u32,
}
impl fidl::Persistable for LightGetGroupCurrentSimpleValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetGroupInfoRequest {
pub group_id: u32,
}
impl fidl::Persistable for LightGetGroupInfoRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetInfoRequest {
pub index: u32,
}
impl fidl::Persistable for LightGetInfoRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetNumLightGroupsResponse {
pub count: u32,
}
impl fidl::Persistable for LightGetNumLightGroupsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LightGetNumLightsResponse {
pub count: u32,
}
impl fidl::Persistable for LightGetNumLightsResponse {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct LightSetBrightnessValueRequest {
pub index: u32,
pub value: f64,
}
impl fidl::Persistable for LightSetBrightnessValueRequest {}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct LightSetGroupBrightnessValueRequest {
pub group_id: u32,
pub values: Vec<f64>,
}
impl fidl::Persistable for LightSetGroupBrightnessValueRequest {}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct LightSetGroupRgbValueRequest {
pub group_id: u32,
pub values: Vec<Rgb>,
}
impl fidl::Persistable for LightSetGroupRgbValueRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightSetGroupSimpleValueRequest {
pub group_id: u32,
pub values: Vec<bool>,
}
impl fidl::Persistable for LightSetGroupSimpleValueRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct LightSetRgbValueRequest {
pub index: u32,
pub value: Rgb,
}
impl fidl::Persistable for LightSetRgbValueRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightSetSimpleValueRequest {
pub index: u32,
pub value: bool,
}
impl fidl::Persistable for LightSetSimpleValueRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct LightGetCurrentBrightnessValueResponse {
pub value: f64,
}
impl fidl::Persistable for LightGetCurrentBrightnessValueResponse {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct LightGetCurrentRgbValueResponse {
pub value: Rgb,
}
impl fidl::Persistable for LightGetCurrentRgbValueResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightGetCurrentSimpleValueResponse {
pub value: bool,
}
impl fidl::Persistable for LightGetCurrentSimpleValueResponse {}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct LightGetGroupCurrentBrightnessValueResponse {
pub values: Option<Vec<f64>>,
}
impl fidl::Persistable for LightGetGroupCurrentBrightnessValueResponse {}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct LightGetGroupCurrentRgbValueResponse {
pub values: Option<Vec<Rgb>>,
}
impl fidl::Persistable for LightGetGroupCurrentRgbValueResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightGetGroupCurrentSimpleValueResponse {
pub values: Option<Vec<bool>>,
}
impl fidl::Persistable for LightGetGroupCurrentSimpleValueResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightGetGroupInfoResponse {
pub info: GroupInfo,
}
impl fidl::Persistable for LightGetGroupInfoResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LightGetInfoResponse {
pub info: Info,
}
impl fidl::Persistable for LightGetInfoResponse {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Rgb {
pub red: f64,
pub green: f64,
pub blue: f64,
}
impl fidl::Persistable for Rgb {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Config {
pub name: Option<String>,
pub brightness: Option<bool>,
pub rgb: Option<bool>,
pub init_on: Option<bool>,
pub group_id: Option<i32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Config {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Metadata {
pub configs: Option<Vec<Config>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Metadata {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LightMarker;
impl fidl::endpoints::ProtocolMarker for LightMarker {
type Proxy = LightProxy;
type RequestStream = LightRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LightSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.hardware.light.Light";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LightMarker {}
pub type LightGetInfoResult = Result<Info, LightError>;
pub type LightGetCurrentSimpleValueResult = Result<bool, LightError>;
pub type LightSetSimpleValueResult = Result<(), LightError>;
pub type LightGetCurrentBrightnessValueResult = Result<f64, LightError>;
pub type LightSetBrightnessValueResult = Result<(), LightError>;
pub type LightGetCurrentRgbValueResult = Result<Rgb, LightError>;
pub type LightSetRgbValueResult = Result<(), LightError>;
pub type LightGetGroupInfoResult = Result<GroupInfo, LightError>;
pub type LightGetGroupCurrentSimpleValueResult = Result<Option<Vec<bool>>, LightError>;
pub type LightSetGroupSimpleValueResult = Result<(), LightError>;
pub type LightGetGroupCurrentBrightnessValueResult = Result<Option<Vec<f64>>, LightError>;
pub type LightSetGroupBrightnessValueResult = Result<(), LightError>;
pub type LightGetGroupCurrentRgbValueResult = Result<Option<Vec<Rgb>>, LightError>;
pub type LightSetGroupRgbValueResult = Result<(), LightError>;
pub trait LightProxyInterface: Send + Sync {
type GetNumLightsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut;
type GetNumLightGroupsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut;
type GetInfoResponseFut: std::future::Future<Output = Result<LightGetInfoResult, fidl::Error>>
+ Send;
fn r#get_info(&self, index: u32) -> Self::GetInfoResponseFut;
type GetCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetCurrentSimpleValueResult, fidl::Error>>
+ Send;
fn r#get_current_simple_value(&self, index: u32) -> Self::GetCurrentSimpleValueResponseFut;
type SetSimpleValueResponseFut: std::future::Future<Output = Result<LightSetSimpleValueResult, fidl::Error>>
+ Send;
fn r#set_simple_value(&self, index: u32, value: bool) -> Self::SetSimpleValueResponseFut;
type GetCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetCurrentBrightnessValueResult, fidl::Error>>
+ Send;
fn r#get_current_brightness_value(
&self,
index: u32,
) -> Self::GetCurrentBrightnessValueResponseFut;
type SetBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetBrightnessValueResult, fidl::Error>>
+ Send;
fn r#set_brightness_value(&self, index: u32, value: f64)
-> Self::SetBrightnessValueResponseFut;
type GetCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetCurrentRgbValueResult, fidl::Error>>
+ Send;
fn r#get_current_rgb_value(&self, index: u32) -> Self::GetCurrentRgbValueResponseFut;
type SetRgbValueResponseFut: std::future::Future<Output = Result<LightSetRgbValueResult, fidl::Error>>
+ Send;
fn r#set_rgb_value(&self, index: u32, value: &Rgb) -> Self::SetRgbValueResponseFut;
type GetGroupInfoResponseFut: std::future::Future<Output = Result<LightGetGroupInfoResult, fidl::Error>>
+ Send;
fn r#get_group_info(&self, group_id: u32) -> Self::GetGroupInfoResponseFut;
type GetGroupCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentSimpleValueResult, fidl::Error>>
+ Send;
fn r#get_group_current_simple_value(
&self,
group_id: u32,
) -> Self::GetGroupCurrentSimpleValueResponseFut;
type SetGroupSimpleValueResponseFut: std::future::Future<Output = Result<LightSetGroupSimpleValueResult, fidl::Error>>
+ Send;
fn r#set_group_simple_value(
&self,
group_id: u32,
values: &[bool],
) -> Self::SetGroupSimpleValueResponseFut;
type GetGroupCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error>>
+ Send;
fn r#get_group_current_brightness_value(
&self,
group_id: u32,
) -> Self::GetGroupCurrentBrightnessValueResponseFut;
type SetGroupBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetGroupBrightnessValueResult, fidl::Error>>
+ Send;
fn r#set_group_brightness_value(
&self,
group_id: u32,
values: &[f64],
) -> Self::SetGroupBrightnessValueResponseFut;
type GetGroupCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentRgbValueResult, fidl::Error>>
+ Send;
fn r#get_group_current_rgb_value(
&self,
group_id: u32,
) -> Self::GetGroupCurrentRgbValueResponseFut;
type SetGroupRgbValueResponseFut: std::future::Future<Output = Result<LightSetGroupRgbValueResult, fidl::Error>>
+ Send;
fn r#set_group_rgb_value(
&self,
group_id: u32,
values: &[Rgb],
) -> Self::SetGroupRgbValueResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LightSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LightSynchronousProxy {
type Proxy = LightProxy;
type Protocol = LightMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl LightSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<LightEvent, fidl::Error> {
LightEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_num_lights(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, LightGetNumLightsResponse>(
(),
0x7ae2bd2ef8062dbb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.count)
}
pub fn r#get_num_light_groups(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u32, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, LightGetNumLightGroupsResponse>(
(),
0x600895db5a7cbf0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.count)
}
pub fn r#get_info(
&self,
mut index: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetInfoResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetInfoRequest,
fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
>(
(index,),
0x4229b55c8c4bd529,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.info))
}
pub fn r#get_current_simple_value(
&self,
mut index: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetCurrentSimpleValueRequest,
fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
>(
(index,),
0x183154896336c321,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_simple_value(
&self,
mut index: u32,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<LightSetSimpleValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetSimpleValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(index, value,),
0x4fb33d84c1aad81d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_current_brightness_value(
&self,
mut index: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetCurrentBrightnessValueRequest,
fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
>(
(index,),
0x2d387e129fe84809,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_brightness_value(
&self,
mut index: u32,
mut value: f64,
___deadline: zx::MonotonicInstant,
) -> Result<LightSetBrightnessValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetBrightnessValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(index, value,),
0x17cada93c7c48661,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_current_rgb_value(
&self,
mut index: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetCurrentRgbValueRequest,
fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
>(
(index,),
0x49965ac0d920f4ad,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_rgb_value(
&self,
mut index: u32,
mut value: &Rgb,
___deadline: zx::MonotonicInstant,
) -> Result<LightSetRgbValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetRgbValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(index, value,),
0x2b354d18be0b70a4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_group_info(
&self,
mut group_id: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetGroupInfoResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetGroupInfoRequest,
fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
>(
(group_id,),
0x5b27b0ca755b470b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.info))
}
pub fn r#get_group_current_simple_value(
&self,
mut group_id: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetGroupCurrentSimpleValueRequest,
fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
>(
(group_id,),
0x659d9bdb5cc2201,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.values))
}
pub fn r#set_group_simple_value(
&self,
mut group_id: u32,
mut values: &[bool],
___deadline: zx::MonotonicInstant,
) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetGroupSimpleValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(group_id, values,),
0x924234e74cc6dd8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_group_current_brightness_value(
&self,
mut group_id: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetGroupCurrentBrightnessValueRequest,
fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
>(
(group_id,),
0x3ab226120b0d0362,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.values))
}
pub fn r#set_group_brightness_value(
&self,
mut group_id: u32,
mut values: &[f64],
___deadline: zx::MonotonicInstant,
) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetGroupBrightnessValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(group_id, values,),
0x79e5f248fc5ec7ae,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_group_current_rgb_value(
&self,
mut group_id: u32,
___deadline: zx::MonotonicInstant,
) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightGetGroupCurrentRgbValueRequest,
fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
>(
(group_id,),
0x2a6014b41254f617,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.values))
}
pub fn r#set_group_rgb_value(
&self,
mut group_id: u32,
mut values: &[Rgb],
___deadline: zx::MonotonicInstant,
) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
let _response = self.client.send_query::<
LightSetGroupRgbValueRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
>(
(group_id, values,),
0x33c92316f251e4e4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct LightProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LightProxy {
type Protocol = LightMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl LightProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LightEventStream {
LightEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_num_lights(
&self,
) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
LightProxyInterface::r#get_num_lights(self)
}
pub fn r#get_num_light_groups(
&self,
) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
LightProxyInterface::r#get_num_light_groups(self)
}
pub fn r#get_info(
&self,
mut index: u32,
) -> fidl::client::QueryResponseFut<
LightGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_info(self, index)
}
pub fn r#get_current_simple_value(
&self,
mut index: u32,
) -> fidl::client::QueryResponseFut<
LightGetCurrentSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_current_simple_value(self, index)
}
pub fn r#set_simple_value(
&self,
mut index: u32,
mut value: bool,
) -> fidl::client::QueryResponseFut<
LightSetSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_simple_value(self, index, value)
}
pub fn r#get_current_brightness_value(
&self,
mut index: u32,
) -> fidl::client::QueryResponseFut<
LightGetCurrentBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_current_brightness_value(self, index)
}
pub fn r#set_brightness_value(
&self,
mut index: u32,
mut value: f64,
) -> fidl::client::QueryResponseFut<
LightSetBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_brightness_value(self, index, value)
}
pub fn r#get_current_rgb_value(
&self,
mut index: u32,
) -> fidl::client::QueryResponseFut<
LightGetCurrentRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_current_rgb_value(self, index)
}
pub fn r#set_rgb_value(
&self,
mut index: u32,
mut value: &Rgb,
) -> fidl::client::QueryResponseFut<
LightSetRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_rgb_value(self, index, value)
}
pub fn r#get_group_info(
&self,
mut group_id: u32,
) -> fidl::client::QueryResponseFut<
LightGetGroupInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_group_info(self, group_id)
}
pub fn r#get_group_current_simple_value(
&self,
mut group_id: u32,
) -> fidl::client::QueryResponseFut<
LightGetGroupCurrentSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_group_current_simple_value(self, group_id)
}
pub fn r#set_group_simple_value(
&self,
mut group_id: u32,
mut values: &[bool],
) -> fidl::client::QueryResponseFut<
LightSetGroupSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_group_simple_value(self, group_id, values)
}
pub fn r#get_group_current_brightness_value(
&self,
mut group_id: u32,
) -> fidl::client::QueryResponseFut<
LightGetGroupCurrentBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_group_current_brightness_value(self, group_id)
}
pub fn r#set_group_brightness_value(
&self,
mut group_id: u32,
mut values: &[f64],
) -> fidl::client::QueryResponseFut<
LightSetGroupBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_group_brightness_value(self, group_id, values)
}
pub fn r#get_group_current_rgb_value(
&self,
mut group_id: u32,
) -> fidl::client::QueryResponseFut<
LightGetGroupCurrentRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#get_group_current_rgb_value(self, group_id)
}
pub fn r#set_group_rgb_value(
&self,
mut group_id: u32,
mut values: &[Rgb],
) -> fidl::client::QueryResponseFut<
LightSetGroupRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LightProxyInterface::r#set_group_rgb_value(self, group_id, values)
}
}
impl LightProxyInterface for LightProxy {
type GetNumLightsResponseFut =
fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
LightGetNumLightsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7ae2bd2ef8062dbb,
>(_buf?)?;
Ok(_response.count)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
(),
0x7ae2bd2ef8062dbb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNumLightGroupsResponseFut =
fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
LightGetNumLightGroupsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x600895db5a7cbf0,
>(_buf?)?;
Ok(_response.count)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
(),
0x600895db5a7cbf0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetInfoResponseFut = fidl::client::QueryResponseFut<
LightGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_info(&self, mut index: u32) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4229b55c8c4bd529,
>(_buf?)?;
Ok(_response.map(|x| x.info))
}
self.client.send_query_and_decode::<LightGetInfoRequest, LightGetInfoResult>(
(index,),
0x4229b55c8c4bd529,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
LightGetCurrentSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_current_simple_value(&self, mut index: u32) -> Self::GetCurrentSimpleValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x183154896336c321,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
LightGetCurrentSimpleValueRequest,
LightGetCurrentSimpleValueResult,
>(
(index,),
0x183154896336c321,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetSimpleValueResponseFut = fidl::client::QueryResponseFut<
LightSetSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_simple_value(
&self,
mut index: u32,
mut value: bool,
) -> Self::SetSimpleValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetSimpleValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4fb33d84c1aad81d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LightSetSimpleValueRequest, LightSetSimpleValueResult>(
(index, value),
0x4fb33d84c1aad81d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
LightGetCurrentBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_current_brightness_value(
&self,
mut index: u32,
) -> Self::GetCurrentBrightnessValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2d387e129fe84809,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
LightGetCurrentBrightnessValueRequest,
LightGetCurrentBrightnessValueResult,
>(
(index,),
0x2d387e129fe84809,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetBrightnessValueResponseFut = fidl::client::QueryResponseFut<
LightSetBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_brightness_value(
&self,
mut index: u32,
mut value: f64,
) -> Self::SetBrightnessValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetBrightnessValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x17cada93c7c48661,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<LightSetBrightnessValueRequest, LightSetBrightnessValueResult>(
(index, value),
0x17cada93c7c48661,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
LightGetCurrentRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_current_rgb_value(&self, mut index: u32) -> Self::GetCurrentRgbValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x49965ac0d920f4ad,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client
.send_query_and_decode::<LightGetCurrentRgbValueRequest, LightGetCurrentRgbValueResult>(
(index,),
0x49965ac0d920f4ad,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetRgbValueResponseFut = fidl::client::QueryResponseFut<
LightSetRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_rgb_value(&self, mut index: u32, mut value: &Rgb) -> Self::SetRgbValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetRgbValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2b354d18be0b70a4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LightSetRgbValueRequest, LightSetRgbValueResult>(
(index, value),
0x2b354d18be0b70a4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetGroupInfoResponseFut = fidl::client::QueryResponseFut<
LightGetGroupInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_group_info(&self, mut group_id: u32) -> Self::GetGroupInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetGroupInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b27b0ca755b470b,
>(_buf?)?;
Ok(_response.map(|x| x.info))
}
self.client.send_query_and_decode::<LightGetGroupInfoRequest, LightGetGroupInfoResult>(
(group_id,),
0x5b27b0ca755b470b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetGroupCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
LightGetGroupCurrentSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_group_current_simple_value(
&self,
mut group_id: u32,
) -> Self::GetGroupCurrentSimpleValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x659d9bdb5cc2201,
>(_buf?)?;
Ok(_response.map(|x| x.values))
}
self.client.send_query_and_decode::<
LightGetGroupCurrentSimpleValueRequest,
LightGetGroupCurrentSimpleValueResult,
>(
(group_id,),
0x659d9bdb5cc2201,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetGroupSimpleValueResponseFut = fidl::client::QueryResponseFut<
LightSetGroupSimpleValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_group_simple_value(
&self,
mut group_id: u32,
mut values: &[bool],
) -> Self::SetGroupSimpleValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x924234e74cc6dd8,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LightSetGroupSimpleValueRequest,
LightSetGroupSimpleValueResult,
>(
(group_id, values,),
0x924234e74cc6dd8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetGroupCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
LightGetGroupCurrentBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_group_current_brightness_value(
&self,
mut group_id: u32,
) -> Self::GetGroupCurrentBrightnessValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3ab226120b0d0362,
>(_buf?)?;
Ok(_response.map(|x| x.values))
}
self.client.send_query_and_decode::<
LightGetGroupCurrentBrightnessValueRequest,
LightGetGroupCurrentBrightnessValueResult,
>(
(group_id,),
0x3ab226120b0d0362,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetGroupBrightnessValueResponseFut = fidl::client::QueryResponseFut<
LightSetGroupBrightnessValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_group_brightness_value(
&self,
mut group_id: u32,
mut values: &[f64],
) -> Self::SetGroupBrightnessValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x79e5f248fc5ec7ae,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LightSetGroupBrightnessValueRequest,
LightSetGroupBrightnessValueResult,
>(
(group_id, values,),
0x79e5f248fc5ec7ae,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetGroupCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
LightGetGroupCurrentRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_group_current_rgb_value(
&self,
mut group_id: u32,
) -> Self::GetGroupCurrentRgbValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2a6014b41254f617,
>(_buf?)?;
Ok(_response.map(|x| x.values))
}
self.client.send_query_and_decode::<
LightGetGroupCurrentRgbValueRequest,
LightGetGroupCurrentRgbValueResult,
>(
(group_id,),
0x2a6014b41254f617,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetGroupRgbValueResponseFut = fidl::client::QueryResponseFut<
LightSetGroupRgbValueResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_group_rgb_value(
&self,
mut group_id: u32,
mut values: &[Rgb],
) -> Self::SetGroupRgbValueResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x33c92316f251e4e4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<LightSetGroupRgbValueRequest, LightSetGroupRgbValueResult>(
(group_id, values),
0x33c92316f251e4e4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct LightEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LightEventStream {}
impl futures::stream::FusedStream for LightEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LightEventStream {
type Item = Result<LightEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(LightEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LightEvent {}
impl LightEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LightEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LightRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LightRequestStream {}
impl futures::stream::FusedStream for LightRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LightRequestStream {
type Protocol = LightMarker;
type ControlHandle = LightControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
LightControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for LightRequestStream {
type Item = Result<LightRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled LightRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x7ae2bd2ef8062dbb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetNumLights {
responder: LightGetNumLightsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x600895db5a7cbf0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetNumLightGroups {
responder: LightGetNumLightGroupsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4229b55c8c4bd529 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetInfo {
index: req.index,
responder: LightGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x183154896336c321 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetCurrentSimpleValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetCurrentSimpleValue {
index: req.index,
responder: LightGetCurrentSimpleValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4fb33d84c1aad81d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetSimpleValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetSimpleValue {
index: req.index,
value: req.value,
responder: LightSetSimpleValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2d387e129fe84809 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetCurrentBrightnessValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetCurrentBrightnessValue {
index: req.index,
responder: LightGetCurrentBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x17cada93c7c48661 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetBrightnessValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetBrightnessValue {
index: req.index,
value: req.value,
responder: LightSetBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x49965ac0d920f4ad => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetCurrentRgbValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetCurrentRgbValue {
index: req.index,
responder: LightGetCurrentRgbValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2b354d18be0b70a4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetRgbValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetRgbValue {
index: req.index,
value: req.value,
responder: LightSetRgbValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b27b0ca755b470b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetGroupInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetGroupInfo {
group_id: req.group_id,
responder: LightGetGroupInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x659d9bdb5cc2201 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetGroupCurrentSimpleValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetGroupCurrentSimpleValue {
group_id: req.group_id,
responder: LightGetGroupCurrentSimpleValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x924234e74cc6dd8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetGroupSimpleValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetGroupSimpleValue {
group_id: req.group_id,
values: req.values,
responder: LightSetGroupSimpleValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3ab226120b0d0362 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetGroupCurrentBrightnessValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetGroupCurrentBrightnessValue {
group_id: req.group_id,
responder: LightGetGroupCurrentBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x79e5f248fc5ec7ae => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetGroupBrightnessValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetGroupBrightnessValue {
group_id: req.group_id,
values: req.values,
responder: LightSetGroupBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2a6014b41254f617 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightGetGroupCurrentRgbValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::GetGroupCurrentRgbValue {
group_id: req.group_id,
responder: LightGetGroupCurrentRgbValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x33c92316f251e4e4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LightSetGroupRgbValueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LightControlHandle { inner: this.inner.clone() };
Ok(LightRequest::SetGroupRgbValue {
group_id: req.group_id,
values: req.values,
responder: LightSetGroupRgbValueResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LightRequest {
GetNumLights { responder: LightGetNumLightsResponder },
GetNumLightGroups { responder: LightGetNumLightGroupsResponder },
GetInfo { index: u32, responder: LightGetInfoResponder },
GetCurrentSimpleValue { index: u32, responder: LightGetCurrentSimpleValueResponder },
SetSimpleValue { index: u32, value: bool, responder: LightSetSimpleValueResponder },
GetCurrentBrightnessValue { index: u32, responder: LightGetCurrentBrightnessValueResponder },
SetBrightnessValue { index: u32, value: f64, responder: LightSetBrightnessValueResponder },
GetCurrentRgbValue { index: u32, responder: LightGetCurrentRgbValueResponder },
SetRgbValue { index: u32, value: Rgb, responder: LightSetRgbValueResponder },
GetGroupInfo { group_id: u32, responder: LightGetGroupInfoResponder },
GetGroupCurrentSimpleValue {
group_id: u32,
responder: LightGetGroupCurrentSimpleValueResponder,
},
SetGroupSimpleValue {
group_id: u32,
values: Vec<bool>,
responder: LightSetGroupSimpleValueResponder,
},
GetGroupCurrentBrightnessValue {
group_id: u32,
responder: LightGetGroupCurrentBrightnessValueResponder,
},
SetGroupBrightnessValue {
group_id: u32,
values: Vec<f64>,
responder: LightSetGroupBrightnessValueResponder,
},
GetGroupCurrentRgbValue { group_id: u32, responder: LightGetGroupCurrentRgbValueResponder },
SetGroupRgbValue { group_id: u32, values: Vec<Rgb>, responder: LightSetGroupRgbValueResponder },
}
impl LightRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_num_lights(self) -> Option<(LightGetNumLightsResponder)> {
if let LightRequest::GetNumLights { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_num_light_groups(self) -> Option<(LightGetNumLightGroupsResponder)> {
if let LightRequest::GetNumLightGroups { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(u32, LightGetInfoResponder)> {
if let LightRequest::GetInfo { index, responder } = self {
Some((index, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_current_simple_value(
self,
) -> Option<(u32, LightGetCurrentSimpleValueResponder)> {
if let LightRequest::GetCurrentSimpleValue { index, responder } = self {
Some((index, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_simple_value(self) -> Option<(u32, bool, LightSetSimpleValueResponder)> {
if let LightRequest::SetSimpleValue { index, value, responder } = self {
Some((index, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_current_brightness_value(
self,
) -> Option<(u32, LightGetCurrentBrightnessValueResponder)> {
if let LightRequest::GetCurrentBrightnessValue { index, responder } = self {
Some((index, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_brightness_value(self) -> Option<(u32, f64, LightSetBrightnessValueResponder)> {
if let LightRequest::SetBrightnessValue { index, value, responder } = self {
Some((index, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_current_rgb_value(self) -> Option<(u32, LightGetCurrentRgbValueResponder)> {
if let LightRequest::GetCurrentRgbValue { index, responder } = self {
Some((index, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_rgb_value(self) -> Option<(u32, Rgb, LightSetRgbValueResponder)> {
if let LightRequest::SetRgbValue { index, value, responder } = self {
Some((index, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_group_info(self) -> Option<(u32, LightGetGroupInfoResponder)> {
if let LightRequest::GetGroupInfo { group_id, responder } = self {
Some((group_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_group_current_simple_value(
self,
) -> Option<(u32, LightGetGroupCurrentSimpleValueResponder)> {
if let LightRequest::GetGroupCurrentSimpleValue { group_id, responder } = self {
Some((group_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_group_simple_value(
self,
) -> Option<(u32, Vec<bool>, LightSetGroupSimpleValueResponder)> {
if let LightRequest::SetGroupSimpleValue { group_id, values, responder } = self {
Some((group_id, values, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_group_current_brightness_value(
self,
) -> Option<(u32, LightGetGroupCurrentBrightnessValueResponder)> {
if let LightRequest::GetGroupCurrentBrightnessValue { group_id, responder } = self {
Some((group_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_group_brightness_value(
self,
) -> Option<(u32, Vec<f64>, LightSetGroupBrightnessValueResponder)> {
if let LightRequest::SetGroupBrightnessValue { group_id, values, responder } = self {
Some((group_id, values, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_group_current_rgb_value(
self,
) -> Option<(u32, LightGetGroupCurrentRgbValueResponder)> {
if let LightRequest::GetGroupCurrentRgbValue { group_id, responder } = self {
Some((group_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_group_rgb_value(
self,
) -> Option<(u32, Vec<Rgb>, LightSetGroupRgbValueResponder)> {
if let LightRequest::SetGroupRgbValue { group_id, values, responder } = self {
Some((group_id, values, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LightRequest::GetNumLights { .. } => "get_num_lights",
LightRequest::GetNumLightGroups { .. } => "get_num_light_groups",
LightRequest::GetInfo { .. } => "get_info",
LightRequest::GetCurrentSimpleValue { .. } => "get_current_simple_value",
LightRequest::SetSimpleValue { .. } => "set_simple_value",
LightRequest::GetCurrentBrightnessValue { .. } => "get_current_brightness_value",
LightRequest::SetBrightnessValue { .. } => "set_brightness_value",
LightRequest::GetCurrentRgbValue { .. } => "get_current_rgb_value",
LightRequest::SetRgbValue { .. } => "set_rgb_value",
LightRequest::GetGroupInfo { .. } => "get_group_info",
LightRequest::GetGroupCurrentSimpleValue { .. } => "get_group_current_simple_value",
LightRequest::SetGroupSimpleValue { .. } => "set_group_simple_value",
LightRequest::GetGroupCurrentBrightnessValue { .. } => {
"get_group_current_brightness_value"
}
LightRequest::SetGroupBrightnessValue { .. } => "set_group_brightness_value",
LightRequest::GetGroupCurrentRgbValue { .. } => "get_group_current_rgb_value",
LightRequest::SetGroupRgbValue { .. } => "set_group_rgb_value",
}
}
}
#[derive(Debug, Clone)]
pub struct LightControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LightControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl LightControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetNumLightsResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetNumLightsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetNumLightsResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetNumLightsResponder {
pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<LightGetNumLightsResponse>(
(count,),
self.tx_id,
0x7ae2bd2ef8062dbb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetNumLightGroupsResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetNumLightGroupsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetNumLightGroupsResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetNumLightGroupsResponder {
pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<LightGetNumLightGroupsResponse>(
(count,),
self.tx_id,
0x600895db5a7cbf0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetInfoResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetInfoResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetInfoResponder {
pub fn send(self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Info, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<LightGetInfoResponse, LightError>>(
result.map(|info| (info,)),
self.tx_id,
0x4229b55c8c4bd529,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetCurrentSimpleValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetCurrentSimpleValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetCurrentSimpleValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetCurrentSimpleValueResponder {
pub fn send(self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetCurrentSimpleValueResponse,
LightError,
>>(
result.map(|value| (value,)),
self.tx_id,
0x183154896336c321,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetSimpleValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetSimpleValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetSimpleValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetSimpleValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x4fb33d84c1aad81d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetCurrentBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetCurrentBrightnessValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetCurrentBrightnessValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetCurrentBrightnessValueResponder {
pub fn send(self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<f64, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetCurrentBrightnessValueResponse,
LightError,
>>(
result.map(|value| (value,)),
self.tx_id,
0x2d387e129fe84809,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetBrightnessValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetBrightnessValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetBrightnessValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x17cada93c7c48661,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetCurrentRgbValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetCurrentRgbValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetCurrentRgbValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetCurrentRgbValueResponder {
pub fn send(self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Rgb, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetCurrentRgbValueResponse,
LightError,
>>(
result.map(|value| (value,)),
self.tx_id,
0x49965ac0d920f4ad,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetRgbValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetRgbValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetRgbValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetRgbValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x2b354d18be0b70a4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetGroupInfoResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetGroupInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetGroupInfoResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetGroupInfoResponder {
pub fn send(self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&GroupInfo, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>>(
result.map(|info| (info,)),
self.tx_id,
0x5b27b0ca755b470b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetGroupCurrentSimpleValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetGroupCurrentSimpleValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetGroupCurrentSimpleValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetGroupCurrentSimpleValueResponder {
pub fn send(self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<Option<&[bool]>, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetGroupCurrentSimpleValueResponse,
LightError,
>>(
result.map(|values| (values,)),
self.tx_id,
0x659d9bdb5cc2201,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetGroupSimpleValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetGroupSimpleValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetGroupSimpleValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetGroupSimpleValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x924234e74cc6dd8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetGroupCurrentBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetGroupCurrentBrightnessValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetGroupCurrentBrightnessValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetGroupCurrentBrightnessValueResponder {
pub fn send(self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<Option<&[f64]>, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetGroupCurrentBrightnessValueResponse,
LightError,
>>(
result.map(|values| (values,)),
self.tx_id,
0x3ab226120b0d0362,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetGroupBrightnessValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetGroupBrightnessValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetGroupBrightnessValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetGroupBrightnessValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x79e5f248fc5ec7ae,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightGetGroupCurrentRgbValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightGetGroupCurrentRgbValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightGetGroupCurrentRgbValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightGetGroupCurrentRgbValueResponder {
pub fn send(self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<Option<&[Rgb]>, LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LightGetGroupCurrentRgbValueResponse,
LightError,
>>(
result.map(|values| (values,)),
self.tx_id,
0x2a6014b41254f617,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LightSetGroupRgbValueResponder {
control_handle: std::mem::ManuallyDrop<LightControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LightSetGroupRgbValueResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LightSetGroupRgbValueResponder {
type ControlHandle = LightControlHandle;
fn control_handle(&self) -> &LightControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LightSetGroupRgbValueResponder {
pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), LightError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
result,
self.tx_id,
0x33c92316f251e4e4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Capability {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Capability {
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 Capability {
#[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 Capability {
#[inline(always)]
fn new_empty() -> Self {
Self::Brightness
}
#[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::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LightError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for LightError {
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 LightError {
#[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 LightError {
#[inline(always)]
fn new_empty() -> Self {
Self::Ok
}
#[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::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GroupInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GroupInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GroupInfo, D>
for &GroupInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GroupInfo>(offset);
fidl::encoding::Encode::<GroupInfo, D>::encode(
(
<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
<Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<Capability, D>,
> fidl::encoding::Encode<GroupInfo, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GroupInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GroupInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
count: fidl::new_empty!(u32, D),
capability: fidl::new_empty!(Capability, 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<32>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u32, D, &mut self.count, decoder, offset + 16, _depth)?;
fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 20, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Info {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Info {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Info>(offset);
fidl::encoding::Encode::<Info, D>::encode(
(
<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
T1: fidl::encoding::Encode<Capability, D>,
> fidl::encoding::Encode<Info, 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::<Info>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
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 Info {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
capability: fidl::new_empty!(Capability, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<32>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D>
for &LightGetCurrentBrightnessValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetCurrentBrightnessValueRequest)
.write_unaligned((self as *const LightGetCurrentBrightnessValueRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentBrightnessValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D>
for &LightGetCurrentRgbValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetCurrentRgbValueRequest)
.write_unaligned((self as *const LightGetCurrentRgbValueRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentRgbValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D>
for &LightGetCurrentSimpleValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetCurrentSimpleValueRequest)
.write_unaligned((self as *const LightGetCurrentSimpleValueRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentSimpleValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D>
for &LightGetGroupCurrentBrightnessValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetGroupCurrentBrightnessValueRequest).write_unaligned(
(self as *const LightGetGroupCurrentBrightnessValueRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentBrightnessValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { group_id: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D>
for &LightGetGroupCurrentRgbValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetGroupCurrentRgbValueRequest)
.write_unaligned((self as *const LightGetGroupCurrentRgbValueRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentRgbValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { group_id: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D>
for &LightGetGroupCurrentSimpleValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetGroupCurrentSimpleValueRequest).write_unaligned(
(self as *const LightGetGroupCurrentSimpleValueRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentSimpleValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { group_id: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupInfoRequest, D> for &LightGetGroupInfoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetGroupInfoRequest)
.write_unaligned((self as *const LightGetGroupInfoRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetGroupInfoRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupInfoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { group_id: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetInfoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoRequest, D>
for &LightGetInfoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetInfoRequest)
.write_unaligned((self as *const LightGetInfoRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetInfoRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetNumLightGroupsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetNumLightGroupsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetNumLightGroupsResponse, D>
for &LightGetNumLightGroupsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetNumLightGroupsResponse)
.write_unaligned((self as *const LightGetNumLightGroupsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetNumLightGroupsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetNumLightGroupsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetNumLightsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetNumLightsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetNumLightsResponse, D> for &LightGetNumLightsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LightGetNumLightsResponse)
.write_unaligned((self as *const LightGetNumLightsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LightGetNumLightsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetNumLightsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetBrightnessValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetBrightnessValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightSetBrightnessValueRequest, D>
for &LightSetBrightnessValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
fidl::encoding::Encode::<LightSetBrightnessValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<f64, D>,
> fidl::encoding::Encode<LightSetBrightnessValueRequest, 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::<LightSetBrightnessValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetBrightnessValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(f64, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
fidl::decode!(f64, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetGroupBrightnessValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetGroupBrightnessValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D>
for &LightSetGroupBrightnessValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
fidl::encoding::Encode::<LightSetGroupBrightnessValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
<fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<f64>, D>,
> fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, 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::<LightSetGroupBrightnessValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetGroupBrightnessValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
group_id: fidl::new_empty!(u32, D),
values: fidl::new_empty!(fidl::encoding::UnboundedVector<f64>, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<f64>,
D,
&mut self.values,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetGroupRgbValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetGroupRgbValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for &LightSetGroupRgbValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
fidl::encoding::Encode::<LightSetGroupRgbValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
<fidl::encoding::UnboundedVector<Rgb> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Rgb>, D>,
> fidl::encoding::Encode<LightSetGroupRgbValueRequest, 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::<LightSetGroupRgbValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetGroupRgbValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
group_id: fidl::new_empty!(u32, D),
values: fidl::new_empty!(fidl::encoding::UnboundedVector<Rgb>, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<Rgb>,
D,
&mut self.values,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetGroupSimpleValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetGroupSimpleValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D>
for &LightSetGroupSimpleValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
fidl::encoding::Encode::<LightSetGroupSimpleValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
<fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<bool>, D>,
> fidl::encoding::Encode<LightSetGroupSimpleValueRequest, 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::<LightSetGroupSimpleValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetGroupSimpleValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
group_id: fidl::new_empty!(u32, D),
values: fidl::new_empty!(fidl::encoding::UnboundedVector<bool>, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<bool>,
D,
&mut self.values,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetRgbValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetRgbValueRequest {
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<LightSetRgbValueRequest, D> for &LightSetRgbValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
fidl::encoding::Encode::<LightSetRgbValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Rgb, D>,
> fidl::encoding::Encode<LightSetRgbValueRequest, 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::<LightSetRgbValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetRgbValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(Rgb, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightSetSimpleValueRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightSetSimpleValueRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightSetSimpleValueRequest, D> for &LightSetSimpleValueRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
fidl::encoding::Encode::<LightSetSimpleValueRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<LightSetSimpleValueRequest, 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::<LightSetSimpleValueRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightSetSimpleValueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D>
for &LightGetCurrentBrightnessValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
fidl::encoding::Encode::<LightGetCurrentBrightnessValueResponse, D>::encode(
(<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentBrightnessValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(f64, 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!(f64, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D>
for &LightGetCurrentRgbValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
fidl::encoding::Encode::<LightGetCurrentRgbValueResponse, D>::encode(
(<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Rgb, D>>
fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentRgbValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Rgb, 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!(Rgb, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D>
for &LightGetCurrentSimpleValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
fidl::encoding::Encode::<LightGetCurrentSimpleValueResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetCurrentSimpleValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(bool, 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!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D>
for &LightGetGroupCurrentBrightnessValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
fidl::encoding::Encode::<LightGetGroupCurrentBrightnessValueResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
D,
>,
> fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentBrightnessValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
values: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
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::Optional<fidl::encoding::UnboundedVector<f64>>,
D,
&mut self.values,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D>
for &LightGetGroupCurrentRgbValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
fidl::encoding::Encode::<LightGetGroupCurrentRgbValueResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
D,
>,
> fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentRgbValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
values: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
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::Optional<fidl::encoding::UnboundedVector<Rgb>>,
D,
&mut self.values,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D>
for &LightGetGroupCurrentSimpleValueResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
fidl::encoding::Encode::<LightGetGroupCurrentSimpleValueResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
D,
>,
> fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupCurrentSimpleValueResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
values: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
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::Optional<fidl::encoding::UnboundedVector<bool>>,
D,
&mut self.values,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LightGetGroupInfoResponse, D> for &LightGetGroupInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
fidl::encoding::Encode::<LightGetGroupInfoResponse, D>::encode(
(<GroupInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GroupInfo, D>>
fidl::encoding::Encode<LightGetGroupInfoResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LightGetGroupInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(GroupInfo, 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!(GroupInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LightGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LightGetInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoResponse, D>
for &LightGetInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
fidl::encoding::Encode::<LightGetInfoResponse, D>::encode(
(<Info as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Info, D>>
fidl::encoding::Encode<LightGetInfoResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(Info, 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!(Info, D, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Rgb {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Rgb {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rgb, D> for &Rgb {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Rgb>(offset);
fidl::encoding::Encode::<Rgb, D>::encode(
(
<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f64, D>,
T1: fidl::encoding::Encode<f64, D>,
T2: fidl::encoding::Encode<f64, D>,
> fidl::encoding::Encode<Rgb, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Rgb>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rgb {
#[inline(always)]
fn new_empty() -> Self {
Self {
red: fidl::new_empty!(f64, D),
green: fidl::new_empty!(f64, D),
blue: fidl::new_empty!(f64, 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!(f64, D, &mut self.red, decoder, offset + 0, _depth)?;
fidl::decode!(f64, D, &mut self.green, decoder, offset + 8, _depth)?;
fidl::decode!(f64, D, &mut self.blue, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl Config {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.group_id {
return 5;
}
if let Some(_) = self.init_on {
return 4;
}
if let Some(_) = self.rgb {
return 3;
}
if let Some(_) = self.brightness {
return 2;
}
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Config {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Config {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Config>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.name.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.brightness.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.rgb.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.init_on.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i32, D>(
self.group_id.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rgb.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.init_on.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.group_id.get_or_insert_with(|| fidl::new_empty!(i32, D));
fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Metadata {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.configs {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Metadata {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Metadata {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Metadata>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Config>, D>(
self.configs.as_ref().map(<fidl::encoding::UnboundedVector<Config> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::UnboundedVector<Config> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.configs.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<Config>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<Config>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}