#![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 CreateBlobError {
AlreadyExists = 1,
Internal = 2,
}
impl CreateBlobError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::AlreadyExists),
2 => Some(Self::Internal),
_ => 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 KeyPurpose {
Metadata,
Data,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! KeyPurposeUnknown {
() => {
_
};
}
impl KeyPurpose {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Metadata),
2 => Some(Self::Data),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Metadata,
2 => Self::Data,
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::Metadata => 1,
Self::Data => 2,
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 BlobCreatorCreateRequest {
pub hash: [u8; 32],
pub allow_existing: bool,
}
impl fidl::Persistable for BlobCreatorCreateRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BlobCreatorCreateResponse {
pub writer: fidl::endpoints::ClientEnd<BlobWriterMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobCreatorCreateResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlobReaderGetVmoRequest {
pub blob_hash: [u8; 32],
}
impl fidl::Persistable for BlobReaderGetVmoRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BlobReaderGetVmoResponse {
pub vmo: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobReaderGetVmoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlobWriterBytesReadyRequest {
pub bytes_written: u64,
}
impl fidl::Persistable for BlobWriterBytesReadyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlobWriterGetVmoRequest {
pub size: u64,
}
impl fidl::Persistable for BlobWriterGetVmoRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BlobWriterGetVmoResponse {
pub vmo: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriterGetVmoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BytesAndNodes {
pub bytes: u64,
pub nodes: u64,
}
impl fidl::Persistable for BytesAndNodes {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptCreateKeyRequest {
pub owner: u64,
pub purpose: KeyPurpose,
}
impl fidl::Persistable for CryptCreateKeyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CryptCreateKeyWithIdRequest {
pub owner: u64,
pub wrapping_key_id: [u8; 16],
}
impl fidl::Persistable for CryptCreateKeyWithIdRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptManagementAddWrappingKeyRequest {
pub wrapping_key_id: [u8; 16],
pub key: Vec<u8>,
}
impl fidl::Persistable for CryptManagementAddWrappingKeyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CryptManagementForgetWrappingKeyRequest {
pub wrapping_key_id: [u8; 16],
}
impl fidl::Persistable for CryptManagementForgetWrappingKeyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptManagementSetActiveKeyRequest {
pub purpose: KeyPurpose,
pub wrapping_key_id: [u8; 16],
}
impl fidl::Persistable for CryptManagementSetActiveKeyRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptUnwrapKeyRequest {
pub wrapping_key_id: [u8; 16],
pub owner: u64,
pub key: Vec<u8>,
}
impl fidl::Persistable for CryptUnwrapKeyRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptCreateKeyWithIdResponse {
pub wrapped_key: Vec<u8>,
pub unwrapped_key: Vec<u8>,
}
impl fidl::Persistable for CryptCreateKeyWithIdResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptCreateKeyResponse {
pub wrapping_key_id: [u8; 16],
pub wrapped_key: Vec<u8>,
pub unwrapped_key: Vec<u8>,
}
impl fidl::Persistable for CryptCreateKeyResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptUnwrapKeyResponse {
pub unwrapped_key: Vec<u8>,
}
impl fidl::Persistable for CryptUnwrapKeyResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DebugDeleteProfileRequest {
pub volume: String,
pub profile: String,
}
impl fidl::Persistable for DebugDeleteProfileRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdClearForNodeRequest {
pub node_id: u64,
}
impl fidl::Persistable for ProjectIdClearForNodeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdClearRequest {
pub project_id: u64,
}
impl fidl::Persistable for ProjectIdClearRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdGetForNodeRequest {
pub node_id: u64,
}
impl fidl::Persistable for ProjectIdGetForNodeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdInfoRequest {
pub project_id: u64,
}
impl fidl::Persistable for ProjectIdInfoRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProjectIdListRequest {
pub token: Option<Box<ProjectIterToken>>,
}
impl fidl::Persistable for ProjectIdListRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdSetForNodeRequest {
pub node_id: u64,
pub project_id: u64,
}
impl fidl::Persistable for ProjectIdSetForNodeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdSetLimitRequest {
pub project_id: u64,
pub bytes: u64,
pub nodes: u64,
}
impl fidl::Persistable for ProjectIdSetLimitRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdGetForNodeResponse {
pub project_id: u64,
}
impl fidl::Persistable for ProjectIdGetForNodeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIdInfoResponse {
pub limit: BytesAndNodes,
pub usage: BytesAndNodes,
}
impl fidl::Persistable for ProjectIdInfoResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProjectIdListResponse {
pub entries: Vec<u64>,
pub next_token: Option<Box<ProjectIterToken>>,
}
impl fidl::Persistable for ProjectIdListResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ProjectIterToken {
pub value: u64,
}
impl fidl::Persistable for ProjectIterToken {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CryptSettings {
pub active_data_wrapping_key_id: Option<[u8; 16]>,
pub active_metadata_wrapping_key_id: Option<[u8; 16]>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CryptSettings {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobCreatorMarker;
impl fidl::endpoints::ProtocolMarker for BlobCreatorMarker {
type Proxy = BlobCreatorProxy;
type RequestStream = BlobCreatorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobCreatorSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobCreator";
}
impl fidl::endpoints::DiscoverableProtocolMarker for BlobCreatorMarker {}
pub type BlobCreatorCreateResult =
Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>;
pub trait BlobCreatorProxyInterface: Send + Sync {
type CreateResponseFut: std::future::Future<Output = Result<BlobCreatorCreateResult, fidl::Error>>
+ Send;
fn r#create(&self, hash: &[u8; 32], allow_existing: bool) -> Self::CreateResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobCreatorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobCreatorSynchronousProxy {
type Proxy = BlobCreatorProxy;
type Protocol = BlobCreatorMarker;
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 BlobCreatorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobCreatorMarker 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<BlobCreatorEvent, fidl::Error> {
BlobCreatorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create(
&self,
mut hash: &[u8; 32],
mut allow_existing: bool,
___deadline: zx::MonotonicInstant,
) -> Result<BlobCreatorCreateResult, fidl::Error> {
let _response = self.client.send_query::<
BlobCreatorCreateRequest,
fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
>(
(hash, allow_existing,),
0x4288fe720cca70d7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.writer))
}
}
#[derive(Debug, Clone)]
pub struct BlobCreatorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobCreatorProxy {
type Protocol = BlobCreatorMarker;
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 BlobCreatorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobCreatorEventStream {
BlobCreatorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create(
&self,
mut hash: &[u8; 32],
mut allow_existing: bool,
) -> fidl::client::QueryResponseFut<
BlobCreatorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BlobCreatorProxyInterface::r#create(self, hash, allow_existing)
}
}
impl BlobCreatorProxyInterface for BlobCreatorProxy {
type CreateResponseFut = fidl::client::QueryResponseFut<
BlobCreatorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create(&self, mut hash: &[u8; 32], mut allow_existing: bool) -> Self::CreateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BlobCreatorCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4288fe720cca70d7,
>(_buf?)?;
Ok(_response.map(|x| x.writer))
}
self.client.send_query_and_decode::<BlobCreatorCreateRequest, BlobCreatorCreateResult>(
(hash, allow_existing),
0x4288fe720cca70d7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobCreatorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobCreatorEventStream {}
impl futures::stream::FusedStream for BlobCreatorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobCreatorEventStream {
type Item = Result<BlobCreatorEvent, 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(BlobCreatorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobCreatorEvent {}
impl BlobCreatorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobCreatorEvent, 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: <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobCreatorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobCreatorRequestStream {}
impl futures::stream::FusedStream for BlobCreatorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobCreatorRequestStream {
type Protocol = BlobCreatorMarker;
type ControlHandle = BlobCreatorControlHandle;
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 {
BlobCreatorControlHandle { 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 BlobCreatorRequestStream {
type Item = Result<BlobCreatorRequest, 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 BlobCreatorRequestStream 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 {
0x4288fe720cca70d7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BlobCreatorCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobCreatorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BlobCreatorControlHandle { inner: this.inner.clone() };
Ok(BlobCreatorRequest::Create {
hash: req.hash,
allow_existing: req.allow_existing,
responder: BlobCreatorCreateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobCreatorRequest {
Create { hash: [u8; 32], allow_existing: bool, responder: BlobCreatorCreateResponder },
}
impl BlobCreatorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create(self) -> Option<([u8; 32], bool, BlobCreatorCreateResponder)> {
if let BlobCreatorRequest::Create { hash, allow_existing, responder } = self {
Some((hash, allow_existing, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobCreatorRequest::Create { .. } => "create",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobCreatorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobCreatorControlHandle {
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 BlobCreatorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobCreatorCreateResponder {
control_handle: std::mem::ManuallyDrop<BlobCreatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobCreatorCreateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobCreatorCreateResponder {
type ControlHandle = BlobCreatorControlHandle;
fn control_handle(&self) -> &BlobCreatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobCreatorCreateResponder {
pub fn send(
self,
mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BlobCreatorCreateResponse,
CreateBlobError,
>>(
result.map(|writer| (writer,)),
self.tx_id,
0x4288fe720cca70d7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobReaderMarker;
impl fidl::endpoints::ProtocolMarker for BlobReaderMarker {
type Proxy = BlobReaderProxy;
type RequestStream = BlobReaderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobReaderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobReader";
}
impl fidl::endpoints::DiscoverableProtocolMarker for BlobReaderMarker {}
pub type BlobReaderGetVmoResult = Result<fidl::Vmo, i32>;
pub trait BlobReaderProxyInterface: Send + Sync {
type GetVmoResponseFut: std::future::Future<Output = Result<BlobReaderGetVmoResult, fidl::Error>>
+ Send;
fn r#get_vmo(&self, blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobReaderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobReaderSynchronousProxy {
type Proxy = BlobReaderProxy;
type Protocol = BlobReaderMarker;
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 BlobReaderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobReaderMarker 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<BlobReaderEvent, fidl::Error> {
BlobReaderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_vmo(
&self,
mut blob_hash: &[u8; 32],
___deadline: zx::MonotonicInstant,
) -> Result<BlobReaderGetVmoResult, fidl::Error> {
let _response = self.client.send_query::<
BlobReaderGetVmoRequest,
fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
>(
(blob_hash,),
0x2fa72823ef7f11f4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.vmo))
}
}
#[derive(Debug, Clone)]
pub struct BlobReaderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobReaderProxy {
type Protocol = BlobReaderMarker;
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 BlobReaderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobReaderEventStream {
BlobReaderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_vmo(
&self,
mut blob_hash: &[u8; 32],
) -> fidl::client::QueryResponseFut<
BlobReaderGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BlobReaderProxyInterface::r#get_vmo(self, blob_hash)
}
}
impl BlobReaderProxyInterface for BlobReaderProxy {
type GetVmoResponseFut = fidl::client::QueryResponseFut<
BlobReaderGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_vmo(&self, mut blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BlobReaderGetVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2fa72823ef7f11f4,
>(_buf?)?;
Ok(_response.map(|x| x.vmo))
}
self.client.send_query_and_decode::<BlobReaderGetVmoRequest, BlobReaderGetVmoResult>(
(blob_hash,),
0x2fa72823ef7f11f4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobReaderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobReaderEventStream {}
impl futures::stream::FusedStream for BlobReaderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobReaderEventStream {
type Item = Result<BlobReaderEvent, 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(BlobReaderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobReaderEvent {}
impl BlobReaderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobReaderEvent, 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: <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobReaderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobReaderRequestStream {}
impl futures::stream::FusedStream for BlobReaderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobReaderRequestStream {
type Protocol = BlobReaderMarker;
type ControlHandle = BlobReaderControlHandle;
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 {
BlobReaderControlHandle { 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 BlobReaderRequestStream {
type Item = Result<BlobReaderRequest, 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 BlobReaderRequestStream 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 {
0x2fa72823ef7f11f4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BlobReaderGetVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobReaderGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BlobReaderControlHandle { inner: this.inner.clone() };
Ok(BlobReaderRequest::GetVmo {
blob_hash: req.blob_hash,
responder: BlobReaderGetVmoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobReaderRequest {
GetVmo { blob_hash: [u8; 32], responder: BlobReaderGetVmoResponder },
}
impl BlobReaderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_vmo(self) -> Option<([u8; 32], BlobReaderGetVmoResponder)> {
if let BlobReaderRequest::GetVmo { blob_hash, responder } = self {
Some((blob_hash, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobReaderRequest::GetVmo { .. } => "get_vmo",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobReaderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobReaderControlHandle {
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 BlobReaderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobReaderGetVmoResponder {
control_handle: std::mem::ManuallyDrop<BlobReaderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobReaderGetVmoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobReaderGetVmoResponder {
type ControlHandle = BlobReaderControlHandle;
fn control_handle(&self) -> &BlobReaderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobReaderGetVmoResponder {
pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::Vmo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>>(
result.map(|vmo| (vmo,)),
self.tx_id,
0x2fa72823ef7f11f4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobWriterMarker;
impl fidl::endpoints::ProtocolMarker for BlobWriterMarker {
type Proxy = BlobWriterProxy;
type RequestStream = BlobWriterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobWriterSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BlobWriter";
}
pub type BlobWriterGetVmoResult = Result<fidl::Vmo, i32>;
pub type BlobWriterBytesReadyResult = Result<(), i32>;
pub trait BlobWriterProxyInterface: Send + Sync {
type GetVmoResponseFut: std::future::Future<Output = Result<BlobWriterGetVmoResult, fidl::Error>>
+ Send;
fn r#get_vmo(&self, size: u64) -> Self::GetVmoResponseFut;
type BytesReadyResponseFut: std::future::Future<Output = Result<BlobWriterBytesReadyResult, fidl::Error>>
+ Send;
fn r#bytes_ready(&self, bytes_written: u64) -> Self::BytesReadyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobWriterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobWriterSynchronousProxy {
type Proxy = BlobWriterProxy;
type Protocol = BlobWriterMarker;
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 BlobWriterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobWriterMarker 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<BlobWriterEvent, fidl::Error> {
BlobWriterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_vmo(
&self,
mut size: u64,
___deadline: zx::MonotonicInstant,
) -> Result<BlobWriterGetVmoResult, fidl::Error> {
let _response = self.client.send_query::<
BlobWriterGetVmoRequest,
fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
>(
(size,),
0x50c8988b12b6f893,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.vmo))
}
pub fn r#bytes_ready(
&self,
mut bytes_written: u64,
___deadline: zx::MonotonicInstant,
) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
let _response = self.client.send_query::<
BlobWriterBytesReadyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(bytes_written,),
0x7b308b473606c573,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct BlobWriterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobWriterProxy {
type Protocol = BlobWriterMarker;
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 BlobWriterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobWriterEventStream {
BlobWriterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_vmo(
&self,
mut size: u64,
) -> fidl::client::QueryResponseFut<
BlobWriterGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BlobWriterProxyInterface::r#get_vmo(self, size)
}
pub fn r#bytes_ready(
&self,
mut bytes_written: u64,
) -> fidl::client::QueryResponseFut<
BlobWriterBytesReadyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BlobWriterProxyInterface::r#bytes_ready(self, bytes_written)
}
}
impl BlobWriterProxyInterface for BlobWriterProxy {
type GetVmoResponseFut = fidl::client::QueryResponseFut<
BlobWriterGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_vmo(&self, mut size: u64) -> Self::GetVmoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BlobWriterGetVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x50c8988b12b6f893,
>(_buf?)?;
Ok(_response.map(|x| x.vmo))
}
self.client.send_query_and_decode::<BlobWriterGetVmoRequest, BlobWriterGetVmoResult>(
(size,),
0x50c8988b12b6f893,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type BytesReadyResponseFut = fidl::client::QueryResponseFut<
BlobWriterBytesReadyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#bytes_ready(&self, mut bytes_written: u64) -> Self::BytesReadyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7b308b473606c573,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<BlobWriterBytesReadyRequest, BlobWriterBytesReadyResult>(
(bytes_written,),
0x7b308b473606c573,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobWriterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobWriterEventStream {}
impl futures::stream::FusedStream for BlobWriterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobWriterEventStream {
type Item = Result<BlobWriterEvent, 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(BlobWriterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobWriterEvent {}
impl BlobWriterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobWriterEvent, 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: <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobWriterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobWriterRequestStream {}
impl futures::stream::FusedStream for BlobWriterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobWriterRequestStream {
type Protocol = BlobWriterMarker;
type ControlHandle = BlobWriterControlHandle;
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 {
BlobWriterControlHandle { 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 BlobWriterRequestStream {
type Item = Result<BlobWriterRequest, 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 BlobWriterRequestStream 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 {
0x50c8988b12b6f893 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BlobWriterGetVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
Ok(BlobWriterRequest::GetVmo {
size: req.size,
responder: BlobWriterGetVmoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7b308b473606c573 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BlobWriterBytesReadyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterBytesReadyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
Ok(BlobWriterRequest::BytesReady {
bytes_written: req.bytes_written,
responder: BlobWriterBytesReadyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobWriterRequest {
GetVmo { size: u64, responder: BlobWriterGetVmoResponder },
BytesReady { bytes_written: u64, responder: BlobWriterBytesReadyResponder },
}
impl BlobWriterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_vmo(self) -> Option<(u64, BlobWriterGetVmoResponder)> {
if let BlobWriterRequest::GetVmo { size, responder } = self {
Some((size, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_bytes_ready(self) -> Option<(u64, BlobWriterBytesReadyResponder)> {
if let BlobWriterRequest::BytesReady { bytes_written, responder } = self {
Some((bytes_written, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobWriterRequest::GetVmo { .. } => "get_vmo",
BlobWriterRequest::BytesReady { .. } => "bytes_ready",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobWriterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobWriterControlHandle {
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 BlobWriterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobWriterGetVmoResponder {
control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobWriterGetVmoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobWriterGetVmoResponder {
type ControlHandle = BlobWriterControlHandle;
fn control_handle(&self) -> &BlobWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobWriterGetVmoResponder {
pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::Vmo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>>(
result.map(|vmo| (vmo,)),
self.tx_id,
0x50c8988b12b6f893,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobWriterBytesReadyResponder {
control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobWriterBytesReadyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobWriterBytesReadyResponder {
type ControlHandle = BlobWriterControlHandle;
fn control_handle(&self) -> &BlobWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobWriterBytesReadyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7b308b473606c573,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CryptMarker;
impl fidl::endpoints::ProtocolMarker for CryptMarker {
type Proxy = CryptProxy;
type RequestStream = CryptRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CryptSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.Crypt";
}
impl fidl::endpoints::DiscoverableProtocolMarker for CryptMarker {}
pub type CryptCreateKeyResult = Result<([u8; 16], Vec<u8>, Vec<u8>), i32>;
pub type CryptCreateKeyWithIdResult = Result<(Vec<u8>, Vec<u8>), i32>;
pub type CryptUnwrapKeyResult = Result<Vec<u8>, i32>;
pub trait CryptProxyInterface: Send + Sync {
type CreateKeyResponseFut: std::future::Future<Output = Result<CryptCreateKeyResult, fidl::Error>>
+ Send;
fn r#create_key(&self, owner: u64, purpose: KeyPurpose) -> Self::CreateKeyResponseFut;
type CreateKeyWithIdResponseFut: std::future::Future<Output = Result<CryptCreateKeyWithIdResult, fidl::Error>>
+ Send;
fn r#create_key_with_id(
&self,
owner: u64,
wrapping_key_id: &[u8; 16],
) -> Self::CreateKeyWithIdResponseFut;
type UnwrapKeyResponseFut: std::future::Future<Output = Result<CryptUnwrapKeyResult, fidl::Error>>
+ Send;
fn r#unwrap_key(
&self,
wrapping_key_id: &[u8; 16],
owner: u64,
key: &[u8],
) -> Self::UnwrapKeyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CryptSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CryptSynchronousProxy {
type Proxy = CryptProxy;
type Protocol = CryptMarker;
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 CryptSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CryptMarker 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<CryptEvent, fidl::Error> {
CryptEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_key(
&self,
mut owner: u64,
mut purpose: KeyPurpose,
___deadline: zx::MonotonicInstant,
) -> Result<CryptCreateKeyResult, fidl::Error> {
let _response = self.client.send_query::<
CryptCreateKeyRequest,
fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
>(
(owner, purpose,),
0x6ec69b3aee7fdbba,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
}
pub fn r#create_key_with_id(
&self,
mut owner: u64,
mut wrapping_key_id: &[u8; 16],
___deadline: zx::MonotonicInstant,
) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
let _response = self.client.send_query::<
CryptCreateKeyWithIdRequest,
fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
>(
(owner, wrapping_key_id,),
0x21e8076688700b50,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
}
pub fn r#unwrap_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut owner: u64,
mut key: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<CryptUnwrapKeyResult, fidl::Error> {
let _response = self.client.send_query::<
CryptUnwrapKeyRequest,
fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
>(
(wrapping_key_id, owner, key,),
0x6ec34e2b64d46be9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.unwrapped_key))
}
}
#[derive(Debug, Clone)]
pub struct CryptProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CryptProxy {
type Protocol = CryptMarker;
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 CryptProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CryptEventStream {
CryptEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_key(
&self,
mut owner: u64,
mut purpose: KeyPurpose,
) -> fidl::client::QueryResponseFut<
CryptCreateKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptProxyInterface::r#create_key(self, owner, purpose)
}
pub fn r#create_key_with_id(
&self,
mut owner: u64,
mut wrapping_key_id: &[u8; 16],
) -> fidl::client::QueryResponseFut<
CryptCreateKeyWithIdResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptProxyInterface::r#create_key_with_id(self, owner, wrapping_key_id)
}
pub fn r#unwrap_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut owner: u64,
mut key: &[u8],
) -> fidl::client::QueryResponseFut<
CryptUnwrapKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptProxyInterface::r#unwrap_key(self, wrapping_key_id, owner, key)
}
}
impl CryptProxyInterface for CryptProxy {
type CreateKeyResponseFut = fidl::client::QueryResponseFut<
CryptCreateKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_key(&self, mut owner: u64, mut purpose: KeyPurpose) -> Self::CreateKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptCreateKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ec69b3aee7fdbba,
>(_buf?)?;
Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
}
self.client.send_query_and_decode::<CryptCreateKeyRequest, CryptCreateKeyResult>(
(owner, purpose),
0x6ec69b3aee7fdbba,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateKeyWithIdResponseFut = fidl::client::QueryResponseFut<
CryptCreateKeyWithIdResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_key_with_id(
&self,
mut owner: u64,
mut wrapping_key_id: &[u8; 16],
) -> Self::CreateKeyWithIdResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x21e8076688700b50,
>(_buf?)?;
Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
}
self.client
.send_query_and_decode::<CryptCreateKeyWithIdRequest, CryptCreateKeyWithIdResult>(
(owner, wrapping_key_id),
0x21e8076688700b50,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UnwrapKeyResponseFut = fidl::client::QueryResponseFut<
CryptUnwrapKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#unwrap_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut owner: u64,
mut key: &[u8],
) -> Self::UnwrapKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptUnwrapKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ec34e2b64d46be9,
>(_buf?)?;
Ok(_response.map(|x| x.unwrapped_key))
}
self.client.send_query_and_decode::<CryptUnwrapKeyRequest, CryptUnwrapKeyResult>(
(wrapping_key_id, owner, key),
0x6ec34e2b64d46be9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CryptEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CryptEventStream {}
impl futures::stream::FusedStream for CryptEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CryptEventStream {
type Item = Result<CryptEvent, 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(CryptEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CryptEvent {}
impl CryptEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CryptEvent, 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: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CryptRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CryptRequestStream {}
impl futures::stream::FusedStream for CryptRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CryptRequestStream {
type Protocol = CryptMarker;
type ControlHandle = CryptControlHandle;
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 {
CryptControlHandle { 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 CryptRequestStream {
type Item = Result<CryptRequest, 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 CryptRequestStream 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 {
0x6ec69b3aee7fdbba => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptCreateKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CryptControlHandle { inner: this.inner.clone() };
Ok(CryptRequest::CreateKey {
owner: req.owner,
purpose: req.purpose,
responder: CryptCreateKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x21e8076688700b50 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptCreateKeyWithIdRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyWithIdRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CryptControlHandle { inner: this.inner.clone() };
Ok(CryptRequest::CreateKeyWithId {
owner: req.owner,
wrapping_key_id: req.wrapping_key_id,
responder: CryptCreateKeyWithIdResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6ec34e2b64d46be9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptUnwrapKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptUnwrapKeyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CryptControlHandle { inner: this.inner.clone() };
Ok(CryptRequest::UnwrapKey {
wrapping_key_id: req.wrapping_key_id,
owner: req.owner,
key: req.key,
responder: CryptUnwrapKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CryptRequest {
CreateKey { owner: u64, purpose: KeyPurpose, responder: CryptCreateKeyResponder },
CreateKeyWithId {
owner: u64,
wrapping_key_id: [u8; 16],
responder: CryptCreateKeyWithIdResponder,
},
UnwrapKey {
wrapping_key_id: [u8; 16],
owner: u64,
key: Vec<u8>,
responder: CryptUnwrapKeyResponder,
},
}
impl CryptRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_key(self) -> Option<(u64, KeyPurpose, CryptCreateKeyResponder)> {
if let CryptRequest::CreateKey { owner, purpose, responder } = self {
Some((owner, purpose, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_key_with_id(self) -> Option<(u64, [u8; 16], CryptCreateKeyWithIdResponder)> {
if let CryptRequest::CreateKeyWithId { owner, wrapping_key_id, responder } = self {
Some((owner, wrapping_key_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_unwrap_key(self) -> Option<([u8; 16], u64, Vec<u8>, CryptUnwrapKeyResponder)> {
if let CryptRequest::UnwrapKey { wrapping_key_id, owner, key, responder } = self {
Some((wrapping_key_id, owner, key, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CryptRequest::CreateKey { .. } => "create_key",
CryptRequest::CreateKeyWithId { .. } => "create_key_with_id",
CryptRequest::UnwrapKey { .. } => "unwrap_key",
}
}
}
#[derive(Debug, Clone)]
pub struct CryptControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CryptControlHandle {
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 CryptControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptCreateKeyResponder {
control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptCreateKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptCreateKeyResponder {
type ControlHandle = CryptControlHandle;
fn control_handle(&self) -> &CryptControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptCreateKeyResponder {
pub fn send(
self,
mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<CryptCreateKeyResponse, i32>>(
result,
self.tx_id,
0x6ec69b3aee7fdbba,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptCreateKeyWithIdResponder {
control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptCreateKeyWithIdResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptCreateKeyWithIdResponder {
type ControlHandle = CryptControlHandle;
fn control_handle(&self) -> &CryptControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptCreateKeyWithIdResponder {
pub fn send(self, mut result: Result<(&[u8], &[u8]), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&[u8], &[u8]), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(&[u8], &[u8]), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>>(
result,
self.tx_id,
0x21e8076688700b50,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptUnwrapKeyResponder {
control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptUnwrapKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptUnwrapKeyResponder {
type ControlHandle = CryptControlHandle;
fn control_handle(&self) -> &CryptControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptUnwrapKeyResponder {
pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>>(
result.map(|unwrapped_key| (unwrapped_key,)),
self.tx_id,
0x6ec34e2b64d46be9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CryptManagementMarker;
impl fidl::endpoints::ProtocolMarker for CryptManagementMarker {
type Proxy = CryptManagementProxy;
type RequestStream = CryptManagementRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CryptManagementSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.CryptManagement";
}
impl fidl::endpoints::DiscoverableProtocolMarker for CryptManagementMarker {}
pub type CryptManagementAddWrappingKeyResult = Result<(), i32>;
pub type CryptManagementSetActiveKeyResult = Result<(), i32>;
pub type CryptManagementForgetWrappingKeyResult = Result<(), i32>;
pub trait CryptManagementProxyInterface: Send + Sync {
type AddWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementAddWrappingKeyResult, fidl::Error>>
+ Send;
fn r#add_wrapping_key(
&self,
wrapping_key_id: &[u8; 16],
key: &[u8],
) -> Self::AddWrappingKeyResponseFut;
type SetActiveKeyResponseFut: std::future::Future<Output = Result<CryptManagementSetActiveKeyResult, fidl::Error>>
+ Send;
fn r#set_active_key(
&self,
purpose: KeyPurpose,
wrapping_key_id: &[u8; 16],
) -> Self::SetActiveKeyResponseFut;
type ForgetWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementForgetWrappingKeyResult, fidl::Error>>
+ Send;
fn r#forget_wrapping_key(
&self,
wrapping_key_id: &[u8; 16],
) -> Self::ForgetWrappingKeyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CryptManagementSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CryptManagementSynchronousProxy {
type Proxy = CryptManagementProxy;
type Protocol = CryptManagementMarker;
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 CryptManagementSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CryptManagementMarker 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<CryptManagementEvent, fidl::Error> {
CryptManagementEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#add_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut key: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
let _response = self.client.send_query::<
CryptManagementAddWrappingKeyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(wrapping_key_id, key,),
0x59a5076762318bf,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_active_key(
&self,
mut purpose: KeyPurpose,
mut wrapping_key_id: &[u8; 16],
___deadline: zx::MonotonicInstant,
) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
let _response = self.client.send_query::<
CryptManagementSetActiveKeyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(purpose, wrapping_key_id,),
0x5e81d600442f2872,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#forget_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
___deadline: zx::MonotonicInstant,
) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
let _response = self.client.send_query::<
CryptManagementForgetWrappingKeyRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(wrapping_key_id,),
0x436d6d27696dfcf4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct CryptManagementProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CryptManagementProxy {
type Protocol = CryptManagementMarker;
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 CryptManagementProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CryptManagementEventStream {
CryptManagementEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#add_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut key: &[u8],
) -> fidl::client::QueryResponseFut<
CryptManagementAddWrappingKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptManagementProxyInterface::r#add_wrapping_key(self, wrapping_key_id, key)
}
pub fn r#set_active_key(
&self,
mut purpose: KeyPurpose,
mut wrapping_key_id: &[u8; 16],
) -> fidl::client::QueryResponseFut<
CryptManagementSetActiveKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptManagementProxyInterface::r#set_active_key(self, purpose, wrapping_key_id)
}
pub fn r#forget_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
) -> fidl::client::QueryResponseFut<
CryptManagementForgetWrappingKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CryptManagementProxyInterface::r#forget_wrapping_key(self, wrapping_key_id)
}
}
impl CryptManagementProxyInterface for CryptManagementProxy {
type AddWrappingKeyResponseFut = fidl::client::QueryResponseFut<
CryptManagementAddWrappingKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#add_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
mut key: &[u8],
) -> Self::AddWrappingKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x59a5076762318bf,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CryptManagementAddWrappingKeyRequest,
CryptManagementAddWrappingKeyResult,
>(
(wrapping_key_id, key,),
0x59a5076762318bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetActiveKeyResponseFut = fidl::client::QueryResponseFut<
CryptManagementSetActiveKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_active_key(
&self,
mut purpose: KeyPurpose,
mut wrapping_key_id: &[u8; 16],
) -> Self::SetActiveKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5e81d600442f2872,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CryptManagementSetActiveKeyRequest,
CryptManagementSetActiveKeyResult,
>(
(purpose, wrapping_key_id,),
0x5e81d600442f2872,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ForgetWrappingKeyResponseFut = fidl::client::QueryResponseFut<
CryptManagementForgetWrappingKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#forget_wrapping_key(
&self,
mut wrapping_key_id: &[u8; 16],
) -> Self::ForgetWrappingKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x436d6d27696dfcf4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CryptManagementForgetWrappingKeyRequest,
CryptManagementForgetWrappingKeyResult,
>(
(wrapping_key_id,),
0x436d6d27696dfcf4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CryptManagementEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CryptManagementEventStream {}
impl futures::stream::FusedStream for CryptManagementEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CryptManagementEventStream {
type Item = Result<CryptManagementEvent, 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(CryptManagementEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CryptManagementEvent {}
impl CryptManagementEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CryptManagementEvent, 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:
<CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CryptManagementRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CryptManagementRequestStream {}
impl futures::stream::FusedStream for CryptManagementRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CryptManagementRequestStream {
type Protocol = CryptManagementMarker;
type ControlHandle = CryptManagementControlHandle;
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 {
CryptManagementControlHandle { 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 CryptManagementRequestStream {
type Item = Result<CryptManagementRequest, 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 CryptManagementRequestStream 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 {
0x59a5076762318bf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptManagementAddWrappingKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementAddWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CryptManagementControlHandle { inner: this.inner.clone() };
Ok(CryptManagementRequest::AddWrappingKey {
wrapping_key_id: req.wrapping_key_id,
key: req.key,
responder: CryptManagementAddWrappingKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5e81d600442f2872 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptManagementSetActiveKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementSetActiveKeyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CryptManagementControlHandle { inner: this.inner.clone() };
Ok(CryptManagementRequest::SetActiveKey {
purpose: req.purpose,
wrapping_key_id: req.wrapping_key_id,
responder: CryptManagementSetActiveKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x436d6d27696dfcf4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CryptManagementForgetWrappingKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementForgetWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CryptManagementControlHandle { inner: this.inner.clone() };
Ok(CryptManagementRequest::ForgetWrappingKey {
wrapping_key_id: req.wrapping_key_id,
responder: CryptManagementForgetWrappingKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CryptManagementRequest {
AddWrappingKey {
wrapping_key_id: [u8; 16],
key: Vec<u8>,
responder: CryptManagementAddWrappingKeyResponder,
},
SetActiveKey {
purpose: KeyPurpose,
wrapping_key_id: [u8; 16],
responder: CryptManagementSetActiveKeyResponder,
},
ForgetWrappingKey {
wrapping_key_id: [u8; 16],
responder: CryptManagementForgetWrappingKeyResponder,
},
}
impl CryptManagementRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_add_wrapping_key(
self,
) -> Option<([u8; 16], Vec<u8>, CryptManagementAddWrappingKeyResponder)> {
if let CryptManagementRequest::AddWrappingKey { wrapping_key_id, key, responder } = self {
Some((wrapping_key_id, key, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_active_key(
self,
) -> Option<(KeyPurpose, [u8; 16], CryptManagementSetActiveKeyResponder)> {
if let CryptManagementRequest::SetActiveKey { purpose, wrapping_key_id, responder } = self {
Some((purpose, wrapping_key_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_forget_wrapping_key(
self,
) -> Option<([u8; 16], CryptManagementForgetWrappingKeyResponder)> {
if let CryptManagementRequest::ForgetWrappingKey { wrapping_key_id, responder } = self {
Some((wrapping_key_id, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CryptManagementRequest::AddWrappingKey { .. } => "add_wrapping_key",
CryptManagementRequest::SetActiveKey { .. } => "set_active_key",
CryptManagementRequest::ForgetWrappingKey { .. } => "forget_wrapping_key",
}
}
}
#[derive(Debug, Clone)]
pub struct CryptManagementControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CryptManagementControlHandle {
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 CryptManagementControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptManagementAddWrappingKeyResponder {
control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptManagementAddWrappingKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptManagementAddWrappingKeyResponder {
type ControlHandle = CryptManagementControlHandle;
fn control_handle(&self) -> &CryptManagementControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptManagementAddWrappingKeyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x59a5076762318bf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptManagementSetActiveKeyResponder {
control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptManagementSetActiveKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptManagementSetActiveKeyResponder {
type ControlHandle = CryptManagementControlHandle;
fn control_handle(&self) -> &CryptManagementControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptManagementSetActiveKeyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5e81d600442f2872,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CryptManagementForgetWrappingKeyResponder {
control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CryptManagementForgetWrappingKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CryptManagementForgetWrappingKeyResponder {
type ControlHandle = CryptManagementControlHandle;
fn control_handle(&self) -> &CryptManagementControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CryptManagementForgetWrappingKeyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x436d6d27696dfcf4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DebugMarker;
impl fidl::endpoints::ProtocolMarker for DebugMarker {
type Proxy = DebugProxy;
type RequestStream = DebugRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DebugSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.Debug";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
pub type DebugCompactResult = Result<(), i32>;
pub type DebugDeleteProfileResult = Result<(), i32>;
pub type DebugStopProfileTasksResult = Result<(), i32>;
pub trait DebugProxyInterface: Send + Sync {
type CompactResponseFut: std::future::Future<Output = Result<DebugCompactResult, fidl::Error>>
+ Send;
fn r#compact(&self) -> Self::CompactResponseFut;
type DeleteProfileResponseFut: std::future::Future<Output = Result<DebugDeleteProfileResult, fidl::Error>>
+ Send;
fn r#delete_profile(&self, volume: &str, profile: &str) -> Self::DeleteProfileResponseFut;
type StopProfileTasksResponseFut: std::future::Future<Output = Result<DebugStopProfileTasksResult, fidl::Error>>
+ Send;
fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DebugSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
type Proxy = DebugProxy;
type Protocol = DebugMarker;
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 DebugSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DebugMarker 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<DebugEvent, fidl::Error> {
DebugEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#compact(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DebugCompactResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x6553eb197306e489,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#delete_profile(
&self,
mut volume: &str,
mut profile: &str,
___deadline: zx::MonotonicInstant,
) -> Result<DebugDeleteProfileResult, fidl::Error> {
let _response = self.client.send_query::<
DebugDeleteProfileRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(volume, profile,),
0x54d9d4c9cf300a1e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_profile_tasks(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DebugStopProfileTasksResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x1657b945dd629177,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DebugProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DebugProxy {
type Protocol = DebugMarker;
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 DebugProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DebugEventStream {
DebugEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#compact(
&self,
) -> fidl::client::QueryResponseFut<
DebugCompactResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugProxyInterface::r#compact(self)
}
pub fn r#delete_profile(
&self,
mut volume: &str,
mut profile: &str,
) -> fidl::client::QueryResponseFut<
DebugDeleteProfileResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugProxyInterface::r#delete_profile(self, volume, profile)
}
pub fn r#stop_profile_tasks(
&self,
) -> fidl::client::QueryResponseFut<
DebugStopProfileTasksResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DebugProxyInterface::r#stop_profile_tasks(self)
}
}
impl DebugProxyInterface for DebugProxy {
type CompactResponseFut = fidl::client::QueryResponseFut<
DebugCompactResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#compact(&self) -> Self::CompactResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugCompactResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6553eb197306e489,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugCompactResult>(
(),
0x6553eb197306e489,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DeleteProfileResponseFut = fidl::client::QueryResponseFut<
DebugDeleteProfileResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#delete_profile(
&self,
mut volume: &str,
mut profile: &str,
) -> Self::DeleteProfileResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugDeleteProfileResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54d9d4c9cf300a1e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<DebugDeleteProfileRequest, DebugDeleteProfileResult>(
(volume, profile),
0x54d9d4c9cf300a1e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopProfileTasksResponseFut = fidl::client::QueryResponseFut<
DebugStopProfileTasksResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DebugStopProfileTasksResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1657b945dd629177,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugStopProfileTasksResult>(
(),
0x1657b945dd629177,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DebugEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DebugEventStream {}
impl futures::stream::FusedStream for DebugEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DebugEventStream {
type Item = Result<DebugEvent, 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(DebugEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DebugEvent {}
impl DebugEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DebugEvent, 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: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DebugRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DebugRequestStream {}
impl futures::stream::FusedStream for DebugRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DebugRequestStream {
type Protocol = DebugMarker;
type ControlHandle = DebugControlHandle;
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 {
DebugControlHandle { 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 DebugRequestStream {
type Item = Result<DebugRequest, 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 DebugRequestStream 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 {
0x6553eb197306e489 => {
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 = DebugControlHandle { inner: this.inner.clone() };
Ok(DebugRequest::Compact {
responder: DebugCompactResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x54d9d4c9cf300a1e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DebugDeleteProfileRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDeleteProfileRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DebugControlHandle { inner: this.inner.clone() };
Ok(DebugRequest::DeleteProfile {
volume: req.volume,
profile: req.profile,
responder: DebugDeleteProfileResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1657b945dd629177 => {
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 = DebugControlHandle { inner: this.inner.clone() };
Ok(DebugRequest::StopProfileTasks {
responder: DebugStopProfileTasksResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DebugRequest {
Compact { responder: DebugCompactResponder },
DeleteProfile { volume: String, profile: String, responder: DebugDeleteProfileResponder },
StopProfileTasks { responder: DebugStopProfileTasksResponder },
}
impl DebugRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_compact(self) -> Option<(DebugCompactResponder)> {
if let DebugRequest::Compact { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_delete_profile(self) -> Option<(String, String, DebugDeleteProfileResponder)> {
if let DebugRequest::DeleteProfile { volume, profile, responder } = self {
Some((volume, profile, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_profile_tasks(self) -> Option<(DebugStopProfileTasksResponder)> {
if let DebugRequest::StopProfileTasks { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DebugRequest::Compact { .. } => "compact",
DebugRequest::DeleteProfile { .. } => "delete_profile",
DebugRequest::StopProfileTasks { .. } => "stop_profile_tasks",
}
}
}
#[derive(Debug, Clone)]
pub struct DebugControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DebugControlHandle {
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 DebugControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugCompactResponder {
control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugCompactResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugCompactResponder {
type ControlHandle = DebugControlHandle;
fn control_handle(&self) -> &DebugControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugCompactResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6553eb197306e489,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugDeleteProfileResponder {
control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugDeleteProfileResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugDeleteProfileResponder {
type ControlHandle = DebugControlHandle;
fn control_handle(&self) -> &DebugControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugDeleteProfileResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x54d9d4c9cf300a1e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DebugStopProfileTasksResponder {
control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DebugStopProfileTasksResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DebugStopProfileTasksResponder {
type ControlHandle = DebugControlHandle;
fn control_handle(&self) -> &DebugControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DebugStopProfileTasksResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1657b945dd629177,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ProjectIdMarker;
impl fidl::endpoints::ProtocolMarker for ProjectIdMarker {
type Proxy = ProjectIdProxy;
type RequestStream = ProjectIdRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ProjectIdSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.ProjectId";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ProjectIdMarker {}
pub type ProjectIdSetLimitResult = Result<(), i32>;
pub type ProjectIdClearResult = Result<(), i32>;
pub type ProjectIdSetForNodeResult = Result<(), i32>;
pub type ProjectIdGetForNodeResult = Result<u64, i32>;
pub type ProjectIdClearForNodeResult = Result<(), i32>;
pub type ProjectIdListResult = Result<(Vec<u64>, Option<Box<ProjectIterToken>>), i32>;
pub type ProjectIdInfoResult = Result<(BytesAndNodes, BytesAndNodes), i32>;
pub trait ProjectIdProxyInterface: Send + Sync {
type SetLimitResponseFut: std::future::Future<Output = Result<ProjectIdSetLimitResult, fidl::Error>>
+ Send;
fn r#set_limit(&self, project_id: u64, bytes: u64, nodes: u64) -> Self::SetLimitResponseFut;
type ClearResponseFut: std::future::Future<Output = Result<ProjectIdClearResult, fidl::Error>>
+ Send;
fn r#clear(&self, project_id: u64) -> Self::ClearResponseFut;
type SetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdSetForNodeResult, fidl::Error>>
+ Send;
fn r#set_for_node(&self, node_id: u64, project_id: u64) -> Self::SetForNodeResponseFut;
type GetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdGetForNodeResult, fidl::Error>>
+ Send;
fn r#get_for_node(&self, node_id: u64) -> Self::GetForNodeResponseFut;
type ClearForNodeResponseFut: std::future::Future<Output = Result<ProjectIdClearForNodeResult, fidl::Error>>
+ Send;
fn r#clear_for_node(&self, node_id: u64) -> Self::ClearForNodeResponseFut;
type ListResponseFut: std::future::Future<Output = Result<ProjectIdListResult, fidl::Error>>
+ Send;
fn r#list(&self, token: Option<&ProjectIterToken>) -> Self::ListResponseFut;
type InfoResponseFut: std::future::Future<Output = Result<ProjectIdInfoResult, fidl::Error>>
+ Send;
fn r#info(&self, project_id: u64) -> Self::InfoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ProjectIdSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ProjectIdSynchronousProxy {
type Proxy = ProjectIdProxy;
type Protocol = ProjectIdMarker;
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 ProjectIdSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ProjectIdMarker 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<ProjectIdEvent, fidl::Error> {
ProjectIdEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_limit(
&self,
mut project_id: u64,
mut bytes: u64,
mut nodes: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdSetLimitResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdSetLimitRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(project_id, bytes, nodes,),
0x20b0fc1e0413876f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clear(
&self,
mut project_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdClearResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdClearRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(project_id,),
0x165b5f1e707863c1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_for_node(
&self,
mut node_id: u64,
mut project_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdSetForNodeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(node_id, project_id,),
0x4d7a8442dc58324c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_for_node(
&self,
mut node_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdGetForNodeRequest,
fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
>(
(node_id,),
0x644073bdf2542573,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.project_id))
}
pub fn r#clear_for_node(
&self,
mut node_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdClearForNodeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(node_id,),
0x3f2ca287bbfe6a62,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list(
&self,
mut token: Option<&ProjectIterToken>,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdListResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdListRequest,
fidl::encoding::ResultType<ProjectIdListResponse, i32>,
>(
(token,),
0x5505f95a36d522cc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.entries, x.next_token)))
}
pub fn r#info(
&self,
mut project_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ProjectIdInfoResult, fidl::Error> {
let _response = self.client.send_query::<
ProjectIdInfoRequest,
fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
>(
(project_id,),
0x51b47743c9e2d1ab,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.limit, x.usage)))
}
}
#[derive(Debug, Clone)]
pub struct ProjectIdProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ProjectIdProxy {
type Protocol = ProjectIdMarker;
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 ProjectIdProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ProjectIdEventStream {
ProjectIdEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_limit(
&self,
mut project_id: u64,
mut bytes: u64,
mut nodes: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdSetLimitResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#set_limit(self, project_id, bytes, nodes)
}
pub fn r#clear(
&self,
mut project_id: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdClearResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#clear(self, project_id)
}
pub fn r#set_for_node(
&self,
mut node_id: u64,
mut project_id: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdSetForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#set_for_node(self, node_id, project_id)
}
pub fn r#get_for_node(
&self,
mut node_id: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdGetForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#get_for_node(self, node_id)
}
pub fn r#clear_for_node(
&self,
mut node_id: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdClearForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#clear_for_node(self, node_id)
}
pub fn r#list(
&self,
mut token: Option<&ProjectIterToken>,
) -> fidl::client::QueryResponseFut<
ProjectIdListResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#list(self, token)
}
pub fn r#info(
&self,
mut project_id: u64,
) -> fidl::client::QueryResponseFut<
ProjectIdInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProjectIdProxyInterface::r#info(self, project_id)
}
}
impl ProjectIdProxyInterface for ProjectIdProxy {
type SetLimitResponseFut = fidl::client::QueryResponseFut<
ProjectIdSetLimitResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_limit(
&self,
mut project_id: u64,
mut bytes: u64,
mut nodes: u64,
) -> Self::SetLimitResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdSetLimitResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x20b0fc1e0413876f,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ProjectIdSetLimitRequest, ProjectIdSetLimitResult>(
(project_id, bytes, nodes),
0x20b0fc1e0413876f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearResponseFut = fidl::client::QueryResponseFut<
ProjectIdClearResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#clear(&self, mut project_id: u64) -> Self::ClearResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdClearResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x165b5f1e707863c1,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ProjectIdClearRequest, ProjectIdClearResult>(
(project_id,),
0x165b5f1e707863c1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetForNodeResponseFut = fidl::client::QueryResponseFut<
ProjectIdSetForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_for_node(&self, mut node_id: u64, mut project_id: u64) -> Self::SetForNodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4d7a8442dc58324c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ProjectIdSetForNodeRequest, ProjectIdSetForNodeResult>(
(node_id, project_id),
0x4d7a8442dc58324c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetForNodeResponseFut = fidl::client::QueryResponseFut<
ProjectIdGetForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_for_node(&self, mut node_id: u64) -> Self::GetForNodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x644073bdf2542573,
>(_buf?)?;
Ok(_response.map(|x| x.project_id))
}
self.client.send_query_and_decode::<ProjectIdGetForNodeRequest, ProjectIdGetForNodeResult>(
(node_id,),
0x644073bdf2542573,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearForNodeResponseFut = fidl::client::QueryResponseFut<
ProjectIdClearForNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#clear_for_node(&self, mut node_id: u64) -> Self::ClearForNodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3f2ca287bbfe6a62,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ProjectIdClearForNodeRequest, ProjectIdClearForNodeResult>(
(node_id,),
0x3f2ca287bbfe6a62,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListResponseFut = fidl::client::QueryResponseFut<
ProjectIdListResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#list(&self, mut token: Option<&ProjectIterToken>) -> Self::ListResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdListResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdListResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5505f95a36d522cc,
>(_buf?)?;
Ok(_response.map(|x| (x.entries, x.next_token)))
}
self.client.send_query_and_decode::<ProjectIdListRequest, ProjectIdListResult>(
(token,),
0x5505f95a36d522cc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type InfoResponseFut = fidl::client::QueryResponseFut<
ProjectIdInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#info(&self, mut project_id: u64) -> Self::InfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x51b47743c9e2d1ab,
>(_buf?)?;
Ok(_response.map(|x| (x.limit, x.usage)))
}
self.client.send_query_and_decode::<ProjectIdInfoRequest, ProjectIdInfoResult>(
(project_id,),
0x51b47743c9e2d1ab,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ProjectIdEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ProjectIdEventStream {}
impl futures::stream::FusedStream for ProjectIdEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ProjectIdEventStream {
type Item = Result<ProjectIdEvent, 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(ProjectIdEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ProjectIdEvent {}
impl ProjectIdEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ProjectIdEvent, 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: <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ProjectIdRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ProjectIdRequestStream {}
impl futures::stream::FusedStream for ProjectIdRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ProjectIdRequestStream {
type Protocol = ProjectIdMarker;
type ControlHandle = ProjectIdControlHandle;
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 {
ProjectIdControlHandle { 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 ProjectIdRequestStream {
type Item = Result<ProjectIdRequest, 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 ProjectIdRequestStream 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 {
0x20b0fc1e0413876f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdSetLimitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetLimitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::SetLimit {
project_id: req.project_id,
bytes: req.bytes,
nodes: req.nodes,
responder: ProjectIdSetLimitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x165b5f1e707863c1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdClearRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::Clear {
project_id: req.project_id,
responder: ProjectIdClearResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4d7a8442dc58324c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdSetForNodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::SetForNode {
node_id: req.node_id,
project_id: req.project_id,
responder: ProjectIdSetForNodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x644073bdf2542573 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdGetForNodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdGetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::GetForNode {
node_id: req.node_id,
responder: ProjectIdGetForNodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3f2ca287bbfe6a62 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdClearForNodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::ClearForNode {
node_id: req.node_id,
responder: ProjectIdClearForNodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5505f95a36d522cc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdListRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdListRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::List {
token: req.token,
responder: ProjectIdListResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x51b47743c9e2d1ab => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProjectIdInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
Ok(ProjectIdRequest::Info {
project_id: req.project_id,
responder: ProjectIdInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ProjectIdRequest {
SetLimit { project_id: u64, bytes: u64, nodes: u64, responder: ProjectIdSetLimitResponder },
Clear { project_id: u64, responder: ProjectIdClearResponder },
SetForNode { node_id: u64, project_id: u64, responder: ProjectIdSetForNodeResponder },
GetForNode { node_id: u64, responder: ProjectIdGetForNodeResponder },
ClearForNode { node_id: u64, responder: ProjectIdClearForNodeResponder },
List { token: Option<Box<ProjectIterToken>>, responder: ProjectIdListResponder },
Info { project_id: u64, responder: ProjectIdInfoResponder },
}
impl ProjectIdRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_limit(self) -> Option<(u64, u64, u64, ProjectIdSetLimitResponder)> {
if let ProjectIdRequest::SetLimit { project_id, bytes, nodes, responder } = self {
Some((project_id, bytes, nodes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear(self) -> Option<(u64, ProjectIdClearResponder)> {
if let ProjectIdRequest::Clear { project_id, responder } = self {
Some((project_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_for_node(self) -> Option<(u64, u64, ProjectIdSetForNodeResponder)> {
if let ProjectIdRequest::SetForNode { node_id, project_id, responder } = self {
Some((node_id, project_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_for_node(self) -> Option<(u64, ProjectIdGetForNodeResponder)> {
if let ProjectIdRequest::GetForNode { node_id, responder } = self {
Some((node_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear_for_node(self) -> Option<(u64, ProjectIdClearForNodeResponder)> {
if let ProjectIdRequest::ClearForNode { node_id, responder } = self {
Some((node_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list(self) -> Option<(Option<Box<ProjectIterToken>>, ProjectIdListResponder)> {
if let ProjectIdRequest::List { token, responder } = self {
Some((token, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_info(self) -> Option<(u64, ProjectIdInfoResponder)> {
if let ProjectIdRequest::Info { project_id, responder } = self {
Some((project_id, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ProjectIdRequest::SetLimit { .. } => "set_limit",
ProjectIdRequest::Clear { .. } => "clear",
ProjectIdRequest::SetForNode { .. } => "set_for_node",
ProjectIdRequest::GetForNode { .. } => "get_for_node",
ProjectIdRequest::ClearForNode { .. } => "clear_for_node",
ProjectIdRequest::List { .. } => "list",
ProjectIdRequest::Info { .. } => "info",
}
}
}
#[derive(Debug, Clone)]
pub struct ProjectIdControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ProjectIdControlHandle {
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 ProjectIdControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdSetLimitResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdSetLimitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdSetLimitResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdSetLimitResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x20b0fc1e0413876f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdClearResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdClearResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdClearResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdClearResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x165b5f1e707863c1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdSetForNodeResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdSetForNodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdSetForNodeResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdSetForNodeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4d7a8442dc58324c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdGetForNodeResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdGetForNodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdGetForNodeResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdGetForNodeResponder {
pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>>(
result.map(|project_id| (project_id,)),
self.tx_id,
0x644073bdf2542573,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdClearForNodeResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdClearForNodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdClearForNodeResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdClearForNodeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3f2ca287bbfe6a62,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdListResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdListResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdListResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdListResponder {
pub fn send(
self,
mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdListResponse, i32>>(
result,
self.tx_id,
0x5505f95a36d522cc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProjectIdInfoResponder {
control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProjectIdInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProjectIdInfoResponder {
type ControlHandle = ProjectIdControlHandle;
fn control_handle(&self) -> &ProjectIdControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProjectIdInfoResponder {
pub fn send(
self,
mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdInfoResponse, i32>>(
result,
self.tx_id,
0x51b47743c9e2d1ab,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for CreateBlobError {
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 CreateBlobError {
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 CreateBlobError
{
#[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 CreateBlobError {
#[inline(always)]
fn new_empty() -> Self {
Self::AlreadyExists
}
#[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 KeyPurpose {
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 KeyPurpose {
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 KeyPurpose {
#[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 KeyPurpose {
#[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 BlobCreatorCreateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobCreatorCreateRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
33
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BlobCreatorCreateRequest, D> for &BlobCreatorCreateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobCreatorCreateRequest>(offset);
fidl::encoding::Encode::<BlobCreatorCreateRequest, D>::encode(
(
<fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.hash,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allow_existing),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<BlobCreatorCreateRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobCreatorCreateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobCreatorCreateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D),
allow_existing: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<u8, 32>, D, &mut self.hash, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.allow_existing, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for BlobCreatorCreateResponse {
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 BlobCreatorCreateResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
BlobCreatorCreateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut BlobCreatorCreateResponse
{
#[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::<BlobCreatorCreateResponse>(offset);
fidl::encoding::Encode::<BlobCreatorCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
BlobCreatorCreateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for BlobCreatorCreateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
writer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.writer,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobReaderGetVmoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobReaderGetVmoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[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<BlobReaderGetVmoRequest, D> for &BlobReaderGetVmoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobReaderGetVmoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlobReaderGetVmoRequest)
.write_unaligned((self as *const BlobReaderGetVmoRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
> fidl::encoding::Encode<BlobReaderGetVmoRequest, 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::<BlobReaderGetVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobReaderGetVmoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { blob_hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for BlobReaderGetVmoResponse {
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 BlobReaderGetVmoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
BlobReaderGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut BlobReaderGetVmoResponse
{
#[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::<BlobReaderGetVmoResponse>(offset);
fidl::encoding::Encode::<
BlobReaderGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
BlobReaderGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for BlobReaderGetVmoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobWriterBytesReadyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobWriterBytesReadyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<BlobWriterBytesReadyRequest, D> for &BlobWriterBytesReadyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterBytesReadyRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlobWriterBytesReadyRequest)
.write_unaligned((self as *const BlobWriterBytesReadyRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<BlobWriterBytesReadyRequest, 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::<BlobWriterBytesReadyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobWriterBytesReadyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { bytes_written: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobWriterGetVmoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobWriterGetVmoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<BlobWriterGetVmoRequest, D> for &BlobWriterGetVmoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterGetVmoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlobWriterGetVmoRequest)
.write_unaligned((self as *const BlobWriterGetVmoRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<BlobWriterGetVmoRequest, 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::<BlobWriterGetVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobWriterGetVmoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { size: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for BlobWriterGetVmoResponse {
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 BlobWriterGetVmoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
BlobWriterGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut BlobWriterGetVmoResponse
{
#[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::<BlobWriterGetVmoResponse>(offset);
fidl::encoding::Encode::<
BlobWriterGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
BlobWriterGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for BlobWriterGetVmoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BytesAndNodes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BytesAndNodes {
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
}
#[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<BytesAndNodes, D>
for &BytesAndNodes
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BytesAndNodes>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BytesAndNodes)
.write_unaligned((self as *const BytesAndNodes).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<BytesAndNodes, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BytesAndNodes>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BytesAndNodes {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(u64, D), nodes: fidl::new_empty!(u64, 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyRequest {
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<CryptCreateKeyRequest, D>
for &CryptCreateKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyRequest>(offset);
fidl::encoding::Encode::<CryptCreateKeyRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
<KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<KeyPurpose, D>,
> fidl::encoding::Encode<CryptCreateKeyRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptCreateKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { owner: fidl::new_empty!(u64, D), purpose: fidl::new_empty!(KeyPurpose, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u64, D, &mut self.owner, decoder, offset + 0, _depth)?;
fidl::decode!(KeyPurpose, D, &mut self.purpose, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyWithIdRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyWithIdRequest {
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
}
#[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<CryptCreateKeyWithIdRequest, D> for &CryptCreateKeyWithIdRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyWithIdRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CryptCreateKeyWithIdRequest)
.write_unaligned((self as *const CryptCreateKeyWithIdRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
> fidl::encoding::Encode<CryptCreateKeyWithIdRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyWithIdRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptCreateKeyWithIdRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
owner: fidl::new_empty!(u64, D),
wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, 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, 24);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementAddWrappingKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptManagementAddWrappingKeyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest, D>
for &CryptManagementAddWrappingKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementAddWrappingKeyRequest>(offset);
fidl::encoding::Encode::<CryptManagementAddWrappingKeyRequest, D>::encode(
(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapping_key_id,
),
<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
> fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementAddWrappingKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptManagementAddWrappingKeyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementForgetWrappingKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptManagementForgetWrappingKeyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[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<CryptManagementForgetWrappingKeyRequest, D>
for &CryptManagementForgetWrappingKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementForgetWrappingKeyRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CryptManagementForgetWrappingKeyRequest).write_unaligned(
(self as *const CryptManagementForgetWrappingKeyRequest).read(),
);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
> fidl::encoding::Encode<CryptManagementForgetWrappingKeyRequest, 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::<CryptManagementForgetWrappingKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptManagementForgetWrappingKeyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementSetActiveKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptManagementSetActiveKeyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CryptManagementSetActiveKeyRequest, D>
for &CryptManagementSetActiveKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
fidl::encoding::Encode::<CryptManagementSetActiveKeyRequest, D>::encode(
(
<KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapping_key_id,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<KeyPurpose, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
> fidl::encoding::Encode<CryptManagementSetActiveKeyRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptManagementSetActiveKeyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
purpose: fidl::new_empty!(KeyPurpose, D),
wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, 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!(KeyPurpose, D, &mut self.purpose, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptUnwrapKeyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptUnwrapKeyRequest, D>
for &CryptUnwrapKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyRequest>(offset);
fidl::encoding::Encode::<CryptUnwrapKeyRequest, D>::encode(
(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapping_key_id,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
<fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
> fidl::encoding::Encode<CryptUnwrapKeyRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptUnwrapKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
owner: fidl::new_empty!(u64, D),
key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.owner, decoder, offset + 16, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.key, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyWithIdResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyWithIdResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CryptCreateKeyWithIdResponse, D> for &CryptCreateKeyWithIdResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyWithIdResponse>(offset);
fidl::encoding::Encode::<CryptCreateKeyWithIdResponse, D>::encode(
(
<fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapped_key,
),
<fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
&self.unwrapped_key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
> fidl::encoding::Encode<CryptCreateKeyWithIdResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyWithIdResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptCreateKeyWithIdResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.wrapped_key, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptCreateKeyResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CryptCreateKeyResponse, D> for &CryptCreateKeyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyResponse>(offset);
fidl::encoding::Encode::<CryptCreateKeyResponse, D>::encode(
(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapping_key_id,
),
<fidl::encoding::Vector<u8, 132> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapped_key,
),
<fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
&self.unwrapped_key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 132>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
> fidl::encoding::Encode<CryptCreateKeyResponse, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptCreateKeyResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
wrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 132>, D),
unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 132>, D, &mut self.wrapped_key, decoder, offset + 16, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptUnwrapKeyResponse {
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<CryptUnwrapKeyResponse, D> for &CryptUnwrapKeyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyResponse>(offset);
fidl::encoding::Encode::<CryptUnwrapKeyResponse, D>::encode(
(<fidl::encoding::Vector<u8, 80> as fidl::encoding::ValueTypeMarker>::borrow(
&self.unwrapped_key,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 80>, D>,
> fidl::encoding::Encode<CryptUnwrapKeyResponse, 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::<CryptUnwrapKeyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CryptUnwrapKeyResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 80>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 80>, D, &mut self.unwrapped_key, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DebugDeleteProfileRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DebugDeleteProfileRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DebugDeleteProfileRequest, D> for &DebugDeleteProfileRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DebugDeleteProfileRequest>(offset);
fidl::encoding::Encode::<DebugDeleteProfileRequest, D>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.volume,
),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.profile,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
> fidl::encoding::Encode<DebugDeleteProfileRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DebugDeleteProfileRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DebugDeleteProfileRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
volume: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
profile: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.volume,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.profile,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdClearForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdClearForNodeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIdClearForNodeRequest, D> for &ProjectIdClearForNodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdClearForNodeRequest)
.write_unaligned((self as *const ProjectIdClearForNodeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIdClearForNodeRequest, 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::<ProjectIdClearForNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProjectIdClearForNodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdClearRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdClearRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIdClearRequest, D>
for &ProjectIdClearRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdClearRequest)
.write_unaligned((self as *const ProjectIdClearRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIdClearRequest, 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::<ProjectIdClearRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdClearRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIdGetForNodeRequest, D> for &ProjectIdGetForNodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdGetForNodeRequest)
.write_unaligned((self as *const ProjectIdGetForNodeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIdGetForNodeRequest, 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::<ProjectIdGetForNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProjectIdGetForNodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdInfoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIdInfoRequest, D>
for &ProjectIdInfoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdInfoRequest)
.write_unaligned((self as *const ProjectIdInfoRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIdInfoRequest, 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::<ProjectIdInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdListRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdListRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListRequest, D>
for &ProjectIdListRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
fidl::encoding::Encode::<ProjectIdListRequest, D>::encode(
(
<fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
> fidl::encoding::Encode<ProjectIdListRequest, 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::<ProjectIdListRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Boxed<ProjectIterToken>,
D,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdSetForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdSetForNodeRequest {
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
}
#[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<ProjectIdSetForNodeRequest, D> for &ProjectIdSetForNodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdSetForNodeRequest)
.write_unaligned((self as *const ProjectIdSetForNodeRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<ProjectIdSetForNodeRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdSetForNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProjectIdSetForNodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64, D), project_id: fidl::new_empty!(u64, 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdSetLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdSetLimitRequest {
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
}
#[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<ProjectIdSetLimitRequest, D> for &ProjectIdSetLimitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdSetLimitRequest)
.write_unaligned((self as *const ProjectIdSetLimitRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<ProjectIdSetLimitRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdSetLimitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProjectIdSetLimitRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
project_id: fidl::new_empty!(u64, D),
bytes: fidl::new_empty!(u64, D),
nodes: fidl::new_empty!(u64, 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, 24);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdGetForNodeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIdGetForNodeResponse, D> for &ProjectIdGetForNodeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdGetForNodeResponse)
.write_unaligned((self as *const ProjectIdGetForNodeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIdGetForNodeResponse, 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::<ProjectIdGetForNodeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ProjectIdGetForNodeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[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<ProjectIdInfoResponse, D>
for &ProjectIdInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIdInfoResponse)
.write_unaligned((self as *const ProjectIdInfoResponse).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<BytesAndNodes, D>,
T1: fidl::encoding::Encode<BytesAndNodes, D>,
> fidl::encoding::Encode<ProjectIdInfoResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
limit: fidl::new_empty!(BytesAndNodes, D),
usage: fidl::new_empty!(BytesAndNodes, 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, 32);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdListResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIdListResponse {
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProjectIdListResponse, D>
for &ProjectIdListResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
fidl::encoding::Encode::<ProjectIdListResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
<fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u64>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>, D>,
> fidl::encoding::Encode<ProjectIdListResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIdListResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
entries: fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D),
next_token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u64>,
D,
&mut self.entries,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<ProjectIterToken>,
D,
&mut self.next_token,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIterToken {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProjectIterToken {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ProjectIterToken, D>
for &ProjectIterToken
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIterToken>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ProjectIterToken)
.write_unaligned((self as *const ProjectIterToken).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ProjectIterToken, 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::<ProjectIterToken>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProjectIterToken {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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, 8);
}
Ok(())
}
}
impl CryptSettings {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.active_metadata_wrapping_key_id {
return 2;
}
if let Some(_) = self.active_data_wrapping_key_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CryptSettings {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CryptSettings {
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<CryptSettings, D>
for &CryptSettings
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptSettings>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
self.active_data_wrapping_key_id.as_ref().map(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
self.active_metadata_wrapping_key_id.as_ref().map(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptSettings {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.active_data_wrapping_key_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.active_metadata_wrapping_key_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}