#![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 FilterError {
NoPattern,
UnknownType,
InvalidOptions,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! FilterErrorUnknown {
() => {
_
};
}
impl FilterError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NoPattern),
2 => Some(Self::UnknownType),
3 => Some(Self::InvalidOptions),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NoPattern,
2 => Self::UnknownType,
3 => Self::InvalidOptions,
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::NoPattern => 1,
Self::UnknownType => 2,
Self::InvalidOptions => 3,
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)]
pub enum FilterType {
Url,
Moniker,
MonikerPrefix,
MonikerSuffix,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u8 },
}
#[macro_export]
macro_rules! FilterTypeUnknown {
() => {
_
};
}
impl FilterType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Url),
1 => Some(Self::Moniker),
2 => Some(Self::MonikerPrefix),
3 => Some(Self::MonikerSuffix),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
0 => Self::Url,
1 => Self::Moniker,
2 => Self::MonikerPrefix,
3 => Self::MonikerSuffix,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::Url => 0,
Self::Moniker => 1,
Self::MonikerPrefix => 2,
Self::MonikerSuffix => 3,
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)]
pub enum MinidumpError {
NoProcesses,
InternalError,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! MinidumpErrorUnknown {
() => {
_
};
}
impl MinidumpError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NoProcesses),
2 => Some(Self::InternalError),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NoProcesses,
2 => 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::NoProcesses => 1,
Self::InternalError => 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)]
pub enum ProcessInfoError {
NoProcesses,
ProcessGone,
ThreadGone,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ProcessInfoErrorUnknown {
() => {
_
};
}
impl ProcessInfoError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NoProcesses),
2 => Some(Self::ProcessGone),
3 => Some(Self::ThreadGone),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NoProcesses,
2 => Self::ProcessGone,
3 => Self::ThreadGone,
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::NoProcesses => 1,
Self::ProcessGone => 2,
Self::ThreadGone => 3,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Agent {
pub name: String,
pub client_end: fidl::endpoints::ClientEnd<DebugAgentMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Agent {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AgentIteratorGetNextResponse {
pub agents: Vec<Agent>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for AgentIteratorGetNextResponse
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AttachedProcessIteratorGetNextResponse {
pub process_names: Vec<String>,
}
impl fidl::Persistable for AttachedProcessIteratorGetNextResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DebugAgentConnectRequest {
pub socket: fidl::Socket,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugAgentConnectRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DebugAgentGetAttachedProcessesRequest {
pub iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetAttachedProcessesRequest
{
}
#[derive(Debug, PartialEq)]
pub struct DebugAgentGetMinidumpsRequest {
pub options: MinidumpOptions,
pub iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetMinidumpsRequest
{
}
#[derive(Debug, PartialEq)]
pub struct DebugAgentGetProcessInfoRequest {
pub options: GetProcessInfoOptions,
pub iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetProcessInfoRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DebugAgentAttachToResponse {
pub num_matches: u32,
}
impl fidl::Persistable for DebugAgentAttachToResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct Filter {
pub pattern: String,
pub type_: FilterType,
pub options: FilterOptions,
}
impl fidl::Persistable for Filter {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherGetAgentsRequest {
pub iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherGetAgentsRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherLaunchRequest {
pub agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherLaunchRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MinidumpIteratorGetNextResponse {
pub minidump: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for MinidumpIteratorGetNextResponse
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct ProcessInfo {
pub process: u64,
pub moniker: String,
pub thread: u64,
pub details: ThreadDetails,
}
impl fidl::Persistable for ProcessInfo {}
#[derive(Clone, Debug, PartialEq)]
pub struct ProcessInfoIteratorGetNextResponse {
pub info: Vec<ProcessInfo>,
}
impl fidl::Persistable for ProcessInfoIteratorGetNextResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DebugAgentOnFatalExceptionRequest {
pub thread: Option<u64>,
pub backtrace: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DebugAgentOnFatalExceptionRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct FilterOptions {
pub recursive: Option<bool>,
pub job_only: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for FilterOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct GetProcessInfoOptions {
pub filter: Option<Filter>,
pub interest: Option<ThreadDetailsInterest>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for GetProcessInfoOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MinidumpOptions {
pub filter: Option<Filter>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MinidumpOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ThreadDetails {
pub backtrace: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ThreadDetails {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ThreadDetailsInterest {
pub backtrace: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ThreadDetailsInterest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AgentIteratorMarker;
impl fidl::endpoints::ProtocolMarker for AgentIteratorMarker {
type Proxy = AgentIteratorProxy;
type RequestStream = AgentIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AgentIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AgentIterator";
}
pub trait AgentIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<Vec<Agent>, fidl::Error>> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AgentIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AgentIteratorSynchronousProxy {
type Proxy = AgentIteratorProxy;
type Protocol = AgentIteratorMarker;
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 AgentIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <AgentIteratorMarker 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<AgentIteratorEvent, fidl::Error> {
AgentIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Agent>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, AgentIteratorGetNextResponse>(
(),
0x40f8adb0c975fa41,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.agents)
}
}
#[derive(Debug, Clone)]
pub struct AgentIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AgentIteratorProxy {
type Protocol = AgentIteratorMarker;
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 AgentIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <AgentIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AgentIteratorEventStream {
AgentIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<Vec<Agent>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
AgentIteratorProxyInterface::r#get_next(self)
}
}
impl AgentIteratorProxyInterface for AgentIteratorProxy {
type GetNextResponseFut =
fidl::client::QueryResponseFut<Vec<Agent>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Agent>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AgentIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x40f8adb0c975fa41,
>(_buf?)?;
Ok(_response.agents)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Agent>>(
(),
0x40f8adb0c975fa41,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct AgentIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AgentIteratorEventStream {}
impl futures::stream::FusedStream for AgentIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AgentIteratorEventStream {
type Item = Result<AgentIteratorEvent, 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(AgentIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AgentIteratorEvent {}
impl AgentIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AgentIteratorEvent, 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: <AgentIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AgentIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AgentIteratorRequestStream {}
impl futures::stream::FusedStream for AgentIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AgentIteratorRequestStream {
type Protocol = AgentIteratorMarker;
type ControlHandle = AgentIteratorControlHandle;
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 {
AgentIteratorControlHandle { 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 AgentIteratorRequestStream {
type Item = Result<AgentIteratorRequest, 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 AgentIteratorRequestStream 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 {
0x40f8adb0c975fa41 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
AgentIteratorControlHandle { inner: this.inner.clone() };
Ok(AgentIteratorRequest::GetNext {
responder: AgentIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<AgentIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AgentIteratorRequest {
GetNext { responder: AgentIteratorGetNextResponder },
}
impl AgentIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(AgentIteratorGetNextResponder)> {
if let AgentIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
AgentIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct AgentIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AgentIteratorControlHandle {
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 AgentIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AgentIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<AgentIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AgentIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AgentIteratorGetNextResponder {
type ControlHandle = AgentIteratorControlHandle;
fn control_handle(&self) -> &AgentIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AgentIteratorGetNextResponder {
pub fn send(self, mut agents: Vec<Agent>) -> Result<(), fidl::Error> {
let _result = self.send_raw(agents);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut agents: Vec<Agent>) -> Result<(), fidl::Error> {
let _result = self.send_raw(agents);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut agents: Vec<Agent>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AgentIteratorGetNextResponse>(
(agents.as_mut(),),
self.tx_id,
0x40f8adb0c975fa41,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AttachedProcessIteratorMarker;
impl fidl::endpoints::ProtocolMarker for AttachedProcessIteratorMarker {
type Proxy = AttachedProcessIteratorProxy;
type RequestStream = AttachedProcessIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AttachedProcessIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AttachedProcessIterator";
}
pub trait AttachedProcessIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AttachedProcessIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AttachedProcessIteratorSynchronousProxy {
type Proxy = AttachedProcessIteratorProxy;
type Protocol = AttachedProcessIteratorMarker;
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 AttachedProcessIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<AttachedProcessIteratorMarker 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<AttachedProcessIteratorEvent, fidl::Error> {
AttachedProcessIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<String>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, AttachedProcessIteratorGetNextResponse>(
(),
0x47ef49b75f6133ab,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.process_names)
}
}
#[derive(Debug, Clone)]
pub struct AttachedProcessIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AttachedProcessIteratorProxy {
type Protocol = AttachedProcessIteratorMarker;
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 AttachedProcessIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<AttachedProcessIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AttachedProcessIteratorEventStream {
AttachedProcessIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
AttachedProcessIteratorProxyInterface::r#get_next(self)
}
}
impl AttachedProcessIteratorProxyInterface for AttachedProcessIteratorProxy {
type GetNextResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AttachedProcessIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x47ef49b75f6133ab,
>(_buf?)?;
Ok(_response.process_names)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
(),
0x47ef49b75f6133ab,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct AttachedProcessIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AttachedProcessIteratorEventStream {}
impl futures::stream::FusedStream for AttachedProcessIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AttachedProcessIteratorEventStream {
type Item = Result<AttachedProcessIteratorEvent, 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(AttachedProcessIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AttachedProcessIteratorEvent {}
impl AttachedProcessIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AttachedProcessIteratorEvent, 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:
<AttachedProcessIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AttachedProcessIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AttachedProcessIteratorRequestStream {}
impl futures::stream::FusedStream for AttachedProcessIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AttachedProcessIteratorRequestStream {
type Protocol = AttachedProcessIteratorMarker;
type ControlHandle = AttachedProcessIteratorControlHandle;
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 {
AttachedProcessIteratorControlHandle { 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 AttachedProcessIteratorRequestStream {
type Item = Result<AttachedProcessIteratorRequest, 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 AttachedProcessIteratorRequestStream 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 {
0x47ef49b75f6133ab => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AttachedProcessIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(AttachedProcessIteratorRequest::GetNext {
responder: AttachedProcessIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <AttachedProcessIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AttachedProcessIteratorRequest {
GetNext { responder: AttachedProcessIteratorGetNextResponder },
}
impl AttachedProcessIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(AttachedProcessIteratorGetNextResponder)> {
if let AttachedProcessIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
AttachedProcessIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct AttachedProcessIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AttachedProcessIteratorControlHandle {
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 AttachedProcessIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AttachedProcessIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<AttachedProcessIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AttachedProcessIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AttachedProcessIteratorGetNextResponder {
type ControlHandle = AttachedProcessIteratorControlHandle;
fn control_handle(&self) -> &AttachedProcessIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AttachedProcessIteratorGetNextResponder {
pub fn send(self, mut process_names: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(process_names);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut process_names: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(process_names);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut process_names: &[String]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AttachedProcessIteratorGetNextResponse>(
(process_names,),
self.tx_id,
0x47ef49b75f6133ab,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DebugAgentMarker;
impl fidl::endpoints::ProtocolMarker for DebugAgentMarker {
type Proxy = DebugAgentProxy;
type RequestStream = DebugAgentRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DebugAgentSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.debugger.DebugAgent";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DebugAgentMarker {}
pub type DebugAgentConnectResult = Result<(), i32>;
pub type DebugAgentAttachToResult = Result<u32, FilterError>;
pub type DebugAgentGetProcessInfoResult = Result<(), FilterError>;
pub type DebugAgentGetMinidumpsResult = Result<(), FilterError>;
pub trait DebugAgentProxyInterface: Send + Sync {
type ConnectResponseFut: std::future::Future<Output = Result<DebugAgentConnectResult, fidl::Error>>
+ Send;
fn r#connect(&self, socket: fidl::Socket) -> Self::ConnectResponseFut;
fn r#get_attached_processes(
&self,
iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
) -> Result<(), fidl::Error>;
type AttachToResponseFut: std::future::Future<Output = Result<DebugAgentAttachToResult, fidl::Error>>
+ Send;
fn r#attach_to(
&self,
pattern: &str,
type_: FilterType,
options: &FilterOptions,
) -> Self::AttachToResponseFut;
type GetProcessInfoResponseFut: std::future::Future<Output = Result<DebugAgentGetProcessInfoResult, fidl::Error>>
+ Send;
fn r#get_process_info(
&self,
options: &GetProcessInfoOptions,
iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
) -> Self::GetProcessInfoResponseFut;
type GetMinidumpsResponseFut: std::future::Future<Output = Result<DebugAgentGetMinidumpsResult, fidl::Error>>
+ Send;
fn r#get_minidumps(
&self,
options: &MinidumpOptions,
iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
) -> Self::GetMinidumpsResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DebugAgentSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DebugAgentSynchronousProxy {
type Proxy = DebugAgentProxy;
type Protocol = DebugAgentMarker;
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 DebugAgentSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DebugAgentMarker 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<DebugAgentEvent, fidl::Error> {
DebugAgentEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(
&self,
mut socket: fidl::Socket,
___deadline: zx::MonotonicInstant,
) -> Result<DebugAgentConnectResult, fidl::Error> {
let _response = self.client.send_query::<
DebugAgentConnectRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(socket,),
0x6f81c1e426ddf3f9,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DebugAgentMarker>("connect")?;
Ok(_response.map(|x| x))
}
pub fn r#get_attached_processes(
&self,
mut iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DebugAgentGetAttachedProcessesRequest>(
(iterator,),
0x4a07b086a7deda56,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#attach_to(
&self,
mut pattern: &str,
mut type_: FilterType,
mut options: &FilterOptions,
___deadline: zx::MonotonicInstant,
) -> Result<DebugAgentAttachToResult, fidl::Error> {
let _response = self.client.send_query::<
Filter,
fidl::encoding::FlexibleResultType<DebugAgentAttachToResponse, FilterError>,
>(
(pattern, type_, options,),
0x2800c757fe52795f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DebugAgentMarker>("attach_to")?;
Ok(_response.map(|x| x.num_matches))
}
pub fn r#get_process_info(
&self,
mut options: &GetProcessInfoOptions,
mut iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<DebugAgentGetProcessInfoResult, fidl::Error> {
let _response = self.client.send_query::<
DebugAgentGetProcessInfoRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FilterError>,
>(
(options, iterator,),
0x4daf0a7366bb6d77,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DebugAgentMarker>("get_process_info")?;
Ok(_response.map(|x| x))
}
pub fn r#get_minidumps(
&self,
mut options: &MinidumpOptions,
mut iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<DebugAgentGetMinidumpsResult, fidl::Error> {
let _response = self.client.send_query::<
DebugAgentGetMinidumpsRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FilterError>,
>(
(options, iterator,),
0x4a4693aeecdb7deb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DebugAgentMarker>("get_minidumps")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DebugAgentProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DebugAgentProxy {
type Protocol = DebugAgentMarker;
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 DebugAgentProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DebugAgentMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DebugAgentEventStream {
DebugAgentEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(
&self,
mut socket: fidl::Socket,
) -> fidl::client::QueryResponseFut<
DebugAgentConnectResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugAgentProxyInterface::r#connect(self, socket)
}
pub fn r#get_attached_processes(
&self,
mut iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
) -> Result<(), fidl::Error> {
DebugAgentProxyInterface::r#get_attached_processes(self, iterator)
}
pub fn r#attach_to(
&self,
mut pattern: &str,
mut type_: FilterType,
mut options: &FilterOptions,
) -> fidl::client::QueryResponseFut<
DebugAgentAttachToResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugAgentProxyInterface::r#attach_to(self, pattern, type_, options)
}
pub fn r#get_process_info(
&self,
mut options: &GetProcessInfoOptions,
mut iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
) -> fidl::client::QueryResponseFut<
DebugAgentGetProcessInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugAgentProxyInterface::r#get_process_info(self, options, iterator)
}
pub fn r#get_minidumps(
&self,
mut options: &MinidumpOptions,
mut iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
) -> fidl::client::QueryResponseFut<
DebugAgentGetMinidumpsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugAgentProxyInterface::r#get_minidumps(self, options, iterator)
}
}
impl DebugAgentProxyInterface for DebugAgentProxy {
type ConnectResponseFut = fidl::client::QueryResponseFut<
DebugAgentConnectResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#connect(&self, mut socket: fidl::Socket) -> Self::ConnectResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugAgentConnectResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f81c1e426ddf3f9,
>(_buf?)?
.into_result::<DebugAgentMarker>("connect")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<DebugAgentConnectRequest, DebugAgentConnectResult>(
(socket,),
0x6f81c1e426ddf3f9,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
fn r#get_attached_processes(
&self,
mut iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DebugAgentGetAttachedProcessesRequest>(
(iterator,),
0x4a07b086a7deda56,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
type AttachToResponseFut = fidl::client::QueryResponseFut<
DebugAgentAttachToResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#attach_to(
&self,
mut pattern: &str,
mut type_: FilterType,
mut options: &FilterOptions,
) -> Self::AttachToResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugAgentAttachToResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DebugAgentAttachToResponse, FilterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2800c757fe52795f,
>(_buf?)?
.into_result::<DebugAgentMarker>("attach_to")?;
Ok(_response.map(|x| x.num_matches))
}
self.client.send_query_and_decode::<Filter, DebugAgentAttachToResult>(
(pattern, type_, options),
0x2800c757fe52795f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type GetProcessInfoResponseFut = fidl::client::QueryResponseFut<
DebugAgentGetProcessInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_process_info(
&self,
mut options: &GetProcessInfoOptions,
mut iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
) -> Self::GetProcessInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugAgentGetProcessInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FilterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4daf0a7366bb6d77,
>(_buf?)?
.into_result::<DebugAgentMarker>("get_process_info")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DebugAgentGetProcessInfoRequest,
DebugAgentGetProcessInfoResult,
>(
(options, iterator,),
0x4daf0a7366bb6d77,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type GetMinidumpsResponseFut = fidl::client::QueryResponseFut<
DebugAgentGetMinidumpsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_minidumps(
&self,
mut options: &MinidumpOptions,
mut iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
) -> Self::GetMinidumpsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugAgentGetMinidumpsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FilterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a4693aeecdb7deb,
>(_buf?)?
.into_result::<DebugAgentMarker>("get_minidumps")?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<DebugAgentGetMinidumpsRequest, DebugAgentGetMinidumpsResult>(
(options, iterator),
0x4a4693aeecdb7deb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DebugAgentEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DebugAgentEventStream {}
impl futures::stream::FusedStream for DebugAgentEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DebugAgentEventStream {
type Item = Result<DebugAgentEvent, 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(DebugAgentEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DebugAgentEvent {
OnFatalException {
payload: DebugAgentOnFatalExceptionRequest,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DebugAgentEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_fatal_exception(self) -> Option<DebugAgentOnFatalExceptionRequest> {
if let DebugAgentEvent::OnFatalException { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DebugAgentEvent, 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 {
0x254b534a4790d114 => {
let mut out = fidl::new_empty!(
DebugAgentOnFatalExceptionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugAgentOnFatalExceptionRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DebugAgentEvent::OnFatalException { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(DebugAgentEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DebugAgentMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DebugAgentRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DebugAgentRequestStream {}
impl futures::stream::FusedStream for DebugAgentRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DebugAgentRequestStream {
type Protocol = DebugAgentMarker;
type ControlHandle = DebugAgentControlHandle;
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 {
DebugAgentControlHandle { 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 DebugAgentRequestStream {
type Item = Result<DebugAgentRequest, 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 DebugAgentRequestStream 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 {
0x6f81c1e426ddf3f9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DebugAgentConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugAgentConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugAgentControlHandle { inner: this.inner.clone() };
Ok(DebugAgentRequest::Connect {
socket: req.socket,
responder: DebugAgentConnectResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a07b086a7deda56 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DebugAgentGetAttachedProcessesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugAgentGetAttachedProcessesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugAgentControlHandle { inner: this.inner.clone() };
Ok(DebugAgentRequest::GetAttachedProcesses {
iterator: req.iterator,
control_handle,
})
}
0x2800c757fe52795f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req =
fidl::new_empty!(Filter, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Filter>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugAgentControlHandle { inner: this.inner.clone() };
Ok(DebugAgentRequest::AttachTo {
pattern: req.pattern,
type_: req.type_,
options: req.options,
responder: DebugAgentAttachToResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4daf0a7366bb6d77 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DebugAgentGetProcessInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugAgentGetProcessInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugAgentControlHandle { inner: this.inner.clone() };
Ok(DebugAgentRequest::GetProcessInfo {
options: req.options,
iterator: req.iterator,
responder: DebugAgentGetProcessInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a4693aeecdb7deb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DebugAgentGetMinidumpsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugAgentGetMinidumpsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugAgentControlHandle { inner: this.inner.clone() };
Ok(DebugAgentRequest::GetMinidumps {
options: req.options,
iterator: req.iterator,
responder: DebugAgentGetMinidumpsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(DebugAgentRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DebugAgentControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(DebugAgentRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DebugAgentControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DebugAgentMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DebugAgentRequest {
Connect { socket: fidl::Socket, responder: DebugAgentConnectResponder },
GetAttachedProcesses {
iterator: fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
control_handle: DebugAgentControlHandle,
},
AttachTo {
pattern: String,
type_: FilterType,
options: FilterOptions,
responder: DebugAgentAttachToResponder,
},
GetProcessInfo {
options: GetProcessInfoOptions,
iterator: fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
responder: DebugAgentGetProcessInfoResponder,
},
GetMinidumps {
options: MinidumpOptions,
iterator: fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
responder: DebugAgentGetMinidumpsResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DebugAgentControlHandle,
method_type: fidl::MethodType,
},
}
impl DebugAgentRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(self) -> Option<(fidl::Socket, DebugAgentConnectResponder)> {
if let DebugAgentRequest::Connect { socket, responder } = self {
Some((socket, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attached_processes(
self,
) -> Option<(fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>, DebugAgentControlHandle)>
{
if let DebugAgentRequest::GetAttachedProcesses { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_attach_to(
self,
) -> Option<(String, FilterType, FilterOptions, DebugAgentAttachToResponder)> {
if let DebugAgentRequest::AttachTo { pattern, type_, options, responder } = self {
Some((pattern, type_, options, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_process_info(
self,
) -> Option<(
GetProcessInfoOptions,
fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>,
DebugAgentGetProcessInfoResponder,
)> {
if let DebugAgentRequest::GetProcessInfo { options, iterator, responder } = self {
Some((options, iterator, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_minidumps(
self,
) -> Option<(
MinidumpOptions,
fidl::endpoints::ServerEnd<MinidumpIteratorMarker>,
DebugAgentGetMinidumpsResponder,
)> {
if let DebugAgentRequest::GetMinidumps { options, iterator, responder } = self {
Some((options, iterator, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DebugAgentRequest::Connect { .. } => "connect",
DebugAgentRequest::GetAttachedProcesses { .. } => "get_attached_processes",
DebugAgentRequest::AttachTo { .. } => "attach_to",
DebugAgentRequest::GetProcessInfo { .. } => "get_process_info",
DebugAgentRequest::GetMinidumps { .. } => "get_minidumps",
DebugAgentRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
DebugAgentRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct DebugAgentControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DebugAgentControlHandle {
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 DebugAgentControlHandle {
pub fn send_on_fatal_exception(
&self,
mut payload: &DebugAgentOnFatalExceptionRequest,
) -> Result<(), fidl::Error> {
self.inner.send::<DebugAgentOnFatalExceptionRequest>(
payload,
0,
0x254b534a4790d114,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugAgentConnectResponder {
control_handle: std::mem::ManuallyDrop<DebugAgentControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugAgentConnectResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugAgentConnectResponder {
type ControlHandle = DebugAgentControlHandle;
fn control_handle(&self) -> &DebugAgentControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugAgentConnectResponder {
pub fn send(self, mut result: Result<(), i32>) -> 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<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x6f81c1e426ddf3f9,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugAgentAttachToResponder {
control_handle: std::mem::ManuallyDrop<DebugAgentControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugAgentAttachToResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugAgentAttachToResponder {
type ControlHandle = DebugAgentControlHandle;
fn control_handle(&self) -> &DebugAgentControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugAgentAttachToResponder {
pub fn send(self, mut result: Result<u32, FilterError>) -> 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<u32, FilterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u32, FilterError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DebugAgentAttachToResponse,
FilterError,
>>(
fidl::encoding::FlexibleResult::new(result.map(|num_matches| (num_matches,))),
self.tx_id,
0x2800c757fe52795f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugAgentGetProcessInfoResponder {
control_handle: std::mem::ManuallyDrop<DebugAgentControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugAgentGetProcessInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugAgentGetProcessInfoResponder {
type ControlHandle = DebugAgentControlHandle;
fn control_handle(&self) -> &DebugAgentControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugAgentGetProcessInfoResponder {
pub fn send(self, mut result: Result<(), FilterError>) -> 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<(), FilterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), FilterError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
FilterError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x4daf0a7366bb6d77,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugAgentGetMinidumpsResponder {
control_handle: std::mem::ManuallyDrop<DebugAgentControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugAgentGetMinidumpsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugAgentGetMinidumpsResponder {
type ControlHandle = DebugAgentControlHandle;
fn control_handle(&self) -> &DebugAgentControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugAgentGetMinidumpsResponder {
pub fn send(self, mut result: Result<(), FilterError>) -> 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<(), FilterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), FilterError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
FilterError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x4a4693aeecdb7deb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[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.debugger.Launcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LauncherMarker {}
pub type LauncherLaunchResult = Result<(), i32>;
pub trait LauncherProxyInterface: Send + Sync {
type LaunchResponseFut: std::future::Future<Output = Result<LauncherLaunchResult, fidl::Error>>
+ Send;
fn r#launch(
&self,
agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
) -> Self::LaunchResponseFut;
fn r#get_agents(
&self,
iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
) -> Result<(), fidl::Error>;
}
#[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#launch(
&self,
mut agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<LauncherLaunchResult, fidl::Error> {
let _response = self.client.send_query::<
LauncherLaunchRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(agent,),
0x54420f44e79e5c0e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LauncherMarker>("launch")?;
Ok(_response.map(|x| x))
}
pub fn r#get_agents(
&self,
mut iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LauncherGetAgentsRequest>(
(iterator,),
0x4e6a35bfa35ee8f4,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[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#launch(
&self,
mut agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
) -> fidl::client::QueryResponseFut<
LauncherLaunchResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#launch(self, agent)
}
pub fn r#get_agents(
&self,
mut iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#get_agents(self, iterator)
}
}
impl LauncherProxyInterface for LauncherProxy {
type LaunchResponseFut = fidl::client::QueryResponseFut<
LauncherLaunchResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#launch(
&self,
mut agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
) -> Self::LaunchResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LauncherLaunchResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54420f44e79e5c0e,
>(_buf?)?
.into_result::<LauncherMarker>("launch")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LauncherLaunchRequest, LauncherLaunchResult>(
(agent,),
0x54420f44e79e5c0e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
fn r#get_agents(
&self,
mut iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LauncherGetAgentsRequest>(
(iterator,),
0x4e6a35bfa35ee8f4,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
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 {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl LauncherEvent {
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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(LauncherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => 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 {
0x54420f44e79e5c0e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherLaunchRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::Launch {
agent: req.agent,
responder: LauncherLaunchResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4e6a35bfa35ee8f4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherGetAgentsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherGetAgentsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::GetAgents { iterator: req.iterator, control_handle })
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(LauncherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LauncherControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(LauncherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LauncherControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LauncherRequest {
Launch {
agent: fidl::endpoints::ServerEnd<DebugAgentMarker>,
responder: LauncherLaunchResponder,
},
GetAgents {
iterator: fidl::endpoints::ServerEnd<AgentIteratorMarker>,
control_handle: LauncherControlHandle,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: LauncherControlHandle,
method_type: fidl::MethodType,
},
}
impl LauncherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_launch(
self,
) -> Option<(fidl::endpoints::ServerEnd<DebugAgentMarker>, LauncherLaunchResponder)> {
if let LauncherRequest::Launch { agent, responder } = self {
Some((agent, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_agents(
self,
) -> Option<(fidl::endpoints::ServerEnd<AgentIteratorMarker>, LauncherControlHandle)> {
if let LauncherRequest::GetAgents { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LauncherRequest::Launch { .. } => "launch",
LauncherRequest::GetAgents { .. } => "get_agents",
LauncherRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
LauncherRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[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 {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherLaunchResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherLaunchResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherLaunchResponder {
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 LauncherLaunchResponder {
pub fn send(self, mut result: Result<(), i32>) -> 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<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x54420f44e79e5c0e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MinidumpIteratorMarker;
impl fidl::endpoints::ProtocolMarker for MinidumpIteratorMarker {
type Proxy = MinidumpIteratorProxy;
type RequestStream = MinidumpIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = MinidumpIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) MinidumpIterator";
}
pub type MinidumpIteratorGetNextResult = Result<fidl::Vmo, MinidumpError>;
pub trait MinidumpIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<MinidumpIteratorGetNextResult, fidl::Error>>
+ Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct MinidumpIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for MinidumpIteratorSynchronousProxy {
type Proxy = MinidumpIteratorProxy;
type Protocol = MinidumpIteratorMarker;
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 MinidumpIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <MinidumpIteratorMarker 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<MinidumpIteratorEvent, fidl::Error> {
MinidumpIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<MinidumpIteratorGetNextResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
MinidumpIteratorGetNextResponse,
MinidumpError,
>>(
(),
0x3db055b61b8482dc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.minidump))
}
}
#[derive(Debug, Clone)]
pub struct MinidumpIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for MinidumpIteratorProxy {
type Protocol = MinidumpIteratorMarker;
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 MinidumpIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <MinidumpIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> MinidumpIteratorEventStream {
MinidumpIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
MinidumpIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
MinidumpIteratorProxyInterface::r#get_next(self)
}
}
impl MinidumpIteratorProxyInterface for MinidumpIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
MinidumpIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<MinidumpIteratorGetNextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<MinidumpIteratorGetNextResponse, MinidumpError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3db055b61b8482dc,
>(_buf?)?;
Ok(_response.map(|x| x.minidump))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, MinidumpIteratorGetNextResult>(
(),
0x3db055b61b8482dc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct MinidumpIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for MinidumpIteratorEventStream {}
impl futures::stream::FusedStream for MinidumpIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for MinidumpIteratorEventStream {
type Item = Result<MinidumpIteratorEvent, 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(MinidumpIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum MinidumpIteratorEvent {}
impl MinidumpIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<MinidumpIteratorEvent, 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:
<MinidumpIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct MinidumpIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for MinidumpIteratorRequestStream {}
impl futures::stream::FusedStream for MinidumpIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for MinidumpIteratorRequestStream {
type Protocol = MinidumpIteratorMarker;
type ControlHandle = MinidumpIteratorControlHandle;
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 {
MinidumpIteratorControlHandle { 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 MinidumpIteratorRequestStream {
type Item = Result<MinidumpIteratorRequest, 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 MinidumpIteratorRequestStream 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 {
0x3db055b61b8482dc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
MinidumpIteratorControlHandle { inner: this.inner.clone() };
Ok(MinidumpIteratorRequest::GetNext {
responder: MinidumpIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<MinidumpIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum MinidumpIteratorRequest {
GetNext { responder: MinidumpIteratorGetNextResponder },
}
impl MinidumpIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(MinidumpIteratorGetNextResponder)> {
if let MinidumpIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
MinidumpIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct MinidumpIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for MinidumpIteratorControlHandle {
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 MinidumpIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MinidumpIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<MinidumpIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MinidumpIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MinidumpIteratorGetNextResponder {
type ControlHandle = MinidumpIteratorControlHandle;
fn control_handle(&self) -> &MinidumpIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MinidumpIteratorGetNextResponder {
pub fn send(self, mut result: Result<fidl::Vmo, MinidumpError>) -> 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::Vmo, MinidumpError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<fidl::Vmo, MinidumpError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
MinidumpIteratorGetNextResponse,
MinidumpError,
>>(
result.map(|minidump| (minidump,)),
self.tx_id,
0x3db055b61b8482dc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ProcessInfoIteratorMarker;
impl fidl::endpoints::ProtocolMarker for ProcessInfoIteratorMarker {
type Proxy = ProcessInfoIteratorProxy;
type RequestStream = ProcessInfoIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ProcessInfoIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ProcessInfoIterator";
}
pub type ProcessInfoIteratorGetNextResult = Result<Vec<ProcessInfo>, ProcessInfoError>;
pub trait ProcessInfoIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<ProcessInfoIteratorGetNextResult, fidl::Error>>
+ Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ProcessInfoIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ProcessInfoIteratorSynchronousProxy {
type Proxy = ProcessInfoIteratorProxy;
type Protocol = ProcessInfoIteratorMarker;
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 ProcessInfoIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ProcessInfoIteratorMarker 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<ProcessInfoIteratorEvent, fidl::Error> {
ProcessInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ProcessInfoIteratorGetNextResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
ProcessInfoIteratorGetNextResponse,
ProcessInfoError,
>>(
(),
0x527e289fe635bcc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.info))
}
}
#[derive(Debug, Clone)]
pub struct ProcessInfoIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ProcessInfoIteratorProxy {
type Protocol = ProcessInfoIteratorMarker;
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 ProcessInfoIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<ProcessInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ProcessInfoIteratorEventStream {
ProcessInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
ProcessInfoIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProcessInfoIteratorProxyInterface::r#get_next(self)
}
}
impl ProcessInfoIteratorProxyInterface for ProcessInfoIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
ProcessInfoIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProcessInfoIteratorGetNextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProcessInfoIteratorGetNextResponse, ProcessInfoError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x527e289fe635bcc,
>(_buf?)?;
Ok(_response.map(|x| x.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ProcessInfoIteratorGetNextResult,
>(
(),
0x527e289fe635bcc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ProcessInfoIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ProcessInfoIteratorEventStream {}
impl futures::stream::FusedStream for ProcessInfoIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ProcessInfoIteratorEventStream {
type Item = Result<ProcessInfoIteratorEvent, 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(ProcessInfoIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ProcessInfoIteratorEvent {}
impl ProcessInfoIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ProcessInfoIteratorEvent, 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:
<ProcessInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ProcessInfoIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ProcessInfoIteratorRequestStream {}
impl futures::stream::FusedStream for ProcessInfoIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ProcessInfoIteratorRequestStream {
type Protocol = ProcessInfoIteratorMarker;
type ControlHandle = ProcessInfoIteratorControlHandle;
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 {
ProcessInfoIteratorControlHandle { 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 ProcessInfoIteratorRequestStream {
type Item = Result<ProcessInfoIteratorRequest, 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 ProcessInfoIteratorRequestStream 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 {
0x527e289fe635bcc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProcessInfoIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(ProcessInfoIteratorRequest::GetNext {
responder: ProcessInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ProcessInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ProcessInfoIteratorRequest {
GetNext { responder: ProcessInfoIteratorGetNextResponder },
}
impl ProcessInfoIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(ProcessInfoIteratorGetNextResponder)> {
if let ProcessInfoIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ProcessInfoIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct ProcessInfoIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ProcessInfoIteratorControlHandle {
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 ProcessInfoIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProcessInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<ProcessInfoIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProcessInfoIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProcessInfoIteratorGetNextResponder {
type ControlHandle = ProcessInfoIteratorControlHandle;
fn control_handle(&self) -> &ProcessInfoIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProcessInfoIteratorGetNextResponder {
pub fn send(
self,
mut result: Result<&[ProcessInfo], ProcessInfoError>,
) -> 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<&[ProcessInfo], ProcessInfoError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[ProcessInfo], ProcessInfoError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ProcessInfoIteratorGetNextResponse,
ProcessInfoError,
>>(
result.map(|info| (info,)),
self.tx_id,
0x527e289fe635bcc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for FilterError {
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 FilterError {
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 FilterError {
#[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 FilterError {
#[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 FilterType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for FilterType {
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 FilterType {
#[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 FilterType {
#[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::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MinidumpError {
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 MinidumpError {
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 MinidumpError {
#[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 MinidumpError {
#[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 ProcessInfoError {
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 ProcessInfoError {
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 ProcessInfoError
{
#[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 ProcessInfoError {
#[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 Agent {
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 Agent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl fidl::encoding::Encode<Agent, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Agent
{
#[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::<Agent>(offset);
fidl::encoding::Encode::<Agent, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DebugAgentMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client_end),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<1024>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DebugAgentMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<Agent, 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::<Agent>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Agent {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(
fidl::encoding::BoundedString<1024>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client_end: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DebugAgentMarker>>,
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,
});
}
fidl::decode!(
fidl::encoding::BoundedString<1024>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DebugAgentMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client_end,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for AgentIteratorGetNextResponse {
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 AgentIteratorGetNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
AgentIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut AgentIteratorGetNextResponse
{
#[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::<AgentIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<AgentIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<Agent> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.agents),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<Agent>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
AgentIteratorGetNextResponse,
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::<AgentIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for AgentIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
agents: fidl::new_empty!(
fidl::encoding::UnboundedVector<Agent>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<Agent>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.agents,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AttachedProcessIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AttachedProcessIteratorGetNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D>
for &AttachedProcessIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<AttachedProcessIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.process_names),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
D,
>,
> fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, 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::<AttachedProcessIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AttachedProcessIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
process_names: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
D,
&mut self.process_names,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DebugAgentConnectRequest {
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 DebugAgentConnectRequest {
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<
DebugAgentConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DebugAgentConnectRequest
{
#[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::<DebugAgentConnectRequest>(offset);
fidl::encoding::Encode::<
DebugAgentConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.socket
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DebugAgentConnectRequest,
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::<DebugAgentConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DebugAgentGetAttachedProcessesRequest {
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 DebugAgentGetAttachedProcessesRequest {
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<
DebugAgentGetAttachedProcessesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DebugAgentGetAttachedProcessesRequest
{
#[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::<DebugAgentGetAttachedProcessesRequest>(offset);
fidl::encoding::Encode::<
DebugAgentGetAttachedProcessesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DebugAgentGetAttachedProcessesRequest,
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::<DebugAgentGetAttachedProcessesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetAttachedProcessesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AttachedProcessIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DebugAgentGetMinidumpsRequest {
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 DebugAgentGetMinidumpsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
DebugAgentGetMinidumpsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DebugAgentGetMinidumpsRequest
{
#[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::<DebugAgentGetMinidumpsRequest>(offset);
fidl::encoding::Encode::<DebugAgentGetMinidumpsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<MinidumpOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MinidumpIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<MinidumpOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MinidumpIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DebugAgentGetMinidumpsRequest,
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::<DebugAgentGetMinidumpsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetMinidumpsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
options: fidl::new_empty!(
MinidumpOptions,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MinidumpIteratorMarker>>,
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,
});
}
fidl::decode!(
MinidumpOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MinidumpIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DebugAgentGetProcessInfoRequest {
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 DebugAgentGetProcessInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
DebugAgentGetProcessInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DebugAgentGetProcessInfoRequest
{
#[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::<DebugAgentGetProcessInfoRequest>(offset);
fidl::encoding::Encode::<DebugAgentGetProcessInfoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<GetProcessInfoOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
GetProcessInfoOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DebugAgentGetProcessInfoRequest,
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::<DebugAgentGetProcessInfoRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DebugAgentGetProcessInfoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
options: fidl::new_empty!(
GetProcessInfoOptions,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>>,
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,
});
}
fidl::decode!(
GetProcessInfoOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProcessInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DebugAgentAttachToResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DebugAgentAttachToResponse {
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<DebugAgentAttachToResponse, D> for &DebugAgentAttachToResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DebugAgentAttachToResponse)
.write_unaligned((self as *const DebugAgentAttachToResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DebugAgentAttachToResponse, 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::<DebugAgentAttachToResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DebugAgentAttachToResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { num_matches: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Filter {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Filter {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Filter, D> for &Filter {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Filter>(offset);
fidl::encoding::Encode::<Filter, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.pattern,
),
<FilterType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<FilterOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<FilterType, D>,
T2: fidl::encoding::Encode<FilterOptions, D>,
> fidl::encoding::Encode<Filter, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Filter>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(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)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Filter {
#[inline(always)]
fn new_empty() -> Self {
Self {
pattern: fidl::new_empty!(fidl::encoding::UnboundedString, D),
type_: fidl::new_empty!(FilterType, D),
options: fidl::new_empty!(FilterOptions, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.pattern,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(FilterType, D, &mut self.type_, decoder, offset + 16, _depth)?;
fidl::decode!(FilterOptions, D, &mut self.options, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherGetAgentsRequest {
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 LauncherGetAgentsRequest {
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<
LauncherGetAgentsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherGetAgentsRequest
{
#[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::<LauncherGetAgentsRequest>(offset);
fidl::encoding::Encode::<LauncherGetAgentsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AgentIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AgentIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherGetAgentsRequest,
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::<LauncherGetAgentsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherGetAgentsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AgentIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AgentIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherLaunchRequest {
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 LauncherLaunchRequest {
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<LauncherLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut LauncherLaunchRequest
{
#[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::<LauncherLaunchRequest>(offset);
fidl::encoding::Encode::<LauncherLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugAgentMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.agent),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugAgentMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<LauncherLaunchRequest, 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::<LauncherLaunchRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherLaunchRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
agent: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugAgentMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugAgentMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.agent,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for MinidumpIteratorGetNextResponse {
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 MinidumpIteratorGetNextResponse {
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<
MinidumpIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut MinidumpIteratorGetNextResponse
{
#[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::<MinidumpIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<
MinidumpIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.minidump
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
MinidumpIteratorGetNextResponse,
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::<MinidumpIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for MinidumpIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
minidump: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.minidump, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProcessInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProcessInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProcessInfo, D>
for &ProcessInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProcessInfo>(offset);
fidl::encoding::Encode::<ProcessInfo, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.process),
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.thread),
<ThreadDetails as fidl::encoding::ValueTypeMarker>::borrow(&self.details),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T2: fidl::encoding::Encode<u64, D>,
T3: fidl::encoding::Encode<ThreadDetails, D>,
> fidl::encoding::Encode<ProcessInfo, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProcessInfo>(offset);
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 + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
process: fidl::new_empty!(u64, D),
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
thread: fidl::new_empty!(u64, D),
details: fidl::new_empty!(ThreadDetails, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u64, D, &mut self.process, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(u64, D, &mut self.thread, decoder, offset + 24, _depth)?;
fidl::decode!(ThreadDetails, D, &mut self.details, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProcessInfoIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProcessInfoIteratorGetNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D>
for &ProcessInfoIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<ProcessInfoIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<ProcessInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ProcessInfo>, D>,
> fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, 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::<ProcessInfoIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProcessInfoIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(fidl::encoding::UnboundedVector<ProcessInfo>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<ProcessInfo>,
D,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl DebugAgentOnFatalExceptionRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.backtrace {
return 2;
}
if let Some(_) = self.thread {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DebugAgentOnFatalExceptionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DebugAgentOnFatalExceptionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DebugAgentOnFatalExceptionRequest, D>
for &DebugAgentOnFatalExceptionRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DebugAgentOnFatalExceptionRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.thread.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.backtrace.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DebugAgentOnFatalExceptionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.thread.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.backtrace
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl FilterOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.job_only {
return 2;
}
if let Some(_) = self.recursive {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for FilterOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FilterOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilterOptions, D>
for &FilterOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FilterOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.recursive.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.job_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.recursive.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.job_only.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl GetProcessInfoOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.interest {
return 2;
}
if let Some(_) = self.filter {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for GetProcessInfoOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GetProcessInfoOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetProcessInfoOptions, D>
for &GetProcessInfoOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetProcessInfoOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Filter, D>(
self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<ThreadDetailsInterest, D>(
self.interest
.as_ref()
.map(<ThreadDetailsInterest as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetProcessInfoOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<ThreadDetailsInterest as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.interest.get_or_insert_with(|| fidl::new_empty!(ThreadDetailsInterest, D));
fidl::decode!(
ThreadDetailsInterest,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MinidumpOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.filter {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MinidumpOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MinidumpOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MinidumpOptions, D>
for &MinidumpOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MinidumpOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Filter, D>(
self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ThreadDetails {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.backtrace {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ThreadDetails {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ThreadDetails {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetails, D>
for &ThreadDetails
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ThreadDetails>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.backtrace.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetails {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.backtrace
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ThreadDetailsInterest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.backtrace {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ThreadDetailsInterest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ThreadDetailsInterest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetailsInterest, D>
for &ThreadDetailsInterest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ThreadDetailsInterest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.backtrace.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetailsInterest {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.backtrace.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}