#![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)]
#[repr(u32)]
pub enum HealthStatus {
Healthy = 1,
Unhealthy = 2,
}
impl HealthStatus {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Healthy),
2 => Some(Self::Unhealthy),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum VerifyError {
Internal,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! VerifyErrorUnknown {
() => {
_
};
}
impl VerifyError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
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::Internal => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ComponentOtaHealthCheckGetHealthStatusResponse {
pub health_status: HealthStatus,
}
impl fidl::Persistable for ComponentOtaHealthCheckGetHealthStatusResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct HealthVerificationQueryHealthChecksResponse {
pub status: i32,
}
impl fidl::Persistable for HealthVerificationQueryHealthChecksResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct VerifierVerifyRequest {
pub options: VerifyOptions,
}
impl fidl::Persistable for VerifierVerifyRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct VerifyOptions {
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for VerifyOptions {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobfsVerifierMarker;
impl fidl::endpoints::ProtocolMarker for BlobfsVerifierMarker {
type Proxy = BlobfsVerifierProxy;
type RequestStream = BlobfsVerifierRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobfsVerifierSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.update.verify.BlobfsVerifier";
}
impl fidl::endpoints::DiscoverableProtocolMarker for BlobfsVerifierMarker {}
pub trait BlobfsVerifierProxyInterface: Send + Sync {
type VerifyResponseFut: std::future::Future<Output = Result<VerifierVerifyResult, fidl::Error>>
+ Send;
fn r#verify(&self, options: &VerifyOptions) -> Self::VerifyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobfsVerifierSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobfsVerifierSynchronousProxy {
type Proxy = BlobfsVerifierProxy;
type Protocol = BlobfsVerifierMarker;
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 BlobfsVerifierSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobfsVerifierMarker 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<BlobfsVerifierEvent, fidl::Error> {
BlobfsVerifierEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
___deadline: zx::MonotonicInstant,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = self.client.send_query::<
VerifierVerifyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct BlobfsVerifierProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobfsVerifierProxy {
type Protocol = BlobfsVerifierMarker;
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 BlobfsVerifierProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobfsVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobfsVerifierEventStream {
BlobfsVerifierEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
) -> fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BlobfsVerifierProxyInterface::r#verify(self, options)
}
}
impl BlobfsVerifierProxyInterface for BlobfsVerifierProxy {
type VerifyResponseFut = fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#verify(&self, mut options: &VerifyOptions) -> Self::VerifyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7d89f7b04929049e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VerifierVerifyRequest, VerifierVerifyResult>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobfsVerifierEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobfsVerifierEventStream {}
impl futures::stream::FusedStream for BlobfsVerifierEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobfsVerifierEventStream {
type Item = Result<BlobfsVerifierEvent, 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(BlobfsVerifierEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobfsVerifierEvent {}
impl BlobfsVerifierEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobfsVerifierEvent, 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:
<BlobfsVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobfsVerifierRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobfsVerifierRequestStream {}
impl futures::stream::FusedStream for BlobfsVerifierRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobfsVerifierRequestStream {
type Protocol = BlobfsVerifierMarker;
type ControlHandle = BlobfsVerifierControlHandle;
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 {
BlobfsVerifierControlHandle { 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 BlobfsVerifierRequestStream {
type Item = Result<BlobfsVerifierRequest, 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 BlobfsVerifierRequestStream 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 {
0x7d89f7b04929049e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VerifierVerifyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VerifierVerifyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BlobfsVerifierControlHandle { inner: this.inner.clone() };
Ok(BlobfsVerifierRequest::Verify {
options: req.options,
responder: BlobfsVerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobfsVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobfsVerifierRequest {
Verify { options: VerifyOptions, responder: BlobfsVerifierVerifyResponder },
}
impl BlobfsVerifierRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_verify(self) -> Option<(VerifyOptions, BlobfsVerifierVerifyResponder)> {
if let BlobfsVerifierRequest::Verify { options, responder } = self {
Some((options, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobfsVerifierRequest::Verify { .. } => "verify",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobfsVerifierControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobfsVerifierControlHandle {
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 BlobfsVerifierControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobfsVerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop<BlobfsVerifierControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobfsVerifierVerifyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobfsVerifierVerifyResponder {
type ControlHandle = BlobfsVerifierControlHandle;
fn control_handle(&self) -> &BlobfsVerifierControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobfsVerifierVerifyResponder {
pub fn send(self, mut result: Result<(), VerifyError>) -> 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<(), VerifyError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), VerifyError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
VerifyError,
>>(
result,
self.tx_id,
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ComponentOtaHealthCheckMarker;
impl fidl::endpoints::ProtocolMarker for ComponentOtaHealthCheckMarker {
type Proxy = ComponentOtaHealthCheckProxy;
type RequestStream = ComponentOtaHealthCheckRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ComponentOtaHealthCheckSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.update.verify.ComponentOtaHealthCheck";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ComponentOtaHealthCheckMarker {}
pub trait ComponentOtaHealthCheckProxyInterface: Send + Sync {
type GetHealthStatusResponseFut: std::future::Future<Output = Result<HealthStatus, fidl::Error>>
+ Send;
fn r#get_health_status(&self) -> Self::GetHealthStatusResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ComponentOtaHealthCheckSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ComponentOtaHealthCheckSynchronousProxy {
type Proxy = ComponentOtaHealthCheckProxy;
type Protocol = ComponentOtaHealthCheckMarker;
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 ComponentOtaHealthCheckSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ComponentOtaHealthCheckMarker 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<ComponentOtaHealthCheckEvent, fidl::Error> {
ComponentOtaHealthCheckEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_status(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthStatus, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
ComponentOtaHealthCheckGetHealthStatusResponse,
>(
(),
0x4a0bab1f2132f9ee,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.health_status)
}
}
#[derive(Debug, Clone)]
pub struct ComponentOtaHealthCheckProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ComponentOtaHealthCheckProxy {
type Protocol = ComponentOtaHealthCheckMarker;
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 ComponentOtaHealthCheckProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<ComponentOtaHealthCheckMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ComponentOtaHealthCheckEventStream {
ComponentOtaHealthCheckEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_status(
&self,
) -> fidl::client::QueryResponseFut<HealthStatus, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ComponentOtaHealthCheckProxyInterface::r#get_health_status(self)
}
}
impl ComponentOtaHealthCheckProxyInterface for ComponentOtaHealthCheckProxy {
type GetHealthStatusResponseFut =
fidl::client::QueryResponseFut<HealthStatus, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_status(&self) -> Self::GetHealthStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthStatus, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ComponentOtaHealthCheckGetHealthStatusResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a0bab1f2132f9ee,
>(_buf?)?;
Ok(_response.health_status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthStatus>(
(),
0x4a0bab1f2132f9ee,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ComponentOtaHealthCheckEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ComponentOtaHealthCheckEventStream {}
impl futures::stream::FusedStream for ComponentOtaHealthCheckEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ComponentOtaHealthCheckEventStream {
type Item = Result<ComponentOtaHealthCheckEvent, 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(ComponentOtaHealthCheckEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ComponentOtaHealthCheckEvent {}
impl ComponentOtaHealthCheckEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ComponentOtaHealthCheckEvent, 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:
<ComponentOtaHealthCheckMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ComponentOtaHealthCheckRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ComponentOtaHealthCheckRequestStream {}
impl futures::stream::FusedStream for ComponentOtaHealthCheckRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ComponentOtaHealthCheckRequestStream {
type Protocol = ComponentOtaHealthCheckMarker;
type ControlHandle = ComponentOtaHealthCheckControlHandle;
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 {
ComponentOtaHealthCheckControlHandle { 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 ComponentOtaHealthCheckRequestStream {
type Item = Result<ComponentOtaHealthCheckRequest, 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 ComponentOtaHealthCheckRequestStream 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 {
0x4a0bab1f2132f9ee => {
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 = ComponentOtaHealthCheckControlHandle {
inner: this.inner.clone(),
};
Ok(ComponentOtaHealthCheckRequest::GetHealthStatus {
responder: ComponentOtaHealthCheckGetHealthStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ComponentOtaHealthCheckMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ComponentOtaHealthCheckRequest {
GetHealthStatus { responder: ComponentOtaHealthCheckGetHealthStatusResponder },
}
impl ComponentOtaHealthCheckRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_status(
self,
) -> Option<(ComponentOtaHealthCheckGetHealthStatusResponder)> {
if let ComponentOtaHealthCheckRequest::GetHealthStatus { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ComponentOtaHealthCheckRequest::GetHealthStatus { .. } => "get_health_status",
}
}
}
#[derive(Debug, Clone)]
pub struct ComponentOtaHealthCheckControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ComponentOtaHealthCheckControlHandle {
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 ComponentOtaHealthCheckControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ComponentOtaHealthCheckGetHealthStatusResponder {
control_handle: std::mem::ManuallyDrop<ComponentOtaHealthCheckControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ComponentOtaHealthCheckGetHealthStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ComponentOtaHealthCheckGetHealthStatusResponder {
type ControlHandle = ComponentOtaHealthCheckControlHandle;
fn control_handle(&self) -> &ComponentOtaHealthCheckControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ComponentOtaHealthCheckGetHealthStatusResponder {
pub fn send(self, mut health_status: HealthStatus) -> Result<(), fidl::Error> {
let _result = self.send_raw(health_status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut health_status: HealthStatus,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(health_status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut health_status: HealthStatus) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ComponentOtaHealthCheckGetHealthStatusResponse>(
(health_status,),
self.tx_id,
0x4a0bab1f2132f9ee,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct HealthVerificationMarker;
impl fidl::endpoints::ProtocolMarker for HealthVerificationMarker {
type Proxy = HealthVerificationProxy;
type RequestStream = HealthVerificationRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = HealthVerificationSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.update.verify.HealthVerification";
}
impl fidl::endpoints::DiscoverableProtocolMarker for HealthVerificationMarker {}
pub trait HealthVerificationProxyInterface: Send + Sync {
type QueryHealthChecksResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#query_health_checks(&self) -> Self::QueryHealthChecksResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct HealthVerificationSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for HealthVerificationSynchronousProxy {
type Proxy = HealthVerificationProxy;
type Protocol = HealthVerificationMarker;
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 HealthVerificationSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<HealthVerificationMarker 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<HealthVerificationEvent, fidl::Error> {
HealthVerificationEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#query_health_checks(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
HealthVerificationQueryHealthChecksResponse,
>(
(),
0x372e04d635be9532,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct HealthVerificationProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for HealthVerificationProxy {
type Protocol = HealthVerificationMarker;
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 HealthVerificationProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<HealthVerificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> HealthVerificationEventStream {
HealthVerificationEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#query_health_checks(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
HealthVerificationProxyInterface::r#query_health_checks(self)
}
}
impl HealthVerificationProxyInterface for HealthVerificationProxy {
type QueryHealthChecksResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query_health_checks(&self) -> Self::QueryHealthChecksResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthVerificationQueryHealthChecksResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x372e04d635be9532,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x372e04d635be9532,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct HealthVerificationEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for HealthVerificationEventStream {}
impl futures::stream::FusedStream for HealthVerificationEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for HealthVerificationEventStream {
type Item = Result<HealthVerificationEvent, 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(HealthVerificationEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum HealthVerificationEvent {}
impl HealthVerificationEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<HealthVerificationEvent, 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:
<HealthVerificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct HealthVerificationRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for HealthVerificationRequestStream {}
impl futures::stream::FusedStream for HealthVerificationRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for HealthVerificationRequestStream {
type Protocol = HealthVerificationMarker;
type ControlHandle = HealthVerificationControlHandle;
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 {
HealthVerificationControlHandle { 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 HealthVerificationRequestStream {
type Item = Result<HealthVerificationRequest, 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 HealthVerificationRequestStream 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 {
0x372e04d635be9532 => {
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 = HealthVerificationControlHandle {
inner: this.inner.clone(),
};
Ok(HealthVerificationRequest::QueryHealthChecks {
responder: HealthVerificationQueryHealthChecksResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <HealthVerificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum HealthVerificationRequest {
QueryHealthChecks { responder: HealthVerificationQueryHealthChecksResponder },
}
impl HealthVerificationRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_query_health_checks(
self,
) -> Option<(HealthVerificationQueryHealthChecksResponder)> {
if let HealthVerificationRequest::QueryHealthChecks { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
HealthVerificationRequest::QueryHealthChecks { .. } => "query_health_checks",
}
}
}
#[derive(Debug, Clone)]
pub struct HealthVerificationControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for HealthVerificationControlHandle {
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 HealthVerificationControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct HealthVerificationQueryHealthChecksResponder {
control_handle: std::mem::ManuallyDrop<HealthVerificationControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for HealthVerificationQueryHealthChecksResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for HealthVerificationQueryHealthChecksResponder {
type ControlHandle = HealthVerificationControlHandle;
fn control_handle(&self) -> &HealthVerificationControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl HealthVerificationQueryHealthChecksResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthVerificationQueryHealthChecksResponse>(
(status,),
self.tx_id,
0x372e04d635be9532,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct NetstackVerifierMarker;
impl fidl::endpoints::ProtocolMarker for NetstackVerifierMarker {
type Proxy = NetstackVerifierProxy;
type RequestStream = NetstackVerifierRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = NetstackVerifierSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.update.verify.NetstackVerifier";
}
impl fidl::endpoints::DiscoverableProtocolMarker for NetstackVerifierMarker {}
pub trait NetstackVerifierProxyInterface: Send + Sync {
type VerifyResponseFut: std::future::Future<Output = Result<VerifierVerifyResult, fidl::Error>>
+ Send;
fn r#verify(&self, options: &VerifyOptions) -> Self::VerifyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct NetstackVerifierSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for NetstackVerifierSynchronousProxy {
type Proxy = NetstackVerifierProxy;
type Protocol = NetstackVerifierMarker;
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 NetstackVerifierSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <NetstackVerifierMarker 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<NetstackVerifierEvent, fidl::Error> {
NetstackVerifierEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
___deadline: zx::MonotonicInstant,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = self.client.send_query::<
VerifierVerifyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct NetstackVerifierProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for NetstackVerifierProxy {
type Protocol = NetstackVerifierMarker;
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 NetstackVerifierProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <NetstackVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> NetstackVerifierEventStream {
NetstackVerifierEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
) -> fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NetstackVerifierProxyInterface::r#verify(self, options)
}
}
impl NetstackVerifierProxyInterface for NetstackVerifierProxy {
type VerifyResponseFut = fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#verify(&self, mut options: &VerifyOptions) -> Self::VerifyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7d89f7b04929049e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VerifierVerifyRequest, VerifierVerifyResult>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct NetstackVerifierEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for NetstackVerifierEventStream {}
impl futures::stream::FusedStream for NetstackVerifierEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for NetstackVerifierEventStream {
type Item = Result<NetstackVerifierEvent, 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(NetstackVerifierEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum NetstackVerifierEvent {}
impl NetstackVerifierEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<NetstackVerifierEvent, 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:
<NetstackVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct NetstackVerifierRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for NetstackVerifierRequestStream {}
impl futures::stream::FusedStream for NetstackVerifierRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for NetstackVerifierRequestStream {
type Protocol = NetstackVerifierMarker;
type ControlHandle = NetstackVerifierControlHandle;
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 {
NetstackVerifierControlHandle { 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 NetstackVerifierRequestStream {
type Item = Result<NetstackVerifierRequest, 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 NetstackVerifierRequestStream 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 {
0x7d89f7b04929049e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VerifierVerifyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VerifierVerifyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
NetstackVerifierControlHandle { inner: this.inner.clone() };
Ok(NetstackVerifierRequest::Verify {
options: req.options,
responder: NetstackVerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<NetstackVerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum NetstackVerifierRequest {
Verify { options: VerifyOptions, responder: NetstackVerifierVerifyResponder },
}
impl NetstackVerifierRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_verify(self) -> Option<(VerifyOptions, NetstackVerifierVerifyResponder)> {
if let NetstackVerifierRequest::Verify { options, responder } = self {
Some((options, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
NetstackVerifierRequest::Verify { .. } => "verify",
}
}
}
#[derive(Debug, Clone)]
pub struct NetstackVerifierControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for NetstackVerifierControlHandle {
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 NetstackVerifierControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NetstackVerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop<NetstackVerifierControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NetstackVerifierVerifyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NetstackVerifierVerifyResponder {
type ControlHandle = NetstackVerifierControlHandle;
fn control_handle(&self) -> &NetstackVerifierControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NetstackVerifierVerifyResponder {
pub fn send(self, mut result: Result<(), VerifyError>) -> 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<(), VerifyError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), VerifyError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
VerifyError,
>>(
result,
self.tx_id,
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VerifierMarker;
impl fidl::endpoints::ProtocolMarker for VerifierMarker {
type Proxy = VerifierProxy;
type RequestStream = VerifierRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VerifierSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Verifier";
}
pub type VerifierVerifyResult = Result<(), VerifyError>;
pub trait VerifierProxyInterface: Send + Sync {
type VerifyResponseFut: std::future::Future<Output = Result<VerifierVerifyResult, fidl::Error>>
+ Send;
fn r#verify(&self, options: &VerifyOptions) -> Self::VerifyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VerifierSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VerifierSynchronousProxy {
type Proxy = VerifierProxy;
type Protocol = VerifierMarker;
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 VerifierSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VerifierMarker 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<VerifierEvent, fidl::Error> {
VerifierEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
___deadline: zx::MonotonicInstant,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = self.client.send_query::<
VerifierVerifyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct VerifierProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for VerifierProxy {
type Protocol = VerifierMarker;
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 VerifierProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <VerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VerifierEventStream {
VerifierEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#verify(
&self,
mut options: &VerifyOptions,
) -> fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VerifierProxyInterface::r#verify(self, options)
}
}
impl VerifierProxyInterface for VerifierProxy {
type VerifyResponseFut = fidl::client::QueryResponseFut<
VerifierVerifyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#verify(&self, mut options: &VerifyOptions) -> Self::VerifyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<VerifierVerifyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, VerifyError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7d89f7b04929049e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VerifierVerifyRequest, VerifierVerifyResult>(
(options,),
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VerifierEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for VerifierEventStream {}
impl futures::stream::FusedStream for VerifierEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VerifierEventStream {
type Item = Result<VerifierEvent, 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(VerifierEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VerifierEvent {}
impl VerifierEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<VerifierEvent, 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: <VerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VerifierRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for VerifierRequestStream {}
impl futures::stream::FusedStream for VerifierRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VerifierRequestStream {
type Protocol = VerifierMarker;
type ControlHandle = VerifierControlHandle;
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 {
VerifierControlHandle { 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 VerifierRequestStream {
type Item = Result<VerifierRequest, 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 VerifierRequestStream 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 {
0x7d89f7b04929049e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VerifierVerifyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VerifierVerifyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VerifierControlHandle { inner: this.inner.clone() };
Ok(VerifierRequest::Verify {
options: req.options,
responder: VerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<VerifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum VerifierRequest {
Verify { options: VerifyOptions, responder: VerifierVerifyResponder },
}
impl VerifierRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_verify(self) -> Option<(VerifyOptions, VerifierVerifyResponder)> {
if let VerifierRequest::Verify { options, responder } = self {
Some((options, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VerifierRequest::Verify { .. } => "verify",
}
}
}
#[derive(Debug, Clone)]
pub struct VerifierControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for VerifierControlHandle {
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 VerifierControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VerifierVerifyResponder {
control_handle: std::mem::ManuallyDrop<VerifierControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VerifierVerifyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VerifierVerifyResponder {
type ControlHandle = VerifierControlHandle;
fn control_handle(&self) -> &VerifierControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VerifierVerifyResponder {
pub fn send(self, mut result: Result<(), VerifyError>) -> 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<(), VerifyError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), VerifyError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
VerifyError,
>>(
result,
self.tx_id,
0x7d89f7b04929049e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for HealthStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for HealthStatus {
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 HealthStatus {
#[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 HealthStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::Healthy
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for VerifyError {
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 VerifyError {
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 VerifyError {
#[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 VerifyError {
#[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::ValueTypeMarker for ComponentOtaHealthCheckGetHealthStatusResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ComponentOtaHealthCheckGetHealthStatusResponse {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ComponentOtaHealthCheckGetHealthStatusResponse, D>
for &ComponentOtaHealthCheckGetHealthStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ComponentOtaHealthCheckGetHealthStatusResponse>(offset);
fidl::encoding::Encode::<ComponentOtaHealthCheckGetHealthStatusResponse, D>::encode(
(<HealthStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.health_status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HealthStatus, D>>
fidl::encoding::Encode<ComponentOtaHealthCheckGetHealthStatusResponse, 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::<ComponentOtaHealthCheckGetHealthStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ComponentOtaHealthCheckGetHealthStatusResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { health_status: fidl::new_empty!(HealthStatus, 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!(HealthStatus, D, &mut self.health_status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HealthVerificationQueryHealthChecksResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HealthVerificationQueryHealthChecksResponse {
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<HealthVerificationQueryHealthChecksResponse, D>
for &HealthVerificationQueryHealthChecksResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HealthVerificationQueryHealthChecksResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut HealthVerificationQueryHealthChecksResponse).write_unaligned(
(self as *const HealthVerificationQueryHealthChecksResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<HealthVerificationQueryHealthChecksResponse, 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::<HealthVerificationQueryHealthChecksResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for HealthVerificationQueryHealthChecksResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VerifierVerifyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VerifierVerifyRequest {
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<VerifierVerifyRequest, D>
for &VerifierVerifyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VerifierVerifyRequest>(offset);
fidl::encoding::Encode::<VerifierVerifyRequest, D>::encode(
(<VerifyOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VerifyOptions, D>>
fidl::encoding::Encode<VerifierVerifyRequest, 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::<VerifierVerifyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VerifierVerifyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { options: fidl::new_empty!(VerifyOptions, 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!(VerifyOptions, D, &mut self.options, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl VerifyOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
0
}
}
impl fidl::encoding::ValueTypeMarker for VerifyOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VerifyOptions {
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<VerifyOptions, D>
for &VerifyOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VerifyOptions>(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;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VerifyOptions {
#[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;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}