#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const VMO_MAP_READONLY_RIGHTS: fidl::Rights = fidl::Rights::from_bits_truncate(49255);
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RegistryRegisterV1Request {
pub process: fidl::Process,
pub allocations_vmo: fidl::Vmo,
pub resources_vmo: fidl::Vmo,
pub snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RegistryRegisterV1Request {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SnapshotSinkV1StoreNamedSnapshotRequest {
pub snapshot_name: String,
pub allocations_vmo_snapshot: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SnapshotSinkV1StoreNamedSnapshotRequest
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RegistryMarker;
impl fidl::endpoints::ProtocolMarker for RegistryMarker {
type Proxy = RegistryProxy;
type RequestStream = RegistryRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RegistrySynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.memory.heapdump.process.Registry";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RegistryMarker {}
pub trait RegistryProxyInterface: Send + Sync {
fn r#register_v1(
&self,
process: fidl::Process,
allocations_vmo: fidl::Vmo,
resources_vmo: fidl::Vmo,
snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RegistrySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RegistrySynchronousProxy {
type Proxy = RegistryProxy;
type Protocol = RegistryMarker;
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 RegistrySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RegistryMarker 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<RegistryEvent, fidl::Error> {
RegistryEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#register_v1(
&self,
mut process: fidl::Process,
mut allocations_vmo: fidl::Vmo,
mut resources_vmo: fidl::Vmo,
mut snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<RegistryRegisterV1Request>(
(process, allocations_vmo, resources_vmo, snapshot_sink),
0x68626342c5d1afce,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct RegistryProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RegistryProxy {
type Protocol = RegistryMarker;
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 RegistryProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RegistryEventStream {
RegistryEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#register_v1(
&self,
mut process: fidl::Process,
mut allocations_vmo: fidl::Vmo,
mut resources_vmo: fidl::Vmo,
mut snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
) -> Result<(), fidl::Error> {
RegistryProxyInterface::r#register_v1(
self,
process,
allocations_vmo,
resources_vmo,
snapshot_sink,
)
}
}
impl RegistryProxyInterface for RegistryProxy {
fn r#register_v1(
&self,
mut process: fidl::Process,
mut allocations_vmo: fidl::Vmo,
mut resources_vmo: fidl::Vmo,
mut snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
) -> Result<(), fidl::Error> {
self.client.send::<RegistryRegisterV1Request>(
(process, allocations_vmo, resources_vmo, snapshot_sink),
0x68626342c5d1afce,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct RegistryEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RegistryEventStream {}
impl futures::stream::FusedStream for RegistryEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RegistryEventStream {
type Item = Result<RegistryEvent, 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(RegistryEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RegistryEvent {}
impl RegistryEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RegistryEvent, 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: <RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RegistryRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RegistryRequestStream {}
impl futures::stream::FusedStream for RegistryRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RegistryRequestStream {
type Protocol = RegistryMarker;
type ControlHandle = RegistryControlHandle;
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 {
RegistryControlHandle { 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 RegistryRequestStream {
type Item = Result<RegistryRequest, 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 RegistryRequestStream 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 {
0x68626342c5d1afce => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
RegistryRegisterV1Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RegistryRegisterV1Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RegistryControlHandle { inner: this.inner.clone() };
Ok(RegistryRequest::RegisterV1 {
process: req.process,
allocations_vmo: req.allocations_vmo,
resources_vmo: req.resources_vmo,
snapshot_sink: req.snapshot_sink,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RegistryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RegistryRequest {
RegisterV1 {
process: fidl::Process,
allocations_vmo: fidl::Vmo,
resources_vmo: fidl::Vmo,
snapshot_sink: fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
control_handle: RegistryControlHandle,
},
}
impl RegistryRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_register_v1(
self,
) -> Option<(
fidl::Process,
fidl::Vmo,
fidl::Vmo,
fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>,
RegistryControlHandle,
)> {
if let RegistryRequest::RegisterV1 {
process,
allocations_vmo,
resources_vmo,
snapshot_sink,
control_handle,
} = self
{
Some((process, allocations_vmo, resources_vmo, snapshot_sink, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RegistryRequest::RegisterV1 { .. } => "register_v1",
}
}
}
#[derive(Debug, Clone)]
pub struct RegistryControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RegistryControlHandle {
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 RegistryControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SnapshotSinkV1Marker;
impl fidl::endpoints::ProtocolMarker for SnapshotSinkV1Marker {
type Proxy = SnapshotSinkV1Proxy;
type RequestStream = SnapshotSinkV1RequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SnapshotSinkV1SynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) SnapshotSinkV1";
}
pub trait SnapshotSinkV1ProxyInterface: Send + Sync {
fn r#store_named_snapshot(
&self,
snapshot_name: &str,
allocations_vmo_snapshot: fidl::Vmo,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SnapshotSinkV1SynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SnapshotSinkV1SynchronousProxy {
type Proxy = SnapshotSinkV1Proxy;
type Protocol = SnapshotSinkV1Marker;
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 SnapshotSinkV1SynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SnapshotSinkV1Marker 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<SnapshotSinkV1Event, fidl::Error> {
SnapshotSinkV1Event::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#store_named_snapshot(
&self,
mut snapshot_name: &str,
mut allocations_vmo_snapshot: fidl::Vmo,
) -> Result<(), fidl::Error> {
self.client.send::<SnapshotSinkV1StoreNamedSnapshotRequest>(
(snapshot_name, allocations_vmo_snapshot),
0x356eaec66aabbea5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SnapshotSinkV1Proxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SnapshotSinkV1Proxy {
type Protocol = SnapshotSinkV1Marker;
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 SnapshotSinkV1Proxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SnapshotSinkV1Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SnapshotSinkV1EventStream {
SnapshotSinkV1EventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#store_named_snapshot(
&self,
mut snapshot_name: &str,
mut allocations_vmo_snapshot: fidl::Vmo,
) -> Result<(), fidl::Error> {
SnapshotSinkV1ProxyInterface::r#store_named_snapshot(
self,
snapshot_name,
allocations_vmo_snapshot,
)
}
}
impl SnapshotSinkV1ProxyInterface for SnapshotSinkV1Proxy {
fn r#store_named_snapshot(
&self,
mut snapshot_name: &str,
mut allocations_vmo_snapshot: fidl::Vmo,
) -> Result<(), fidl::Error> {
self.client.send::<SnapshotSinkV1StoreNamedSnapshotRequest>(
(snapshot_name, allocations_vmo_snapshot),
0x356eaec66aabbea5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SnapshotSinkV1EventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SnapshotSinkV1EventStream {}
impl futures::stream::FusedStream for SnapshotSinkV1EventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SnapshotSinkV1EventStream {
type Item = Result<SnapshotSinkV1Event, 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(SnapshotSinkV1Event::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SnapshotSinkV1Event {}
impl SnapshotSinkV1Event {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SnapshotSinkV1Event, 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:
<SnapshotSinkV1Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SnapshotSinkV1RequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SnapshotSinkV1RequestStream {}
impl futures::stream::FusedStream for SnapshotSinkV1RequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SnapshotSinkV1RequestStream {
type Protocol = SnapshotSinkV1Marker;
type ControlHandle = SnapshotSinkV1ControlHandle;
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 {
SnapshotSinkV1ControlHandle { 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 SnapshotSinkV1RequestStream {
type Item = Result<SnapshotSinkV1Request, 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 SnapshotSinkV1RequestStream 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 {
0x356eaec66aabbea5 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SnapshotSinkV1StoreNamedSnapshotRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SnapshotSinkV1StoreNamedSnapshotRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
SnapshotSinkV1ControlHandle { inner: this.inner.clone() };
Ok(SnapshotSinkV1Request::StoreNamedSnapshot {
snapshot_name: req.snapshot_name,
allocations_vmo_snapshot: req.allocations_vmo_snapshot,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SnapshotSinkV1Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SnapshotSinkV1Request {
StoreNamedSnapshot {
snapshot_name: String,
allocations_vmo_snapshot: fidl::Vmo,
control_handle: SnapshotSinkV1ControlHandle,
},
}
impl SnapshotSinkV1Request {
#[allow(irrefutable_let_patterns)]
pub fn into_store_named_snapshot(
self,
) -> Option<(String, fidl::Vmo, SnapshotSinkV1ControlHandle)> {
if let SnapshotSinkV1Request::StoreNamedSnapshot {
snapshot_name,
allocations_vmo_snapshot,
control_handle,
} = self
{
Some((snapshot_name, allocations_vmo_snapshot, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SnapshotSinkV1Request::StoreNamedSnapshot { .. } => "store_named_snapshot",
}
}
}
#[derive(Debug, Clone)]
pub struct SnapshotSinkV1ControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SnapshotSinkV1ControlHandle {
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 SnapshotSinkV1ControlHandle {}
mod internal {
use super::*;
impl fidl::encoding::ResourceTypeMarker for RegistryRegisterV1Request {
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 RegistryRegisterV1Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
RegistryRegisterV1Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RegistryRegisterV1Request
{
#[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::<RegistryRegisterV1Request>(offset);
fidl::encoding::Encode::<RegistryRegisterV1Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 49231> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.process),
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.allocations_vmo),
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resources_vmo),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.snapshot_sink),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.into_raw() },
49231,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RegistryRegisterV1Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RegistryRegisterV1Request>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RegistryRegisterV1Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
process: fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 49231>, fidl::encoding::DefaultFuchsiaResourceDialect),
allocations_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, fidl::encoding::DefaultFuchsiaResourceDialect),
resources_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, fidl::encoding::DefaultFuchsiaResourceDialect),
snapshot_sink: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>>,
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::Process, { fidl::ObjectType::PROCESS.into_raw() }, 49231>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.process, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.allocations_vmo, decoder, offset + 4, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resources_vmo, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SnapshotSinkV1Marker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.snapshot_sink,
decoder,
offset + 12,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SnapshotSinkV1StoreNamedSnapshotRequest {
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 SnapshotSinkV1StoreNamedSnapshotRequest {
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<
SnapshotSinkV1StoreNamedSnapshotRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SnapshotSinkV1StoreNamedSnapshotRequest
{
#[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::<SnapshotSinkV1StoreNamedSnapshotRequest>(offset);
fidl::encoding::Encode::<
SnapshotSinkV1StoreNamedSnapshotRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.snapshot_name,
),
<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
49255,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.allocations_vmo_snapshot,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SnapshotSinkV1StoreNamedSnapshotRequest,
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::<SnapshotSinkV1StoreNamedSnapshotRequest>(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 SnapshotSinkV1StoreNamedSnapshotRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
snapshot_name: fidl::new_empty!(
fidl::encoding::BoundedString<32>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
allocations_vmo_snapshot: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, 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<32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.snapshot_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.allocations_vmo_snapshot, decoder, offset + 16, _depth)?;
Ok(())
}
}
}