#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const DISPLAY_NOT_OWNED_SIGNAL: u32 = 16777216;
pub const DISPLAY_OWNED_SIGNAL: u32 = 33554432;
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ScenicCreateSession2Request {
pub session: fidl::endpoints::ServerEnd<SessionMarker>,
pub listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
pub view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicCreateSession2Request
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ScenicCreateSessionRequest {
pub session: fidl::endpoints::ServerEnd<SessionMarker>,
pub listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicCreateSessionRequest
{
}
#[derive(Debug, PartialEq)]
pub struct ScenicCreateSessionTRequest {
pub endpoints: SessionEndpoints,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicCreateSessionTRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct ScenicGetDisplayInfoResponse {
pub info: fidl_fuchsia_ui_gfx::DisplayInfo,
}
impl fidl::Persistable for ScenicGetDisplayInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ScenicGetDisplayOwnershipEventResponse {
pub ownership_event: fidl::Event,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicGetDisplayOwnershipEventResponse
{
}
#[derive(Debug, PartialEq)]
pub struct ScenicTakeScreenshotResponse {
pub img_data: ScreenshotData,
pub success: bool,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicTakeScreenshotResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ScenicUsesFlatlandResponse {
pub flatland_enabled: bool,
}
impl fidl::Persistable for ScenicUsesFlatlandResponse {}
#[derive(Debug, PartialEq)]
pub struct ScreenshotData {
pub info: fidl_fuchsia_images::ImageInfo,
pub data: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ScreenshotData {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SessionDeregisterBufferCollectionRequest {
pub buffer_id: u32,
}
impl fidl::Persistable for SessionDeregisterBufferCollectionRequest {}
#[derive(Debug, PartialEq)]
pub struct SessionEnqueueRequest {
pub cmds: Vec<Command>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionEnqueueRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SessionListenerOnScenicErrorRequest {
pub error: String,
}
impl fidl::Persistable for SessionListenerOnScenicErrorRequest {}
#[derive(Debug, PartialEq)]
pub struct SessionListenerOnScenicEventRequest {
pub events: Vec<Event>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionListenerOnScenicEventRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct SessionOnFramePresentedRequest {
pub frame_presented_info: fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
}
impl fidl::Persistable for SessionOnFramePresentedRequest {}
#[derive(Debug, PartialEq)]
pub struct SessionPresent2Request {
pub args: Present2Args,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionPresent2Request {}
#[derive(Clone, Debug, PartialEq)]
pub struct SessionPresent2Response {
pub request_presentation_times_info: fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
}
impl fidl::Persistable for SessionPresent2Response {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SessionPresentRequest {
pub presentation_time: u64,
pub acquire_fences: Vec<fidl::Event>,
pub release_fences: Vec<fidl::Event>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionPresentRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct SessionPresentResponse {
pub presentation_info: fidl_fuchsia_images::PresentationInfo,
}
impl fidl::Persistable for SessionPresentResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SessionRegisterBufferCollectionRequest {
pub buffer_id: u32,
pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionRegisterBufferCollectionRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SessionRequestPresentationTimesRequest {
pub requested_prediction_span: i64,
}
impl fidl::Persistable for SessionRequestPresentationTimesRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct SessionRequestPresentationTimesResponse {
pub request_presentation_times_info: fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
}
impl fidl::Persistable for SessionRequestPresentationTimesResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SessionSetDebugNameRequest {
pub debug_name: String,
}
impl fidl::Persistable for SessionSetDebugNameRequest {}
#[derive(Debug, Default, PartialEq)]
pub struct Present2Args {
pub requested_presentation_time: Option<i64>,
pub acquire_fences: Option<Vec<fidl::Event>>,
pub release_fences: Option<Vec<fidl::Event>>,
pub requested_prediction_span: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Present2Args {}
#[derive(Debug, Default, PartialEq)]
pub struct SessionEndpoints {
pub session: Option<fidl::endpoints::ServerEnd<SessionMarker>>,
pub session_listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
pub view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
pub view_ref_focused:
Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>>,
pub touch_source:
Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>>,
pub mouse_source:
Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionEndpoints {}
#[derive(Debug, PartialEq)]
pub enum Command {
Gfx(fidl_fuchsia_ui_gfx::Command),
Views(fidl_fuchsia_ui_views::Command),
Input(fidl_fuchsia_ui_input::Command),
}
impl Command {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Gfx(_) => 1,
Self::Views(_) => 3,
Self::Input(_) => 4,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Command {}
#[derive(Debug, PartialEq)]
pub enum Event {
Gfx(fidl_fuchsia_ui_gfx::Event),
Input(fidl_fuchsia_ui_input::InputEvent),
Unhandled(Command),
}
impl Event {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Gfx(_) => 1,
Self::Input(_) => 2,
Self::Unhandled(_) => 3,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ScenicMarker;
impl fidl::endpoints::ProtocolMarker for ScenicMarker {
type Proxy = ScenicProxy;
type RequestStream = ScenicRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ScenicSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.ui.scenic.Scenic";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ScenicMarker {}
pub trait ScenicProxyInterface: Send + Sync {
fn r#create_session(
&self,
session: fidl::endpoints::ServerEnd<SessionMarker>,
listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
) -> Result<(), fidl::Error>;
fn r#create_session2(
&self,
session: fidl::endpoints::ServerEnd<SessionMarker>,
listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
) -> Result<(), fidl::Error>;
type CreateSessionTResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#create_session_t(&self, endpoints: SessionEndpoints) -> Self::CreateSessionTResponseFut;
type GetDisplayInfoResponseFut: std::future::Future<Output = Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error>>
+ Send;
fn r#get_display_info(&self) -> Self::GetDisplayInfoResponseFut;
type GetDisplayOwnershipEventResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
+ Send;
fn r#get_display_ownership_event(&self) -> Self::GetDisplayOwnershipEventResponseFut;
type TakeScreenshotResponseFut: std::future::Future<Output = Result<(ScreenshotData, bool), fidl::Error>>
+ Send;
fn r#take_screenshot(&self) -> Self::TakeScreenshotResponseFut;
type UsesFlatlandResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#uses_flatland(&self) -> Self::UsesFlatlandResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ScenicSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ScenicSynchronousProxy {
type Proxy = ScenicProxy;
type Protocol = ScenicMarker;
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 ScenicSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ScenicMarker 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<ScenicEvent, fidl::Error> {
ScenicEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_session(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
) -> Result<(), fidl::Error> {
self.client.send::<ScenicCreateSessionRequest>(
(session, listener),
0x2af781f341771a50,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#create_session2(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
) -> Result<(), fidl::Error> {
self.client.send::<ScenicCreateSession2Request>(
(session, listener, view_focuser),
0x11fa60f776121fa5,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#create_session_t(
&self,
mut endpoints: SessionEndpoints,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<ScenicCreateSessionTRequest, fidl::encoding::EmptyPayload>(
(&mut endpoints,),
0x369061a897552d4f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_display_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ScenicGetDisplayInfoResponse>(
(),
0x3e4cdecbf7cc1797,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#get_display_ownership_event(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::Event, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, ScenicGetDisplayOwnershipEventResponse>(
(),
0x54c114c7322b24d6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.ownership_event)
}
pub fn r#take_screenshot(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(ScreenshotData, bool), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ScenicTakeScreenshotResponse>(
(),
0x53f5e06463987df2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.img_data, _response.success))
}
pub fn r#uses_flatland(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ScenicUsesFlatlandResponse>(
(),
0x5f2e5e19463ae706,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.flatland_enabled)
}
}
#[derive(Debug, Clone)]
pub struct ScenicProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ScenicProxy {
type Protocol = ScenicMarker;
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 ScenicProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ScenicEventStream {
ScenicEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_session(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
) -> Result<(), fidl::Error> {
ScenicProxyInterface::r#create_session(self, session, listener)
}
pub fn r#create_session2(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
) -> Result<(), fidl::Error> {
ScenicProxyInterface::r#create_session2(self, session, listener, view_focuser)
}
pub fn r#create_session_t(
&self,
mut endpoints: SessionEndpoints,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
ScenicProxyInterface::r#create_session_t(self, endpoints)
}
pub fn r#get_display_info(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_ui_gfx::DisplayInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ScenicProxyInterface::r#get_display_info(self)
}
pub fn r#get_display_ownership_event(
&self,
) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ScenicProxyInterface::r#get_display_ownership_event(self)
}
pub fn r#take_screenshot(
&self,
) -> fidl::client::QueryResponseFut<
(ScreenshotData, bool),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ScenicProxyInterface::r#take_screenshot(self)
}
pub fn r#uses_flatland(
&self,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
ScenicProxyInterface::r#uses_flatland(self)
}
}
impl ScenicProxyInterface for ScenicProxy {
fn r#create_session(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
) -> Result<(), fidl::Error> {
self.client.send::<ScenicCreateSessionRequest>(
(session, listener),
0x2af781f341771a50,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#create_session2(
&self,
mut session: fidl::endpoints::ServerEnd<SessionMarker>,
mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
) -> Result<(), fidl::Error> {
self.client.send::<ScenicCreateSession2Request>(
(session, listener, view_focuser),
0x11fa60f776121fa5,
fidl::encoding::DynamicFlags::empty(),
)
}
type CreateSessionTResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#create_session_t(
&self,
mut endpoints: SessionEndpoints,
) -> Self::CreateSessionTResponseFut {
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,
0x369061a897552d4f,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<ScenicCreateSessionTRequest, ()>(
(&mut endpoints,),
0x369061a897552d4f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDisplayInfoResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_ui_gfx::DisplayInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_display_info(&self) -> Self::GetDisplayInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ScenicGetDisplayInfoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3e4cdecbf7cc1797,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_ui_gfx::DisplayInfo,
>(
(),
0x3e4cdecbf7cc1797,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDisplayOwnershipEventResponseFut =
fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_display_ownership_event(&self) -> Self::GetDisplayOwnershipEventResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::Event, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ScenicGetDisplayOwnershipEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54c114c7322b24d6,
>(_buf?)?;
Ok(_response.ownership_event)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Event>(
(),
0x54c114c7322b24d6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type TakeScreenshotResponseFut = fidl::client::QueryResponseFut<
(ScreenshotData, bool),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#take_screenshot(&self) -> Self::TakeScreenshotResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(ScreenshotData, bool), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ScenicTakeScreenshotResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x53f5e06463987df2,
>(_buf?)?;
Ok((_response.img_data, _response.success))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (ScreenshotData, bool)>(
(),
0x53f5e06463987df2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UsesFlatlandResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#uses_flatland(&self) -> Self::UsesFlatlandResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ScenicUsesFlatlandResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5f2e5e19463ae706,
>(_buf?)?;
Ok(_response.flatland_enabled)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
(),
0x5f2e5e19463ae706,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ScenicEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ScenicEventStream {}
impl futures::stream::FusedStream for ScenicEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ScenicEventStream {
type Item = Result<ScenicEvent, 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(ScenicEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ScenicEvent {}
impl ScenicEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ScenicEvent, 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: <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ScenicRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ScenicRequestStream {}
impl futures::stream::FusedStream for ScenicRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ScenicRequestStream {
type Protocol = ScenicMarker;
type ControlHandle = ScenicControlHandle;
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 {
ScenicControlHandle { 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 ScenicRequestStream {
type Item = Result<ScenicRequest, 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 ScenicRequestStream 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 {
0x2af781f341771a50 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ScenicCreateSessionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSessionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::CreateSession {
session: req.session,
listener: req.listener,
control_handle,
})
}
0x11fa60f776121fa5 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ScenicCreateSession2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSession2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::CreateSession2 {
session: req.session,
listener: req.listener,
view_focuser: req.view_focuser,
control_handle,
})
}
0x369061a897552d4f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ScenicCreateSessionTRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSessionTRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::CreateSessionT {
endpoints: req.endpoints,
responder: ScenicCreateSessionTResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3e4cdecbf7cc1797 => {
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 = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::GetDisplayInfo {
responder: ScenicGetDisplayInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x54c114c7322b24d6 => {
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 = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::GetDisplayOwnershipEvent {
responder: ScenicGetDisplayOwnershipEventResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x53f5e06463987df2 => {
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 = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::TakeScreenshot {
responder: ScenicTakeScreenshotResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5f2e5e19463ae706 => {
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 = ScenicControlHandle { inner: this.inner.clone() };
Ok(ScenicRequest::UsesFlatland {
responder: ScenicUsesFlatlandResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ScenicRequest {
CreateSession {
session: fidl::endpoints::ServerEnd<SessionMarker>,
listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
control_handle: ScenicControlHandle,
},
CreateSession2 {
session: fidl::endpoints::ServerEnd<SessionMarker>,
listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
control_handle: ScenicControlHandle,
},
CreateSessionT { endpoints: SessionEndpoints, responder: ScenicCreateSessionTResponder },
GetDisplayInfo { responder: ScenicGetDisplayInfoResponder },
GetDisplayOwnershipEvent { responder: ScenicGetDisplayOwnershipEventResponder },
TakeScreenshot { responder: ScenicTakeScreenshotResponder },
UsesFlatland { responder: ScenicUsesFlatlandResponder },
}
impl ScenicRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_session(
self,
) -> Option<(
fidl::endpoints::ServerEnd<SessionMarker>,
Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
ScenicControlHandle,
)> {
if let ScenicRequest::CreateSession { session, listener, control_handle } = self {
Some((session, listener, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_session2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<SessionMarker>,
Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
ScenicControlHandle,
)> {
if let ScenicRequest::CreateSession2 { session, listener, view_focuser, control_handle } =
self
{
Some((session, listener, view_focuser, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_session_t(
self,
) -> Option<(SessionEndpoints, ScenicCreateSessionTResponder)> {
if let ScenicRequest::CreateSessionT { endpoints, responder } = self {
Some((endpoints, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_display_info(self) -> Option<(ScenicGetDisplayInfoResponder)> {
if let ScenicRequest::GetDisplayInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_display_ownership_event(
self,
) -> Option<(ScenicGetDisplayOwnershipEventResponder)> {
if let ScenicRequest::GetDisplayOwnershipEvent { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_take_screenshot(self) -> Option<(ScenicTakeScreenshotResponder)> {
if let ScenicRequest::TakeScreenshot { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_uses_flatland(self) -> Option<(ScenicUsesFlatlandResponder)> {
if let ScenicRequest::UsesFlatland { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ScenicRequest::CreateSession { .. } => "create_session",
ScenicRequest::CreateSession2 { .. } => "create_session2",
ScenicRequest::CreateSessionT { .. } => "create_session_t",
ScenicRequest::GetDisplayInfo { .. } => "get_display_info",
ScenicRequest::GetDisplayOwnershipEvent { .. } => "get_display_ownership_event",
ScenicRequest::TakeScreenshot { .. } => "take_screenshot",
ScenicRequest::UsesFlatland { .. } => "uses_flatland",
}
}
}
#[derive(Debug, Clone)]
pub struct ScenicControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ScenicControlHandle {
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 ScenicControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ScenicCreateSessionTResponder {
control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ScenicCreateSessionTResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ScenicCreateSessionTResponder {
type ControlHandle = ScenicControlHandle;
fn control_handle(&self) -> &ScenicControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ScenicCreateSessionTResponder {
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,
0x369061a897552d4f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ScenicGetDisplayInfoResponder {
control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ScenicGetDisplayInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ScenicGetDisplayInfoResponder {
type ControlHandle = ScenicControlHandle;
fn control_handle(&self) -> &ScenicControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ScenicGetDisplayInfoResponder {
pub fn send(self, mut info: &fidl_fuchsia_ui_gfx::DisplayInfo) -> 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: &fidl_fuchsia_ui_gfx::DisplayInfo,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: &fidl_fuchsia_ui_gfx::DisplayInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ScenicGetDisplayInfoResponse>(
(info,),
self.tx_id,
0x3e4cdecbf7cc1797,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ScenicGetDisplayOwnershipEventResponder {
control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ScenicGetDisplayOwnershipEventResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ScenicGetDisplayOwnershipEventResponder {
type ControlHandle = ScenicControlHandle;
fn control_handle(&self) -> &ScenicControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ScenicGetDisplayOwnershipEventResponder {
pub fn send(self, mut ownership_event: fidl::Event) -> Result<(), fidl::Error> {
let _result = self.send_raw(ownership_event);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut ownership_event: fidl::Event,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(ownership_event);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut ownership_event: fidl::Event) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ScenicGetDisplayOwnershipEventResponse>(
(ownership_event,),
self.tx_id,
0x54c114c7322b24d6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ScenicTakeScreenshotResponder {
control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ScenicTakeScreenshotResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ScenicTakeScreenshotResponder {
type ControlHandle = ScenicControlHandle;
fn control_handle(&self) -> &ScenicControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ScenicTakeScreenshotResponder {
pub fn send(self, mut img_data: ScreenshotData, mut success: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(img_data, success);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut img_data: ScreenshotData,
mut success: bool,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(img_data, success);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut img_data: ScreenshotData, mut success: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ScenicTakeScreenshotResponse>(
(&mut img_data, success),
self.tx_id,
0x53f5e06463987df2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ScenicUsesFlatlandResponder {
control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ScenicUsesFlatlandResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ScenicUsesFlatlandResponder {
type ControlHandle = ScenicControlHandle;
fn control_handle(&self) -> &ScenicControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ScenicUsesFlatlandResponder {
pub fn send(self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(flatland_enabled);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(flatland_enabled);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ScenicUsesFlatlandResponse>(
(flatland_enabled,),
self.tx_id,
0x5f2e5e19463ae706,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SessionMarker;
impl fidl::endpoints::ProtocolMarker for SessionMarker {
type Proxy = SessionProxy;
type RequestStream = SessionRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SessionSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Session";
}
pub trait SessionProxyInterface: Send + Sync {
fn r#enqueue(&self, cmds: Vec<Command>) -> Result<(), fidl::Error>;
type PresentResponseFut: std::future::Future<Output = Result<fidl_fuchsia_images::PresentationInfo, fidl::Error>>
+ Send;
fn r#present(
&self,
presentation_time: u64,
acquire_fences: Vec<fidl::Event>,
release_fences: Vec<fidl::Event>,
) -> Self::PresentResponseFut;
type Present2ResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error>,
> + Send;
fn r#present2(&self, args: Present2Args) -> Self::Present2ResponseFut;
type RequestPresentationTimesResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error>,
> + Send;
fn r#request_presentation_times(
&self,
requested_prediction_span: i64,
) -> Self::RequestPresentationTimesResponseFut;
fn r#register_buffer_collection(
&self,
buffer_id: u32,
token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error>;
fn r#deregister_buffer_collection(&self, buffer_id: u32) -> Result<(), fidl::Error>;
fn r#set_debug_name(&self, debug_name: &str) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SessionSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SessionSynchronousProxy {
type Proxy = SessionProxy;
type Protocol = SessionMarker;
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 SessionSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SessionMarker 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<SessionEvent, fidl::Error> {
SessionEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
self.client.send::<SessionEnqueueRequest>(
(cmds.as_mut(),),
0x61e1e8b2cb6b0852,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#present(
&self,
mut presentation_time: u64,
mut acquire_fences: Vec<fidl::Event>,
mut release_fences: Vec<fidl::Event>,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_images::PresentationInfo, fidl::Error> {
let _response = self.client.send_query::<SessionPresentRequest, SessionPresentResponse>(
(presentation_time, acquire_fences.as_mut(), release_fences.as_mut()),
0x36967062cdd2c37e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.presentation_info)
}
pub fn r#present2(
&self,
mut args: Present2Args,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
let _response = self.client.send_query::<SessionPresent2Request, SessionPresent2Response>(
(&mut args,),
0x5d307d6198d76a65,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.request_presentation_times_info)
}
pub fn r#request_presentation_times(
&self,
mut requested_prediction_span: i64,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
let _response = self.client.send_query::<
SessionRequestPresentationTimesRequest,
SessionRequestPresentationTimesResponse,
>(
(requested_prediction_span,),
0x14a087997bf83904,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.request_presentation_times_info)
}
pub fn r#register_buffer_collection(
&self,
mut buffer_id: u32,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SessionRegisterBufferCollectionRequest>(
(buffer_id, token),
0x141b0d5768c5ecf8,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
self.client.send::<SessionDeregisterBufferCollectionRequest>(
(buffer_id,),
0x34e6c5c26b6cdb1e,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
self.client.send::<SessionSetDebugNameRequest>(
(debug_name,),
0xdb157bf88f57b91,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SessionProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SessionProxy {
type Protocol = SessionMarker;
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 SessionProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SessionEventStream {
SessionEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
SessionProxyInterface::r#enqueue(self, cmds)
}
pub fn r#present(
&self,
mut presentation_time: u64,
mut acquire_fences: Vec<fidl::Event>,
mut release_fences: Vec<fidl::Event>,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_images::PresentationInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SessionProxyInterface::r#present(self, presentation_time, acquire_fences, release_fences)
}
pub fn r#present2(
&self,
mut args: Present2Args,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SessionProxyInterface::r#present2(self, args)
}
pub fn r#request_presentation_times(
&self,
mut requested_prediction_span: i64,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SessionProxyInterface::r#request_presentation_times(self, requested_prediction_span)
}
pub fn r#register_buffer_collection(
&self,
mut buffer_id: u32,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
SessionProxyInterface::r#register_buffer_collection(self, buffer_id, token)
}
pub fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
SessionProxyInterface::r#deregister_buffer_collection(self, buffer_id)
}
pub fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
SessionProxyInterface::r#set_debug_name(self, debug_name)
}
}
impl SessionProxyInterface for SessionProxy {
fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
self.client.send::<SessionEnqueueRequest>(
(cmds.as_mut(),),
0x61e1e8b2cb6b0852,
fidl::encoding::DynamicFlags::empty(),
)
}
type PresentResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_images::PresentationInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#present(
&self,
mut presentation_time: u64,
mut acquire_fences: Vec<fidl::Event>,
mut release_fences: Vec<fidl::Event>,
) -> Self::PresentResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_images::PresentationInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SessionPresentResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x36967062cdd2c37e,
>(_buf?)?;
Ok(_response.presentation_info)
}
self.client
.send_query_and_decode::<SessionPresentRequest, fidl_fuchsia_images::PresentationInfo>(
(presentation_time, acquire_fences.as_mut(), release_fences.as_mut()),
0x36967062cdd2c37e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type Present2ResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#present2(&self, mut args: Present2Args) -> Self::Present2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SessionPresent2Response,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5d307d6198d76a65,
>(_buf?)?;
Ok(_response.request_presentation_times_info)
}
self.client.send_query_and_decode::<
SessionPresent2Request,
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
>(
(&mut args,),
0x5d307d6198d76a65,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RequestPresentationTimesResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#request_presentation_times(
&self,
mut requested_prediction_span: i64,
) -> Self::RequestPresentationTimesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SessionRequestPresentationTimesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x14a087997bf83904,
>(_buf?)?;
Ok(_response.request_presentation_times_info)
}
self.client.send_query_and_decode::<
SessionRequestPresentationTimesRequest,
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
>(
(requested_prediction_span,),
0x14a087997bf83904,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#register_buffer_collection(
&self,
mut buffer_id: u32,
mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SessionRegisterBufferCollectionRequest>(
(buffer_id, token),
0x141b0d5768c5ecf8,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
self.client.send::<SessionDeregisterBufferCollectionRequest>(
(buffer_id,),
0x34e6c5c26b6cdb1e,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
self.client.send::<SessionSetDebugNameRequest>(
(debug_name,),
0xdb157bf88f57b91,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SessionEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SessionEventStream {}
impl futures::stream::FusedStream for SessionEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SessionEventStream {
type Item = Result<SessionEvent, 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(SessionEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SessionEvent {
OnFramePresented { frame_presented_info: fidl_fuchsia_scenic_scheduling::FramePresentedInfo },
}
impl SessionEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_frame_presented(
self,
) -> Option<fidl_fuchsia_scenic_scheduling::FramePresentedInfo> {
if let SessionEvent::OnFramePresented { frame_presented_info } = self {
Some((frame_presented_info))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SessionEvent, 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 {
0x26e3bdd1559be16b => {
let mut out = fidl::new_empty!(
SessionOnFramePresentedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionOnFramePresentedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((SessionEvent::OnFramePresented {
frame_presented_info: out.frame_presented_info,
}))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SessionRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SessionRequestStream {}
impl futures::stream::FusedStream for SessionRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SessionRequestStream {
type Protocol = SessionMarker;
type ControlHandle = SessionControlHandle;
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 {
SessionControlHandle { 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 SessionRequestStream {
type Item = Result<SessionRequest, 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 SessionRequestStream 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 {
0x61e1e8b2cb6b0852 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionEnqueueRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionEnqueueRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Enqueue { cmds: req.cmds, control_handle })
}
0x36967062cdd2c37e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SessionPresentRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionPresentRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Present {
presentation_time: req.presentation_time,
acquire_fences: req.acquire_fences,
release_fences: req.release_fences,
responder: SessionPresentResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5d307d6198d76a65 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SessionPresent2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionPresent2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Present2 {
args: req.args,
responder: SessionPresent2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x14a087997bf83904 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SessionRequestPresentationTimesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionRequestPresentationTimesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::RequestPresentationTimes {
requested_prediction_span: req.requested_prediction_span,
responder: SessionRequestPresentationTimesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x141b0d5768c5ecf8 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionRegisterBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionRegisterBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::RegisterBufferCollection {
buffer_id: req.buffer_id,
token: req.token,
control_handle,
})
}
0x34e6c5c26b6cdb1e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionDeregisterBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionDeregisterBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::DeregisterBufferCollection {
buffer_id: req.buffer_id,
control_handle,
})
}
0xdb157bf88f57b91 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionSetDebugNameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionSetDebugNameRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::SetDebugName {
debug_name: req.debug_name,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SessionRequest {
Enqueue {
cmds: Vec<Command>,
control_handle: SessionControlHandle,
},
Present {
presentation_time: u64,
acquire_fences: Vec<fidl::Event>,
release_fences: Vec<fidl::Event>,
responder: SessionPresentResponder,
},
Present2 {
args: Present2Args,
responder: SessionPresent2Responder,
},
RequestPresentationTimes {
requested_prediction_span: i64,
responder: SessionRequestPresentationTimesResponder,
},
RegisterBufferCollection {
buffer_id: u32,
token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
control_handle: SessionControlHandle,
},
DeregisterBufferCollection {
buffer_id: u32,
control_handle: SessionControlHandle,
},
SetDebugName {
debug_name: String,
control_handle: SessionControlHandle,
},
}
impl SessionRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_enqueue(self) -> Option<(Vec<Command>, SessionControlHandle)> {
if let SessionRequest::Enqueue { cmds, control_handle } = self {
Some((cmds, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_present(
self,
) -> Option<(u64, Vec<fidl::Event>, Vec<fidl::Event>, SessionPresentResponder)> {
if let SessionRequest::Present {
presentation_time,
acquire_fences,
release_fences,
responder,
} = self
{
Some((presentation_time, acquire_fences, release_fences, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_present2(self) -> Option<(Present2Args, SessionPresent2Responder)> {
if let SessionRequest::Present2 { args, responder } = self {
Some((args, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_request_presentation_times(
self,
) -> Option<(i64, SessionRequestPresentationTimesResponder)> {
if let SessionRequest::RequestPresentationTimes { requested_prediction_span, responder } =
self
{
Some((requested_prediction_span, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_register_buffer_collection(
self,
) -> Option<(
u32,
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
SessionControlHandle,
)> {
if let SessionRequest::RegisterBufferCollection { buffer_id, token, control_handle } = self
{
Some((buffer_id, token, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_deregister_buffer_collection(self) -> Option<(u32, SessionControlHandle)> {
if let SessionRequest::DeregisterBufferCollection { buffer_id, control_handle } = self {
Some((buffer_id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_debug_name(self) -> Option<(String, SessionControlHandle)> {
if let SessionRequest::SetDebugName { debug_name, control_handle } = self {
Some((debug_name, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SessionRequest::Enqueue { .. } => "enqueue",
SessionRequest::Present { .. } => "present",
SessionRequest::Present2 { .. } => "present2",
SessionRequest::RequestPresentationTimes { .. } => "request_presentation_times",
SessionRequest::RegisterBufferCollection { .. } => "register_buffer_collection",
SessionRequest::DeregisterBufferCollection { .. } => "deregister_buffer_collection",
SessionRequest::SetDebugName { .. } => "set_debug_name",
}
}
}
#[derive(Debug, Clone)]
pub struct SessionControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SessionControlHandle {
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 SessionControlHandle {
pub fn send_on_frame_presented(
&self,
mut frame_presented_info: &fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
) -> Result<(), fidl::Error> {
self.inner.send::<SessionOnFramePresentedRequest>(
(frame_presented_info,),
0,
0x26e3bdd1559be16b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SessionPresentResponder {
control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SessionPresentResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SessionPresentResponder {
type ControlHandle = SessionControlHandle;
fn control_handle(&self) -> &SessionControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SessionPresentResponder {
pub fn send(
self,
mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(presentation_info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(presentation_info);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<SessionPresentResponse>(
(presentation_info,),
self.tx_id,
0x36967062cdd2c37e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SessionPresent2Responder {
control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SessionPresent2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SessionPresent2Responder {
type ControlHandle = SessionControlHandle;
fn control_handle(&self) -> &SessionControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SessionPresent2Responder {
pub fn send(
self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(request_presentation_times_info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(request_presentation_times_info);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<SessionPresent2Response>(
(request_presentation_times_info,),
self.tx_id,
0x5d307d6198d76a65,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SessionRequestPresentationTimesResponder {
control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SessionRequestPresentationTimesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SessionRequestPresentationTimesResponder {
type ControlHandle = SessionControlHandle;
fn control_handle(&self) -> &SessionControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SessionRequestPresentationTimesResponder {
pub fn send(
self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(request_presentation_times_info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(request_presentation_times_info);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<SessionRequestPresentationTimesResponse>(
(request_presentation_times_info,),
self.tx_id,
0x14a087997bf83904,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SessionListenerMarker;
impl fidl::endpoints::ProtocolMarker for SessionListenerMarker {
type Proxy = SessionListenerProxy;
type RequestStream = SessionListenerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SessionListenerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) SessionListener";
}
pub trait SessionListenerProxyInterface: Send + Sync {
fn r#on_scenic_error(&self, error: &str) -> Result<(), fidl::Error>;
fn r#on_scenic_event(&self, events: Vec<Event>) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SessionListenerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SessionListenerSynchronousProxy {
type Proxy = SessionListenerProxy;
type Protocol = SessionListenerMarker;
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 SessionListenerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SessionListenerMarker 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<SessionListenerEvent, fidl::Error> {
SessionListenerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
self.client.send::<SessionListenerOnScenicErrorRequest>(
(error,),
0x68095b89cb6c45f7,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
self.client.send::<SessionListenerOnScenicEventRequest>(
(events.as_mut(),),
0x5f66bec36e87b3ea,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SessionListenerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SessionListenerProxy {
type Protocol = SessionListenerMarker;
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 SessionListenerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SessionListenerEventStream {
SessionListenerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
SessionListenerProxyInterface::r#on_scenic_error(self, error)
}
pub fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
SessionListenerProxyInterface::r#on_scenic_event(self, events)
}
}
impl SessionListenerProxyInterface for SessionListenerProxy {
fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
self.client.send::<SessionListenerOnScenicErrorRequest>(
(error,),
0x68095b89cb6c45f7,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
self.client.send::<SessionListenerOnScenicEventRequest>(
(events.as_mut(),),
0x5f66bec36e87b3ea,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SessionListenerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SessionListenerEventStream {}
impl futures::stream::FusedStream for SessionListenerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SessionListenerEventStream {
type Item = Result<SessionListenerEvent, 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(SessionListenerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SessionListenerEvent {}
impl SessionListenerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SessionListenerEvent, 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:
<SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SessionListenerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SessionListenerRequestStream {}
impl futures::stream::FusedStream for SessionListenerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SessionListenerRequestStream {
type Protocol = SessionListenerMarker;
type ControlHandle = SessionListenerControlHandle;
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 {
SessionListenerControlHandle { 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 SessionListenerRequestStream {
type Item = Result<SessionListenerRequest, 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 SessionListenerRequestStream 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 {
0x68095b89cb6c45f7 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionListenerOnScenicErrorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionListenerOnScenicErrorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
SessionListenerControlHandle { inner: this.inner.clone() };
Ok(SessionListenerRequest::OnScenicError {
error: req.error,
control_handle,
})
}
0x5f66bec36e87b3ea => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SessionListenerOnScenicEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionListenerOnScenicEventRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
SessionListenerControlHandle { inner: this.inner.clone() };
Ok(SessionListenerRequest::OnScenicEvent {
events: req.events,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SessionListenerRequest {
OnScenicError { error: String, control_handle: SessionListenerControlHandle },
OnScenicEvent { events: Vec<Event>, control_handle: SessionListenerControlHandle },
}
impl SessionListenerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_on_scenic_error(self) -> Option<(String, SessionListenerControlHandle)> {
if let SessionListenerRequest::OnScenicError { error, control_handle } = self {
Some((error, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_scenic_event(self) -> Option<(Vec<Event>, SessionListenerControlHandle)> {
if let SessionListenerRequest::OnScenicEvent { events, control_handle } = self {
Some((events, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SessionListenerRequest::OnScenicError { .. } => "on_scenic_error",
SessionListenerRequest::OnScenicEvent { .. } => "on_scenic_event",
}
}
}
#[derive(Debug, Clone)]
pub struct SessionListenerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SessionListenerControlHandle {
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 SessionListenerControlHandle {}
mod internal {
use super::*;
impl fidl::encoding::ResourceTypeMarker for ScenicCreateSession2Request {
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 ScenicCreateSession2Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl
fidl::encoding::Encode<
ScenicCreateSession2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ScenicCreateSession2Request
{
#[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::<ScenicCreateSession2Request>(offset);
fidl::encoding::Encode::<ScenicCreateSession2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
<fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
<fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_focuser),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ScenicCreateSession2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[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::<ScenicCreateSession2Request>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicCreateSession2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
session: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
listener: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
view_focuser: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
>,
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<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.session,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.listener,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_focuser,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ScenicCreateSessionRequest {
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 ScenicCreateSessionRequest {
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<
ScenicCreateSessionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ScenicCreateSessionRequest
{
#[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::<ScenicCreateSessionRequest>(offset);
fidl::encoding::Encode::<ScenicCreateSessionRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
<fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ScenicCreateSessionRequest,
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::<ScenicCreateSessionRequest>(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 ScenicCreateSessionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
session: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
listener: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
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<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.session,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.listener,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ScenicCreateSessionTRequest {
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 ScenicCreateSessionTRequest {
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<
ScenicCreateSessionTRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ScenicCreateSessionTRequest
{
#[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::<ScenicCreateSessionTRequest>(offset);
fidl::encoding::Encode::<
ScenicCreateSessionTRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<SessionEndpoints as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.endpoints,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<SessionEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
ScenicCreateSessionTRequest,
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::<ScenicCreateSessionTRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicCreateSessionTRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
endpoints: fidl::new_empty!(
SessionEndpoints,
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!(
SessionEndpoints,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.endpoints,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ScenicGetDisplayInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ScenicGetDisplayInfoResponse {
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<ScenicGetDisplayInfoResponse, D> for &ScenicGetDisplayInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ScenicGetDisplayInfoResponse>(offset);
fidl::encoding::Encode::<ScenicGetDisplayInfoResponse, D>::encode(
(<fidl_fuchsia_ui_gfx::DisplayInfo as fidl::encoding::ValueTypeMarker>::borrow(
&self.info,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_ui_gfx::DisplayInfo, D>,
> fidl::encoding::Encode<ScenicGetDisplayInfoResponse, 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::<ScenicGetDisplayInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ScenicGetDisplayInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(fidl_fuchsia_ui_gfx::DisplayInfo, 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_ui_gfx::DisplayInfo,
D,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ScenicGetDisplayOwnershipEventResponse {
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 ScenicGetDisplayOwnershipEventResponse {
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<
ScenicGetDisplayOwnershipEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ScenicGetDisplayOwnershipEventResponse
{
#[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::<ScenicGetDisplayOwnershipEventResponse>(offset);
fidl::encoding::Encode::<
ScenicGetDisplayOwnershipEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.ownership_event,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ScenicGetDisplayOwnershipEventResponse,
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::<ScenicGetDisplayOwnershipEventResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicGetDisplayOwnershipEventResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
ownership_event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.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);
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.ownership_event, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ScenicTakeScreenshotResponse {
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 ScenicTakeScreenshotResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl
fidl::encoding::Encode<
ScenicTakeScreenshotResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ScenicTakeScreenshotResponse
{
#[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::<ScenicTakeScreenshotResponse>(offset);
fidl::encoding::Encode::<
ScenicTakeScreenshotResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<ScreenshotData as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.img_data,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.success),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
ScenicTakeScreenshotResponse,
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::<ScenicTakeScreenshotResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ScenicTakeScreenshotResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
img_data: fidl::new_empty!(
ScreenshotData,
fidl::encoding::DefaultFuchsiaResourceDialect
),
success: fidl::new_empty!(bool, 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(48) };
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 + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
ScreenshotData,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.img_data,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.success,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ScenicUsesFlatlandResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ScenicUsesFlatlandResponse {
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<ScenicUsesFlatlandResponse, D> for &ScenicUsesFlatlandResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ScenicUsesFlatlandResponse>(offset);
fidl::encoding::Encode::<ScenicUsesFlatlandResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.flatland_enabled),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ScenicUsesFlatlandResponse, 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::<ScenicUsesFlatlandResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ScenicUsesFlatlandResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { flatland_enabled: 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.flatland_enabled, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ScreenshotData {
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 ScreenshotData {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl
fidl::encoding::Encode<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ScreenshotData
{
#[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::<ScreenshotData>(offset);
fidl::encoding::Encode::<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_images::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_images::ImageInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ScreenshotData, 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::<ScreenshotData>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ScreenshotData
{
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(
fidl_fuchsia_images::ImageInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
),
data: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
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_fuchsia_images::ImageInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionDeregisterBufferCollectionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionDeregisterBufferCollectionRequest {
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<SessionDeregisterBufferCollectionRequest, D>
for &SessionDeregisterBufferCollectionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionDeregisterBufferCollectionRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SessionDeregisterBufferCollectionRequest).write_unaligned(
(self as *const SessionDeregisterBufferCollectionRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<SessionDeregisterBufferCollectionRequest, 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::<SessionDeregisterBufferCollectionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionDeregisterBufferCollectionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { buffer_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SessionEnqueueRequest {
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 SessionEnqueueRequest {
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<SessionEnqueueRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SessionEnqueueRequest
{
#[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::<SessionEnqueueRequest>(offset);
fidl::encoding::Encode::<SessionEnqueueRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<Command> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.cmds),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<Command>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<SessionEnqueueRequest, 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::<SessionEnqueueRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionEnqueueRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
cmds: fidl::new_empty!(
fidl::encoding::UnboundedVector<Command>,
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::UnboundedVector<Command>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.cmds,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionListenerOnScenicErrorRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionListenerOnScenicErrorRequest {
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<SessionListenerOnScenicErrorRequest, D>
for &SessionListenerOnScenicErrorRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionListenerOnScenicErrorRequest>(offset);
fidl::encoding::Encode::<SessionListenerOnScenicErrorRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.error,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<SessionListenerOnScenicErrorRequest, 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::<SessionListenerOnScenicErrorRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionListenerOnScenicErrorRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { error: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.error,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SessionListenerOnScenicEventRequest {
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 SessionListenerOnScenicEventRequest {
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<
SessionListenerOnScenicEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SessionListenerOnScenicEventRequest
{
#[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::<SessionListenerOnScenicEventRequest>(offset);
fidl::encoding::Encode::<SessionListenerOnScenicEventRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<Event>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SessionListenerOnScenicEventRequest,
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::<SessionListenerOnScenicEventRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionListenerOnScenicEventRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
events: fidl::new_empty!(
fidl::encoding::UnboundedVector<Event>,
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::UnboundedVector<Event>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.events,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionOnFramePresentedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionOnFramePresentedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SessionOnFramePresentedRequest, D>
for &SessionOnFramePresentedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionOnFramePresentedRequest>(offset);
fidl::encoding::Encode::<SessionOnFramePresentedRequest, D>::encode(
(
<fidl_fuchsia_scenic_scheduling::FramePresentedInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_presented_info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling::FramePresentedInfo, D>,
> fidl::encoding::Encode<SessionOnFramePresentedRequest, 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::<SessionOnFramePresentedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionOnFramePresentedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
frame_presented_info: fidl::new_empty!(
fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
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_scenic_scheduling::FramePresentedInfo,
D,
&mut self.frame_presented_info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SessionPresent2Request {
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 SessionPresent2Request {
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<
SessionPresent2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SessionPresent2Request
{
#[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::<SessionPresent2Request>(offset);
fidl::encoding::Encode::<
SessionPresent2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<Present2Args as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.args,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Present2Args, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
SessionPresent2Request,
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::<SessionPresent2Request>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionPresent2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
args: fidl::new_empty!(Present2Args, 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!(
Present2Args,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.args,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionPresent2Response {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionPresent2Response {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SessionPresent2Response, D> for &SessionPresent2Response
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionPresent2Response>(offset);
fidl::encoding::Encode::<SessionPresent2Response, D>::encode(
(
<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes as fidl::encoding::ValueTypeMarker>::borrow(&self.request_presentation_times_info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, D>,
> fidl::encoding::Encode<SessionPresent2Response, 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::<SessionPresent2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionPresent2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self {
request_presentation_times_info: fidl::new_empty!(
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
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_scenic_scheduling::FuturePresentationTimes,
D,
&mut self.request_presentation_times_info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SessionPresentRequest {
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 SessionPresentRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<SessionPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SessionPresentRequest
{
#[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::<SessionPresentRequest>(offset);
fidl::encoding::Encode::<
SessionPresentRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.presentation_time),
<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.acquire_fences,
),
<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.release_fences,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<SessionPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[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::<SessionPresentRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SessionPresentRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
presentation_time: fidl::new_empty!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect
),
acquire_fences: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
release_fences: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.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);
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.presentation_time,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.acquire_fences,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.release_fences,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionPresentResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionPresentResponse {
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<SessionPresentResponse, D> for &SessionPresentResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionPresentResponse>(offset);
fidl::encoding::Encode::<SessionPresentResponse, D>::encode(
(
<fidl_fuchsia_images::PresentationInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.presentation_info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_images::PresentationInfo, D>,
> fidl::encoding::Encode<SessionPresentResponse, 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::<SessionPresentResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionPresentResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { presentation_info: fidl::new_empty!(fidl_fuchsia_images::PresentationInfo, 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_images::PresentationInfo,
D,
&mut self.presentation_info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SessionRegisterBufferCollectionRequest {
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 SessionRegisterBufferCollectionRequest {
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<
SessionRegisterBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SessionRegisterBufferCollectionRequest
{
#[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::<SessionRegisterBufferCollectionRequest>(offset);
fidl::encoding::Encode::<
SessionRegisterBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_id),
<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<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SessionRegisterBufferCollectionRequest,
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::<SessionRegisterBufferCollectionRequest>(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 SessionRegisterBufferCollectionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
buffer_id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
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!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.buffer_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionRequestPresentationTimesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesRequest {
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
}
#[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<SessionRequestPresentationTimesRequest, D>
for &SessionRequestPresentationTimesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionRequestPresentationTimesRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SessionRequestPresentationTimesRequest).write_unaligned(
(self as *const SessionRequestPresentationTimesRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
fidl::encoding::Encode<SessionRequestPresentationTimesRequest, 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::<SessionRequestPresentationTimesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionRequestPresentationTimesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { requested_prediction_span: fidl::new_empty!(i64, 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::ValueTypeMarker for SessionRequestPresentationTimesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SessionRequestPresentationTimesResponse, D>
for &SessionRequestPresentationTimesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionRequestPresentationTimesResponse>(offset);
fidl::encoding::Encode::<SessionRequestPresentationTimesResponse, D>::encode(
(
<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes as fidl::encoding::ValueTypeMarker>::borrow(&self.request_presentation_times_info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, D>,
> fidl::encoding::Encode<SessionRequestPresentationTimesResponse, 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::<SessionRequestPresentationTimesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionRequestPresentationTimesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
request_presentation_times_info: fidl::new_empty!(
fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
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_scenic_scheduling::FuturePresentationTimes,
D,
&mut self.request_presentation_times_info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SessionSetDebugNameRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SessionSetDebugNameRequest {
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<SessionSetDebugNameRequest, D> for &SessionSetDebugNameRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionSetDebugNameRequest>(offset);
fidl::encoding::Encode::<SessionSetDebugNameRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.debug_name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<SessionSetDebugNameRequest, 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::<SessionSetDebugNameRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SessionSetDebugNameRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { debug_name: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.debug_name,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl Present2Args {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.requested_prediction_span {
return 4;
}
if let Some(_) = self.release_fences {
return 3;
}
if let Some(_) = self.acquire_fences {
return 2;
}
if let Some(_) = self.requested_presentation_time {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for Present2Args {
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 Present2Args {
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<Present2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Present2Args
{
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::<Present2Args>(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::<
i64,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.requested_presentation_time
.as_ref()
.map(<i64 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::<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.acquire_fences.as_mut().map(
<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.release_fences.as_mut().map(
<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_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.requested_prediction_span
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Present2Args {
#[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 =
<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.requested_presentation_time.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 < 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 = <fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.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.acquire_fences.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.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;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.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_fences.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.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;
_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.requested_prediction_span.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;
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 SessionEndpoints {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.mouse_source {
return 6;
}
if let Some(_) = self.touch_source {
return 5;
}
if let Some(_) = self.view_ref_focused {
return 4;
}
if let Some(_) = self.view_focuser {
return 3;
}
if let Some(_) = self.session_listener {
return 2;
}
if let Some(_) = self.session {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for SessionEndpoints {
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 SessionEndpoints {
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<SessionEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SessionEndpoints
{
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::<SessionEndpoints>(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::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.session.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_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::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.session_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.view_focuser.as_mut().map(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_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::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.view_ref_focused.as_mut().map(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_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::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.touch_source.as_mut().map(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.mouse_source.as_mut().map(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
> 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 SessionEndpoints
{
#[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 = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<SessionMarker>,
> 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.session.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
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 = <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<SessionListenerMarker>,
> 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.session_listener.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
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 = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
> 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.view_focuser.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
>,
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 = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
> 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.view_ref_focused.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
>,
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::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
> 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.touch_source.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
>,
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 < 6 {
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::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
> 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.mouse_source.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
>,
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 fidl::encoding::ResourceTypeMarker for Command {
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 Command {
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<Command, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Command
{
#[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::<Command>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Command::Gfx(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_gfx::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl_fuchsia_ui_gfx::Command as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Command::Views(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_views::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl_fuchsia_ui_views::Command as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::Input(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_input::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl_fuchsia_ui_input::Command as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Command {
#[inline(always)]
fn new_empty() -> Self {
Self::Gfx(fidl::new_empty!(
fidl_fuchsia_ui_gfx::Command,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
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);
#[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 => <fidl_fuchsia_ui_gfx::Command as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
3 => <fidl_fuchsia_ui_views::Command as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
4 => <fidl_fuchsia_ui_input::Command 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 Command::Gfx(_) = self {
} else {
*self = Command::Gfx(fidl::new_empty!(
fidl_fuchsia_ui_gfx::Command,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Gfx(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_ui_gfx::Command,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Command::Views(_) = self {
} else {
*self = Command::Views(fidl::new_empty!(
fidl_fuchsia_ui_views::Command,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Views(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_ui_views::Command,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Command::Input(_) = self {
} else {
*self = Command::Input(fidl::new_empty!(
fidl_fuchsia_ui_input::Command,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Input(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_ui_input::Command,
fidl::encoding::DefaultFuchsiaResourceDialect,
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(())
}
}
impl fidl::encoding::ResourceTypeMarker for Event {
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 Event {
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<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Event
{
#[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::<Event>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Event::Gfx(ref val) => fidl::encoding::encode_in_envelope::<
fidl_fuchsia_ui_gfx::Event,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl_fuchsia_ui_gfx::Event as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Event::Input(ref val) => fidl::encoding::encode_in_envelope::<
fidl_fuchsia_ui_input::InputEvent,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl_fuchsia_ui_input::InputEvent as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
Event::Unhandled(ref mut val) => fidl::encoding::encode_in_envelope::<
Command,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Command as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
#[inline(always)]
fn new_empty() -> Self {
Self::Gfx(fidl::new_empty!(
fidl_fuchsia_ui_gfx::Event,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
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);
#[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 => <fidl_fuchsia_ui_gfx::Event as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
2 => {
<fidl_fuchsia_ui_input::InputEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
)
}
3 => <Command 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 Event::Gfx(_) = self {
} else {
*self = Event::Gfx(fidl::new_empty!(
fidl_fuchsia_ui_gfx::Event,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Event::Gfx(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_ui_gfx::Event,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Event::Input(_) = self {
} else {
*self = Event::Input(fidl::new_empty!(
fidl_fuchsia_ui_input::InputEvent,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Event::Input(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_ui_input::InputEvent,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Event::Unhandled(_) = self {
} else {
*self = Event::Unhandled(fidl::new_empty!(
Command,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Event::Unhandled(ref mut val) = self {
fidl::decode!(
Command,
fidl::encoding::DefaultFuchsiaResourceDialect,
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(())
}
}
}