#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ColorCorrectionMode {
Disabled = 0,
CorrectProtanomaly = 1,
CorrectDeuteranomaly = 2,
CorrectTritanomaly = 3,
}
impl ColorCorrectionMode {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Disabled),
1 => Some(Self::CorrectProtanomaly),
2 => Some(Self::CorrectDeuteranomaly),
3 => Some(Self::CorrectTritanomaly),
_ => 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, PartialEq)]
pub struct ColorTransformHandlerSetColorTransformConfigurationRequest {
pub configuration: ColorTransformConfiguration,
}
impl fidl::Persistable for ColorTransformHandlerSetColorTransformConfigurationRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ColorTransformRegisterColorTransformHandlerRequest {
pub handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
}
impl fidl::Standalone for ColorTransformRegisterColorTransformHandlerRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct MagnificationHandlerSetClipSpaceTransformRequest {
pub x: f32,
pub y: f32,
pub scale: f32,
}
impl fidl::Persistable for MagnificationHandlerSetClipSpaceTransformRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MagnifierRegisterHandlerRequest {
pub handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
}
impl fidl::Standalone for MagnifierRegisterHandlerRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ColorTransformConfiguration {
pub color_inversion_enabled: Option<bool>,
pub color_correction: Option<ColorCorrectionMode>,
pub color_adjustment_matrix: Option<[f32; 9]>,
pub color_adjustment_pre_offset: Option<[f32; 3]>,
pub color_adjustment_post_offset: Option<[f32; 3]>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ColorTransformConfiguration {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ColorTransformMarker;
impl fidl::endpoints::ProtocolMarker for ColorTransformMarker {
type Proxy = ColorTransformProxy;
type RequestStream = ColorTransformRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ColorTransformSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.accessibility.ColorTransform";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ColorTransformMarker {}
pub trait ColorTransformProxyInterface: Send + Sync {
fn r#register_color_transform_handler(
&self,
handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ColorTransformSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ColorTransformSynchronousProxy {
type Proxy = ColorTransformProxy;
type Protocol = ColorTransformMarker;
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 ColorTransformSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ColorTransformMarker 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<ColorTransformEvent, fidl::Error> {
ColorTransformEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#register_color_transform_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ColorTransformRegisterColorTransformHandlerRequest>(
(handler,),
0x49ff3b83fcb05b88,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct ColorTransformProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for ColorTransformProxy {
type Protocol = ColorTransformMarker;
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 ColorTransformProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <ColorTransformMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ColorTransformEventStream {
ColorTransformEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#register_color_transform_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
) -> Result<(), fidl::Error> {
ColorTransformProxyInterface::r#register_color_transform_handler(self, handler)
}
}
impl ColorTransformProxyInterface for ColorTransformProxy {
fn r#register_color_transform_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ColorTransformRegisterColorTransformHandlerRequest>(
(handler,),
0x49ff3b83fcb05b88,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct ColorTransformEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for ColorTransformEventStream {}
impl futures::stream::FusedStream for ColorTransformEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ColorTransformEventStream {
type Item = Result<ColorTransformEvent, 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(ColorTransformEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ColorTransformEvent {}
impl ColorTransformEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<ColorTransformEvent, 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:
<ColorTransformMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ColorTransformRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for ColorTransformRequestStream {}
impl futures::stream::FusedStream for ColorTransformRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ColorTransformRequestStream {
type Protocol = ColorTransformMarker;
type ControlHandle = ColorTransformControlHandle;
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 {
ColorTransformControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ColorTransformRequestStream {
type Item = Result<ColorTransformRequest, 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 ColorTransformRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x49ff3b83fcb05b88 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ColorTransformRegisterColorTransformHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ColorTransformRegisterColorTransformHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ColorTransformControlHandle { inner: this.inner.clone() };
Ok(ColorTransformRequest::RegisterColorTransformHandler {
handler: req.handler,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ColorTransformMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum ColorTransformRequest {
RegisterColorTransformHandler {
handler: fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
control_handle: ColorTransformControlHandle,
},
}
impl ColorTransformRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_register_color_transform_handler(
self,
) -> Option<(
fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
ColorTransformControlHandle,
)> {
if let ColorTransformRequest::RegisterColorTransformHandler { handler, control_handle } =
self
{
Some((handler, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ColorTransformRequest::RegisterColorTransformHandler { .. } => {
"register_color_transform_handler"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ColorTransformControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for ColorTransformControlHandle {
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().as_ref().signal_peer(clear_mask, set_mask)
}
}
impl ColorTransformControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ColorTransformHandlerMarker;
impl fidl::endpoints::ProtocolMarker for ColorTransformHandlerMarker {
type Proxy = ColorTransformHandlerProxy;
type RequestStream = ColorTransformHandlerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ColorTransformHandlerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ColorTransformHandler";
}
pub trait ColorTransformHandlerProxyInterface: Send + Sync {
type SetColorTransformConfigurationResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#set_color_transform_configuration(
&self,
configuration: &ColorTransformConfiguration,
) -> Self::SetColorTransformConfigurationResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ColorTransformHandlerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ColorTransformHandlerSynchronousProxy {
type Proxy = ColorTransformHandlerProxy;
type Protocol = ColorTransformHandlerMarker;
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 ColorTransformHandlerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ColorTransformHandlerMarker 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<ColorTransformHandlerEvent, fidl::Error> {
ColorTransformHandlerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_color_transform_configuration(
&self,
mut configuration: &ColorTransformConfiguration,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
ColorTransformHandlerSetColorTransformConfigurationRequest,
fidl::encoding::EmptyPayload,
>(
(configuration,),
0x747ad9d676318dc6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct ColorTransformHandlerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for ColorTransformHandlerProxy {
type Protocol = ColorTransformHandlerMarker;
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 ColorTransformHandlerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name =
<ColorTransformHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ColorTransformHandlerEventStream {
ColorTransformHandlerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_color_transform_configuration(
&self,
mut configuration: &ColorTransformConfiguration,
) -> fidl::client::QueryResponseFut<()> {
ColorTransformHandlerProxyInterface::r#set_color_transform_configuration(
self,
configuration,
)
}
}
impl ColorTransformHandlerProxyInterface for ColorTransformHandlerProxy {
type SetColorTransformConfigurationResponseFut = fidl::client::QueryResponseFut<()>;
fn r#set_color_transform_configuration(
&self,
mut configuration: &ColorTransformConfiguration,
) -> Self::SetColorTransformConfigurationResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
0x747ad9d676318dc6,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<
ColorTransformHandlerSetColorTransformConfigurationRequest,
(),
>(
(configuration,),
0x747ad9d676318dc6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ColorTransformHandlerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for ColorTransformHandlerEventStream {}
impl futures::stream::FusedStream for ColorTransformHandlerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ColorTransformHandlerEventStream {
type Item = Result<ColorTransformHandlerEvent, 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(ColorTransformHandlerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ColorTransformHandlerEvent {}
impl ColorTransformHandlerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<ColorTransformHandlerEvent, 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:
<ColorTransformHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ColorTransformHandlerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for ColorTransformHandlerRequestStream {}
impl futures::stream::FusedStream for ColorTransformHandlerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ColorTransformHandlerRequestStream {
type Protocol = ColorTransformHandlerMarker;
type ControlHandle = ColorTransformHandlerControlHandle;
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 {
ColorTransformHandlerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ColorTransformHandlerRequestStream {
type Item = Result<ColorTransformHandlerRequest, 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 ColorTransformHandlerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x747ad9d676318dc6 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ColorTransformHandlerSetColorTransformConfigurationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ColorTransformHandlerSetColorTransformConfigurationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ColorTransformHandlerControlHandle { inner: this.inner.clone() };
Ok(ColorTransformHandlerRequest::SetColorTransformConfiguration {
configuration: req.configuration,
responder: ColorTransformHandlerSetColorTransformConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ColorTransformHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum ColorTransformHandlerRequest {
SetColorTransformConfiguration {
configuration: ColorTransformConfiguration,
responder: ColorTransformHandlerSetColorTransformConfigurationResponder,
},
}
impl ColorTransformHandlerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_color_transform_configuration(
self,
) -> Option<(
ColorTransformConfiguration,
ColorTransformHandlerSetColorTransformConfigurationResponder,
)> {
if let ColorTransformHandlerRequest::SetColorTransformConfiguration {
configuration,
responder,
} = self
{
Some((configuration, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ColorTransformHandlerRequest::SetColorTransformConfiguration { .. } => {
"set_color_transform_configuration"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ColorTransformHandlerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for ColorTransformHandlerControlHandle {
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().as_ref().signal_peer(clear_mask, set_mask)
}
}
impl ColorTransformHandlerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ColorTransformHandlerSetColorTransformConfigurationResponder {
control_handle: std::mem::ManuallyDrop<ColorTransformHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ColorTransformHandlerSetColorTransformConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ColorTransformHandlerSetColorTransformConfigurationResponder {
type ControlHandle = ColorTransformHandlerControlHandle;
fn control_handle(&self) -> &ColorTransformHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ColorTransformHandlerSetColorTransformConfigurationResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x747ad9d676318dc6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MagnificationHandlerMarker;
impl fidl::endpoints::ProtocolMarker for MagnificationHandlerMarker {
type Proxy = MagnificationHandlerProxy;
type RequestStream = MagnificationHandlerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = MagnificationHandlerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) MagnificationHandler";
}
pub trait MagnificationHandlerProxyInterface: Send + Sync {
type SetClipSpaceTransformResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#set_clip_space_transform(
&self,
x: f32,
y: f32,
scale: f32,
) -> Self::SetClipSpaceTransformResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct MagnificationHandlerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for MagnificationHandlerSynchronousProxy {
type Proxy = MagnificationHandlerProxy;
type Protocol = MagnificationHandlerMarker;
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 MagnificationHandlerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<MagnificationHandlerMarker 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<MagnificationHandlerEvent, fidl::Error> {
MagnificationHandlerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_clip_space_transform(
&self,
mut x: f32,
mut y: f32,
mut scale: f32,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
MagnificationHandlerSetClipSpaceTransformRequest,
fidl::encoding::EmptyPayload,
>(
(x, y, scale,),
0x71e54bab8b9f7357,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct MagnificationHandlerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for MagnificationHandlerProxy {
type Protocol = MagnificationHandlerMarker;
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 MagnificationHandlerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name =
<MagnificationHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> MagnificationHandlerEventStream {
MagnificationHandlerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_clip_space_transform(
&self,
mut x: f32,
mut y: f32,
mut scale: f32,
) -> fidl::client::QueryResponseFut<()> {
MagnificationHandlerProxyInterface::r#set_clip_space_transform(self, x, y, scale)
}
}
impl MagnificationHandlerProxyInterface for MagnificationHandlerProxy {
type SetClipSpaceTransformResponseFut = fidl::client::QueryResponseFut<()>;
fn r#set_clip_space_transform(
&self,
mut x: f32,
mut y: f32,
mut scale: f32,
) -> Self::SetClipSpaceTransformResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
0x71e54bab8b9f7357,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<MagnificationHandlerSetClipSpaceTransformRequest, ()>(
(x, y, scale),
0x71e54bab8b9f7357,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct MagnificationHandlerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for MagnificationHandlerEventStream {}
impl futures::stream::FusedStream for MagnificationHandlerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for MagnificationHandlerEventStream {
type Item = Result<MagnificationHandlerEvent, 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(MagnificationHandlerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum MagnificationHandlerEvent {}
impl MagnificationHandlerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<MagnificationHandlerEvent, 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:
<MagnificationHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct MagnificationHandlerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for MagnificationHandlerRequestStream {}
impl futures::stream::FusedStream for MagnificationHandlerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for MagnificationHandlerRequestStream {
type Protocol = MagnificationHandlerMarker;
type ControlHandle = MagnificationHandlerControlHandle;
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 {
MagnificationHandlerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for MagnificationHandlerRequestStream {
type Item = Result<MagnificationHandlerRequest, 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 MagnificationHandlerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x71e54bab8b9f7357 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
MagnificationHandlerSetClipSpaceTransformRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MagnificationHandlerSetClipSpaceTransformRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
MagnificationHandlerControlHandle { inner: this.inner.clone() };
Ok(MagnificationHandlerRequest::SetClipSpaceTransform {
x: req.x,
y: req.y,
scale: req.scale,
responder: MagnificationHandlerSetClipSpaceTransformResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<MagnificationHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum MagnificationHandlerRequest {
SetClipSpaceTransform {
x: f32,
y: f32,
scale: f32,
responder: MagnificationHandlerSetClipSpaceTransformResponder,
},
}
impl MagnificationHandlerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_clip_space_transform(
self,
) -> Option<(f32, f32, f32, MagnificationHandlerSetClipSpaceTransformResponder)> {
if let MagnificationHandlerRequest::SetClipSpaceTransform { x, y, scale, responder } = self
{
Some((x, y, scale, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
MagnificationHandlerRequest::SetClipSpaceTransform { .. } => "set_clip_space_transform",
}
}
}
#[derive(Debug, Clone)]
pub struct MagnificationHandlerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for MagnificationHandlerControlHandle {
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().as_ref().signal_peer(clear_mask, set_mask)
}
}
impl MagnificationHandlerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MagnificationHandlerSetClipSpaceTransformResponder {
control_handle: std::mem::ManuallyDrop<MagnificationHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MagnificationHandlerSetClipSpaceTransformResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MagnificationHandlerSetClipSpaceTransformResponder {
type ControlHandle = MagnificationHandlerControlHandle;
fn control_handle(&self) -> &MagnificationHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MagnificationHandlerSetClipSpaceTransformResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x71e54bab8b9f7357,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MagnifierMarker;
impl fidl::endpoints::ProtocolMarker for MagnifierMarker {
type Proxy = MagnifierProxy;
type RequestStream = MagnifierRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = MagnifierSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.accessibility.Magnifier";
}
impl fidl::endpoints::DiscoverableProtocolMarker for MagnifierMarker {}
pub trait MagnifierProxyInterface: Send + Sync {
fn r#register_handler(
&self,
handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct MagnifierSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for MagnifierSynchronousProxy {
type Proxy = MagnifierProxy;
type Protocol = MagnifierMarker;
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 MagnifierSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <MagnifierMarker 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<MagnifierEvent, fidl::Error> {
MagnifierEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#register_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<MagnifierRegisterHandlerRequest>(
(handler,),
0x36559e34eb45d161,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct MagnifierProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for MagnifierProxy {
type Protocol = MagnifierMarker;
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 MagnifierProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <MagnifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> MagnifierEventStream {
MagnifierEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#register_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
) -> Result<(), fidl::Error> {
MagnifierProxyInterface::r#register_handler(self, handler)
}
}
impl MagnifierProxyInterface for MagnifierProxy {
fn r#register_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<MagnifierRegisterHandlerRequest>(
(handler,),
0x36559e34eb45d161,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct MagnifierEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for MagnifierEventStream {}
impl futures::stream::FusedStream for MagnifierEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for MagnifierEventStream {
type Item = Result<MagnifierEvent, 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(MagnifierEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum MagnifierEvent {}
impl MagnifierEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<MagnifierEvent, 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: <MagnifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct MagnifierRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for MagnifierRequestStream {}
impl futures::stream::FusedStream for MagnifierRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for MagnifierRequestStream {
type Protocol = MagnifierMarker;
type ControlHandle = MagnifierControlHandle;
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 {
MagnifierControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for MagnifierRequestStream {
type Item = Result<MagnifierRequest, 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 MagnifierRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x36559e34eb45d161 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
MagnifierRegisterHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MagnifierRegisterHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = MagnifierControlHandle { inner: this.inner.clone() };
Ok(MagnifierRequest::RegisterHandler { handler: req.handler, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <MagnifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum MagnifierRequest {
RegisterHandler {
handler: fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
control_handle: MagnifierControlHandle,
},
}
impl MagnifierRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_register_handler(
self,
) -> Option<(fidl::endpoints::ClientEnd<MagnificationHandlerMarker>, MagnifierControlHandle)>
{
if let MagnifierRequest::RegisterHandler { handler, control_handle } = self {
Some((handler, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
MagnifierRequest::RegisterHandler { .. } => "register_handler",
}
}
}
#[derive(Debug, Clone)]
pub struct MagnifierControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for MagnifierControlHandle {
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().as_ref().signal_peer(clear_mask, set_mask)
}
}
impl MagnifierControlHandle {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for ColorCorrectionMode {
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 ColorCorrectionMode {
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 ColorCorrectionMode
{
#[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 ColorCorrectionMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Disabled
}
#[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 ColorTransformHandlerSetColorTransformConfigurationRequest
{
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker
for ColorTransformHandlerSetColorTransformConfigurationRequest
{
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<ColorTransformHandlerSetColorTransformConfigurationRequest, D>
for &ColorTransformHandlerSetColorTransformConfigurationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ColorTransformHandlerSetColorTransformConfigurationRequest>(
offset,
);
fidl::encoding::Encode::<ColorTransformHandlerSetColorTransformConfigurationRequest, D>::encode(
(
<ColorTransformConfiguration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ColorTransformConfiguration, D>,
> fidl::encoding::Encode<ColorTransformHandlerSetColorTransformConfigurationRequest, 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::<ColorTransformHandlerSetColorTransformConfigurationRequest>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ColorTransformHandlerSetColorTransformConfigurationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(ColorTransformConfiguration, 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!(
ColorTransformConfiguration,
D,
&mut self.configuration,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ColorTransformRegisterColorTransformHandlerRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorTransformRegisterColorTransformHandlerRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
ColorTransformRegisterColorTransformHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ColorTransformRegisterColorTransformHandlerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ColorTransformRegisterColorTransformHandlerRequest>(offset);
fidl::encoding::Encode::<
ColorTransformRegisterColorTransformHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handler
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ColorTransformRegisterColorTransformHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ColorTransformRegisterColorTransformHandlerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ColorTransformRegisterColorTransformHandlerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handler: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ColorTransformHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.handler,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for MagnificationHandlerSetClipSpaceTransformRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MagnificationHandlerSetClipSpaceTransformRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<MagnificationHandlerSetClipSpaceTransformRequest, D>
for &MagnificationHandlerSetClipSpaceTransformRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MagnificationHandlerSetClipSpaceTransformRequest>(offset);
fidl::encoding::Encode::<MagnificationHandlerSetClipSpaceTransformRequest, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<MagnificationHandlerSetClipSpaceTransformRequest, 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::<MagnificationHandlerSetClipSpaceTransformRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for MagnificationHandlerSetClipSpaceTransformRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
x: fidl::new_empty!(f32, D),
y: fidl::new_empty!(f32, D),
scale: fidl::new_empty!(f32, 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!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.scale, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for MagnifierRegisterHandlerRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MagnifierRegisterHandlerRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
MagnifierRegisterHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut MagnifierRegisterHandlerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MagnifierRegisterHandlerRequest>(offset);
fidl::encoding::Encode::<
MagnifierRegisterHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handler
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MagnificationHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
MagnifierRegisterHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MagnifierRegisterHandlerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for MagnifierRegisterHandlerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handler: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<MagnificationHandlerMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MagnificationHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.handler,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl ColorTransformConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.color_adjustment_post_offset {
return 5;
}
if let Some(_) = self.color_adjustment_pre_offset {
return 4;
}
if let Some(_) = self.color_adjustment_matrix {
return 3;
}
if let Some(_) = self.color_correction {
return 2;
}
if let Some(_) = self.color_inversion_enabled {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ColorTransformConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorTransformConfiguration {
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<ColorTransformConfiguration, D> for &ColorTransformConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorTransformConfiguration>(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::<bool, D>(
self.color_inversion_enabled
.as_ref()
.map(<bool 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::<ColorCorrectionMode, D>(
self.color_correction
.as_ref()
.map(<ColorCorrectionMode 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::<fidl::encoding::Array<f32, 9>, D>(
self.color_adjustment_matrix.as_ref().map(
<fidl::encoding::Array<f32, 9> 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::<fidl::encoding::Array<f32, 3>, D>(
self.color_adjustment_pre_offset.as_ref().map(
<fidl::encoding::Array<f32, 3> 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::<fidl::encoding::Array<f32, 3>, D>(
self.color_adjustment_post_offset.as_ref().map(
<fidl::encoding::Array<f32, 3> 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 ColorTransformConfiguration
{
#[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 =
<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.color_inversion_enabled.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 < 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 =
<ColorCorrectionMode 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
.color_correction
.get_or_insert_with(|| fidl::new_empty!(ColorCorrectionMode, D));
fidl::decode!(ColorCorrectionMode, 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 =
<fidl::encoding::Array<f32, 9> 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
.color_adjustment_matrix
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 9>, D));
fidl::decode!(fidl::encoding::Array<f32, 9>, 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 =
<fidl::encoding::Array<f32, 3> 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
.color_adjustment_pre_offset
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 3>, D));
fidl::decode!(fidl::encoding::Array<f32, 3>, 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 =
<fidl::encoding::Array<f32, 3> 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
.color_adjustment_post_offset
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 3>, D));
fidl::decode!(fidl::encoding::Array<f32, 3>, 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(())
}
}
}