#![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;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum PresentRootViewError {
InternalError,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! PresentRootViewErrorUnknown {
() => {
_
};
}
impl PresentRootViewError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InternalError),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InternalError,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InternalError => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Debug, PartialEq)]
pub struct ManagerPresentRootViewLegacyRequest {
pub view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
pub view_ref: fidl_fuchsia_ui_views::ViewRef,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerPresentRootViewLegacyRequest
{
}
#[derive(Debug, PartialEq)]
pub struct ManagerPresentRootViewRequest {
pub viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerPresentRootViewRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerSetRootViewRequest {
pub view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ManagerSetRootViewRequest {}
#[derive(Debug, PartialEq)]
pub struct ManagerSetRootViewResponse {
pub view_ref: fidl_fuchsia_ui_views::ViewRef,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerSetRootViewResponse
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ManagerMarker;
impl fidl::endpoints::ProtocolMarker for ManagerMarker {
type Proxy = ManagerProxy;
type RequestStream = ManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.session.scene.Manager";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ManagerMarker {}
pub type ManagerSetRootViewResult = Result<fidl_fuchsia_ui_views::ViewRef, PresentRootViewError>;
pub type ManagerPresentRootViewLegacyResult = Result<(), PresentRootViewError>;
pub type ManagerPresentRootViewResult = Result<(), PresentRootViewError>;
pub trait ManagerProxyInterface: Send + Sync {
type SetRootViewResponseFut: std::future::Future<Output = Result<ManagerSetRootViewResult, fidl::Error>>
+ Send;
fn r#set_root_view(
&self,
view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
) -> Self::SetRootViewResponseFut;
type PresentRootViewLegacyResponseFut: std::future::Future<Output = Result<ManagerPresentRootViewLegacyResult, fidl::Error>>
+ Send;
fn r#present_root_view_legacy(
&self,
view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
view_ref: fidl_fuchsia_ui_views::ViewRef,
) -> Self::PresentRootViewLegacyResponseFut;
type PresentRootViewResponseFut: std::future::Future<Output = Result<ManagerPresentRootViewResult, fidl::Error>>
+ Send;
fn r#present_root_view(
&self,
viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
) -> Self::PresentRootViewResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ManagerSynchronousProxy {
type Proxy = ManagerProxy;
type Protocol = ManagerMarker;
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 ManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ManagerMarker 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<ManagerEvent, fidl::Error> {
ManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_root_view(
&self,
mut view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerSetRootViewResult, fidl::Error> {
let _response =
self.client.send_query::<ManagerSetRootViewRequest, fidl::encoding::ResultType<
ManagerSetRootViewResponse,
PresentRootViewError,
>>(
(view_provider,),
0x3095976368270dc4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.view_ref))
}
pub fn r#present_root_view_legacy(
&self,
mut view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
mut view_ref: fidl_fuchsia_ui_views::ViewRef,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerPresentRootViewLegacyResult, fidl::Error> {
let _response = self.client.send_query::<
ManagerPresentRootViewLegacyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, PresentRootViewError>,
>(
(&mut view_holder_token, &mut view_ref,),
0x17729b456a2eff7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#present_root_view(
&self,
mut viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerPresentRootViewResult, fidl::Error> {
let _response =
self.client.send_query::<ManagerPresentRootViewRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
PresentRootViewError,
>>(
(&mut viewport_creation_token,),
0x51e070bb675a18df,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ManagerProxy {
type Protocol = ManagerMarker;
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 ManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ManagerEventStream {
ManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_root_view(
&self,
mut view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
) -> fidl::client::QueryResponseFut<
ManagerSetRootViewResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#set_root_view(self, view_provider)
}
pub fn r#present_root_view_legacy(
&self,
mut view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
mut view_ref: fidl_fuchsia_ui_views::ViewRef,
) -> fidl::client::QueryResponseFut<
ManagerPresentRootViewLegacyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#present_root_view_legacy(self, view_holder_token, view_ref)
}
pub fn r#present_root_view(
&self,
mut viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
) -> fidl::client::QueryResponseFut<
ManagerPresentRootViewResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#present_root_view(self, viewport_creation_token)
}
}
impl ManagerProxyInterface for ManagerProxy {
type SetRootViewResponseFut = fidl::client::QueryResponseFut<
ManagerSetRootViewResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_root_view(
&self,
mut view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
) -> Self::SetRootViewResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerSetRootViewResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ManagerSetRootViewResponse, PresentRootViewError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3095976368270dc4,
>(_buf?)?;
Ok(_response.map(|x| x.view_ref))
}
self.client.send_query_and_decode::<ManagerSetRootViewRequest, ManagerSetRootViewResult>(
(view_provider,),
0x3095976368270dc4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PresentRootViewLegacyResponseFut = fidl::client::QueryResponseFut<
ManagerPresentRootViewLegacyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#present_root_view_legacy(
&self,
mut view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
mut view_ref: fidl_fuchsia_ui_views::ViewRef,
) -> Self::PresentRootViewLegacyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerPresentRootViewLegacyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, PresentRootViewError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x17729b456a2eff7,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ManagerPresentRootViewLegacyRequest,
ManagerPresentRootViewLegacyResult,
>(
(&mut view_holder_token, &mut view_ref,),
0x17729b456a2eff7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PresentRootViewResponseFut = fidl::client::QueryResponseFut<
ManagerPresentRootViewResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#present_root_view(
&self,
mut viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
) -> Self::PresentRootViewResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerPresentRootViewResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, PresentRootViewError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x51e070bb675a18df,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ManagerPresentRootViewRequest, ManagerPresentRootViewResult>(
(&mut viewport_creation_token,),
0x51e070bb675a18df,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ManagerEventStream {}
impl futures::stream::FusedStream for ManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ManagerEventStream {
type Item = Result<ManagerEvent, 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(ManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ManagerEvent {}
impl ManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ManagerEvent, 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: <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ManagerRequestStream {}
impl futures::stream::FusedStream for ManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ManagerRequestStream {
type Protocol = ManagerMarker;
type ControlHandle = ManagerControlHandle;
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 {
ManagerControlHandle { 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 ManagerRequestStream {
type Item = Result<ManagerRequest, 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 ManagerRequestStream 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 {
0x3095976368270dc4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerSetRootViewRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerSetRootViewRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::SetRootView {
view_provider: req.view_provider,
responder: ManagerSetRootViewResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x17729b456a2eff7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerPresentRootViewLegacyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerPresentRootViewLegacyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::PresentRootViewLegacy {
view_holder_token: req.view_holder_token,
view_ref: req.view_ref,
responder: ManagerPresentRootViewLegacyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x51e070bb675a18df => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerPresentRootViewRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerPresentRootViewRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::PresentRootView {
viewport_creation_token: req.viewport_creation_token,
responder: ManagerPresentRootViewResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ManagerRequest {
SetRootView {
view_provider: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
responder: ManagerSetRootViewResponder,
},
PresentRootViewLegacy {
view_holder_token: fidl_fuchsia_ui_views::ViewHolderToken,
view_ref: fidl_fuchsia_ui_views::ViewRef,
responder: ManagerPresentRootViewLegacyResponder,
},
PresentRootView {
viewport_creation_token: fidl_fuchsia_ui_views::ViewportCreationToken,
responder: ManagerPresentRootViewResponder,
},
}
impl ManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_root_view(
self,
) -> Option<(
fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
ManagerSetRootViewResponder,
)> {
if let ManagerRequest::SetRootView { view_provider, responder } = self {
Some((view_provider, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_present_root_view_legacy(
self,
) -> Option<(
fidl_fuchsia_ui_views::ViewHolderToken,
fidl_fuchsia_ui_views::ViewRef,
ManagerPresentRootViewLegacyResponder,
)> {
if let ManagerRequest::PresentRootViewLegacy { view_holder_token, view_ref, responder } =
self
{
Some((view_holder_token, view_ref, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_present_root_view(
self,
) -> Option<(fidl_fuchsia_ui_views::ViewportCreationToken, ManagerPresentRootViewResponder)>
{
if let ManagerRequest::PresentRootView { viewport_creation_token, responder } = self {
Some((viewport_creation_token, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ManagerRequest::SetRootView { .. } => "set_root_view",
ManagerRequest::PresentRootViewLegacy { .. } => "present_root_view_legacy",
ManagerRequest::PresentRootView { .. } => "present_root_view",
}
}
}
#[derive(Debug, Clone)]
pub struct ManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ManagerControlHandle {
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 ManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerSetRootViewResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerSetRootViewResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerSetRootViewResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerSetRootViewResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_ui_views::ViewRef, PresentRootViewError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl_fuchsia_ui_views::ViewRef, PresentRootViewError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_ui_views::ViewRef, PresentRootViewError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ManagerSetRootViewResponse,
PresentRootViewError,
>>(
result.as_mut().map_err(|e| *e).map(|view_ref| (view_ref,)),
self.tx_id,
0x3095976368270dc4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerPresentRootViewLegacyResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerPresentRootViewLegacyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerPresentRootViewLegacyResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerPresentRootViewLegacyResponder {
pub fn send(self, mut result: Result<(), PresentRootViewError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), PresentRootViewError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), PresentRootViewError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
PresentRootViewError,
>>(
result,
self.tx_id,
0x17729b456a2eff7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerPresentRootViewResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerPresentRootViewResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerPresentRootViewResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerPresentRootViewResponder {
pub fn send(self, mut result: Result<(), PresentRootViewError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), PresentRootViewError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), PresentRootViewError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
PresentRootViewError,
>>(
result,
self.tx_id,
0x51e070bb675a18df,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for PresentRootViewError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for PresentRootViewError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for PresentRootViewError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PresentRootViewError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerPresentRootViewLegacyRequest {
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 ManagerPresentRootViewLegacyRequest {
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<
ManagerPresentRootViewLegacyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerPresentRootViewLegacyRequest
{
#[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::<ManagerPresentRootViewLegacyRequest>(offset);
fidl::encoding::Encode::<ManagerPresentRootViewLegacyRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewHolderToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_holder_token),
<fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerPresentRootViewLegacyRequest,
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::<ManagerPresentRootViewLegacyRequest>(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 ManagerPresentRootViewLegacyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_holder_token: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect
),
view_ref: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewRef,
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_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_holder_token,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_ref,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerPresentRootViewRequest {
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 ManagerPresentRootViewRequest {
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<
ManagerPresentRootViewRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerPresentRootViewRequest
{
#[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::<ManagerPresentRootViewRequest>(offset);
fidl::encoding::Encode::<ManagerPresentRootViewRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewportCreationToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.viewport_creation_token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewportCreationToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerPresentRootViewRequest,
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::<ManagerPresentRootViewRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerPresentRootViewRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
viewport_creation_token: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewportCreationToken,
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_ui_views::ViewportCreationToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.viewport_creation_token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerSetRootViewRequest {
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 ManagerSetRootViewRequest {
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<
ManagerSetRootViewRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerSetRootViewRequest
{
#[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::<ManagerSetRootViewRequest>(offset);
fidl::encoding::Encode::<
ManagerSetRootViewRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.view_provider
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerSetRootViewRequest,
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::<ManagerSetRootViewRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerSetRootViewRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_provider: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ui_app::ViewProviderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_provider,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerSetRootViewResponse {
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 ManagerSetRootViewResponse {
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<
ManagerSetRootViewResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerSetRootViewResponse
{
#[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::<ManagerSetRootViewResponse>(offset);
fidl::encoding::Encode::<ManagerSetRootViewResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerSetRootViewResponse,
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::<ManagerSetRootViewResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerSetRootViewResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_ref: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewRef,
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_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_ref,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
}