#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
#[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 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 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 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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CheckOptions {
pub crypt: Option<fidl::endpoints::ClientEnd<CryptMarker>>,
}
impl fidl::Standalone for CheckOptions {}
#[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, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptManagementAddWrappingKeyRequest {
pub wrapping_key_id: u64,
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: u64,
}
impl fidl::Persistable for CryptManagementForgetWrappingKeyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptManagementSetActiveKeyRequest {
pub purpose: KeyPurpose,
pub wrapping_key_id: u64,
}
impl fidl::Persistable for CryptManagementSetActiveKeyRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptUnwrapKeyRequest {
pub wrapping_key_id: u64,
pub owner: u64,
pub key: Vec<u8>,
}
impl fidl::Persistable for CryptUnwrapKeyRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CryptCreateKeyResponse {
pub wrapping_key_id: u64,
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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MountOptions {
pub crypt: Option<fidl::endpoints::ClientEnd<CryptMarker>>,
pub as_blob: bool,
}
impl fidl::Standalone for MountOptions {}
#[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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeCheckRequest {
pub options: CheckOptions,
}
impl fidl::Standalone for VolumeCheckRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeMountRequest {
pub outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
pub options: MountOptions,
}
impl fidl::Standalone for VolumeMountRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeSetLimitRequest {
pub bytes: u64,
}
impl fidl::Persistable for VolumeSetLimitRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeGetLimitResponse {
pub bytes: u64,
}
impl fidl::Persistable for VolumeGetLimitResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumesCreateRequest {
pub name: String,
pub outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
pub mount_options: MountOptions,
}
impl fidl::Standalone for VolumesCreateRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumesRemoveRequest {
pub name: String,
}
impl fidl::Persistable for VolumesRemoveRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CryptSettings {
pub active_data_wrapping_key_id: Option<u64>,
pub active_metadata_wrapping_key_id: Option<u64>,
#[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::Time) -> 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::Time,
) -> 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,
}
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> {
BlobCreatorProxyInterface::r#create(self, hash, allow_existing)
}
}
impl BlobCreatorProxyInterface for BlobCreatorProxy {
type CreateResponseFut = fidl::client::QueryResponseFut<BlobCreatorCreateResult>;
fn r#create(&self, mut hash: &[u8; 32], mut allow_existing: bool) -> Self::CreateResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BlobCreatorCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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>,
}
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()
}
}
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::Time) -> 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::Time,
) -> 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,
}
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> {
BlobReaderProxyInterface::r#get_vmo(self, blob_hash)
}
}
impl BlobReaderProxyInterface for BlobReaderProxy {
type GetVmoResponseFut = fidl::client::QueryResponseFut<BlobReaderGetVmoResult>;
fn r#get_vmo(&self, mut blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BlobReaderGetVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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>,
}
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()
}
}
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::Time) -> Result<BlobWriterEvent, fidl::Error> {
BlobWriterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_vmo(
&self,
mut size: u64,
___deadline: zx::Time,
) -> 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::Time,
) -> 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,
}
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> {
BlobWriterProxyInterface::r#get_vmo(self, size)
}
pub fn r#bytes_ready(
&self,
mut bytes_written: u64,
) -> fidl::client::QueryResponseFut<BlobWriterBytesReadyResult> {
BlobWriterProxyInterface::r#bytes_ready(self, bytes_written)
}
}
impl BlobWriterProxyInterface for BlobWriterProxy {
type GetVmoResponseFut = fidl::client::QueryResponseFut<BlobWriterGetVmoResult>;
fn r#get_vmo(&self, mut size: u64) -> Self::GetVmoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BlobWriterGetVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
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>;
fn r#bytes_ready(&self, mut bytes_written: u64) -> Self::BytesReadyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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>,
}
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()
}
}
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<(u64, 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 UnwrapKeyResponseFut: std::future::Future<Output = Result<CryptUnwrapKeyResult, fidl::Error>>
+ Send;
fn r#unwrap_key(
&self,
wrapping_key_id: u64,
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::Time) -> 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::Time,
) -> 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#unwrap_key(
&self,
mut wrapping_key_id: u64,
mut owner: u64,
mut key: &[u8],
___deadline: zx::Time,
) -> 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,
}
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> {
CryptProxyInterface::r#create_key(self, owner, purpose)
}
pub fn r#unwrap_key(
&self,
mut wrapping_key_id: u64,
mut owner: u64,
mut key: &[u8],
) -> fidl::client::QueryResponseFut<CryptUnwrapKeyResult> {
CryptProxyInterface::r#unwrap_key(self, wrapping_key_id, owner, key)
}
}
impl CryptProxyInterface for CryptProxy {
type CreateKeyResponseFut = fidl::client::QueryResponseFut<CryptCreateKeyResult>;
fn r#create_key(&self, mut owner: u64, mut purpose: KeyPurpose) -> Self::CreateKeyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CryptCreateKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
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 UnwrapKeyResponseFut = fidl::client::QueryResponseFut<CryptUnwrapKeyResult>;
fn r#unwrap_key(
&self,
mut wrapping_key_id: u64,
mut owner: u64,
mut key: &[u8],
) -> Self::UnwrapKeyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CryptUnwrapKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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,
},
})
}
0x6ec34e2b64d46be9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(CryptUnwrapKeyRequest);
fidl::encoding::Decoder::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 },
UnwrapKey { wrapping_key_id: u64, 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_unwrap_key(self) -> Option<(u64, 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::UnwrapKey { .. } => "unwrap_key",
}
}
}
#[derive(Debug, Clone)]
pub struct CryptControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
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()
}
}
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<(u64, &[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<(u64, &[u8], &[u8]), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(u64, &[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 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: u64,
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: u64,
) -> Self::SetActiveKeyResponseFut;
type ForgetWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementForgetWrappingKeyResult, fidl::Error>>
+ Send;
fn r#forget_wrapping_key(&self, wrapping_key_id: u64) -> 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::Time) -> Result<CryptManagementEvent, fidl::Error> {
CryptManagementEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#add_wrapping_key(
&self,
mut wrapping_key_id: u64,
mut key: &[u8],
___deadline: zx::Time,
) -> 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: u64,
___deadline: zx::Time,
) -> 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: u64,
___deadline: zx::Time,
) -> 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,
}
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: u64,
mut key: &[u8],
) -> fidl::client::QueryResponseFut<CryptManagementAddWrappingKeyResult> {
CryptManagementProxyInterface::r#add_wrapping_key(self, wrapping_key_id, key)
}
pub fn r#set_active_key(
&self,
mut purpose: KeyPurpose,
mut wrapping_key_id: u64,
) -> fidl::client::QueryResponseFut<CryptManagementSetActiveKeyResult> {
CryptManagementProxyInterface::r#set_active_key(self, purpose, wrapping_key_id)
}
pub fn r#forget_wrapping_key(
&self,
mut wrapping_key_id: u64,
) -> fidl::client::QueryResponseFut<CryptManagementForgetWrappingKeyResult> {
CryptManagementProxyInterface::r#forget_wrapping_key(self, wrapping_key_id)
}
}
impl CryptManagementProxyInterface for CryptManagementProxy {
type AddWrappingKeyResponseFut =
fidl::client::QueryResponseFut<CryptManagementAddWrappingKeyResult>;
fn r#add_wrapping_key(
&self,
mut wrapping_key_id: u64,
mut key: &[u8],
) -> Self::AddWrappingKeyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#set_active_key(
&self,
mut purpose: KeyPurpose,
mut wrapping_key_id: u64,
) -> Self::SetActiveKeyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#forget_wrapping_key(
&self,
mut wrapping_key_id: u64,
) -> Self::ForgetWrappingKeyResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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::Decoder::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: u64,
key: Vec<u8>,
responder: CryptManagementAddWrappingKeyResponder,
},
SetActiveKey {
purpose: KeyPurpose,
wrapping_key_id: u64,
responder: CryptManagementSetActiveKeyResponder,
},
ForgetWrappingKey { wrapping_key_id: u64, responder: CryptManagementForgetWrappingKeyResponder },
}
impl CryptManagementRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_add_wrapping_key(
self,
) -> Option<(u64, 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, u64, 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<(u64, 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>,
}
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()
}
}
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 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;
}
#[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::Time) -> Result<DebugEvent, fidl::Error> {
DebugEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#compact(&self, ___deadline: zx::Time) -> 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::Time,
) -> 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))
}
}
#[derive(Debug, Clone)]
pub struct DebugProxy {
client: fidl::client::Client,
}
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> {
DebugProxyInterface::r#compact(self)
}
pub fn r#delete_profile(
&self,
mut volume: &str,
mut profile: &str,
) -> fidl::client::QueryResponseFut<DebugDeleteProfileResult> {
DebugProxyInterface::r#delete_profile(self, volume, profile)
}
}
impl DebugProxyInterface for DebugProxy {
type CompactResponseFut = fidl::client::QueryResponseFut<DebugCompactResult>;
fn r#compact(&self) -> Self::CompactResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DebugCompactResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#delete_profile(
&self,
mut volume: &str,
mut profile: &str,
) -> Self::DeleteProfileResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DebugDeleteProfileResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x54d9d4c9cf300a1e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<DebugDeleteProfileRequest, DebugDeleteProfileResult>(
(volume, profile),
0x54d9d4c9cf300a1e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DebugEventStream {
event_receiver: fidl::client::EventReceiver,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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,
},
})
}
_ => 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 },
}
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
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DebugRequest::Compact { .. } => "compact",
DebugRequest::DeleteProfile { .. } => "delete_profile",
}
}
}
#[derive(Debug, Clone)]
pub struct DebugControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
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()
}
}
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(),
)
}
}
#[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::Time) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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,
}
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> {
ProjectIdProxyInterface::r#set_limit(self, project_id, bytes, nodes)
}
pub fn r#clear(
&self,
mut project_id: u64,
) -> fidl::client::QueryResponseFut<ProjectIdClearResult> {
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> {
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> {
ProjectIdProxyInterface::r#get_for_node(self, node_id)
}
pub fn r#clear_for_node(
&self,
mut node_id: u64,
) -> fidl::client::QueryResponseFut<ProjectIdClearForNodeResult> {
ProjectIdProxyInterface::r#clear_for_node(self, node_id)
}
pub fn r#list(
&self,
mut token: Option<&ProjectIterToken>,
) -> fidl::client::QueryResponseFut<ProjectIdListResult> {
ProjectIdProxyInterface::r#list(self, token)
}
pub fn r#info(
&self,
mut project_id: u64,
) -> fidl::client::QueryResponseFut<ProjectIdInfoResult> {
ProjectIdProxyInterface::r#info(self, project_id)
}
}
impl ProjectIdProxyInterface for ProjectIdProxy {
type SetLimitResponseFut = fidl::client::QueryResponseFut<ProjectIdSetLimitResult>;
fn r#set_limit(
&self,
mut project_id: u64,
mut bytes: u64,
mut nodes: u64,
) -> Self::SetLimitResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdSetLimitResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#clear(&self, mut project_id: u64) -> Self::ClearResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdClearResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#set_for_node(&self, mut node_id: u64, mut project_id: u64) -> Self::SetForNodeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#get_for_node(&self, mut node_id: u64) -> Self::GetForNodeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
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>;
fn r#clear_for_node(&self, mut node_id: u64) -> Self::ClearForNodeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
fn r#list(&self, mut token: Option<&ProjectIterToken>) -> Self::ListResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdListResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdListResponse, i32>,
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>;
fn r#info(&self, mut project_id: u64) -> Self::InfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ProjectIdInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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>,
}
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()
}
}
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(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VolumeMarker;
impl fidl::endpoints::ProtocolMarker for VolumeMarker {
type Proxy = VolumeProxy;
type RequestStream = VolumeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Volume";
}
pub type VolumeMountResult = Result<(), i32>;
pub type VolumeCheckResult = Result<(), i32>;
pub type VolumeSetLimitResult = Result<(), i32>;
pub type VolumeGetLimitResult = Result<u64, i32>;
pub trait VolumeProxyInterface: Send + Sync {
type MountResponseFut: std::future::Future<Output = Result<VolumeMountResult, fidl::Error>>
+ Send;
fn r#mount(
&self,
outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
options: MountOptions,
) -> Self::MountResponseFut;
type CheckResponseFut: std::future::Future<Output = Result<VolumeCheckResult, fidl::Error>>
+ Send;
fn r#check(&self, options: CheckOptions) -> Self::CheckResponseFut;
type SetLimitResponseFut: std::future::Future<Output = Result<VolumeSetLimitResult, fidl::Error>>
+ Send;
fn r#set_limit(&self, bytes: u64) -> Self::SetLimitResponseFut;
type GetLimitResponseFut: std::future::Future<Output = Result<VolumeGetLimitResult, fidl::Error>>
+ Send;
fn r#get_limit(&self) -> Self::GetLimitResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumeSynchronousProxy {
type Proxy = VolumeProxy;
type Protocol = VolumeMarker;
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 VolumeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumeMarker 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::Time) -> Result<VolumeEvent, fidl::Error> {
VolumeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#mount(
&self,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut options: MountOptions,
___deadline: zx::Time,
) -> Result<VolumeMountResult, fidl::Error> {
let _response = self.client.send_query::<
VolumeMountRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(outgoing_directory, &mut options,),
0x79c80fe2e7a7f157,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#check(
&self,
mut options: CheckOptions,
___deadline: zx::Time,
) -> Result<VolumeCheckResult, fidl::Error> {
let _response = self.client.send_query::<
VolumeCheckRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(&mut options,),
0x6bcbc999b69a8553,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_limit(
&self,
mut bytes: u64,
___deadline: zx::Time,
) -> Result<VolumeSetLimitResult, fidl::Error> {
let _response = self.client.send_query::<
VolumeSetLimitRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(bytes,),
0x28123ae4ce365b1b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_limit(&self, ___deadline: zx::Time) -> Result<VolumeGetLimitResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<VolumeGetLimitResponse, i32>,
>(
(),
0x195a1d83847a41f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.bytes))
}
}
#[derive(Debug, Clone)]
pub struct VolumeProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for VolumeProxy {
type Protocol = VolumeMarker;
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 VolumeProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumeEventStream {
VolumeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#mount(
&self,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut options: MountOptions,
) -> fidl::client::QueryResponseFut<VolumeMountResult> {
VolumeProxyInterface::r#mount(self, outgoing_directory, options)
}
pub fn r#check(
&self,
mut options: CheckOptions,
) -> fidl::client::QueryResponseFut<VolumeCheckResult> {
VolumeProxyInterface::r#check(self, options)
}
pub fn r#set_limit(
&self,
mut bytes: u64,
) -> fidl::client::QueryResponseFut<VolumeSetLimitResult> {
VolumeProxyInterface::r#set_limit(self, bytes)
}
pub fn r#get_limit(&self) -> fidl::client::QueryResponseFut<VolumeGetLimitResult> {
VolumeProxyInterface::r#get_limit(self)
}
}
impl VolumeProxyInterface for VolumeProxy {
type MountResponseFut = fidl::client::QueryResponseFut<VolumeMountResult>;
fn r#mount(
&self,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut options: MountOptions,
) -> Self::MountResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumeMountResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x79c80fe2e7a7f157,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VolumeMountRequest, VolumeMountResult>(
(outgoing_directory, &mut options),
0x79c80fe2e7a7f157,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CheckResponseFut = fidl::client::QueryResponseFut<VolumeCheckResult>;
fn r#check(&self, mut options: CheckOptions) -> Self::CheckResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumeCheckResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x6bcbc999b69a8553,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VolumeCheckRequest, VolumeCheckResult>(
(&mut options,),
0x6bcbc999b69a8553,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetLimitResponseFut = fidl::client::QueryResponseFut<VolumeSetLimitResult>;
fn r#set_limit(&self, mut bytes: u64) -> Self::SetLimitResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumeSetLimitResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x28123ae4ce365b1b,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VolumeSetLimitRequest, VolumeSetLimitResult>(
(bytes,),
0x28123ae4ce365b1b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetLimitResponseFut = fidl::client::QueryResponseFut<VolumeGetLimitResult>;
fn r#get_limit(&self) -> Self::GetLimitResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumeGetLimitResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<VolumeGetLimitResponse, i32>,
0x195a1d83847a41f,
>(_buf?)?;
Ok(_response.map(|x| x.bytes))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, VolumeGetLimitResult>(
(),
0x195a1d83847a41f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VolumeEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for VolumeEventStream {}
impl futures::stream::FusedStream for VolumeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumeEventStream {
type Item = Result<VolumeEvent, 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(VolumeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumeEvent {}
impl VolumeEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<VolumeEvent, 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: <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumeRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumeRequestStream {}
impl futures::stream::FusedStream for VolumeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumeRequestStream {
type Protocol = VolumeMarker;
type ControlHandle = VolumeControlHandle;
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 {
VolumeControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for VolumeRequestStream {
type Item = Result<VolumeRequest, 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 VolumeRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x79c80fe2e7a7f157 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumeMountRequest);
fidl::encoding::Decoder::decode_into::<VolumeMountRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::Mount {
outgoing_directory: req.outgoing_directory,
options: req.options,
responder: VolumeMountResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6bcbc999b69a8553 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumeCheckRequest);
fidl::encoding::Decoder::decode_into::<VolumeCheckRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::Check {
options: req.options,
responder: VolumeCheckResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x28123ae4ce365b1b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumeSetLimitRequest);
fidl::encoding::Decoder::decode_into::<VolumeSetLimitRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::SetLimit {
bytes: req.bytes,
responder: VolumeSetLimitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x195a1d83847a41f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetLimit {
responder: VolumeGetLimitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum VolumeRequest {
Mount {
outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
options: MountOptions,
responder: VolumeMountResponder,
},
Check { options: CheckOptions, responder: VolumeCheckResponder },
SetLimit { bytes: u64, responder: VolumeSetLimitResponder },
GetLimit { responder: VolumeGetLimitResponder },
}
impl VolumeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_mount(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
MountOptions,
VolumeMountResponder,
)> {
if let VolumeRequest::Mount { outgoing_directory, options, responder } = self {
Some((outgoing_directory, options, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_check(self) -> Option<(CheckOptions, VolumeCheckResponder)> {
if let VolumeRequest::Check { options, responder } = self {
Some((options, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_limit(self) -> Option<(u64, VolumeSetLimitResponder)> {
if let VolumeRequest::SetLimit { bytes, responder } = self {
Some((bytes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_limit(self) -> Option<(VolumeGetLimitResponder)> {
if let VolumeRequest::GetLimit { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumeRequest::Mount { .. } => "mount",
VolumeRequest::Check { .. } => "check",
VolumeRequest::SetLimit { .. } => "set_limit",
VolumeRequest::GetLimit { .. } => "get_limit",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumeControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for VolumeControlHandle {
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()
}
}
impl VolumeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeMountResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeMountResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeMountResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeMountResponder {
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,
0x79c80fe2e7a7f157,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeCheckResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeCheckResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeCheckResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeCheckResponder {
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,
0x6bcbc999b69a8553,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeSetLimitResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeSetLimitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeSetLimitResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeSetLimitResponder {
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,
0x28123ae4ce365b1b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetLimitResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetLimitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetLimitResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetLimitResponder {
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<VolumeGetLimitResponse, i32>>(
result.map(|bytes| (bytes,)),
self.tx_id,
0x195a1d83847a41f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VolumesMarker;
impl fidl::endpoints::ProtocolMarker for VolumesMarker {
type Proxy = VolumesProxy;
type RequestStream = VolumesRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumesSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.fxfs.Volumes";
}
impl fidl::endpoints::DiscoverableProtocolMarker for VolumesMarker {}
pub type VolumesCreateResult = Result<(), i32>;
pub type VolumesRemoveResult = Result<(), i32>;
pub trait VolumesProxyInterface: Send + Sync {
type CreateResponseFut: std::future::Future<Output = Result<VolumesCreateResult, fidl::Error>>
+ Send;
fn r#create(
&self,
name: &str,
outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mount_options: MountOptions,
) -> Self::CreateResponseFut;
type RemoveResponseFut: std::future::Future<Output = Result<VolumesRemoveResult, fidl::Error>>
+ Send;
fn r#remove(&self, name: &str) -> Self::RemoveResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumesSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumesSynchronousProxy {
type Proxy = VolumesProxy;
type Protocol = VolumesMarker;
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 VolumesSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumesMarker 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::Time) -> Result<VolumesEvent, fidl::Error> {
VolumesEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create(
&self,
mut name: &str,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut mount_options: MountOptions,
___deadline: zx::Time,
) -> Result<VolumesCreateResult, fidl::Error> {
let _response = self.client.send_query::<
VolumesCreateRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, outgoing_directory, &mut mount_options,),
0x1c4f356c34e6dbff,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove(
&self,
mut name: &str,
___deadline: zx::Time,
) -> Result<VolumesRemoveResult, fidl::Error> {
let _response = self.client.send_query::<
VolumesRemoveRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x2bd6218497310d7e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct VolumesProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for VolumesProxy {
type Protocol = VolumesMarker;
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 VolumesProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumesEventStream {
VolumesEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create(
&self,
mut name: &str,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut mount_options: MountOptions,
) -> fidl::client::QueryResponseFut<VolumesCreateResult> {
VolumesProxyInterface::r#create(self, name, outgoing_directory, mount_options)
}
pub fn r#remove(&self, mut name: &str) -> fidl::client::QueryResponseFut<VolumesRemoveResult> {
VolumesProxyInterface::r#remove(self, name)
}
}
impl VolumesProxyInterface for VolumesProxy {
type CreateResponseFut = fidl::client::QueryResponseFut<VolumesCreateResult>;
fn r#create(
&self,
mut name: &str,
mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mut mount_options: MountOptions,
) -> Self::CreateResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumesCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x1c4f356c34e6dbff,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VolumesCreateRequest, VolumesCreateResult>(
(name, outgoing_directory, &mut mount_options),
0x1c4f356c34e6dbff,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveResponseFut = fidl::client::QueryResponseFut<VolumesRemoveResult>;
fn r#remove(&self, mut name: &str) -> Self::RemoveResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<VolumesRemoveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x2bd6218497310d7e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<VolumesRemoveRequest, VolumesRemoveResult>(
(name,),
0x2bd6218497310d7e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VolumesEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for VolumesEventStream {}
impl futures::stream::FusedStream for VolumesEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumesEventStream {
type Item = Result<VolumesEvent, 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(VolumesEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumesEvent {}
impl VolumesEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<VolumesEvent, 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: <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumesRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumesRequestStream {}
impl futures::stream::FusedStream for VolumesRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumesRequestStream {
type Protocol = VolumesMarker;
type ControlHandle = VolumesControlHandle;
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 {
VolumesControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for VolumesRequestStream {
type Item = Result<VolumesRequest, 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 VolumesRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x1c4f356c34e6dbff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumesCreateRequest);
fidl::encoding::Decoder::decode_into::<VolumesCreateRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumesControlHandle { inner: this.inner.clone() };
Ok(VolumesRequest::Create {
name: req.name,
outgoing_directory: req.outgoing_directory,
mount_options: req.mount_options,
responder: VolumesCreateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2bd6218497310d7e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumesRemoveRequest);
fidl::encoding::Decoder::decode_into::<VolumesRemoveRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumesControlHandle { inner: this.inner.clone() };
Ok(VolumesRequest::Remove {
name: req.name,
responder: VolumesRemoveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum VolumesRequest {
Create {
name: String,
outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
mount_options: MountOptions,
responder: VolumesCreateResponder,
},
Remove { name: String, responder: VolumesRemoveResponder },
}
impl VolumesRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
MountOptions,
VolumesCreateResponder,
)> {
if let VolumesRequest::Create { name, outgoing_directory, mount_options, responder } = self
{
Some((name, outgoing_directory, mount_options, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove(self) -> Option<(String, VolumesRemoveResponder)> {
if let VolumesRequest::Remove { name, responder } = self {
Some((name, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumesRequest::Create { .. } => "create",
VolumesRequest::Remove { .. } => "remove",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumesControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for VolumesControlHandle {
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()
}
}
impl VolumesControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumesCreateResponder {
control_handle: std::mem::ManuallyDrop<VolumesControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumesCreateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumesCreateResponder {
type ControlHandle = VolumesControlHandle;
fn control_handle(&self) -> &VolumesControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumesCreateResponder {
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,
0x1c4f356c34e6dbff,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumesRemoveResponder {
control_handle: std::mem::ManuallyDrop<VolumesControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumesRemoveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumesRemoveResponder {
type ControlHandle = VolumesControlHandle;
fn control_handle(&self) -> &VolumesControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumesRemoveResponder {
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,
0x2bd6218497310d7e,
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<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for CreateBlobError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CreateBlobError {
#[inline(always)]
fn new_empty() -> Self {
Self::AlreadyExists
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for KeyPurpose {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for KeyPurpose {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
impl fidl::encoding::ValueTypeMarker for BlobCreatorCreateRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlobCreatorCreateRequest> for &BlobCreatorCreateRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobCreatorCreateRequest>(offset);
fidl::encoding::Encode::<BlobCreatorCreateRequest>::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<
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>>,
T1: fidl::encoding::Encode<bool>,
> fidl::encoding::Encode<BlobCreatorCreateRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for BlobCreatorCreateRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>),
allow_existing: fidl::new_empty!(bool),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<u8, 32>, &mut self.hash, decoder, offset + 0, _depth)?;
fidl::decode!(bool, &mut self.allow_existing, decoder, offset + 32, _depth)?;
Ok(())
}
}
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
}
}
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::Encode<BlobCreatorCreateResponse> for &mut BlobCreatorCreateResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
fidl::encoding::Encode::<BlobCreatorCreateResponse>::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::Encode<BlobCreatorCreateResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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> for BlobCreatorCreateResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
writer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
&mut self.writer,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for BlobReaderGetVmoRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlobReaderGetVmoRequest> for &BlobReaderGetVmoRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>>>
fidl::encoding::Encode<BlobReaderGetVmoRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobReaderGetVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BlobReaderGetVmoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { blob_hash: fidl::new_empty!(fidl::encoding::Array<u8, 32>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
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::Encode<BlobReaderGetVmoResponse> for &mut BlobReaderGetVmoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
fidl::encoding::Encode::<BlobReaderGetVmoResponse>::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::Encode<BlobReaderGetVmoResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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> for BlobReaderGetVmoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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>, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for BlobWriterBytesReadyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlobWriterBytesReadyRequest> for &BlobWriterBytesReadyRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<BlobWriterBytesReadyRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterBytesReadyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BlobWriterBytesReadyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes_written: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for BlobWriterGetVmoRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlobWriterGetVmoRequest> for &BlobWriterGetVmoRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<BlobWriterGetVmoRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterGetVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BlobWriterGetVmoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { size: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
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::Encode<BlobWriterGetVmoResponse> for &mut BlobWriterGetVmoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
fidl::encoding::Encode::<BlobWriterGetVmoResponse>::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::Encode<BlobWriterGetVmoResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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> for BlobWriterGetVmoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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>, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for BytesAndNodes {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BytesAndNodes> for &BytesAndNodes {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<BytesAndNodes> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for BytesAndNodes {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(u64), nodes: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for CheckOptions {
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
}
}
impl fidl::encoding::ResourceTypeMarker for CheckOptions {
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::Encode<CheckOptions> for &mut CheckOptions {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CheckOptions>(offset);
fidl::encoding::Encode::<CheckOptions>::encode(
(<fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.crypt
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>,
>,
> fidl::encoding::Encode<CheckOptions> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CheckOptions>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CheckOptions {
#[inline(always)]
fn new_empty() -> Self {
Self {
crypt: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>,
&mut self.crypt,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptCreateKeyRequest> for &CryptCreateKeyRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyRequest>(offset);
fidl::encoding::Encode::<CryptCreateKeyRequest>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
<KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<KeyPurpose>>
fidl::encoding::Encode<CryptCreateKeyRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for CryptCreateKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { owner: fidl::new_empty!(u64), purpose: fidl::new_empty!(KeyPurpose) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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, &mut self.owner, decoder, offset + 0, _depth)?;
fidl::decode!(KeyPurpose, &mut self.purpose, decoder, offset + 8, _depth)?;
Ok(())
}
}
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 {
24
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementAddWrappingKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest>
for &CryptManagementAddWrappingKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementAddWrappingKeyRequest>(offset);
fidl::encoding::Encode::<CryptManagementAddWrappingKeyRequest>::encode(
(
<u64 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<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>>,
> fidl::encoding::Encode<CryptManagementAddWrappingKeyRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptManagementAddWrappingKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(u64),
key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u64, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 32>, &mut self.key, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CryptManagementForgetWrappingKeyRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementForgetWrappingKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptManagementForgetWrappingKeyRequest>
for &CryptManagementForgetWrappingKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<CryptManagementForgetWrappingKeyRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementForgetWrappingKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptManagementForgetWrappingKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { wrapping_key_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for CryptManagementSetActiveKeyRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for CryptManagementSetActiveKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptManagementSetActiveKeyRequest>
for &CryptManagementSetActiveKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
fidl::encoding::Encode::<CryptManagementSetActiveKeyRequest>::encode(
(
<KeyPurpose as fidl::encoding::ValueTypeMarker>::borrow(&self.purpose),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrapping_key_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<KeyPurpose>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<CryptManagementSetActiveKeyRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptManagementSetActiveKeyRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptManagementSetActiveKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { purpose: fidl::new_empty!(KeyPurpose), wrapping_key_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(KeyPurpose, &mut self.purpose, decoder, offset + 0, _depth)?;
fidl::decode!(u64, &mut self.wrapping_key_id, decoder, offset + 8, _depth)?;
Ok(())
}
}
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 {
32
}
}
impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptUnwrapKeyRequest> for &CryptUnwrapKeyRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyRequest>(offset);
fidl::encoding::Encode::<CryptUnwrapKeyRequest>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrapping_key_id),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.owner),
<fidl::encoding::Vector<u8, 48> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<u64>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 48>>,
> fidl::encoding::Encode<CryptUnwrapKeyRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptUnwrapKeyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(u64),
owner: fidl::new_empty!(u64),
key: fidl::new_empty!(fidl::encoding::Vector<u8, 48>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u64, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(u64, &mut self.owner, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 48>, &mut self.key, decoder, offset + 16, _depth)?;
Ok(())
}
}
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 {
40
}
}
impl fidl::encoding::ValueTypeMarker for CryptCreateKeyResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptCreateKeyResponse> for &CryptCreateKeyResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptCreateKeyResponse>(offset);
fidl::encoding::Encode::<CryptCreateKeyResponse>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrapping_key_id),
<fidl::encoding::Vector<u8, 48> as fidl::encoding::ValueTypeMarker>::borrow(
&self.wrapped_key,
),
<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.unwrapped_key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 48>>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>>,
> fidl::encoding::Encode<CryptCreateKeyResponse> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptCreateKeyResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
wrapping_key_id: fidl::new_empty!(u64),
wrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 48>),
unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u64, &mut self.wrapping_key_id, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 48>, &mut self.wrapped_key, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 32>, &mut self.unwrapped_key, decoder, offset + 24, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for CryptUnwrapKeyResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptUnwrapKeyResponse> for &CryptUnwrapKeyResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyResponse>(offset);
fidl::encoding::Encode::<CryptUnwrapKeyResponse>::encode(
(<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.unwrapped_key,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>>>
fidl::encoding::Encode<CryptUnwrapKeyResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CryptUnwrapKeyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptUnwrapKeyResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { unwrapped_key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 32>, &mut self.unwrapped_key, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DebugDeleteProfileRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DebugDeleteProfileRequest> for &DebugDeleteProfileRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DebugDeleteProfileRequest>(offset);
fidl::encoding::Encode::<DebugDeleteProfileRequest>::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<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>>,
> fidl::encoding::Encode<DebugDeleteProfileRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for DebugDeleteProfileRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
volume: fidl::new_empty!(fidl::encoding::BoundedString<255>),
profile: fidl::new_empty!(fidl::encoding::BoundedString<255>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
&mut self.volume,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
&mut self.profile,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MountOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ResourceTypeMarker for MountOptions {
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::Encode<MountOptions> for &mut MountOptions {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MountOptions>(offset);
fidl::encoding::Encode::<MountOptions>::encode(
(
<fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.crypt
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.as_blob),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>,
>,
T1: fidl::encoding::Encode<bool>,
> fidl::encoding::Encode<MountOptions> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MountOptions>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MountOptions {
#[inline(always)]
fn new_empty() -> Self {
Self {
crypt: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>
),
as_blob: fidl::new_empty!(bool),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CryptMarker>>,
>,
&mut self.crypt,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, &mut self.as_blob, decoder, offset + 4, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdClearForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdClearForNodeRequest> for &ProjectIdClearForNodeRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<ProjectIdClearForNodeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdClearForNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdClearForNodeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdClearRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdClearRequest> for &ProjectIdClearRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ProjectIdClearRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdClearRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdClearRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdGetForNodeRequest> for &ProjectIdGetForNodeRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ProjectIdGetForNodeRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdGetForNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdGetForNodeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdInfoRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdInfoRequest> for &ProjectIdInfoRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ProjectIdInfoRequest> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdInfoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdListRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdListRequest> for &ProjectIdListRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
fidl::encoding::Encode::<ProjectIdListRequest>::encode(
(
<fidl::encoding::Boxed<ProjectIterToken> as fidl::encoding::ValueTypeMarker>::borrow(&self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>>>
fidl::encoding::Encode<ProjectIdListRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdListRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Boxed<ProjectIterToken>,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdSetForNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdSetForNodeRequest> for &ProjectIdSetForNodeRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<ProjectIdSetForNodeRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for ProjectIdSetForNodeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u64), project_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdSetLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdSetLimitRequest> for &ProjectIdSetLimitRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<u64>,
T2: fidl::encoding::Encode<u64>,
> fidl::encoding::Encode<ProjectIdSetLimitRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for ProjectIdSetLimitRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
project_id: fidl::new_empty!(u64),
bytes: fidl::new_empty!(u64),
nodes: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdGetForNodeResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdGetForNodeResponse> for &ProjectIdGetForNodeResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ProjectIdGetForNodeResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdGetForNodeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIdGetForNodeResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { project_id: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdInfoResponse> for &ProjectIdInfoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<BytesAndNodes>, T1: fidl::encoding::Encode<BytesAndNodes>>
fidl::encoding::Encode<ProjectIdInfoResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for ProjectIdInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { limit: fidl::new_empty!(BytesAndNodes), usage: fidl::new_empty!(BytesAndNodes) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIdListResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIdListResponse> for &ProjectIdListResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIdListResponse>(offset);
fidl::encoding::Encode::<ProjectIdListResponse>::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<
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u64>>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<ProjectIterToken>>,
> fidl::encoding::Encode<ProjectIdListResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for ProjectIdListResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
entries: fidl::new_empty!(fidl::encoding::UnboundedVector<u64>),
next_token: fidl::new_empty!(fidl::encoding::Boxed<ProjectIterToken>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u64>,
&mut self.entries,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<ProjectIterToken>,
&mut self.next_token,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ProjectIterToken {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ProjectIterToken> for &ProjectIterToken {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ProjectIterToken> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProjectIterToken>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ProjectIterToken {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeCheckRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for VolumeCheckRequest {
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::Encode<VolumeCheckRequest> for &mut VolumeCheckRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeCheckRequest>(offset);
fidl::encoding::Encode::<VolumeCheckRequest>::encode(
(<CheckOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.options,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<CheckOptions>> fidl::encoding::Encode<VolumeCheckRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeCheckRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeCheckRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { options: fidl::new_empty!(CheckOptions) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(CheckOptions, &mut self.options, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeMountRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
impl fidl::encoding::ResourceTypeMarker for VolumeMountRequest {
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::Encode<VolumeMountRequest> for &mut VolumeMountRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeMountRequest>(offset);
fidl::encoding::Encode::<VolumeMountRequest>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.outgoing_directory,
),
<MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.options,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
>,
T1: fidl::encoding::Encode<MountOptions>,
> fidl::encoding::Encode<VolumeMountRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeMountRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeMountRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
outgoing_directory: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>
),
options: fidl::new_empty!(MountOptions),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
&mut self.outgoing_directory,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(MountOptions, &mut self.options, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeSetLimitRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeSetLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeSetLimitRequest> for &VolumeSetLimitRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeSetLimitRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeSetLimitRequest)
.write_unaligned((self as *const VolumeSetLimitRequest).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<VolumeSetLimitRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeSetLimitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeSetLimitRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeGetLimitResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeGetLimitResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeGetLimitResponse> for &VolumeGetLimitResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeGetLimitResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeGetLimitResponse)
.write_unaligned((self as *const VolumeGetLimitResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<VolumeGetLimitResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeGetLimitResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeGetLimitResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumesCreateRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for VolumesCreateRequest {
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::Encode<VolumesCreateRequest> for &mut VolumesCreateRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumesCreateRequest>(offset);
fidl::encoding::Encode::<VolumesCreateRequest>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.outgoing_directory,
),
<MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.mount_options,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
>,
T2: fidl::encoding::Encode<MountOptions>,
> fidl::encoding::Encode<VolumesCreateRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumesCreateRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumesCreateRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<255>),
outgoing_directory: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>
),
mount_options: fidl::new_empty!(MountOptions),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
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 + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<255>,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
&mut self.outgoing_directory,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(MountOptions, &mut self.mount_options, decoder, offset + 20, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for VolumesRemoveRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumesRemoveRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumesRemoveRequest> for &VolumesRemoveRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumesRemoveRequest>(offset);
fidl::encoding::Encode::<VolumesRemoveRequest>::encode(
(<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>>>
fidl::encoding::Encode<VolumesRemoveRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumesRemoveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumesRemoveRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(fidl::encoding::BoundedString<255>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
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
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for CryptSettings {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CryptSettings> for &CryptSettings {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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::<u64>(
self.active_data_wrapping_key_id
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64>(
self.active_metadata_wrapping_key_id
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CryptSettings {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.active_data_wrapping_key_id.get_or_insert_with(|| fidl::new_empty!(u64));
fidl::decode!(u64, 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 =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.active_metadata_wrapping_key_id
.get_or_insert_with(|| fidl::new_empty!(u64));
fidl::decode!(u64, 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(())
}
}
}