#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_RESOLUTION_CONTEXT_SIZE: u32 = 8192;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum BlobWrittenError {
NotWritten = 1,
UnopenedBlob = 2,
}
impl BlobWrittenError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NotWritten),
2 => Some(Self::UnopenedBlob),
_ => 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)]
#[repr(u32)]
pub enum GcProtection {
OpenPackageTracking = 1,
Retained = 2,
}
impl GcProtection {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::OpenPackageTracking),
2 => Some(Self::Retained),
_ => 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)]
#[repr(u32)]
pub enum GetInfoError {
UnknownUrl = 1,
Verification = 2,
NotAvailable = 3,
}
impl GetInfoError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::UnknownUrl),
2 => Some(Self::Verification),
3 => Some(Self::NotAvailable),
_ => 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)]
#[repr(u32)]
pub enum GetSubpackageError {
SuperpackageClosed = 1,
DoesNotExist = 2,
Internal = 3,
}
impl GetSubpackageError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::SuperpackageClosed),
2 => Some(Self::DoesNotExist),
3 => 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)]
#[repr(u32)]
pub enum OpenBlobError {
OutOfSpace = 1,
ConcurrentWrite = 2,
UnspecifiedIo = 3,
Internal = 4,
}
impl OpenBlobError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::OutOfSpace),
2 => Some(Self::ConcurrentWrite),
3 => Some(Self::UnspecifiedIo),
4 => 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)]
#[repr(u32)]
pub enum RepositoryStorageType {
Ephemeral = 1,
Persistent = 2,
}
impl RepositoryStorageType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Ephemeral),
2 => Some(Self::Persistent),
_ => 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)]
#[repr(i32)]
pub enum ResolveError {
Internal = 1,
AccessDenied = 2,
Io = 3,
BlobNotFound = 4,
PackageNotFound = 5,
RepoNotFound = 6,
NoSpace = 7,
UnavailableBlob = 8,
UnavailableRepoMetadata = 9,
InvalidUrl = 10,
InvalidContext = 11,
}
impl ResolveError {
#[inline]
pub fn from_primitive(prim: i32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::AccessDenied),
3 => Some(Self::Io),
4 => Some(Self::BlobNotFound),
5 => Some(Self::PackageNotFound),
6 => Some(Self::RepoNotFound),
7 => Some(Self::NoSpace),
8 => Some(Self::UnavailableBlob),
9 => Some(Self::UnavailableRepoMetadata),
10 => Some(Self::InvalidUrl),
11 => Some(Self::InvalidContext),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> i32 {
self as i32
}
#[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 SetUpgradableUrlsError {
PartialSet,
Internal,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! SetUpgradableUrlsErrorUnknown {
() => {
_
};
}
impl SetUpgradableUrlsError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::PartialSet),
2 => Some(Self::Internal),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::PartialSet,
2 => Self::Internal,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::PartialSet => 1,
Self::Internal => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum WriteError {
UnknownUrl = 1,
Verification = 2,
Download = 3,
Storage = 4,
}
impl WriteError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::UnknownUrl),
2 => Some(Self::Verification),
3 => Some(Self::Download),
4 => Some(Self::Storage),
_ => 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(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlobId {
pub merkle_root: [u8; 32],
}
impl fidl::Persistable for BlobId {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BlobIdIteratorNextResponse {
pub blobs: Vec<BlobId>,
}
impl fidl::Persistable for BlobIdIteratorNextResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlobInfo {
pub blob_id: BlobId,
pub length: u64,
}
impl fidl::Persistable for BlobInfo {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BlobInfoIteratorNextResponse {
pub blobs: Vec<BlobInfo>,
}
impl fidl::Persistable for BlobInfoIteratorNextResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CupGetInfoRequest {
pub url: PackageUrl,
}
impl fidl::Persistable for CupGetInfoRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CupWriteRequest {
pub url: PackageUrl,
pub cup: CupData,
}
impl fidl::Persistable for CupWriteRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CupGetInfoResponse {
pub version: String,
pub channel: String,
}
impl fidl::Persistable for CupGetInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FontResolverResolveRequest {
pub package_url: String,
pub directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for FontResolverResolveRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NeededBlobsBlobWrittenRequest {
pub blob_id: BlobId,
}
impl fidl::Persistable for NeededBlobsBlobWrittenRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NeededBlobsGetMissingBlobsRequest {
pub iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsGetMissingBlobsRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NeededBlobsOpenBlobRequest {
pub blob_id: BlobId,
}
impl fidl::Persistable for NeededBlobsOpenBlobRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NeededBlobsOpenBlobResponse {
pub writer: Option<Box<BlobWriter>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsOpenBlobResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NeededBlobsOpenMetaBlobResponse {
pub writer: Option<Box<BlobWriter>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsOpenMetaBlobResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageCacheBasePackageIndexRequest {
pub iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheBasePackageIndexRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageCacheCachePackageIndexRequest {
pub iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheCachePackageIndexRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageCacheGetRequest {
pub meta_far_blob: BlobInfo,
pub gc_protection: GcProtection,
pub needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PackageCacheGetRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageCacheGetSubpackageRequest {
pub superpackage: BlobId,
pub subpackage: PackageUrl,
pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheGetSubpackageRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageCacheSetUpgradableUrlsRequest {
pub pinned_urls: Vec<PackageUrl>,
}
impl fidl::Persistable for PackageCacheSetUpgradableUrlsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageIndexEntry {
pub package_url: PackageUrl,
pub meta_far_blob_id: BlobId,
}
impl fidl::Persistable for PackageIndexEntry {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageIndexIteratorNextResponse {
pub entries: Vec<PackageIndexEntry>,
}
impl fidl::Persistable for PackageIndexIteratorNextResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageResolverGetHashRequest {
pub package_url: PackageUrl,
}
impl fidl::Persistable for PackageResolverGetHashRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageResolverResolveRequest {
pub package_url: String,
pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageResolverResolveRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageResolverResolveWithContextRequest {
pub package_url: String,
pub context: ResolutionContext,
pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageResolverResolveWithContextRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct PackageResolverGetHashResponse {
pub meta_far_blob_id: BlobId,
}
impl fidl::Persistable for PackageResolverGetHashResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageResolverResolveWithContextResponse {
pub resolved_context: ResolutionContext,
}
impl fidl::Persistable for PackageResolverResolveWithContextResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageResolverResolveResponse {
pub resolved_context: ResolutionContext,
}
impl fidl::Persistable for PackageResolverResolveResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PackageUrl {
pub url: String,
}
impl fidl::Persistable for PackageUrl {}
#[derive(Clone, Debug, PartialEq)]
pub struct RepositoryIteratorNextResponse {
pub repos: Vec<RepositoryConfig>,
}
impl fidl::Persistable for RepositoryIteratorNextResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RepositoryManagerAddMirrorRequest {
pub repo_url: String,
pub mirror: MirrorConfig,
}
impl fidl::Persistable for RepositoryManagerAddMirrorRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct RepositoryManagerAddRequest {
pub repo: RepositoryConfig,
}
impl fidl::Persistable for RepositoryManagerAddRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RepositoryManagerListRequest {
pub iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RepositoryManagerListRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RepositoryManagerRemoveMirrorRequest {
pub repo_url: String,
pub mirror_url: String,
}
impl fidl::Persistable for RepositoryManagerRemoveMirrorRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RepositoryManagerRemoveRequest {
pub repo_url: String,
}
impl fidl::Persistable for RepositoryManagerRemoveRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RepositoryUrl {
pub url: String,
}
impl fidl::Persistable for RepositoryUrl {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ResolutionContext {
pub bytes: Vec<u8>,
}
impl fidl::Persistable for ResolutionContext {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RetainedPackagesReplaceRequest {
pub iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RetainedPackagesReplaceRequest
{
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CupData {
pub request: Option<Vec<u8>>,
pub key_id: Option<u64>,
pub nonce: Option<[u8; 32]>,
pub response: Option<Vec<u8>>,
pub signature: Option<Vec<u8>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CupData {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MirrorConfig {
pub mirror_url: Option<String>,
pub subscribe: Option<bool>,
pub blob_mirror_url: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MirrorConfig {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RepositoryConfig {
pub repo_url: Option<String>,
pub root_keys: Option<Vec<RepositoryKeyConfig>>,
pub mirrors: Option<Vec<MirrorConfig>>,
pub root_version: Option<u32>,
pub root_threshold: Option<u32>,
pub use_local_mirror: Option<bool>,
pub storage_type: Option<RepositoryStorageType>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RepositoryConfig {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum BlobWriter {
File(fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>),
Writer(fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>),
}
impl BlobWriter {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::File(_) => 1,
Self::Writer(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriter {}
#[derive(Clone, Debug)]
pub enum RepositoryKeyConfig {
Ed25519Key(Vec<u8>),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! RepositoryKeyConfigUnknown {
() => {
_
};
}
impl PartialEq for RepositoryKeyConfig {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Ed25519Key(x), Self::Ed25519Key(y)) => *x == *y,
_ => false,
}
}
}
impl RepositoryKeyConfig {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Ed25519Key(_) => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for RepositoryKeyConfig {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobIdIteratorMarker;
impl fidl::endpoints::ProtocolMarker for BlobIdIteratorMarker {
type Proxy = BlobIdIteratorProxy;
type RequestStream = BlobIdIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobIdIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BlobIdIterator";
}
pub trait BlobIdIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<BlobId>, fidl::Error>> + Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobIdIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobIdIteratorSynchronousProxy {
type Proxy = BlobIdIteratorProxy;
type Protocol = BlobIdIteratorMarker;
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 BlobIdIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<BlobIdIteratorEvent, fidl::Error> {
BlobIdIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<BlobId>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, BlobIdIteratorNextResponse>(
(),
0x5eb0af0daeb8f537,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.blobs)
}
}
#[derive(Debug, Clone)]
pub struct BlobIdIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobIdIteratorProxy {
type Protocol = BlobIdIteratorMarker;
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 BlobIdIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobIdIteratorEventStream {
BlobIdIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(
&self,
) -> fidl::client::QueryResponseFut<Vec<BlobId>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
BlobIdIteratorProxyInterface::r#next(self)
}
}
impl BlobIdIteratorProxyInterface for BlobIdIteratorProxy {
type NextResponseFut =
fidl::client::QueryResponseFut<Vec<BlobId>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<BlobId>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BlobIdIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5eb0af0daeb8f537,
>(_buf?)?;
Ok(_response.blobs)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BlobId>>(
(),
0x5eb0af0daeb8f537,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobIdIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobIdIteratorEventStream {}
impl futures::stream::FusedStream for BlobIdIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobIdIteratorEventStream {
type Item = Result<BlobIdIteratorEvent, 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(BlobIdIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobIdIteratorEvent {}
impl BlobIdIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobIdIteratorEvent, 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:
<BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobIdIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobIdIteratorRequestStream {}
impl futures::stream::FusedStream for BlobIdIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobIdIteratorRequestStream {
type Protocol = BlobIdIteratorMarker;
type ControlHandle = BlobIdIteratorControlHandle;
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 {
BlobIdIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for BlobIdIteratorRequestStream {
type Item = Result<BlobIdIteratorRequest, 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 BlobIdIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x5eb0af0daeb8f537 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BlobIdIteratorControlHandle { inner: this.inner.clone() };
Ok(BlobIdIteratorRequest::Next {
responder: BlobIdIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobIdIteratorRequest {
Next { responder: BlobIdIteratorNextResponder },
}
impl BlobIdIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(BlobIdIteratorNextResponder)> {
if let BlobIdIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobIdIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobIdIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobIdIteratorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl BlobIdIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobIdIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<BlobIdIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobIdIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobIdIteratorNextResponder {
type ControlHandle = BlobIdIteratorControlHandle;
fn control_handle(&self) -> &BlobIdIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobIdIteratorNextResponder {
pub fn send(self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
let _result = self.send_raw(blobs);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
let _result = self.send_raw(blobs);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BlobIdIteratorNextResponse>(
(blobs,),
self.tx_id,
0x5eb0af0daeb8f537,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BlobInfoIteratorMarker;
impl fidl::endpoints::ProtocolMarker for BlobInfoIteratorMarker {
type Proxy = BlobInfoIteratorProxy;
type RequestStream = BlobInfoIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BlobInfoIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BlobInfoIterator";
}
pub trait BlobInfoIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<BlobInfo>, fidl::Error>> + Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BlobInfoIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BlobInfoIteratorSynchronousProxy {
type Proxy = BlobInfoIteratorProxy;
type Protocol = BlobInfoIteratorMarker;
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 BlobInfoIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<BlobInfoIteratorEvent, fidl::Error> {
BlobInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<BlobInfo>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, BlobInfoIteratorNextResponse>(
(),
0x2b889489a59b6970,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.blobs)
}
}
#[derive(Debug, Clone)]
pub struct BlobInfoIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BlobInfoIteratorProxy {
type Protocol = BlobInfoIteratorMarker;
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 BlobInfoIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BlobInfoIteratorEventStream {
BlobInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(
&self,
) -> fidl::client::QueryResponseFut<Vec<BlobInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
BlobInfoIteratorProxyInterface::r#next(self)
}
}
impl BlobInfoIteratorProxyInterface for BlobInfoIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<
Vec<BlobInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<BlobInfo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BlobInfoIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2b889489a59b6970,
>(_buf?)?;
Ok(_response.blobs)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BlobInfo>>(
(),
0x2b889489a59b6970,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BlobInfoIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BlobInfoIteratorEventStream {}
impl futures::stream::FusedStream for BlobInfoIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BlobInfoIteratorEventStream {
type Item = Result<BlobInfoIteratorEvent, 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(BlobInfoIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BlobInfoIteratorEvent {}
impl BlobInfoIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BlobInfoIteratorEvent, 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:
<BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BlobInfoIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BlobInfoIteratorRequestStream {}
impl futures::stream::FusedStream for BlobInfoIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BlobInfoIteratorRequestStream {
type Protocol = BlobInfoIteratorMarker;
type ControlHandle = BlobInfoIteratorControlHandle;
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 {
BlobInfoIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for BlobInfoIteratorRequestStream {
type Item = Result<BlobInfoIteratorRequest, 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 BlobInfoIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x2b889489a59b6970 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BlobInfoIteratorControlHandle { inner: this.inner.clone() };
Ok(BlobInfoIteratorRequest::Next {
responder: BlobInfoIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BlobInfoIteratorRequest {
Next { responder: BlobInfoIteratorNextResponder },
}
impl BlobInfoIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(BlobInfoIteratorNextResponder)> {
if let BlobInfoIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BlobInfoIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct BlobInfoIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BlobInfoIteratorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl BlobInfoIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BlobInfoIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<BlobInfoIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BlobInfoIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BlobInfoIteratorNextResponder {
type ControlHandle = BlobInfoIteratorControlHandle;
fn control_handle(&self) -> &BlobInfoIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BlobInfoIteratorNextResponder {
pub fn send(self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
let _result = self.send_raw(blobs);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
let _result = self.send_raw(blobs);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BlobInfoIteratorNextResponse>(
(blobs,),
self.tx_id,
0x2b889489a59b6970,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CupMarker;
impl fidl::endpoints::ProtocolMarker for CupMarker {
type Proxy = CupProxy;
type RequestStream = CupRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CupSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.Cup";
}
impl fidl::endpoints::DiscoverableProtocolMarker for CupMarker {}
pub type CupWriteResult = Result<(), WriteError>;
pub type CupGetInfoResult = Result<(String, String), GetInfoError>;
pub trait CupProxyInterface: Send + Sync {
type WriteResponseFut: std::future::Future<Output = Result<CupWriteResult, fidl::Error>> + Send;
fn r#write(&self, url: &PackageUrl, cup: &CupData) -> Self::WriteResponseFut;
type GetInfoResponseFut: std::future::Future<Output = Result<CupGetInfoResult, fidl::Error>>
+ Send;
fn r#get_info(&self, url: &PackageUrl) -> Self::GetInfoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CupSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CupSynchronousProxy {
type Proxy = CupProxy;
type Protocol = CupMarker;
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 CupSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<CupEvent, fidl::Error> {
CupEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#write(
&self,
mut url: &PackageUrl,
mut cup: &CupData,
___deadline: zx::MonotonicInstant,
) -> Result<CupWriteResult, fidl::Error> {
let _response = self.client.send_query::<CupWriteRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
WriteError,
>>(
(url, cup),
0x29f30e83bda39c37,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_info(
&self,
mut url: &PackageUrl,
___deadline: zx::MonotonicInstant,
) -> Result<CupGetInfoResult, fidl::Error> {
let _response = self.client.send_query::<
CupGetInfoRequest,
fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>,
>(
(url,),
0x5b2cedd887209b9c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.version, x.channel)))
}
}
#[derive(Debug, Clone)]
pub struct CupProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CupProxy {
type Protocol = CupMarker;
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 CupProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CupEventStream {
CupEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#write(
&self,
mut url: &PackageUrl,
mut cup: &CupData,
) -> fidl::client::QueryResponseFut<CupWriteResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
CupProxyInterface::r#write(self, url, cup)
}
pub fn r#get_info(
&self,
mut url: &PackageUrl,
) -> fidl::client::QueryResponseFut<
CupGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CupProxyInterface::r#get_info(self, url)
}
}
impl CupProxyInterface for CupProxy {
type WriteResponseFut = fidl::client::QueryResponseFut<
CupWriteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write(&self, mut url: &PackageUrl, mut cup: &CupData) -> Self::WriteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CupWriteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, WriteError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x29f30e83bda39c37,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<CupWriteRequest, CupWriteResult>(
(url, cup),
0x29f30e83bda39c37,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetInfoResponseFut = fidl::client::QueryResponseFut<
CupGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_info(&self, mut url: &PackageUrl) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CupGetInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b2cedd887209b9c,
>(_buf?)?;
Ok(_response.map(|x| (x.version, x.channel)))
}
self.client.send_query_and_decode::<CupGetInfoRequest, CupGetInfoResult>(
(url,),
0x5b2cedd887209b9c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CupEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CupEventStream {}
impl futures::stream::FusedStream for CupEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CupEventStream {
type Item = Result<CupEvent, 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(CupEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CupEvent {}
impl CupEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CupEvent, 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: <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CupRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CupRequestStream {}
impl futures::stream::FusedStream for CupRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CupRequestStream {
type Protocol = CupMarker;
type ControlHandle = CupControlHandle;
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 {
CupControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for CupRequestStream {
type Item = Result<CupRequest, 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 CupRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x29f30e83bda39c37 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CupWriteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CupWriteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CupControlHandle { inner: this.inner.clone() };
Ok(CupRequest::Write {
url: req.url,
cup: req.cup,
responder: CupWriteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b2cedd887209b9c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CupGetInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CupGetInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CupControlHandle { inner: this.inner.clone() };
Ok(CupRequest::GetInfo {
url: req.url,
responder: CupGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CupRequest {
Write { url: PackageUrl, cup: CupData, responder: CupWriteResponder },
GetInfo { url: PackageUrl, responder: CupGetInfoResponder },
}
impl CupRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_write(self) -> Option<(PackageUrl, CupData, CupWriteResponder)> {
if let CupRequest::Write { url, cup, responder } = self {
Some((url, cup, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(PackageUrl, CupGetInfoResponder)> {
if let CupRequest::GetInfo { url, responder } = self {
Some((url, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CupRequest::Write { .. } => "write",
CupRequest::GetInfo { .. } => "get_info",
}
}
}
#[derive(Debug, Clone)]
pub struct CupControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CupControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl CupControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CupWriteResponder {
control_handle: std::mem::ManuallyDrop<CupControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CupWriteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CupWriteResponder {
type ControlHandle = CupControlHandle;
fn control_handle(&self) -> &CupControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CupWriteResponder {
pub fn send(self, mut result: Result<(), WriteError>) -> 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<(), WriteError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), WriteError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, WriteError>>(
result,
self.tx_id,
0x29f30e83bda39c37,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CupGetInfoResponder {
control_handle: std::mem::ManuallyDrop<CupControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CupGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CupGetInfoResponder {
type ControlHandle = CupControlHandle;
fn control_handle(&self) -> &CupControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CupGetInfoResponder {
pub fn send(self, mut result: Result<(&str, &str), GetInfoError>) -> 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<(&str, &str), GetInfoError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(&str, &str), GetInfoError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>>(
result,
self.tx_id,
0x5b2cedd887209b9c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct FontResolverMarker;
impl fidl::endpoints::ProtocolMarker for FontResolverMarker {
type Proxy = FontResolverProxy;
type RequestStream = FontResolverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = FontResolverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.FontResolver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for FontResolverMarker {}
pub type FontResolverResolveResult = Result<(), i32>;
pub trait FontResolverProxyInterface: Send + Sync {
type ResolveResponseFut: std::future::Future<Output = Result<FontResolverResolveResult, fidl::Error>>
+ Send;
fn r#resolve(
&self,
package_url: &str,
directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct FontResolverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for FontResolverSynchronousProxy {
type Proxy = FontResolverProxy;
type Protocol = FontResolverMarker;
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 FontResolverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<FontResolverEvent, fidl::Error> {
FontResolverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#resolve(
&self,
mut package_url: &str,
mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<FontResolverResolveResult, fidl::Error> {
let _response = self.client.send_query::<
FontResolverResolveRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(package_url, directory_request,),
0x159f60cc5ba432da,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct FontResolverProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for FontResolverProxy {
type Protocol = FontResolverMarker;
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 FontResolverProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> FontResolverEventStream {
FontResolverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#resolve(
&self,
mut package_url: &str,
mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
FontResolverResolveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FontResolverProxyInterface::r#resolve(self, package_url, directory_request)
}
}
impl FontResolverProxyInterface for FontResolverProxy {
type ResolveResponseFut = fidl::client::QueryResponseFut<
FontResolverResolveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve(
&self,
mut package_url: &str,
mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FontResolverResolveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x159f60cc5ba432da,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<FontResolverResolveRequest, FontResolverResolveResult>(
(package_url, directory_request),
0x159f60cc5ba432da,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct FontResolverEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for FontResolverEventStream {}
impl futures::stream::FusedStream for FontResolverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for FontResolverEventStream {
type Item = Result<FontResolverEvent, 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(FontResolverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum FontResolverEvent {}
impl FontResolverEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<FontResolverEvent, 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: <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct FontResolverRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for FontResolverRequestStream {}
impl futures::stream::FusedStream for FontResolverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for FontResolverRequestStream {
type Protocol = FontResolverMarker;
type ControlHandle = FontResolverControlHandle;
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 {
FontResolverControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for FontResolverRequestStream {
type Item = Result<FontResolverRequest, 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 FontResolverRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x159f60cc5ba432da => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FontResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FontResolverResolveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
FontResolverControlHandle { inner: this.inner.clone() };
Ok(FontResolverRequest::Resolve {
package_url: req.package_url,
directory_request: req.directory_request,
responder: FontResolverResolveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum FontResolverRequest {
Resolve {
package_url: String,
directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: FontResolverResolveResponder,
},
}
impl FontResolverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_resolve(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
FontResolverResolveResponder,
)> {
if let FontResolverRequest::Resolve { package_url, directory_request, responder } = self {
Some((package_url, directory_request, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
FontResolverRequest::Resolve { .. } => "resolve",
}
}
}
#[derive(Debug, Clone)]
pub struct FontResolverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for FontResolverControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl FontResolverControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FontResolverResolveResponder {
control_handle: std::mem::ManuallyDrop<FontResolverControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FontResolverResolveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FontResolverResolveResponder {
type ControlHandle = FontResolverControlHandle;
fn control_handle(&self) -> &FontResolverControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FontResolverResolveResponder {
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,
0x159f60cc5ba432da,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct NeededBlobsMarker;
impl fidl::endpoints::ProtocolMarker for NeededBlobsMarker {
type Proxy = NeededBlobsProxy;
type RequestStream = NeededBlobsRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = NeededBlobsSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) NeededBlobs";
}
pub type NeededBlobsOpenMetaBlobResult = Result<Option<Box<BlobWriter>>, OpenBlobError>;
pub type NeededBlobsOpenBlobResult = Result<Option<Box<BlobWriter>>, OpenBlobError>;
pub type NeededBlobsBlobWrittenResult = Result<(), BlobWrittenError>;
pub trait NeededBlobsProxyInterface: Send + Sync {
type OpenMetaBlobResponseFut: std::future::Future<Output = Result<NeededBlobsOpenMetaBlobResult, fidl::Error>>
+ Send;
fn r#open_meta_blob(&self) -> Self::OpenMetaBlobResponseFut;
fn r#get_missing_blobs(
&self,
iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
) -> Result<(), fidl::Error>;
type OpenBlobResponseFut: std::future::Future<Output = Result<NeededBlobsOpenBlobResult, fidl::Error>>
+ Send;
fn r#open_blob(&self, blob_id: &BlobId) -> Self::OpenBlobResponseFut;
type BlobWrittenResponseFut: std::future::Future<Output = Result<NeededBlobsBlobWrittenResult, fidl::Error>>
+ Send;
fn r#blob_written(&self, blob_id: &BlobId) -> Self::BlobWrittenResponseFut;
type AbortResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#abort(&self) -> Self::AbortResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct NeededBlobsSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for NeededBlobsSynchronousProxy {
type Proxy = NeededBlobsProxy;
type Protocol = NeededBlobsMarker;
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 NeededBlobsSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<NeededBlobsEvent, fidl::Error> {
NeededBlobsEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#open_meta_blob(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<NeededBlobsOpenMetaBlobResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
NeededBlobsOpenMetaBlobResponse,
OpenBlobError,
>>(
(),
0x42f385a58180f5fb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.writer))
}
pub fn r#get_missing_blobs(
&self,
mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NeededBlobsGetMissingBlobsRequest>(
(iterator,),
0x44eaf14fd56e7ae1,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#open_blob(
&self,
mut blob_id: &BlobId,
___deadline: zx::MonotonicInstant,
) -> Result<NeededBlobsOpenBlobResult, fidl::Error> {
let _response = self.client.send_query::<
NeededBlobsOpenBlobRequest,
fidl::encoding::ResultType<NeededBlobsOpenBlobResponse, OpenBlobError>,
>(
(blob_id,),
0x67cd4c4cd10ea9e0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.writer))
}
pub fn r#blob_written(
&self,
mut blob_id: &BlobId,
___deadline: zx::MonotonicInstant,
) -> Result<NeededBlobsBlobWrittenResult, fidl::Error> {
let _response = self.client.send_query::<
NeededBlobsBlobWrittenRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BlobWrittenError>,
>(
(blob_id,),
0x222f80ec77433f44,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#abort(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x6fda8d5ebea74cbb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct NeededBlobsProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for NeededBlobsProxy {
type Protocol = NeededBlobsMarker;
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 NeededBlobsProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> NeededBlobsEventStream {
NeededBlobsEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#open_meta_blob(
&self,
) -> fidl::client::QueryResponseFut<
NeededBlobsOpenMetaBlobResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NeededBlobsProxyInterface::r#open_meta_blob(self)
}
pub fn r#get_missing_blobs(
&self,
mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
NeededBlobsProxyInterface::r#get_missing_blobs(self, iterator)
}
pub fn r#open_blob(
&self,
mut blob_id: &BlobId,
) -> fidl::client::QueryResponseFut<
NeededBlobsOpenBlobResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NeededBlobsProxyInterface::r#open_blob(self, blob_id)
}
pub fn r#blob_written(
&self,
mut blob_id: &BlobId,
) -> fidl::client::QueryResponseFut<
NeededBlobsBlobWrittenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NeededBlobsProxyInterface::r#blob_written(self, blob_id)
}
pub fn r#abort(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
NeededBlobsProxyInterface::r#abort(self)
}
}
impl NeededBlobsProxyInterface for NeededBlobsProxy {
type OpenMetaBlobResponseFut = fidl::client::QueryResponseFut<
NeededBlobsOpenMetaBlobResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_meta_blob(&self) -> Self::OpenMetaBlobResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NeededBlobsOpenMetaBlobResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NeededBlobsOpenMetaBlobResponse, OpenBlobError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x42f385a58180f5fb,
>(_buf?)?;
Ok(_response.map(|x| x.writer))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, NeededBlobsOpenMetaBlobResult>(
(),
0x42f385a58180f5fb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#get_missing_blobs(
&self,
mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NeededBlobsGetMissingBlobsRequest>(
(iterator,),
0x44eaf14fd56e7ae1,
fidl::encoding::DynamicFlags::empty(),
)
}
type OpenBlobResponseFut = fidl::client::QueryResponseFut<
NeededBlobsOpenBlobResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_blob(&self, mut blob_id: &BlobId) -> Self::OpenBlobResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NeededBlobsOpenBlobResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NeededBlobsOpenBlobResponse, OpenBlobError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x67cd4c4cd10ea9e0,
>(_buf?)?;
Ok(_response.map(|x| x.writer))
}
self.client.send_query_and_decode::<NeededBlobsOpenBlobRequest, NeededBlobsOpenBlobResult>(
(blob_id,),
0x67cd4c4cd10ea9e0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type BlobWrittenResponseFut = fidl::client::QueryResponseFut<
NeededBlobsBlobWrittenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#blob_written(&self, mut blob_id: &BlobId) -> Self::BlobWrittenResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NeededBlobsBlobWrittenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BlobWrittenError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x222f80ec77433f44,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<NeededBlobsBlobWrittenRequest, NeededBlobsBlobWrittenResult>(
(blob_id,),
0x222f80ec77433f44,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AbortResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#abort(&self) -> Self::AbortResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6fda8d5ebea74cbb,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x6fda8d5ebea74cbb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct NeededBlobsEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for NeededBlobsEventStream {}
impl futures::stream::FusedStream for NeededBlobsEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for NeededBlobsEventStream {
type Item = Result<NeededBlobsEvent, 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(NeededBlobsEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum NeededBlobsEvent {}
impl NeededBlobsEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<NeededBlobsEvent, 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: <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct NeededBlobsRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for NeededBlobsRequestStream {}
impl futures::stream::FusedStream for NeededBlobsRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for NeededBlobsRequestStream {
type Protocol = NeededBlobsMarker;
type ControlHandle = NeededBlobsControlHandle;
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 {
NeededBlobsControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for NeededBlobsRequestStream {
type Item = Result<NeededBlobsRequest, 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 NeededBlobsRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x42f385a58180f5fb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
Ok(NeededBlobsRequest::OpenMetaBlob {
responder: NeededBlobsOpenMetaBlobResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x44eaf14fd56e7ae1 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NeededBlobsGetMissingBlobsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsGetMissingBlobsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
Ok(NeededBlobsRequest::GetMissingBlobs {
iterator: req.iterator,
control_handle,
})
}
0x67cd4c4cd10ea9e0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NeededBlobsOpenBlobRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsOpenBlobRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
Ok(NeededBlobsRequest::OpenBlob {
blob_id: req.blob_id,
responder: NeededBlobsOpenBlobResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x222f80ec77433f44 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NeededBlobsBlobWrittenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsBlobWrittenRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
Ok(NeededBlobsRequest::BlobWritten {
blob_id: req.blob_id,
responder: NeededBlobsBlobWrittenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6fda8d5ebea74cbb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
Ok(NeededBlobsRequest::Abort {
responder: NeededBlobsAbortResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum NeededBlobsRequest {
OpenMetaBlob { responder: NeededBlobsOpenMetaBlobResponder },
GetMissingBlobs {
iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
control_handle: NeededBlobsControlHandle,
},
OpenBlob { blob_id: BlobId, responder: NeededBlobsOpenBlobResponder },
BlobWritten { blob_id: BlobId, responder: NeededBlobsBlobWrittenResponder },
Abort { responder: NeededBlobsAbortResponder },
}
impl NeededBlobsRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_open_meta_blob(self) -> Option<(NeededBlobsOpenMetaBlobResponder)> {
if let NeededBlobsRequest::OpenMetaBlob { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_missing_blobs(
self,
) -> Option<(fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>, NeededBlobsControlHandle)>
{
if let NeededBlobsRequest::GetMissingBlobs { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open_blob(self) -> Option<(BlobId, NeededBlobsOpenBlobResponder)> {
if let NeededBlobsRequest::OpenBlob { blob_id, responder } = self {
Some((blob_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_blob_written(self) -> Option<(BlobId, NeededBlobsBlobWrittenResponder)> {
if let NeededBlobsRequest::BlobWritten { blob_id, responder } = self {
Some((blob_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_abort(self) -> Option<(NeededBlobsAbortResponder)> {
if let NeededBlobsRequest::Abort { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
NeededBlobsRequest::OpenMetaBlob { .. } => "open_meta_blob",
NeededBlobsRequest::GetMissingBlobs { .. } => "get_missing_blobs",
NeededBlobsRequest::OpenBlob { .. } => "open_blob",
NeededBlobsRequest::BlobWritten { .. } => "blob_written",
NeededBlobsRequest::Abort { .. } => "abort",
}
}
}
#[derive(Debug, Clone)]
pub struct NeededBlobsControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for NeededBlobsControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl NeededBlobsControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NeededBlobsOpenMetaBlobResponder {
control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NeededBlobsOpenMetaBlobResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NeededBlobsOpenMetaBlobResponder {
type ControlHandle = NeededBlobsControlHandle;
fn control_handle(&self) -> &NeededBlobsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NeededBlobsOpenMetaBlobResponder {
pub fn send(
self,
mut result: Result<Option<BlobWriter>, OpenBlobError>,
) -> 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<Option<BlobWriter>, OpenBlobError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<Option<BlobWriter>, OpenBlobError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
NeededBlobsOpenMetaBlobResponse,
OpenBlobError,
>>(
result.as_mut().map_err(|e| *e).map(|writer| (writer.as_mut(),)),
self.tx_id,
0x42f385a58180f5fb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NeededBlobsOpenBlobResponder {
control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NeededBlobsOpenBlobResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NeededBlobsOpenBlobResponder {
type ControlHandle = NeededBlobsControlHandle;
fn control_handle(&self) -> &NeededBlobsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NeededBlobsOpenBlobResponder {
pub fn send(
self,
mut result: Result<Option<BlobWriter>, OpenBlobError>,
) -> 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<Option<BlobWriter>, OpenBlobError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<Option<BlobWriter>, OpenBlobError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
NeededBlobsOpenBlobResponse,
OpenBlobError,
>>(
result.as_mut().map_err(|e| *e).map(|writer| (writer.as_mut(),)),
self.tx_id,
0x67cd4c4cd10ea9e0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NeededBlobsBlobWrittenResponder {
control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NeededBlobsBlobWrittenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NeededBlobsBlobWrittenResponder {
type ControlHandle = NeededBlobsControlHandle;
fn control_handle(&self) -> &NeededBlobsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NeededBlobsBlobWrittenResponder {
pub fn send(self, mut result: Result<(), BlobWrittenError>) -> 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<(), BlobWrittenError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), BlobWrittenError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
BlobWrittenError,
>>(
result,
self.tx_id,
0x222f80ec77433f44,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NeededBlobsAbortResponder {
control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NeededBlobsAbortResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NeededBlobsAbortResponder {
type ControlHandle = NeededBlobsControlHandle;
fn control_handle(&self) -> &NeededBlobsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NeededBlobsAbortResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x6fda8d5ebea74cbb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PackageCacheMarker;
impl fidl::endpoints::ProtocolMarker for PackageCacheMarker {
type Proxy = PackageCacheProxy;
type RequestStream = PackageCacheRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PackageCacheSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.PackageCache";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PackageCacheMarker {}
pub type PackageCacheGetResult = Result<(), i32>;
pub type PackageCacheGetSubpackageResult = Result<(), GetSubpackageError>;
pub type PackageCacheSyncResult = Result<(), i32>;
pub type PackageCacheSetUpgradableUrlsResult = Result<(), SetUpgradableUrlsError>;
pub trait PackageCacheProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<PackageCacheGetResult, fidl::Error>>
+ Send;
fn r#get(
&self,
meta_far_blob: &BlobInfo,
gc_protection: GcProtection,
needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::GetResponseFut;
type GetSubpackageResponseFut: std::future::Future<Output = Result<PackageCacheGetSubpackageResult, fidl::Error>>
+ Send;
fn r#get_subpackage(
&self,
superpackage: &BlobId,
subpackage: &PackageUrl,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::GetSubpackageResponseFut;
fn r#base_package_index(
&self,
iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error>;
fn r#cache_package_index(
&self,
iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error>;
type SyncResponseFut: std::future::Future<Output = Result<PackageCacheSyncResult, fidl::Error>>
+ Send;
fn r#sync(&self) -> Self::SyncResponseFut;
type SetUpgradableUrlsResponseFut: std::future::Future<Output = Result<PackageCacheSetUpgradableUrlsResult, fidl::Error>>
+ Send;
fn r#set_upgradable_urls(
&self,
pinned_urls: &[PackageUrl],
) -> Self::SetUpgradableUrlsResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PackageCacheSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PackageCacheSynchronousProxy {
type Proxy = PackageCacheProxy;
type Protocol = PackageCacheMarker;
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 PackageCacheSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<PackageCacheEvent, fidl::Error> {
PackageCacheEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(
&self,
mut meta_far_blob: &BlobInfo,
mut gc_protection: GcProtection,
mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PackageCacheGetResult, fidl::Error> {
let _response = self.client.send_query::<
PackageCacheGetRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(meta_far_blob, gc_protection, needed_blobs, dir,),
0x15e1963f4bf123b5,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_subpackage(
&self,
mut superpackage: &BlobId,
mut subpackage: &PackageUrl,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PackageCacheGetSubpackageResult, fidl::Error> {
let _response =
self.client.send_query::<PackageCacheGetSubpackageRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
GetSubpackageError,
>>(
(superpackage, subpackage, dir),
0x29478df87c29ffa3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#base_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PackageCacheBasePackageIndexRequest>(
(iterator,),
0x46af9e595f8eced4,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#cache_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PackageCacheCachePackageIndexRequest>(
(iterator,),
0x14a48fdb8f26ed26,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#sync(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<PackageCacheSyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5c10a84094535a74,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_upgradable_urls(
&self,
mut pinned_urls: &[PackageUrl],
___deadline: zx::MonotonicInstant,
) -> Result<PackageCacheSetUpgradableUrlsResult, fidl::Error> {
let _response = self.client.send_query::<
PackageCacheSetUpgradableUrlsRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, SetUpgradableUrlsError>,
>(
(pinned_urls,),
0x2c235f7efdb5e2d1,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PackageCacheMarker>("set_upgradable_urls")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct PackageCacheProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PackageCacheProxy {
type Protocol = PackageCacheMarker;
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 PackageCacheProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PackageCacheEventStream {
PackageCacheEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
mut meta_far_blob: &BlobInfo,
mut gc_protection: GcProtection,
mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
PackageCacheGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageCacheProxyInterface::r#get(self, meta_far_blob, gc_protection, needed_blobs, dir)
}
pub fn r#get_subpackage(
&self,
mut superpackage: &BlobId,
mut subpackage: &PackageUrl,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
PackageCacheGetSubpackageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageCacheProxyInterface::r#get_subpackage(self, superpackage, subpackage, dir)
}
pub fn r#base_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
PackageCacheProxyInterface::r#base_package_index(self, iterator)
}
pub fn r#cache_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
PackageCacheProxyInterface::r#cache_package_index(self, iterator)
}
pub fn r#sync(
&self,
) -> fidl::client::QueryResponseFut<
PackageCacheSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageCacheProxyInterface::r#sync(self)
}
pub fn r#set_upgradable_urls(
&self,
mut pinned_urls: &[PackageUrl],
) -> fidl::client::QueryResponseFut<
PackageCacheSetUpgradableUrlsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageCacheProxyInterface::r#set_upgradable_urls(self, pinned_urls)
}
}
impl PackageCacheProxyInterface for PackageCacheProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
PackageCacheGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(
&self,
mut meta_far_blob: &BlobInfo,
mut gc_protection: GcProtection,
mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageCacheGetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x15e1963f4bf123b5,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<PackageCacheGetRequest, PackageCacheGetResult>(
(meta_far_blob, gc_protection, needed_blobs, dir),
0x15e1963f4bf123b5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSubpackageResponseFut = fidl::client::QueryResponseFut<
PackageCacheGetSubpackageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_subpackage(
&self,
mut superpackage: &BlobId,
mut subpackage: &PackageUrl,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::GetSubpackageResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageCacheGetSubpackageResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GetSubpackageError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x29478df87c29ffa3,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PackageCacheGetSubpackageRequest,
PackageCacheGetSubpackageResult,
>(
(superpackage, subpackage, dir,),
0x29478df87c29ffa3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#base_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PackageCacheBasePackageIndexRequest>(
(iterator,),
0x46af9e595f8eced4,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#cache_package_index(
&self,
mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PackageCacheCachePackageIndexRequest>(
(iterator,),
0x14a48fdb8f26ed26,
fidl::encoding::DynamicFlags::empty(),
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<
PackageCacheSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageCacheSyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5c10a84094535a74,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PackageCacheSyncResult>(
(),
0x5c10a84094535a74,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetUpgradableUrlsResponseFut = fidl::client::QueryResponseFut<
PackageCacheSetUpgradableUrlsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_upgradable_urls(
&self,
mut pinned_urls: &[PackageUrl],
) -> Self::SetUpgradableUrlsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageCacheSetUpgradableUrlsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
SetUpgradableUrlsError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c235f7efdb5e2d1,
>(_buf?)?
.into_result::<PackageCacheMarker>("set_upgradable_urls")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PackageCacheSetUpgradableUrlsRequest,
PackageCacheSetUpgradableUrlsResult,
>(
(pinned_urls,),
0x2c235f7efdb5e2d1,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct PackageCacheEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PackageCacheEventStream {}
impl futures::stream::FusedStream for PackageCacheEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PackageCacheEventStream {
type Item = Result<PackageCacheEvent, 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(PackageCacheEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PackageCacheEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl PackageCacheEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PackageCacheEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(PackageCacheEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PackageCacheRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PackageCacheRequestStream {}
impl futures::stream::FusedStream for PackageCacheRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PackageCacheRequestStream {
type Protocol = PackageCacheMarker;
type ControlHandle = PackageCacheControlHandle;
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 {
PackageCacheControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for PackageCacheRequestStream {
type Item = Result<PackageCacheRequest, 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 PackageCacheRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x15e1963f4bf123b5 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageCacheGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheGetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::Get {
meta_far_blob: req.meta_far_blob,
gc_protection: req.gc_protection,
needed_blobs: req.needed_blobs,
dir: req.dir,
responder: PackageCacheGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x29478df87c29ffa3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageCacheGetSubpackageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheGetSubpackageRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::GetSubpackage {
superpackage: req.superpackage,
subpackage: req.subpackage,
dir: req.dir,
responder: PackageCacheGetSubpackageResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x46af9e595f8eced4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
PackageCacheBasePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheBasePackageIndexRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::BasePackageIndex {
iterator: req.iterator,
control_handle,
})
}
0x14a48fdb8f26ed26 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
PackageCacheCachePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheCachePackageIndexRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::CachePackageIndex {
iterator: req.iterator,
control_handle,
})
}
0x5c10a84094535a74 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::Sync {
responder: PackageCacheSyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c235f7efdb5e2d1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageCacheSetUpgradableUrlsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheSetUpgradableUrlsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageCacheControlHandle { inner: this.inner.clone() };
Ok(PackageCacheRequest::SetUpgradableUrls {
pinned_urls: req.pinned_urls,
responder: PackageCacheSetUpgradableUrlsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(PackageCacheRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: PackageCacheControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(PackageCacheRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: PackageCacheControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PackageCacheRequest {
Get {
meta_far_blob: BlobInfo,
gc_protection: GcProtection,
needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: PackageCacheGetResponder,
},
GetSubpackage {
superpackage: BlobId,
subpackage: PackageUrl,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: PackageCacheGetSubpackageResponder,
},
BasePackageIndex {
iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
control_handle: PackageCacheControlHandle,
},
CachePackageIndex {
iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
control_handle: PackageCacheControlHandle,
},
Sync { responder: PackageCacheSyncResponder },
SetUpgradableUrls {
pinned_urls: Vec<PackageUrl>,
responder: PackageCacheSetUpgradableUrlsResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: PackageCacheControlHandle,
method_type: fidl::MethodType,
},
}
impl PackageCacheRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(
self,
) -> Option<(
BlobInfo,
GcProtection,
fidl::endpoints::ServerEnd<NeededBlobsMarker>,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
PackageCacheGetResponder,
)> {
if let PackageCacheRequest::Get {
meta_far_blob,
gc_protection,
needed_blobs,
dir,
responder,
} = self
{
Some((meta_far_blob, gc_protection, needed_blobs, dir, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_subpackage(
self,
) -> Option<(
BlobId,
PackageUrl,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
PackageCacheGetSubpackageResponder,
)> {
if let PackageCacheRequest::GetSubpackage { superpackage, subpackage, dir, responder } =
self
{
Some((superpackage, subpackage, dir, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_base_package_index(
self,
) -> Option<(fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>, PackageCacheControlHandle)>
{
if let PackageCacheRequest::BasePackageIndex { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_cache_package_index(
self,
) -> Option<(fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>, PackageCacheControlHandle)>
{
if let PackageCacheRequest::CachePackageIndex { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(PackageCacheSyncResponder)> {
if let PackageCacheRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_upgradable_urls(
self,
) -> Option<(Vec<PackageUrl>, PackageCacheSetUpgradableUrlsResponder)> {
if let PackageCacheRequest::SetUpgradableUrls { pinned_urls, responder } = self {
Some((pinned_urls, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PackageCacheRequest::Get { .. } => "get",
PackageCacheRequest::GetSubpackage { .. } => "get_subpackage",
PackageCacheRequest::BasePackageIndex { .. } => "base_package_index",
PackageCacheRequest::CachePackageIndex { .. } => "cache_package_index",
PackageCacheRequest::Sync { .. } => "sync",
PackageCacheRequest::SetUpgradableUrls { .. } => "set_upgradable_urls",
PackageCacheRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
PackageCacheRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct PackageCacheControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PackageCacheControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl PackageCacheControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageCacheGetResponder {
control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageCacheGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageCacheGetResponder {
type ControlHandle = PackageCacheControlHandle;
fn control_handle(&self) -> &PackageCacheControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageCacheGetResponder {
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,
0x15e1963f4bf123b5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageCacheGetSubpackageResponder {
control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageCacheGetSubpackageResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageCacheGetSubpackageResponder {
type ControlHandle = PackageCacheControlHandle;
fn control_handle(&self) -> &PackageCacheControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageCacheGetSubpackageResponder {
pub fn send(self, mut result: Result<(), GetSubpackageError>) -> 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<(), GetSubpackageError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), GetSubpackageError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
GetSubpackageError,
>>(
result,
self.tx_id,
0x29478df87c29ffa3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageCacheSyncResponder {
control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageCacheSyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageCacheSyncResponder {
type ControlHandle = PackageCacheControlHandle;
fn control_handle(&self) -> &PackageCacheControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageCacheSyncResponder {
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,
0x5c10a84094535a74,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageCacheSetUpgradableUrlsResponder {
control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageCacheSetUpgradableUrlsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageCacheSetUpgradableUrlsResponder {
type ControlHandle = PackageCacheControlHandle;
fn control_handle(&self) -> &PackageCacheControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageCacheSetUpgradableUrlsResponder {
pub fn send(self, mut result: Result<(), SetUpgradableUrlsError>) -> 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<(), SetUpgradableUrlsError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), SetUpgradableUrlsError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
SetUpgradableUrlsError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x2c235f7efdb5e2d1,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PackageIndexIteratorMarker;
impl fidl::endpoints::ProtocolMarker for PackageIndexIteratorMarker {
type Proxy = PackageIndexIteratorProxy;
type RequestStream = PackageIndexIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PackageIndexIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) PackageIndexIterator";
}
pub trait PackageIndexIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<PackageIndexEntry>, fidl::Error>>
+ Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PackageIndexIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PackageIndexIteratorSynchronousProxy {
type Proxy = PackageIndexIteratorProxy;
type Protocol = PackageIndexIteratorMarker;
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 PackageIndexIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<PackageIndexIteratorEvent, fidl::Error> {
PackageIndexIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<PackageIndexEntry>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, PackageIndexIteratorNextResponse>(
(),
0x9de6bbc87c314d9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.entries)
}
}
#[derive(Debug, Clone)]
pub struct PackageIndexIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PackageIndexIteratorProxy {
type Protocol = PackageIndexIteratorMarker;
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 PackageIndexIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PackageIndexIteratorEventStream {
PackageIndexIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(
&self,
) -> fidl::client::QueryResponseFut<
Vec<PackageIndexEntry>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageIndexIteratorProxyInterface::r#next(self)
}
}
impl PackageIndexIteratorProxyInterface for PackageIndexIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<
Vec<PackageIndexEntry>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<PackageIndexEntry>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PackageIndexIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x9de6bbc87c314d9,
>(_buf?)?;
Ok(_response.entries)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<PackageIndexEntry>>(
(),
0x9de6bbc87c314d9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PackageIndexIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PackageIndexIteratorEventStream {}
impl futures::stream::FusedStream for PackageIndexIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PackageIndexIteratorEventStream {
type Item = Result<PackageIndexIteratorEvent, 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(PackageIndexIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PackageIndexIteratorEvent {}
impl PackageIndexIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PackageIndexIteratorEvent, 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:
<PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PackageIndexIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PackageIndexIteratorRequestStream {}
impl futures::stream::FusedStream for PackageIndexIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PackageIndexIteratorRequestStream {
type Protocol = PackageIndexIteratorMarker;
type ControlHandle = PackageIndexIteratorControlHandle;
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 {
PackageIndexIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for PackageIndexIteratorRequestStream {
type Item = Result<PackageIndexIteratorRequest, 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 PackageIndexIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x9de6bbc87c314d9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PackageIndexIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(PackageIndexIteratorRequest::Next {
responder: PackageIndexIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PackageIndexIteratorRequest {
Next { responder: PackageIndexIteratorNextResponder },
}
impl PackageIndexIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(PackageIndexIteratorNextResponder)> {
if let PackageIndexIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PackageIndexIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct PackageIndexIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PackageIndexIteratorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl PackageIndexIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageIndexIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<PackageIndexIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageIndexIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageIndexIteratorNextResponder {
type ControlHandle = PackageIndexIteratorControlHandle;
fn control_handle(&self) -> &PackageIndexIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageIndexIteratorNextResponder {
pub fn send(self, mut entries: &[PackageIndexEntry]) -> Result<(), fidl::Error> {
let _result = self.send_raw(entries);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut entries: &[PackageIndexEntry],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(entries);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut entries: &[PackageIndexEntry]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PackageIndexIteratorNextResponse>(
(entries,),
self.tx_id,
0x9de6bbc87c314d9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PackageResolverMarker;
impl fidl::endpoints::ProtocolMarker for PackageResolverMarker {
type Proxy = PackageResolverProxy;
type RequestStream = PackageResolverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PackageResolverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.PackageResolver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PackageResolverMarker {}
pub type PackageResolverResolveResult = Result<ResolutionContext, ResolveError>;
pub type PackageResolverResolveWithContextResult = Result<ResolutionContext, ResolveError>;
pub type PackageResolverGetHashResult = Result<BlobId, i32>;
pub trait PackageResolverProxyInterface: Send + Sync {
type ResolveResponseFut: std::future::Future<Output = Result<PackageResolverResolveResult, fidl::Error>>
+ Send;
fn r#resolve(
&self,
package_url: &str,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveResponseFut;
type ResolveWithContextResponseFut: std::future::Future<Output = Result<PackageResolverResolveWithContextResult, fidl::Error>>
+ Send;
fn r#resolve_with_context(
&self,
package_url: &str,
context: &ResolutionContext,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveWithContextResponseFut;
type GetHashResponseFut: std::future::Future<Output = Result<PackageResolverGetHashResult, fidl::Error>>
+ Send;
fn r#get_hash(&self, package_url: &PackageUrl) -> Self::GetHashResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PackageResolverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PackageResolverSynchronousProxy {
type Proxy = PackageResolverProxy;
type Protocol = PackageResolverMarker;
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 PackageResolverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<PackageResolverEvent, fidl::Error> {
PackageResolverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#resolve(
&self,
mut package_url: &str,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PackageResolverResolveResult, fidl::Error> {
let _response = self.client.send_query::<
PackageResolverResolveRequest,
fidl::encoding::ResultType<PackageResolverResolveResponse, ResolveError>,
>(
(package_url, dir,),
0x6611263be4052d4f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resolved_context))
}
pub fn r#resolve_with_context(
&self,
mut package_url: &str,
mut context: &ResolutionContext,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PackageResolverResolveWithContextResult, fidl::Error> {
let _response =
self.client
.send_query::<PackageResolverResolveWithContextRequest, fidl::encoding::ResultType<
PackageResolverResolveWithContextResponse,
ResolveError,
>>(
(package_url, context, dir),
0x4c255ae7260298d4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resolved_context))
}
pub fn r#get_hash(
&self,
mut package_url: &PackageUrl,
___deadline: zx::MonotonicInstant,
) -> Result<PackageResolverGetHashResult, fidl::Error> {
let _response = self.client.send_query::<
PackageResolverGetHashRequest,
fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>,
>(
(package_url,),
0x594e8b4db51efd87,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.meta_far_blob_id))
}
}
#[derive(Debug, Clone)]
pub struct PackageResolverProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PackageResolverProxy {
type Protocol = PackageResolverMarker;
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 PackageResolverProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PackageResolverEventStream {
PackageResolverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#resolve(
&self,
mut package_url: &str,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
PackageResolverResolveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageResolverProxyInterface::r#resolve(self, package_url, dir)
}
pub fn r#resolve_with_context(
&self,
mut package_url: &str,
mut context: &ResolutionContext,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
PackageResolverResolveWithContextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageResolverProxyInterface::r#resolve_with_context(self, package_url, context, dir)
}
pub fn r#get_hash(
&self,
mut package_url: &PackageUrl,
) -> fidl::client::QueryResponseFut<
PackageResolverGetHashResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PackageResolverProxyInterface::r#get_hash(self, package_url)
}
}
impl PackageResolverProxyInterface for PackageResolverProxy {
type ResolveResponseFut = fidl::client::QueryResponseFut<
PackageResolverResolveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve(
&self,
mut package_url: &str,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageResolverResolveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<PackageResolverResolveResponse, ResolveError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6611263be4052d4f,
>(_buf?)?;
Ok(_response.map(|x| x.resolved_context))
}
self.client
.send_query_and_decode::<PackageResolverResolveRequest, PackageResolverResolveResult>(
(package_url, dir),
0x6611263be4052d4f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResolveWithContextResponseFut = fidl::client::QueryResponseFut<
PackageResolverResolveWithContextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve_with_context(
&self,
mut package_url: &str,
mut context: &ResolutionContext,
mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::ResolveWithContextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageResolverResolveWithContextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<PackageResolverResolveWithContextResponse, ResolveError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c255ae7260298d4,
>(_buf?)?;
Ok(_response.map(|x| x.resolved_context))
}
self.client.send_query_and_decode::<
PackageResolverResolveWithContextRequest,
PackageResolverResolveWithContextResult,
>(
(package_url, context, dir,),
0x4c255ae7260298d4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetHashResponseFut = fidl::client::QueryResponseFut<
PackageResolverGetHashResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_hash(&self, mut package_url: &PackageUrl) -> Self::GetHashResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PackageResolverGetHashResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x594e8b4db51efd87,
>(_buf?)?;
Ok(_response.map(|x| x.meta_far_blob_id))
}
self.client
.send_query_and_decode::<PackageResolverGetHashRequest, PackageResolverGetHashResult>(
(package_url,),
0x594e8b4db51efd87,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PackageResolverEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PackageResolverEventStream {}
impl futures::stream::FusedStream for PackageResolverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PackageResolverEventStream {
type Item = Result<PackageResolverEvent, 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(PackageResolverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PackageResolverEvent {}
impl PackageResolverEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PackageResolverEvent, 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:
<PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PackageResolverRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PackageResolverRequestStream {}
impl futures::stream::FusedStream for PackageResolverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PackageResolverRequestStream {
type Protocol = PackageResolverMarker;
type ControlHandle = PackageResolverControlHandle;
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 {
PackageResolverControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for PackageResolverRequestStream {
type Item = Result<PackageResolverRequest, 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 PackageResolverRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x6611263be4052d4f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverResolveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageResolverControlHandle { inner: this.inner.clone() };
Ok(PackageResolverRequest::Resolve {
package_url: req.package_url,
dir: req.dir,
responder: PackageResolverResolveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c255ae7260298d4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageResolverResolveWithContextRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverResolveWithContextRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageResolverControlHandle { inner: this.inner.clone() };
Ok(PackageResolverRequest::ResolveWithContext {
package_url: req.package_url,
context: req.context,
dir: req.dir,
responder: PackageResolverResolveWithContextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x594e8b4db51efd87 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PackageResolverGetHashRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverGetHashRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PackageResolverControlHandle { inner: this.inner.clone() };
Ok(PackageResolverRequest::GetHash {
package_url: req.package_url,
responder: PackageResolverGetHashResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PackageResolverRequest {
Resolve {
package_url: String,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: PackageResolverResolveResponder,
},
ResolveWithContext {
package_url: String,
context: ResolutionContext,
dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: PackageResolverResolveWithContextResponder,
},
GetHash { package_url: PackageUrl, responder: PackageResolverGetHashResponder },
}
impl PackageResolverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_resolve(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
PackageResolverResolveResponder,
)> {
if let PackageResolverRequest::Resolve { package_url, dir, responder } = self {
Some((package_url, dir, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_resolve_with_context(
self,
) -> Option<(
String,
ResolutionContext,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
PackageResolverResolveWithContextResponder,
)> {
if let PackageResolverRequest::ResolveWithContext { package_url, context, dir, responder } =
self
{
Some((package_url, context, dir, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_hash(self) -> Option<(PackageUrl, PackageResolverGetHashResponder)> {
if let PackageResolverRequest::GetHash { package_url, responder } = self {
Some((package_url, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PackageResolverRequest::Resolve { .. } => "resolve",
PackageResolverRequest::ResolveWithContext { .. } => "resolve_with_context",
PackageResolverRequest::GetHash { .. } => "get_hash",
}
}
}
#[derive(Debug, Clone)]
pub struct PackageResolverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PackageResolverControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl PackageResolverControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageResolverResolveResponder {
control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageResolverResolveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageResolverResolveResponder {
type ControlHandle = PackageResolverControlHandle;
fn control_handle(&self) -> &PackageResolverControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageResolverResolveResponder {
pub fn send(
self,
mut result: Result<&ResolutionContext, ResolveError>,
) -> 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<&ResolutionContext, ResolveError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&ResolutionContext, ResolveError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
PackageResolverResolveResponse,
ResolveError,
>>(
result.map(|resolved_context| (resolved_context,)),
self.tx_id,
0x6611263be4052d4f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageResolverResolveWithContextResponder {
control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageResolverResolveWithContextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageResolverResolveWithContextResponder {
type ControlHandle = PackageResolverControlHandle;
fn control_handle(&self) -> &PackageResolverControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageResolverResolveWithContextResponder {
pub fn send(
self,
mut result: Result<&ResolutionContext, ResolveError>,
) -> 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<&ResolutionContext, ResolveError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&ResolutionContext, ResolveError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
PackageResolverResolveWithContextResponse,
ResolveError,
>>(
result.map(|resolved_context| (resolved_context,)),
self.tx_id,
0x4c255ae7260298d4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PackageResolverGetHashResponder {
control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PackageResolverGetHashResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PackageResolverGetHashResponder {
type ControlHandle = PackageResolverControlHandle;
fn control_handle(&self) -> &PackageResolverControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PackageResolverGetHashResponder {
pub fn send(self, mut result: Result<&BlobId, 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<&BlobId, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&BlobId, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>>(
result.map(|meta_far_blob_id| (meta_far_blob_id,)),
self.tx_id,
0x594e8b4db51efd87,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RepositoryIteratorMarker;
impl fidl::endpoints::ProtocolMarker for RepositoryIteratorMarker {
type Proxy = RepositoryIteratorProxy;
type RequestStream = RepositoryIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RepositoryIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) RepositoryIterator";
}
pub trait RepositoryIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<RepositoryConfig>, fidl::Error>>
+ Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RepositoryIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RepositoryIteratorSynchronousProxy {
type Proxy = RepositoryIteratorProxy;
type Protocol = RepositoryIteratorMarker;
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 RepositoryIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<RepositoryIteratorEvent, fidl::Error> {
RepositoryIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<RepositoryConfig>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, RepositoryIteratorNextResponse>(
(),
0x5502086bc0cdd25e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.repos)
}
}
#[derive(Debug, Clone)]
pub struct RepositoryIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RepositoryIteratorProxy {
type Protocol = RepositoryIteratorMarker;
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 RepositoryIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RepositoryIteratorEventStream {
RepositoryIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(
&self,
) -> fidl::client::QueryResponseFut<
Vec<RepositoryConfig>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RepositoryIteratorProxyInterface::r#next(self)
}
}
impl RepositoryIteratorProxyInterface for RepositoryIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<
Vec<RepositoryConfig>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<RepositoryConfig>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RepositoryIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5502086bc0cdd25e,
>(_buf?)?;
Ok(_response.repos)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<RepositoryConfig>>(
(),
0x5502086bc0cdd25e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct RepositoryIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RepositoryIteratorEventStream {}
impl futures::stream::FusedStream for RepositoryIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RepositoryIteratorEventStream {
type Item = Result<RepositoryIteratorEvent, 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(RepositoryIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RepositoryIteratorEvent {}
impl RepositoryIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RepositoryIteratorEvent, 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:
<RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RepositoryIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RepositoryIteratorRequestStream {}
impl futures::stream::FusedStream for RepositoryIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RepositoryIteratorRequestStream {
type Protocol = RepositoryIteratorMarker;
type ControlHandle = RepositoryIteratorControlHandle;
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 {
RepositoryIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RepositoryIteratorRequestStream {
type Item = Result<RepositoryIteratorRequest, 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 RepositoryIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x5502086bc0cdd25e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RepositoryIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(RepositoryIteratorRequest::Next {
responder: RepositoryIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RepositoryIteratorRequest {
Next { responder: RepositoryIteratorNextResponder },
}
impl RepositoryIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(RepositoryIteratorNextResponder)> {
if let RepositoryIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RepositoryIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct RepositoryIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RepositoryIteratorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl RepositoryIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RepositoryIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<RepositoryIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RepositoryIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RepositoryIteratorNextResponder {
type ControlHandle = RepositoryIteratorControlHandle;
fn control_handle(&self) -> &RepositoryIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RepositoryIteratorNextResponder {
pub fn send(self, mut repos: &[RepositoryConfig]) -> Result<(), fidl::Error> {
let _result = self.send_raw(repos);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut repos: &[RepositoryConfig],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(repos);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut repos: &[RepositoryConfig]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RepositoryIteratorNextResponse>(
(repos,),
self.tx_id,
0x5502086bc0cdd25e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RepositoryManagerMarker;
impl fidl::endpoints::ProtocolMarker for RepositoryManagerMarker {
type Proxy = RepositoryManagerProxy;
type RequestStream = RepositoryManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RepositoryManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.RepositoryManager";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RepositoryManagerMarker {}
pub type RepositoryManagerAddResult = Result<(), i32>;
pub type RepositoryManagerRemoveResult = Result<(), i32>;
pub type RepositoryManagerAddMirrorResult = Result<(), i32>;
pub type RepositoryManagerRemoveMirrorResult = Result<(), i32>;
pub trait RepositoryManagerProxyInterface: Send + Sync {
type AddResponseFut: std::future::Future<Output = Result<RepositoryManagerAddResult, fidl::Error>>
+ Send;
fn r#add(&self, repo: &RepositoryConfig) -> Self::AddResponseFut;
type RemoveResponseFut: std::future::Future<Output = Result<RepositoryManagerRemoveResult, fidl::Error>>
+ Send;
fn r#remove(&self, repo_url: &str) -> Self::RemoveResponseFut;
type AddMirrorResponseFut: std::future::Future<Output = Result<RepositoryManagerAddMirrorResult, fidl::Error>>
+ Send;
fn r#add_mirror(&self, repo_url: &str, mirror: &MirrorConfig) -> Self::AddMirrorResponseFut;
type RemoveMirrorResponseFut: std::future::Future<Output = Result<RepositoryManagerRemoveMirrorResult, fidl::Error>>
+ Send;
fn r#remove_mirror(&self, repo_url: &str, mirror_url: &str) -> Self::RemoveMirrorResponseFut;
fn r#list(
&self,
iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RepositoryManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RepositoryManagerSynchronousProxy {
type Proxy = RepositoryManagerProxy;
type Protocol = RepositoryManagerMarker;
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 RepositoryManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<RepositoryManagerEvent, fidl::Error> {
RepositoryManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#add(
&self,
mut repo: &RepositoryConfig,
___deadline: zx::MonotonicInstant,
) -> Result<RepositoryManagerAddResult, fidl::Error> {
let _response = self.client.send_query::<
RepositoryManagerAddRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(repo,),
0x7fff4b8c733c7151,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove(
&self,
mut repo_url: &str,
___deadline: zx::MonotonicInstant,
) -> Result<RepositoryManagerRemoveResult, fidl::Error> {
let _response = self.client.send_query::<
RepositoryManagerRemoveRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(repo_url,),
0x5de23dc0e0dea4ba,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#add_mirror(
&self,
mut repo_url: &str,
mut mirror: &MirrorConfig,
___deadline: zx::MonotonicInstant,
) -> Result<RepositoryManagerAddMirrorResult, fidl::Error> {
let _response = self.client.send_query::<
RepositoryManagerAddMirrorRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(repo_url, mirror,),
0x3b7ef213730dd24c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_mirror(
&self,
mut repo_url: &str,
mut mirror_url: &str,
___deadline: zx::MonotonicInstant,
) -> Result<RepositoryManagerRemoveMirrorResult, fidl::Error> {
let _response = self.client.send_query::<
RepositoryManagerRemoveMirrorRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(repo_url, mirror_url,),
0x4682584cc47c23a2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list(
&self,
mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<RepositoryManagerListRequest>(
(iterator,),
0x61837314ba6f4afb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct RepositoryManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RepositoryManagerProxy {
type Protocol = RepositoryManagerMarker;
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 RepositoryManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RepositoryManagerEventStream {
RepositoryManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#add(
&self,
mut repo: &RepositoryConfig,
) -> fidl::client::QueryResponseFut<
RepositoryManagerAddResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RepositoryManagerProxyInterface::r#add(self, repo)
}
pub fn r#remove(
&self,
mut repo_url: &str,
) -> fidl::client::QueryResponseFut<
RepositoryManagerRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RepositoryManagerProxyInterface::r#remove(self, repo_url)
}
pub fn r#add_mirror(
&self,
mut repo_url: &str,
mut mirror: &MirrorConfig,
) -> fidl::client::QueryResponseFut<
RepositoryManagerAddMirrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RepositoryManagerProxyInterface::r#add_mirror(self, repo_url, mirror)
}
pub fn r#remove_mirror(
&self,
mut repo_url: &str,
mut mirror_url: &str,
) -> fidl::client::QueryResponseFut<
RepositoryManagerRemoveMirrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RepositoryManagerProxyInterface::r#remove_mirror(self, repo_url, mirror_url)
}
pub fn r#list(
&self,
mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
) -> Result<(), fidl::Error> {
RepositoryManagerProxyInterface::r#list(self, iterator)
}
}
impl RepositoryManagerProxyInterface for RepositoryManagerProxy {
type AddResponseFut = fidl::client::QueryResponseFut<
RepositoryManagerAddResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#add(&self, mut repo: &RepositoryConfig) -> Self::AddResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RepositoryManagerAddResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7fff4b8c733c7151,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<RepositoryManagerAddRequest, RepositoryManagerAddResult>(
(repo,),
0x7fff4b8c733c7151,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveResponseFut = fidl::client::QueryResponseFut<
RepositoryManagerRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove(&self, mut repo_url: &str) -> Self::RemoveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RepositoryManagerRemoveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5de23dc0e0dea4ba,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<RepositoryManagerRemoveRequest, RepositoryManagerRemoveResult>(
(repo_url,),
0x5de23dc0e0dea4ba,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AddMirrorResponseFut = fidl::client::QueryResponseFut<
RepositoryManagerAddMirrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#add_mirror(
&self,
mut repo_url: &str,
mut mirror: &MirrorConfig,
) -> Self::AddMirrorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RepositoryManagerAddMirrorResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3b7ef213730dd24c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
RepositoryManagerAddMirrorRequest,
RepositoryManagerAddMirrorResult,
>(
(repo_url, mirror,),
0x3b7ef213730dd24c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveMirrorResponseFut = fidl::client::QueryResponseFut<
RepositoryManagerRemoveMirrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_mirror(
&self,
mut repo_url: &str,
mut mirror_url: &str,
) -> Self::RemoveMirrorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RepositoryManagerRemoveMirrorResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4682584cc47c23a2,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
RepositoryManagerRemoveMirrorRequest,
RepositoryManagerRemoveMirrorResult,
>(
(repo_url, mirror_url,),
0x4682584cc47c23a2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list(
&self,
mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<RepositoryManagerListRequest>(
(iterator,),
0x61837314ba6f4afb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct RepositoryManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RepositoryManagerEventStream {}
impl futures::stream::FusedStream for RepositoryManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RepositoryManagerEventStream {
type Item = Result<RepositoryManagerEvent, 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(RepositoryManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RepositoryManagerEvent {}
impl RepositoryManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RepositoryManagerEvent, 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:
<RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RepositoryManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RepositoryManagerRequestStream {}
impl futures::stream::FusedStream for RepositoryManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RepositoryManagerRequestStream {
type Protocol = RepositoryManagerMarker;
type ControlHandle = RepositoryManagerControlHandle;
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 {
RepositoryManagerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RepositoryManagerRequestStream {
type Item = Result<RepositoryManagerRequest, 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 RepositoryManagerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x7fff4b8c733c7151 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RepositoryManagerAddRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerAddRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RepositoryManagerControlHandle { inner: this.inner.clone() };
Ok(RepositoryManagerRequest::Add {
repo: req.repo,
responder: RepositoryManagerAddResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5de23dc0e0dea4ba => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RepositoryManagerRemoveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RepositoryManagerControlHandle { inner: this.inner.clone() };
Ok(RepositoryManagerRequest::Remove {
repo_url: req.repo_url,
responder: RepositoryManagerRemoveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3b7ef213730dd24c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RepositoryManagerAddMirrorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerAddMirrorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RepositoryManagerControlHandle { inner: this.inner.clone() };
Ok(RepositoryManagerRequest::AddMirror {
repo_url: req.repo_url,
mirror: req.mirror,
responder: RepositoryManagerAddMirrorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4682584cc47c23a2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RepositoryManagerRemoveMirrorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerRemoveMirrorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RepositoryManagerControlHandle { inner: this.inner.clone() };
Ok(RepositoryManagerRequest::RemoveMirror {
repo_url: req.repo_url,
mirror_url: req.mirror_url,
responder: RepositoryManagerRemoveMirrorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x61837314ba6f4afb => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
RepositoryManagerListRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerListRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RepositoryManagerControlHandle { inner: this.inner.clone() };
Ok(RepositoryManagerRequest::List {
iterator: req.iterator,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RepositoryManagerRequest {
Add { repo: RepositoryConfig, responder: RepositoryManagerAddResponder },
Remove { repo_url: String, responder: RepositoryManagerRemoveResponder },
AddMirror {
repo_url: String,
mirror: MirrorConfig,
responder: RepositoryManagerAddMirrorResponder,
},
RemoveMirror {
repo_url: String,
mirror_url: String,
responder: RepositoryManagerRemoveMirrorResponder,
},
List {
iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
control_handle: RepositoryManagerControlHandle,
},
}
impl RepositoryManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_add(self) -> Option<(RepositoryConfig, RepositoryManagerAddResponder)> {
if let RepositoryManagerRequest::Add { repo, responder } = self {
Some((repo, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove(self) -> Option<(String, RepositoryManagerRemoveResponder)> {
if let RepositoryManagerRequest::Remove { repo_url, responder } = self {
Some((repo_url, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_mirror(
self,
) -> Option<(String, MirrorConfig, RepositoryManagerAddMirrorResponder)> {
if let RepositoryManagerRequest::AddMirror { repo_url, mirror, responder } = self {
Some((repo_url, mirror, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_mirror(
self,
) -> Option<(String, String, RepositoryManagerRemoveMirrorResponder)> {
if let RepositoryManagerRequest::RemoveMirror { repo_url, mirror_url, responder } = self {
Some((repo_url, mirror_url, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list(
self,
) -> Option<(
fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
RepositoryManagerControlHandle,
)> {
if let RepositoryManagerRequest::List { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RepositoryManagerRequest::Add { .. } => "add",
RepositoryManagerRequest::Remove { .. } => "remove",
RepositoryManagerRequest::AddMirror { .. } => "add_mirror",
RepositoryManagerRequest::RemoveMirror { .. } => "remove_mirror",
RepositoryManagerRequest::List { .. } => "list",
}
}
}
#[derive(Debug, Clone)]
pub struct RepositoryManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RepositoryManagerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl RepositoryManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RepositoryManagerAddResponder {
control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RepositoryManagerAddResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RepositoryManagerAddResponder {
type ControlHandle = RepositoryManagerControlHandle;
fn control_handle(&self) -> &RepositoryManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RepositoryManagerAddResponder {
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,
0x7fff4b8c733c7151,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RepositoryManagerRemoveResponder {
control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RepositoryManagerRemoveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RepositoryManagerRemoveResponder {
type ControlHandle = RepositoryManagerControlHandle;
fn control_handle(&self) -> &RepositoryManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RepositoryManagerRemoveResponder {
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,
0x5de23dc0e0dea4ba,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RepositoryManagerAddMirrorResponder {
control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RepositoryManagerAddMirrorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RepositoryManagerAddMirrorResponder {
type ControlHandle = RepositoryManagerControlHandle;
fn control_handle(&self) -> &RepositoryManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RepositoryManagerAddMirrorResponder {
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,
0x3b7ef213730dd24c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RepositoryManagerRemoveMirrorResponder {
control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RepositoryManagerRemoveMirrorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RepositoryManagerRemoveMirrorResponder {
type ControlHandle = RepositoryManagerControlHandle;
fn control_handle(&self) -> &RepositoryManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RepositoryManagerRemoveMirrorResponder {
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,
0x4682584cc47c23a2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RetainedPackagesMarker;
impl fidl::endpoints::ProtocolMarker for RetainedPackagesMarker {
type Proxy = RetainedPackagesProxy;
type RequestStream = RetainedPackagesRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RetainedPackagesSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.pkg.RetainedPackages";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RetainedPackagesMarker {}
pub trait RetainedPackagesProxyInterface: Send + Sync {
type ClearResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#clear(&self) -> Self::ClearResponseFut;
type ReplaceResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#replace(
&self,
iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
) -> Self::ReplaceResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RetainedPackagesSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RetainedPackagesSynchronousProxy {
type Proxy = RetainedPackagesProxy;
type Protocol = RetainedPackagesMarker;
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 RetainedPackagesSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<RetainedPackagesEvent, fidl::Error> {
RetainedPackagesEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#clear(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x7f17476f097961ac,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#replace(
&self,
mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<RetainedPackagesReplaceRequest, fidl::encoding::EmptyPayload>(
(iterator,),
0x5021e479570f3a9f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct RetainedPackagesProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RetainedPackagesProxy {
type Protocol = RetainedPackagesMarker;
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 RetainedPackagesProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RetainedPackagesEventStream {
RetainedPackagesEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#clear(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RetainedPackagesProxyInterface::r#clear(self)
}
pub fn r#replace(
&self,
mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RetainedPackagesProxyInterface::r#replace(self, iterator)
}
}
impl RetainedPackagesProxyInterface for RetainedPackagesProxy {
type ClearResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#clear(&self) -> Self::ClearResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7f17476f097961ac,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x7f17476f097961ac,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReplaceResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#replace(
&self,
mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
) -> Self::ReplaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5021e479570f3a9f,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<RetainedPackagesReplaceRequest, ()>(
(iterator,),
0x5021e479570f3a9f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct RetainedPackagesEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RetainedPackagesEventStream {}
impl futures::stream::FusedStream for RetainedPackagesEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RetainedPackagesEventStream {
type Item = Result<RetainedPackagesEvent, 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(RetainedPackagesEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RetainedPackagesEvent {}
impl RetainedPackagesEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RetainedPackagesEvent, 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:
<RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RetainedPackagesRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RetainedPackagesRequestStream {}
impl futures::stream::FusedStream for RetainedPackagesRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RetainedPackagesRequestStream {
type Protocol = RetainedPackagesMarker;
type ControlHandle = RetainedPackagesControlHandle;
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 {
RetainedPackagesControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RetainedPackagesRequestStream {
type Item = Result<RetainedPackagesRequest, 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 RetainedPackagesRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x7f17476f097961ac => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RetainedPackagesControlHandle { inner: this.inner.clone() };
Ok(RetainedPackagesRequest::Clear {
responder: RetainedPackagesClearResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5021e479570f3a9f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RetainedPackagesReplaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RetainedPackagesReplaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RetainedPackagesControlHandle { inner: this.inner.clone() };
Ok(RetainedPackagesRequest::Replace {
iterator: req.iterator,
responder: RetainedPackagesReplaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RetainedPackagesRequest {
Clear { responder: RetainedPackagesClearResponder },
Replace {
iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
responder: RetainedPackagesReplaceResponder,
},
}
impl RetainedPackagesRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_clear(self) -> Option<(RetainedPackagesClearResponder)> {
if let RetainedPackagesRequest::Clear { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_replace(
self,
) -> Option<(fidl::endpoints::ClientEnd<BlobIdIteratorMarker>, RetainedPackagesReplaceResponder)>
{
if let RetainedPackagesRequest::Replace { iterator, responder } = self {
Some((iterator, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RetainedPackagesRequest::Clear { .. } => "clear",
RetainedPackagesRequest::Replace { .. } => "replace",
}
}
}
#[derive(Debug, Clone)]
pub struct RetainedPackagesControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RetainedPackagesControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl RetainedPackagesControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RetainedPackagesClearResponder {
control_handle: std::mem::ManuallyDrop<RetainedPackagesControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RetainedPackagesClearResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RetainedPackagesClearResponder {
type ControlHandle = RetainedPackagesControlHandle;
fn control_handle(&self) -> &RetainedPackagesControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RetainedPackagesClearResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x7f17476f097961ac,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RetainedPackagesReplaceResponder {
control_handle: std::mem::ManuallyDrop<RetainedPackagesControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RetainedPackagesReplaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RetainedPackagesReplaceResponder {
type ControlHandle = RetainedPackagesControlHandle;
fn control_handle(&self) -> &RetainedPackagesControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RetainedPackagesReplaceResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x5021e479570f3a9f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for BlobWrittenError {
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 BlobWrittenError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for BlobWrittenError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobWrittenError {
#[inline(always)]
fn new_empty() -> Self {
Self::NotWritten
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GcProtection {
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 GcProtection {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GcProtection {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GcProtection {
#[inline(always)]
fn new_empty() -> Self {
Self::OpenPackageTracking
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetInfoError {
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 GetInfoError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GetInfoError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetInfoError {
#[inline(always)]
fn new_empty() -> Self {
Self::UnknownUrl
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetSubpackageError {
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 GetSubpackageError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for GetSubpackageError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetSubpackageError {
#[inline(always)]
fn new_empty() -> Self {
Self::SuperpackageClosed
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for OpenBlobError {
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 OpenBlobError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenBlobError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenBlobError {
#[inline(always)]
fn new_empty() -> Self {
Self::OutOfSpace
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryStorageType {
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 RepositoryStorageType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RepositoryStorageType
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryStorageType {
#[inline(always)]
fn new_empty() -> Self {
Self::Ephemeral
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ResolveError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<i32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<i32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ResolveError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResolveError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveError {
#[inline(always)]
fn new_empty() -> Self {
Self::Internal
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<i32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SetUpgradableUrlsError {
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 SetUpgradableUrlsError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for SetUpgradableUrlsError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetUpgradableUrlsError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WriteError {
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 WriteError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WriteError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteError {
#[inline(always)]
fn new_empty() -> Self {
Self::UnknownUrl
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlobId, D> for &BlobId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlobId).write_unaligned((self as *const BlobId).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
> fidl::encoding::Encode<BlobId, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobId {
#[inline(always)]
fn new_empty() -> Self {
Self { merkle_root: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobIdIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobIdIteratorNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BlobIdIteratorNextResponse, D> for &BlobIdIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobIdIteratorNextResponse>(offset);
fidl::encoding::Encode::<BlobIdIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<BlobId> as fidl::encoding::ValueTypeMarker>::borrow(&self.blobs),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<BlobId>, D>,
> fidl::encoding::Encode<BlobIdIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobIdIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobIdIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { blobs: fidl::new_empty!(fidl::encoding::UnboundedVector<BlobId>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<BlobId>,
D,
&mut self.blobs,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobInfo {
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
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlobInfo, D> for &BlobInfo {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlobInfo).write_unaligned((self as *const BlobInfo).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<BlobId, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<BlobInfo, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobInfo {
#[inline(always)]
fn new_empty() -> Self {
Self { blob_id: fidl::new_empty!(BlobId, D), length: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BlobInfoIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobInfoIteratorNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BlobInfoIteratorNextResponse, D> for &BlobInfoIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobInfoIteratorNextResponse>(offset);
fidl::encoding::Encode::<BlobInfoIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<BlobInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.blobs),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<BlobInfo>, D>,
> fidl::encoding::Encode<BlobInfoIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobInfoIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BlobInfoIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { blobs: fidl::new_empty!(fidl::encoding::UnboundedVector<BlobInfo>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<BlobInfo>,
D,
&mut self.blobs,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CupGetInfoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CupGetInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupGetInfoRequest, D>
for &CupGetInfoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupGetInfoRequest>(offset);
fidl::encoding::Encode::<CupGetInfoRequest, D>::encode(
(<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.url),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
fidl::encoding::Encode<CupGetInfoRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupGetInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupGetInfoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { url: fidl::new_empty!(PackageUrl, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PackageUrl, D, &mut self.url, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CupWriteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CupWriteRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupWriteRequest, D>
for &CupWriteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupWriteRequest>(offset);
fidl::encoding::Encode::<CupWriteRequest, D>::encode(
(
<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
<CupData as fidl::encoding::ValueTypeMarker>::borrow(&self.cup),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PackageUrl, D>,
T1: fidl::encoding::Encode<CupData, D>,
> fidl::encoding::Encode<CupWriteRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupWriteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupWriteRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { url: fidl::new_empty!(PackageUrl, D), cup: fidl::new_empty!(CupData, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PackageUrl, D, &mut self.url, decoder, offset + 0, _depth)?;
fidl::decode!(CupData, D, &mut self.cup, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CupGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CupGetInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupGetInfoResponse, D>
for &CupGetInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupGetInfoResponse>(offset);
fidl::encoding::Encode::<CupGetInfoResponse, D>::encode(
(
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.version,
),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
&self.channel,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
> fidl::encoding::Encode<CupGetInfoResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupGetInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
version: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
&mut self.version,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.channel,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FontResolverResolveRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FontResolverResolveRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
FontResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut FontResolverResolveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FontResolverResolveRequest>(offset);
fidl::encoding::Encode::<
FontResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.package_url,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.directory_request,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
FontResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FontResolverResolveRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for FontResolverResolveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
package_url: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
directory_request: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.package_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.directory_request,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NeededBlobsBlobWrittenRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NeededBlobsBlobWrittenRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NeededBlobsBlobWrittenRequest, D>
for &NeededBlobsBlobWrittenRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsBlobWrittenRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NeededBlobsBlobWrittenRequest)
.write_unaligned((self as *const NeededBlobsBlobWrittenRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
fidl::encoding::Encode<NeededBlobsBlobWrittenRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsBlobWrittenRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NeededBlobsBlobWrittenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { blob_id: fidl::new_empty!(BlobId, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NeededBlobsGetMissingBlobsRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NeededBlobsGetMissingBlobsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
NeededBlobsGetMissingBlobsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut NeededBlobsGetMissingBlobsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsGetMissingBlobsRequest>(offset);
fidl::encoding::Encode::<NeededBlobsGetMissingBlobsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
NeededBlobsGetMissingBlobsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsGetMissingBlobsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsGetMissingBlobsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NeededBlobsOpenBlobRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenBlobRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for &NeededBlobsOpenBlobRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NeededBlobsOpenBlobRequest)
.write_unaligned((self as *const NeededBlobsOpenBlobRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NeededBlobsOpenBlobRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { blob_id: fidl::new_empty!(BlobId, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NeededBlobsOpenBlobResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenBlobResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
NeededBlobsOpenBlobResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut NeededBlobsOpenBlobResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenBlobResponse>(offset);
fidl::encoding::Encode::<NeededBlobsOpenBlobResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::OptionalUnion<BlobWriter> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
NeededBlobsOpenBlobResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenBlobResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsOpenBlobResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
writer: fidl::new_empty!(
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.writer,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NeededBlobsOpenMetaBlobResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenMetaBlobResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
NeededBlobsOpenMetaBlobResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut NeededBlobsOpenMetaBlobResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenMetaBlobResponse>(offset);
fidl::encoding::Encode::<NeededBlobsOpenMetaBlobResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::OptionalUnion<BlobWriter> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
NeededBlobsOpenMetaBlobResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NeededBlobsOpenMetaBlobResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NeededBlobsOpenMetaBlobResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
writer: fidl::new_empty!(
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::OptionalUnion<BlobWriter>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.writer,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageCacheBasePackageIndexRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageCacheBasePackageIndexRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
PackageCacheBasePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageCacheBasePackageIndexRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheBasePackageIndexRequest>(offset);
fidl::encoding::Encode::<
PackageCacheBasePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageCacheBasePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheBasePackageIndexRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheBasePackageIndexRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageCacheCachePackageIndexRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageCacheCachePackageIndexRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
PackageCacheCachePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageCacheCachePackageIndexRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheCachePackageIndexRequest>(offset);
fidl::encoding::Encode::<
PackageCacheCachePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageCacheCachePackageIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheCachePackageIndexRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheCachePackageIndexRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageCacheGetRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageCacheGetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl
fidl::encoding::Encode<
PackageCacheGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageCacheGetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheGetRequest>(offset);
fidl::encoding::Encode::<PackageCacheGetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<BlobInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.meta_far_blob),
<GcProtection as fidl::encoding::ValueTypeMarker>::borrow(&self.gc_protection),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.needed_blobs),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<BlobInfo, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<GcProtection, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageCacheGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheGetRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 40, depth)?;
self.2.encode(encoder, offset + 44, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheGetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
meta_far_blob: fidl::new_empty!(
BlobInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
),
gc_protection: fidl::new_empty!(
GcProtection,
fidl::encoding::DefaultFuchsiaResourceDialect
),
needed_blobs: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
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 + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
BlobInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.meta_far_blob,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
GcProtection,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.gc_protection,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.needed_blobs,
decoder,
offset + 44,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageCacheGetSubpackageRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageCacheGetSubpackageRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl
fidl::encoding::Encode<
PackageCacheGetSubpackageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageCacheGetSubpackageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheGetSubpackageRequest>(offset);
fidl::encoding::Encode::<
PackageCacheGetSubpackageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.superpackage),
<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackage),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dir
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<BlobId, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<PackageUrl, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageCacheGetSubpackageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheGetSubpackageRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
self.2.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageCacheGetSubpackageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
superpackage: fidl::new_empty!(
BlobId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
subpackage: fidl::new_empty!(
PackageUrl,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
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 + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
BlobId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.superpackage,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
PackageUrl,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.subpackage,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageCacheSetUpgradableUrlsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageCacheSetUpgradableUrlsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D>
for &PackageCacheSetUpgradableUrlsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
fidl::encoding::Encode::<PackageCacheSetUpgradableUrlsRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<PackageUrl> as fidl::encoding::ValueTypeMarker>::borrow(&self.pinned_urls),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageUrl>, D>,
> fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageCacheSetUpgradableUrlsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { pinned_urls: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageUrl>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<PackageUrl>,
D,
&mut self.pinned_urls,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageIndexEntry {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageIndexEntry {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageIndexEntry, D>
for &PackageIndexEntry
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageIndexEntry>(offset);
fidl::encoding::Encode::<PackageIndexEntry, D>::encode(
(
<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),
<BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.meta_far_blob_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PackageUrl, D>,
T1: fidl::encoding::Encode<BlobId, D>,
> fidl::encoding::Encode<PackageIndexEntry, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageIndexEntry>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageIndexEntry {
#[inline(always)]
fn new_empty() -> Self {
Self {
package_url: fidl::new_empty!(PackageUrl, D),
meta_far_blob_id: fidl::new_empty!(BlobId, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
fidl::decode!(BlobId, D, &mut self.meta_far_blob_id, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageIndexIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageIndexIteratorNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageIndexIteratorNextResponse, D>
for &PackageIndexIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
fidl::encoding::Encode::<PackageIndexIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<PackageIndexEntry> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageIndexEntry>, D>,
> fidl::encoding::Encode<PackageIndexIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageIndexIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
entries: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageIndexEntry>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<PackageIndexEntry>,
D,
&mut self.entries,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageResolverGetHashRequest, D>
for &PackageResolverGetHashRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
fidl::encoding::Encode::<PackageResolverGetHashRequest, D>::encode(
(<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
fidl::encoding::Encode<PackageResolverGetHashRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageResolverGetHashRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { package_url: fidl::new_empty!(PackageUrl, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageResolverResolveRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
PackageResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageResolverResolveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveRequest>(offset);
fidl::encoding::Encode::<
PackageResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.package_url,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dir
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageResolverResolveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
package_url: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.package_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PackageResolverResolveWithContextRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveWithContextRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
PackageResolverResolveWithContextRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PackageResolverResolveWithContextRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveWithContextRequest>(offset);
fidl::encoding::Encode::<
PackageResolverResolveWithContextRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.package_url,
),
<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(&self.context),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dir
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
ResolutionContext,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PackageResolverResolveWithContextRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveWithContextRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(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 + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PackageResolverResolveWithContextRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
package_url: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
context: fidl::new_empty!(
ResolutionContext,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
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 + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.package_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ResolutionContext,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.context,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageResolverGetHashResponse, D>
for &PackageResolverGetHashResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut PackageResolverGetHashResponse)
.write_unaligned((self as *const PackageResolverGetHashResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
fidl::encoding::Encode<PackageResolverGetHashResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageResolverGetHashResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { meta_far_blob_id: fidl::new_empty!(BlobId, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageResolverResolveWithContextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveWithContextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D>
for &PackageResolverResolveWithContextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
fidl::encoding::Encode::<PackageResolverResolveWithContextResponse, D>::encode(
(<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
&self.resolved_context,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolutionContext, D>>
fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageResolverResolveWithContextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
ResolutionContext,
D,
&mut self.resolved_context,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageResolverResolveResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PackageResolverResolveResponse, D>
for &PackageResolverResolveResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
fidl::encoding::Encode::<PackageResolverResolveResponse, D>::encode(
(<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
&self.resolved_context,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolutionContext, D>>
fidl::encoding::Encode<PackageResolverResolveResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PackageResolverResolveResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
ResolutionContext,
D,
&mut self.resolved_context,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PackageUrl {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PackageUrl {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageUrl, D>
for &PackageUrl
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageUrl>(offset);
fidl::encoding::Encode::<PackageUrl, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.url,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<PackageUrl, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PackageUrl>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageUrl {
#[inline(always)]
fn new_empty() -> Self {
Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.url,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryIteratorNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RepositoryIteratorNextResponse, D>
for &RepositoryIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
fidl::encoding::Encode::<RepositoryIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<RepositoryConfig> as fidl::encoding::ValueTypeMarker>::borrow(&self.repos),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RepositoryConfig>, D>,
> fidl::encoding::Encode<RepositoryIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RepositoryIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { repos: fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryConfig>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RepositoryConfig>,
D,
&mut self.repos,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddMirrorRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddMirrorRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D>
for &RepositoryManagerAddMirrorRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
fidl::encoding::Encode::<RepositoryManagerAddMirrorRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.repo_url,
),
<MirrorConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.mirror),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<MirrorConfig, D>,
> fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RepositoryManagerAddMirrorRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
mirror: fidl::new_empty!(MirrorConfig, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.repo_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(MirrorConfig, D, &mut self.mirror, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RepositoryManagerAddRequest, D> for &RepositoryManagerAddRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
fidl::encoding::Encode::<RepositoryManagerAddRequest, D>::encode(
(<RepositoryConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.repo),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RepositoryConfig, D>>
fidl::encoding::Encode<RepositoryManagerAddRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RepositoryManagerAddRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { repo: fidl::new_empty!(RepositoryConfig, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(RepositoryConfig, D, &mut self.repo, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RepositoryManagerListRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryManagerListRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
RepositoryManagerListRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RepositoryManagerListRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerListRequest>(offset);
fidl::encoding::Encode::<RepositoryManagerListRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RepositoryManagerListRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerListRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RepositoryManagerListRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveMirrorRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveMirrorRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D>
for &RepositoryManagerRemoveMirrorRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
fidl::encoding::Encode::<RepositoryManagerRemoveMirrorRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.repo_url,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.mirror_url,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RepositoryManagerRemoveMirrorRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
mirror_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.repo_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.mirror_url,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RepositoryManagerRemoveRequest, D>
for &RepositoryManagerRemoveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
fidl::encoding::Encode::<RepositoryManagerRemoveRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.repo_url,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<RepositoryManagerRemoveRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RepositoryManagerRemoveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.repo_url,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryUrl {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryUrl {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryUrl, D>
for &RepositoryUrl
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryUrl>(offset);
fidl::encoding::Encode::<RepositoryUrl, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.url,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RepositoryUrl, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryUrl>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryUrl {
#[inline(always)]
fn new_empty() -> Self {
Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.url,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ResolutionContext {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ResolutionContext {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolutionContext, D>
for &ResolutionContext
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ResolutionContext>(offset);
fidl::encoding::Encode::<ResolutionContext, D>::encode(
(<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.bytes,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
> fidl::encoding::Encode<ResolutionContext, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ResolutionContext>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolutionContext {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RetainedPackagesReplaceRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RetainedPackagesReplaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
RetainedPackagesReplaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RetainedPackagesReplaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RetainedPackagesReplaceRequest>(offset);
fidl::encoding::Encode::<RetainedPackagesReplaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RetainedPackagesReplaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RetainedPackagesReplaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RetainedPackagesReplaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl CupData {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.signature {
return 5;
}
if let Some(_) = self.response {
return 4;
}
if let Some(_) = self.nonce {
return 3;
}
if let Some(_) = self.key_id {
return 2;
}
if let Some(_) = self.request {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CupData {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CupData {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupData, D> for &CupData {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CupData>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
self.request.as_ref().map(
<fidl::encoding::Vector<u8, 65536> 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, D>(
self.key_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 32>, D>(
self.nonce.as_ref().map(
<fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
self.response.as_ref().map(
<fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 72>, D>(
self.signature.as_ref().map(
<fidl::encoding::Vector<u8, 72> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupData {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 65536> 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
.request
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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.key_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 32> 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
.nonce
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 32>, D));
fidl::decode!(fidl::encoding::Array<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 65536> 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
.response
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 72> 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
.signature
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 72>, D));
fidl::decode!(fidl::encoding::Vector<u8, 72>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MirrorConfig {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.blob_mirror_url {
return 4;
}
if let Some(_) = self.subscribe {
return 2;
}
if let Some(_) = self.mirror_url {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MirrorConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MirrorConfig {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MirrorConfig, D>
for &MirrorConfig
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MirrorConfig>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.mirror_url.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.subscribe.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.blob_mirror_url.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MirrorConfig {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.mirror_url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.subscribe.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.blob_mirror_url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl RepositoryConfig {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.storage_type {
return 8;
}
if let Some(_) = self.use_local_mirror {
return 7;
}
if let Some(_) = self.root_threshold {
return 6;
}
if let Some(_) = self.root_version {
return 5;
}
if let Some(_) = self.mirrors {
return 3;
}
if let Some(_) = self.root_keys {
return 2;
}
if let Some(_) = self.repo_url {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryConfig {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryConfig, D>
for &RepositoryConfig
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryConfig>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.repo_url.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D>(
self.root_keys.as_ref().map(<fidl::encoding::UnboundedVector<RepositoryKeyConfig> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<MirrorConfig>, D>(
self.mirrors.as_ref().map(<fidl::encoding::UnboundedVector<MirrorConfig> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.root_version.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.root_threshold.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.use_local_mirror
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<RepositoryStorageType, D>(
self.storage_type
.as_ref()
.map(<RepositoryStorageType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryConfig {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.repo_url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::UnboundedVector<RepositoryKeyConfig> 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.root_keys.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<RepositoryKeyConfig>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::UnboundedVector<MirrorConfig> 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.mirrors.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<MirrorConfig>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<MirrorConfig>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
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 =
<u32 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.root_version.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
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 =
<u32 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.root_threshold.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.use_local_mirror.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
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 =
<RepositoryStorageType 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
.storage_type
.get_or_insert_with(|| fidl::new_empty!(RepositoryStorageType, D));
fidl::decode!(
RepositoryStorageType,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for BlobWriter {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BlobWriter {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<BlobWriter, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut BlobWriter
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlobWriter>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
BlobWriter::File(ref mut val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
val
),
encoder,
offset + 8,
_depth,
),
BlobWriter::Writer(ref mut val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
val
),
encoder,
offset + 8,
_depth,
),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriter {
#[inline(always)]
fn new_empty() -> Self {
Self::File(fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let BlobWriter::File(_) = self {
} else {
*self = BlobWriter::File(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let BlobWriter::File(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let BlobWriter::Writer(_) = self {
} else {
*self = BlobWriter::Writer(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let BlobWriter::Writer(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RepositoryKeyConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RepositoryKeyConfig {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryKeyConfig, D>
for &RepositoryKeyConfig
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RepositoryKeyConfig>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
RepositoryKeyConfig::Ed25519Key(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
RepositoryKeyConfig::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryKeyConfig {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => {
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
)
}
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let RepositoryKeyConfig::Ed25519Key(_) = self {
} else {
*self = RepositoryKeyConfig::Ed25519Key(fidl::new_empty!(
fidl::encoding::UnboundedVector<u8>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let RepositoryKeyConfig::Ed25519Key(ref mut val) = self {
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = RepositoryKeyConfig::__SourceBreaking { unknown_ordinal: ordinal };
}
}
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);
}
Ok(())
}
}
}