#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type DeviceId = u64;
pub const MAX_CONFIGURATIONS_PER_CAMERA: u32 = 256;
pub const MAX_IDENTIFIER_LENGTH: u32 = 256;
pub const MAX_RESOLUTIONS_PER_STREAM: u32 = 256;
pub const MAX_STREAMS_PER_CONFIGURATION: u32 = 256;
pub const MAX_WATCH_DEVICES_EVENTS: u32 = 256;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Orientation {
Up = 1,
Down = 2,
Left = 3,
Right = 4,
UpFlipped = 5,
DownFlipped = 6,
LeftFlipped = 7,
RightFlipped = 8,
}
impl Orientation {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Up),
2 => Some(Self::Down),
3 => Some(Self::Left),
4 => Some(Self::Right),
5 => Some(Self::UpFlipped),
6 => Some(Self::DownFlipped),
7 => Some(Self::LeftFlipped),
8 => Some(Self::RightFlipped),
_ => 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 Configuration {
pub streams: Vec<StreamProperties>,
}
impl fidl::Persistable for Configuration {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceConnectToStreamRequest {
pub index: u32,
pub request: fidl::endpoints::ServerEnd<Stream_Marker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceConnectToStreamRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct DeviceGetConfigurations2Response {
pub configurations: Vec<Configuration2>,
}
impl fidl::Persistable for DeviceGetConfigurations2Response {}
#[derive(Clone, Debug, PartialEq)]
pub struct DeviceGetConfigurationsResponse {
pub configurations: Vec<Configuration>,
}
impl fidl::Persistable for DeviceGetConfigurationsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetIdentifierResponse {
pub identifier: Option<String>,
}
impl fidl::Persistable for DeviceGetIdentifierResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceRebindRequest {
pub request: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DeviceRebindRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceSetCurrentConfigurationRequest {
pub index: u32,
}
impl fidl::Persistable for DeviceSetCurrentConfigurationRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceSetSoftwareMuteStateRequest {
pub muted: bool,
}
impl fidl::Persistable for DeviceSetSoftwareMuteStateRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceWatchCurrentConfigurationResponse {
pub index: u32,
}
impl fidl::Persistable for DeviceWatchCurrentConfigurationResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceWatchMuteStateResponse {
pub software_muted: bool,
pub hardware_muted: bool,
}
impl fidl::Persistable for DeviceWatchMuteStateResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceWatcherConnectToDeviceRequest {
pub id: u64,
pub request: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceWatcherConnectToDeviceRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceWatcherWatchDevicesResponse {
pub events: Vec<WatchDevicesEvent>,
}
impl fidl::Persistable for DeviceWatcherWatchDevicesResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FrameInfo {
pub buffer_index: u32,
pub frame_counter: u64,
pub timestamp: i64,
pub release_fence: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FrameRate {
pub numerator: u32,
pub denominator: u32,
}
impl fidl::Persistable for FrameRate {}
#[derive(Debug, PartialEq)]
pub struct StreamGetNextFrame2Response {
pub info: FrameInfo2,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamGetNextFrame2Response
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamGetNextFrameResponse {
pub info: FrameInfo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamGetNextFrameResponse
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamGetProperties2Response {
pub properties: StreamProperties2,
}
impl fidl::Persistable for StreamGetProperties2Response {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamGetPropertiesResponse {
pub properties: StreamProperties,
}
impl fidl::Persistable for StreamGetPropertiesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamProperties {
pub image_format: fidl_fuchsia_sysmem::ImageFormat2,
pub frame_rate: FrameRate,
pub supports_crop_region: bool,
}
impl fidl::Persistable for StreamProperties {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamRebindRequest {
pub request: fidl::endpoints::ServerEnd<Stream_Marker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StreamRebindRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamSetBufferCollection2Request {
pub token:
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamSetBufferCollection2Request
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamSetBufferCollectionRequest {
pub token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamSetBufferCollectionRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamSetCropRegionRequest {
pub region: Option<Box<fidl_fuchsia_math::RectF>>,
}
impl fidl::Persistable for StreamSetCropRegionRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamSetResolutionRequest {
pub coded_size: fidl_fuchsia_math::Size,
}
impl fidl::Persistable for StreamSetResolutionRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamWatchBufferCollection2Response {
pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamWatchBufferCollection2Response
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamWatchBufferCollectionResponse {
pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamWatchBufferCollectionResponse
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamWatchCropRegionResponse {
pub region: Option<Box<fidl_fuchsia_math::RectF>>,
}
impl fidl::Persistable for StreamWatchCropRegionResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamWatchOrientationResponse {
pub orientation: Orientation,
}
impl fidl::Persistable for StreamWatchOrientationResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamWatchResolutionResponse {
pub coded_size: fidl_fuchsia_math::Size,
}
impl fidl::Persistable for StreamWatchResolutionResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Configuration2 {
pub streams: Option<Vec<StreamProperties2>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Configuration2 {}
#[derive(Debug, Default, PartialEq)]
pub struct FrameInfo2 {
pub buffer_index: Option<u32>,
pub frame_counter: Option<u64>,
pub timestamp: Option<i64>,
pub capture_timestamp: Option<i64>,
pub release_fence: Option<fidl::EventPair>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo2 {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StreamProperties2 {
pub image_format: Option<fidl_fuchsia_sysmem::ImageFormat2>,
pub frame_rate: Option<FrameRate>,
pub supports_crop_region: Option<bool>,
pub supported_resolutions: Option<Vec<fidl_fuchsia_math::Size>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for StreamProperties2 {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum WatchDevicesEvent {
Existing(u64),
Added(u64),
Removed(u64),
}
impl WatchDevicesEvent {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Existing(_) => 1,
Self::Added(_) => 2,
Self::Removed(_) => 3,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for WatchDevicesEvent {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceMarker;
impl fidl::endpoints::ProtocolMarker for DeviceMarker {
type Proxy = DeviceProxy;
type RequestStream = DeviceRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Device";
}
pub trait DeviceProxyInterface: Send + Sync {
type GetIdentifierResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
+ Send;
fn r#get_identifier(&self) -> Self::GetIdentifierResponseFut;
type GetConfigurationsResponseFut: std::future::Future<Output = Result<Vec<Configuration>, fidl::Error>>
+ Send;
fn r#get_configurations(&self) -> Self::GetConfigurationsResponseFut;
type GetConfigurations2ResponseFut: std::future::Future<Output = Result<Vec<Configuration2>, fidl::Error>>
+ Send;
fn r#get_configurations2(&self) -> Self::GetConfigurations2ResponseFut;
type WatchCurrentConfigurationResponseFut: std::future::Future<Output = Result<u32, fidl::Error>>
+ Send;
fn r#watch_current_configuration(&self) -> Self::WatchCurrentConfigurationResponseFut;
fn r#set_current_configuration(&self, index: u32) -> Result<(), fidl::Error>;
type WatchMuteStateResponseFut: std::future::Future<Output = Result<(bool, bool), fidl::Error>>
+ Send;
fn r#watch_mute_state(&self) -> Self::WatchMuteStateResponseFut;
type SetSoftwareMuteStateResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#set_software_mute_state(&self, muted: bool) -> Self::SetSoftwareMuteStateResponseFut;
fn r#connect_to_stream(
&self,
index: u32,
request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error>;
fn r#rebind(
&self,
request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
type Proxy = DeviceProxy;
type Protocol = DeviceMarker;
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 DeviceSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceMarker 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<DeviceEvent, fidl::Error> {
DeviceEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_identifier(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Option<String>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetIdentifierResponse>(
(),
0x1417d1af92667e47,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.identifier)
}
pub fn r#get_configurations(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<Configuration>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DeviceGetConfigurationsResponse>(
(),
0x26c7a180d8eef786,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.configurations)
}
pub fn r#get_configurations2(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<Configuration2>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DeviceGetConfigurations2Response>(
(),
0x2667155e740fb9ff,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.configurations)
}
pub fn r#watch_current_configuration(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u32, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DeviceWatchCurrentConfigurationResponse>(
(),
0x7a82832a127834b7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.index)
}
pub fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
self.client.send::<DeviceSetCurrentConfigurationRequest>(
(index,),
0x11d65c8f92593b87,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_mute_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(bool, bool), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceWatchMuteStateResponse>(
(),
0x2bafd68e6e7ef2fb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.software_muted, _response.hardware_muted))
}
pub fn r#set_software_mute_state(
&self,
mut muted: bool,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<DeviceSetSoftwareMuteStateRequest, fidl::encoding::EmptyPayload>(
(muted,),
0x6bb19cb687f560a5,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#connect_to_stream(
&self,
mut index: u32,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceConnectToStreamRequest>(
(index, request),
0x290a86763174c4c3,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceRebindRequest>(
(request,),
0x24811b7cee5c51c3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DeviceProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DeviceProxy {
type Protocol = DeviceMarker;
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 DeviceProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceEventStream {
DeviceEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_identifier(
&self,
) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DeviceProxyInterface::r#get_identifier(self)
}
pub fn r#get_configurations(
&self,
) -> fidl::client::QueryResponseFut<
Vec<Configuration>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceProxyInterface::r#get_configurations(self)
}
pub fn r#get_configurations2(
&self,
) -> fidl::client::QueryResponseFut<
Vec<Configuration2>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceProxyInterface::r#get_configurations2(self)
}
pub fn r#watch_current_configuration(
&self,
) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceProxyInterface::r#watch_current_configuration(self)
}
pub fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#set_current_configuration(self, index)
}
pub fn r#watch_mute_state(
&self,
) -> fidl::client::QueryResponseFut<(bool, bool), fidl::encoding::DefaultFuchsiaResourceDialect>
{
DeviceProxyInterface::r#watch_mute_state(self)
}
pub fn r#set_software_mute_state(
&self,
mut muted: bool,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceProxyInterface::r#set_software_mute_state(self, muted)
}
pub fn r#connect_to_stream(
&self,
mut index: u32,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#connect_to_stream(self, index, request)
}
pub fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#rebind(self, request)
}
}
impl DeviceProxyInterface for DeviceProxy {
type GetIdentifierResponseFut = fidl::client::QueryResponseFut<
Option<String>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_identifier(&self) -> Self::GetIdentifierResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Option<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetIdentifierResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1417d1af92667e47,
>(_buf?)?;
Ok(_response.identifier)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Option<String>>(
(),
0x1417d1af92667e47,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConfigurationsResponseFut = fidl::client::QueryResponseFut<
Vec<Configuration>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_configurations(&self) -> Self::GetConfigurationsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Configuration>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetConfigurationsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x26c7a180d8eef786,
>(_buf?)?;
Ok(_response.configurations)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Configuration>>(
(),
0x26c7a180d8eef786,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConfigurations2ResponseFut = fidl::client::QueryResponseFut<
Vec<Configuration2>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_configurations2(&self) -> Self::GetConfigurations2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Configuration2>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetConfigurations2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2667155e740fb9ff,
>(_buf?)?;
Ok(_response.configurations)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Configuration2>>(
(),
0x2667155e740fb9ff,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchCurrentConfigurationResponseFut =
fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_current_configuration(&self) -> Self::WatchCurrentConfigurationResponseFut {
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::<
DeviceWatchCurrentConfigurationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a82832a127834b7,
>(_buf?)?;
Ok(_response.index)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
(),
0x7a82832a127834b7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
self.client.send::<DeviceSetCurrentConfigurationRequest>(
(index,),
0x11d65c8f92593b87,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchMuteStateResponseFut =
fidl::client::QueryResponseFut<(bool, bool), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_mute_state(&self) -> Self::WatchMuteStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(bool, bool), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceWatchMuteStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2bafd68e6e7ef2fb,
>(_buf?)?;
Ok((_response.software_muted, _response.hardware_muted))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (bool, bool)>(
(),
0x2bafd68e6e7ef2fb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetSoftwareMuteStateResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_software_mute_state(&self, mut muted: bool) -> Self::SetSoftwareMuteStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6bb19cb687f560a5,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<DeviceSetSoftwareMuteStateRequest, ()>(
(muted,),
0x6bb19cb687f560a5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#connect_to_stream(
&self,
mut index: u32,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceConnectToStreamRequest>(
(index, request),
0x290a86763174c4c3,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceRebindRequest>(
(request,),
0x24811b7cee5c51c3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DeviceEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DeviceEventStream {}
impl futures::stream::FusedStream for DeviceEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceEventStream {
type Item = Result<DeviceEvent, 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(DeviceEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceEvent {}
impl DeviceEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DeviceEvent, 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: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceRequestStream {}
impl futures::stream::FusedStream for DeviceRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceRequestStream {
type Protocol = DeviceMarker;
type ControlHandle = DeviceControlHandle;
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 {
DeviceControlHandle { 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 DeviceRequestStream {
type Item = Result<DeviceRequest, 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 DeviceRequestStream 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 {
0x1417d1af92667e47 => {
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 = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetIdentifier {
responder: DeviceGetIdentifierResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x26c7a180d8eef786 => {
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 = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetConfigurations {
responder: DeviceGetConfigurationsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2667155e740fb9ff => {
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 = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetConfigurations2 {
responder: DeviceGetConfigurations2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a82832a127834b7 => {
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 = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::WatchCurrentConfiguration {
responder: DeviceWatchCurrentConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x11d65c8f92593b87 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceSetCurrentConfigurationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceSetCurrentConfigurationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::SetCurrentConfiguration {
index: req.index,
control_handle,
})
}
0x2bafd68e6e7ef2fb => {
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 = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::WatchMuteState {
responder: DeviceWatchMuteStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6bb19cb687f560a5 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceSetSoftwareMuteStateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceSetSoftwareMuteStateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::SetSoftwareMuteState {
muted: req.muted,
responder: DeviceSetSoftwareMuteStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x290a86763174c4c3 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceConnectToStreamRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectToStreamRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::ConnectToStream {
index: req.index,
request: req.request,
control_handle,
})
}
0x24811b7cee5c51c3 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceRebindRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRebindRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::Rebind { request: req.request, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DeviceRequest {
GetIdentifier { responder: DeviceGetIdentifierResponder },
GetConfigurations { responder: DeviceGetConfigurationsResponder },
GetConfigurations2 { responder: DeviceGetConfigurations2Responder },
WatchCurrentConfiguration { responder: DeviceWatchCurrentConfigurationResponder },
SetCurrentConfiguration { index: u32, control_handle: DeviceControlHandle },
WatchMuteState { responder: DeviceWatchMuteStateResponder },
SetSoftwareMuteState { muted: bool, responder: DeviceSetSoftwareMuteStateResponder },
ConnectToStream {
index: u32,
request: fidl::endpoints::ServerEnd<Stream_Marker>,
control_handle: DeviceControlHandle,
},
Rebind {
request: fidl::endpoints::ServerEnd<DeviceMarker>,
control_handle: DeviceControlHandle,
},
}
impl DeviceRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_identifier(self) -> Option<(DeviceGetIdentifierResponder)> {
if let DeviceRequest::GetIdentifier { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_configurations(self) -> Option<(DeviceGetConfigurationsResponder)> {
if let DeviceRequest::GetConfigurations { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_configurations2(self) -> Option<(DeviceGetConfigurations2Responder)> {
if let DeviceRequest::GetConfigurations2 { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_current_configuration(
self,
) -> Option<(DeviceWatchCurrentConfigurationResponder)> {
if let DeviceRequest::WatchCurrentConfiguration { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_current_configuration(self) -> Option<(u32, DeviceControlHandle)> {
if let DeviceRequest::SetCurrentConfiguration { index, control_handle } = self {
Some((index, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_mute_state(self) -> Option<(DeviceWatchMuteStateResponder)> {
if let DeviceRequest::WatchMuteState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_software_mute_state(
self,
) -> Option<(bool, DeviceSetSoftwareMuteStateResponder)> {
if let DeviceRequest::SetSoftwareMuteState { muted, responder } = self {
Some((muted, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_to_stream(
self,
) -> Option<(u32, fidl::endpoints::ServerEnd<Stream_Marker>, DeviceControlHandle)> {
if let DeviceRequest::ConnectToStream { index, request, control_handle } = self {
Some((index, request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rebind(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, DeviceControlHandle)> {
if let DeviceRequest::Rebind { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceRequest::GetIdentifier { .. } => "get_identifier",
DeviceRequest::GetConfigurations { .. } => "get_configurations",
DeviceRequest::GetConfigurations2 { .. } => "get_configurations2",
DeviceRequest::WatchCurrentConfiguration { .. } => "watch_current_configuration",
DeviceRequest::SetCurrentConfiguration { .. } => "set_current_configuration",
DeviceRequest::WatchMuteState { .. } => "watch_mute_state",
DeviceRequest::SetSoftwareMuteState { .. } => "set_software_mute_state",
DeviceRequest::ConnectToStream { .. } => "connect_to_stream",
DeviceRequest::Rebind { .. } => "rebind",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DeviceControlHandle {
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 DeviceControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetIdentifierResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetIdentifierResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetIdentifierResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetIdentifierResponder {
pub fn send(self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(identifier);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(identifier);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetIdentifierResponse>(
(identifier,),
self.tx_id,
0x1417d1af92667e47,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetConfigurationsResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetConfigurationsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetConfigurationsResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetConfigurationsResponder {
pub fn send(self, mut configurations: &[Configuration]) -> Result<(), fidl::Error> {
let _result = self.send_raw(configurations);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut configurations: &[Configuration],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(configurations);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut configurations: &[Configuration]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetConfigurationsResponse>(
(configurations,),
self.tx_id,
0x26c7a180d8eef786,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetConfigurations2Responder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetConfigurations2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetConfigurations2Responder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetConfigurations2Responder {
pub fn send(self, mut configurations: &[Configuration2]) -> Result<(), fidl::Error> {
let _result = self.send_raw(configurations);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut configurations: &[Configuration2],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(configurations);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut configurations: &[Configuration2]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetConfigurations2Response>(
(configurations,),
self.tx_id,
0x2667155e740fb9ff,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceWatchCurrentConfigurationResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceWatchCurrentConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceWatchCurrentConfigurationResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceWatchCurrentConfigurationResponder {
pub fn send(self, mut index: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(index);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut index: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(index);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut index: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceWatchCurrentConfigurationResponse>(
(index,),
self.tx_id,
0x7a82832a127834b7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceWatchMuteStateResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceWatchMuteStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceWatchMuteStateResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceWatchMuteStateResponder {
pub fn send(
self,
mut software_muted: bool,
mut hardware_muted: bool,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(software_muted, hardware_muted);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut software_muted: bool,
mut hardware_muted: bool,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(software_muted, hardware_muted);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut software_muted: bool,
mut hardware_muted: bool,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceWatchMuteStateResponse>(
(software_muted, hardware_muted),
self.tx_id,
0x2bafd68e6e7ef2fb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceSetSoftwareMuteStateResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceSetSoftwareMuteStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceSetSoftwareMuteStateResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceSetSoftwareMuteStateResponder {
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,
0x6bb19cb687f560a5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceWatcherMarker;
impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
type Proxy = DeviceWatcherProxy;
type RequestStream = DeviceWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.camera3.DeviceWatcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DeviceWatcherMarker {}
pub trait DeviceWatcherProxyInterface: Send + Sync {
type WatchDevicesResponseFut: std::future::Future<Output = Result<Vec<WatchDevicesEvent>, fidl::Error>>
+ Send;
fn r#watch_devices(&self) -> Self::WatchDevicesResponseFut;
fn r#connect_to_device(
&self,
id: u64,
request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
type Proxy = DeviceWatcherProxy;
type Protocol = DeviceWatcherMarker;
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 DeviceWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceWatcherMarker 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<DeviceWatcherEvent, fidl::Error> {
DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#watch_devices(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<WatchDevicesEvent>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DeviceWatcherWatchDevicesResponse>(
(),
0x5f38542e295e8575,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.events)
}
pub fn r#connect_to_device(
&self,
mut id: u64,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceWatcherConnectToDeviceRequest>(
(id, request),
0x5f175a8283b26b2d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DeviceWatcherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DeviceWatcherProxy {
type Protocol = DeviceWatcherMarker;
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 DeviceWatcherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#watch_devices(
&self,
) -> fidl::client::QueryResponseFut<
Vec<WatchDevicesEvent>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceWatcherProxyInterface::r#watch_devices(self)
}
pub fn r#connect_to_device(
&self,
mut id: u64,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
DeviceWatcherProxyInterface::r#connect_to_device(self, id, request)
}
}
impl DeviceWatcherProxyInterface for DeviceWatcherProxy {
type WatchDevicesResponseFut = fidl::client::QueryResponseFut<
Vec<WatchDevicesEvent>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_devices(&self) -> Self::WatchDevicesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<WatchDevicesEvent>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceWatcherWatchDevicesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5f38542e295e8575,
>(_buf?)?;
Ok(_response.events)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<WatchDevicesEvent>>(
(),
0x5f38542e295e8575,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#connect_to_device(
&self,
mut id: u64,
mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceWatcherConnectToDeviceRequest>(
(id, request),
0x5f175a8283b26b2d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DeviceWatcherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DeviceWatcherEventStream {}
impl futures::stream::FusedStream for DeviceWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceWatcherEventStream {
type Item = Result<DeviceWatcherEvent, 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(DeviceWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceWatcherEvent {}
impl DeviceWatcherEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DeviceWatcherEvent, 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: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceWatcherRequestStream {}
impl futures::stream::FusedStream for DeviceWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
type Protocol = DeviceWatcherMarker;
type ControlHandle = DeviceWatcherControlHandle;
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 {
DeviceWatcherControlHandle { 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 DeviceWatcherRequestStream {
type Item = Result<DeviceWatcherRequest, 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 DeviceWatcherRequestStream 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 {
0x5f38542e295e8575 => {
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 =
DeviceWatcherControlHandle { inner: this.inner.clone() };
Ok(DeviceWatcherRequest::WatchDevices {
responder: DeviceWatcherWatchDevicesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5f175a8283b26b2d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceWatcherConnectToDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherConnectToDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceWatcherControlHandle { inner: this.inner.clone() };
Ok(DeviceWatcherRequest::ConnectToDevice {
id: req.id,
request: req.request,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DeviceWatcherRequest {
WatchDevices { responder: DeviceWatcherWatchDevicesResponder },
ConnectToDevice {
id: u64,
request: fidl::endpoints::ServerEnd<DeviceMarker>,
control_handle: DeviceWatcherControlHandle,
},
}
impl DeviceWatcherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_watch_devices(self) -> Option<(DeviceWatcherWatchDevicesResponder)> {
if let DeviceWatcherRequest::WatchDevices { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_to_device(
self,
) -> Option<(u64, fidl::endpoints::ServerEnd<DeviceMarker>, DeviceWatcherControlHandle)> {
if let DeviceWatcherRequest::ConnectToDevice { id, request, control_handle } = self {
Some((id, request, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceWatcherRequest::WatchDevices { .. } => "watch_devices",
DeviceWatcherRequest::ConnectToDevice { .. } => "connect_to_device",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
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 DeviceWatcherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceWatcherWatchDevicesResponder {
control_handle: std::mem::ManuallyDrop<DeviceWatcherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceWatcherWatchDevicesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceWatcherWatchDevicesResponder {
type ControlHandle = DeviceWatcherControlHandle;
fn control_handle(&self) -> &DeviceWatcherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceWatcherWatchDevicesResponder {
pub fn send(self, mut events: &[WatchDevicesEvent]) -> Result<(), fidl::Error> {
let _result = self.send_raw(events);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut events: &[WatchDevicesEvent],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(events);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut events: &[WatchDevicesEvent]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceWatcherWatchDevicesResponse>(
(events,),
self.tx_id,
0x5f38542e295e8575,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Stream_Marker;
impl fidl::endpoints::ProtocolMarker for Stream_Marker {
type Proxy = Stream_Proxy;
type RequestStream = Stream_RequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = Stream_SynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Stream_";
}
pub trait Stream_ProxyInterface: Send + Sync {
type GetPropertiesResponseFut: std::future::Future<Output = Result<StreamProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type GetProperties2ResponseFut: std::future::Future<Output = Result<StreamProperties2, fidl::Error>>
+ Send;
fn r#get_properties2(&self) -> Self::GetProperties2ResponseFut;
fn r#set_crop_region(
&self,
region: Option<&fidl_fuchsia_math::RectF>,
) -> Result<(), fidl::Error>;
type WatchCropRegionResponseFut: std::future::Future<Output = Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error>>
+ Send;
fn r#watch_crop_region(&self) -> Self::WatchCropRegionResponseFut;
fn r#set_resolution(&self, coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error>;
type WatchResolutionResponseFut: std::future::Future<Output = Result<fidl_fuchsia_math::Size, fidl::Error>>
+ Send;
fn r#watch_resolution(&self) -> Self::WatchResolutionResponseFut;
fn r#set_buffer_collection2(
&self,
token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error>;
fn r#set_buffer_collection(
&self,
token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
) -> Result<(), fidl::Error>;
type WatchBufferCollection2ResponseFut: std::future::Future<
Output = Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
fidl::Error,
>,
> + Send;
fn r#watch_buffer_collection2(&self) -> Self::WatchBufferCollection2ResponseFut;
type WatchBufferCollectionResponseFut: std::future::Future<
Output = Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
fidl::Error,
>,
> + Send;
fn r#watch_buffer_collection(&self) -> Self::WatchBufferCollectionResponseFut;
type WatchOrientationResponseFut: std::future::Future<Output = Result<Orientation, fidl::Error>>
+ Send;
fn r#watch_orientation(&self) -> Self::WatchOrientationResponseFut;
type GetNextFrameResponseFut: std::future::Future<Output = Result<FrameInfo, fidl::Error>>
+ Send;
fn r#get_next_frame(&self) -> Self::GetNextFrameResponseFut;
type GetNextFrame2ResponseFut: std::future::Future<Output = Result<FrameInfo2, fidl::Error>>
+ Send;
fn r#get_next_frame2(&self) -> Self::GetNextFrame2ResponseFut;
fn r#rebind(
&self,
request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct Stream_SynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for Stream_SynchronousProxy {
type Proxy = Stream_Proxy;
type Protocol = Stream_Marker;
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 Stream_SynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <Stream_Marker 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<Stream_Event, fidl::Error> {
Stream_Event::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<StreamProperties, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetPropertiesResponse>(
(),
0x13662921504b55f7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#get_properties2(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<StreamProperties2, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetProperties2Response>(
(),
0x70346d69a8cbc391,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#set_crop_region(
&self,
mut region: Option<&fidl_fuchsia_math::RectF>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetCropRegionRequest>(
(region,),
0x72dde73bf7a94302,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_crop_region(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamWatchCropRegionResponse>(
(),
0x4c28250035dbbb90,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.region)
}
pub fn r#set_resolution(
&self,
mut coded_size: &fidl_fuchsia_math::Size,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetResolutionRequest>(
(coded_size,),
0x6ef2c207ff2b74e3,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_resolution(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_math::Size, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamWatchResolutionResponse>(
(),
0x6c7b28be2b72ea7f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.coded_size)
}
pub fn r#set_buffer_collection2(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetBufferCollection2Request>(
(token,),
0x6691d2eed219c8e6,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_buffer_collection(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetBufferCollectionRequest>(
(token,),
0x730ab5c4ee023c6d,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_buffer_collection2(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
fidl::Error,
> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamWatchBufferCollection2Response>(
(),
0x60c9daa36b3d2cf1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.token)
}
pub fn r#watch_buffer_collection(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
fidl::Error,
> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamWatchBufferCollectionResponse>(
(),
0x35d855a45e19e5d6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.token)
}
pub fn r#watch_orientation(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Orientation, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamWatchOrientationResponse>(
(),
0x1f0d1cd93daa1dd4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.orientation)
}
pub fn r#get_next_frame(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<FrameInfo, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetNextFrameResponse>(
(),
0x4b06b8dfbcbdc658,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#get_next_frame2(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<FrameInfo2, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetNextFrame2Response>(
(),
0x7142a7a6aa6a6f10,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamRebindRequest>(
(request,),
0x75b84fa09b68dbef,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct Stream_Proxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for Stream_Proxy {
type Protocol = Stream_Marker;
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 Stream_Proxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> Stream_EventStream {
Stream_EventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<
StreamProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#get_properties(self)
}
pub fn r#get_properties2(
&self,
) -> fidl::client::QueryResponseFut<
StreamProperties2,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#get_properties2(self)
}
pub fn r#set_crop_region(
&self,
mut region: Option<&fidl_fuchsia_math::RectF>,
) -> Result<(), fidl::Error> {
Stream_ProxyInterface::r#set_crop_region(self, region)
}
pub fn r#watch_crop_region(
&self,
) -> fidl::client::QueryResponseFut<
Option<Box<fidl_fuchsia_math::RectF>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#watch_crop_region(self)
}
pub fn r#set_resolution(
&self,
mut coded_size: &fidl_fuchsia_math::Size,
) -> Result<(), fidl::Error> {
Stream_ProxyInterface::r#set_resolution(self, coded_size)
}
pub fn r#watch_resolution(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_math::Size,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#watch_resolution(self)
}
pub fn r#set_buffer_collection2(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
Stream_ProxyInterface::r#set_buffer_collection2(self, token)
}
pub fn r#set_buffer_collection(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
Stream_ProxyInterface::r#set_buffer_collection(self, token)
}
pub fn r#watch_buffer_collection2(
&self,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#watch_buffer_collection2(self)
}
pub fn r#watch_buffer_collection(
&self,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Stream_ProxyInterface::r#watch_buffer_collection(self)
}
pub fn r#watch_orientation(
&self,
) -> fidl::client::QueryResponseFut<Orientation, fidl::encoding::DefaultFuchsiaResourceDialect>
{
Stream_ProxyInterface::r#watch_orientation(self)
}
pub fn r#get_next_frame(
&self,
) -> fidl::client::QueryResponseFut<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
Stream_ProxyInterface::r#get_next_frame(self)
}
pub fn r#get_next_frame2(
&self,
) -> fidl::client::QueryResponseFut<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>
{
Stream_ProxyInterface::r#get_next_frame2(self)
}
pub fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
Stream_ProxyInterface::r#rebind(self, request)
}
}
impl Stream_ProxyInterface for Stream_Proxy {
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
StreamProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StreamProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x13662921504b55f7,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties>(
(),
0x13662921504b55f7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetProperties2ResponseFut = fidl::client::QueryResponseFut<
StreamProperties2,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties2(&self) -> Self::GetProperties2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StreamProperties2, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamGetProperties2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x70346d69a8cbc391,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties2>(
(),
0x70346d69a8cbc391,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_crop_region(
&self,
mut region: Option<&fidl_fuchsia_math::RectF>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetCropRegionRequest>(
(region,),
0x72dde73bf7a94302,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchCropRegionResponseFut = fidl::client::QueryResponseFut<
Option<Box<fidl_fuchsia_math::RectF>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_crop_region(&self) -> Self::WatchCropRegionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamWatchCropRegionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c28250035dbbb90,
>(_buf?)?;
Ok(_response.region)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
Option<Box<fidl_fuchsia_math::RectF>>,
>(
(),
0x4c28250035dbbb90,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_resolution(
&self,
mut coded_size: &fidl_fuchsia_math::Size,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetResolutionRequest>(
(coded_size,),
0x6ef2c207ff2b74e3,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchResolutionResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_math::Size,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_resolution(&self) -> Self::WatchResolutionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_math::Size, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamWatchResolutionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6c7b28be2b72ea7f,
>(_buf?)?;
Ok(_response.coded_size)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_math::Size>(
(),
0x6c7b28be2b72ea7f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_buffer_collection2(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetBufferCollection2Request>(
(token,),
0x6691d2eed219c8e6,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_buffer_collection(
&self,
mut token: Option<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamSetBufferCollectionRequest>(
(token,),
0x730ab5c4ee023c6d,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchBufferCollection2ResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_buffer_collection2(&self) -> Self::WatchBufferCollection2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
fidl::Error,
> {
let _response = fidl::client::decode_transaction_body::<
StreamWatchBufferCollection2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x60c9daa36b3d2cf1,
>(_buf?)?;
Ok(_response.token)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>(
(),
0x60c9daa36b3d2cf1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchBufferCollectionResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_buffer_collection(&self) -> Self::WatchBufferCollectionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
fidl::Error,
> {
let _response = fidl::client::decode_transaction_body::<
StreamWatchBufferCollectionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x35d855a45e19e5d6,
>(_buf?)?;
Ok(_response.token)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>(
(),
0x35d855a45e19e5d6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchOrientationResponseFut =
fidl::client::QueryResponseFut<Orientation, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_orientation(&self) -> Self::WatchOrientationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Orientation, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamWatchOrientationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1f0d1cd93daa1dd4,
>(_buf?)?;
Ok(_response.orientation)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Orientation>(
(),
0x1f0d1cd93daa1dd4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNextFrameResponseFut =
fidl::client::QueryResponseFut<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_next_frame(&self) -> Self::GetNextFrameResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FrameInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamGetNextFrameResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4b06b8dfbcbdc658,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FrameInfo>(
(),
0x4b06b8dfbcbdc658,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNextFrame2ResponseFut =
fidl::client::QueryResponseFut<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_next_frame2(&self) -> Self::GetNextFrame2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FrameInfo2, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamGetNextFrame2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7142a7a6aa6a6f10,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FrameInfo2>(
(),
0x7142a7a6aa6a6f10,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#rebind(
&self,
mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamRebindRequest>(
(request,),
0x75b84fa09b68dbef,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct Stream_EventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for Stream_EventStream {}
impl futures::stream::FusedStream for Stream_EventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for Stream_EventStream {
type Item = Result<Stream_Event, 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(Stream_Event::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum Stream_Event {}
impl Stream_Event {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<Stream_Event, 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: <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct Stream_RequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for Stream_RequestStream {}
impl futures::stream::FusedStream for Stream_RequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for Stream_RequestStream {
type Protocol = Stream_Marker;
type ControlHandle = Stream_ControlHandle;
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 {
Stream_ControlHandle { 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 Stream_RequestStream {
type Item = Result<Stream_Request, 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 Stream_RequestStream 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 {
0x13662921504b55f7 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::GetProperties {
responder: Stream_GetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x70346d69a8cbc391 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::GetProperties2 {
responder: Stream_GetProperties2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x72dde73bf7a94302 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamSetCropRegionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetCropRegionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::SetCropRegion { region: req.region, control_handle })
}
0x4c28250035dbbb90 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::WatchCropRegion {
responder: Stream_WatchCropRegionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6ef2c207ff2b74e3 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamSetResolutionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetResolutionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::SetResolution {
coded_size: req.coded_size,
control_handle,
})
}
0x6c7b28be2b72ea7f => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::WatchResolution {
responder: Stream_WatchResolutionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6691d2eed219c8e6 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamSetBufferCollection2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetBufferCollection2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::SetBufferCollection2 {
token: req.token,
control_handle,
})
}
0x730ab5c4ee023c6d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamSetBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::SetBufferCollection { token: req.token, control_handle })
}
0x60c9daa36b3d2cf1 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::WatchBufferCollection2 {
responder: Stream_WatchBufferCollection2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x35d855a45e19e5d6 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::WatchBufferCollection {
responder: Stream_WatchBufferCollectionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1f0d1cd93daa1dd4 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::WatchOrientation {
responder: Stream_WatchOrientationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b06b8dfbcbdc658 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::GetNextFrame {
responder: Stream_GetNextFrameResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7142a7a6aa6a6f10 => {
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 = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::GetNextFrame2 {
responder: Stream_GetNextFrame2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x75b84fa09b68dbef => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamRebindRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamRebindRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
Ok(Stream_Request::Rebind { request: req.request, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum Stream_Request {
GetProperties {
responder: Stream_GetPropertiesResponder,
},
GetProperties2 {
responder: Stream_GetProperties2Responder,
},
SetCropRegion {
region: Option<Box<fidl_fuchsia_math::RectF>>,
control_handle: Stream_ControlHandle,
},
WatchCropRegion {
responder: Stream_WatchCropRegionResponder,
},
SetResolution {
coded_size: fidl_fuchsia_math::Size,
control_handle: Stream_ControlHandle,
},
WatchResolution {
responder: Stream_WatchResolutionResponder,
},
SetBufferCollection2 {
token:
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
control_handle: Stream_ControlHandle,
},
SetBufferCollection {
token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
control_handle: Stream_ControlHandle,
},
WatchBufferCollection2 {
responder: Stream_WatchBufferCollection2Responder,
},
WatchBufferCollection {
responder: Stream_WatchBufferCollectionResponder,
},
WatchOrientation {
responder: Stream_WatchOrientationResponder,
},
GetNextFrame {
responder: Stream_GetNextFrameResponder,
},
GetNextFrame2 {
responder: Stream_GetNextFrame2Responder,
},
Rebind {
request: fidl::endpoints::ServerEnd<Stream_Marker>,
control_handle: Stream_ControlHandle,
},
}
impl Stream_Request {
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(Stream_GetPropertiesResponder)> {
if let Stream_Request::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties2(self) -> Option<(Stream_GetProperties2Responder)> {
if let Stream_Request::GetProperties2 { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_crop_region(
self,
) -> Option<(Option<Box<fidl_fuchsia_math::RectF>>, Stream_ControlHandle)> {
if let Stream_Request::SetCropRegion { region, control_handle } = self {
Some((region, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_crop_region(self) -> Option<(Stream_WatchCropRegionResponder)> {
if let Stream_Request::WatchCropRegion { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_resolution(self) -> Option<(fidl_fuchsia_math::Size, Stream_ControlHandle)> {
if let Stream_Request::SetResolution { coded_size, control_handle } = self {
Some((coded_size, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_resolution(self) -> Option<(Stream_WatchResolutionResponder)> {
if let Stream_Request::WatchResolution { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_buffer_collection2(
self,
) -> Option<(
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
Stream_ControlHandle,
)> {
if let Stream_Request::SetBufferCollection2 { token, control_handle } = self {
Some((token, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_buffer_collection(
self,
) -> Option<(
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
Stream_ControlHandle,
)> {
if let Stream_Request::SetBufferCollection { token, control_handle } = self {
Some((token, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_buffer_collection2(self) -> Option<(Stream_WatchBufferCollection2Responder)> {
if let Stream_Request::WatchBufferCollection2 { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_buffer_collection(self) -> Option<(Stream_WatchBufferCollectionResponder)> {
if let Stream_Request::WatchBufferCollection { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_orientation(self) -> Option<(Stream_WatchOrientationResponder)> {
if let Stream_Request::WatchOrientation { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_next_frame(self) -> Option<(Stream_GetNextFrameResponder)> {
if let Stream_Request::GetNextFrame { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_next_frame2(self) -> Option<(Stream_GetNextFrame2Responder)> {
if let Stream_Request::GetNextFrame2 { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rebind(
self,
) -> Option<(fidl::endpoints::ServerEnd<Stream_Marker>, Stream_ControlHandle)> {
if let Stream_Request::Rebind { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
Stream_Request::GetProperties { .. } => "get_properties",
Stream_Request::GetProperties2 { .. } => "get_properties2",
Stream_Request::SetCropRegion { .. } => "set_crop_region",
Stream_Request::WatchCropRegion { .. } => "watch_crop_region",
Stream_Request::SetResolution { .. } => "set_resolution",
Stream_Request::WatchResolution { .. } => "watch_resolution",
Stream_Request::SetBufferCollection2 { .. } => "set_buffer_collection2",
Stream_Request::SetBufferCollection { .. } => "set_buffer_collection",
Stream_Request::WatchBufferCollection2 { .. } => "watch_buffer_collection2",
Stream_Request::WatchBufferCollection { .. } => "watch_buffer_collection",
Stream_Request::WatchOrientation { .. } => "watch_orientation",
Stream_Request::GetNextFrame { .. } => "get_next_frame",
Stream_Request::GetNextFrame2 { .. } => "get_next_frame2",
Stream_Request::Rebind { .. } => "rebind",
}
}
}
#[derive(Debug, Clone)]
pub struct Stream_ControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for Stream_ControlHandle {
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 Stream_ControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_GetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_GetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_GetPropertiesResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_GetPropertiesResponder {
pub fn send(self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &StreamProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamGetPropertiesResponse>(
(properties,),
self.tx_id,
0x13662921504b55f7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_GetProperties2Responder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_GetProperties2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_GetProperties2Responder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_GetProperties2Responder {
pub fn send(self, mut properties: &StreamProperties2) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &StreamProperties2,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &StreamProperties2) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamGetProperties2Response>(
(properties,),
self.tx_id,
0x70346d69a8cbc391,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_WatchCropRegionResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_WatchCropRegionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_WatchCropRegionResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_WatchCropRegionResponder {
pub fn send(self, mut region: Option<&fidl_fuchsia_math::RectF>) -> Result<(), fidl::Error> {
let _result = self.send_raw(region);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut region: Option<&fidl_fuchsia_math::RectF>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(region);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut region: Option<&fidl_fuchsia_math::RectF>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamWatchCropRegionResponse>(
(region,),
self.tx_id,
0x4c28250035dbbb90,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_WatchResolutionResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_WatchResolutionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_WatchResolutionResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_WatchResolutionResponder {
pub fn send(self, mut coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error> {
let _result = self.send_raw(coded_size);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut coded_size: &fidl_fuchsia_math::Size,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(coded_size);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamWatchResolutionResponse>(
(coded_size,),
self.tx_id,
0x6c7b28be2b72ea7f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_WatchBufferCollection2Responder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_WatchBufferCollection2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_WatchBufferCollection2Responder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_WatchBufferCollection2Responder {
pub fn send(
self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(token);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(token);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamWatchBufferCollection2Response>(
(token,),
self.tx_id,
0x60c9daa36b3d2cf1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_WatchBufferCollectionResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_WatchBufferCollectionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_WatchBufferCollectionResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_WatchBufferCollectionResponder {
pub fn send(
self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(token);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(token);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamWatchBufferCollectionResponse>(
(token,),
self.tx_id,
0x35d855a45e19e5d6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_WatchOrientationResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_WatchOrientationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_WatchOrientationResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_WatchOrientationResponder {
pub fn send(self, mut orientation: Orientation) -> Result<(), fidl::Error> {
let _result = self.send_raw(orientation);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut orientation: Orientation) -> Result<(), fidl::Error> {
let _result = self.send_raw(orientation);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut orientation: Orientation) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamWatchOrientationResponse>(
(orientation,),
self.tx_id,
0x1f0d1cd93daa1dd4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_GetNextFrameResponder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_GetNextFrameResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_GetNextFrameResponder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_GetNextFrameResponder {
pub fn send(self, mut info: FrameInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut info: FrameInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: FrameInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamGetNextFrameResponse>(
(&mut info,),
self.tx_id,
0x4b06b8dfbcbdc658,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Stream_GetNextFrame2Responder {
control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Stream_GetNextFrame2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Stream_GetNextFrame2Responder {
type ControlHandle = Stream_ControlHandle;
fn control_handle(&self) -> &Stream_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Stream_GetNextFrame2Responder {
pub fn send(self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamGetNextFrame2Response>(
(&mut info,),
self.tx_id,
0x7142a7a6aa6a6f10,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Orientation {
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 Orientation {
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 Orientation {
#[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 Orientation {
#[inline(always)]
fn new_empty() -> Self {
Self::Up
}
#[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 Configuration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Configuration {
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<Configuration, D>
for &Configuration
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Configuration>(offset);
fidl::encoding::Encode::<Configuration, D>::encode(
(
<fidl::encoding::Vector<StreamProperties, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.streams),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<StreamProperties, 256>, D>,
> fidl::encoding::Encode<Configuration, 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::<Configuration>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self { streams: fidl::new_empty!(fidl::encoding::Vector<StreamProperties, 256>, 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::Vector<StreamProperties, 256>, D, &mut self.streams, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceConnectToStreamRequest {
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 DeviceConnectToStreamRequest {
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
fidl::encoding::Encode<
DeviceConnectToStreamRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceConnectToStreamRequest
{
#[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::<DeviceConnectToStreamRequest>(offset);
fidl::encoding::Encode::<DeviceConnectToStreamRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceConnectToStreamRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[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::<DeviceConnectToStreamRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceConnectToStreamRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
request: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
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!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.index,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.request,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetConfigurations2Response {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetConfigurations2Response {
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<DeviceGetConfigurations2Response, D>
for &DeviceGetConfigurations2Response
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetConfigurations2Response>(offset);
fidl::encoding::Encode::<DeviceGetConfigurations2Response, D>::encode(
(
<fidl::encoding::Vector<Configuration2, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.configurations),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<Configuration2, 256>, D>,
> fidl::encoding::Encode<DeviceGetConfigurations2Response, 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::<DeviceGetConfigurations2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceGetConfigurations2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self {
configurations: fidl::new_empty!(fidl::encoding::Vector<Configuration2, 256>, 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::Vector<Configuration2, 256>, D, &mut self.configurations, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetConfigurationsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetConfigurationsResponse {
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<DeviceGetConfigurationsResponse, D>
for &DeviceGetConfigurationsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetConfigurationsResponse>(offset);
fidl::encoding::Encode::<DeviceGetConfigurationsResponse, D>::encode(
(
<fidl::encoding::Vector<Configuration, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.configurations),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<Configuration, 256>, D>,
> fidl::encoding::Encode<DeviceGetConfigurationsResponse, 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::<DeviceGetConfigurationsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceGetConfigurationsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { configurations: fidl::new_empty!(fidl::encoding::Vector<Configuration, 256>, 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::Vector<Configuration, 256>, D, &mut self.configurations, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetIdentifierResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetIdentifierResponse {
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<DeviceGetIdentifierResponse, D> for &DeviceGetIdentifierResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetIdentifierResponse>(offset);
fidl::encoding::Encode::<DeviceGetIdentifierResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::BoundedString<256>> as fidl::encoding::ValueTypeMarker>::borrow(&self.identifier),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<256>>, D>,
> fidl::encoding::Encode<DeviceGetIdentifierResponse, 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::<DeviceGetIdentifierResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceGetIdentifierResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
identifier: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::BoundedString<256>>,
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::BoundedString<256>>,
D,
&mut self.identifier,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceRebindRequest {
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 DeviceRebindRequest {
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<DeviceRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DeviceRebindRequest
{
#[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::<DeviceRebindRequest>(offset);
fidl::encoding::Encode::<DeviceRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DeviceRebindRequest, 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::<DeviceRebindRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceRebindRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
request: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
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::ServerEnd<DeviceMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.request,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentConfigurationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentConfigurationRequest {
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<DeviceSetCurrentConfigurationRequest, D>
for &DeviceSetCurrentConfigurationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetCurrentConfigurationRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceSetCurrentConfigurationRequest)
.write_unaligned((self as *const DeviceSetCurrentConfigurationRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeviceSetCurrentConfigurationRequest, 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::<DeviceSetCurrentConfigurationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceSetCurrentConfigurationRequest
{
#[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 DeviceSetSoftwareMuteStateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceSetSoftwareMuteStateRequest {
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<DeviceSetSoftwareMuteStateRequest, D>
for &DeviceSetSoftwareMuteStateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetSoftwareMuteStateRequest>(offset);
fidl::encoding::Encode::<DeviceSetSoftwareMuteStateRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.muted),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<DeviceSetSoftwareMuteStateRequest, 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::<DeviceSetSoftwareMuteStateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceSetSoftwareMuteStateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { muted: 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.muted, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatchCurrentConfigurationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatchCurrentConfigurationResponse {
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<DeviceWatchCurrentConfigurationResponse, D>
for &DeviceWatchCurrentConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatchCurrentConfigurationResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceWatchCurrentConfigurationResponse).write_unaligned(
(self as *const DeviceWatchCurrentConfigurationResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeviceWatchCurrentConfigurationResponse, 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::<DeviceWatchCurrentConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatchCurrentConfigurationResponse
{
#[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 DeviceWatchMuteStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatchMuteStateResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceWatchMuteStateResponse, D> for &DeviceWatchMuteStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatchMuteStateResponse>(offset);
fidl::encoding::Encode::<DeviceWatchMuteStateResponse, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.software_muted),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.hardware_muted),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<DeviceWatchMuteStateResponse, 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::<DeviceWatchMuteStateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatchMuteStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
software_muted: fidl::new_empty!(bool, D),
hardware_muted: 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.software_muted, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.hardware_muted, decoder, offset + 1, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceWatcherConnectToDeviceRequest {
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 DeviceWatcherConnectToDeviceRequest {
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
fidl::encoding::Encode<
DeviceWatcherConnectToDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceWatcherConnectToDeviceRequest
{
#[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::<DeviceWatcherConnectToDeviceRequest>(offset);
fidl::encoding::Encode::<DeviceWatcherConnectToDeviceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceWatcherConnectToDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[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::<DeviceWatcherConnectToDeviceRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceWatcherConnectToDeviceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
request: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.request,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherWatchDevicesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatcherWatchDevicesResponse {
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<DeviceWatcherWatchDevicesResponse, D>
for &DeviceWatcherWatchDevicesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherWatchDevicesResponse>(offset);
fidl::encoding::Encode::<DeviceWatcherWatchDevicesResponse, D>::encode(
(
<fidl::encoding::Vector<WatchDevicesEvent, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<WatchDevicesEvent, 256>, D>,
> fidl::encoding::Encode<DeviceWatcherWatchDevicesResponse, 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::<DeviceWatcherWatchDevicesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatcherWatchDevicesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { events: fidl::new_empty!(fidl::encoding::Vector<WatchDevicesEvent, 256>, 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::Vector<WatchDevicesEvent, 256>, D, &mut self.events, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FrameInfo {
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 FrameInfo {
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 fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut FrameInfo
{
#[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::<FrameInfo>(offset);
fidl::encoding::Encode::<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_counter),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.release_fence),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<i64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T3: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3)
{
#[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::<FrameInfo>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
buffer_index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
frame_counter: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
timestamp: fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect),
release_fence: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, 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);
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,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
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 + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.buffer_index,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.frame_counter,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.timestamp,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.release_fence, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FrameRate {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FrameRate {
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
}
#[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<FrameRate, D>
for &FrameRate
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FrameRate>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FrameRate).write_unaligned((self as *const FrameRate).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<FrameRate, 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::<FrameRate>(offset);
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 FrameRate {
#[inline(always)]
fn new_empty() -> Self {
Self { numerator: fidl::new_empty!(u32, D), denominator: 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamGetNextFrame2Response {
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 StreamGetNextFrame2Response {
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
fidl::encoding::Encode<
StreamGetNextFrame2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamGetNextFrame2Response
{
#[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::<StreamGetNextFrame2Response>(offset);
fidl::encoding::Encode::<
StreamGetNextFrame2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<FrameInfo2 as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.info,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
StreamGetNextFrame2Response,
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::<StreamGetNextFrame2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamGetNextFrame2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(FrameInfo2, 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!(
FrameInfo2,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamGetNextFrameResponse {
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 StreamGetNextFrameResponse {
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
fidl::encoding::Encode<
StreamGetNextFrameResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamGetNextFrameResponse
{
#[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::<StreamGetNextFrameResponse>(offset);
fidl::encoding::Encode::<
StreamGetNextFrameResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<FrameInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
StreamGetNextFrameResponse,
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::<StreamGetNextFrameResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamGetNextFrameResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(FrameInfo, 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!(
FrameInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamGetProperties2Response {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamGetProperties2Response {
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<StreamGetProperties2Response, D> for &StreamGetProperties2Response
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamGetProperties2Response>(offset);
fidl::encoding::Encode::<StreamGetProperties2Response, D>::encode(
(<StreamProperties2 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamProperties2, D>>
fidl::encoding::Encode<StreamGetProperties2Response, 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::<StreamGetProperties2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamGetProperties2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(StreamProperties2, 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!(StreamProperties2, D, &mut self.properties, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamGetPropertiesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
72
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<StreamGetPropertiesResponse, D> for &StreamGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamGetPropertiesResponse>(offset);
fidl::encoding::Encode::<StreamGetPropertiesResponse, D>::encode(
(<StreamProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamProperties, D>>
fidl::encoding::Encode<StreamGetPropertiesResponse, 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::<StreamGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(StreamProperties, 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!(StreamProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamProperties {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
72
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamProperties, D>
for &StreamProperties
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamProperties>(offset);
fidl::encoding::Encode::<StreamProperties, D>::encode(
(
<fidl_fuchsia_sysmem::ImageFormat2 as fidl::encoding::ValueTypeMarker>::borrow(
&self.image_format,
),
<FrameRate as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rate),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_crop_region),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_sysmem::ImageFormat2, D>,
T1: fidl::encoding::Encode<FrameRate, D>,
T2: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<StreamProperties, 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::<StreamProperties>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 56, depth)?;
self.2.encode(encoder, offset + 64, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamProperties {
#[inline(always)]
fn new_empty() -> Self {
Self {
image_format: fidl::new_empty!(fidl_fuchsia_sysmem::ImageFormat2, D),
frame_rate: fidl::new_empty!(FrameRate, D),
supports_crop_region: 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(64) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_sysmem::ImageFormat2,
D,
&mut self.image_format,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(FrameRate, D, &mut self.frame_rate, decoder, offset + 56, _depth)?;
fidl::decode!(bool, D, &mut self.supports_crop_region, decoder, offset + 64, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamRebindRequest {
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 StreamRebindRequest {
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<StreamRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut StreamRebindRequest
{
#[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::<StreamRebindRequest>(offset);
fidl::encoding::Encode::<StreamRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<StreamRebindRequest, 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::<StreamRebindRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamRebindRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
request: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
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::ServerEnd<Stream_Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.request,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamSetBufferCollection2Request {
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 StreamSetBufferCollection2Request {
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<
StreamSetBufferCollection2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamSetBufferCollection2Request
{
#[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::<StreamSetBufferCollection2Request>(offset);
fidl::encoding::Encode::<
StreamSetBufferCollection2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamSetBufferCollection2Request,
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::<StreamSetBufferCollection2Request>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamSetBufferCollection2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
>,
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::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamSetBufferCollectionRequest {
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 StreamSetBufferCollectionRequest {
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<
StreamSetBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamSetBufferCollectionRequest
{
#[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::<StreamSetBufferCollectionRequest>(offset);
fidl::encoding::Encode::<
StreamSetBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
>,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamSetBufferCollectionRequest,
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::<StreamSetBufferCollectionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamSetBufferCollectionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
>,
>,
>,
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::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamSetCropRegionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamSetCropRegionRequest {
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<StreamSetCropRegionRequest, D> for &StreamSetCropRegionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamSetCropRegionRequest>(offset);
fidl::encoding::Encode::<StreamSetCropRegionRequest, D>::encode(
(
<fidl::encoding::Boxed<fidl_fuchsia_math::RectF> as fidl::encoding::ValueTypeMarker>::borrow(&self.region),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_math::RectF>, D>,
> fidl::encoding::Encode<StreamSetCropRegionRequest, 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::<StreamSetCropRegionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamSetCropRegionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { region: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_math::RectF>, 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::Boxed<fidl_fuchsia_math::RectF>,
D,
&mut self.region,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamSetResolutionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamSetResolutionRequest {
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<StreamSetResolutionRequest, D> for &StreamSetResolutionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamSetResolutionRequest>(offset);
fidl::encoding::Encode::<StreamSetResolutionRequest, D>::encode(
(<fidl_fuchsia_math::Size as fidl::encoding::ValueTypeMarker>::borrow(
&self.coded_size,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_math::Size, D>,
> fidl::encoding::Encode<StreamSetResolutionRequest, 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::<StreamSetResolutionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamSetResolutionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { coded_size: fidl::new_empty!(fidl_fuchsia_math::Size, 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_fuchsia_math::Size,
D,
&mut self.coded_size,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamWatchBufferCollection2Response {
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 StreamWatchBufferCollection2Response {
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<
StreamWatchBufferCollection2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamWatchBufferCollection2Response
{
#[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::<StreamWatchBufferCollection2Response>(offset);
fidl::encoding::Encode::<
StreamWatchBufferCollection2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamWatchBufferCollection2Response,
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::<StreamWatchBufferCollection2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamWatchBufferCollection2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
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<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamWatchBufferCollectionResponse {
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 StreamWatchBufferCollectionResponse {
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<
StreamWatchBufferCollectionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamWatchBufferCollectionResponse
{
#[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::<StreamWatchBufferCollectionResponse>(offset);
fidl::encoding::Encode::<
StreamWatchBufferCollectionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamWatchBufferCollectionResponse,
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::<StreamWatchBufferCollectionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamWatchBufferCollectionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
>,
>,
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<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamWatchCropRegionResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamWatchCropRegionResponse {
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<StreamWatchCropRegionResponse, D>
for &StreamWatchCropRegionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamWatchCropRegionResponse>(offset);
fidl::encoding::Encode::<StreamWatchCropRegionResponse, D>::encode(
(
<fidl::encoding::Boxed<fidl_fuchsia_math::RectF> as fidl::encoding::ValueTypeMarker>::borrow(&self.region),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_math::RectF>, D>,
> fidl::encoding::Encode<StreamWatchCropRegionResponse, 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::<StreamWatchCropRegionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamWatchCropRegionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { region: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_math::RectF>, 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::Boxed<fidl_fuchsia_math::RectF>,
D,
&mut self.region,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamWatchOrientationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamWatchOrientationResponse {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<StreamWatchOrientationResponse, D>
for &StreamWatchOrientationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamWatchOrientationResponse>(offset);
fidl::encoding::Encode::<StreamWatchOrientationResponse, D>::encode(
(<Orientation as fidl::encoding::ValueTypeMarker>::borrow(&self.orientation),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Orientation, D>>
fidl::encoding::Encode<StreamWatchOrientationResponse, 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::<StreamWatchOrientationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamWatchOrientationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { orientation: fidl::new_empty!(Orientation, 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!(Orientation, D, &mut self.orientation, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamWatchResolutionResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamWatchResolutionResponse {
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<StreamWatchResolutionResponse, D>
for &StreamWatchResolutionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamWatchResolutionResponse>(offset);
fidl::encoding::Encode::<StreamWatchResolutionResponse, D>::encode(
(<fidl_fuchsia_math::Size as fidl::encoding::ValueTypeMarker>::borrow(
&self.coded_size,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_math::Size, D>,
> fidl::encoding::Encode<StreamWatchResolutionResponse, 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::<StreamWatchResolutionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamWatchResolutionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { coded_size: fidl::new_empty!(fidl_fuchsia_math::Size, 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_fuchsia_math::Size,
D,
&mut self.coded_size,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl Configuration2 {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.streams {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Configuration2 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Configuration2 {
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<Configuration2, D>
for &Configuration2
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Configuration2>(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::Vector<StreamProperties2, 256>, D>(
self.streams.as_ref().map(<fidl::encoding::Vector<StreamProperties2, 256> 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 Configuration2 {
#[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::Vector<StreamProperties2, 256> 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.streams.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<StreamProperties2, 256>, D),
);
fidl::decode!(fidl::encoding::Vector<StreamProperties2, 256>, 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 FrameInfo2 {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.release_fence {
return 5;
}
if let Some(_) = self.capture_timestamp {
return 4;
}
if let Some(_) = self.timestamp {
return 3;
}
if let Some(_) = self.frame_counter {
return 2;
}
if let Some(_) = self.buffer_index {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for FrameInfo2 {
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 FrameInfo2 {
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 fidl::encoding::Encode<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut FrameInfo2
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FrameInfo2>(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::<
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.buffer_index.as_ref().map(<u32 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::<
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.frame_counter.as_ref().map(<u64 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::<
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.timestamp.as_ref().map(<i64 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::<
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.capture_timestamp
.as_ref()
.map(<i64 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::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.release_fence.as_mut().map(
<fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo2 {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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 =
<u32 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.buffer_index.get_or_insert_with(|| {
fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 =
<u64 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.frame_counter.get_or_insert_with(|| {
fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 =
<i64 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.timestamp.get_or_insert_with(|| {
fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 =
<i64 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.capture_timestamp.get_or_insert_with(|| {
fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
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::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> 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.release_fence.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, 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 StreamProperties2 {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.supported_resolutions {
return 4;
}
if let Some(_) = self.supports_crop_region {
return 3;
}
if let Some(_) = self.frame_rate {
return 2;
}
if let Some(_) = self.image_format {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for StreamProperties2 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamProperties2 {
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<StreamProperties2, D>
for &StreamProperties2
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamProperties2>(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_fuchsia_sysmem::ImageFormat2, D>(
self.image_format.as_ref().map(
<fidl_fuchsia_sysmem::ImageFormat2 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::<FrameRate, D>(
self.frame_rate
.as_ref()
.map(<FrameRate 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.supports_crop_region
.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::<fidl::encoding::Vector<fidl_fuchsia_math::Size, 256>, D>(
self.supported_resolutions.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_math::Size, 256> 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 StreamProperties2 {
#[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_fuchsia_sysmem::ImageFormat2 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
.image_format
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_sysmem::ImageFormat2, D));
fidl::decode!(
fidl_fuchsia_sysmem::ImageFormat2,
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 =
<FrameRate 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.frame_rate.get_or_insert_with(|| fidl::new_empty!(FrameRate, D));
fidl::decode!(FrameRate, 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.supports_crop_region.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 = <fidl::encoding::Vector<fidl_fuchsia_math::Size, 256> 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.supported_resolutions.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_math::Size, 256>, D),
);
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_math::Size, 256>, 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 fidl::encoding::ValueTypeMarker for WatchDevicesEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WatchDevicesEvent {
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<WatchDevicesEvent, D>
for &WatchDevicesEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WatchDevicesEvent>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
WatchDevicesEvent::Existing(ref val) => {
fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
WatchDevicesEvent::Added(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
WatchDevicesEvent::Removed(ref val) => {
fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchDevicesEvent {
#[inline(always)]
fn new_empty() -> Self {
Self::Existing(fidl::new_empty!(u64, D))
}
#[inline]
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);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Existing(_) = self {
} else {
*self = WatchDevicesEvent::Existing(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Existing(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Added(_) = self {
} else {
*self = WatchDevicesEvent::Added(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Added(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Removed(_) = self {
} else {
*self = WatchDevicesEvent::Removed(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let WatchDevicesEvent::Removed(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
}