#![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 MAX_URLS: u64 = 20;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum DashNamespaceLayout {
NestAllInstanceDirs = 1,
InstanceNamespaceIsRoot = 2,
}
impl DashNamespaceLayout {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NestAllInstanceDirs),
2 => Some(Self::InstanceNamespaceIsRoot),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum FuchsiaPkgResolver {
Base,
Full,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! FuchsiaPkgResolverUnknown {
() => {
_
};
}
impl FuchsiaPkgResolver {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Base),
2 => Some(Self::Full),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Base,
2 => Self::Full,
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::Base => 1,
Self::Full => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum LauncherError {
Internal = 1,
BadMoniker = 2,
InstanceNotFound = 3,
RealmQuery = 4,
ProcessLauncher = 5,
DashBinary = 6,
Pty = 7,
InstanceNotResolved = 8,
PackageResolver = 9,
ToolsCannotResolve = 10,
BadUrl = 11,
ToolsBinaryRead = 12,
NonUniqueBinaryName = 13,
ProcessResolver = 14,
VmexResource = 15,
ResolveTargetPackage = 16,
}
impl LauncherError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::BadMoniker),
3 => Some(Self::InstanceNotFound),
4 => Some(Self::RealmQuery),
5 => Some(Self::ProcessLauncher),
6 => Some(Self::DashBinary),
7 => Some(Self::Pty),
8 => Some(Self::InstanceNotResolved),
9 => Some(Self::PackageResolver),
10 => Some(Self::ToolsCannotResolve),
11 => Some(Self::BadUrl),
12 => Some(Self::ToolsBinaryRead),
13 => Some(Self::NonUniqueBinaryName),
14 => Some(Self::ProcessResolver),
15 => Some(Self::VmexResource),
16 => Some(Self::ResolveTargetPackage),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherExploreComponentOverPtyRequest {
pub moniker: String,
pub pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
pub tool_urls: Vec<String>,
pub command: Option<String>,
pub ns_layout: DashNamespaceLayout,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExploreComponentOverPtyRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherExploreComponentOverSocketRequest {
pub moniker: String,
pub socket: fidl::Socket,
pub tool_urls: Vec<String>,
pub command: Option<String>,
pub ns_layout: DashNamespaceLayout,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExploreComponentOverSocketRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherExplorePackageOverSocket2Request {
pub fuchsia_pkg_resolver: FuchsiaPkgResolver,
pub url: String,
pub subpackages: Vec<String>,
pub socket: fidl::Socket,
pub tool_urls: Vec<String>,
pub command: Option<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExplorePackageOverSocket2Request
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherExplorePackageOverSocketRequest {
pub url: String,
pub subpackages: Vec<String>,
pub socket: fidl::Socket,
pub tool_urls: Vec<String>,
pub command: Option<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExplorePackageOverSocketRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LauncherOnTerminatedRequest {
pub return_code: i32,
}
impl fidl::Persistable for LauncherOnTerminatedRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LauncherMarker;
impl fidl::endpoints::ProtocolMarker for LauncherMarker {
type Proxy = LauncherProxy;
type RequestStream = LauncherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LauncherSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.dash.Launcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LauncherMarker {}
pub type LauncherExploreComponentOverPtyResult = Result<(), LauncherError>;
pub type LauncherExploreComponentOverSocketResult = Result<(), LauncherError>;
pub type LauncherExplorePackageOverSocketResult = Result<(), LauncherError>;
pub type LauncherExplorePackageOverSocket2Result = Result<(), LauncherError>;
pub trait LauncherProxyInterface: Send + Sync {
type ExploreComponentOverPtyResponseFut: std::future::Future<Output = Result<LauncherExploreComponentOverPtyResult, fidl::Error>>
+ Send;
fn r#explore_component_over_pty(
&self,
moniker: &str,
pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
tool_urls: &[String],
command: Option<&str>,
ns_layout: DashNamespaceLayout,
) -> Self::ExploreComponentOverPtyResponseFut;
type ExploreComponentOverSocketResponseFut: std::future::Future<Output = Result<LauncherExploreComponentOverSocketResult, fidl::Error>>
+ Send;
fn r#explore_component_over_socket(
&self,
moniker: &str,
socket: fidl::Socket,
tool_urls: &[String],
command: Option<&str>,
ns_layout: DashNamespaceLayout,
) -> Self::ExploreComponentOverSocketResponseFut;
type ExplorePackageOverSocketResponseFut: std::future::Future<Output = Result<LauncherExplorePackageOverSocketResult, fidl::Error>>
+ Send;
fn r#explore_package_over_socket(
&self,
url: &str,
subpackages: &[String],
socket: fidl::Socket,
tool_urls: &[String],
command: Option<&str>,
) -> Self::ExplorePackageOverSocketResponseFut;
type ExplorePackageOverSocket2ResponseFut: std::future::Future<Output = Result<LauncherExplorePackageOverSocket2Result, fidl::Error>>
+ Send;
fn r#explore_package_over_socket2(
&self,
fuchsia_pkg_resolver: FuchsiaPkgResolver,
url: &str,
subpackages: &[String],
socket: fidl::Socket,
tool_urls: &[String],
command: Option<&str>,
) -> Self::ExplorePackageOverSocket2ResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LauncherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LauncherSynchronousProxy {
type Proxy = LauncherProxy;
type Protocol = LauncherMarker;
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 LauncherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LauncherMarker 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<LauncherEvent, fidl::Error> {
LauncherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#explore_component_over_pty(
&self,
mut moniker: &str,
mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
___deadline: zx::MonotonicInstant,
) -> Result<LauncherExploreComponentOverPtyResult, fidl::Error> {
let _response = self.client.send_query::<
LauncherExploreComponentOverPtyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
>(
(moniker, pty, tool_urls, command, ns_layout,),
0x22efaa9c12b8779f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#explore_component_over_socket(
&self,
mut moniker: &str,
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
___deadline: zx::MonotonicInstant,
) -> Result<LauncherExploreComponentOverSocketResult, fidl::Error> {
let _response = self.client.send_query::<
LauncherExploreComponentOverSocketRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
>(
(moniker, socket, tool_urls, command, ns_layout,),
0x233557fb2b70eb68,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#explore_package_over_socket(
&self,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
___deadline: zx::MonotonicInstant,
) -> Result<LauncherExplorePackageOverSocketResult, fidl::Error> {
let _response = self.client.send_query::<
LauncherExplorePackageOverSocketRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
>(
(url, subpackages, socket, tool_urls, command,),
0x8e536067655b5a2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#explore_package_over_socket2(
&self,
mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
___deadline: zx::MonotonicInstant,
) -> Result<LauncherExplorePackageOverSocket2Result, fidl::Error> {
let _response = self.client.send_query::<
LauncherExplorePackageOverSocket2Request,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
>(
(fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command,),
0x3884e07c1fa8d20b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct LauncherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LauncherProxy {
type Protocol = LauncherMarker;
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 LauncherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LauncherEventStream {
LauncherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#explore_component_over_pty(
&self,
mut moniker: &str,
mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
) -> fidl::client::QueryResponseFut<
LauncherExploreComponentOverPtyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#explore_component_over_pty(
self, moniker, pty, tool_urls, command, ns_layout,
)
}
pub fn r#explore_component_over_socket(
&self,
mut moniker: &str,
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
) -> fidl::client::QueryResponseFut<
LauncherExploreComponentOverSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#explore_component_over_socket(
self, moniker, socket, tool_urls, command, ns_layout,
)
}
pub fn r#explore_package_over_socket(
&self,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
) -> fidl::client::QueryResponseFut<
LauncherExplorePackageOverSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#explore_package_over_socket(
self,
url,
subpackages,
socket,
tool_urls,
command,
)
}
pub fn r#explore_package_over_socket2(
&self,
mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
) -> fidl::client::QueryResponseFut<
LauncherExplorePackageOverSocket2Result,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#explore_package_over_socket2(
self,
fuchsia_pkg_resolver,
url,
subpackages,
socket,
tool_urls,
command,
)
}
}
impl LauncherProxyInterface for LauncherProxy {
type ExploreComponentOverPtyResponseFut = fidl::client::QueryResponseFut<
LauncherExploreComponentOverPtyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#explore_component_over_pty(
&self,
mut moniker: &str,
mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
) -> Self::ExploreComponentOverPtyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LauncherExploreComponentOverPtyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x22efaa9c12b8779f,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LauncherExploreComponentOverPtyRequest,
LauncherExploreComponentOverPtyResult,
>(
(moniker, pty, tool_urls, command, ns_layout,),
0x22efaa9c12b8779f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ExploreComponentOverSocketResponseFut = fidl::client::QueryResponseFut<
LauncherExploreComponentOverSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#explore_component_over_socket(
&self,
mut moniker: &str,
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
mut ns_layout: DashNamespaceLayout,
) -> Self::ExploreComponentOverSocketResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LauncherExploreComponentOverSocketResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x233557fb2b70eb68,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LauncherExploreComponentOverSocketRequest,
LauncherExploreComponentOverSocketResult,
>(
(moniker, socket, tool_urls, command, ns_layout,),
0x233557fb2b70eb68,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ExplorePackageOverSocketResponseFut = fidl::client::QueryResponseFut<
LauncherExplorePackageOverSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#explore_package_over_socket(
&self,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
) -> Self::ExplorePackageOverSocketResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LauncherExplorePackageOverSocketResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x8e536067655b5a2,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LauncherExplorePackageOverSocketRequest,
LauncherExplorePackageOverSocketResult,
>(
(url, subpackages, socket, tool_urls, command,),
0x8e536067655b5a2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ExplorePackageOverSocket2ResponseFut = fidl::client::QueryResponseFut<
LauncherExplorePackageOverSocket2Result,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#explore_package_over_socket2(
&self,
mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
mut url: &str,
mut subpackages: &[String],
mut socket: fidl::Socket,
mut tool_urls: &[String],
mut command: Option<&str>,
) -> Self::ExplorePackageOverSocket2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LauncherExplorePackageOverSocket2Result, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3884e07c1fa8d20b,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LauncherExplorePackageOverSocket2Request,
LauncherExplorePackageOverSocket2Result,
>(
(fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command,),
0x3884e07c1fa8d20b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct LauncherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LauncherEventStream {}
impl futures::stream::FusedStream for LauncherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LauncherEventStream {
type Item = Result<LauncherEvent, 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(LauncherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LauncherEvent {
OnTerminated { return_code: i32 },
}
impl LauncherEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_terminated(self) -> Option<i32> {
if let LauncherEvent::OnTerminated { return_code } = self {
Some((return_code))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LauncherEvent, 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 {
0x6e5422dc5fe6b3f2 => {
let mut out = fidl::new_empty!(
LauncherOnTerminatedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherOnTerminatedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((LauncherEvent::OnTerminated { return_code: out.return_code }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LauncherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LauncherRequestStream {}
impl futures::stream::FusedStream for LauncherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LauncherRequestStream {
type Protocol = LauncherMarker;
type ControlHandle = LauncherControlHandle;
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 {
LauncherControlHandle { 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 LauncherRequestStream {
type Item = Result<LauncherRequest, 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 LauncherRequestStream 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 {
0x22efaa9c12b8779f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherExploreComponentOverPtyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExploreComponentOverPtyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::ExploreComponentOverPty {
moniker: req.moniker,
pty: req.pty,
tool_urls: req.tool_urls,
command: req.command,
ns_layout: req.ns_layout,
responder: LauncherExploreComponentOverPtyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x233557fb2b70eb68 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherExploreComponentOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExploreComponentOverSocketRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::ExploreComponentOverSocket {
moniker: req.moniker,
socket: req.socket,
tool_urls: req.tool_urls,
command: req.command,
ns_layout: req.ns_layout,
responder: LauncherExploreComponentOverSocketResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x8e536067655b5a2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherExplorePackageOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExplorePackageOverSocketRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::ExplorePackageOverSocket {
url: req.url,
subpackages: req.subpackages,
socket: req.socket,
tool_urls: req.tool_urls,
command: req.command,
responder: LauncherExplorePackageOverSocketResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3884e07c1fa8d20b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherExplorePackageOverSocket2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExplorePackageOverSocket2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::ExplorePackageOverSocket2 {
fuchsia_pkg_resolver: req.fuchsia_pkg_resolver,
url: req.url,
subpackages: req.subpackages,
socket: req.socket,
tool_urls: req.tool_urls,
command: req.command,
responder: LauncherExplorePackageOverSocket2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LauncherRequest {
ExploreComponentOverPty {
moniker: String,
pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
tool_urls: Vec<String>,
command: Option<String>,
ns_layout: DashNamespaceLayout,
responder: LauncherExploreComponentOverPtyResponder,
},
ExploreComponentOverSocket {
moniker: String,
socket: fidl::Socket,
tool_urls: Vec<String>,
command: Option<String>,
ns_layout: DashNamespaceLayout,
responder: LauncherExploreComponentOverSocketResponder,
},
ExplorePackageOverSocket {
url: String,
subpackages: Vec<String>,
socket: fidl::Socket,
tool_urls: Vec<String>,
command: Option<String>,
responder: LauncherExplorePackageOverSocketResponder,
},
ExplorePackageOverSocket2 {
fuchsia_pkg_resolver: FuchsiaPkgResolver,
url: String,
subpackages: Vec<String>,
socket: fidl::Socket,
tool_urls: Vec<String>,
command: Option<String>,
responder: LauncherExplorePackageOverSocket2Responder,
},
}
impl LauncherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_explore_component_over_pty(
self,
) -> Option<(
String,
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
Vec<String>,
Option<String>,
DashNamespaceLayout,
LauncherExploreComponentOverPtyResponder,
)> {
if let LauncherRequest::ExploreComponentOverPty {
moniker,
pty,
tool_urls,
command,
ns_layout,
responder,
} = self
{
Some((moniker, pty, tool_urls, command, ns_layout, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_explore_component_over_socket(
self,
) -> Option<(
String,
fidl::Socket,
Vec<String>,
Option<String>,
DashNamespaceLayout,
LauncherExploreComponentOverSocketResponder,
)> {
if let LauncherRequest::ExploreComponentOverSocket {
moniker,
socket,
tool_urls,
command,
ns_layout,
responder,
} = self
{
Some((moniker, socket, tool_urls, command, ns_layout, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_explore_package_over_socket(
self,
) -> Option<(
String,
Vec<String>,
fidl::Socket,
Vec<String>,
Option<String>,
LauncherExplorePackageOverSocketResponder,
)> {
if let LauncherRequest::ExplorePackageOverSocket {
url,
subpackages,
socket,
tool_urls,
command,
responder,
} = self
{
Some((url, subpackages, socket, tool_urls, command, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_explore_package_over_socket2(
self,
) -> Option<(
FuchsiaPkgResolver,
String,
Vec<String>,
fidl::Socket,
Vec<String>,
Option<String>,
LauncherExplorePackageOverSocket2Responder,
)> {
if let LauncherRequest::ExplorePackageOverSocket2 {
fuchsia_pkg_resolver,
url,
subpackages,
socket,
tool_urls,
command,
responder,
} = self
{
Some((fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LauncherRequest::ExploreComponentOverPty { .. } => "explore_component_over_pty",
LauncherRequest::ExploreComponentOverSocket { .. } => "explore_component_over_socket",
LauncherRequest::ExplorePackageOverSocket { .. } => "explore_package_over_socket",
LauncherRequest::ExplorePackageOverSocket2 { .. } => "explore_package_over_socket2",
}
}
}
#[derive(Debug, Clone)]
pub struct LauncherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LauncherControlHandle {
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 LauncherControlHandle {
pub fn send_on_terminated(&self, mut return_code: i32) -> Result<(), fidl::Error> {
self.inner.send::<LauncherOnTerminatedRequest>(
(return_code,),
0,
0x6e5422dc5fe6b3f2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherExploreComponentOverPtyResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherExploreComponentOverPtyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherExploreComponentOverPtyResponder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherExploreComponentOverPtyResponder {
pub fn send(self, mut result: Result<(), LauncherError>) -> 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<(), LauncherError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
LauncherError,
>>(
result,
self.tx_id,
0x22efaa9c12b8779f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherExploreComponentOverSocketResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherExploreComponentOverSocketResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherExploreComponentOverSocketResponder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherExploreComponentOverSocketResponder {
pub fn send(self, mut result: Result<(), LauncherError>) -> 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<(), LauncherError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
LauncherError,
>>(
result,
self.tx_id,
0x233557fb2b70eb68,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherExplorePackageOverSocketResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherExplorePackageOverSocketResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherExplorePackageOverSocketResponder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherExplorePackageOverSocketResponder {
pub fn send(self, mut result: Result<(), LauncherError>) -> 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<(), LauncherError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
LauncherError,
>>(
result,
self.tx_id,
0x8e536067655b5a2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherExplorePackageOverSocket2Responder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherExplorePackageOverSocket2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherExplorePackageOverSocket2Responder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherExplorePackageOverSocket2Responder {
pub fn send(self, mut result: Result<(), LauncherError>) -> 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<(), LauncherError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
LauncherError,
>>(
result,
self.tx_id,
0x3884e07c1fa8d20b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for DashNamespaceLayout {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DashNamespaceLayout {
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 DashNamespaceLayout
{
#[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 DashNamespaceLayout {
#[inline(always)]
fn new_empty() -> Self {
Self::NestAllInstanceDirs
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FuchsiaPkgResolver {
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 FuchsiaPkgResolver {
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 FuchsiaPkgResolver
{
#[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 FuchsiaPkgResolver {
#[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(())
}
}
unsafe impl fidl::encoding::TypeMarker for LauncherError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for LauncherError {
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 LauncherError {
#[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 LauncherError {
#[inline(always)]
fn new_empty() -> Self {
Self::Internal
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherExploreComponentOverPtyRequest {
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 LauncherExploreComponentOverPtyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl
fidl::encoding::Encode<
LauncherExploreComponentOverPtyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherExploreComponentOverPtyRequest
{
#[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::<LauncherExploreComponentOverPtyRequest>(offset);
fidl::encoding::Encode::<LauncherExploreComponentOverPtyRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.pty),
<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
<DashNamespaceLayout as fidl::encoding::ValueTypeMarker>::borrow(&self.ns_layout),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
DashNamespaceLayout,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherExploreComponentOverPtyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3, T4)
{
#[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::<LauncherExploreComponentOverPtyRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExploreComponentOverPtyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
pty: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
tool_urls: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
command: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ns_layout: fidl::new_empty!(
DashNamespaceLayout,
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(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.pty,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.tool_urls,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.command,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
DashNamespaceLayout,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ns_layout,
decoder,
offset + 56,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherExploreComponentOverSocketRequest {
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 LauncherExploreComponentOverSocketRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl
fidl::encoding::Encode<
LauncherExploreComponentOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherExploreComponentOverSocketRequest
{
#[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::<LauncherExploreComponentOverSocketRequest>(offset);
fidl::encoding::Encode::<LauncherExploreComponentOverSocketRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
<DashNamespaceLayout as fidl::encoding::ValueTypeMarker>::borrow(&self.ns_layout),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
DashNamespaceLayout,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherExploreComponentOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3, T4)
{
#[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::<LauncherExploreComponentOverSocketRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExploreComponentOverSocketRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
tool_urls: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
command: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ns_layout: fidl::new_empty!(
DashNamespaceLayout,
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(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.tool_urls,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.command,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
DashNamespaceLayout,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ns_layout,
decoder,
offset + 56,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherExplorePackageOverSocket2Request {
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 LauncherExplorePackageOverSocket2Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
80
}
}
unsafe impl
fidl::encoding::Encode<
LauncherExplorePackageOverSocket2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherExplorePackageOverSocket2Request
{
#[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::<LauncherExplorePackageOverSocket2Request>(offset);
fidl::encoding::Encode::<LauncherExplorePackageOverSocket2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<FuchsiaPkgResolver as fidl::encoding::ValueTypeMarker>::borrow(&self.fuchsia_pkg_resolver),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackages),
<fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
FuchsiaPkgResolver,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T5: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherExplorePackageOverSocket2Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3, T4, T5)
{
#[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::<LauncherExplorePackageOverSocket2Request>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 48, depth)?;
self.5.encode(encoder, offset + 64, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExplorePackageOverSocket2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
fuchsia_pkg_resolver: fidl::new_empty!(
FuchsiaPkgResolver,
fidl::encoding::DefaultFuchsiaResourceDialect
),
url: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
subpackages: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
tool_urls: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
command: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
FuchsiaPkgResolver,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.fuchsia_pkg_resolver,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.url,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.subpackages,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 40, _depth)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.tool_urls,
decoder,
offset + 48,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.command,
decoder,
offset + 64,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherExplorePackageOverSocketRequest {
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 LauncherExplorePackageOverSocketRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
72
}
}
unsafe impl
fidl::encoding::Encode<
LauncherExplorePackageOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherExplorePackageOverSocketRequest
{
#[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::<LauncherExplorePackageOverSocketRequest>(offset);
fidl::encoding::Encode::<LauncherExplorePackageOverSocketRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackages),
<fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherExplorePackageOverSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3, T4)
{
#[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::<LauncherExplorePackageOverSocketRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherExplorePackageOverSocketRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
url: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
subpackages: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
tool_urls: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
command: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
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(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.subpackages,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 32, _depth)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.tool_urls,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.command,
decoder,
offset + 56,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LauncherOnTerminatedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LauncherOnTerminatedRequest {
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<LauncherOnTerminatedRequest, D> for &LauncherOnTerminatedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LauncherOnTerminatedRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LauncherOnTerminatedRequest)
.write_unaligned((self as *const LauncherOnTerminatedRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<LauncherOnTerminatedRequest, 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::<LauncherOnTerminatedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LauncherOnTerminatedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { return_code: fidl::new_empty!(i32, 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(())
}
}
}