Skip to main content

fidl_fuchsia_io/
fidl_fuchsia_io.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_io_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14/// The type to identify a connection to a node.
15/// It represents a capability: a reference to a node with associated rights.
16pub type Token = fidl::Event;
17
18#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct DirectoryCreateSymlinkRequest {
20    pub name: String,
21    pub target: Vec<u8>,
22    pub connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
23}
24
25impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
26    for DirectoryCreateSymlinkRequest
27{
28}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct DirectoryDeprecatedOpenRequest {
32    pub flags: OpenFlags,
33    pub mode: ModeType,
34    pub path: String,
35    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39    for DirectoryDeprecatedOpenRequest
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct DirectoryGetTokenResponse {
45    pub s: i32,
46    pub token: Option<fidl::NullableHandle>,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryGetTokenResponse {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct DirectoryLinkRequest {
53    pub src: String,
54    pub dst_parent_token: fidl::NullableHandle,
55    pub dst: String,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryLinkRequest {}
59
60#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct DirectoryRenameRequest {
62    pub src: String,
63    pub dst_parent_token: fidl::Event,
64    pub dst: String,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryRenameRequest {}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct DirectoryWatchRequest {
71    pub mask: WatchMask,
72    pub options: u32,
73    pub watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
74}
75
76impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryWatchRequest {}
77
78#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct FileAllocateRequest {
80    pub offset: u64,
81    pub length: u64,
82    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
83    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
84    /// support a particular provided mode bit, or combination of mode bits, an error is
85    /// returned.
86    pub mode: AllocateMode,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileAllocateRequest {}
90
91#[derive(Debug, PartialEq)]
92pub struct FileEnableVerityRequest {
93    pub options: VerificationOptions,
94}
95
96impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileEnableVerityRequest {}
97
98#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
99pub struct FileObject {
100    /// An optional event which transmits information about an object's readability
101    /// or writability. This event relays information about the underlying object, not
102    /// the capability granted to client: this event may be signalled "readable" on a
103    /// connection that does not have the capability to read.
104    ///
105    /// The "`FILE_SIGNAL_`" values may be observed on this event.
106    pub event: Option<fidl::Event>,
107    /// A placeholder for future stream support.
108    ///
109    /// Currently, servers are required not to send a handle in this field.
110    pub stream: Option<fidl::Stream>,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {}
114
115#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
116pub struct FileGetBackingMemoryResponse {
117    pub vmo: fidl::Vmo,
118}
119
120impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
121    for FileGetBackingMemoryResponse
122{
123}
124
125#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct LinkableLinkIntoRequest {
127    pub dst_parent_token: fidl::Event,
128    pub dst: String,
129}
130
131impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LinkableLinkIntoRequest {}
132
133#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
134pub struct NodeDeprecatedCloneRequest {
135    pub flags: OpenFlags,
136    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140    for NodeDeprecatedCloneRequest
141{
142}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct NodeListExtendedAttributesRequest {
146    pub iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
150    for NodeListExtendedAttributesRequest
151{
152}
153
154#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct NodeOnOpenRequest {
156    pub s: i32,
157    pub info: Option<Box<NodeInfoDeprecated>>,
158}
159
160impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeOnOpenRequest {}
161
162#[derive(Debug, PartialEq)]
163pub struct NodeSetExtendedAttributeRequest {
164    pub name: Vec<u8>,
165    pub value: ExtendedAttributeValue,
166    /// Specifies the behavior based on the current state of the attribute.
167    pub mode: SetExtendedAttributeMode,
168}
169
170impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
171    for NodeSetExtendedAttributeRequest
172{
173}
174
175#[derive(Debug, PartialEq)]
176pub struct OpenableOpenRequest {
177    pub path: String,
178    pub flags: Flags,
179    pub options: Options,
180    pub object: fidl::Channel,
181}
182
183impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for OpenableOpenRequest {}
184
185#[derive(Debug, Default, PartialEq)]
186pub struct ConnectionInfo {
187    /// The rights possessed by the current connection. Note: `rights` limits
188    /// the set of operations allowed on the connection, but does not guarantee
189    /// their availability. For example, one may have the [`Rights.EXECUTE`]
190    /// right on a file connection, but the file itself does not have the
191    /// `EXECUTE` ability, and hence cannot be executed. See
192    /// [`ConnectionOptions.rights`].
193    pub rights: Option<Operations>,
194    #[doc(hidden)]
195    pub __source_breaking: fidl::marker::SourceBreaking,
196}
197
198impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectionInfo {}
199
200/// Auxiliary data for the file representation of a node.
201#[derive(Debug, Default, PartialEq)]
202pub struct FileInfo {
203    /// True if the file is opened in append mode.
204    /// In append mode, the seek offset is moved to the end before every
205    /// write, the two steps performed in an atomic manner.
206    pub is_append: Option<bool>,
207    /// An optional event which transmits information about an object's
208    /// readability or writability. This event relays information about the
209    /// underlying object, not the capability granted to client: this event
210    /// may be signalled "readable" on a connection that does not have
211    /// the capability to read.
212    ///
213    /// This event will be present if the following conditions are met:
214    ///
215    /// - The `available_operations` on the file connection is not empty.
216    /// - The filesystem supports signalling readability/writability events.
217    ///
218    /// The [`FileSignal`] values may be observed on this event.
219    pub observer: Option<fidl::Event>,
220    /// An optional stream object, which can be used to read to and write from
221    /// the file more quickly than with fidl.
222    ///
223    /// The channel for the file *must* be held open while the stream is in use.
224    /// Using a stream object that has outlived the channel it came from may
225    /// result in failures or unexpected results.
226    pub stream: Option<fidl::Stream>,
227    /// Requested attributes for the file. This is only populated if requested.
228    pub attributes: Option<NodeAttributes2>,
229    #[doc(hidden)]
230    pub __source_breaking: fidl::marker::SourceBreaking,
231}
232
233impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {}
234
235/// The value type for an extended attribute. If the value is less than 32768
236/// bytes, then it is included inline. Values larger than this size are written
237/// into a vmo buffer.
238#[derive(Debug)]
239pub enum ExtendedAttributeValue {
240    Bytes(Vec<u8>),
241    Buffer(fidl::Vmo),
242    #[doc(hidden)]
243    __SourceBreaking {
244        unknown_ordinal: u64,
245    },
246}
247
248/// Pattern that matches an unknown `ExtendedAttributeValue` member.
249#[macro_export]
250macro_rules! ExtendedAttributeValueUnknown {
251    () => {
252        _
253    };
254}
255
256// Custom PartialEq so that unknown variants are not equal to themselves.
257impl PartialEq for ExtendedAttributeValue {
258    fn eq(&self, other: &Self) -> bool {
259        match (self, other) {
260            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
261            (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
262            _ => false,
263        }
264    }
265}
266
267impl ExtendedAttributeValue {
268    #[inline]
269    pub fn ordinal(&self) -> u64 {
270        match *self {
271            Self::Bytes(_) => 1,
272            Self::Buffer(_) => 2,
273            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
274        }
275    }
276
277    #[inline]
278    pub fn unknown_variant_for_testing() -> Self {
279        Self::__SourceBreaking { unknown_ordinal: 0 }
280    }
281
282    #[inline]
283    pub fn is_unknown(&self) -> bool {
284        match self {
285            Self::__SourceBreaking { .. } => true,
286            _ => false,
287        }
288    }
289}
290
291impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ExtendedAttributeValue {}
292
293#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
294pub enum NodeInfoDeprecated {
295    /// No protocol information was supplied by the connection.
296    Service(Service),
297    /// The connection composes [`File`].
298    File(FileObject),
299    /// The connection composes [`Directory`].
300    Directory(DirectoryObject),
301    /// The connection composes ['Symlink'].
302    Symlink(SymlinkObject),
303}
304
305impl NodeInfoDeprecated {
306    #[inline]
307    pub fn ordinal(&self) -> u64 {
308        match *self {
309            Self::Service(_) => 1,
310            Self::File(_) => 2,
311            Self::Directory(_) => 3,
312            Self::Symlink(_) => 4,
313        }
314    }
315}
316
317impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeInfoDeprecated {}
318
319#[derive(Debug)]
320pub enum Representation {
321    /// The [`Node`] protocol was negotiated for this connection.
322    Node(NodeInfo),
323    /// The [`File`] protocol was negotiated for this connection.
324    Directory(DirectoryInfo),
325    /// The [`File`] protocol was negotiated for this connection.
326    File(FileInfo),
327    /// The [`Symlink`] protocol was negotiated for this connection.
328    Symlink(SymlinkInfo),
329    #[doc(hidden)]
330    __SourceBreaking { unknown_ordinal: u64 },
331}
332
333/// Pattern that matches an unknown `Representation` member.
334#[macro_export]
335macro_rules! RepresentationUnknown {
336    () => {
337        _
338    };
339}
340
341// Custom PartialEq so that unknown variants are not equal to themselves.
342impl PartialEq for Representation {
343    fn eq(&self, other: &Self) -> bool {
344        match (self, other) {
345            (Self::Node(x), Self::Node(y)) => *x == *y,
346            (Self::Directory(x), Self::Directory(y)) => *x == *y,
347            (Self::File(x), Self::File(y)) => *x == *y,
348            (Self::Symlink(x), Self::Symlink(y)) => *x == *y,
349            _ => false,
350        }
351    }
352}
353
354impl Representation {
355    #[inline]
356    pub fn ordinal(&self) -> u64 {
357        match *self {
358            Self::Node(_) => 1,
359            Self::Directory(_) => 2,
360            Self::File(_) => 3,
361            Self::Symlink(_) => 4,
362            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
363        }
364    }
365
366    #[inline]
367    pub fn unknown_variant_for_testing() -> Self {
368        Self::__SourceBreaking { unknown_ordinal: 0 }
369    }
370
371    #[inline]
372    pub fn is_unknown(&self) -> bool {
373        match self {
374            Self::__SourceBreaking { .. } => true,
375            _ => false,
376        }
377    }
378}
379
380impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Representation {}
381
382#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
383pub struct AdvisoryLockingMarker;
384
385impl fidl::endpoints::ProtocolMarker for AdvisoryLockingMarker {
386    type Proxy = AdvisoryLockingProxy;
387    type RequestStream = AdvisoryLockingRequestStream;
388    #[cfg(target_os = "fuchsia")]
389    type SynchronousProxy = AdvisoryLockingSynchronousProxy;
390
391    const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
392}
393pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
394
395pub trait AdvisoryLockingProxyInterface: Send + Sync {
396    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
397        + Send;
398    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
399}
400#[derive(Debug)]
401#[cfg(target_os = "fuchsia")]
402pub struct AdvisoryLockingSynchronousProxy {
403    client: fidl::client::sync::Client,
404}
405
406#[cfg(target_os = "fuchsia")]
407impl fidl::endpoints::SynchronousProxy for AdvisoryLockingSynchronousProxy {
408    type Proxy = AdvisoryLockingProxy;
409    type Protocol = AdvisoryLockingMarker;
410
411    fn from_channel(inner: fidl::Channel) -> Self {
412        Self::new(inner)
413    }
414
415    fn into_channel(self) -> fidl::Channel {
416        self.client.into_channel()
417    }
418
419    fn as_channel(&self) -> &fidl::Channel {
420        self.client.as_channel()
421    }
422}
423
424#[cfg(target_os = "fuchsia")]
425impl AdvisoryLockingSynchronousProxy {
426    pub fn new(channel: fidl::Channel) -> Self {
427        Self { client: fidl::client::sync::Client::new(channel) }
428    }
429
430    pub fn into_channel(self) -> fidl::Channel {
431        self.client.into_channel()
432    }
433
434    /// Waits until an event arrives and returns it. It is safe for other
435    /// threads to make concurrent requests while waiting for an event.
436    pub fn wait_for_event(
437        &self,
438        deadline: zx::MonotonicInstant,
439    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
440        AdvisoryLockingEvent::decode(self.client.wait_for_event::<AdvisoryLockingMarker>(deadline)?)
441    }
442
443    /// Acquires an advisory lock on the underlying file.
444    ///
445    /// The lock lasts until either this connection is closed or
446    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
447    /// explicitly.
448    ///
449    /// Advisory locks are purely advisory. They do not prevent actual read or
450    /// write operations from occurring on the file, either through this
451    /// connection or through other connections.
452    ///
453    /// This method requires the following rights:
454    ///
455    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
456    /// * [`Rights.WRITE_BYTES`] if `request.type` is
457    ///   [`AdvisoryLockType.WRITE`].
458    ///
459    /// # Errors
460    ///
461    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
462    ///   example, another connection might hold a conflicting lock type.
463    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
464    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
465    ///   to acquire the given type of lock.
466    pub fn r#advisory_lock(
467        &self,
468        mut request: &AdvisoryLockRequest,
469        ___deadline: zx::MonotonicInstant,
470    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
471        let _response = self.client.send_query::<
472            AdvisoryLockingAdvisoryLockRequest,
473            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
474            AdvisoryLockingMarker,
475        >(
476            (request,),
477            0x6ee9c0ad53ec87aa,
478            fidl::encoding::DynamicFlags::empty(),
479            ___deadline,
480        )?;
481        Ok(_response.map(|x| x))
482    }
483}
484
485#[cfg(target_os = "fuchsia")]
486impl From<AdvisoryLockingSynchronousProxy> for zx::NullableHandle {
487    fn from(value: AdvisoryLockingSynchronousProxy) -> Self {
488        value.into_channel().into()
489    }
490}
491
492#[cfg(target_os = "fuchsia")]
493impl From<fidl::Channel> for AdvisoryLockingSynchronousProxy {
494    fn from(value: fidl::Channel) -> Self {
495        Self::new(value)
496    }
497}
498
499#[cfg(target_os = "fuchsia")]
500impl fidl::endpoints::FromClient for AdvisoryLockingSynchronousProxy {
501    type Protocol = AdvisoryLockingMarker;
502
503    fn from_client(value: fidl::endpoints::ClientEnd<AdvisoryLockingMarker>) -> Self {
504        Self::new(value.into_channel())
505    }
506}
507
508#[derive(Debug, Clone)]
509pub struct AdvisoryLockingProxy {
510    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
511}
512
513impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
514    type Protocol = AdvisoryLockingMarker;
515
516    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
517        Self::new(inner)
518    }
519
520    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
521        self.client.into_channel().map_err(|client| Self { client })
522    }
523
524    fn as_channel(&self) -> &::fidl::AsyncChannel {
525        self.client.as_channel()
526    }
527}
528
529impl AdvisoryLockingProxy {
530    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
531    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
532        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
533        Self { client: fidl::client::Client::new(channel, protocol_name) }
534    }
535
536    /// Get a Stream of events from the remote end of the protocol.
537    ///
538    /// # Panics
539    ///
540    /// Panics if the event stream was already taken.
541    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
542        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
543    }
544
545    /// Acquires an advisory lock on the underlying file.
546    ///
547    /// The lock lasts until either this connection is closed or
548    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
549    /// explicitly.
550    ///
551    /// Advisory locks are purely advisory. They do not prevent actual read or
552    /// write operations from occurring on the file, either through this
553    /// connection or through other connections.
554    ///
555    /// This method requires the following rights:
556    ///
557    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
558    /// * [`Rights.WRITE_BYTES`] if `request.type` is
559    ///   [`AdvisoryLockType.WRITE`].
560    ///
561    /// # Errors
562    ///
563    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
564    ///   example, another connection might hold a conflicting lock type.
565    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
566    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
567    ///   to acquire the given type of lock.
568    pub fn r#advisory_lock(
569        &self,
570        mut request: &AdvisoryLockRequest,
571    ) -> fidl::client::QueryResponseFut<
572        AdvisoryLockingAdvisoryLockResult,
573        fidl::encoding::DefaultFuchsiaResourceDialect,
574    > {
575        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
576    }
577}
578
579impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
580    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
581        AdvisoryLockingAdvisoryLockResult,
582        fidl::encoding::DefaultFuchsiaResourceDialect,
583    >;
584    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
585        fn _decode(
586            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
587        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
588            let _response = fidl::client::decode_transaction_body::<
589                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
590                fidl::encoding::DefaultFuchsiaResourceDialect,
591                0x6ee9c0ad53ec87aa,
592            >(_buf?)?;
593            Ok(_response.map(|x| x))
594        }
595        self.client.send_query_and_decode::<
596            AdvisoryLockingAdvisoryLockRequest,
597            AdvisoryLockingAdvisoryLockResult,
598        >(
599            (request,),
600            0x6ee9c0ad53ec87aa,
601            fidl::encoding::DynamicFlags::empty(),
602            _decode,
603        )
604    }
605}
606
607pub struct AdvisoryLockingEventStream {
608    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
609}
610
611impl std::marker::Unpin for AdvisoryLockingEventStream {}
612
613impl futures::stream::FusedStream for AdvisoryLockingEventStream {
614    fn is_terminated(&self) -> bool {
615        self.event_receiver.is_terminated()
616    }
617}
618
619impl futures::Stream for AdvisoryLockingEventStream {
620    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
621
622    fn poll_next(
623        mut self: std::pin::Pin<&mut Self>,
624        cx: &mut std::task::Context<'_>,
625    ) -> std::task::Poll<Option<Self::Item>> {
626        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
627            &mut self.event_receiver,
628            cx
629        )?) {
630            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
631            None => std::task::Poll::Ready(None),
632        }
633    }
634}
635
636#[derive(Debug)]
637pub enum AdvisoryLockingEvent {}
638
639impl AdvisoryLockingEvent {
640    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
641    fn decode(
642        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
643    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
644        let (bytes, _handles) = buf.split_mut();
645        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
646        debug_assert_eq!(tx_header.tx_id, 0);
647        match tx_header.ordinal {
648            _ => Err(fidl::Error::UnknownOrdinal {
649                ordinal: tx_header.ordinal,
650                protocol_name:
651                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
652            }),
653        }
654    }
655}
656
657/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
658pub struct AdvisoryLockingRequestStream {
659    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
660    is_terminated: bool,
661}
662
663impl std::marker::Unpin for AdvisoryLockingRequestStream {}
664
665impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
666    fn is_terminated(&self) -> bool {
667        self.is_terminated
668    }
669}
670
671impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
672    type Protocol = AdvisoryLockingMarker;
673    type ControlHandle = AdvisoryLockingControlHandle;
674
675    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
676        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
677    }
678
679    fn control_handle(&self) -> Self::ControlHandle {
680        AdvisoryLockingControlHandle { inner: self.inner.clone() }
681    }
682
683    fn into_inner(
684        self,
685    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
686    {
687        (self.inner, self.is_terminated)
688    }
689
690    fn from_inner(
691        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
692        is_terminated: bool,
693    ) -> Self {
694        Self { inner, is_terminated }
695    }
696}
697
698impl futures::Stream for AdvisoryLockingRequestStream {
699    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
700
701    fn poll_next(
702        mut self: std::pin::Pin<&mut Self>,
703        cx: &mut std::task::Context<'_>,
704    ) -> std::task::Poll<Option<Self::Item>> {
705        let this = &mut *self;
706        if this.inner.check_shutdown(cx) {
707            this.is_terminated = true;
708            return std::task::Poll::Ready(None);
709        }
710        if this.is_terminated {
711            panic!("polled AdvisoryLockingRequestStream after completion");
712        }
713        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
714            |bytes, handles| {
715                match this.inner.channel().read_etc(cx, bytes, handles) {
716                    std::task::Poll::Ready(Ok(())) => {}
717                    std::task::Poll::Pending => return std::task::Poll::Pending,
718                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
719                        this.is_terminated = true;
720                        return std::task::Poll::Ready(None);
721                    }
722                    std::task::Poll::Ready(Err(e)) => {
723                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
724                            e.into(),
725                        ))));
726                    }
727                }
728
729                // A message has been received from the channel
730                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
731
732                std::task::Poll::Ready(Some(match header.ordinal {
733                    0x6ee9c0ad53ec87aa => {
734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
735                        let mut req = fidl::new_empty!(
736                            AdvisoryLockingAdvisoryLockRequest,
737                            fidl::encoding::DefaultFuchsiaResourceDialect
738                        );
739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
740                        let control_handle =
741                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
742                        Ok(AdvisoryLockingRequest::AdvisoryLock {
743                            request: req.request,
744
745                            responder: AdvisoryLockingAdvisoryLockResponder {
746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
747                                tx_id: header.tx_id,
748                            },
749                        })
750                    }
751                    _ => Err(fidl::Error::UnknownOrdinal {
752                        ordinal: header.ordinal,
753                        protocol_name:
754                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
755                    }),
756                }))
757            },
758        )
759    }
760}
761
762/// Advisory locking protocol.
763///
764/// This protocol is intended to be composed into the |File| protocol to
765/// provide support for advisory locking.
766///
767/// Advisory locks are purely advisory. They do not prevent actual read or
768/// write operations from occurring on the file, either through this
769/// connection or through other connections.
770///
771/// These primitives are designed to support the flock() and fcntl(),
772/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
773/// running on Fuchsia expects from other operating systems.
774#[derive(Debug)]
775pub enum AdvisoryLockingRequest {
776    /// Acquires an advisory lock on the underlying file.
777    ///
778    /// The lock lasts until either this connection is closed or
779    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
780    /// explicitly.
781    ///
782    /// Advisory locks are purely advisory. They do not prevent actual read or
783    /// write operations from occurring on the file, either through this
784    /// connection or through other connections.
785    ///
786    /// This method requires the following rights:
787    ///
788    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
789    /// * [`Rights.WRITE_BYTES`] if `request.type` is
790    ///   [`AdvisoryLockType.WRITE`].
791    ///
792    /// # Errors
793    ///
794    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
795    ///   example, another connection might hold a conflicting lock type.
796    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
797    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
798    ///   to acquire the given type of lock.
799    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
800}
801
802impl AdvisoryLockingRequest {
803    #[allow(irrefutable_let_patterns)]
804    pub fn into_advisory_lock(
805        self,
806    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
807        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
808            Some((request, responder))
809        } else {
810            None
811        }
812    }
813
814    /// Name of the method defined in FIDL
815    pub fn method_name(&self) -> &'static str {
816        match *self {
817            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
818        }
819    }
820}
821
822#[derive(Debug, Clone)]
823pub struct AdvisoryLockingControlHandle {
824    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
825}
826
827impl AdvisoryLockingControlHandle {
828    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
829        self.inner.shutdown_with_epitaph(status.into())
830    }
831}
832
833impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
834    fn shutdown(&self) {
835        self.inner.shutdown()
836    }
837
838    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
839        self.inner.shutdown_with_epitaph(status)
840    }
841
842    fn is_closed(&self) -> bool {
843        self.inner.channel().is_closed()
844    }
845    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
846        self.inner.channel().on_closed()
847    }
848
849    #[cfg(target_os = "fuchsia")]
850    fn signal_peer(
851        &self,
852        clear_mask: zx::Signals,
853        set_mask: zx::Signals,
854    ) -> Result<(), zx_status::Status> {
855        use fidl::Peered;
856        self.inner.channel().signal_peer(clear_mask, set_mask)
857    }
858}
859
860impl AdvisoryLockingControlHandle {}
861
862#[must_use = "FIDL methods require a response to be sent"]
863#[derive(Debug)]
864pub struct AdvisoryLockingAdvisoryLockResponder {
865    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
866    tx_id: u32,
867}
868
869/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
870/// if the responder is dropped without sending a response, so that the client
871/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
872impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
873    fn drop(&mut self) {
874        self.control_handle.shutdown();
875        // Safety: drops once, never accessed again
876        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
877    }
878}
879
880impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
881    type ControlHandle = AdvisoryLockingControlHandle;
882
883    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
884        &self.control_handle
885    }
886
887    fn drop_without_shutdown(mut self) {
888        // Safety: drops once, never accessed again due to mem::forget
889        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
890        // Prevent Drop from running (which would shut down the channel)
891        std::mem::forget(self);
892    }
893}
894
895impl AdvisoryLockingAdvisoryLockResponder {
896    /// Sends a response to the FIDL transaction.
897    ///
898    /// Sets the channel to shutdown if an error occurs.
899    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
900        let _result = self.send_raw(result);
901        if _result.is_err() {
902            self.control_handle.shutdown();
903        }
904        self.drop_without_shutdown();
905        _result
906    }
907
908    /// Similar to "send" but does not shutdown the channel if an error occurs.
909    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
910        let _result = self.send_raw(result);
911        self.drop_without_shutdown();
912        _result
913    }
914
915    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
916        self.control_handle
917            .inner
918            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
919                result,
920                self.tx_id,
921                0x6ee9c0ad53ec87aa,
922                fidl::encoding::DynamicFlags::empty(),
923            )
924    }
925}
926
927#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
928pub struct DirectoryMarker;
929
930impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
931    type Proxy = DirectoryProxy;
932    type RequestStream = DirectoryRequestStream;
933    #[cfg(target_os = "fuchsia")]
934    type SynchronousProxy = DirectorySynchronousProxy;
935
936    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
937}
938impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
939pub type DirectoryUnlinkResult = Result<(), i32>;
940pub type DirectoryRenameResult = Result<(), i32>;
941pub type DirectoryCreateSymlinkResult = Result<(), i32>;
942
943pub trait DirectoryProxyInterface: Send + Sync {
944    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
945        + Send;
946    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
947    fn r#clone(
948        &self,
949        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
950    ) -> Result<(), fidl::Error>;
951    type CloseResponseFut: std::future::Future<
952            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
953        > + Send;
954    fn r#close(&self) -> Self::CloseResponseFut;
955    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
956    fn r#query(&self) -> Self::QueryResponseFut;
957    fn r#deprecated_clone(
958        &self,
959        flags: OpenFlags,
960        object: fidl::endpoints::ServerEnd<NodeMarker>,
961    ) -> Result<(), fidl::Error>;
962    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
963        + Send;
964    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
965    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
966    fn r#deprecated_set_attr(
967        &self,
968        flags: NodeAttributeFlags,
969        attributes: &NodeAttributes,
970    ) -> Self::DeprecatedSetAttrResponseFut;
971    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
972        + Send;
973    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
974    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
975        + Send;
976    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
977    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
978        + Send;
979    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
980    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
981        + Send;
982    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
983    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
984        + Send;
985    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
986    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
987        + Send;
988    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
989    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
990        + Send;
991    fn r#update_attributes(
992        &self,
993        payload: &MutableNodeAttributes,
994    ) -> Self::UpdateAttributesResponseFut;
995    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
996    fn r#sync(&self) -> Self::SyncResponseFut;
997    fn r#list_extended_attributes(
998        &self,
999        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1000    ) -> Result<(), fidl::Error>;
1001    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
1002        + Send;
1003    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
1004    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
1005        + Send;
1006    fn r#set_extended_attribute(
1007        &self,
1008        name: &[u8],
1009        value: ExtendedAttributeValue,
1010        mode: SetExtendedAttributeMode,
1011    ) -> Self::SetExtendedAttributeResponseFut;
1012    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1013        + Send;
1014    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1015    fn r#open(
1016        &self,
1017        path: &str,
1018        flags: Flags,
1019        options: &Options,
1020        object: fidl::Channel,
1021    ) -> Result<(), fidl::Error>;
1022    fn r#deprecated_open(
1023        &self,
1024        flags: OpenFlags,
1025        mode: ModeType,
1026        path: &str,
1027        object: fidl::endpoints::ServerEnd<NodeMarker>,
1028    ) -> Result<(), fidl::Error>;
1029    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1030        + Send;
1031    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1032    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1033    fn r#rewind(&self) -> Self::RewindResponseFut;
1034    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::NullableHandle>), fidl::Error>>
1035        + Send;
1036    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1037    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1038    fn r#link(
1039        &self,
1040        src: &str,
1041        dst_parent_token: fidl::NullableHandle,
1042        dst: &str,
1043    ) -> Self::LinkResponseFut;
1044    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1045        + Send;
1046    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1047    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1048        + Send;
1049    fn r#rename(
1050        &self,
1051        src: &str,
1052        dst_parent_token: fidl::Event,
1053        dst: &str,
1054    ) -> Self::RenameResponseFut;
1055    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1056        + Send;
1057    fn r#create_symlink(
1058        &self,
1059        name: &str,
1060        target: &[u8],
1061        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1062    ) -> Self::CreateSymlinkResponseFut;
1063    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1064    fn r#watch(
1065        &self,
1066        mask: WatchMask,
1067        options: u32,
1068        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1069    ) -> Self::WatchResponseFut;
1070}
1071#[derive(Debug)]
1072#[cfg(target_os = "fuchsia")]
1073pub struct DirectorySynchronousProxy {
1074    client: fidl::client::sync::Client,
1075}
1076
1077#[cfg(target_os = "fuchsia")]
1078impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1079    type Proxy = DirectoryProxy;
1080    type Protocol = DirectoryMarker;
1081
1082    fn from_channel(inner: fidl::Channel) -> Self {
1083        Self::new(inner)
1084    }
1085
1086    fn into_channel(self) -> fidl::Channel {
1087        self.client.into_channel()
1088    }
1089
1090    fn as_channel(&self) -> &fidl::Channel {
1091        self.client.as_channel()
1092    }
1093}
1094
1095#[cfg(target_os = "fuchsia")]
1096impl DirectorySynchronousProxy {
1097    pub fn new(channel: fidl::Channel) -> Self {
1098        Self { client: fidl::client::sync::Client::new(channel) }
1099    }
1100
1101    pub fn into_channel(self) -> fidl::Channel {
1102        self.client.into_channel()
1103    }
1104
1105    /// Waits until an event arrives and returns it. It is safe for other
1106    /// threads to make concurrent requests while waiting for an event.
1107    pub fn wait_for_event(
1108        &self,
1109        deadline: zx::MonotonicInstant,
1110    ) -> Result<DirectoryEvent, fidl::Error> {
1111        DirectoryEvent::decode(self.client.wait_for_event::<DirectoryMarker>(deadline)?)
1112    }
1113
1114    /// Acquires an advisory lock on the underlying file.
1115    ///
1116    /// The lock lasts until either this connection is closed or
1117    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1118    /// explicitly.
1119    ///
1120    /// Advisory locks are purely advisory. They do not prevent actual read or
1121    /// write operations from occurring on the file, either through this
1122    /// connection or through other connections.
1123    ///
1124    /// This method requires the following rights:
1125    ///
1126    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1127    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1128    ///   [`AdvisoryLockType.WRITE`].
1129    ///
1130    /// # Errors
1131    ///
1132    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1133    ///   example, another connection might hold a conflicting lock type.
1134    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1135    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1136    ///   to acquire the given type of lock.
1137    pub fn r#advisory_lock(
1138        &self,
1139        mut request: &AdvisoryLockRequest,
1140        ___deadline: zx::MonotonicInstant,
1141    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1142        let _response = self.client.send_query::<
1143            AdvisoryLockingAdvisoryLockRequest,
1144            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1145            DirectoryMarker,
1146        >(
1147            (request,),
1148            0x6ee9c0ad53ec87aa,
1149            fidl::encoding::DynamicFlags::empty(),
1150            ___deadline,
1151        )?;
1152        Ok(_response.map(|x| x))
1153    }
1154
1155    pub fn r#clone(
1156        &self,
1157        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1158    ) -> Result<(), fidl::Error> {
1159        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1160            (request,),
1161            0x20d8a7aba2168a79,
1162            fidl::encoding::DynamicFlags::empty(),
1163        )
1164    }
1165
1166    /// Terminates the connection.
1167    ///
1168    /// After calling `Close`, the client must not send any other requests.
1169    ///
1170    /// Servers, after sending the status response, should close the connection
1171    /// regardless of status and without sending an epitaph.
1172    ///
1173    /// Closing the client end of the channel should be semantically equivalent
1174    /// to calling `Close` without knowing when the close has completed or its
1175    /// status.
1176    pub fn r#close(
1177        &self,
1178        ___deadline: zx::MonotonicInstant,
1179    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1180        let _response = self.client.send_query::<
1181            fidl::encoding::EmptyPayload,
1182            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1183            DirectoryMarker,
1184        >(
1185            (),
1186            0x5ac5d459ad7f657e,
1187            fidl::encoding::DynamicFlags::empty(),
1188            ___deadline,
1189        )?;
1190        Ok(_response.map(|x| x))
1191    }
1192
1193    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1194        let _response = self.client.send_query::<
1195            fidl::encoding::EmptyPayload,
1196            fidl_fuchsia_unknown::QueryableQueryResponse,
1197            DirectoryMarker,
1198        >(
1199            (),
1200            0x2658edee9decfc06,
1201            fidl::encoding::DynamicFlags::empty(),
1202            ___deadline,
1203        )?;
1204        Ok(_response.protocol)
1205    }
1206
1207    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1208    pub fn r#deprecated_clone(
1209        &self,
1210        mut flags: OpenFlags,
1211        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1212    ) -> Result<(), fidl::Error> {
1213        self.client.send::<NodeDeprecatedCloneRequest>(
1214            (flags, object),
1215            0x5a61678f293ce16f,
1216            fidl::encoding::DynamicFlags::FLEXIBLE,
1217        )
1218    }
1219
1220    /// DEPRECATED - Use `Node.GetAttributes` instead.
1221    ///
1222    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1223    pub fn r#deprecated_get_attr(
1224        &self,
1225        ___deadline: zx::MonotonicInstant,
1226    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1227        let _response = self.client.send_query::<
1228            fidl::encoding::EmptyPayload,
1229            NodeDeprecatedGetAttrResponse,
1230            DirectoryMarker,
1231        >(
1232            (),
1233            0x78985e216314dafd,
1234            fidl::encoding::DynamicFlags::empty(),
1235            ___deadline,
1236        )?;
1237        Ok((_response.s, _response.attributes))
1238    }
1239
1240    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1241    pub fn r#deprecated_set_attr(
1242        &self,
1243        mut flags: NodeAttributeFlags,
1244        mut attributes: &NodeAttributes,
1245        ___deadline: zx::MonotonicInstant,
1246    ) -> Result<i32, fidl::Error> {
1247        let _response = self.client.send_query::<
1248            NodeDeprecatedSetAttrRequest,
1249            NodeDeprecatedSetAttrResponse,
1250            DirectoryMarker,
1251        >(
1252            (flags, attributes,),
1253            0x4186c0f40d938f46,
1254            fidl::encoding::DynamicFlags::empty(),
1255            ___deadline,
1256        )?;
1257        Ok(_response.s)
1258    }
1259
1260    /// [DEPRECATED - Use new GetFlags method instead.]
1261    pub fn r#deprecated_get_flags(
1262        &self,
1263        ___deadline: zx::MonotonicInstant,
1264    ) -> Result<(i32, OpenFlags), fidl::Error> {
1265        let _response = self.client.send_query::<
1266            fidl::encoding::EmptyPayload,
1267            NodeDeprecatedGetFlagsResponse,
1268            DirectoryMarker,
1269        >(
1270            (),
1271            0x5b88fffb8eda3aa1,
1272            fidl::encoding::DynamicFlags::empty(),
1273            ___deadline,
1274        )?;
1275        Ok((_response.s, _response.flags))
1276    }
1277
1278    /// [DEPRECATED - Use new SetFlags method instead.]
1279    pub fn r#deprecated_set_flags(
1280        &self,
1281        mut flags: OpenFlags,
1282        ___deadline: zx::MonotonicInstant,
1283    ) -> Result<i32, fidl::Error> {
1284        let _response = self.client.send_query::<
1285            NodeDeprecatedSetFlagsRequest,
1286            NodeDeprecatedSetFlagsResponse,
1287            DirectoryMarker,
1288        >(
1289            (flags,),
1290            0x5295b76c71fde733,
1291            fidl::encoding::DynamicFlags::empty(),
1292            ___deadline,
1293        )?;
1294        Ok(_response.s)
1295    }
1296
1297    /// Queries the flags that apply to this node after it has been opened/created. This method does
1298    /// not require any rights.
1299    ///
1300    /// Note that the final set of flags that apply to the connection may differ from those
1301    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1302    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1303    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1304    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1305    pub fn r#get_flags(
1306        &self,
1307        ___deadline: zx::MonotonicInstant,
1308    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1309        let _response = self.client.send_query::<
1310            fidl::encoding::EmptyPayload,
1311            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1312            DirectoryMarker,
1313        >(
1314            (),
1315            0x176eb318f64ec23,
1316            fidl::encoding::DynamicFlags::FLEXIBLE,
1317            ___deadline,
1318        )?
1319        .into_result::<DirectoryMarker>("get_flags")?;
1320        Ok(_response.map(|x| x.flags))
1321    }
1322
1323    /// Sets the flags that apply to this node after it has been opened. This method does not
1324    /// require any rights.
1325    ///
1326    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1327    /// clear append mode.
1328    ///
1329    /// Errors:
1330    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1331    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1332    pub fn r#set_flags(
1333        &self,
1334        mut flags: Flags,
1335        ___deadline: zx::MonotonicInstant,
1336    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1337        let _response = self.client.send_query::<
1338            NodeSetFlagsRequest,
1339            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1340            DirectoryMarker,
1341        >(
1342            (flags,),
1343            0x55a8028685791ea8,
1344            fidl::encoding::DynamicFlags::FLEXIBLE,
1345            ___deadline,
1346        )?
1347        .into_result::<DirectoryMarker>("set_flags")?;
1348        Ok(_response.map(|x| x))
1349    }
1350
1351    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1352    /// volume has different settings or the storage is accounted seperately from the rest of the
1353    /// filesystem that may be reported instead of filesystem-wide details.
1354    pub fn r#query_filesystem(
1355        &self,
1356        ___deadline: zx::MonotonicInstant,
1357    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1358        let _response = self.client.send_query::<
1359            fidl::encoding::EmptyPayload,
1360            NodeQueryFilesystemResponse,
1361            DirectoryMarker,
1362        >(
1363            (),
1364            0x6f344a1c6b0a0610,
1365            fidl::encoding::DynamicFlags::empty(),
1366            ___deadline,
1367        )?;
1368        Ok((_response.s, _response.info))
1369    }
1370
1371    /// Acquires information about the node.
1372    ///
1373    /// The attributes of a node should be stable, independent of the
1374    /// specific protocol used to access it.
1375    ///
1376    /// If a particular attribute is not applicable or not supported,
1377    /// filesystems should leave the corresponding field absent.
1378    ///
1379    /// + `query` a bit-mask specifying which attributes to fetch. The server
1380    ///   should not return more than necessary.
1381    /// - `attributes` the returned attributes.
1382    ///
1383    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1384    pub fn r#get_attributes(
1385        &self,
1386        mut query: NodeAttributesQuery,
1387        ___deadline: zx::MonotonicInstant,
1388    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1389        let _response = self.client.send_query::<
1390            NodeGetAttributesRequest,
1391            fidl::encoding::ResultType<NodeAttributes2, i32>,
1392            DirectoryMarker,
1393        >(
1394            (query,),
1395            0x3d4396a638ea053b,
1396            fidl::encoding::DynamicFlags::empty(),
1397            ___deadline,
1398        )?;
1399        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1400    }
1401
1402    /// Updates information about the node.
1403    ///
1404    /// + `attributes` the presence of a table field in `attributes` indicates
1405    /// the intent to update the corresponding attribute.
1406    ///
1407    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1408    ///
1409    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1410    pub fn r#update_attributes(
1411        &self,
1412        mut payload: &MutableNodeAttributes,
1413        ___deadline: zx::MonotonicInstant,
1414    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1415        let _response = self.client.send_query::<
1416            MutableNodeAttributes,
1417            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1418            DirectoryMarker,
1419        >(
1420            payload,
1421            0x3308c1da5a89bf08,
1422            fidl::encoding::DynamicFlags::empty(),
1423            ___deadline,
1424        )?;
1425        Ok(_response.map(|x| x))
1426    }
1427
1428    /// Synchronizes updates to the node to the underlying media, if it exists.
1429    ///
1430    /// This method will return when the filesystem server has flushed the
1431    /// relevant updates to the underlying media, but does not guarantee the
1432    /// underlying media has persisted the information, nor that any information
1433    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1434    /// between operations.
1435    ///
1436    /// This method does not require any rights.
1437    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1438        let _response = self.client.send_query::<
1439            fidl::encoding::EmptyPayload,
1440            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1441            DirectoryMarker,
1442        >(
1443            (),
1444            0x2c5c27ca0ab5dc49,
1445            fidl::encoding::DynamicFlags::empty(),
1446            ___deadline,
1447        )?;
1448        Ok(_response.map(|x| x))
1449    }
1450
1451    /// Creates an iterator over all the extended attribute names associated
1452    /// with this node. If an error occurs it is returned as an epitaph on the
1453    /// iterator request channel, and then the channel is closed.
1454    ///
1455    /// GetExtendedAttributes can be used with any of these names to retrieve
1456    /// the associated value.
1457    ///
1458    /// This method requires the [`Rights.READ_BYTES`] right.
1459    pub fn r#list_extended_attributes(
1460        &self,
1461        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1462    ) -> Result<(), fidl::Error> {
1463        self.client.send::<NodeListExtendedAttributesRequest>(
1464            (iterator,),
1465            0x4b61033de007fcd0,
1466            fidl::encoding::DynamicFlags::empty(),
1467        )
1468    }
1469
1470    /// Get the value associated with the given attribute `name` for this node.
1471    ///
1472    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1473    /// particular structure is imposed on them.
1474    ///
1475    /// This method requires the [`Rights.READ_BYTES`] right.
1476    pub fn r#get_extended_attribute(
1477        &self,
1478        mut name: &[u8],
1479        ___deadline: zx::MonotonicInstant,
1480    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1481        let _response = self.client.send_query::<
1482            NodeGetExtendedAttributeRequest,
1483            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1484            DirectoryMarker,
1485        >(
1486            (name,),
1487            0x45ffa3ccfdeb76db,
1488            fidl::encoding::DynamicFlags::empty(),
1489            ___deadline,
1490        )?;
1491        Ok(_response.map(|x| x))
1492    }
1493
1494    /// Set the value for the given attribute `name` to `value` for this node.
1495    ///
1496    /// The attribute name may exist, in which case the attribute is updated.
1497    /// If the attribute doesn't exist, it is created. The name should have no
1498    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1499    ///
1500    /// This method requires the [`Rights.WRITE_BYTES`] right.
1501    pub fn r#set_extended_attribute(
1502        &self,
1503        mut name: &[u8],
1504        mut value: ExtendedAttributeValue,
1505        mut mode: SetExtendedAttributeMode,
1506        ___deadline: zx::MonotonicInstant,
1507    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1508        let _response = self.client.send_query::<
1509            NodeSetExtendedAttributeRequest,
1510            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1511            DirectoryMarker,
1512        >(
1513            (name, &mut value, mode,),
1514            0x4a951362f681f23c,
1515            fidl::encoding::DynamicFlags::empty(),
1516            ___deadline,
1517        )?;
1518        Ok(_response.map(|x| x))
1519    }
1520
1521    /// Remove the specified extended attribute.
1522    ///
1523    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1524    ///
1525    /// This method requires the [`Rights.WRITE_BYTES`] right.
1526    pub fn r#remove_extended_attribute(
1527        &self,
1528        mut name: &[u8],
1529        ___deadline: zx::MonotonicInstant,
1530    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1531        let _response = self.client.send_query::<
1532            NodeRemoveExtendedAttributeRequest,
1533            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1534            DirectoryMarker,
1535        >(
1536            (name,),
1537            0x7a0b9f3a9bf9032d,
1538            fidl::encoding::DynamicFlags::empty(),
1539            ___deadline,
1540        )?;
1541        Ok(_response.map(|x| x))
1542    }
1543
1544    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1545    /// epitaph sent on the `object` channel.
1546    ///
1547    /// Errors:
1548    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1549    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1550    pub fn r#open(
1551        &self,
1552        mut path: &str,
1553        mut flags: Flags,
1554        mut options: &Options,
1555        mut object: fidl::Channel,
1556    ) -> Result<(), fidl::Error> {
1557        self.client.send::<OpenableOpenRequest>(
1558            (path, flags, options, object),
1559            0x568ddcb9a9cbb6d9,
1560            fidl::encoding::DynamicFlags::FLEXIBLE,
1561        )
1562    }
1563
1564    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1565    pub fn r#deprecated_open(
1566        &self,
1567        mut flags: OpenFlags,
1568        mut mode: ModeType,
1569        mut path: &str,
1570        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1571    ) -> Result<(), fidl::Error> {
1572        self.client.send::<DirectoryDeprecatedOpenRequest>(
1573            (flags, mode, path, object),
1574            0x2c5044561d685ec0,
1575            fidl::encoding::DynamicFlags::FLEXIBLE,
1576        )
1577    }
1578
1579    /// Reads a collection of variably sized dirents into a buffer.
1580    /// The number of dirents in a directory may be very large: akin to
1581    /// calling read multiple times on a file, directories have a seek
1582    /// offset which is updated on subsequent calls to ReadDirents.
1583    /// Each call to ReadDirents will only return whole dirent structures,
1584    /// they will not get split across ReadDirent calls. When the seek
1585    /// offset reaches the end, `dirents` will be empty.
1586    ///
1587    /// These dirents are of the form:
1588    /// ```
1589    /// struct dirent {
1590    ///   // Describes the inode of the entry.
1591    ///   uint64 ino;
1592    ///   // Describes the length of the dirent name in bytes.
1593    ///   uint8 size;
1594    ///   // Describes the type of the entry. Aligned with the
1595    ///   // POSIX d_type values. Use `DirentType` constants.
1596    ///   uint8 type;
1597    ///   // Unterminated name of entry.
1598    ///   char name[0];
1599    /// }
1600    /// ```
1601    ///
1602    /// This method does not require any rights, since one could always probe for
1603    /// directory contents by triggering name conflicts during file creation.
1604    pub fn r#read_dirents(
1605        &self,
1606        mut max_bytes: u64,
1607        ___deadline: zx::MonotonicInstant,
1608    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1609        let _response = self.client.send_query::<
1610            DirectoryReadDirentsRequest,
1611            DirectoryReadDirentsResponse,
1612            DirectoryMarker,
1613        >(
1614            (max_bytes,),
1615            0x3582806bf27faa0a,
1616            fidl::encoding::DynamicFlags::empty(),
1617            ___deadline,
1618        )?;
1619        Ok((_response.s, _response.dirents))
1620    }
1621
1622    /// Resets the directory seek offset.
1623    ///
1624    /// This method does not require any rights, similar to ReadDirents.
1625    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1626        let _response = self
1627            .client
1628            .send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse, DirectoryMarker>(
1629                (),
1630                0x16b1202af0f34c71,
1631                fidl::encoding::DynamicFlags::empty(),
1632                ___deadline,
1633            )?;
1634        Ok(_response.s)
1635    }
1636
1637    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1638    /// in time. The token will remain valid for as long as the connection requesting the token
1639    /// remains open.
1640    ///
1641    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1642    /// `ZX_ERR_BAD_HANDLE`.
1643    pub fn r#get_token(
1644        &self,
1645        ___deadline: zx::MonotonicInstant,
1646    ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
1647        let _response = self
1648            .client
1649            .send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse, DirectoryMarker>(
1650                (),
1651                0x26ae9d18763c8655,
1652                fidl::encoding::DynamicFlags::empty(),
1653                ___deadline,
1654            )?;
1655        Ok((_response.s, _response.token))
1656    }
1657
1658    /// Creates a link to an object named src by the name dst, within a directory represented by
1659    /// token.
1660    ///
1661    /// `src` must be a resolved object name. Including "/" in the string will
1662    /// return `ZX_ERR_INVALID_ARGS`.
1663    ///
1664    /// `dst` must be a resolved object name. Including "/" in the string will
1665    /// return `ZX_ERR_INVALID_ARGS`.
1666    ///
1667    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1668    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1669    ///
1670    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1671    /// there are two actors operating concurrently, and one actor performs a rename that affects
1672    /// the source within this directory, and the other does a link, each will appear to occur
1673    /// atomically in an unspecified order.
1674    pub fn r#link(
1675        &self,
1676        mut src: &str,
1677        mut dst_parent_token: fidl::NullableHandle,
1678        mut dst: &str,
1679        ___deadline: zx::MonotonicInstant,
1680    ) -> Result<i32, fidl::Error> {
1681        let _response = self
1682            .client
1683            .send_query::<DirectoryLinkRequest, DirectoryLinkResponse, DirectoryMarker>(
1684                (src, dst_parent_token, dst),
1685                0x740604c0c7c930e7,
1686                fidl::encoding::DynamicFlags::empty(),
1687                ___deadline,
1688            )?;
1689        Ok(_response.s)
1690    }
1691
1692    /// Removes a child node from the this directory's list of entries.
1693    ///
1694    /// Note: this does not guarantee that the underlying object is destroyed.
1695    /// Although the link will be removed from the containing directory,
1696    /// objects with multiple references (such as files which are still open)
1697    /// will not actually be destroyed until all references are closed.
1698    ///
1699    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1700    ///   [`Rights.WRITE_BYTES`].
1701    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1702    ///   support writing.
1703    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1704    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1705    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1706    ///   containing a remote channel.
1707    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1708    ///     something other than a directory was found.
1709    ///
1710    /// Other errors may be returned for filesystem-specific reasons.
1711    ///
1712    /// This method requires the following rights:
1713    ///
1714    /// * [`Rights.ENUMERATE`]
1715    /// * [`Rights.MODIFY_DIRECTORY`]
1716    pub fn r#unlink(
1717        &self,
1718        mut name: &str,
1719        mut options: &UnlinkOptions,
1720        ___deadline: zx::MonotonicInstant,
1721    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1722        let _response = self.client.send_query::<
1723            DirectoryUnlinkRequest,
1724            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1725            DirectoryMarker,
1726        >(
1727            (name, options,),
1728            0x750a0326a78d7bed,
1729            fidl::encoding::DynamicFlags::empty(),
1730            ___deadline,
1731        )?;
1732        Ok(_response.map(|x| x))
1733    }
1734
1735    /// Renames a node named `src` to the name `dst`, in a directory represented
1736    /// by `dst_parent_token`.
1737    ///
1738    /// `src` and `dst` must be valid node names.
1739    /// See [`Name`] for what constitutes a valid name.
1740    ///
1741    /// This method requires the following rights on both the current connection, and the connection
1742    /// identified by `dst_parent_token`:
1743    ///
1744    /// * [`Rights.ENUMERATE`]
1745    /// * [`Rights.MODIFY_DIRECTORY`]
1746    ///
1747    /// The following requirements are necessary to avoid rights escalations.
1748    ///
1749    /// If the source and destination directory differ, the source directory must also have the
1750    /// maximal set of abilities supported for files, which would typically be
1751    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1752    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1753    /// right.
1754    ///
1755    /// If `src` refers to a directory, and differs from the destination directory, then the source
1756    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1757    ///
1758    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1759    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1760    pub fn r#rename(
1761        &self,
1762        mut src: &str,
1763        mut dst_parent_token: fidl::Event,
1764        mut dst: &str,
1765        ___deadline: zx::MonotonicInstant,
1766    ) -> Result<DirectoryRenameResult, fidl::Error> {
1767        let _response = self.client.send_query::<
1768            DirectoryRenameRequest,
1769            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1770            DirectoryMarker,
1771        >(
1772            (src, dst_parent_token, dst,),
1773            0x7060e7723b9928de,
1774            fidl::encoding::DynamicFlags::empty(),
1775            ___deadline,
1776        )?;
1777        Ok(_response.map(|x| x))
1778    }
1779
1780    /// Creates a symbolic link.
1781    ///
1782    /// `name` is the name to be given to the created symbolic link.
1783    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1784    /// will perform no validation of `target` except for a server chosen maximum length.
1785    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1786    /// on the successfully created node.
1787    ///
1788    /// * [`Rights.MODIFY_DIRECTORY`]
1789    ///
1790    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1791    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1792    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1793    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1794    pub fn r#create_symlink(
1795        &self,
1796        mut name: &str,
1797        mut target: &[u8],
1798        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1799        ___deadline: zx::MonotonicInstant,
1800    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1801        let _response = self.client.send_query::<
1802            DirectoryCreateSymlinkRequest,
1803            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1804            DirectoryMarker,
1805        >(
1806            (name, target, connection,),
1807            0x21ce0f19ec043889,
1808            fidl::encoding::DynamicFlags::empty(),
1809            ___deadline,
1810        )?;
1811        Ok(_response.map(|x| x))
1812    }
1813
1814    /// Watches a directory, receiving events of added messages on the
1815    /// watcher request channel.
1816    ///
1817    /// Options must be zero; it is reserved.
1818    ///
1819    /// This method does not require any rights, similar to ReadDirents.
1820    pub fn r#watch(
1821        &self,
1822        mut mask: WatchMask,
1823        mut options: u32,
1824        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1825        ___deadline: zx::MonotonicInstant,
1826    ) -> Result<i32, fidl::Error> {
1827        let _response = self
1828            .client
1829            .send_query::<DirectoryWatchRequest, DirectoryWatchResponse, DirectoryMarker>(
1830                (mask, options, watcher),
1831                0x5717193a59d66d91,
1832                fidl::encoding::DynamicFlags::empty(),
1833                ___deadline,
1834            )?;
1835        Ok(_response.s)
1836    }
1837}
1838
1839#[cfg(target_os = "fuchsia")]
1840impl From<DirectorySynchronousProxy> for zx::NullableHandle {
1841    fn from(value: DirectorySynchronousProxy) -> Self {
1842        value.into_channel().into()
1843    }
1844}
1845
1846#[cfg(target_os = "fuchsia")]
1847impl From<fidl::Channel> for DirectorySynchronousProxy {
1848    fn from(value: fidl::Channel) -> Self {
1849        Self::new(value)
1850    }
1851}
1852
1853#[cfg(target_os = "fuchsia")]
1854impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1855    type Protocol = DirectoryMarker;
1856
1857    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1858        Self::new(value.into_channel())
1859    }
1860}
1861
1862#[derive(Debug, Clone)]
1863pub struct DirectoryProxy {
1864    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1865}
1866
1867impl fidl::endpoints::Proxy for DirectoryProxy {
1868    type Protocol = DirectoryMarker;
1869
1870    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1871        Self::new(inner)
1872    }
1873
1874    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1875        self.client.into_channel().map_err(|client| Self { client })
1876    }
1877
1878    fn as_channel(&self) -> &::fidl::AsyncChannel {
1879        self.client.as_channel()
1880    }
1881}
1882
1883impl DirectoryProxy {
1884    /// Create a new Proxy for fuchsia.io/Directory.
1885    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1886        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1887        Self { client: fidl::client::Client::new(channel, protocol_name) }
1888    }
1889
1890    /// Get a Stream of events from the remote end of the protocol.
1891    ///
1892    /// # Panics
1893    ///
1894    /// Panics if the event stream was already taken.
1895    pub fn take_event_stream(&self) -> DirectoryEventStream {
1896        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1897    }
1898
1899    /// Acquires an advisory lock on the underlying file.
1900    ///
1901    /// The lock lasts until either this connection is closed or
1902    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1903    /// explicitly.
1904    ///
1905    /// Advisory locks are purely advisory. They do not prevent actual read or
1906    /// write operations from occurring on the file, either through this
1907    /// connection or through other connections.
1908    ///
1909    /// This method requires the following rights:
1910    ///
1911    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1912    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1913    ///   [`AdvisoryLockType.WRITE`].
1914    ///
1915    /// # Errors
1916    ///
1917    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1918    ///   example, another connection might hold a conflicting lock type.
1919    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1920    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1921    ///   to acquire the given type of lock.
1922    pub fn r#advisory_lock(
1923        &self,
1924        mut request: &AdvisoryLockRequest,
1925    ) -> fidl::client::QueryResponseFut<
1926        AdvisoryLockingAdvisoryLockResult,
1927        fidl::encoding::DefaultFuchsiaResourceDialect,
1928    > {
1929        DirectoryProxyInterface::r#advisory_lock(self, request)
1930    }
1931
1932    pub fn r#clone(
1933        &self,
1934        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1935    ) -> Result<(), fidl::Error> {
1936        DirectoryProxyInterface::r#clone(self, request)
1937    }
1938
1939    /// Terminates the connection.
1940    ///
1941    /// After calling `Close`, the client must not send any other requests.
1942    ///
1943    /// Servers, after sending the status response, should close the connection
1944    /// regardless of status and without sending an epitaph.
1945    ///
1946    /// Closing the client end of the channel should be semantically equivalent
1947    /// to calling `Close` without knowing when the close has completed or its
1948    /// status.
1949    pub fn r#close(
1950        &self,
1951    ) -> fidl::client::QueryResponseFut<
1952        fidl_fuchsia_unknown::CloseableCloseResult,
1953        fidl::encoding::DefaultFuchsiaResourceDialect,
1954    > {
1955        DirectoryProxyInterface::r#close(self)
1956    }
1957
1958    pub fn r#query(
1959        &self,
1960    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1961    {
1962        DirectoryProxyInterface::r#query(self)
1963    }
1964
1965    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1966    pub fn r#deprecated_clone(
1967        &self,
1968        mut flags: OpenFlags,
1969        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1970    ) -> Result<(), fidl::Error> {
1971        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1972    }
1973
1974    /// DEPRECATED - Use `Node.GetAttributes` instead.
1975    ///
1976    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1977    pub fn r#deprecated_get_attr(
1978        &self,
1979    ) -> fidl::client::QueryResponseFut<
1980        (i32, NodeAttributes),
1981        fidl::encoding::DefaultFuchsiaResourceDialect,
1982    > {
1983        DirectoryProxyInterface::r#deprecated_get_attr(self)
1984    }
1985
1986    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1987    pub fn r#deprecated_set_attr(
1988        &self,
1989        mut flags: NodeAttributeFlags,
1990        mut attributes: &NodeAttributes,
1991    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1992        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1993    }
1994
1995    /// [DEPRECATED - Use new GetFlags method instead.]
1996    pub fn r#deprecated_get_flags(
1997        &self,
1998    ) -> fidl::client::QueryResponseFut<
1999        (i32, OpenFlags),
2000        fidl::encoding::DefaultFuchsiaResourceDialect,
2001    > {
2002        DirectoryProxyInterface::r#deprecated_get_flags(self)
2003    }
2004
2005    /// [DEPRECATED - Use new SetFlags method instead.]
2006    pub fn r#deprecated_set_flags(
2007        &self,
2008        mut flags: OpenFlags,
2009    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2010        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
2011    }
2012
2013    /// Queries the flags that apply to this node after it has been opened/created. This method does
2014    /// not require any rights.
2015    ///
2016    /// Note that the final set of flags that apply to the connection may differ from those
2017    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2018    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2019    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2020    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2021    pub fn r#get_flags(
2022        &self,
2023    ) -> fidl::client::QueryResponseFut<
2024        NodeGetFlagsResult,
2025        fidl::encoding::DefaultFuchsiaResourceDialect,
2026    > {
2027        DirectoryProxyInterface::r#get_flags(self)
2028    }
2029
2030    /// Sets the flags that apply to this node after it has been opened. This method does not
2031    /// require any rights.
2032    ///
2033    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2034    /// clear append mode.
2035    ///
2036    /// Errors:
2037    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2038    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2039    pub fn r#set_flags(
2040        &self,
2041        mut flags: Flags,
2042    ) -> fidl::client::QueryResponseFut<
2043        NodeSetFlagsResult,
2044        fidl::encoding::DefaultFuchsiaResourceDialect,
2045    > {
2046        DirectoryProxyInterface::r#set_flags(self, flags)
2047    }
2048
2049    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2050    /// volume has different settings or the storage is accounted seperately from the rest of the
2051    /// filesystem that may be reported instead of filesystem-wide details.
2052    pub fn r#query_filesystem(
2053        &self,
2054    ) -> fidl::client::QueryResponseFut<
2055        (i32, Option<Box<FilesystemInfo>>),
2056        fidl::encoding::DefaultFuchsiaResourceDialect,
2057    > {
2058        DirectoryProxyInterface::r#query_filesystem(self)
2059    }
2060
2061    /// Acquires information about the node.
2062    ///
2063    /// The attributes of a node should be stable, independent of the
2064    /// specific protocol used to access it.
2065    ///
2066    /// If a particular attribute is not applicable or not supported,
2067    /// filesystems should leave the corresponding field absent.
2068    ///
2069    /// + `query` a bit-mask specifying which attributes to fetch. The server
2070    ///   should not return more than necessary.
2071    /// - `attributes` the returned attributes.
2072    ///
2073    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2074    pub fn r#get_attributes(
2075        &self,
2076        mut query: NodeAttributesQuery,
2077    ) -> fidl::client::QueryResponseFut<
2078        NodeGetAttributesResult,
2079        fidl::encoding::DefaultFuchsiaResourceDialect,
2080    > {
2081        DirectoryProxyInterface::r#get_attributes(self, query)
2082    }
2083
2084    /// Updates information about the node.
2085    ///
2086    /// + `attributes` the presence of a table field in `attributes` indicates
2087    /// the intent to update the corresponding attribute.
2088    ///
2089    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2090    ///
2091    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2092    pub fn r#update_attributes(
2093        &self,
2094        mut payload: &MutableNodeAttributes,
2095    ) -> fidl::client::QueryResponseFut<
2096        NodeUpdateAttributesResult,
2097        fidl::encoding::DefaultFuchsiaResourceDialect,
2098    > {
2099        DirectoryProxyInterface::r#update_attributes(self, payload)
2100    }
2101
2102    /// Synchronizes updates to the node to the underlying media, if it exists.
2103    ///
2104    /// This method will return when the filesystem server has flushed the
2105    /// relevant updates to the underlying media, but does not guarantee the
2106    /// underlying media has persisted the information, nor that any information
2107    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2108    /// between operations.
2109    ///
2110    /// This method does not require any rights.
2111    pub fn r#sync(
2112        &self,
2113    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2114    {
2115        DirectoryProxyInterface::r#sync(self)
2116    }
2117
2118    /// Creates an iterator over all the extended attribute names associated
2119    /// with this node. If an error occurs it is returned as an epitaph on the
2120    /// iterator request channel, and then the channel is closed.
2121    ///
2122    /// GetExtendedAttributes can be used with any of these names to retrieve
2123    /// the associated value.
2124    ///
2125    /// This method requires the [`Rights.READ_BYTES`] right.
2126    pub fn r#list_extended_attributes(
2127        &self,
2128        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2129    ) -> Result<(), fidl::Error> {
2130        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2131    }
2132
2133    /// Get the value associated with the given attribute `name` for this node.
2134    ///
2135    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2136    /// particular structure is imposed on them.
2137    ///
2138    /// This method requires the [`Rights.READ_BYTES`] right.
2139    pub fn r#get_extended_attribute(
2140        &self,
2141        mut name: &[u8],
2142    ) -> fidl::client::QueryResponseFut<
2143        NodeGetExtendedAttributeResult,
2144        fidl::encoding::DefaultFuchsiaResourceDialect,
2145    > {
2146        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2147    }
2148
2149    /// Set the value for the given attribute `name` to `value` for this node.
2150    ///
2151    /// The attribute name may exist, in which case the attribute is updated.
2152    /// If the attribute doesn't exist, it is created. The name should have no
2153    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2154    ///
2155    /// This method requires the [`Rights.WRITE_BYTES`] right.
2156    pub fn r#set_extended_attribute(
2157        &self,
2158        mut name: &[u8],
2159        mut value: ExtendedAttributeValue,
2160        mut mode: SetExtendedAttributeMode,
2161    ) -> fidl::client::QueryResponseFut<
2162        NodeSetExtendedAttributeResult,
2163        fidl::encoding::DefaultFuchsiaResourceDialect,
2164    > {
2165        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2166    }
2167
2168    /// Remove the specified extended attribute.
2169    ///
2170    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2171    ///
2172    /// This method requires the [`Rights.WRITE_BYTES`] right.
2173    pub fn r#remove_extended_attribute(
2174        &self,
2175        mut name: &[u8],
2176    ) -> fidl::client::QueryResponseFut<
2177        NodeRemoveExtendedAttributeResult,
2178        fidl::encoding::DefaultFuchsiaResourceDialect,
2179    > {
2180        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2181    }
2182
2183    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2184    /// epitaph sent on the `object` channel.
2185    ///
2186    /// Errors:
2187    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2188    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2189    pub fn r#open(
2190        &self,
2191        mut path: &str,
2192        mut flags: Flags,
2193        mut options: &Options,
2194        mut object: fidl::Channel,
2195    ) -> Result<(), fidl::Error> {
2196        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2197    }
2198
2199    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2200    pub fn r#deprecated_open(
2201        &self,
2202        mut flags: OpenFlags,
2203        mut mode: ModeType,
2204        mut path: &str,
2205        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2206    ) -> Result<(), fidl::Error> {
2207        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2208    }
2209
2210    /// Reads a collection of variably sized dirents into a buffer.
2211    /// The number of dirents in a directory may be very large: akin to
2212    /// calling read multiple times on a file, directories have a seek
2213    /// offset which is updated on subsequent calls to ReadDirents.
2214    /// Each call to ReadDirents will only return whole dirent structures,
2215    /// they will not get split across ReadDirent calls. When the seek
2216    /// offset reaches the end, `dirents` will be empty.
2217    ///
2218    /// These dirents are of the form:
2219    /// ```
2220    /// struct dirent {
2221    ///   // Describes the inode of the entry.
2222    ///   uint64 ino;
2223    ///   // Describes the length of the dirent name in bytes.
2224    ///   uint8 size;
2225    ///   // Describes the type of the entry. Aligned with the
2226    ///   // POSIX d_type values. Use `DirentType` constants.
2227    ///   uint8 type;
2228    ///   // Unterminated name of entry.
2229    ///   char name[0];
2230    /// }
2231    /// ```
2232    ///
2233    /// This method does not require any rights, since one could always probe for
2234    /// directory contents by triggering name conflicts during file creation.
2235    pub fn r#read_dirents(
2236        &self,
2237        mut max_bytes: u64,
2238    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2239    {
2240        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2241    }
2242
2243    /// Resets the directory seek offset.
2244    ///
2245    /// This method does not require any rights, similar to ReadDirents.
2246    pub fn r#rewind(
2247        &self,
2248    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2249        DirectoryProxyInterface::r#rewind(self)
2250    }
2251
2252    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2253    /// in time. The token will remain valid for as long as the connection requesting the token
2254    /// remains open.
2255    ///
2256    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2257    /// `ZX_ERR_BAD_HANDLE`.
2258    pub fn r#get_token(
2259        &self,
2260    ) -> fidl::client::QueryResponseFut<
2261        (i32, Option<fidl::NullableHandle>),
2262        fidl::encoding::DefaultFuchsiaResourceDialect,
2263    > {
2264        DirectoryProxyInterface::r#get_token(self)
2265    }
2266
2267    /// Creates a link to an object named src by the name dst, within a directory represented by
2268    /// token.
2269    ///
2270    /// `src` must be a resolved object name. Including "/" in the string will
2271    /// return `ZX_ERR_INVALID_ARGS`.
2272    ///
2273    /// `dst` must be a resolved object name. Including "/" in the string will
2274    /// return `ZX_ERR_INVALID_ARGS`.
2275    ///
2276    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2277    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2278    ///
2279    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2280    /// there are two actors operating concurrently, and one actor performs a rename that affects
2281    /// the source within this directory, and the other does a link, each will appear to occur
2282    /// atomically in an unspecified order.
2283    pub fn r#link(
2284        &self,
2285        mut src: &str,
2286        mut dst_parent_token: fidl::NullableHandle,
2287        mut dst: &str,
2288    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2289        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2290    }
2291
2292    /// Removes a child node from the this directory's list of entries.
2293    ///
2294    /// Note: this does not guarantee that the underlying object is destroyed.
2295    /// Although the link will be removed from the containing directory,
2296    /// objects with multiple references (such as files which are still open)
2297    /// will not actually be destroyed until all references are closed.
2298    ///
2299    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2300    ///   [`Rights.WRITE_BYTES`].
2301    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2302    ///   support writing.
2303    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2304    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2305    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2306    ///   containing a remote channel.
2307    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2308    ///     something other than a directory was found.
2309    ///
2310    /// Other errors may be returned for filesystem-specific reasons.
2311    ///
2312    /// This method requires the following rights:
2313    ///
2314    /// * [`Rights.ENUMERATE`]
2315    /// * [`Rights.MODIFY_DIRECTORY`]
2316    pub fn r#unlink(
2317        &self,
2318        mut name: &str,
2319        mut options: &UnlinkOptions,
2320    ) -> fidl::client::QueryResponseFut<
2321        DirectoryUnlinkResult,
2322        fidl::encoding::DefaultFuchsiaResourceDialect,
2323    > {
2324        DirectoryProxyInterface::r#unlink(self, name, options)
2325    }
2326
2327    /// Renames a node named `src` to the name `dst`, in a directory represented
2328    /// by `dst_parent_token`.
2329    ///
2330    /// `src` and `dst` must be valid node names.
2331    /// See [`Name`] for what constitutes a valid name.
2332    ///
2333    /// This method requires the following rights on both the current connection, and the connection
2334    /// identified by `dst_parent_token`:
2335    ///
2336    /// * [`Rights.ENUMERATE`]
2337    /// * [`Rights.MODIFY_DIRECTORY`]
2338    ///
2339    /// The following requirements are necessary to avoid rights escalations.
2340    ///
2341    /// If the source and destination directory differ, the source directory must also have the
2342    /// maximal set of abilities supported for files, which would typically be
2343    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2344    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2345    /// right.
2346    ///
2347    /// If `src` refers to a directory, and differs from the destination directory, then the source
2348    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2349    ///
2350    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2351    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2352    pub fn r#rename(
2353        &self,
2354        mut src: &str,
2355        mut dst_parent_token: fidl::Event,
2356        mut dst: &str,
2357    ) -> fidl::client::QueryResponseFut<
2358        DirectoryRenameResult,
2359        fidl::encoding::DefaultFuchsiaResourceDialect,
2360    > {
2361        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2362    }
2363
2364    /// Creates a symbolic link.
2365    ///
2366    /// `name` is the name to be given to the created symbolic link.
2367    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2368    /// will perform no validation of `target` except for a server chosen maximum length.
2369    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2370    /// on the successfully created node.
2371    ///
2372    /// * [`Rights.MODIFY_DIRECTORY`]
2373    ///
2374    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2375    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2376    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2377    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2378    pub fn r#create_symlink(
2379        &self,
2380        mut name: &str,
2381        mut target: &[u8],
2382        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2383    ) -> fidl::client::QueryResponseFut<
2384        DirectoryCreateSymlinkResult,
2385        fidl::encoding::DefaultFuchsiaResourceDialect,
2386    > {
2387        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2388    }
2389
2390    /// Watches a directory, receiving events of added messages on the
2391    /// watcher request channel.
2392    ///
2393    /// Options must be zero; it is reserved.
2394    ///
2395    /// This method does not require any rights, similar to ReadDirents.
2396    pub fn r#watch(
2397        &self,
2398        mut mask: WatchMask,
2399        mut options: u32,
2400        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2401    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2402        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2403    }
2404}
2405
2406impl DirectoryProxyInterface for DirectoryProxy {
2407    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2408        AdvisoryLockingAdvisoryLockResult,
2409        fidl::encoding::DefaultFuchsiaResourceDialect,
2410    >;
2411    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2412        fn _decode(
2413            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2414        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2415            let _response = fidl::client::decode_transaction_body::<
2416                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2417                fidl::encoding::DefaultFuchsiaResourceDialect,
2418                0x6ee9c0ad53ec87aa,
2419            >(_buf?)?;
2420            Ok(_response.map(|x| x))
2421        }
2422        self.client.send_query_and_decode::<
2423            AdvisoryLockingAdvisoryLockRequest,
2424            AdvisoryLockingAdvisoryLockResult,
2425        >(
2426            (request,),
2427            0x6ee9c0ad53ec87aa,
2428            fidl::encoding::DynamicFlags::empty(),
2429            _decode,
2430        )
2431    }
2432
2433    fn r#clone(
2434        &self,
2435        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2436    ) -> Result<(), fidl::Error> {
2437        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2438            (request,),
2439            0x20d8a7aba2168a79,
2440            fidl::encoding::DynamicFlags::empty(),
2441        )
2442    }
2443
2444    type CloseResponseFut = fidl::client::QueryResponseFut<
2445        fidl_fuchsia_unknown::CloseableCloseResult,
2446        fidl::encoding::DefaultFuchsiaResourceDialect,
2447    >;
2448    fn r#close(&self) -> Self::CloseResponseFut {
2449        fn _decode(
2450            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2451        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2452            let _response = fidl::client::decode_transaction_body::<
2453                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2454                fidl::encoding::DefaultFuchsiaResourceDialect,
2455                0x5ac5d459ad7f657e,
2456            >(_buf?)?;
2457            Ok(_response.map(|x| x))
2458        }
2459        self.client.send_query_and_decode::<
2460            fidl::encoding::EmptyPayload,
2461            fidl_fuchsia_unknown::CloseableCloseResult,
2462        >(
2463            (),
2464            0x5ac5d459ad7f657e,
2465            fidl::encoding::DynamicFlags::empty(),
2466            _decode,
2467        )
2468    }
2469
2470    type QueryResponseFut =
2471        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2472    fn r#query(&self) -> Self::QueryResponseFut {
2473        fn _decode(
2474            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2475        ) -> Result<Vec<u8>, fidl::Error> {
2476            let _response = fidl::client::decode_transaction_body::<
2477                fidl_fuchsia_unknown::QueryableQueryResponse,
2478                fidl::encoding::DefaultFuchsiaResourceDialect,
2479                0x2658edee9decfc06,
2480            >(_buf?)?;
2481            Ok(_response.protocol)
2482        }
2483        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2484            (),
2485            0x2658edee9decfc06,
2486            fidl::encoding::DynamicFlags::empty(),
2487            _decode,
2488        )
2489    }
2490
2491    fn r#deprecated_clone(
2492        &self,
2493        mut flags: OpenFlags,
2494        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2495    ) -> Result<(), fidl::Error> {
2496        self.client.send::<NodeDeprecatedCloneRequest>(
2497            (flags, object),
2498            0x5a61678f293ce16f,
2499            fidl::encoding::DynamicFlags::FLEXIBLE,
2500        )
2501    }
2502
2503    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2504        (i32, NodeAttributes),
2505        fidl::encoding::DefaultFuchsiaResourceDialect,
2506    >;
2507    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2508        fn _decode(
2509            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2510        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2511            let _response = fidl::client::decode_transaction_body::<
2512                NodeDeprecatedGetAttrResponse,
2513                fidl::encoding::DefaultFuchsiaResourceDialect,
2514                0x78985e216314dafd,
2515            >(_buf?)?;
2516            Ok((_response.s, _response.attributes))
2517        }
2518        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2519            (),
2520            0x78985e216314dafd,
2521            fidl::encoding::DynamicFlags::empty(),
2522            _decode,
2523        )
2524    }
2525
2526    type DeprecatedSetAttrResponseFut =
2527        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2528    fn r#deprecated_set_attr(
2529        &self,
2530        mut flags: NodeAttributeFlags,
2531        mut attributes: &NodeAttributes,
2532    ) -> Self::DeprecatedSetAttrResponseFut {
2533        fn _decode(
2534            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2535        ) -> Result<i32, fidl::Error> {
2536            let _response = fidl::client::decode_transaction_body::<
2537                NodeDeprecatedSetAttrResponse,
2538                fidl::encoding::DefaultFuchsiaResourceDialect,
2539                0x4186c0f40d938f46,
2540            >(_buf?)?;
2541            Ok(_response.s)
2542        }
2543        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2544            (flags, attributes),
2545            0x4186c0f40d938f46,
2546            fidl::encoding::DynamicFlags::empty(),
2547            _decode,
2548        )
2549    }
2550
2551    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2552        (i32, OpenFlags),
2553        fidl::encoding::DefaultFuchsiaResourceDialect,
2554    >;
2555    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2556        fn _decode(
2557            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2558        ) -> Result<(i32, OpenFlags), fidl::Error> {
2559            let _response = fidl::client::decode_transaction_body::<
2560                NodeDeprecatedGetFlagsResponse,
2561                fidl::encoding::DefaultFuchsiaResourceDialect,
2562                0x5b88fffb8eda3aa1,
2563            >(_buf?)?;
2564            Ok((_response.s, _response.flags))
2565        }
2566        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2567            (),
2568            0x5b88fffb8eda3aa1,
2569            fidl::encoding::DynamicFlags::empty(),
2570            _decode,
2571        )
2572    }
2573
2574    type DeprecatedSetFlagsResponseFut =
2575        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2576    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2577        fn _decode(
2578            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2579        ) -> Result<i32, fidl::Error> {
2580            let _response = fidl::client::decode_transaction_body::<
2581                NodeDeprecatedSetFlagsResponse,
2582                fidl::encoding::DefaultFuchsiaResourceDialect,
2583                0x5295b76c71fde733,
2584            >(_buf?)?;
2585            Ok(_response.s)
2586        }
2587        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2588            (flags,),
2589            0x5295b76c71fde733,
2590            fidl::encoding::DynamicFlags::empty(),
2591            _decode,
2592        )
2593    }
2594
2595    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2596        NodeGetFlagsResult,
2597        fidl::encoding::DefaultFuchsiaResourceDialect,
2598    >;
2599    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2600        fn _decode(
2601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2602        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2603            let _response = fidl::client::decode_transaction_body::<
2604                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2605                fidl::encoding::DefaultFuchsiaResourceDialect,
2606                0x176eb318f64ec23,
2607            >(_buf?)?
2608            .into_result::<DirectoryMarker>("get_flags")?;
2609            Ok(_response.map(|x| x.flags))
2610        }
2611        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2612            (),
2613            0x176eb318f64ec23,
2614            fidl::encoding::DynamicFlags::FLEXIBLE,
2615            _decode,
2616        )
2617    }
2618
2619    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2620        NodeSetFlagsResult,
2621        fidl::encoding::DefaultFuchsiaResourceDialect,
2622    >;
2623    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2624        fn _decode(
2625            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2626        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2627            let _response = fidl::client::decode_transaction_body::<
2628                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2629                fidl::encoding::DefaultFuchsiaResourceDialect,
2630                0x55a8028685791ea8,
2631            >(_buf?)?
2632            .into_result::<DirectoryMarker>("set_flags")?;
2633            Ok(_response.map(|x| x))
2634        }
2635        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2636            (flags,),
2637            0x55a8028685791ea8,
2638            fidl::encoding::DynamicFlags::FLEXIBLE,
2639            _decode,
2640        )
2641    }
2642
2643    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2644        (i32, Option<Box<FilesystemInfo>>),
2645        fidl::encoding::DefaultFuchsiaResourceDialect,
2646    >;
2647    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2648        fn _decode(
2649            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2650        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2651            let _response = fidl::client::decode_transaction_body::<
2652                NodeQueryFilesystemResponse,
2653                fidl::encoding::DefaultFuchsiaResourceDialect,
2654                0x6f344a1c6b0a0610,
2655            >(_buf?)?;
2656            Ok((_response.s, _response.info))
2657        }
2658        self.client.send_query_and_decode::<
2659            fidl::encoding::EmptyPayload,
2660            (i32, Option<Box<FilesystemInfo>>),
2661        >(
2662            (),
2663            0x6f344a1c6b0a0610,
2664            fidl::encoding::DynamicFlags::empty(),
2665            _decode,
2666        )
2667    }
2668
2669    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2670        NodeGetAttributesResult,
2671        fidl::encoding::DefaultFuchsiaResourceDialect,
2672    >;
2673    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2674        fn _decode(
2675            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2676        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2677            let _response = fidl::client::decode_transaction_body::<
2678                fidl::encoding::ResultType<NodeAttributes2, i32>,
2679                fidl::encoding::DefaultFuchsiaResourceDialect,
2680                0x3d4396a638ea053b,
2681            >(_buf?)?;
2682            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2683        }
2684        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2685            (query,),
2686            0x3d4396a638ea053b,
2687            fidl::encoding::DynamicFlags::empty(),
2688            _decode,
2689        )
2690    }
2691
2692    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2693        NodeUpdateAttributesResult,
2694        fidl::encoding::DefaultFuchsiaResourceDialect,
2695    >;
2696    fn r#update_attributes(
2697        &self,
2698        mut payload: &MutableNodeAttributes,
2699    ) -> Self::UpdateAttributesResponseFut {
2700        fn _decode(
2701            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2702        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2703            let _response = fidl::client::decode_transaction_body::<
2704                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2705                fidl::encoding::DefaultFuchsiaResourceDialect,
2706                0x3308c1da5a89bf08,
2707            >(_buf?)?;
2708            Ok(_response.map(|x| x))
2709        }
2710        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2711            payload,
2712            0x3308c1da5a89bf08,
2713            fidl::encoding::DynamicFlags::empty(),
2714            _decode,
2715        )
2716    }
2717
2718    type SyncResponseFut = fidl::client::QueryResponseFut<
2719        NodeSyncResult,
2720        fidl::encoding::DefaultFuchsiaResourceDialect,
2721    >;
2722    fn r#sync(&self) -> Self::SyncResponseFut {
2723        fn _decode(
2724            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2725        ) -> Result<NodeSyncResult, fidl::Error> {
2726            let _response = fidl::client::decode_transaction_body::<
2727                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2728                fidl::encoding::DefaultFuchsiaResourceDialect,
2729                0x2c5c27ca0ab5dc49,
2730            >(_buf?)?;
2731            Ok(_response.map(|x| x))
2732        }
2733        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2734            (),
2735            0x2c5c27ca0ab5dc49,
2736            fidl::encoding::DynamicFlags::empty(),
2737            _decode,
2738        )
2739    }
2740
2741    fn r#list_extended_attributes(
2742        &self,
2743        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2744    ) -> Result<(), fidl::Error> {
2745        self.client.send::<NodeListExtendedAttributesRequest>(
2746            (iterator,),
2747            0x4b61033de007fcd0,
2748            fidl::encoding::DynamicFlags::empty(),
2749        )
2750    }
2751
2752    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2753        NodeGetExtendedAttributeResult,
2754        fidl::encoding::DefaultFuchsiaResourceDialect,
2755    >;
2756    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2757        fn _decode(
2758            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2759        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2760            let _response = fidl::client::decode_transaction_body::<
2761                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2762                fidl::encoding::DefaultFuchsiaResourceDialect,
2763                0x45ffa3ccfdeb76db,
2764            >(_buf?)?;
2765            Ok(_response.map(|x| x))
2766        }
2767        self.client.send_query_and_decode::<
2768            NodeGetExtendedAttributeRequest,
2769            NodeGetExtendedAttributeResult,
2770        >(
2771            (name,),
2772            0x45ffa3ccfdeb76db,
2773            fidl::encoding::DynamicFlags::empty(),
2774            _decode,
2775        )
2776    }
2777
2778    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2779        NodeSetExtendedAttributeResult,
2780        fidl::encoding::DefaultFuchsiaResourceDialect,
2781    >;
2782    fn r#set_extended_attribute(
2783        &self,
2784        mut name: &[u8],
2785        mut value: ExtendedAttributeValue,
2786        mut mode: SetExtendedAttributeMode,
2787    ) -> Self::SetExtendedAttributeResponseFut {
2788        fn _decode(
2789            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2790        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2791            let _response = fidl::client::decode_transaction_body::<
2792                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2793                fidl::encoding::DefaultFuchsiaResourceDialect,
2794                0x4a951362f681f23c,
2795            >(_buf?)?;
2796            Ok(_response.map(|x| x))
2797        }
2798        self.client.send_query_and_decode::<
2799            NodeSetExtendedAttributeRequest,
2800            NodeSetExtendedAttributeResult,
2801        >(
2802            (name, &mut value, mode,),
2803            0x4a951362f681f23c,
2804            fidl::encoding::DynamicFlags::empty(),
2805            _decode,
2806        )
2807    }
2808
2809    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2810        NodeRemoveExtendedAttributeResult,
2811        fidl::encoding::DefaultFuchsiaResourceDialect,
2812    >;
2813    fn r#remove_extended_attribute(
2814        &self,
2815        mut name: &[u8],
2816    ) -> Self::RemoveExtendedAttributeResponseFut {
2817        fn _decode(
2818            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2819        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2820            let _response = fidl::client::decode_transaction_body::<
2821                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2822                fidl::encoding::DefaultFuchsiaResourceDialect,
2823                0x7a0b9f3a9bf9032d,
2824            >(_buf?)?;
2825            Ok(_response.map(|x| x))
2826        }
2827        self.client.send_query_and_decode::<
2828            NodeRemoveExtendedAttributeRequest,
2829            NodeRemoveExtendedAttributeResult,
2830        >(
2831            (name,),
2832            0x7a0b9f3a9bf9032d,
2833            fidl::encoding::DynamicFlags::empty(),
2834            _decode,
2835        )
2836    }
2837
2838    fn r#open(
2839        &self,
2840        mut path: &str,
2841        mut flags: Flags,
2842        mut options: &Options,
2843        mut object: fidl::Channel,
2844    ) -> Result<(), fidl::Error> {
2845        self.client.send::<OpenableOpenRequest>(
2846            (path, flags, options, object),
2847            0x568ddcb9a9cbb6d9,
2848            fidl::encoding::DynamicFlags::FLEXIBLE,
2849        )
2850    }
2851
2852    fn r#deprecated_open(
2853        &self,
2854        mut flags: OpenFlags,
2855        mut mode: ModeType,
2856        mut path: &str,
2857        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2858    ) -> Result<(), fidl::Error> {
2859        self.client.send::<DirectoryDeprecatedOpenRequest>(
2860            (flags, mode, path, object),
2861            0x2c5044561d685ec0,
2862            fidl::encoding::DynamicFlags::FLEXIBLE,
2863        )
2864    }
2865
2866    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2867        (i32, Vec<u8>),
2868        fidl::encoding::DefaultFuchsiaResourceDialect,
2869    >;
2870    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2871        fn _decode(
2872            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2873        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2874            let _response = fidl::client::decode_transaction_body::<
2875                DirectoryReadDirentsResponse,
2876                fidl::encoding::DefaultFuchsiaResourceDialect,
2877                0x3582806bf27faa0a,
2878            >(_buf?)?;
2879            Ok((_response.s, _response.dirents))
2880        }
2881        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2882            (max_bytes,),
2883            0x3582806bf27faa0a,
2884            fidl::encoding::DynamicFlags::empty(),
2885            _decode,
2886        )
2887    }
2888
2889    type RewindResponseFut =
2890        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2891    fn r#rewind(&self) -> Self::RewindResponseFut {
2892        fn _decode(
2893            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2894        ) -> Result<i32, fidl::Error> {
2895            let _response = fidl::client::decode_transaction_body::<
2896                DirectoryRewindResponse,
2897                fidl::encoding::DefaultFuchsiaResourceDialect,
2898                0x16b1202af0f34c71,
2899            >(_buf?)?;
2900            Ok(_response.s)
2901        }
2902        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2903            (),
2904            0x16b1202af0f34c71,
2905            fidl::encoding::DynamicFlags::empty(),
2906            _decode,
2907        )
2908    }
2909
2910    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2911        (i32, Option<fidl::NullableHandle>),
2912        fidl::encoding::DefaultFuchsiaResourceDialect,
2913    >;
2914    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2915        fn _decode(
2916            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2917        ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
2918            let _response = fidl::client::decode_transaction_body::<
2919                DirectoryGetTokenResponse,
2920                fidl::encoding::DefaultFuchsiaResourceDialect,
2921                0x26ae9d18763c8655,
2922            >(_buf?)?;
2923            Ok((_response.s, _response.token))
2924        }
2925        self.client.send_query_and_decode::<
2926            fidl::encoding::EmptyPayload,
2927            (i32, Option<fidl::NullableHandle>),
2928        >(
2929            (),
2930            0x26ae9d18763c8655,
2931            fidl::encoding::DynamicFlags::empty(),
2932            _decode,
2933        )
2934    }
2935
2936    type LinkResponseFut =
2937        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2938    fn r#link(
2939        &self,
2940        mut src: &str,
2941        mut dst_parent_token: fidl::NullableHandle,
2942        mut dst: &str,
2943    ) -> Self::LinkResponseFut {
2944        fn _decode(
2945            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2946        ) -> Result<i32, fidl::Error> {
2947            let _response = fidl::client::decode_transaction_body::<
2948                DirectoryLinkResponse,
2949                fidl::encoding::DefaultFuchsiaResourceDialect,
2950                0x740604c0c7c930e7,
2951            >(_buf?)?;
2952            Ok(_response.s)
2953        }
2954        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2955            (src, dst_parent_token, dst),
2956            0x740604c0c7c930e7,
2957            fidl::encoding::DynamicFlags::empty(),
2958            _decode,
2959        )
2960    }
2961
2962    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2963        DirectoryUnlinkResult,
2964        fidl::encoding::DefaultFuchsiaResourceDialect,
2965    >;
2966    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2967        fn _decode(
2968            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2969        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2970            let _response = fidl::client::decode_transaction_body::<
2971                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2972                fidl::encoding::DefaultFuchsiaResourceDialect,
2973                0x750a0326a78d7bed,
2974            >(_buf?)?;
2975            Ok(_response.map(|x| x))
2976        }
2977        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2978            (name, options),
2979            0x750a0326a78d7bed,
2980            fidl::encoding::DynamicFlags::empty(),
2981            _decode,
2982        )
2983    }
2984
2985    type RenameResponseFut = fidl::client::QueryResponseFut<
2986        DirectoryRenameResult,
2987        fidl::encoding::DefaultFuchsiaResourceDialect,
2988    >;
2989    fn r#rename(
2990        &self,
2991        mut src: &str,
2992        mut dst_parent_token: fidl::Event,
2993        mut dst: &str,
2994    ) -> Self::RenameResponseFut {
2995        fn _decode(
2996            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2997        ) -> Result<DirectoryRenameResult, fidl::Error> {
2998            let _response = fidl::client::decode_transaction_body::<
2999                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3000                fidl::encoding::DefaultFuchsiaResourceDialect,
3001                0x7060e7723b9928de,
3002            >(_buf?)?;
3003            Ok(_response.map(|x| x))
3004        }
3005        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
3006            (src, dst_parent_token, dst),
3007            0x7060e7723b9928de,
3008            fidl::encoding::DynamicFlags::empty(),
3009            _decode,
3010        )
3011    }
3012
3013    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
3014        DirectoryCreateSymlinkResult,
3015        fidl::encoding::DefaultFuchsiaResourceDialect,
3016    >;
3017    fn r#create_symlink(
3018        &self,
3019        mut name: &str,
3020        mut target: &[u8],
3021        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
3022    ) -> Self::CreateSymlinkResponseFut {
3023        fn _decode(
3024            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3025        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
3026            let _response = fidl::client::decode_transaction_body::<
3027                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3028                fidl::encoding::DefaultFuchsiaResourceDialect,
3029                0x21ce0f19ec043889,
3030            >(_buf?)?;
3031            Ok(_response.map(|x| x))
3032        }
3033        self.client
3034            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
3035                (name, target, connection),
3036                0x21ce0f19ec043889,
3037                fidl::encoding::DynamicFlags::empty(),
3038                _decode,
3039            )
3040    }
3041
3042    type WatchResponseFut =
3043        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3044    fn r#watch(
3045        &self,
3046        mut mask: WatchMask,
3047        mut options: u32,
3048        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
3049    ) -> Self::WatchResponseFut {
3050        fn _decode(
3051            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3052        ) -> Result<i32, fidl::Error> {
3053            let _response = fidl::client::decode_transaction_body::<
3054                DirectoryWatchResponse,
3055                fidl::encoding::DefaultFuchsiaResourceDialect,
3056                0x5717193a59d66d91,
3057            >(_buf?)?;
3058            Ok(_response.s)
3059        }
3060        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3061            (mask, options, watcher),
3062            0x5717193a59d66d91,
3063            fidl::encoding::DynamicFlags::empty(),
3064            _decode,
3065        )
3066    }
3067}
3068
3069pub struct DirectoryEventStream {
3070    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3071}
3072
3073impl std::marker::Unpin for DirectoryEventStream {}
3074
3075impl futures::stream::FusedStream for DirectoryEventStream {
3076    fn is_terminated(&self) -> bool {
3077        self.event_receiver.is_terminated()
3078    }
3079}
3080
3081impl futures::Stream for DirectoryEventStream {
3082    type Item = Result<DirectoryEvent, fidl::Error>;
3083
3084    fn poll_next(
3085        mut self: std::pin::Pin<&mut Self>,
3086        cx: &mut std::task::Context<'_>,
3087    ) -> std::task::Poll<Option<Self::Item>> {
3088        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3089            &mut self.event_receiver,
3090            cx
3091        )?) {
3092            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3093            None => std::task::Poll::Ready(None),
3094        }
3095    }
3096}
3097
3098#[derive(Debug)]
3099pub enum DirectoryEvent {
3100    OnOpen_ {
3101        s: i32,
3102        info: Option<Box<NodeInfoDeprecated>>,
3103    },
3104    OnRepresentation {
3105        payload: Representation,
3106    },
3107    #[non_exhaustive]
3108    _UnknownEvent {
3109        /// Ordinal of the event that was sent.
3110        ordinal: u64,
3111    },
3112}
3113
3114impl DirectoryEvent {
3115    #[allow(irrefutable_let_patterns)]
3116    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3117        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3118    }
3119    #[allow(irrefutable_let_patterns)]
3120    pub fn into_on_representation(self) -> Option<Representation> {
3121        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3122    }
3123
3124    /// Decodes a message buffer as a [`DirectoryEvent`].
3125    fn decode(
3126        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3127    ) -> Result<DirectoryEvent, fidl::Error> {
3128        let (bytes, _handles) = buf.split_mut();
3129        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3130        debug_assert_eq!(tx_header.tx_id, 0);
3131        match tx_header.ordinal {
3132            0x7fc7bbb1dbfd1972 => {
3133                let mut out = fidl::new_empty!(
3134                    NodeOnOpenRequest,
3135                    fidl::encoding::DefaultFuchsiaResourceDialect
3136                );
3137                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3138                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3139            }
3140            0x5cb40567d80a510c => {
3141                let mut out =
3142                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3143                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3144                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3145            }
3146            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3147                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3148            }
3149            _ => Err(fidl::Error::UnknownOrdinal {
3150                ordinal: tx_header.ordinal,
3151                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3152            }),
3153        }
3154    }
3155}
3156
3157/// A Stream of incoming requests for fuchsia.io/Directory.
3158pub struct DirectoryRequestStream {
3159    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3160    is_terminated: bool,
3161}
3162
3163impl std::marker::Unpin for DirectoryRequestStream {}
3164
3165impl futures::stream::FusedStream for DirectoryRequestStream {
3166    fn is_terminated(&self) -> bool {
3167        self.is_terminated
3168    }
3169}
3170
3171impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3172    type Protocol = DirectoryMarker;
3173    type ControlHandle = DirectoryControlHandle;
3174
3175    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3176        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3177    }
3178
3179    fn control_handle(&self) -> Self::ControlHandle {
3180        DirectoryControlHandle { inner: self.inner.clone() }
3181    }
3182
3183    fn into_inner(
3184        self,
3185    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3186    {
3187        (self.inner, self.is_terminated)
3188    }
3189
3190    fn from_inner(
3191        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3192        is_terminated: bool,
3193    ) -> Self {
3194        Self { inner, is_terminated }
3195    }
3196}
3197
3198impl futures::Stream for DirectoryRequestStream {
3199    type Item = Result<DirectoryRequest, fidl::Error>;
3200
3201    fn poll_next(
3202        mut self: std::pin::Pin<&mut Self>,
3203        cx: &mut std::task::Context<'_>,
3204    ) -> std::task::Poll<Option<Self::Item>> {
3205        let this = &mut *self;
3206        if this.inner.check_shutdown(cx) {
3207            this.is_terminated = true;
3208            return std::task::Poll::Ready(None);
3209        }
3210        if this.is_terminated {
3211            panic!("polled DirectoryRequestStream after completion");
3212        }
3213        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3214            |bytes, handles| {
3215                match this.inner.channel().read_etc(cx, bytes, handles) {
3216                    std::task::Poll::Ready(Ok(())) => {}
3217                    std::task::Poll::Pending => return std::task::Poll::Pending,
3218                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3219                        this.is_terminated = true;
3220                        return std::task::Poll::Ready(None);
3221                    }
3222                    std::task::Poll::Ready(Err(e)) => {
3223                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3224                            e.into(),
3225                        ))));
3226                    }
3227                }
3228
3229                // A message has been received from the channel
3230                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3231
3232                std::task::Poll::Ready(Some(match header.ordinal {
3233                    0x6ee9c0ad53ec87aa => {
3234                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3235                        let mut req = fidl::new_empty!(
3236                            AdvisoryLockingAdvisoryLockRequest,
3237                            fidl::encoding::DefaultFuchsiaResourceDialect
3238                        );
3239                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3240                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3241                        Ok(DirectoryRequest::AdvisoryLock {
3242                            request: req.request,
3243
3244                            responder: DirectoryAdvisoryLockResponder {
3245                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3246                                tx_id: header.tx_id,
3247                            },
3248                        })
3249                    }
3250                    0x20d8a7aba2168a79 => {
3251                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3252                        let mut req = fidl::new_empty!(
3253                            fidl_fuchsia_unknown::CloneableCloneRequest,
3254                            fidl::encoding::DefaultFuchsiaResourceDialect
3255                        );
3256                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3257                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3258                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3259                    }
3260                    0x5ac5d459ad7f657e => {
3261                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3262                        let mut req = fidl::new_empty!(
3263                            fidl::encoding::EmptyPayload,
3264                            fidl::encoding::DefaultFuchsiaResourceDialect
3265                        );
3266                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3267                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3268                        Ok(DirectoryRequest::Close {
3269                            responder: DirectoryCloseResponder {
3270                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3271                                tx_id: header.tx_id,
3272                            },
3273                        })
3274                    }
3275                    0x2658edee9decfc06 => {
3276                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3277                        let mut req = fidl::new_empty!(
3278                            fidl::encoding::EmptyPayload,
3279                            fidl::encoding::DefaultFuchsiaResourceDialect
3280                        );
3281                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3282                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3283                        Ok(DirectoryRequest::Query {
3284                            responder: DirectoryQueryResponder {
3285                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3286                                tx_id: header.tx_id,
3287                            },
3288                        })
3289                    }
3290                    0x5a61678f293ce16f => {
3291                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3292                        let mut req = fidl::new_empty!(
3293                            NodeDeprecatedCloneRequest,
3294                            fidl::encoding::DefaultFuchsiaResourceDialect
3295                        );
3296                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3297                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3298                        Ok(DirectoryRequest::DeprecatedClone {
3299                            flags: req.flags,
3300                            object: req.object,
3301
3302                            control_handle,
3303                        })
3304                    }
3305                    0x78985e216314dafd => {
3306                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3307                        let mut req = fidl::new_empty!(
3308                            fidl::encoding::EmptyPayload,
3309                            fidl::encoding::DefaultFuchsiaResourceDialect
3310                        );
3311                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3312                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3313                        Ok(DirectoryRequest::DeprecatedGetAttr {
3314                            responder: DirectoryDeprecatedGetAttrResponder {
3315                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3316                                tx_id: header.tx_id,
3317                            },
3318                        })
3319                    }
3320                    0x4186c0f40d938f46 => {
3321                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3322                        let mut req = fidl::new_empty!(
3323                            NodeDeprecatedSetAttrRequest,
3324                            fidl::encoding::DefaultFuchsiaResourceDialect
3325                        );
3326                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3327                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3328                        Ok(DirectoryRequest::DeprecatedSetAttr {
3329                            flags: req.flags,
3330                            attributes: req.attributes,
3331
3332                            responder: DirectoryDeprecatedSetAttrResponder {
3333                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3334                                tx_id: header.tx_id,
3335                            },
3336                        })
3337                    }
3338                    0x5b88fffb8eda3aa1 => {
3339                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3340                        let mut req = fidl::new_empty!(
3341                            fidl::encoding::EmptyPayload,
3342                            fidl::encoding::DefaultFuchsiaResourceDialect
3343                        );
3344                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3345                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3346                        Ok(DirectoryRequest::DeprecatedGetFlags {
3347                            responder: DirectoryDeprecatedGetFlagsResponder {
3348                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3349                                tx_id: header.tx_id,
3350                            },
3351                        })
3352                    }
3353                    0x5295b76c71fde733 => {
3354                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3355                        let mut req = fidl::new_empty!(
3356                            NodeDeprecatedSetFlagsRequest,
3357                            fidl::encoding::DefaultFuchsiaResourceDialect
3358                        );
3359                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3360                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3361                        Ok(DirectoryRequest::DeprecatedSetFlags {
3362                            flags: req.flags,
3363
3364                            responder: DirectoryDeprecatedSetFlagsResponder {
3365                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3366                                tx_id: header.tx_id,
3367                            },
3368                        })
3369                    }
3370                    0x176eb318f64ec23 => {
3371                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3372                        let mut req = fidl::new_empty!(
3373                            fidl::encoding::EmptyPayload,
3374                            fidl::encoding::DefaultFuchsiaResourceDialect
3375                        );
3376                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3377                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3378                        Ok(DirectoryRequest::GetFlags {
3379                            responder: DirectoryGetFlagsResponder {
3380                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3381                                tx_id: header.tx_id,
3382                            },
3383                        })
3384                    }
3385                    0x55a8028685791ea8 => {
3386                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3387                        let mut req = fidl::new_empty!(
3388                            NodeSetFlagsRequest,
3389                            fidl::encoding::DefaultFuchsiaResourceDialect
3390                        );
3391                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3392                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3393                        Ok(DirectoryRequest::SetFlags {
3394                            flags: req.flags,
3395
3396                            responder: DirectorySetFlagsResponder {
3397                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3398                                tx_id: header.tx_id,
3399                            },
3400                        })
3401                    }
3402                    0x6f344a1c6b0a0610 => {
3403                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3404                        let mut req = fidl::new_empty!(
3405                            fidl::encoding::EmptyPayload,
3406                            fidl::encoding::DefaultFuchsiaResourceDialect
3407                        );
3408                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3409                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3410                        Ok(DirectoryRequest::QueryFilesystem {
3411                            responder: DirectoryQueryFilesystemResponder {
3412                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3413                                tx_id: header.tx_id,
3414                            },
3415                        })
3416                    }
3417                    0x3d4396a638ea053b => {
3418                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3419                        let mut req = fidl::new_empty!(
3420                            NodeGetAttributesRequest,
3421                            fidl::encoding::DefaultFuchsiaResourceDialect
3422                        );
3423                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3424                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3425                        Ok(DirectoryRequest::GetAttributes {
3426                            query: req.query,
3427
3428                            responder: DirectoryGetAttributesResponder {
3429                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3430                                tx_id: header.tx_id,
3431                            },
3432                        })
3433                    }
3434                    0x3308c1da5a89bf08 => {
3435                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3436                        let mut req = fidl::new_empty!(
3437                            MutableNodeAttributes,
3438                            fidl::encoding::DefaultFuchsiaResourceDialect
3439                        );
3440                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3441                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3442                        Ok(DirectoryRequest::UpdateAttributes {
3443                            payload: req,
3444                            responder: DirectoryUpdateAttributesResponder {
3445                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3446                                tx_id: header.tx_id,
3447                            },
3448                        })
3449                    }
3450                    0x2c5c27ca0ab5dc49 => {
3451                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3452                        let mut req = fidl::new_empty!(
3453                            fidl::encoding::EmptyPayload,
3454                            fidl::encoding::DefaultFuchsiaResourceDialect
3455                        );
3456                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3457                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3458                        Ok(DirectoryRequest::Sync {
3459                            responder: DirectorySyncResponder {
3460                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3461                                tx_id: header.tx_id,
3462                            },
3463                        })
3464                    }
3465                    0x4b61033de007fcd0 => {
3466                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3467                        let mut req = fidl::new_empty!(
3468                            NodeListExtendedAttributesRequest,
3469                            fidl::encoding::DefaultFuchsiaResourceDialect
3470                        );
3471                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3472                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3473                        Ok(DirectoryRequest::ListExtendedAttributes {
3474                            iterator: req.iterator,
3475
3476                            control_handle,
3477                        })
3478                    }
3479                    0x45ffa3ccfdeb76db => {
3480                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3481                        let mut req = fidl::new_empty!(
3482                            NodeGetExtendedAttributeRequest,
3483                            fidl::encoding::DefaultFuchsiaResourceDialect
3484                        );
3485                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3486                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3487                        Ok(DirectoryRequest::GetExtendedAttribute {
3488                            name: req.name,
3489
3490                            responder: DirectoryGetExtendedAttributeResponder {
3491                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3492                                tx_id: header.tx_id,
3493                            },
3494                        })
3495                    }
3496                    0x4a951362f681f23c => {
3497                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3498                        let mut req = fidl::new_empty!(
3499                            NodeSetExtendedAttributeRequest,
3500                            fidl::encoding::DefaultFuchsiaResourceDialect
3501                        );
3502                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3503                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3504                        Ok(DirectoryRequest::SetExtendedAttribute {
3505                            name: req.name,
3506                            value: req.value,
3507                            mode: req.mode,
3508
3509                            responder: DirectorySetExtendedAttributeResponder {
3510                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3511                                tx_id: header.tx_id,
3512                            },
3513                        })
3514                    }
3515                    0x7a0b9f3a9bf9032d => {
3516                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3517                        let mut req = fidl::new_empty!(
3518                            NodeRemoveExtendedAttributeRequest,
3519                            fidl::encoding::DefaultFuchsiaResourceDialect
3520                        );
3521                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3522                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3523                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3524                            name: req.name,
3525
3526                            responder: DirectoryRemoveExtendedAttributeResponder {
3527                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3528                                tx_id: header.tx_id,
3529                            },
3530                        })
3531                    }
3532                    0x568ddcb9a9cbb6d9 => {
3533                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3534                        let mut req = fidl::new_empty!(
3535                            OpenableOpenRequest,
3536                            fidl::encoding::DefaultFuchsiaResourceDialect
3537                        );
3538                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3539                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3540                        Ok(DirectoryRequest::Open {
3541                            path: req.path,
3542                            flags: req.flags,
3543                            options: req.options,
3544                            object: req.object,
3545
3546                            control_handle,
3547                        })
3548                    }
3549                    0x2c5044561d685ec0 => {
3550                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3551                        let mut req = fidl::new_empty!(
3552                            DirectoryDeprecatedOpenRequest,
3553                            fidl::encoding::DefaultFuchsiaResourceDialect
3554                        );
3555                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3556                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3557                        Ok(DirectoryRequest::DeprecatedOpen {
3558                            flags: req.flags,
3559                            mode: req.mode,
3560                            path: req.path,
3561                            object: req.object,
3562
3563                            control_handle,
3564                        })
3565                    }
3566                    0x3582806bf27faa0a => {
3567                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3568                        let mut req = fidl::new_empty!(
3569                            DirectoryReadDirentsRequest,
3570                            fidl::encoding::DefaultFuchsiaResourceDialect
3571                        );
3572                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3573                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3574                        Ok(DirectoryRequest::ReadDirents {
3575                            max_bytes: req.max_bytes,
3576
3577                            responder: DirectoryReadDirentsResponder {
3578                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3579                                tx_id: header.tx_id,
3580                            },
3581                        })
3582                    }
3583                    0x16b1202af0f34c71 => {
3584                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3585                        let mut req = fidl::new_empty!(
3586                            fidl::encoding::EmptyPayload,
3587                            fidl::encoding::DefaultFuchsiaResourceDialect
3588                        );
3589                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3590                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3591                        Ok(DirectoryRequest::Rewind {
3592                            responder: DirectoryRewindResponder {
3593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3594                                tx_id: header.tx_id,
3595                            },
3596                        })
3597                    }
3598                    0x26ae9d18763c8655 => {
3599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3600                        let mut req = fidl::new_empty!(
3601                            fidl::encoding::EmptyPayload,
3602                            fidl::encoding::DefaultFuchsiaResourceDialect
3603                        );
3604                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3605                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3606                        Ok(DirectoryRequest::GetToken {
3607                            responder: DirectoryGetTokenResponder {
3608                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3609                                tx_id: header.tx_id,
3610                            },
3611                        })
3612                    }
3613                    0x740604c0c7c930e7 => {
3614                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3615                        let mut req = fidl::new_empty!(
3616                            DirectoryLinkRequest,
3617                            fidl::encoding::DefaultFuchsiaResourceDialect
3618                        );
3619                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3620                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3621                        Ok(DirectoryRequest::Link {
3622                            src: req.src,
3623                            dst_parent_token: req.dst_parent_token,
3624                            dst: req.dst,
3625
3626                            responder: DirectoryLinkResponder {
3627                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3628                                tx_id: header.tx_id,
3629                            },
3630                        })
3631                    }
3632                    0x750a0326a78d7bed => {
3633                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3634                        let mut req = fidl::new_empty!(
3635                            DirectoryUnlinkRequest,
3636                            fidl::encoding::DefaultFuchsiaResourceDialect
3637                        );
3638                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3639                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3640                        Ok(DirectoryRequest::Unlink {
3641                            name: req.name,
3642                            options: req.options,
3643
3644                            responder: DirectoryUnlinkResponder {
3645                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3646                                tx_id: header.tx_id,
3647                            },
3648                        })
3649                    }
3650                    0x7060e7723b9928de => {
3651                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3652                        let mut req = fidl::new_empty!(
3653                            DirectoryRenameRequest,
3654                            fidl::encoding::DefaultFuchsiaResourceDialect
3655                        );
3656                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3657                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3658                        Ok(DirectoryRequest::Rename {
3659                            src: req.src,
3660                            dst_parent_token: req.dst_parent_token,
3661                            dst: req.dst,
3662
3663                            responder: DirectoryRenameResponder {
3664                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3665                                tx_id: header.tx_id,
3666                            },
3667                        })
3668                    }
3669                    0x21ce0f19ec043889 => {
3670                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3671                        let mut req = fidl::new_empty!(
3672                            DirectoryCreateSymlinkRequest,
3673                            fidl::encoding::DefaultFuchsiaResourceDialect
3674                        );
3675                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3676                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3677                        Ok(DirectoryRequest::CreateSymlink {
3678                            name: req.name,
3679                            target: req.target,
3680                            connection: req.connection,
3681
3682                            responder: DirectoryCreateSymlinkResponder {
3683                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3684                                tx_id: header.tx_id,
3685                            },
3686                        })
3687                    }
3688                    0x5717193a59d66d91 => {
3689                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3690                        let mut req = fidl::new_empty!(
3691                            DirectoryWatchRequest,
3692                            fidl::encoding::DefaultFuchsiaResourceDialect
3693                        );
3694                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3695                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3696                        Ok(DirectoryRequest::Watch {
3697                            mask: req.mask,
3698                            options: req.options,
3699                            watcher: req.watcher,
3700
3701                            responder: DirectoryWatchResponder {
3702                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3703                                tx_id: header.tx_id,
3704                            },
3705                        })
3706                    }
3707                    _ if header.tx_id == 0
3708                        && header
3709                            .dynamic_flags()
3710                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3711                    {
3712                        Ok(DirectoryRequest::_UnknownMethod {
3713                            ordinal: header.ordinal,
3714                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3715                            method_type: fidl::MethodType::OneWay,
3716                        })
3717                    }
3718                    _ if header
3719                        .dynamic_flags()
3720                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3721                    {
3722                        this.inner.send_framework_err(
3723                            fidl::encoding::FrameworkErr::UnknownMethod,
3724                            header.tx_id,
3725                            header.ordinal,
3726                            header.dynamic_flags(),
3727                            (bytes, handles),
3728                        )?;
3729                        Ok(DirectoryRequest::_UnknownMethod {
3730                            ordinal: header.ordinal,
3731                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3732                            method_type: fidl::MethodType::TwoWay,
3733                        })
3734                    }
3735                    _ => Err(fidl::Error::UnknownOrdinal {
3736                        ordinal: header.ordinal,
3737                        protocol_name:
3738                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3739                    }),
3740                }))
3741            },
3742        )
3743    }
3744}
3745
3746/// Directory defines a node which is capable of containing other Objects.
3747#[derive(Debug)]
3748pub enum DirectoryRequest {
3749    /// Acquires an advisory lock on the underlying file.
3750    ///
3751    /// The lock lasts until either this connection is closed or
3752    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3753    /// explicitly.
3754    ///
3755    /// Advisory locks are purely advisory. They do not prevent actual read or
3756    /// write operations from occurring on the file, either through this
3757    /// connection or through other connections.
3758    ///
3759    /// This method requires the following rights:
3760    ///
3761    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3762    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3763    ///   [`AdvisoryLockType.WRITE`].
3764    ///
3765    /// # Errors
3766    ///
3767    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3768    ///   example, another connection might hold a conflicting lock type.
3769    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3770    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3771    ///   to acquire the given type of lock.
3772    AdvisoryLock {
3773        request: AdvisoryLockRequest,
3774        responder: DirectoryAdvisoryLockResponder,
3775    },
3776    Clone {
3777        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3778        control_handle: DirectoryControlHandle,
3779    },
3780    /// Terminates the connection.
3781    ///
3782    /// After calling `Close`, the client must not send any other requests.
3783    ///
3784    /// Servers, after sending the status response, should close the connection
3785    /// regardless of status and without sending an epitaph.
3786    ///
3787    /// Closing the client end of the channel should be semantically equivalent
3788    /// to calling `Close` without knowing when the close has completed or its
3789    /// status.
3790    Close {
3791        responder: DirectoryCloseResponder,
3792    },
3793    Query {
3794        responder: DirectoryQueryResponder,
3795    },
3796    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3797    DeprecatedClone {
3798        flags: OpenFlags,
3799        object: fidl::endpoints::ServerEnd<NodeMarker>,
3800        control_handle: DirectoryControlHandle,
3801    },
3802    /// DEPRECATED - Use `Node.GetAttributes` instead.
3803    ///
3804    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3805    DeprecatedGetAttr {
3806        responder: DirectoryDeprecatedGetAttrResponder,
3807    },
3808    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3809    DeprecatedSetAttr {
3810        flags: NodeAttributeFlags,
3811        attributes: NodeAttributes,
3812        responder: DirectoryDeprecatedSetAttrResponder,
3813    },
3814    /// [DEPRECATED - Use new GetFlags method instead.]
3815    DeprecatedGetFlags {
3816        responder: DirectoryDeprecatedGetFlagsResponder,
3817    },
3818    /// [DEPRECATED - Use new SetFlags method instead.]
3819    DeprecatedSetFlags {
3820        flags: OpenFlags,
3821        responder: DirectoryDeprecatedSetFlagsResponder,
3822    },
3823    /// Queries the flags that apply to this node after it has been opened/created. This method does
3824    /// not require any rights.
3825    ///
3826    /// Note that the final set of flags that apply to the connection may differ from those
3827    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3828    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3829    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3830    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3831    GetFlags {
3832        responder: DirectoryGetFlagsResponder,
3833    },
3834    /// Sets the flags that apply to this node after it has been opened. This method does not
3835    /// require any rights.
3836    ///
3837    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3838    /// clear append mode.
3839    ///
3840    /// Errors:
3841    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3842    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3843    SetFlags {
3844        flags: Flags,
3845        responder: DirectorySetFlagsResponder,
3846    },
3847    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
3848    /// volume has different settings or the storage is accounted seperately from the rest of the
3849    /// filesystem that may be reported instead of filesystem-wide details.
3850    QueryFilesystem {
3851        responder: DirectoryQueryFilesystemResponder,
3852    },
3853    /// Acquires information about the node.
3854    ///
3855    /// The attributes of a node should be stable, independent of the
3856    /// specific protocol used to access it.
3857    ///
3858    /// If a particular attribute is not applicable or not supported,
3859    /// filesystems should leave the corresponding field absent.
3860    ///
3861    /// + `query` a bit-mask specifying which attributes to fetch. The server
3862    ///   should not return more than necessary.
3863    /// - `attributes` the returned attributes.
3864    ///
3865    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3866    GetAttributes {
3867        query: NodeAttributesQuery,
3868        responder: DirectoryGetAttributesResponder,
3869    },
3870    /// Updates information about the node.
3871    ///
3872    /// + `attributes` the presence of a table field in `attributes` indicates
3873    /// the intent to update the corresponding attribute.
3874    ///
3875    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3876    ///
3877    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3878    UpdateAttributes {
3879        payload: MutableNodeAttributes,
3880        responder: DirectoryUpdateAttributesResponder,
3881    },
3882    /// Synchronizes updates to the node to the underlying media, if it exists.
3883    ///
3884    /// This method will return when the filesystem server has flushed the
3885    /// relevant updates to the underlying media, but does not guarantee the
3886    /// underlying media has persisted the information, nor that any information
3887    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3888    /// between operations.
3889    ///
3890    /// This method does not require any rights.
3891    Sync {
3892        responder: DirectorySyncResponder,
3893    },
3894    /// Creates an iterator over all the extended attribute names associated
3895    /// with this node. If an error occurs it is returned as an epitaph on the
3896    /// iterator request channel, and then the channel is closed.
3897    ///
3898    /// GetExtendedAttributes can be used with any of these names to retrieve
3899    /// the associated value.
3900    ///
3901    /// This method requires the [`Rights.READ_BYTES`] right.
3902    ListExtendedAttributes {
3903        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3904        control_handle: DirectoryControlHandle,
3905    },
3906    /// Get the value associated with the given attribute `name` for this node.
3907    ///
3908    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3909    /// particular structure is imposed on them.
3910    ///
3911    /// This method requires the [`Rights.READ_BYTES`] right.
3912    GetExtendedAttribute {
3913        name: Vec<u8>,
3914        responder: DirectoryGetExtendedAttributeResponder,
3915    },
3916    /// Set the value for the given attribute `name` to `value` for this node.
3917    ///
3918    /// The attribute name may exist, in which case the attribute is updated.
3919    /// If the attribute doesn't exist, it is created. The name should have no
3920    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3921    ///
3922    /// This method requires the [`Rights.WRITE_BYTES`] right.
3923    SetExtendedAttribute {
3924        name: Vec<u8>,
3925        value: ExtendedAttributeValue,
3926        mode: SetExtendedAttributeMode,
3927        responder: DirectorySetExtendedAttributeResponder,
3928    },
3929    /// Remove the specified extended attribute.
3930    ///
3931    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3932    ///
3933    /// This method requires the [`Rights.WRITE_BYTES`] right.
3934    RemoveExtendedAttribute {
3935        name: Vec<u8>,
3936        responder: DirectoryRemoveExtendedAttributeResponder,
3937    },
3938    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3939    /// epitaph sent on the `object` channel.
3940    ///
3941    /// Errors:
3942    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3943    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3944    Open {
3945        path: String,
3946        flags: Flags,
3947        options: Options,
3948        object: fidl::Channel,
3949        control_handle: DirectoryControlHandle,
3950    },
3951    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3952    DeprecatedOpen {
3953        flags: OpenFlags,
3954        mode: ModeType,
3955        path: String,
3956        object: fidl::endpoints::ServerEnd<NodeMarker>,
3957        control_handle: DirectoryControlHandle,
3958    },
3959    /// Reads a collection of variably sized dirents into a buffer.
3960    /// The number of dirents in a directory may be very large: akin to
3961    /// calling read multiple times on a file, directories have a seek
3962    /// offset which is updated on subsequent calls to ReadDirents.
3963    /// Each call to ReadDirents will only return whole dirent structures,
3964    /// they will not get split across ReadDirent calls. When the seek
3965    /// offset reaches the end, `dirents` will be empty.
3966    ///
3967    /// These dirents are of the form:
3968    /// ```
3969    /// struct dirent {
3970    ///   // Describes the inode of the entry.
3971    ///   uint64 ino;
3972    ///   // Describes the length of the dirent name in bytes.
3973    ///   uint8 size;
3974    ///   // Describes the type of the entry. Aligned with the
3975    ///   // POSIX d_type values. Use `DirentType` constants.
3976    ///   uint8 type;
3977    ///   // Unterminated name of entry.
3978    ///   char name[0];
3979    /// }
3980    /// ```
3981    ///
3982    /// This method does not require any rights, since one could always probe for
3983    /// directory contents by triggering name conflicts during file creation.
3984    ReadDirents {
3985        max_bytes: u64,
3986        responder: DirectoryReadDirentsResponder,
3987    },
3988    /// Resets the directory seek offset.
3989    ///
3990    /// This method does not require any rights, similar to ReadDirents.
3991    Rewind {
3992        responder: DirectoryRewindResponder,
3993    },
3994    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3995    /// in time. The token will remain valid for as long as the connection requesting the token
3996    /// remains open.
3997    ///
3998    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3999    /// `ZX_ERR_BAD_HANDLE`.
4000    GetToken {
4001        responder: DirectoryGetTokenResponder,
4002    },
4003    /// Creates a link to an object named src by the name dst, within a directory represented by
4004    /// token.
4005    ///
4006    /// `src` must be a resolved object name. Including "/" in the string will
4007    /// return `ZX_ERR_INVALID_ARGS`.
4008    ///
4009    /// `dst` must be a resolved object name. Including "/" in the string will
4010    /// return `ZX_ERR_INVALID_ARGS`.
4011    ///
4012    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
4013    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
4014    ///
4015    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
4016    /// there are two actors operating concurrently, and one actor performs a rename that affects
4017    /// the source within this directory, and the other does a link, each will appear to occur
4018    /// atomically in an unspecified order.
4019    Link {
4020        src: String,
4021        dst_parent_token: fidl::NullableHandle,
4022        dst: String,
4023        responder: DirectoryLinkResponder,
4024    },
4025    /// Removes a child node from the this directory's list of entries.
4026    ///
4027    /// Note: this does not guarantee that the underlying object is destroyed.
4028    /// Although the link will be removed from the containing directory,
4029    /// objects with multiple references (such as files which are still open)
4030    /// will not actually be destroyed until all references are closed.
4031    ///
4032    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
4033    ///   [`Rights.WRITE_BYTES`].
4034    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
4035    ///   support writing.
4036    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
4037    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
4038    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
4039    ///   containing a remote channel.
4040    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
4041    ///     something other than a directory was found.
4042    ///
4043    /// Other errors may be returned for filesystem-specific reasons.
4044    ///
4045    /// This method requires the following rights:
4046    ///
4047    /// * [`Rights.ENUMERATE`]
4048    /// * [`Rights.MODIFY_DIRECTORY`]
4049    Unlink {
4050        name: String,
4051        options: UnlinkOptions,
4052        responder: DirectoryUnlinkResponder,
4053    },
4054    /// Renames a node named `src` to the name `dst`, in a directory represented
4055    /// by `dst_parent_token`.
4056    ///
4057    /// `src` and `dst` must be valid node names.
4058    /// See [`Name`] for what constitutes a valid name.
4059    ///
4060    /// This method requires the following rights on both the current connection, and the connection
4061    /// identified by `dst_parent_token`:
4062    ///
4063    /// * [`Rights.ENUMERATE`]
4064    /// * [`Rights.MODIFY_DIRECTORY`]
4065    ///
4066    /// The following requirements are necessary to avoid rights escalations.
4067    ///
4068    /// If the source and destination directory differ, the source directory must also have the
4069    /// maximal set of abilities supported for files, which would typically be
4070    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4071    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4072    /// right.
4073    ///
4074    /// If `src` refers to a directory, and differs from the destination directory, then the source
4075    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4076    ///
4077    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4078    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4079    Rename {
4080        src: String,
4081        dst_parent_token: fidl::Event,
4082        dst: String,
4083        responder: DirectoryRenameResponder,
4084    },
4085    /// Creates a symbolic link.
4086    ///
4087    /// `name` is the name to be given to the created symbolic link.
4088    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4089    /// will perform no validation of `target` except for a server chosen maximum length.
4090    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4091    /// on the successfully created node.
4092    ///
4093    /// * [`Rights.MODIFY_DIRECTORY`]
4094    ///
4095    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4096    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4097    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4098    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4099    CreateSymlink {
4100        name: String,
4101        target: Vec<u8>,
4102        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4103        responder: DirectoryCreateSymlinkResponder,
4104    },
4105    /// Watches a directory, receiving events of added messages on the
4106    /// watcher request channel.
4107    ///
4108    /// Options must be zero; it is reserved.
4109    ///
4110    /// This method does not require any rights, similar to ReadDirents.
4111    Watch {
4112        mask: WatchMask,
4113        options: u32,
4114        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4115        responder: DirectoryWatchResponder,
4116    },
4117    /// An interaction was received which does not match any known method.
4118    #[non_exhaustive]
4119    _UnknownMethod {
4120        /// Ordinal of the method that was called.
4121        ordinal: u64,
4122        control_handle: DirectoryControlHandle,
4123        method_type: fidl::MethodType,
4124    },
4125}
4126
4127impl DirectoryRequest {
4128    #[allow(irrefutable_let_patterns)]
4129    pub fn into_advisory_lock(
4130        self,
4131    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4132        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4133            Some((request, responder))
4134        } else {
4135            None
4136        }
4137    }
4138
4139    #[allow(irrefutable_let_patterns)]
4140    pub fn into_clone(
4141        self,
4142    ) -> Option<(
4143        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4144        DirectoryControlHandle,
4145    )> {
4146        if let DirectoryRequest::Clone { request, control_handle } = self {
4147            Some((request, control_handle))
4148        } else {
4149            None
4150        }
4151    }
4152
4153    #[allow(irrefutable_let_patterns)]
4154    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4155        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4156    }
4157
4158    #[allow(irrefutable_let_patterns)]
4159    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4160        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4161    }
4162
4163    #[allow(irrefutable_let_patterns)]
4164    pub fn into_deprecated_clone(
4165        self,
4166    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4167        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4168            Some((flags, object, control_handle))
4169        } else {
4170            None
4171        }
4172    }
4173
4174    #[allow(irrefutable_let_patterns)]
4175    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4176        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4177            Some((responder))
4178        } else {
4179            None
4180        }
4181    }
4182
4183    #[allow(irrefutable_let_patterns)]
4184    pub fn into_deprecated_set_attr(
4185        self,
4186    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4187        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4188            Some((flags, attributes, responder))
4189        } else {
4190            None
4191        }
4192    }
4193
4194    #[allow(irrefutable_let_patterns)]
4195    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4196        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4197            Some((responder))
4198        } else {
4199            None
4200        }
4201    }
4202
4203    #[allow(irrefutable_let_patterns)]
4204    pub fn into_deprecated_set_flags(
4205        self,
4206    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4207        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4208            Some((flags, responder))
4209        } else {
4210            None
4211        }
4212    }
4213
4214    #[allow(irrefutable_let_patterns)]
4215    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4216        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4217    }
4218
4219    #[allow(irrefutable_let_patterns)]
4220    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4221        if let DirectoryRequest::SetFlags { flags, responder } = self {
4222            Some((flags, responder))
4223        } else {
4224            None
4225        }
4226    }
4227
4228    #[allow(irrefutable_let_patterns)]
4229    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4230        if let DirectoryRequest::QueryFilesystem { responder } = self {
4231            Some((responder))
4232        } else {
4233            None
4234        }
4235    }
4236
4237    #[allow(irrefutable_let_patterns)]
4238    pub fn into_get_attributes(
4239        self,
4240    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4241        if let DirectoryRequest::GetAttributes { query, responder } = self {
4242            Some((query, responder))
4243        } else {
4244            None
4245        }
4246    }
4247
4248    #[allow(irrefutable_let_patterns)]
4249    pub fn into_update_attributes(
4250        self,
4251    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4252        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4253            Some((payload, responder))
4254        } else {
4255            None
4256        }
4257    }
4258
4259    #[allow(irrefutable_let_patterns)]
4260    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4261        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4262    }
4263
4264    #[allow(irrefutable_let_patterns)]
4265    pub fn into_list_extended_attributes(
4266        self,
4267    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4268    {
4269        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4270            Some((iterator, control_handle))
4271        } else {
4272            None
4273        }
4274    }
4275
4276    #[allow(irrefutable_let_patterns)]
4277    pub fn into_get_extended_attribute(
4278        self,
4279    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4280        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4281            Some((name, responder))
4282        } else {
4283            None
4284        }
4285    }
4286
4287    #[allow(irrefutable_let_patterns)]
4288    pub fn into_set_extended_attribute(
4289        self,
4290    ) -> Option<(
4291        Vec<u8>,
4292        ExtendedAttributeValue,
4293        SetExtendedAttributeMode,
4294        DirectorySetExtendedAttributeResponder,
4295    )> {
4296        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4297            Some((name, value, mode, responder))
4298        } else {
4299            None
4300        }
4301    }
4302
4303    #[allow(irrefutable_let_patterns)]
4304    pub fn into_remove_extended_attribute(
4305        self,
4306    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4307        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4308            Some((name, responder))
4309        } else {
4310            None
4311        }
4312    }
4313
4314    #[allow(irrefutable_let_patterns)]
4315    pub fn into_open(
4316        self,
4317    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4318        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4319            Some((path, flags, options, object, control_handle))
4320        } else {
4321            None
4322        }
4323    }
4324
4325    #[allow(irrefutable_let_patterns)]
4326    pub fn into_deprecated_open(
4327        self,
4328    ) -> Option<(
4329        OpenFlags,
4330        ModeType,
4331        String,
4332        fidl::endpoints::ServerEnd<NodeMarker>,
4333        DirectoryControlHandle,
4334    )> {
4335        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4336        {
4337            Some((flags, mode, path, object, control_handle))
4338        } else {
4339            None
4340        }
4341    }
4342
4343    #[allow(irrefutable_let_patterns)]
4344    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4345        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4346            Some((max_bytes, responder))
4347        } else {
4348            None
4349        }
4350    }
4351
4352    #[allow(irrefutable_let_patterns)]
4353    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4354        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4355    }
4356
4357    #[allow(irrefutable_let_patterns)]
4358    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4359        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4360    }
4361
4362    #[allow(irrefutable_let_patterns)]
4363    pub fn into_link(
4364        self,
4365    ) -> Option<(String, fidl::NullableHandle, String, DirectoryLinkResponder)> {
4366        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4367            Some((src, dst_parent_token, dst, responder))
4368        } else {
4369            None
4370        }
4371    }
4372
4373    #[allow(irrefutable_let_patterns)]
4374    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4375        if let DirectoryRequest::Unlink { name, options, responder } = self {
4376            Some((name, options, responder))
4377        } else {
4378            None
4379        }
4380    }
4381
4382    #[allow(irrefutable_let_patterns)]
4383    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4384        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4385            Some((src, dst_parent_token, dst, responder))
4386        } else {
4387            None
4388        }
4389    }
4390
4391    #[allow(irrefutable_let_patterns)]
4392    pub fn into_create_symlink(
4393        self,
4394    ) -> Option<(
4395        String,
4396        Vec<u8>,
4397        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4398        DirectoryCreateSymlinkResponder,
4399    )> {
4400        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4401            Some((name, target, connection, responder))
4402        } else {
4403            None
4404        }
4405    }
4406
4407    #[allow(irrefutable_let_patterns)]
4408    pub fn into_watch(
4409        self,
4410    ) -> Option<(
4411        WatchMask,
4412        u32,
4413        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4414        DirectoryWatchResponder,
4415    )> {
4416        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4417            Some((mask, options, watcher, responder))
4418        } else {
4419            None
4420        }
4421    }
4422
4423    /// Name of the method defined in FIDL
4424    pub fn method_name(&self) -> &'static str {
4425        match *self {
4426            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4427            DirectoryRequest::Clone { .. } => "clone",
4428            DirectoryRequest::Close { .. } => "close",
4429            DirectoryRequest::Query { .. } => "query",
4430            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4431            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4432            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4433            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4434            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4435            DirectoryRequest::GetFlags { .. } => "get_flags",
4436            DirectoryRequest::SetFlags { .. } => "set_flags",
4437            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4438            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4439            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4440            DirectoryRequest::Sync { .. } => "sync",
4441            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4442            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4443            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4444            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4445            DirectoryRequest::Open { .. } => "open",
4446            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4447            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4448            DirectoryRequest::Rewind { .. } => "rewind",
4449            DirectoryRequest::GetToken { .. } => "get_token",
4450            DirectoryRequest::Link { .. } => "link",
4451            DirectoryRequest::Unlink { .. } => "unlink",
4452            DirectoryRequest::Rename { .. } => "rename",
4453            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4454            DirectoryRequest::Watch { .. } => "watch",
4455            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4456                "unknown one-way method"
4457            }
4458            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4459                "unknown two-way method"
4460            }
4461        }
4462    }
4463}
4464
4465#[derive(Debug, Clone)]
4466pub struct DirectoryControlHandle {
4467    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4468}
4469
4470impl DirectoryControlHandle {
4471    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4472        self.inner.shutdown_with_epitaph(status.into())
4473    }
4474}
4475
4476impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4477    fn shutdown(&self) {
4478        self.inner.shutdown()
4479    }
4480
4481    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4482        self.inner.shutdown_with_epitaph(status)
4483    }
4484
4485    fn is_closed(&self) -> bool {
4486        self.inner.channel().is_closed()
4487    }
4488    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4489        self.inner.channel().on_closed()
4490    }
4491
4492    #[cfg(target_os = "fuchsia")]
4493    fn signal_peer(
4494        &self,
4495        clear_mask: zx::Signals,
4496        set_mask: zx::Signals,
4497    ) -> Result<(), zx_status::Status> {
4498        use fidl::Peered;
4499        self.inner.channel().signal_peer(clear_mask, set_mask)
4500    }
4501}
4502
4503impl DirectoryControlHandle {
4504    pub fn send_on_open_(
4505        &self,
4506        mut s: i32,
4507        mut info: Option<NodeInfoDeprecated>,
4508    ) -> Result<(), fidl::Error> {
4509        self.inner.send::<NodeOnOpenRequest>(
4510            (s, info.as_mut()),
4511            0,
4512            0x7fc7bbb1dbfd1972,
4513            fidl::encoding::DynamicFlags::FLEXIBLE,
4514        )
4515    }
4516
4517    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4518        self.inner.send::<Representation>(
4519            &mut payload,
4520            0,
4521            0x5cb40567d80a510c,
4522            fidl::encoding::DynamicFlags::empty(),
4523        )
4524    }
4525}
4526
4527#[must_use = "FIDL methods require a response to be sent"]
4528#[derive(Debug)]
4529pub struct DirectoryAdvisoryLockResponder {
4530    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4531    tx_id: u32,
4532}
4533
4534/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4535/// if the responder is dropped without sending a response, so that the client
4536/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4537impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4538    fn drop(&mut self) {
4539        self.control_handle.shutdown();
4540        // Safety: drops once, never accessed again
4541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4542    }
4543}
4544
4545impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4546    type ControlHandle = DirectoryControlHandle;
4547
4548    fn control_handle(&self) -> &DirectoryControlHandle {
4549        &self.control_handle
4550    }
4551
4552    fn drop_without_shutdown(mut self) {
4553        // Safety: drops once, never accessed again due to mem::forget
4554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4555        // Prevent Drop from running (which would shut down the channel)
4556        std::mem::forget(self);
4557    }
4558}
4559
4560impl DirectoryAdvisoryLockResponder {
4561    /// Sends a response to the FIDL transaction.
4562    ///
4563    /// Sets the channel to shutdown if an error occurs.
4564    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4565        let _result = self.send_raw(result);
4566        if _result.is_err() {
4567            self.control_handle.shutdown();
4568        }
4569        self.drop_without_shutdown();
4570        _result
4571    }
4572
4573    /// Similar to "send" but does not shutdown the channel if an error occurs.
4574    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4575        let _result = self.send_raw(result);
4576        self.drop_without_shutdown();
4577        _result
4578    }
4579
4580    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4581        self.control_handle
4582            .inner
4583            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4584                result,
4585                self.tx_id,
4586                0x6ee9c0ad53ec87aa,
4587                fidl::encoding::DynamicFlags::empty(),
4588            )
4589    }
4590}
4591
4592#[must_use = "FIDL methods require a response to be sent"]
4593#[derive(Debug)]
4594pub struct DirectoryCloseResponder {
4595    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4596    tx_id: u32,
4597}
4598
4599/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4600/// if the responder is dropped without sending a response, so that the client
4601/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4602impl std::ops::Drop for DirectoryCloseResponder {
4603    fn drop(&mut self) {
4604        self.control_handle.shutdown();
4605        // Safety: drops once, never accessed again
4606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4607    }
4608}
4609
4610impl fidl::endpoints::Responder for DirectoryCloseResponder {
4611    type ControlHandle = DirectoryControlHandle;
4612
4613    fn control_handle(&self) -> &DirectoryControlHandle {
4614        &self.control_handle
4615    }
4616
4617    fn drop_without_shutdown(mut self) {
4618        // Safety: drops once, never accessed again due to mem::forget
4619        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4620        // Prevent Drop from running (which would shut down the channel)
4621        std::mem::forget(self);
4622    }
4623}
4624
4625impl DirectoryCloseResponder {
4626    /// Sends a response to the FIDL transaction.
4627    ///
4628    /// Sets the channel to shutdown if an error occurs.
4629    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4630        let _result = self.send_raw(result);
4631        if _result.is_err() {
4632            self.control_handle.shutdown();
4633        }
4634        self.drop_without_shutdown();
4635        _result
4636    }
4637
4638    /// Similar to "send" but does not shutdown the channel if an error occurs.
4639    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4640        let _result = self.send_raw(result);
4641        self.drop_without_shutdown();
4642        _result
4643    }
4644
4645    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4646        self.control_handle
4647            .inner
4648            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4649                result,
4650                self.tx_id,
4651                0x5ac5d459ad7f657e,
4652                fidl::encoding::DynamicFlags::empty(),
4653            )
4654    }
4655}
4656
4657#[must_use = "FIDL methods require a response to be sent"]
4658#[derive(Debug)]
4659pub struct DirectoryQueryResponder {
4660    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4661    tx_id: u32,
4662}
4663
4664/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4665/// if the responder is dropped without sending a response, so that the client
4666/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4667impl std::ops::Drop for DirectoryQueryResponder {
4668    fn drop(&mut self) {
4669        self.control_handle.shutdown();
4670        // Safety: drops once, never accessed again
4671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4672    }
4673}
4674
4675impl fidl::endpoints::Responder for DirectoryQueryResponder {
4676    type ControlHandle = DirectoryControlHandle;
4677
4678    fn control_handle(&self) -> &DirectoryControlHandle {
4679        &self.control_handle
4680    }
4681
4682    fn drop_without_shutdown(mut self) {
4683        // Safety: drops once, never accessed again due to mem::forget
4684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4685        // Prevent Drop from running (which would shut down the channel)
4686        std::mem::forget(self);
4687    }
4688}
4689
4690impl DirectoryQueryResponder {
4691    /// Sends a response to the FIDL transaction.
4692    ///
4693    /// Sets the channel to shutdown if an error occurs.
4694    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4695        let _result = self.send_raw(protocol);
4696        if _result.is_err() {
4697            self.control_handle.shutdown();
4698        }
4699        self.drop_without_shutdown();
4700        _result
4701    }
4702
4703    /// Similar to "send" but does not shutdown the channel if an error occurs.
4704    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4705        let _result = self.send_raw(protocol);
4706        self.drop_without_shutdown();
4707        _result
4708    }
4709
4710    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4711        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4712            (protocol,),
4713            self.tx_id,
4714            0x2658edee9decfc06,
4715            fidl::encoding::DynamicFlags::empty(),
4716        )
4717    }
4718}
4719
4720#[must_use = "FIDL methods require a response to be sent"]
4721#[derive(Debug)]
4722pub struct DirectoryDeprecatedGetAttrResponder {
4723    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4724    tx_id: u32,
4725}
4726
4727/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4728/// if the responder is dropped without sending a response, so that the client
4729/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4730impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4731    fn drop(&mut self) {
4732        self.control_handle.shutdown();
4733        // Safety: drops once, never accessed again
4734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4735    }
4736}
4737
4738impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4739    type ControlHandle = DirectoryControlHandle;
4740
4741    fn control_handle(&self) -> &DirectoryControlHandle {
4742        &self.control_handle
4743    }
4744
4745    fn drop_without_shutdown(mut self) {
4746        // Safety: drops once, never accessed again due to mem::forget
4747        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4748        // Prevent Drop from running (which would shut down the channel)
4749        std::mem::forget(self);
4750    }
4751}
4752
4753impl DirectoryDeprecatedGetAttrResponder {
4754    /// Sends a response to the FIDL transaction.
4755    ///
4756    /// Sets the channel to shutdown if an error occurs.
4757    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4758        let _result = self.send_raw(s, attributes);
4759        if _result.is_err() {
4760            self.control_handle.shutdown();
4761        }
4762        self.drop_without_shutdown();
4763        _result
4764    }
4765
4766    /// Similar to "send" but does not shutdown the channel if an error occurs.
4767    pub fn send_no_shutdown_on_err(
4768        self,
4769        mut s: i32,
4770        mut attributes: &NodeAttributes,
4771    ) -> Result<(), fidl::Error> {
4772        let _result = self.send_raw(s, attributes);
4773        self.drop_without_shutdown();
4774        _result
4775    }
4776
4777    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4778        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4779            (s, attributes),
4780            self.tx_id,
4781            0x78985e216314dafd,
4782            fidl::encoding::DynamicFlags::empty(),
4783        )
4784    }
4785}
4786
4787#[must_use = "FIDL methods require a response to be sent"]
4788#[derive(Debug)]
4789pub struct DirectoryDeprecatedSetAttrResponder {
4790    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4791    tx_id: u32,
4792}
4793
4794/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4795/// if the responder is dropped without sending a response, so that the client
4796/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4797impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4798    fn drop(&mut self) {
4799        self.control_handle.shutdown();
4800        // Safety: drops once, never accessed again
4801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4802    }
4803}
4804
4805impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4806    type ControlHandle = DirectoryControlHandle;
4807
4808    fn control_handle(&self) -> &DirectoryControlHandle {
4809        &self.control_handle
4810    }
4811
4812    fn drop_without_shutdown(mut self) {
4813        // Safety: drops once, never accessed again due to mem::forget
4814        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4815        // Prevent Drop from running (which would shut down the channel)
4816        std::mem::forget(self);
4817    }
4818}
4819
4820impl DirectoryDeprecatedSetAttrResponder {
4821    /// Sends a response to the FIDL transaction.
4822    ///
4823    /// Sets the channel to shutdown if an error occurs.
4824    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4825        let _result = self.send_raw(s);
4826        if _result.is_err() {
4827            self.control_handle.shutdown();
4828        }
4829        self.drop_without_shutdown();
4830        _result
4831    }
4832
4833    /// Similar to "send" but does not shutdown the channel if an error occurs.
4834    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4835        let _result = self.send_raw(s);
4836        self.drop_without_shutdown();
4837        _result
4838    }
4839
4840    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4841        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4842            (s,),
4843            self.tx_id,
4844            0x4186c0f40d938f46,
4845            fidl::encoding::DynamicFlags::empty(),
4846        )
4847    }
4848}
4849
4850#[must_use = "FIDL methods require a response to be sent"]
4851#[derive(Debug)]
4852pub struct DirectoryDeprecatedGetFlagsResponder {
4853    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4854    tx_id: u32,
4855}
4856
4857/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4858/// if the responder is dropped without sending a response, so that the client
4859/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4860impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4861    fn drop(&mut self) {
4862        self.control_handle.shutdown();
4863        // Safety: drops once, never accessed again
4864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4865    }
4866}
4867
4868impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4869    type ControlHandle = DirectoryControlHandle;
4870
4871    fn control_handle(&self) -> &DirectoryControlHandle {
4872        &self.control_handle
4873    }
4874
4875    fn drop_without_shutdown(mut self) {
4876        // Safety: drops once, never accessed again due to mem::forget
4877        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4878        // Prevent Drop from running (which would shut down the channel)
4879        std::mem::forget(self);
4880    }
4881}
4882
4883impl DirectoryDeprecatedGetFlagsResponder {
4884    /// Sends a response to the FIDL transaction.
4885    ///
4886    /// Sets the channel to shutdown if an error occurs.
4887    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4888        let _result = self.send_raw(s, flags);
4889        if _result.is_err() {
4890            self.control_handle.shutdown();
4891        }
4892        self.drop_without_shutdown();
4893        _result
4894    }
4895
4896    /// Similar to "send" but does not shutdown the channel if an error occurs.
4897    pub fn send_no_shutdown_on_err(
4898        self,
4899        mut s: i32,
4900        mut flags: OpenFlags,
4901    ) -> Result<(), fidl::Error> {
4902        let _result = self.send_raw(s, flags);
4903        self.drop_without_shutdown();
4904        _result
4905    }
4906
4907    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4908        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4909            (s, flags),
4910            self.tx_id,
4911            0x5b88fffb8eda3aa1,
4912            fidl::encoding::DynamicFlags::empty(),
4913        )
4914    }
4915}
4916
4917#[must_use = "FIDL methods require a response to be sent"]
4918#[derive(Debug)]
4919pub struct DirectoryDeprecatedSetFlagsResponder {
4920    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4921    tx_id: u32,
4922}
4923
4924/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4925/// if the responder is dropped without sending a response, so that the client
4926/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4927impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4928    fn drop(&mut self) {
4929        self.control_handle.shutdown();
4930        // Safety: drops once, never accessed again
4931        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4932    }
4933}
4934
4935impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4936    type ControlHandle = DirectoryControlHandle;
4937
4938    fn control_handle(&self) -> &DirectoryControlHandle {
4939        &self.control_handle
4940    }
4941
4942    fn drop_without_shutdown(mut self) {
4943        // Safety: drops once, never accessed again due to mem::forget
4944        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4945        // Prevent Drop from running (which would shut down the channel)
4946        std::mem::forget(self);
4947    }
4948}
4949
4950impl DirectoryDeprecatedSetFlagsResponder {
4951    /// Sends a response to the FIDL transaction.
4952    ///
4953    /// Sets the channel to shutdown if an error occurs.
4954    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4955        let _result = self.send_raw(s);
4956        if _result.is_err() {
4957            self.control_handle.shutdown();
4958        }
4959        self.drop_without_shutdown();
4960        _result
4961    }
4962
4963    /// Similar to "send" but does not shutdown the channel if an error occurs.
4964    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4965        let _result = self.send_raw(s);
4966        self.drop_without_shutdown();
4967        _result
4968    }
4969
4970    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4971        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4972            (s,),
4973            self.tx_id,
4974            0x5295b76c71fde733,
4975            fidl::encoding::DynamicFlags::empty(),
4976        )
4977    }
4978}
4979
4980#[must_use = "FIDL methods require a response to be sent"]
4981#[derive(Debug)]
4982pub struct DirectoryGetFlagsResponder {
4983    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4984    tx_id: u32,
4985}
4986
4987/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4988/// if the responder is dropped without sending a response, so that the client
4989/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4990impl std::ops::Drop for DirectoryGetFlagsResponder {
4991    fn drop(&mut self) {
4992        self.control_handle.shutdown();
4993        // Safety: drops once, never accessed again
4994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4995    }
4996}
4997
4998impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4999    type ControlHandle = DirectoryControlHandle;
5000
5001    fn control_handle(&self) -> &DirectoryControlHandle {
5002        &self.control_handle
5003    }
5004
5005    fn drop_without_shutdown(mut self) {
5006        // Safety: drops once, never accessed again due to mem::forget
5007        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5008        // Prevent Drop from running (which would shut down the channel)
5009        std::mem::forget(self);
5010    }
5011}
5012
5013impl DirectoryGetFlagsResponder {
5014    /// Sends a response to the FIDL transaction.
5015    ///
5016    /// Sets the channel to shutdown if an error occurs.
5017    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5018        let _result = self.send_raw(result);
5019        if _result.is_err() {
5020            self.control_handle.shutdown();
5021        }
5022        self.drop_without_shutdown();
5023        _result
5024    }
5025
5026    /// Similar to "send" but does not shutdown the channel if an error occurs.
5027    pub fn send_no_shutdown_on_err(
5028        self,
5029        mut result: Result<Flags, i32>,
5030    ) -> Result<(), fidl::Error> {
5031        let _result = self.send_raw(result);
5032        self.drop_without_shutdown();
5033        _result
5034    }
5035
5036    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5037        self.control_handle
5038            .inner
5039            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
5040                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
5041                self.tx_id,
5042                0x176eb318f64ec23,
5043                fidl::encoding::DynamicFlags::FLEXIBLE,
5044            )
5045    }
5046}
5047
5048#[must_use = "FIDL methods require a response to be sent"]
5049#[derive(Debug)]
5050pub struct DirectorySetFlagsResponder {
5051    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5052    tx_id: u32,
5053}
5054
5055/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5056/// if the responder is dropped without sending a response, so that the client
5057/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5058impl std::ops::Drop for DirectorySetFlagsResponder {
5059    fn drop(&mut self) {
5060        self.control_handle.shutdown();
5061        // Safety: drops once, never accessed again
5062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5063    }
5064}
5065
5066impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5067    type ControlHandle = DirectoryControlHandle;
5068
5069    fn control_handle(&self) -> &DirectoryControlHandle {
5070        &self.control_handle
5071    }
5072
5073    fn drop_without_shutdown(mut self) {
5074        // Safety: drops once, never accessed again due to mem::forget
5075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5076        // Prevent Drop from running (which would shut down the channel)
5077        std::mem::forget(self);
5078    }
5079}
5080
5081impl DirectorySetFlagsResponder {
5082    /// Sends a response to the FIDL transaction.
5083    ///
5084    /// Sets the channel to shutdown if an error occurs.
5085    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5086        let _result = self.send_raw(result);
5087        if _result.is_err() {
5088            self.control_handle.shutdown();
5089        }
5090        self.drop_without_shutdown();
5091        _result
5092    }
5093
5094    /// Similar to "send" but does not shutdown the channel if an error occurs.
5095    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5096        let _result = self.send_raw(result);
5097        self.drop_without_shutdown();
5098        _result
5099    }
5100
5101    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5102        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5103            fidl::encoding::EmptyStruct,
5104            i32,
5105        >>(
5106            fidl::encoding::FlexibleResult::new(result),
5107            self.tx_id,
5108            0x55a8028685791ea8,
5109            fidl::encoding::DynamicFlags::FLEXIBLE,
5110        )
5111    }
5112}
5113
5114#[must_use = "FIDL methods require a response to be sent"]
5115#[derive(Debug)]
5116pub struct DirectoryQueryFilesystemResponder {
5117    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5118    tx_id: u32,
5119}
5120
5121/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5122/// if the responder is dropped without sending a response, so that the client
5123/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5124impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5125    fn drop(&mut self) {
5126        self.control_handle.shutdown();
5127        // Safety: drops once, never accessed again
5128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5129    }
5130}
5131
5132impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5133    type ControlHandle = DirectoryControlHandle;
5134
5135    fn control_handle(&self) -> &DirectoryControlHandle {
5136        &self.control_handle
5137    }
5138
5139    fn drop_without_shutdown(mut self) {
5140        // Safety: drops once, never accessed again due to mem::forget
5141        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5142        // Prevent Drop from running (which would shut down the channel)
5143        std::mem::forget(self);
5144    }
5145}
5146
5147impl DirectoryQueryFilesystemResponder {
5148    /// Sends a response to the FIDL transaction.
5149    ///
5150    /// Sets the channel to shutdown if an error occurs.
5151    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5152        let _result = self.send_raw(s, info);
5153        if _result.is_err() {
5154            self.control_handle.shutdown();
5155        }
5156        self.drop_without_shutdown();
5157        _result
5158    }
5159
5160    /// Similar to "send" but does not shutdown the channel if an error occurs.
5161    pub fn send_no_shutdown_on_err(
5162        self,
5163        mut s: i32,
5164        mut info: Option<&FilesystemInfo>,
5165    ) -> Result<(), fidl::Error> {
5166        let _result = self.send_raw(s, info);
5167        self.drop_without_shutdown();
5168        _result
5169    }
5170
5171    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5172        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5173            (s, info),
5174            self.tx_id,
5175            0x6f344a1c6b0a0610,
5176            fidl::encoding::DynamicFlags::empty(),
5177        )
5178    }
5179}
5180
5181#[must_use = "FIDL methods require a response to be sent"]
5182#[derive(Debug)]
5183pub struct DirectoryGetAttributesResponder {
5184    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5185    tx_id: u32,
5186}
5187
5188/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5189/// if the responder is dropped without sending a response, so that the client
5190/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5191impl std::ops::Drop for DirectoryGetAttributesResponder {
5192    fn drop(&mut self) {
5193        self.control_handle.shutdown();
5194        // Safety: drops once, never accessed again
5195        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5196    }
5197}
5198
5199impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5200    type ControlHandle = DirectoryControlHandle;
5201
5202    fn control_handle(&self) -> &DirectoryControlHandle {
5203        &self.control_handle
5204    }
5205
5206    fn drop_without_shutdown(mut self) {
5207        // Safety: drops once, never accessed again due to mem::forget
5208        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5209        // Prevent Drop from running (which would shut down the channel)
5210        std::mem::forget(self);
5211    }
5212}
5213
5214impl DirectoryGetAttributesResponder {
5215    /// Sends a response to the FIDL transaction.
5216    ///
5217    /// Sets the channel to shutdown if an error occurs.
5218    pub fn send(
5219        self,
5220        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5221    ) -> Result<(), fidl::Error> {
5222        let _result = self.send_raw(result);
5223        if _result.is_err() {
5224            self.control_handle.shutdown();
5225        }
5226        self.drop_without_shutdown();
5227        _result
5228    }
5229
5230    /// Similar to "send" but does not shutdown the channel if an error occurs.
5231    pub fn send_no_shutdown_on_err(
5232        self,
5233        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5234    ) -> Result<(), fidl::Error> {
5235        let _result = self.send_raw(result);
5236        self.drop_without_shutdown();
5237        _result
5238    }
5239
5240    fn send_raw(
5241        &self,
5242        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5243    ) -> Result<(), fidl::Error> {
5244        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5245            result,
5246            self.tx_id,
5247            0x3d4396a638ea053b,
5248            fidl::encoding::DynamicFlags::empty(),
5249        )
5250    }
5251}
5252
5253#[must_use = "FIDL methods require a response to be sent"]
5254#[derive(Debug)]
5255pub struct DirectoryUpdateAttributesResponder {
5256    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5257    tx_id: u32,
5258}
5259
5260/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5261/// if the responder is dropped without sending a response, so that the client
5262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5263impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5264    fn drop(&mut self) {
5265        self.control_handle.shutdown();
5266        // Safety: drops once, never accessed again
5267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5268    }
5269}
5270
5271impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5272    type ControlHandle = DirectoryControlHandle;
5273
5274    fn control_handle(&self) -> &DirectoryControlHandle {
5275        &self.control_handle
5276    }
5277
5278    fn drop_without_shutdown(mut self) {
5279        // Safety: drops once, never accessed again due to mem::forget
5280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5281        // Prevent Drop from running (which would shut down the channel)
5282        std::mem::forget(self);
5283    }
5284}
5285
5286impl DirectoryUpdateAttributesResponder {
5287    /// Sends a response to the FIDL transaction.
5288    ///
5289    /// Sets the channel to shutdown if an error occurs.
5290    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5291        let _result = self.send_raw(result);
5292        if _result.is_err() {
5293            self.control_handle.shutdown();
5294        }
5295        self.drop_without_shutdown();
5296        _result
5297    }
5298
5299    /// Similar to "send" but does not shutdown the channel if an error occurs.
5300    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5301        let _result = self.send_raw(result);
5302        self.drop_without_shutdown();
5303        _result
5304    }
5305
5306    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5307        self.control_handle
5308            .inner
5309            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5310                result,
5311                self.tx_id,
5312                0x3308c1da5a89bf08,
5313                fidl::encoding::DynamicFlags::empty(),
5314            )
5315    }
5316}
5317
5318#[must_use = "FIDL methods require a response to be sent"]
5319#[derive(Debug)]
5320pub struct DirectorySyncResponder {
5321    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5322    tx_id: u32,
5323}
5324
5325/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5326/// if the responder is dropped without sending a response, so that the client
5327/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5328impl std::ops::Drop for DirectorySyncResponder {
5329    fn drop(&mut self) {
5330        self.control_handle.shutdown();
5331        // Safety: drops once, never accessed again
5332        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5333    }
5334}
5335
5336impl fidl::endpoints::Responder for DirectorySyncResponder {
5337    type ControlHandle = DirectoryControlHandle;
5338
5339    fn control_handle(&self) -> &DirectoryControlHandle {
5340        &self.control_handle
5341    }
5342
5343    fn drop_without_shutdown(mut self) {
5344        // Safety: drops once, never accessed again due to mem::forget
5345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5346        // Prevent Drop from running (which would shut down the channel)
5347        std::mem::forget(self);
5348    }
5349}
5350
5351impl DirectorySyncResponder {
5352    /// Sends a response to the FIDL transaction.
5353    ///
5354    /// Sets the channel to shutdown if an error occurs.
5355    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5356        let _result = self.send_raw(result);
5357        if _result.is_err() {
5358            self.control_handle.shutdown();
5359        }
5360        self.drop_without_shutdown();
5361        _result
5362    }
5363
5364    /// Similar to "send" but does not shutdown the channel if an error occurs.
5365    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5366        let _result = self.send_raw(result);
5367        self.drop_without_shutdown();
5368        _result
5369    }
5370
5371    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5372        self.control_handle
5373            .inner
5374            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5375                result,
5376                self.tx_id,
5377                0x2c5c27ca0ab5dc49,
5378                fidl::encoding::DynamicFlags::empty(),
5379            )
5380    }
5381}
5382
5383#[must_use = "FIDL methods require a response to be sent"]
5384#[derive(Debug)]
5385pub struct DirectoryGetExtendedAttributeResponder {
5386    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5387    tx_id: u32,
5388}
5389
5390/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5391/// if the responder is dropped without sending a response, so that the client
5392/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5393impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5394    fn drop(&mut self) {
5395        self.control_handle.shutdown();
5396        // Safety: drops once, never accessed again
5397        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5398    }
5399}
5400
5401impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5402    type ControlHandle = DirectoryControlHandle;
5403
5404    fn control_handle(&self) -> &DirectoryControlHandle {
5405        &self.control_handle
5406    }
5407
5408    fn drop_without_shutdown(mut self) {
5409        // Safety: drops once, never accessed again due to mem::forget
5410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5411        // Prevent Drop from running (which would shut down the channel)
5412        std::mem::forget(self);
5413    }
5414}
5415
5416impl DirectoryGetExtendedAttributeResponder {
5417    /// Sends a response to the FIDL transaction.
5418    ///
5419    /// Sets the channel to shutdown if an error occurs.
5420    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5421        let _result = self.send_raw(result);
5422        if _result.is_err() {
5423            self.control_handle.shutdown();
5424        }
5425        self.drop_without_shutdown();
5426        _result
5427    }
5428
5429    /// Similar to "send" but does not shutdown the channel if an error occurs.
5430    pub fn send_no_shutdown_on_err(
5431        self,
5432        mut result: Result<ExtendedAttributeValue, i32>,
5433    ) -> Result<(), fidl::Error> {
5434        let _result = self.send_raw(result);
5435        self.drop_without_shutdown();
5436        _result
5437    }
5438
5439    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5440        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5441            result.as_mut().map_err(|e| *e),
5442            self.tx_id,
5443            0x45ffa3ccfdeb76db,
5444            fidl::encoding::DynamicFlags::empty(),
5445        )
5446    }
5447}
5448
5449#[must_use = "FIDL methods require a response to be sent"]
5450#[derive(Debug)]
5451pub struct DirectorySetExtendedAttributeResponder {
5452    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5453    tx_id: u32,
5454}
5455
5456/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5457/// if the responder is dropped without sending a response, so that the client
5458/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5459impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5460    fn drop(&mut self) {
5461        self.control_handle.shutdown();
5462        // Safety: drops once, never accessed again
5463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5464    }
5465}
5466
5467impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5468    type ControlHandle = DirectoryControlHandle;
5469
5470    fn control_handle(&self) -> &DirectoryControlHandle {
5471        &self.control_handle
5472    }
5473
5474    fn drop_without_shutdown(mut self) {
5475        // Safety: drops once, never accessed again due to mem::forget
5476        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5477        // Prevent Drop from running (which would shut down the channel)
5478        std::mem::forget(self);
5479    }
5480}
5481
5482impl DirectorySetExtendedAttributeResponder {
5483    /// Sends a response to the FIDL transaction.
5484    ///
5485    /// Sets the channel to shutdown if an error occurs.
5486    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5487        let _result = self.send_raw(result);
5488        if _result.is_err() {
5489            self.control_handle.shutdown();
5490        }
5491        self.drop_without_shutdown();
5492        _result
5493    }
5494
5495    /// Similar to "send" but does not shutdown the channel if an error occurs.
5496    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5497        let _result = self.send_raw(result);
5498        self.drop_without_shutdown();
5499        _result
5500    }
5501
5502    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5503        self.control_handle
5504            .inner
5505            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5506                result,
5507                self.tx_id,
5508                0x4a951362f681f23c,
5509                fidl::encoding::DynamicFlags::empty(),
5510            )
5511    }
5512}
5513
5514#[must_use = "FIDL methods require a response to be sent"]
5515#[derive(Debug)]
5516pub struct DirectoryRemoveExtendedAttributeResponder {
5517    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5518    tx_id: u32,
5519}
5520
5521/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5522/// if the responder is dropped without sending a response, so that the client
5523/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5524impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5525    fn drop(&mut self) {
5526        self.control_handle.shutdown();
5527        // Safety: drops once, never accessed again
5528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5529    }
5530}
5531
5532impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5533    type ControlHandle = DirectoryControlHandle;
5534
5535    fn control_handle(&self) -> &DirectoryControlHandle {
5536        &self.control_handle
5537    }
5538
5539    fn drop_without_shutdown(mut self) {
5540        // Safety: drops once, never accessed again due to mem::forget
5541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5542        // Prevent Drop from running (which would shut down the channel)
5543        std::mem::forget(self);
5544    }
5545}
5546
5547impl DirectoryRemoveExtendedAttributeResponder {
5548    /// Sends a response to the FIDL transaction.
5549    ///
5550    /// Sets the channel to shutdown if an error occurs.
5551    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5552        let _result = self.send_raw(result);
5553        if _result.is_err() {
5554            self.control_handle.shutdown();
5555        }
5556        self.drop_without_shutdown();
5557        _result
5558    }
5559
5560    /// Similar to "send" but does not shutdown the channel if an error occurs.
5561    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5562        let _result = self.send_raw(result);
5563        self.drop_without_shutdown();
5564        _result
5565    }
5566
5567    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5568        self.control_handle
5569            .inner
5570            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5571                result,
5572                self.tx_id,
5573                0x7a0b9f3a9bf9032d,
5574                fidl::encoding::DynamicFlags::empty(),
5575            )
5576    }
5577}
5578
5579#[must_use = "FIDL methods require a response to be sent"]
5580#[derive(Debug)]
5581pub struct DirectoryReadDirentsResponder {
5582    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5583    tx_id: u32,
5584}
5585
5586/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5587/// if the responder is dropped without sending a response, so that the client
5588/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5589impl std::ops::Drop for DirectoryReadDirentsResponder {
5590    fn drop(&mut self) {
5591        self.control_handle.shutdown();
5592        // Safety: drops once, never accessed again
5593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5594    }
5595}
5596
5597impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5598    type ControlHandle = DirectoryControlHandle;
5599
5600    fn control_handle(&self) -> &DirectoryControlHandle {
5601        &self.control_handle
5602    }
5603
5604    fn drop_without_shutdown(mut self) {
5605        // Safety: drops once, never accessed again due to mem::forget
5606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5607        // Prevent Drop from running (which would shut down the channel)
5608        std::mem::forget(self);
5609    }
5610}
5611
5612impl DirectoryReadDirentsResponder {
5613    /// Sends a response to the FIDL transaction.
5614    ///
5615    /// Sets the channel to shutdown if an error occurs.
5616    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5617        let _result = self.send_raw(s, dirents);
5618        if _result.is_err() {
5619            self.control_handle.shutdown();
5620        }
5621        self.drop_without_shutdown();
5622        _result
5623    }
5624
5625    /// Similar to "send" but does not shutdown the channel if an error occurs.
5626    pub fn send_no_shutdown_on_err(
5627        self,
5628        mut s: i32,
5629        mut dirents: &[u8],
5630    ) -> Result<(), fidl::Error> {
5631        let _result = self.send_raw(s, dirents);
5632        self.drop_without_shutdown();
5633        _result
5634    }
5635
5636    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5637        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5638            (s, dirents),
5639            self.tx_id,
5640            0x3582806bf27faa0a,
5641            fidl::encoding::DynamicFlags::empty(),
5642        )
5643    }
5644}
5645
5646#[must_use = "FIDL methods require a response to be sent"]
5647#[derive(Debug)]
5648pub struct DirectoryRewindResponder {
5649    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5650    tx_id: u32,
5651}
5652
5653/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5654/// if the responder is dropped without sending a response, so that the client
5655/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5656impl std::ops::Drop for DirectoryRewindResponder {
5657    fn drop(&mut self) {
5658        self.control_handle.shutdown();
5659        // Safety: drops once, never accessed again
5660        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5661    }
5662}
5663
5664impl fidl::endpoints::Responder for DirectoryRewindResponder {
5665    type ControlHandle = DirectoryControlHandle;
5666
5667    fn control_handle(&self) -> &DirectoryControlHandle {
5668        &self.control_handle
5669    }
5670
5671    fn drop_without_shutdown(mut self) {
5672        // Safety: drops once, never accessed again due to mem::forget
5673        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5674        // Prevent Drop from running (which would shut down the channel)
5675        std::mem::forget(self);
5676    }
5677}
5678
5679impl DirectoryRewindResponder {
5680    /// Sends a response to the FIDL transaction.
5681    ///
5682    /// Sets the channel to shutdown if an error occurs.
5683    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5684        let _result = self.send_raw(s);
5685        if _result.is_err() {
5686            self.control_handle.shutdown();
5687        }
5688        self.drop_without_shutdown();
5689        _result
5690    }
5691
5692    /// Similar to "send" but does not shutdown the channel if an error occurs.
5693    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5694        let _result = self.send_raw(s);
5695        self.drop_without_shutdown();
5696        _result
5697    }
5698
5699    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5700        self.control_handle.inner.send::<DirectoryRewindResponse>(
5701            (s,),
5702            self.tx_id,
5703            0x16b1202af0f34c71,
5704            fidl::encoding::DynamicFlags::empty(),
5705        )
5706    }
5707}
5708
5709#[must_use = "FIDL methods require a response to be sent"]
5710#[derive(Debug)]
5711pub struct DirectoryGetTokenResponder {
5712    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5713    tx_id: u32,
5714}
5715
5716/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5717/// if the responder is dropped without sending a response, so that the client
5718/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5719impl std::ops::Drop for DirectoryGetTokenResponder {
5720    fn drop(&mut self) {
5721        self.control_handle.shutdown();
5722        // Safety: drops once, never accessed again
5723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5724    }
5725}
5726
5727impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5728    type ControlHandle = DirectoryControlHandle;
5729
5730    fn control_handle(&self) -> &DirectoryControlHandle {
5731        &self.control_handle
5732    }
5733
5734    fn drop_without_shutdown(mut self) {
5735        // Safety: drops once, never accessed again due to mem::forget
5736        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5737        // Prevent Drop from running (which would shut down the channel)
5738        std::mem::forget(self);
5739    }
5740}
5741
5742impl DirectoryGetTokenResponder {
5743    /// Sends a response to the FIDL transaction.
5744    ///
5745    /// Sets the channel to shutdown if an error occurs.
5746    pub fn send(
5747        self,
5748        mut s: i32,
5749        mut token: Option<fidl::NullableHandle>,
5750    ) -> Result<(), fidl::Error> {
5751        let _result = self.send_raw(s, token);
5752        if _result.is_err() {
5753            self.control_handle.shutdown();
5754        }
5755        self.drop_without_shutdown();
5756        _result
5757    }
5758
5759    /// Similar to "send" but does not shutdown the channel if an error occurs.
5760    pub fn send_no_shutdown_on_err(
5761        self,
5762        mut s: i32,
5763        mut token: Option<fidl::NullableHandle>,
5764    ) -> Result<(), fidl::Error> {
5765        let _result = self.send_raw(s, token);
5766        self.drop_without_shutdown();
5767        _result
5768    }
5769
5770    fn send_raw(
5771        &self,
5772        mut s: i32,
5773        mut token: Option<fidl::NullableHandle>,
5774    ) -> Result<(), fidl::Error> {
5775        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5776            (s, token),
5777            self.tx_id,
5778            0x26ae9d18763c8655,
5779            fidl::encoding::DynamicFlags::empty(),
5780        )
5781    }
5782}
5783
5784#[must_use = "FIDL methods require a response to be sent"]
5785#[derive(Debug)]
5786pub struct DirectoryLinkResponder {
5787    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5788    tx_id: u32,
5789}
5790
5791/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5792/// if the responder is dropped without sending a response, so that the client
5793/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5794impl std::ops::Drop for DirectoryLinkResponder {
5795    fn drop(&mut self) {
5796        self.control_handle.shutdown();
5797        // Safety: drops once, never accessed again
5798        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5799    }
5800}
5801
5802impl fidl::endpoints::Responder for DirectoryLinkResponder {
5803    type ControlHandle = DirectoryControlHandle;
5804
5805    fn control_handle(&self) -> &DirectoryControlHandle {
5806        &self.control_handle
5807    }
5808
5809    fn drop_without_shutdown(mut self) {
5810        // Safety: drops once, never accessed again due to mem::forget
5811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5812        // Prevent Drop from running (which would shut down the channel)
5813        std::mem::forget(self);
5814    }
5815}
5816
5817impl DirectoryLinkResponder {
5818    /// Sends a response to the FIDL transaction.
5819    ///
5820    /// Sets the channel to shutdown if an error occurs.
5821    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5822        let _result = self.send_raw(s);
5823        if _result.is_err() {
5824            self.control_handle.shutdown();
5825        }
5826        self.drop_without_shutdown();
5827        _result
5828    }
5829
5830    /// Similar to "send" but does not shutdown the channel if an error occurs.
5831    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5832        let _result = self.send_raw(s);
5833        self.drop_without_shutdown();
5834        _result
5835    }
5836
5837    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5838        self.control_handle.inner.send::<DirectoryLinkResponse>(
5839            (s,),
5840            self.tx_id,
5841            0x740604c0c7c930e7,
5842            fidl::encoding::DynamicFlags::empty(),
5843        )
5844    }
5845}
5846
5847#[must_use = "FIDL methods require a response to be sent"]
5848#[derive(Debug)]
5849pub struct DirectoryUnlinkResponder {
5850    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5851    tx_id: u32,
5852}
5853
5854/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5855/// if the responder is dropped without sending a response, so that the client
5856/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5857impl std::ops::Drop for DirectoryUnlinkResponder {
5858    fn drop(&mut self) {
5859        self.control_handle.shutdown();
5860        // Safety: drops once, never accessed again
5861        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5862    }
5863}
5864
5865impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5866    type ControlHandle = DirectoryControlHandle;
5867
5868    fn control_handle(&self) -> &DirectoryControlHandle {
5869        &self.control_handle
5870    }
5871
5872    fn drop_without_shutdown(mut self) {
5873        // Safety: drops once, never accessed again due to mem::forget
5874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5875        // Prevent Drop from running (which would shut down the channel)
5876        std::mem::forget(self);
5877    }
5878}
5879
5880impl DirectoryUnlinkResponder {
5881    /// Sends a response to the FIDL transaction.
5882    ///
5883    /// Sets the channel to shutdown if an error occurs.
5884    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5885        let _result = self.send_raw(result);
5886        if _result.is_err() {
5887            self.control_handle.shutdown();
5888        }
5889        self.drop_without_shutdown();
5890        _result
5891    }
5892
5893    /// Similar to "send" but does not shutdown the channel if an error occurs.
5894    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5895        let _result = self.send_raw(result);
5896        self.drop_without_shutdown();
5897        _result
5898    }
5899
5900    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5901        self.control_handle
5902            .inner
5903            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5904                result,
5905                self.tx_id,
5906                0x750a0326a78d7bed,
5907                fidl::encoding::DynamicFlags::empty(),
5908            )
5909    }
5910}
5911
5912#[must_use = "FIDL methods require a response to be sent"]
5913#[derive(Debug)]
5914pub struct DirectoryRenameResponder {
5915    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5916    tx_id: u32,
5917}
5918
5919/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5920/// if the responder is dropped without sending a response, so that the client
5921/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5922impl std::ops::Drop for DirectoryRenameResponder {
5923    fn drop(&mut self) {
5924        self.control_handle.shutdown();
5925        // Safety: drops once, never accessed again
5926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5927    }
5928}
5929
5930impl fidl::endpoints::Responder for DirectoryRenameResponder {
5931    type ControlHandle = DirectoryControlHandle;
5932
5933    fn control_handle(&self) -> &DirectoryControlHandle {
5934        &self.control_handle
5935    }
5936
5937    fn drop_without_shutdown(mut self) {
5938        // Safety: drops once, never accessed again due to mem::forget
5939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5940        // Prevent Drop from running (which would shut down the channel)
5941        std::mem::forget(self);
5942    }
5943}
5944
5945impl DirectoryRenameResponder {
5946    /// Sends a response to the FIDL transaction.
5947    ///
5948    /// Sets the channel to shutdown if an error occurs.
5949    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5950        let _result = self.send_raw(result);
5951        if _result.is_err() {
5952            self.control_handle.shutdown();
5953        }
5954        self.drop_without_shutdown();
5955        _result
5956    }
5957
5958    /// Similar to "send" but does not shutdown the channel if an error occurs.
5959    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5960        let _result = self.send_raw(result);
5961        self.drop_without_shutdown();
5962        _result
5963    }
5964
5965    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5966        self.control_handle
5967            .inner
5968            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5969                result,
5970                self.tx_id,
5971                0x7060e7723b9928de,
5972                fidl::encoding::DynamicFlags::empty(),
5973            )
5974    }
5975}
5976
5977#[must_use = "FIDL methods require a response to be sent"]
5978#[derive(Debug)]
5979pub struct DirectoryCreateSymlinkResponder {
5980    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5981    tx_id: u32,
5982}
5983
5984/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5985/// if the responder is dropped without sending a response, so that the client
5986/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5987impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5988    fn drop(&mut self) {
5989        self.control_handle.shutdown();
5990        // Safety: drops once, never accessed again
5991        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5992    }
5993}
5994
5995impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5996    type ControlHandle = DirectoryControlHandle;
5997
5998    fn control_handle(&self) -> &DirectoryControlHandle {
5999        &self.control_handle
6000    }
6001
6002    fn drop_without_shutdown(mut self) {
6003        // Safety: drops once, never accessed again due to mem::forget
6004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6005        // Prevent Drop from running (which would shut down the channel)
6006        std::mem::forget(self);
6007    }
6008}
6009
6010impl DirectoryCreateSymlinkResponder {
6011    /// Sends a response to the FIDL transaction.
6012    ///
6013    /// Sets the channel to shutdown if an error occurs.
6014    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6015        let _result = self.send_raw(result);
6016        if _result.is_err() {
6017            self.control_handle.shutdown();
6018        }
6019        self.drop_without_shutdown();
6020        _result
6021    }
6022
6023    /// Similar to "send" but does not shutdown the channel if an error occurs.
6024    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6025        let _result = self.send_raw(result);
6026        self.drop_without_shutdown();
6027        _result
6028    }
6029
6030    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6031        self.control_handle
6032            .inner
6033            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6034                result,
6035                self.tx_id,
6036                0x21ce0f19ec043889,
6037                fidl::encoding::DynamicFlags::empty(),
6038            )
6039    }
6040}
6041
6042#[must_use = "FIDL methods require a response to be sent"]
6043#[derive(Debug)]
6044pub struct DirectoryWatchResponder {
6045    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6046    tx_id: u32,
6047}
6048
6049/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6050/// if the responder is dropped without sending a response, so that the client
6051/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6052impl std::ops::Drop for DirectoryWatchResponder {
6053    fn drop(&mut self) {
6054        self.control_handle.shutdown();
6055        // Safety: drops once, never accessed again
6056        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6057    }
6058}
6059
6060impl fidl::endpoints::Responder for DirectoryWatchResponder {
6061    type ControlHandle = DirectoryControlHandle;
6062
6063    fn control_handle(&self) -> &DirectoryControlHandle {
6064        &self.control_handle
6065    }
6066
6067    fn drop_without_shutdown(mut self) {
6068        // Safety: drops once, never accessed again due to mem::forget
6069        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6070        // Prevent Drop from running (which would shut down the channel)
6071        std::mem::forget(self);
6072    }
6073}
6074
6075impl DirectoryWatchResponder {
6076    /// Sends a response to the FIDL transaction.
6077    ///
6078    /// Sets the channel to shutdown if an error occurs.
6079    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6080        let _result = self.send_raw(s);
6081        if _result.is_err() {
6082            self.control_handle.shutdown();
6083        }
6084        self.drop_without_shutdown();
6085        _result
6086    }
6087
6088    /// Similar to "send" but does not shutdown the channel if an error occurs.
6089    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6090        let _result = self.send_raw(s);
6091        self.drop_without_shutdown();
6092        _result
6093    }
6094
6095    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6096        self.control_handle.inner.send::<DirectoryWatchResponse>(
6097            (s,),
6098            self.tx_id,
6099            0x5717193a59d66d91,
6100            fidl::encoding::DynamicFlags::empty(),
6101        )
6102    }
6103}
6104
6105#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6106pub struct DirectoryWatcherMarker;
6107
6108impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6109    type Proxy = DirectoryWatcherProxy;
6110    type RequestStream = DirectoryWatcherRequestStream;
6111    #[cfg(target_os = "fuchsia")]
6112    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6113
6114    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6115}
6116
6117pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6118#[derive(Debug)]
6119#[cfg(target_os = "fuchsia")]
6120pub struct DirectoryWatcherSynchronousProxy {
6121    client: fidl::client::sync::Client,
6122}
6123
6124#[cfg(target_os = "fuchsia")]
6125impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6126    type Proxy = DirectoryWatcherProxy;
6127    type Protocol = DirectoryWatcherMarker;
6128
6129    fn from_channel(inner: fidl::Channel) -> Self {
6130        Self::new(inner)
6131    }
6132
6133    fn into_channel(self) -> fidl::Channel {
6134        self.client.into_channel()
6135    }
6136
6137    fn as_channel(&self) -> &fidl::Channel {
6138        self.client.as_channel()
6139    }
6140}
6141
6142#[cfg(target_os = "fuchsia")]
6143impl DirectoryWatcherSynchronousProxy {
6144    pub fn new(channel: fidl::Channel) -> Self {
6145        Self { client: fidl::client::sync::Client::new(channel) }
6146    }
6147
6148    pub fn into_channel(self) -> fidl::Channel {
6149        self.client.into_channel()
6150    }
6151
6152    /// Waits until an event arrives and returns it. It is safe for other
6153    /// threads to make concurrent requests while waiting for an event.
6154    pub fn wait_for_event(
6155        &self,
6156        deadline: zx::MonotonicInstant,
6157    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6158        DirectoryWatcherEvent::decode(
6159            self.client.wait_for_event::<DirectoryWatcherMarker>(deadline)?,
6160        )
6161    }
6162}
6163
6164#[cfg(target_os = "fuchsia")]
6165impl From<DirectoryWatcherSynchronousProxy> for zx::NullableHandle {
6166    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6167        value.into_channel().into()
6168    }
6169}
6170
6171#[cfg(target_os = "fuchsia")]
6172impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6173    fn from(value: fidl::Channel) -> Self {
6174        Self::new(value)
6175    }
6176}
6177
6178#[cfg(target_os = "fuchsia")]
6179impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6180    type Protocol = DirectoryWatcherMarker;
6181
6182    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6183        Self::new(value.into_channel())
6184    }
6185}
6186
6187#[derive(Debug, Clone)]
6188pub struct DirectoryWatcherProxy {
6189    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6190}
6191
6192impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6193    type Protocol = DirectoryWatcherMarker;
6194
6195    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6196        Self::new(inner)
6197    }
6198
6199    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6200        self.client.into_channel().map_err(|client| Self { client })
6201    }
6202
6203    fn as_channel(&self) -> &::fidl::AsyncChannel {
6204        self.client.as_channel()
6205    }
6206}
6207
6208impl DirectoryWatcherProxy {
6209    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6210    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6211        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6212        Self { client: fidl::client::Client::new(channel, protocol_name) }
6213    }
6214
6215    /// Get a Stream of events from the remote end of the protocol.
6216    ///
6217    /// # Panics
6218    ///
6219    /// Panics if the event stream was already taken.
6220    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6221        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6222    }
6223}
6224
6225impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6226
6227pub struct DirectoryWatcherEventStream {
6228    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6229}
6230
6231impl std::marker::Unpin for DirectoryWatcherEventStream {}
6232
6233impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6234    fn is_terminated(&self) -> bool {
6235        self.event_receiver.is_terminated()
6236    }
6237}
6238
6239impl futures::Stream for DirectoryWatcherEventStream {
6240    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6241
6242    fn poll_next(
6243        mut self: std::pin::Pin<&mut Self>,
6244        cx: &mut std::task::Context<'_>,
6245    ) -> std::task::Poll<Option<Self::Item>> {
6246        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6247            &mut self.event_receiver,
6248            cx
6249        )?) {
6250            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6251            None => std::task::Poll::Ready(None),
6252        }
6253    }
6254}
6255
6256#[derive(Debug)]
6257pub enum DirectoryWatcherEvent {}
6258
6259impl DirectoryWatcherEvent {
6260    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6261    fn decode(
6262        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6263    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6264        let (bytes, _handles) = buf.split_mut();
6265        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6266        debug_assert_eq!(tx_header.tx_id, 0);
6267        match tx_header.ordinal {
6268            _ => Err(fidl::Error::UnknownOrdinal {
6269                ordinal: tx_header.ordinal,
6270                protocol_name:
6271                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6272            }),
6273        }
6274    }
6275}
6276
6277/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6278pub struct DirectoryWatcherRequestStream {
6279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6280    is_terminated: bool,
6281}
6282
6283impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6284
6285impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6286    fn is_terminated(&self) -> bool {
6287        self.is_terminated
6288    }
6289}
6290
6291impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6292    type Protocol = DirectoryWatcherMarker;
6293    type ControlHandle = DirectoryWatcherControlHandle;
6294
6295    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6296        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6297    }
6298
6299    fn control_handle(&self) -> Self::ControlHandle {
6300        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6301    }
6302
6303    fn into_inner(
6304        self,
6305    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6306    {
6307        (self.inner, self.is_terminated)
6308    }
6309
6310    fn from_inner(
6311        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6312        is_terminated: bool,
6313    ) -> Self {
6314        Self { inner, is_terminated }
6315    }
6316}
6317
6318impl futures::Stream for DirectoryWatcherRequestStream {
6319    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6320
6321    fn poll_next(
6322        mut self: std::pin::Pin<&mut Self>,
6323        cx: &mut std::task::Context<'_>,
6324    ) -> std::task::Poll<Option<Self::Item>> {
6325        let this = &mut *self;
6326        if this.inner.check_shutdown(cx) {
6327            this.is_terminated = true;
6328            return std::task::Poll::Ready(None);
6329        }
6330        if this.is_terminated {
6331            panic!("polled DirectoryWatcherRequestStream after completion");
6332        }
6333        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6334            |bytes, handles| {
6335                match this.inner.channel().read_etc(cx, bytes, handles) {
6336                    std::task::Poll::Ready(Ok(())) => {}
6337                    std::task::Poll::Pending => return std::task::Poll::Pending,
6338                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6339                        this.is_terminated = true;
6340                        return std::task::Poll::Ready(None);
6341                    }
6342                    std::task::Poll::Ready(Err(e)) => {
6343                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6344                            e.into(),
6345                        ))));
6346                    }
6347                }
6348
6349                // A message has been received from the channel
6350                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6351
6352                std::task::Poll::Ready(Some(match header.ordinal {
6353                    _ => Err(fidl::Error::UnknownOrdinal {
6354                        ordinal: header.ordinal,
6355                        protocol_name:
6356                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6357                    }),
6358                }))
6359            },
6360        )
6361    }
6362}
6363
6364/// DirectoryWatcher transmits messages from a filesystem server
6365/// about events happening in the filesystem. Clients can register
6366/// new watchers using the `Directory.Watch` method, where they can
6367/// filter which events they want to receive notifications for.
6368///
6369/// The DirectoryWatcher will send messages of the form:
6370/// ```
6371/// struct {
6372///   uint8 event;
6373///   uint8 len;
6374///   char name[];
6375/// };
6376/// ```
6377/// Where names are NOT null-terminated. The name is the relative
6378/// path to the entry the event is refering to. It will be empty if
6379/// the event isn't referencing a particular entry (e.g. for the
6380/// `IDLE` event).
6381#[derive(Debug)]
6382pub enum DirectoryWatcherRequest {}
6383
6384impl DirectoryWatcherRequest {
6385    /// Name of the method defined in FIDL
6386    pub fn method_name(&self) -> &'static str {
6387        match *self {}
6388    }
6389}
6390
6391#[derive(Debug, Clone)]
6392pub struct DirectoryWatcherControlHandle {
6393    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6394}
6395
6396impl DirectoryWatcherControlHandle {
6397    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6398        self.inner.shutdown_with_epitaph(status.into())
6399    }
6400}
6401
6402impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6403    fn shutdown(&self) {
6404        self.inner.shutdown()
6405    }
6406
6407    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6408        self.inner.shutdown_with_epitaph(status)
6409    }
6410
6411    fn is_closed(&self) -> bool {
6412        self.inner.channel().is_closed()
6413    }
6414    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6415        self.inner.channel().on_closed()
6416    }
6417
6418    #[cfg(target_os = "fuchsia")]
6419    fn signal_peer(
6420        &self,
6421        clear_mask: zx::Signals,
6422        set_mask: zx::Signals,
6423    ) -> Result<(), zx_status::Status> {
6424        use fidl::Peered;
6425        self.inner.channel().signal_peer(clear_mask, set_mask)
6426    }
6427}
6428
6429impl DirectoryWatcherControlHandle {}
6430
6431#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6432pub struct ExtendedAttributeIteratorMarker;
6433
6434impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6435    type Proxy = ExtendedAttributeIteratorProxy;
6436    type RequestStream = ExtendedAttributeIteratorRequestStream;
6437    #[cfg(target_os = "fuchsia")]
6438    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6439
6440    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6441}
6442pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6443
6444pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6445    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6446        + Send;
6447    fn r#get_next(&self) -> Self::GetNextResponseFut;
6448}
6449#[derive(Debug)]
6450#[cfg(target_os = "fuchsia")]
6451pub struct ExtendedAttributeIteratorSynchronousProxy {
6452    client: fidl::client::sync::Client,
6453}
6454
6455#[cfg(target_os = "fuchsia")]
6456impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6457    type Proxy = ExtendedAttributeIteratorProxy;
6458    type Protocol = ExtendedAttributeIteratorMarker;
6459
6460    fn from_channel(inner: fidl::Channel) -> Self {
6461        Self::new(inner)
6462    }
6463
6464    fn into_channel(self) -> fidl::Channel {
6465        self.client.into_channel()
6466    }
6467
6468    fn as_channel(&self) -> &fidl::Channel {
6469        self.client.as_channel()
6470    }
6471}
6472
6473#[cfg(target_os = "fuchsia")]
6474impl ExtendedAttributeIteratorSynchronousProxy {
6475    pub fn new(channel: fidl::Channel) -> Self {
6476        Self { client: fidl::client::sync::Client::new(channel) }
6477    }
6478
6479    pub fn into_channel(self) -> fidl::Channel {
6480        self.client.into_channel()
6481    }
6482
6483    /// Waits until an event arrives and returns it. It is safe for other
6484    /// threads to make concurrent requests while waiting for an event.
6485    pub fn wait_for_event(
6486        &self,
6487        deadline: zx::MonotonicInstant,
6488    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6489        ExtendedAttributeIteratorEvent::decode(
6490            self.client.wait_for_event::<ExtendedAttributeIteratorMarker>(deadline)?,
6491        )
6492    }
6493
6494    /// Get the next chunk of extended attribute names. If this is the last
6495    /// chunk, last will be true, and the channel will be closed after the
6496    /// call.
6497    pub fn r#get_next(
6498        &self,
6499        ___deadline: zx::MonotonicInstant,
6500    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6501        let _response = self.client.send_query::<
6502            fidl::encoding::EmptyPayload,
6503            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6504            ExtendedAttributeIteratorMarker,
6505        >(
6506            (),
6507            0x3ba664a1c2e45a7,
6508            fidl::encoding::DynamicFlags::empty(),
6509            ___deadline,
6510        )?;
6511        Ok(_response.map(|x| (x.attributes, x.last)))
6512    }
6513}
6514
6515#[cfg(target_os = "fuchsia")]
6516impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::NullableHandle {
6517    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6518        value.into_channel().into()
6519    }
6520}
6521
6522#[cfg(target_os = "fuchsia")]
6523impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6524    fn from(value: fidl::Channel) -> Self {
6525        Self::new(value)
6526    }
6527}
6528
6529#[cfg(target_os = "fuchsia")]
6530impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6531    type Protocol = ExtendedAttributeIteratorMarker;
6532
6533    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6534        Self::new(value.into_channel())
6535    }
6536}
6537
6538#[derive(Debug, Clone)]
6539pub struct ExtendedAttributeIteratorProxy {
6540    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6541}
6542
6543impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6544    type Protocol = ExtendedAttributeIteratorMarker;
6545
6546    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6547        Self::new(inner)
6548    }
6549
6550    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6551        self.client.into_channel().map_err(|client| Self { client })
6552    }
6553
6554    fn as_channel(&self) -> &::fidl::AsyncChannel {
6555        self.client.as_channel()
6556    }
6557}
6558
6559impl ExtendedAttributeIteratorProxy {
6560    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6561    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6562        let protocol_name =
6563            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6564        Self { client: fidl::client::Client::new(channel, protocol_name) }
6565    }
6566
6567    /// Get a Stream of events from the remote end of the protocol.
6568    ///
6569    /// # Panics
6570    ///
6571    /// Panics if the event stream was already taken.
6572    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6573        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6574    }
6575
6576    /// Get the next chunk of extended attribute names. If this is the last
6577    /// chunk, last will be true, and the channel will be closed after the
6578    /// call.
6579    pub fn r#get_next(
6580        &self,
6581    ) -> fidl::client::QueryResponseFut<
6582        ExtendedAttributeIteratorGetNextResult,
6583        fidl::encoding::DefaultFuchsiaResourceDialect,
6584    > {
6585        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6586    }
6587}
6588
6589impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6590    type GetNextResponseFut = fidl::client::QueryResponseFut<
6591        ExtendedAttributeIteratorGetNextResult,
6592        fidl::encoding::DefaultFuchsiaResourceDialect,
6593    >;
6594    fn r#get_next(&self) -> Self::GetNextResponseFut {
6595        fn _decode(
6596            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6597        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6598            let _response = fidl::client::decode_transaction_body::<
6599                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6600                fidl::encoding::DefaultFuchsiaResourceDialect,
6601                0x3ba664a1c2e45a7,
6602            >(_buf?)?;
6603            Ok(_response.map(|x| (x.attributes, x.last)))
6604        }
6605        self.client.send_query_and_decode::<
6606            fidl::encoding::EmptyPayload,
6607            ExtendedAttributeIteratorGetNextResult,
6608        >(
6609            (),
6610            0x3ba664a1c2e45a7,
6611            fidl::encoding::DynamicFlags::empty(),
6612            _decode,
6613        )
6614    }
6615}
6616
6617pub struct ExtendedAttributeIteratorEventStream {
6618    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6619}
6620
6621impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6622
6623impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6624    fn is_terminated(&self) -> bool {
6625        self.event_receiver.is_terminated()
6626    }
6627}
6628
6629impl futures::Stream for ExtendedAttributeIteratorEventStream {
6630    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6631
6632    fn poll_next(
6633        mut self: std::pin::Pin<&mut Self>,
6634        cx: &mut std::task::Context<'_>,
6635    ) -> std::task::Poll<Option<Self::Item>> {
6636        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6637            &mut self.event_receiver,
6638            cx
6639        )?) {
6640            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6641            None => std::task::Poll::Ready(None),
6642        }
6643    }
6644}
6645
6646#[derive(Debug)]
6647pub enum ExtendedAttributeIteratorEvent {}
6648
6649impl ExtendedAttributeIteratorEvent {
6650    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6651    fn decode(
6652        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6653    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6654        let (bytes, _handles) = buf.split_mut();
6655        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6656        debug_assert_eq!(tx_header.tx_id, 0);
6657        match tx_header.ordinal {
6658            _ => Err(fidl::Error::UnknownOrdinal {
6659                ordinal: tx_header.ordinal,
6660                protocol_name:
6661                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6662            }),
6663        }
6664    }
6665}
6666
6667/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6668pub struct ExtendedAttributeIteratorRequestStream {
6669    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6670    is_terminated: bool,
6671}
6672
6673impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6674
6675impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6676    fn is_terminated(&self) -> bool {
6677        self.is_terminated
6678    }
6679}
6680
6681impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6682    type Protocol = ExtendedAttributeIteratorMarker;
6683    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6684
6685    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6686        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6687    }
6688
6689    fn control_handle(&self) -> Self::ControlHandle {
6690        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6691    }
6692
6693    fn into_inner(
6694        self,
6695    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6696    {
6697        (self.inner, self.is_terminated)
6698    }
6699
6700    fn from_inner(
6701        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6702        is_terminated: bool,
6703    ) -> Self {
6704        Self { inner, is_terminated }
6705    }
6706}
6707
6708impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6709    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6710
6711    fn poll_next(
6712        mut self: std::pin::Pin<&mut Self>,
6713        cx: &mut std::task::Context<'_>,
6714    ) -> std::task::Poll<Option<Self::Item>> {
6715        let this = &mut *self;
6716        if this.inner.check_shutdown(cx) {
6717            this.is_terminated = true;
6718            return std::task::Poll::Ready(None);
6719        }
6720        if this.is_terminated {
6721            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6722        }
6723        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6724            |bytes, handles| {
6725                match this.inner.channel().read_etc(cx, bytes, handles) {
6726                    std::task::Poll::Ready(Ok(())) => {}
6727                    std::task::Poll::Pending => return std::task::Poll::Pending,
6728                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6729                        this.is_terminated = true;
6730                        return std::task::Poll::Ready(None);
6731                    }
6732                    std::task::Poll::Ready(Err(e)) => {
6733                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6734                            e.into(),
6735                        ))));
6736                    }
6737                }
6738
6739                // A message has been received from the channel
6740                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6741
6742                std::task::Poll::Ready(Some(match header.ordinal {
6743                0x3ba664a1c2e45a7 => {
6744                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6745                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6746                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6747                    let control_handle = ExtendedAttributeIteratorControlHandle {
6748                        inner: this.inner.clone(),
6749                    };
6750                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6751                        responder: ExtendedAttributeIteratorGetNextResponder {
6752                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6753                            tx_id: header.tx_id,
6754                        },
6755                    })
6756                }
6757                _ => Err(fidl::Error::UnknownOrdinal {
6758                    ordinal: header.ordinal,
6759                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6760                }),
6761            }))
6762            },
6763        )
6764    }
6765}
6766
6767#[derive(Debug)]
6768pub enum ExtendedAttributeIteratorRequest {
6769    /// Get the next chunk of extended attribute names. If this is the last
6770    /// chunk, last will be true, and the channel will be closed after the
6771    /// call.
6772    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6773}
6774
6775impl ExtendedAttributeIteratorRequest {
6776    #[allow(irrefutable_let_patterns)]
6777    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6778        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6779            Some((responder))
6780        } else {
6781            None
6782        }
6783    }
6784
6785    /// Name of the method defined in FIDL
6786    pub fn method_name(&self) -> &'static str {
6787        match *self {
6788            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6789        }
6790    }
6791}
6792
6793#[derive(Debug, Clone)]
6794pub struct ExtendedAttributeIteratorControlHandle {
6795    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6796}
6797
6798impl ExtendedAttributeIteratorControlHandle {
6799    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6800        self.inner.shutdown_with_epitaph(status.into())
6801    }
6802}
6803
6804impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6805    fn shutdown(&self) {
6806        self.inner.shutdown()
6807    }
6808
6809    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6810        self.inner.shutdown_with_epitaph(status)
6811    }
6812
6813    fn is_closed(&self) -> bool {
6814        self.inner.channel().is_closed()
6815    }
6816    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6817        self.inner.channel().on_closed()
6818    }
6819
6820    #[cfg(target_os = "fuchsia")]
6821    fn signal_peer(
6822        &self,
6823        clear_mask: zx::Signals,
6824        set_mask: zx::Signals,
6825    ) -> Result<(), zx_status::Status> {
6826        use fidl::Peered;
6827        self.inner.channel().signal_peer(clear_mask, set_mask)
6828    }
6829}
6830
6831impl ExtendedAttributeIteratorControlHandle {}
6832
6833#[must_use = "FIDL methods require a response to be sent"]
6834#[derive(Debug)]
6835pub struct ExtendedAttributeIteratorGetNextResponder {
6836    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6837    tx_id: u32,
6838}
6839
6840/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6841/// if the responder is dropped without sending a response, so that the client
6842/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6843impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6844    fn drop(&mut self) {
6845        self.control_handle.shutdown();
6846        // Safety: drops once, never accessed again
6847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6848    }
6849}
6850
6851impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6852    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6853
6854    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6855        &self.control_handle
6856    }
6857
6858    fn drop_without_shutdown(mut self) {
6859        // Safety: drops once, never accessed again due to mem::forget
6860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6861        // Prevent Drop from running (which would shut down the channel)
6862        std::mem::forget(self);
6863    }
6864}
6865
6866impl ExtendedAttributeIteratorGetNextResponder {
6867    /// Sends a response to the FIDL transaction.
6868    ///
6869    /// Sets the channel to shutdown if an error occurs.
6870    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6871        let _result = self.send_raw(result);
6872        if _result.is_err() {
6873            self.control_handle.shutdown();
6874        }
6875        self.drop_without_shutdown();
6876        _result
6877    }
6878
6879    /// Similar to "send" but does not shutdown the channel if an error occurs.
6880    pub fn send_no_shutdown_on_err(
6881        self,
6882        mut result: Result<(&[Vec<u8>], bool), i32>,
6883    ) -> Result<(), fidl::Error> {
6884        let _result = self.send_raw(result);
6885        self.drop_without_shutdown();
6886        _result
6887    }
6888
6889    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6890        self.control_handle.inner.send::<fidl::encoding::ResultType<
6891            ExtendedAttributeIteratorGetNextResponse,
6892            i32,
6893        >>(
6894            result,
6895            self.tx_id,
6896            0x3ba664a1c2e45a7,
6897            fidl::encoding::DynamicFlags::empty(),
6898        )
6899    }
6900}
6901
6902#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6903pub struct FileMarker;
6904
6905impl fidl::endpoints::ProtocolMarker for FileMarker {
6906    type Proxy = FileProxy;
6907    type RequestStream = FileRequestStream;
6908    #[cfg(target_os = "fuchsia")]
6909    type SynchronousProxy = FileSynchronousProxy;
6910
6911    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6912}
6913impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6914pub type FileSeekResult = Result<u64, i32>;
6915pub type FileReadAtResult = Result<Vec<u8>, i32>;
6916pub type FileWriteAtResult = Result<u64, i32>;
6917pub type FileResizeResult = Result<(), i32>;
6918pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6919pub type FileAllocateResult = Result<(), i32>;
6920pub type FileEnableVerityResult = Result<(), i32>;
6921
6922pub trait FileProxyInterface: Send + Sync {
6923    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6924        + Send;
6925    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6926    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6927        + Send;
6928    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6929    fn r#clone(
6930        &self,
6931        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6932    ) -> Result<(), fidl::Error>;
6933    type CloseResponseFut: std::future::Future<
6934            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6935        > + Send;
6936    fn r#close(&self) -> Self::CloseResponseFut;
6937    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6938    fn r#query(&self) -> Self::QueryResponseFut;
6939    fn r#deprecated_clone(
6940        &self,
6941        flags: OpenFlags,
6942        object: fidl::endpoints::ServerEnd<NodeMarker>,
6943    ) -> Result<(), fidl::Error>;
6944    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6945        + Send;
6946    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
6947    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6948    fn r#deprecated_set_attr(
6949        &self,
6950        flags: NodeAttributeFlags,
6951        attributes: &NodeAttributes,
6952    ) -> Self::DeprecatedSetAttrResponseFut;
6953    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6954        + Send;
6955    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6956    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6957        + Send;
6958    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6959    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6960        + Send;
6961    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6962    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6963        + Send;
6964    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6965    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6966        + Send;
6967    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6968    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6969        + Send;
6970    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6971    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6972        + Send;
6973    fn r#update_attributes(
6974        &self,
6975        payload: &MutableNodeAttributes,
6976    ) -> Self::UpdateAttributesResponseFut;
6977    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6978    fn r#sync(&self) -> Self::SyncResponseFut;
6979    fn r#list_extended_attributes(
6980        &self,
6981        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6982    ) -> Result<(), fidl::Error>;
6983    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6984        + Send;
6985    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6986    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6987        + Send;
6988    fn r#set_extended_attribute(
6989        &self,
6990        name: &[u8],
6991        value: ExtendedAttributeValue,
6992        mode: SetExtendedAttributeMode,
6993    ) -> Self::SetExtendedAttributeResponseFut;
6994    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6995        + Send;
6996    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6997    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6998        + Send;
6999    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
7000    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
7001        + Send;
7002    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
7003    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
7004    fn r#describe(&self) -> Self::DescribeResponseFut;
7005    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
7006    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
7007    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
7008        + Send;
7009    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
7010    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
7011        + Send;
7012    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
7013    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
7014        + Send;
7015    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
7016    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
7017        + Send;
7018    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
7019    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
7020        + Send;
7021    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
7022    -> Self::AllocateResponseFut;
7023    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
7024        + Send;
7025    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
7026}
7027#[derive(Debug)]
7028#[cfg(target_os = "fuchsia")]
7029pub struct FileSynchronousProxy {
7030    client: fidl::client::sync::Client,
7031}
7032
7033#[cfg(target_os = "fuchsia")]
7034impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
7035    type Proxy = FileProxy;
7036    type Protocol = FileMarker;
7037
7038    fn from_channel(inner: fidl::Channel) -> Self {
7039        Self::new(inner)
7040    }
7041
7042    fn into_channel(self) -> fidl::Channel {
7043        self.client.into_channel()
7044    }
7045
7046    fn as_channel(&self) -> &fidl::Channel {
7047        self.client.as_channel()
7048    }
7049}
7050
7051#[cfg(target_os = "fuchsia")]
7052impl FileSynchronousProxy {
7053    pub fn new(channel: fidl::Channel) -> Self {
7054        Self { client: fidl::client::sync::Client::new(channel) }
7055    }
7056
7057    pub fn into_channel(self) -> fidl::Channel {
7058        self.client.into_channel()
7059    }
7060
7061    /// Waits until an event arrives and returns it. It is safe for other
7062    /// threads to make concurrent requests while waiting for an event.
7063    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
7064        FileEvent::decode(self.client.wait_for_event::<FileMarker>(deadline)?)
7065    }
7066
7067    /// Acquires an advisory lock on the underlying file.
7068    ///
7069    /// The lock lasts until either this connection is closed or
7070    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7071    /// explicitly.
7072    ///
7073    /// Advisory locks are purely advisory. They do not prevent actual read or
7074    /// write operations from occurring on the file, either through this
7075    /// connection or through other connections.
7076    ///
7077    /// This method requires the following rights:
7078    ///
7079    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7080    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7081    ///   [`AdvisoryLockType.WRITE`].
7082    ///
7083    /// # Errors
7084    ///
7085    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7086    ///   example, another connection might hold a conflicting lock type.
7087    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7088    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7089    ///   to acquire the given type of lock.
7090    pub fn r#advisory_lock(
7091        &self,
7092        mut request: &AdvisoryLockRequest,
7093        ___deadline: zx::MonotonicInstant,
7094    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7095        let _response = self.client.send_query::<
7096            AdvisoryLockingAdvisoryLockRequest,
7097            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7098            FileMarker,
7099        >(
7100            (request,),
7101            0x6ee9c0ad53ec87aa,
7102            fidl::encoding::DynamicFlags::empty(),
7103            ___deadline,
7104        )?;
7105        Ok(_response.map(|x| x))
7106    }
7107
7108    /// Creates a link to this this object with name `dst` in the directory represented by
7109    /// `dst_parent_token`.
7110    ///
7111    /// `dst` must be a resolved object name. Including "/" in the string will return
7112    /// `ZX_ERR_INVALID_ARGS`.
7113    ///
7114    /// This method requires the maximal set of rights supported by the filesystem for this object.
7115    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7116    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7117    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7118    /// `ZX_ERR_ACCESS_DENIED`.
7119    ///
7120    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7121    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7122    ///
7123    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7124    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7125    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7126    ///
7127    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7128    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7129    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7130    pub fn r#link_into(
7131        &self,
7132        mut dst_parent_token: fidl::Event,
7133        mut dst: &str,
7134        ___deadline: zx::MonotonicInstant,
7135    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7136        let _response = self.client.send_query::<
7137            LinkableLinkIntoRequest,
7138            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7139            FileMarker,
7140        >(
7141            (dst_parent_token, dst,),
7142            0x54f3949246a03e74,
7143            fidl::encoding::DynamicFlags::empty(),
7144            ___deadline,
7145        )?;
7146        Ok(_response.map(|x| x))
7147    }
7148
7149    pub fn r#clone(
7150        &self,
7151        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7152    ) -> Result<(), fidl::Error> {
7153        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7154            (request,),
7155            0x20d8a7aba2168a79,
7156            fidl::encoding::DynamicFlags::empty(),
7157        )
7158    }
7159
7160    /// Terminates the connection.
7161    ///
7162    /// After calling `Close`, the client must not send any other requests.
7163    ///
7164    /// Servers, after sending the status response, should close the connection
7165    /// regardless of status and without sending an epitaph.
7166    ///
7167    /// Closing the client end of the channel should be semantically equivalent
7168    /// to calling `Close` without knowing when the close has completed or its
7169    /// status.
7170    pub fn r#close(
7171        &self,
7172        ___deadline: zx::MonotonicInstant,
7173    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7174        let _response = self.client.send_query::<
7175            fidl::encoding::EmptyPayload,
7176            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7177            FileMarker,
7178        >(
7179            (),
7180            0x5ac5d459ad7f657e,
7181            fidl::encoding::DynamicFlags::empty(),
7182            ___deadline,
7183        )?;
7184        Ok(_response.map(|x| x))
7185    }
7186
7187    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7188        let _response = self.client.send_query::<
7189            fidl::encoding::EmptyPayload,
7190            fidl_fuchsia_unknown::QueryableQueryResponse,
7191            FileMarker,
7192        >(
7193            (),
7194            0x2658edee9decfc06,
7195            fidl::encoding::DynamicFlags::empty(),
7196            ___deadline,
7197        )?;
7198        Ok(_response.protocol)
7199    }
7200
7201    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7202    pub fn r#deprecated_clone(
7203        &self,
7204        mut flags: OpenFlags,
7205        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7206    ) -> Result<(), fidl::Error> {
7207        self.client.send::<NodeDeprecatedCloneRequest>(
7208            (flags, object),
7209            0x5a61678f293ce16f,
7210            fidl::encoding::DynamicFlags::FLEXIBLE,
7211        )
7212    }
7213
7214    /// DEPRECATED - Use `Node.GetAttributes` instead.
7215    ///
7216    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7217    pub fn r#deprecated_get_attr(
7218        &self,
7219        ___deadline: zx::MonotonicInstant,
7220    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7221        let _response = self
7222            .client
7223            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, FileMarker>(
7224                (),
7225                0x78985e216314dafd,
7226                fidl::encoding::DynamicFlags::empty(),
7227                ___deadline,
7228            )?;
7229        Ok((_response.s, _response.attributes))
7230    }
7231
7232    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7233    pub fn r#deprecated_set_attr(
7234        &self,
7235        mut flags: NodeAttributeFlags,
7236        mut attributes: &NodeAttributes,
7237        ___deadline: zx::MonotonicInstant,
7238    ) -> Result<i32, fidl::Error> {
7239        let _response = self
7240            .client
7241            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, FileMarker>(
7242                (flags, attributes),
7243                0x4186c0f40d938f46,
7244                fidl::encoding::DynamicFlags::empty(),
7245                ___deadline,
7246            )?;
7247        Ok(_response.s)
7248    }
7249
7250    /// [DEPRECATED - Use new GetFlags method instead.]
7251    pub fn r#deprecated_get_flags(
7252        &self,
7253        ___deadline: zx::MonotonicInstant,
7254    ) -> Result<(i32, OpenFlags), fidl::Error> {
7255        let _response = self
7256            .client
7257            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, FileMarker>(
7258                (),
7259                0x5b88fffb8eda3aa1,
7260                fidl::encoding::DynamicFlags::empty(),
7261                ___deadline,
7262            )?;
7263        Ok((_response.s, _response.flags))
7264    }
7265
7266    /// [DEPRECATED - Use new SetFlags method instead.]
7267    pub fn r#deprecated_set_flags(
7268        &self,
7269        mut flags: OpenFlags,
7270        ___deadline: zx::MonotonicInstant,
7271    ) -> Result<i32, fidl::Error> {
7272        let _response = self.client.send_query::<
7273            NodeDeprecatedSetFlagsRequest,
7274            NodeDeprecatedSetFlagsResponse,
7275            FileMarker,
7276        >(
7277            (flags,),
7278            0x5295b76c71fde733,
7279            fidl::encoding::DynamicFlags::empty(),
7280            ___deadline,
7281        )?;
7282        Ok(_response.s)
7283    }
7284
7285    /// Queries the flags that apply to this node after it has been opened/created. This method does
7286    /// not require any rights.
7287    ///
7288    /// Note that the final set of flags that apply to the connection may differ from those
7289    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7290    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7291    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7292    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7293    pub fn r#get_flags(
7294        &self,
7295        ___deadline: zx::MonotonicInstant,
7296    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7297        let _response = self.client.send_query::<
7298            fidl::encoding::EmptyPayload,
7299            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7300            FileMarker,
7301        >(
7302            (),
7303            0x176eb318f64ec23,
7304            fidl::encoding::DynamicFlags::FLEXIBLE,
7305            ___deadline,
7306        )?
7307        .into_result::<FileMarker>("get_flags")?;
7308        Ok(_response.map(|x| x.flags))
7309    }
7310
7311    /// Sets the flags that apply to this node after it has been opened. This method does not
7312    /// require any rights.
7313    ///
7314    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7315    /// clear append mode.
7316    ///
7317    /// Errors:
7318    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7319    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7320    pub fn r#set_flags(
7321        &self,
7322        mut flags: Flags,
7323        ___deadline: zx::MonotonicInstant,
7324    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7325        let _response = self.client.send_query::<
7326            NodeSetFlagsRequest,
7327            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7328            FileMarker,
7329        >(
7330            (flags,),
7331            0x55a8028685791ea8,
7332            fidl::encoding::DynamicFlags::FLEXIBLE,
7333            ___deadline,
7334        )?
7335        .into_result::<FileMarker>("set_flags")?;
7336        Ok(_response.map(|x| x))
7337    }
7338
7339    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
7340    /// volume has different settings or the storage is accounted seperately from the rest of the
7341    /// filesystem that may be reported instead of filesystem-wide details.
7342    pub fn r#query_filesystem(
7343        &self,
7344        ___deadline: zx::MonotonicInstant,
7345    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7346        let _response = self
7347            .client
7348            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, FileMarker>(
7349                (),
7350                0x6f344a1c6b0a0610,
7351                fidl::encoding::DynamicFlags::empty(),
7352                ___deadline,
7353            )?;
7354        Ok((_response.s, _response.info))
7355    }
7356
7357    /// Acquires information about the node.
7358    ///
7359    /// The attributes of a node should be stable, independent of the
7360    /// specific protocol used to access it.
7361    ///
7362    /// If a particular attribute is not applicable or not supported,
7363    /// filesystems should leave the corresponding field absent.
7364    ///
7365    /// + `query` a bit-mask specifying which attributes to fetch. The server
7366    ///   should not return more than necessary.
7367    /// - `attributes` the returned attributes.
7368    ///
7369    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7370    pub fn r#get_attributes(
7371        &self,
7372        mut query: NodeAttributesQuery,
7373        ___deadline: zx::MonotonicInstant,
7374    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7375        let _response = self.client.send_query::<
7376            NodeGetAttributesRequest,
7377            fidl::encoding::ResultType<NodeAttributes2, i32>,
7378            FileMarker,
7379        >(
7380            (query,),
7381            0x3d4396a638ea053b,
7382            fidl::encoding::DynamicFlags::empty(),
7383            ___deadline,
7384        )?;
7385        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7386    }
7387
7388    /// Updates information about the node.
7389    ///
7390    /// + `attributes` the presence of a table field in `attributes` indicates
7391    /// the intent to update the corresponding attribute.
7392    ///
7393    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7394    ///
7395    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7396    pub fn r#update_attributes(
7397        &self,
7398        mut payload: &MutableNodeAttributes,
7399        ___deadline: zx::MonotonicInstant,
7400    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7401        let _response = self.client.send_query::<
7402            MutableNodeAttributes,
7403            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7404            FileMarker,
7405        >(
7406            payload,
7407            0x3308c1da5a89bf08,
7408            fidl::encoding::DynamicFlags::empty(),
7409            ___deadline,
7410        )?;
7411        Ok(_response.map(|x| x))
7412    }
7413
7414    /// Synchronizes updates to the node to the underlying media, if it exists.
7415    ///
7416    /// This method will return when the filesystem server has flushed the
7417    /// relevant updates to the underlying media, but does not guarantee the
7418    /// underlying media has persisted the information, nor that any information
7419    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7420    /// between operations.
7421    ///
7422    /// This method does not require any rights.
7423    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7424        let _response = self.client.send_query::<
7425            fidl::encoding::EmptyPayload,
7426            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7427            FileMarker,
7428        >(
7429            (),
7430            0x2c5c27ca0ab5dc49,
7431            fidl::encoding::DynamicFlags::empty(),
7432            ___deadline,
7433        )?;
7434        Ok(_response.map(|x| x))
7435    }
7436
7437    /// Creates an iterator over all the extended attribute names associated
7438    /// with this node. If an error occurs it is returned as an epitaph on the
7439    /// iterator request channel, and then the channel is closed.
7440    ///
7441    /// GetExtendedAttributes can be used with any of these names to retrieve
7442    /// the associated value.
7443    ///
7444    /// This method requires the [`Rights.READ_BYTES`] right.
7445    pub fn r#list_extended_attributes(
7446        &self,
7447        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7448    ) -> Result<(), fidl::Error> {
7449        self.client.send::<NodeListExtendedAttributesRequest>(
7450            (iterator,),
7451            0x4b61033de007fcd0,
7452            fidl::encoding::DynamicFlags::empty(),
7453        )
7454    }
7455
7456    /// Get the value associated with the given attribute `name` for this node.
7457    ///
7458    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7459    /// particular structure is imposed on them.
7460    ///
7461    /// This method requires the [`Rights.READ_BYTES`] right.
7462    pub fn r#get_extended_attribute(
7463        &self,
7464        mut name: &[u8],
7465        ___deadline: zx::MonotonicInstant,
7466    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7467        let _response = self.client.send_query::<
7468            NodeGetExtendedAttributeRequest,
7469            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7470            FileMarker,
7471        >(
7472            (name,),
7473            0x45ffa3ccfdeb76db,
7474            fidl::encoding::DynamicFlags::empty(),
7475            ___deadline,
7476        )?;
7477        Ok(_response.map(|x| x))
7478    }
7479
7480    /// Set the value for the given attribute `name` to `value` for this node.
7481    ///
7482    /// The attribute name may exist, in which case the attribute is updated.
7483    /// If the attribute doesn't exist, it is created. The name should have no
7484    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7485    ///
7486    /// This method requires the [`Rights.WRITE_BYTES`] right.
7487    pub fn r#set_extended_attribute(
7488        &self,
7489        mut name: &[u8],
7490        mut value: ExtendedAttributeValue,
7491        mut mode: SetExtendedAttributeMode,
7492        ___deadline: zx::MonotonicInstant,
7493    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7494        let _response = self.client.send_query::<
7495            NodeSetExtendedAttributeRequest,
7496            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7497            FileMarker,
7498        >(
7499            (name, &mut value, mode,),
7500            0x4a951362f681f23c,
7501            fidl::encoding::DynamicFlags::empty(),
7502            ___deadline,
7503        )?;
7504        Ok(_response.map(|x| x))
7505    }
7506
7507    /// Remove the specified extended attribute.
7508    ///
7509    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7510    ///
7511    /// This method requires the [`Rights.WRITE_BYTES`] right.
7512    pub fn r#remove_extended_attribute(
7513        &self,
7514        mut name: &[u8],
7515        ___deadline: zx::MonotonicInstant,
7516    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7517        let _response = self.client.send_query::<
7518            NodeRemoveExtendedAttributeRequest,
7519            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7520            FileMarker,
7521        >(
7522            (name,),
7523            0x7a0b9f3a9bf9032d,
7524            fidl::encoding::DynamicFlags::empty(),
7525            ___deadline,
7526        )?;
7527        Ok(_response.map(|x| x))
7528    }
7529
7530    /// Reads up to 'count' bytes at the seek offset.
7531    /// The seek offset is moved forward by the number of bytes read.
7532    ///
7533    /// ## Invariants
7534    ///
7535    /// * The returned `data.length` will never be greater than `count`.
7536    /// * If `data.length` is less than `count`, it means that the seek offset
7537    ///   has reached the end of file as part of this operation.
7538    /// * If `data.length` is zero while `count` is not, it means that the
7539    ///   seek offset is already at or beyond the end of file, and no data could
7540    ///   be read.
7541    /// * If `count` is zero, the server should perform all the checks ensuring
7542    ///   read access without actually read anything, and return an empty
7543    ///   `data` vector.
7544    ///
7545    /// This method requires the [`Rights.READ_BYTES`] right.
7546    ///
7547    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7548    pub fn r#read(
7549        &self,
7550        mut count: u64,
7551        ___deadline: zx::MonotonicInstant,
7552    ) -> Result<ReadableReadResult, fidl::Error> {
7553        let _response = self.client.send_query::<
7554            ReadableReadRequest,
7555            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7556            FileMarker,
7557        >(
7558            (count,),
7559            0x57e419a298c8ede,
7560            fidl::encoding::DynamicFlags::empty(),
7561            ___deadline,
7562        )?;
7563        Ok(_response.map(|x| x.data))
7564    }
7565
7566    /// Writes data at the seek offset.
7567    /// The seek offset is moved forward by the number of bytes written.
7568    /// If the file is in append mode, the seek offset is first set to the end
7569    /// of the file, followed by the write, in one atomic step.
7570    ///
7571    /// The file size may grow if the seek offset plus `data.length` is beyond
7572    /// the current end of file.
7573    ///
7574    /// + request `data` the byte buffer to write to the file.
7575    /// - response `actual_count` the number of bytes written.
7576    ///
7577    /// ## Invariants
7578    ///
7579    /// * The returned `actual_count` will never be greater than `data.length`.
7580    /// * If the server is unable to write all the data due to e.g. not enough
7581    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7582    ///   could be written, an error is returned.
7583    /// * If `data.length` is zero, the server should perform all the checks
7584    ///   ensuring write access without mutating the file and return a
7585    ///   successful write of zero bytes.  The seek offset is still updated if
7586    ///   in append mode.
7587    ///
7588    /// This method requires the [`Rights.WRITE_BYTES`] right.
7589    pub fn r#write(
7590        &self,
7591        mut data: &[u8],
7592        ___deadline: zx::MonotonicInstant,
7593    ) -> Result<WritableWriteResult, fidl::Error> {
7594        let _response = self.client.send_query::<
7595            WritableWriteRequest,
7596            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7597            FileMarker,
7598        >(
7599            (data,),
7600            0x6a31437832469f82,
7601            fidl::encoding::DynamicFlags::empty(),
7602            ___deadline,
7603        )?;
7604        Ok(_response.map(|x| x.actual_count))
7605    }
7606
7607    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7608        let _response =
7609            self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo, FileMarker>(
7610                (),
7611                0x68b5ac00c62906bc,
7612                fidl::encoding::DynamicFlags::empty(),
7613                ___deadline,
7614            )?;
7615        Ok(_response)
7616    }
7617
7618    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7619    /// will occur. The seek offset is specific to each file connection.
7620    ///
7621    /// + request `origin` the reference point where `offset` will be based on.
7622    /// + request `offset` the number of bytes to seek.
7623    /// - response `offset_from_start` the adjusted seek offset, from the start
7624    ///   of the file.
7625    ///
7626    /// This method does not require any rights.
7627    pub fn r#seek(
7628        &self,
7629        mut origin: SeekOrigin,
7630        mut offset: i64,
7631        ___deadline: zx::MonotonicInstant,
7632    ) -> Result<FileSeekResult, fidl::Error> {
7633        let _response = self.client.send_query::<
7634            FileSeekRequest,
7635            fidl::encoding::ResultType<FileSeekResponse, i32>,
7636            FileMarker,
7637        >(
7638            (origin, offset,),
7639            0x78079168162c5207,
7640            fidl::encoding::DynamicFlags::empty(),
7641            ___deadline,
7642        )?;
7643        Ok(_response.map(|x| x.offset_from_start))
7644    }
7645
7646    /// Reads up to 'count' bytes at the provided offset.
7647    /// Does not affect the seek offset.
7648    ///
7649    /// ## Invariants
7650    ///
7651    /// * The returned `data.length` will never be greater than `count`.
7652    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7653    ///   the end of file as part of this operation.
7654    /// * If `data.length` is zero while `count` is not, it means that `offset`
7655    ///   is at or past the end of file, and no data can be read.
7656    /// * If `count` is zero, the server should perform all the checks ensuring
7657    ///   read access without actually reading anything, and return an empty
7658    ///   `data` vector.
7659    ///
7660    /// This method requires the [`Rights.READ_BYTES`] right.
7661    ///
7662    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7663    pub fn r#read_at(
7664        &self,
7665        mut count: u64,
7666        mut offset: u64,
7667        ___deadline: zx::MonotonicInstant,
7668    ) -> Result<FileReadAtResult, fidl::Error> {
7669        let _response = self.client.send_query::<
7670            FileReadAtRequest,
7671            fidl::encoding::ResultType<FileReadAtResponse, i32>,
7672            FileMarker,
7673        >(
7674            (count, offset,),
7675            0x1607a293a60d723e,
7676            fidl::encoding::DynamicFlags::empty(),
7677            ___deadline,
7678        )?;
7679        Ok(_response.map(|x| x.data))
7680    }
7681
7682    /// Writes data at the provided offset.
7683    /// Does not affect the seek offset.
7684    ///
7685    /// The file size may grow if `offset` plus `data.length` is past the
7686    /// current end of file.
7687    ///
7688    /// + request `data` the byte buffer to write to the file.
7689    /// + request `offset` the offset from start of the file to begin writing.
7690    /// - response `actual_count` the number of bytes written.
7691    ///
7692    /// ## Invariants
7693    ///
7694    /// * The returned `actual_count` will never be greater than `data.length`.
7695    /// * If the server is unable to write all the data due to e.g. not enough
7696    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7697    ///   could be written, an error is returned.
7698    /// * If `data.length` is zero, the server should perform all the checks
7699    ///   ensuring write access without mutating the file, and will return a
7700    ///   successful write of zero bytes.
7701    ///
7702    /// This method requires the [`Rights.WRITE_BYTES`] right.
7703    pub fn r#write_at(
7704        &self,
7705        mut data: &[u8],
7706        mut offset: u64,
7707        ___deadline: zx::MonotonicInstant,
7708    ) -> Result<FileWriteAtResult, fidl::Error> {
7709        let _response = self.client.send_query::<
7710            FileWriteAtRequest,
7711            fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7712            FileMarker,
7713        >(
7714            (data, offset,),
7715            0x793eefc0045e792b,
7716            fidl::encoding::DynamicFlags::empty(),
7717            ___deadline,
7718        )?;
7719        Ok(_response.map(|x| x.actual_count))
7720    }
7721
7722    /// Shrinks or grows the file size to 'length' bytes.
7723    ///
7724    /// If file size is reduced by this operation, the extra trailing data'
7725    /// is discarded.
7726    /// If file size is increased by this operation, the extended area appears
7727    /// as if it was zeroed.
7728    ///
7729    /// This method requires the [`Rights.WRITE_BYTES`] right.
7730    pub fn r#resize(
7731        &self,
7732        mut length: u64,
7733        ___deadline: zx::MonotonicInstant,
7734    ) -> Result<FileResizeResult, fidl::Error> {
7735        let _response = self.client.send_query::<
7736            FileResizeRequest,
7737            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7738            FileMarker,
7739        >(
7740            (length,),
7741            0x2b80825f0535743a,
7742            fidl::encoding::DynamicFlags::empty(),
7743            ___deadline,
7744        )?;
7745        Ok(_response.map(|x| x))
7746    }
7747
7748    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7749    /// with the requested access rights.
7750    ///
7751    /// Implementations are not required to implement files backed by VMOs so
7752    /// this request may fail. Additionally, implementations may only support
7753    /// a certain subset of the flags. Clients should be prepared with fallback
7754    /// behavior if this request fails.
7755    ///
7756    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7757    /// implementation is free to choose the semantics of the returned VMO.
7758    ///
7759    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7760    /// - response `vmo` the requested [`zx.Handle:VMO`].
7761    /// * error a [`zx.Status`] value indicating the failure.
7762    ///
7763    /// This method requires the following rights:
7764    ///
7765    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7766    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7767    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7768    pub fn r#get_backing_memory(
7769        &self,
7770        mut flags: VmoFlags,
7771        ___deadline: zx::MonotonicInstant,
7772    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7773        let _response = self.client.send_query::<
7774            FileGetBackingMemoryRequest,
7775            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7776            FileMarker,
7777        >(
7778            (flags,),
7779            0xa6a9e654cbf62b,
7780            fidl::encoding::DynamicFlags::empty(),
7781            ___deadline,
7782        )?;
7783        Ok(_response.map(|x| x.vmo))
7784    }
7785
7786    /// Pre-allocate on-disk space for this file.
7787    pub fn r#allocate(
7788        &self,
7789        mut offset: u64,
7790        mut length: u64,
7791        mut mode: AllocateMode,
7792        ___deadline: zx::MonotonicInstant,
7793    ) -> Result<FileAllocateResult, fidl::Error> {
7794        let _response = self.client.send_query::<
7795            FileAllocateRequest,
7796            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7797            FileMarker,
7798        >(
7799            (offset, length, mode,),
7800            0x77fa0c330b57fd2e,
7801            fidl::encoding::DynamicFlags::FLEXIBLE,
7802            ___deadline,
7803        )?
7804        .into_result::<FileMarker>("allocate")?;
7805        Ok(_response.map(|x| x))
7806    }
7807
7808    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7809    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7810    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7811    /// rejected. This method can take some time to complete as it depends on the size of the file.
7812    /// This method can be aborted by closing the connection that this method was issued on.
7813    ///
7814    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7815    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7816    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7817    /// Also returns any error that might arise from reading the file, or from flushing the file,
7818    /// such as `ZX_ERR_IO`.
7819    pub fn r#enable_verity(
7820        &self,
7821        mut options: &VerificationOptions,
7822        ___deadline: zx::MonotonicInstant,
7823    ) -> Result<FileEnableVerityResult, fidl::Error> {
7824        let _response = self.client.send_query::<
7825            FileEnableVerityRequest,
7826            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7827            FileMarker,
7828        >(
7829            (options,),
7830            0x2c421ec3faaeb8bb,
7831            fidl::encoding::DynamicFlags::FLEXIBLE,
7832            ___deadline,
7833        )?
7834        .into_result::<FileMarker>("enable_verity")?;
7835        Ok(_response.map(|x| x))
7836    }
7837}
7838
7839#[cfg(target_os = "fuchsia")]
7840impl From<FileSynchronousProxy> for zx::NullableHandle {
7841    fn from(value: FileSynchronousProxy) -> Self {
7842        value.into_channel().into()
7843    }
7844}
7845
7846#[cfg(target_os = "fuchsia")]
7847impl From<fidl::Channel> for FileSynchronousProxy {
7848    fn from(value: fidl::Channel) -> Self {
7849        Self::new(value)
7850    }
7851}
7852
7853#[cfg(target_os = "fuchsia")]
7854impl fidl::endpoints::FromClient for FileSynchronousProxy {
7855    type Protocol = FileMarker;
7856
7857    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7858        Self::new(value.into_channel())
7859    }
7860}
7861
7862#[derive(Debug, Clone)]
7863pub struct FileProxy {
7864    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7865}
7866
7867impl fidl::endpoints::Proxy for FileProxy {
7868    type Protocol = FileMarker;
7869
7870    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7871        Self::new(inner)
7872    }
7873
7874    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7875        self.client.into_channel().map_err(|client| Self { client })
7876    }
7877
7878    fn as_channel(&self) -> &::fidl::AsyncChannel {
7879        self.client.as_channel()
7880    }
7881}
7882
7883impl FileProxy {
7884    /// Create a new Proxy for fuchsia.io/File.
7885    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7886        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7887        Self { client: fidl::client::Client::new(channel, protocol_name) }
7888    }
7889
7890    /// Get a Stream of events from the remote end of the protocol.
7891    ///
7892    /// # Panics
7893    ///
7894    /// Panics if the event stream was already taken.
7895    pub fn take_event_stream(&self) -> FileEventStream {
7896        FileEventStream { event_receiver: self.client.take_event_receiver() }
7897    }
7898
7899    /// Acquires an advisory lock on the underlying file.
7900    ///
7901    /// The lock lasts until either this connection is closed or
7902    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7903    /// explicitly.
7904    ///
7905    /// Advisory locks are purely advisory. They do not prevent actual read or
7906    /// write operations from occurring on the file, either through this
7907    /// connection or through other connections.
7908    ///
7909    /// This method requires the following rights:
7910    ///
7911    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7912    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7913    ///   [`AdvisoryLockType.WRITE`].
7914    ///
7915    /// # Errors
7916    ///
7917    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7918    ///   example, another connection might hold a conflicting lock type.
7919    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7920    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7921    ///   to acquire the given type of lock.
7922    pub fn r#advisory_lock(
7923        &self,
7924        mut request: &AdvisoryLockRequest,
7925    ) -> fidl::client::QueryResponseFut<
7926        AdvisoryLockingAdvisoryLockResult,
7927        fidl::encoding::DefaultFuchsiaResourceDialect,
7928    > {
7929        FileProxyInterface::r#advisory_lock(self, request)
7930    }
7931
7932    /// Creates a link to this this object with name `dst` in the directory represented by
7933    /// `dst_parent_token`.
7934    ///
7935    /// `dst` must be a resolved object name. Including "/" in the string will return
7936    /// `ZX_ERR_INVALID_ARGS`.
7937    ///
7938    /// This method requires the maximal set of rights supported by the filesystem for this object.
7939    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7940    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7941    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7942    /// `ZX_ERR_ACCESS_DENIED`.
7943    ///
7944    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7945    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7946    ///
7947    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7948    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7949    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7950    ///
7951    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7952    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7953    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7954    pub fn r#link_into(
7955        &self,
7956        mut dst_parent_token: fidl::Event,
7957        mut dst: &str,
7958    ) -> fidl::client::QueryResponseFut<
7959        LinkableLinkIntoResult,
7960        fidl::encoding::DefaultFuchsiaResourceDialect,
7961    > {
7962        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7963    }
7964
7965    pub fn r#clone(
7966        &self,
7967        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7968    ) -> Result<(), fidl::Error> {
7969        FileProxyInterface::r#clone(self, request)
7970    }
7971
7972    /// Terminates the connection.
7973    ///
7974    /// After calling `Close`, the client must not send any other requests.
7975    ///
7976    /// Servers, after sending the status response, should close the connection
7977    /// regardless of status and without sending an epitaph.
7978    ///
7979    /// Closing the client end of the channel should be semantically equivalent
7980    /// to calling `Close` without knowing when the close has completed or its
7981    /// status.
7982    pub fn r#close(
7983        &self,
7984    ) -> fidl::client::QueryResponseFut<
7985        fidl_fuchsia_unknown::CloseableCloseResult,
7986        fidl::encoding::DefaultFuchsiaResourceDialect,
7987    > {
7988        FileProxyInterface::r#close(self)
7989    }
7990
7991    pub fn r#query(
7992        &self,
7993    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7994    {
7995        FileProxyInterface::r#query(self)
7996    }
7997
7998    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7999    pub fn r#deprecated_clone(
8000        &self,
8001        mut flags: OpenFlags,
8002        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8003    ) -> Result<(), fidl::Error> {
8004        FileProxyInterface::r#deprecated_clone(self, flags, object)
8005    }
8006
8007    /// DEPRECATED - Use `Node.GetAttributes` instead.
8008    ///
8009    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8010    pub fn r#deprecated_get_attr(
8011        &self,
8012    ) -> fidl::client::QueryResponseFut<
8013        (i32, NodeAttributes),
8014        fidl::encoding::DefaultFuchsiaResourceDialect,
8015    > {
8016        FileProxyInterface::r#deprecated_get_attr(self)
8017    }
8018
8019    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
8020    pub fn r#deprecated_set_attr(
8021        &self,
8022        mut flags: NodeAttributeFlags,
8023        mut attributes: &NodeAttributes,
8024    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8025        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
8026    }
8027
8028    /// [DEPRECATED - Use new GetFlags method instead.]
8029    pub fn r#deprecated_get_flags(
8030        &self,
8031    ) -> fidl::client::QueryResponseFut<
8032        (i32, OpenFlags),
8033        fidl::encoding::DefaultFuchsiaResourceDialect,
8034    > {
8035        FileProxyInterface::r#deprecated_get_flags(self)
8036    }
8037
8038    /// [DEPRECATED - Use new SetFlags method instead.]
8039    pub fn r#deprecated_set_flags(
8040        &self,
8041        mut flags: OpenFlags,
8042    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8043        FileProxyInterface::r#deprecated_set_flags(self, flags)
8044    }
8045
8046    /// Queries the flags that apply to this node after it has been opened/created. This method does
8047    /// not require any rights.
8048    ///
8049    /// Note that the final set of flags that apply to the connection may differ from those
8050    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8051    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8052    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8053    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8054    pub fn r#get_flags(
8055        &self,
8056    ) -> fidl::client::QueryResponseFut<
8057        NodeGetFlagsResult,
8058        fidl::encoding::DefaultFuchsiaResourceDialect,
8059    > {
8060        FileProxyInterface::r#get_flags(self)
8061    }
8062
8063    /// Sets the flags that apply to this node after it has been opened. This method does not
8064    /// require any rights.
8065    ///
8066    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8067    /// clear append mode.
8068    ///
8069    /// Errors:
8070    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8071    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8072    pub fn r#set_flags(
8073        &self,
8074        mut flags: Flags,
8075    ) -> fidl::client::QueryResponseFut<
8076        NodeSetFlagsResult,
8077        fidl::encoding::DefaultFuchsiaResourceDialect,
8078    > {
8079        FileProxyInterface::r#set_flags(self, flags)
8080    }
8081
8082    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8083    /// volume has different settings or the storage is accounted seperately from the rest of the
8084    /// filesystem that may be reported instead of filesystem-wide details.
8085    pub fn r#query_filesystem(
8086        &self,
8087    ) -> fidl::client::QueryResponseFut<
8088        (i32, Option<Box<FilesystemInfo>>),
8089        fidl::encoding::DefaultFuchsiaResourceDialect,
8090    > {
8091        FileProxyInterface::r#query_filesystem(self)
8092    }
8093
8094    /// Acquires information about the node.
8095    ///
8096    /// The attributes of a node should be stable, independent of the
8097    /// specific protocol used to access it.
8098    ///
8099    /// If a particular attribute is not applicable or not supported,
8100    /// filesystems should leave the corresponding field absent.
8101    ///
8102    /// + `query` a bit-mask specifying which attributes to fetch. The server
8103    ///   should not return more than necessary.
8104    /// - `attributes` the returned attributes.
8105    ///
8106    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8107    pub fn r#get_attributes(
8108        &self,
8109        mut query: NodeAttributesQuery,
8110    ) -> fidl::client::QueryResponseFut<
8111        NodeGetAttributesResult,
8112        fidl::encoding::DefaultFuchsiaResourceDialect,
8113    > {
8114        FileProxyInterface::r#get_attributes(self, query)
8115    }
8116
8117    /// Updates information about the node.
8118    ///
8119    /// + `attributes` the presence of a table field in `attributes` indicates
8120    /// the intent to update the corresponding attribute.
8121    ///
8122    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8123    ///
8124    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8125    pub fn r#update_attributes(
8126        &self,
8127        mut payload: &MutableNodeAttributes,
8128    ) -> fidl::client::QueryResponseFut<
8129        NodeUpdateAttributesResult,
8130        fidl::encoding::DefaultFuchsiaResourceDialect,
8131    > {
8132        FileProxyInterface::r#update_attributes(self, payload)
8133    }
8134
8135    /// Synchronizes updates to the node to the underlying media, if it exists.
8136    ///
8137    /// This method will return when the filesystem server has flushed the
8138    /// relevant updates to the underlying media, but does not guarantee the
8139    /// underlying media has persisted the information, nor that any information
8140    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8141    /// between operations.
8142    ///
8143    /// This method does not require any rights.
8144    pub fn r#sync(
8145        &self,
8146    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8147    {
8148        FileProxyInterface::r#sync(self)
8149    }
8150
8151    /// Creates an iterator over all the extended attribute names associated
8152    /// with this node. If an error occurs it is returned as an epitaph on the
8153    /// iterator request channel, and then the channel is closed.
8154    ///
8155    /// GetExtendedAttributes can be used with any of these names to retrieve
8156    /// the associated value.
8157    ///
8158    /// This method requires the [`Rights.READ_BYTES`] right.
8159    pub fn r#list_extended_attributes(
8160        &self,
8161        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8162    ) -> Result<(), fidl::Error> {
8163        FileProxyInterface::r#list_extended_attributes(self, iterator)
8164    }
8165
8166    /// Get the value associated with the given attribute `name` for this node.
8167    ///
8168    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8169    /// particular structure is imposed on them.
8170    ///
8171    /// This method requires the [`Rights.READ_BYTES`] right.
8172    pub fn r#get_extended_attribute(
8173        &self,
8174        mut name: &[u8],
8175    ) -> fidl::client::QueryResponseFut<
8176        NodeGetExtendedAttributeResult,
8177        fidl::encoding::DefaultFuchsiaResourceDialect,
8178    > {
8179        FileProxyInterface::r#get_extended_attribute(self, name)
8180    }
8181
8182    /// Set the value for the given attribute `name` to `value` for this node.
8183    ///
8184    /// The attribute name may exist, in which case the attribute is updated.
8185    /// If the attribute doesn't exist, it is created. The name should have no
8186    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8187    ///
8188    /// This method requires the [`Rights.WRITE_BYTES`] right.
8189    pub fn r#set_extended_attribute(
8190        &self,
8191        mut name: &[u8],
8192        mut value: ExtendedAttributeValue,
8193        mut mode: SetExtendedAttributeMode,
8194    ) -> fidl::client::QueryResponseFut<
8195        NodeSetExtendedAttributeResult,
8196        fidl::encoding::DefaultFuchsiaResourceDialect,
8197    > {
8198        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8199    }
8200
8201    /// Remove the specified extended attribute.
8202    ///
8203    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8204    ///
8205    /// This method requires the [`Rights.WRITE_BYTES`] right.
8206    pub fn r#remove_extended_attribute(
8207        &self,
8208        mut name: &[u8],
8209    ) -> fidl::client::QueryResponseFut<
8210        NodeRemoveExtendedAttributeResult,
8211        fidl::encoding::DefaultFuchsiaResourceDialect,
8212    > {
8213        FileProxyInterface::r#remove_extended_attribute(self, name)
8214    }
8215
8216    /// Reads up to 'count' bytes at the seek offset.
8217    /// The seek offset is moved forward by the number of bytes read.
8218    ///
8219    /// ## Invariants
8220    ///
8221    /// * The returned `data.length` will never be greater than `count`.
8222    /// * If `data.length` is less than `count`, it means that the seek offset
8223    ///   has reached the end of file as part of this operation.
8224    /// * If `data.length` is zero while `count` is not, it means that the
8225    ///   seek offset is already at or beyond the end of file, and no data could
8226    ///   be read.
8227    /// * If `count` is zero, the server should perform all the checks ensuring
8228    ///   read access without actually read anything, and return an empty
8229    ///   `data` vector.
8230    ///
8231    /// This method requires the [`Rights.READ_BYTES`] right.
8232    ///
8233    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8234    pub fn r#read(
8235        &self,
8236        mut count: u64,
8237    ) -> fidl::client::QueryResponseFut<
8238        ReadableReadResult,
8239        fidl::encoding::DefaultFuchsiaResourceDialect,
8240    > {
8241        FileProxyInterface::r#read(self, count)
8242    }
8243
8244    /// Writes data at the seek offset.
8245    /// The seek offset is moved forward by the number of bytes written.
8246    /// If the file is in append mode, the seek offset is first set to the end
8247    /// of the file, followed by the write, in one atomic step.
8248    ///
8249    /// The file size may grow if the seek offset plus `data.length` is beyond
8250    /// the current end of file.
8251    ///
8252    /// + request `data` the byte buffer to write to the file.
8253    /// - response `actual_count` the number of bytes written.
8254    ///
8255    /// ## Invariants
8256    ///
8257    /// * The returned `actual_count` will never be greater than `data.length`.
8258    /// * If the server is unable to write all the data due to e.g. not enough
8259    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8260    ///   could be written, an error is returned.
8261    /// * If `data.length` is zero, the server should perform all the checks
8262    ///   ensuring write access without mutating the file and return a
8263    ///   successful write of zero bytes.  The seek offset is still updated if
8264    ///   in append mode.
8265    ///
8266    /// This method requires the [`Rights.WRITE_BYTES`] right.
8267    pub fn r#write(
8268        &self,
8269        mut data: &[u8],
8270    ) -> fidl::client::QueryResponseFut<
8271        WritableWriteResult,
8272        fidl::encoding::DefaultFuchsiaResourceDialect,
8273    > {
8274        FileProxyInterface::r#write(self, data)
8275    }
8276
8277    pub fn r#describe(
8278        &self,
8279    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8280    {
8281        FileProxyInterface::r#describe(self)
8282    }
8283
8284    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8285    /// will occur. The seek offset is specific to each file connection.
8286    ///
8287    /// + request `origin` the reference point where `offset` will be based on.
8288    /// + request `offset` the number of bytes to seek.
8289    /// - response `offset_from_start` the adjusted seek offset, from the start
8290    ///   of the file.
8291    ///
8292    /// This method does not require any rights.
8293    pub fn r#seek(
8294        &self,
8295        mut origin: SeekOrigin,
8296        mut offset: i64,
8297    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8298    {
8299        FileProxyInterface::r#seek(self, origin, offset)
8300    }
8301
8302    /// Reads up to 'count' bytes at the provided offset.
8303    /// Does not affect the seek offset.
8304    ///
8305    /// ## Invariants
8306    ///
8307    /// * The returned `data.length` will never be greater than `count`.
8308    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8309    ///   the end of file as part of this operation.
8310    /// * If `data.length` is zero while `count` is not, it means that `offset`
8311    ///   is at or past the end of file, and no data can be read.
8312    /// * If `count` is zero, the server should perform all the checks ensuring
8313    ///   read access without actually reading anything, and return an empty
8314    ///   `data` vector.
8315    ///
8316    /// This method requires the [`Rights.READ_BYTES`] right.
8317    ///
8318    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8319    pub fn r#read_at(
8320        &self,
8321        mut count: u64,
8322        mut offset: u64,
8323    ) -> fidl::client::QueryResponseFut<
8324        FileReadAtResult,
8325        fidl::encoding::DefaultFuchsiaResourceDialect,
8326    > {
8327        FileProxyInterface::r#read_at(self, count, offset)
8328    }
8329
8330    /// Writes data at the provided offset.
8331    /// Does not affect the seek offset.
8332    ///
8333    /// The file size may grow if `offset` plus `data.length` is past the
8334    /// current end of file.
8335    ///
8336    /// + request `data` the byte buffer to write to the file.
8337    /// + request `offset` the offset from start of the file to begin writing.
8338    /// - response `actual_count` the number of bytes written.
8339    ///
8340    /// ## Invariants
8341    ///
8342    /// * The returned `actual_count` will never be greater than `data.length`.
8343    /// * If the server is unable to write all the data due to e.g. not enough
8344    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8345    ///   could be written, an error is returned.
8346    /// * If `data.length` is zero, the server should perform all the checks
8347    ///   ensuring write access without mutating the file, and will return a
8348    ///   successful write of zero bytes.
8349    ///
8350    /// This method requires the [`Rights.WRITE_BYTES`] right.
8351    pub fn r#write_at(
8352        &self,
8353        mut data: &[u8],
8354        mut offset: u64,
8355    ) -> fidl::client::QueryResponseFut<
8356        FileWriteAtResult,
8357        fidl::encoding::DefaultFuchsiaResourceDialect,
8358    > {
8359        FileProxyInterface::r#write_at(self, data, offset)
8360    }
8361
8362    /// Shrinks or grows the file size to 'length' bytes.
8363    ///
8364    /// If file size is reduced by this operation, the extra trailing data'
8365    /// is discarded.
8366    /// If file size is increased by this operation, the extended area appears
8367    /// as if it was zeroed.
8368    ///
8369    /// This method requires the [`Rights.WRITE_BYTES`] right.
8370    pub fn r#resize(
8371        &self,
8372        mut length: u64,
8373    ) -> fidl::client::QueryResponseFut<
8374        FileResizeResult,
8375        fidl::encoding::DefaultFuchsiaResourceDialect,
8376    > {
8377        FileProxyInterface::r#resize(self, length)
8378    }
8379
8380    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8381    /// with the requested access rights.
8382    ///
8383    /// Implementations are not required to implement files backed by VMOs so
8384    /// this request may fail. Additionally, implementations may only support
8385    /// a certain subset of the flags. Clients should be prepared with fallback
8386    /// behavior if this request fails.
8387    ///
8388    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8389    /// implementation is free to choose the semantics of the returned VMO.
8390    ///
8391    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8392    /// - response `vmo` the requested [`zx.Handle:VMO`].
8393    /// * error a [`zx.Status`] value indicating the failure.
8394    ///
8395    /// This method requires the following rights:
8396    ///
8397    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8398    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8399    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8400    pub fn r#get_backing_memory(
8401        &self,
8402        mut flags: VmoFlags,
8403    ) -> fidl::client::QueryResponseFut<
8404        FileGetBackingMemoryResult,
8405        fidl::encoding::DefaultFuchsiaResourceDialect,
8406    > {
8407        FileProxyInterface::r#get_backing_memory(self, flags)
8408    }
8409
8410    /// Pre-allocate on-disk space for this file.
8411    pub fn r#allocate(
8412        &self,
8413        mut offset: u64,
8414        mut length: u64,
8415        mut mode: AllocateMode,
8416    ) -> fidl::client::QueryResponseFut<
8417        FileAllocateResult,
8418        fidl::encoding::DefaultFuchsiaResourceDialect,
8419    > {
8420        FileProxyInterface::r#allocate(self, offset, length, mode)
8421    }
8422
8423    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8424    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8425    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8426    /// rejected. This method can take some time to complete as it depends on the size of the file.
8427    /// This method can be aborted by closing the connection that this method was issued on.
8428    ///
8429    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8430    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8431    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8432    /// Also returns any error that might arise from reading the file, or from flushing the file,
8433    /// such as `ZX_ERR_IO`.
8434    pub fn r#enable_verity(
8435        &self,
8436        mut options: &VerificationOptions,
8437    ) -> fidl::client::QueryResponseFut<
8438        FileEnableVerityResult,
8439        fidl::encoding::DefaultFuchsiaResourceDialect,
8440    > {
8441        FileProxyInterface::r#enable_verity(self, options)
8442    }
8443}
8444
8445impl FileProxyInterface for FileProxy {
8446    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8447        AdvisoryLockingAdvisoryLockResult,
8448        fidl::encoding::DefaultFuchsiaResourceDialect,
8449    >;
8450    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8451        fn _decode(
8452            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8453        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8454            let _response = fidl::client::decode_transaction_body::<
8455                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8456                fidl::encoding::DefaultFuchsiaResourceDialect,
8457                0x6ee9c0ad53ec87aa,
8458            >(_buf?)?;
8459            Ok(_response.map(|x| x))
8460        }
8461        self.client.send_query_and_decode::<
8462            AdvisoryLockingAdvisoryLockRequest,
8463            AdvisoryLockingAdvisoryLockResult,
8464        >(
8465            (request,),
8466            0x6ee9c0ad53ec87aa,
8467            fidl::encoding::DynamicFlags::empty(),
8468            _decode,
8469        )
8470    }
8471
8472    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8473        LinkableLinkIntoResult,
8474        fidl::encoding::DefaultFuchsiaResourceDialect,
8475    >;
8476    fn r#link_into(
8477        &self,
8478        mut dst_parent_token: fidl::Event,
8479        mut dst: &str,
8480    ) -> Self::LinkIntoResponseFut {
8481        fn _decode(
8482            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8483        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8484            let _response = fidl::client::decode_transaction_body::<
8485                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8486                fidl::encoding::DefaultFuchsiaResourceDialect,
8487                0x54f3949246a03e74,
8488            >(_buf?)?;
8489            Ok(_response.map(|x| x))
8490        }
8491        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8492            (dst_parent_token, dst),
8493            0x54f3949246a03e74,
8494            fidl::encoding::DynamicFlags::empty(),
8495            _decode,
8496        )
8497    }
8498
8499    fn r#clone(
8500        &self,
8501        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8502    ) -> Result<(), fidl::Error> {
8503        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8504            (request,),
8505            0x20d8a7aba2168a79,
8506            fidl::encoding::DynamicFlags::empty(),
8507        )
8508    }
8509
8510    type CloseResponseFut = fidl::client::QueryResponseFut<
8511        fidl_fuchsia_unknown::CloseableCloseResult,
8512        fidl::encoding::DefaultFuchsiaResourceDialect,
8513    >;
8514    fn r#close(&self) -> Self::CloseResponseFut {
8515        fn _decode(
8516            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8517        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8518            let _response = fidl::client::decode_transaction_body::<
8519                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8520                fidl::encoding::DefaultFuchsiaResourceDialect,
8521                0x5ac5d459ad7f657e,
8522            >(_buf?)?;
8523            Ok(_response.map(|x| x))
8524        }
8525        self.client.send_query_and_decode::<
8526            fidl::encoding::EmptyPayload,
8527            fidl_fuchsia_unknown::CloseableCloseResult,
8528        >(
8529            (),
8530            0x5ac5d459ad7f657e,
8531            fidl::encoding::DynamicFlags::empty(),
8532            _decode,
8533        )
8534    }
8535
8536    type QueryResponseFut =
8537        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8538    fn r#query(&self) -> Self::QueryResponseFut {
8539        fn _decode(
8540            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8541        ) -> Result<Vec<u8>, fidl::Error> {
8542            let _response = fidl::client::decode_transaction_body::<
8543                fidl_fuchsia_unknown::QueryableQueryResponse,
8544                fidl::encoding::DefaultFuchsiaResourceDialect,
8545                0x2658edee9decfc06,
8546            >(_buf?)?;
8547            Ok(_response.protocol)
8548        }
8549        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8550            (),
8551            0x2658edee9decfc06,
8552            fidl::encoding::DynamicFlags::empty(),
8553            _decode,
8554        )
8555    }
8556
8557    fn r#deprecated_clone(
8558        &self,
8559        mut flags: OpenFlags,
8560        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8561    ) -> Result<(), fidl::Error> {
8562        self.client.send::<NodeDeprecatedCloneRequest>(
8563            (flags, object),
8564            0x5a61678f293ce16f,
8565            fidl::encoding::DynamicFlags::FLEXIBLE,
8566        )
8567    }
8568
8569    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8570        (i32, NodeAttributes),
8571        fidl::encoding::DefaultFuchsiaResourceDialect,
8572    >;
8573    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8574        fn _decode(
8575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8576        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8577            let _response = fidl::client::decode_transaction_body::<
8578                NodeDeprecatedGetAttrResponse,
8579                fidl::encoding::DefaultFuchsiaResourceDialect,
8580                0x78985e216314dafd,
8581            >(_buf?)?;
8582            Ok((_response.s, _response.attributes))
8583        }
8584        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8585            (),
8586            0x78985e216314dafd,
8587            fidl::encoding::DynamicFlags::empty(),
8588            _decode,
8589        )
8590    }
8591
8592    type DeprecatedSetAttrResponseFut =
8593        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8594    fn r#deprecated_set_attr(
8595        &self,
8596        mut flags: NodeAttributeFlags,
8597        mut attributes: &NodeAttributes,
8598    ) -> Self::DeprecatedSetAttrResponseFut {
8599        fn _decode(
8600            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8601        ) -> Result<i32, fidl::Error> {
8602            let _response = fidl::client::decode_transaction_body::<
8603                NodeDeprecatedSetAttrResponse,
8604                fidl::encoding::DefaultFuchsiaResourceDialect,
8605                0x4186c0f40d938f46,
8606            >(_buf?)?;
8607            Ok(_response.s)
8608        }
8609        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8610            (flags, attributes),
8611            0x4186c0f40d938f46,
8612            fidl::encoding::DynamicFlags::empty(),
8613            _decode,
8614        )
8615    }
8616
8617    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8618        (i32, OpenFlags),
8619        fidl::encoding::DefaultFuchsiaResourceDialect,
8620    >;
8621    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8622        fn _decode(
8623            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8624        ) -> Result<(i32, OpenFlags), fidl::Error> {
8625            let _response = fidl::client::decode_transaction_body::<
8626                NodeDeprecatedGetFlagsResponse,
8627                fidl::encoding::DefaultFuchsiaResourceDialect,
8628                0x5b88fffb8eda3aa1,
8629            >(_buf?)?;
8630            Ok((_response.s, _response.flags))
8631        }
8632        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8633            (),
8634            0x5b88fffb8eda3aa1,
8635            fidl::encoding::DynamicFlags::empty(),
8636            _decode,
8637        )
8638    }
8639
8640    type DeprecatedSetFlagsResponseFut =
8641        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8642    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8643        fn _decode(
8644            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8645        ) -> Result<i32, fidl::Error> {
8646            let _response = fidl::client::decode_transaction_body::<
8647                NodeDeprecatedSetFlagsResponse,
8648                fidl::encoding::DefaultFuchsiaResourceDialect,
8649                0x5295b76c71fde733,
8650            >(_buf?)?;
8651            Ok(_response.s)
8652        }
8653        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8654            (flags,),
8655            0x5295b76c71fde733,
8656            fidl::encoding::DynamicFlags::empty(),
8657            _decode,
8658        )
8659    }
8660
8661    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8662        NodeGetFlagsResult,
8663        fidl::encoding::DefaultFuchsiaResourceDialect,
8664    >;
8665    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8666        fn _decode(
8667            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8668        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8669            let _response = fidl::client::decode_transaction_body::<
8670                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8671                fidl::encoding::DefaultFuchsiaResourceDialect,
8672                0x176eb318f64ec23,
8673            >(_buf?)?
8674            .into_result::<FileMarker>("get_flags")?;
8675            Ok(_response.map(|x| x.flags))
8676        }
8677        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8678            (),
8679            0x176eb318f64ec23,
8680            fidl::encoding::DynamicFlags::FLEXIBLE,
8681            _decode,
8682        )
8683    }
8684
8685    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8686        NodeSetFlagsResult,
8687        fidl::encoding::DefaultFuchsiaResourceDialect,
8688    >;
8689    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8690        fn _decode(
8691            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8692        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8693            let _response = fidl::client::decode_transaction_body::<
8694                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8695                fidl::encoding::DefaultFuchsiaResourceDialect,
8696                0x55a8028685791ea8,
8697            >(_buf?)?
8698            .into_result::<FileMarker>("set_flags")?;
8699            Ok(_response.map(|x| x))
8700        }
8701        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8702            (flags,),
8703            0x55a8028685791ea8,
8704            fidl::encoding::DynamicFlags::FLEXIBLE,
8705            _decode,
8706        )
8707    }
8708
8709    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8710        (i32, Option<Box<FilesystemInfo>>),
8711        fidl::encoding::DefaultFuchsiaResourceDialect,
8712    >;
8713    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8714        fn _decode(
8715            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8716        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8717            let _response = fidl::client::decode_transaction_body::<
8718                NodeQueryFilesystemResponse,
8719                fidl::encoding::DefaultFuchsiaResourceDialect,
8720                0x6f344a1c6b0a0610,
8721            >(_buf?)?;
8722            Ok((_response.s, _response.info))
8723        }
8724        self.client.send_query_and_decode::<
8725            fidl::encoding::EmptyPayload,
8726            (i32, Option<Box<FilesystemInfo>>),
8727        >(
8728            (),
8729            0x6f344a1c6b0a0610,
8730            fidl::encoding::DynamicFlags::empty(),
8731            _decode,
8732        )
8733    }
8734
8735    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8736        NodeGetAttributesResult,
8737        fidl::encoding::DefaultFuchsiaResourceDialect,
8738    >;
8739    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8740        fn _decode(
8741            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8742        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8743            let _response = fidl::client::decode_transaction_body::<
8744                fidl::encoding::ResultType<NodeAttributes2, i32>,
8745                fidl::encoding::DefaultFuchsiaResourceDialect,
8746                0x3d4396a638ea053b,
8747            >(_buf?)?;
8748            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8749        }
8750        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8751            (query,),
8752            0x3d4396a638ea053b,
8753            fidl::encoding::DynamicFlags::empty(),
8754            _decode,
8755        )
8756    }
8757
8758    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8759        NodeUpdateAttributesResult,
8760        fidl::encoding::DefaultFuchsiaResourceDialect,
8761    >;
8762    fn r#update_attributes(
8763        &self,
8764        mut payload: &MutableNodeAttributes,
8765    ) -> Self::UpdateAttributesResponseFut {
8766        fn _decode(
8767            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8768        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8769            let _response = fidl::client::decode_transaction_body::<
8770                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8771                fidl::encoding::DefaultFuchsiaResourceDialect,
8772                0x3308c1da5a89bf08,
8773            >(_buf?)?;
8774            Ok(_response.map(|x| x))
8775        }
8776        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8777            payload,
8778            0x3308c1da5a89bf08,
8779            fidl::encoding::DynamicFlags::empty(),
8780            _decode,
8781        )
8782    }
8783
8784    type SyncResponseFut = fidl::client::QueryResponseFut<
8785        NodeSyncResult,
8786        fidl::encoding::DefaultFuchsiaResourceDialect,
8787    >;
8788    fn r#sync(&self) -> Self::SyncResponseFut {
8789        fn _decode(
8790            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8791        ) -> Result<NodeSyncResult, fidl::Error> {
8792            let _response = fidl::client::decode_transaction_body::<
8793                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8794                fidl::encoding::DefaultFuchsiaResourceDialect,
8795                0x2c5c27ca0ab5dc49,
8796            >(_buf?)?;
8797            Ok(_response.map(|x| x))
8798        }
8799        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8800            (),
8801            0x2c5c27ca0ab5dc49,
8802            fidl::encoding::DynamicFlags::empty(),
8803            _decode,
8804        )
8805    }
8806
8807    fn r#list_extended_attributes(
8808        &self,
8809        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8810    ) -> Result<(), fidl::Error> {
8811        self.client.send::<NodeListExtendedAttributesRequest>(
8812            (iterator,),
8813            0x4b61033de007fcd0,
8814            fidl::encoding::DynamicFlags::empty(),
8815        )
8816    }
8817
8818    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8819        NodeGetExtendedAttributeResult,
8820        fidl::encoding::DefaultFuchsiaResourceDialect,
8821    >;
8822    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8823        fn _decode(
8824            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8825        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8826            let _response = fidl::client::decode_transaction_body::<
8827                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8828                fidl::encoding::DefaultFuchsiaResourceDialect,
8829                0x45ffa3ccfdeb76db,
8830            >(_buf?)?;
8831            Ok(_response.map(|x| x))
8832        }
8833        self.client.send_query_and_decode::<
8834            NodeGetExtendedAttributeRequest,
8835            NodeGetExtendedAttributeResult,
8836        >(
8837            (name,),
8838            0x45ffa3ccfdeb76db,
8839            fidl::encoding::DynamicFlags::empty(),
8840            _decode,
8841        )
8842    }
8843
8844    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8845        NodeSetExtendedAttributeResult,
8846        fidl::encoding::DefaultFuchsiaResourceDialect,
8847    >;
8848    fn r#set_extended_attribute(
8849        &self,
8850        mut name: &[u8],
8851        mut value: ExtendedAttributeValue,
8852        mut mode: SetExtendedAttributeMode,
8853    ) -> Self::SetExtendedAttributeResponseFut {
8854        fn _decode(
8855            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8856        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8857            let _response = fidl::client::decode_transaction_body::<
8858                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8859                fidl::encoding::DefaultFuchsiaResourceDialect,
8860                0x4a951362f681f23c,
8861            >(_buf?)?;
8862            Ok(_response.map(|x| x))
8863        }
8864        self.client.send_query_and_decode::<
8865            NodeSetExtendedAttributeRequest,
8866            NodeSetExtendedAttributeResult,
8867        >(
8868            (name, &mut value, mode,),
8869            0x4a951362f681f23c,
8870            fidl::encoding::DynamicFlags::empty(),
8871            _decode,
8872        )
8873    }
8874
8875    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8876        NodeRemoveExtendedAttributeResult,
8877        fidl::encoding::DefaultFuchsiaResourceDialect,
8878    >;
8879    fn r#remove_extended_attribute(
8880        &self,
8881        mut name: &[u8],
8882    ) -> Self::RemoveExtendedAttributeResponseFut {
8883        fn _decode(
8884            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8885        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8886            let _response = fidl::client::decode_transaction_body::<
8887                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8888                fidl::encoding::DefaultFuchsiaResourceDialect,
8889                0x7a0b9f3a9bf9032d,
8890            >(_buf?)?;
8891            Ok(_response.map(|x| x))
8892        }
8893        self.client.send_query_and_decode::<
8894            NodeRemoveExtendedAttributeRequest,
8895            NodeRemoveExtendedAttributeResult,
8896        >(
8897            (name,),
8898            0x7a0b9f3a9bf9032d,
8899            fidl::encoding::DynamicFlags::empty(),
8900            _decode,
8901        )
8902    }
8903
8904    type ReadResponseFut = fidl::client::QueryResponseFut<
8905        ReadableReadResult,
8906        fidl::encoding::DefaultFuchsiaResourceDialect,
8907    >;
8908    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8909        fn _decode(
8910            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8911        ) -> Result<ReadableReadResult, fidl::Error> {
8912            let _response = fidl::client::decode_transaction_body::<
8913                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8914                fidl::encoding::DefaultFuchsiaResourceDialect,
8915                0x57e419a298c8ede,
8916            >(_buf?)?;
8917            Ok(_response.map(|x| x.data))
8918        }
8919        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8920            (count,),
8921            0x57e419a298c8ede,
8922            fidl::encoding::DynamicFlags::empty(),
8923            _decode,
8924        )
8925    }
8926
8927    type WriteResponseFut = fidl::client::QueryResponseFut<
8928        WritableWriteResult,
8929        fidl::encoding::DefaultFuchsiaResourceDialect,
8930    >;
8931    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8932        fn _decode(
8933            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8934        ) -> Result<WritableWriteResult, fidl::Error> {
8935            let _response = fidl::client::decode_transaction_body::<
8936                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8937                fidl::encoding::DefaultFuchsiaResourceDialect,
8938                0x6a31437832469f82,
8939            >(_buf?)?;
8940            Ok(_response.map(|x| x.actual_count))
8941        }
8942        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8943            (data,),
8944            0x6a31437832469f82,
8945            fidl::encoding::DynamicFlags::empty(),
8946            _decode,
8947        )
8948    }
8949
8950    type DescribeResponseFut =
8951        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8952    fn r#describe(&self) -> Self::DescribeResponseFut {
8953        fn _decode(
8954            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8955        ) -> Result<FileInfo, fidl::Error> {
8956            let _response = fidl::client::decode_transaction_body::<
8957                FileInfo,
8958                fidl::encoding::DefaultFuchsiaResourceDialect,
8959                0x68b5ac00c62906bc,
8960            >(_buf?)?;
8961            Ok(_response)
8962        }
8963        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8964            (),
8965            0x68b5ac00c62906bc,
8966            fidl::encoding::DynamicFlags::empty(),
8967            _decode,
8968        )
8969    }
8970
8971    type SeekResponseFut = fidl::client::QueryResponseFut<
8972        FileSeekResult,
8973        fidl::encoding::DefaultFuchsiaResourceDialect,
8974    >;
8975    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8976        fn _decode(
8977            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8978        ) -> Result<FileSeekResult, fidl::Error> {
8979            let _response = fidl::client::decode_transaction_body::<
8980                fidl::encoding::ResultType<FileSeekResponse, i32>,
8981                fidl::encoding::DefaultFuchsiaResourceDialect,
8982                0x78079168162c5207,
8983            >(_buf?)?;
8984            Ok(_response.map(|x| x.offset_from_start))
8985        }
8986        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8987            (origin, offset),
8988            0x78079168162c5207,
8989            fidl::encoding::DynamicFlags::empty(),
8990            _decode,
8991        )
8992    }
8993
8994    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8995        FileReadAtResult,
8996        fidl::encoding::DefaultFuchsiaResourceDialect,
8997    >;
8998    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8999        fn _decode(
9000            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9001        ) -> Result<FileReadAtResult, fidl::Error> {
9002            let _response = fidl::client::decode_transaction_body::<
9003                fidl::encoding::ResultType<FileReadAtResponse, i32>,
9004                fidl::encoding::DefaultFuchsiaResourceDialect,
9005                0x1607a293a60d723e,
9006            >(_buf?)?;
9007            Ok(_response.map(|x| x.data))
9008        }
9009        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
9010            (count, offset),
9011            0x1607a293a60d723e,
9012            fidl::encoding::DynamicFlags::empty(),
9013            _decode,
9014        )
9015    }
9016
9017    type WriteAtResponseFut = fidl::client::QueryResponseFut<
9018        FileWriteAtResult,
9019        fidl::encoding::DefaultFuchsiaResourceDialect,
9020    >;
9021    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
9022        fn _decode(
9023            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9024        ) -> Result<FileWriteAtResult, fidl::Error> {
9025            let _response = fidl::client::decode_transaction_body::<
9026                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
9027                fidl::encoding::DefaultFuchsiaResourceDialect,
9028                0x793eefc0045e792b,
9029            >(_buf?)?;
9030            Ok(_response.map(|x| x.actual_count))
9031        }
9032        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
9033            (data, offset),
9034            0x793eefc0045e792b,
9035            fidl::encoding::DynamicFlags::empty(),
9036            _decode,
9037        )
9038    }
9039
9040    type ResizeResponseFut = fidl::client::QueryResponseFut<
9041        FileResizeResult,
9042        fidl::encoding::DefaultFuchsiaResourceDialect,
9043    >;
9044    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
9045        fn _decode(
9046            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9047        ) -> Result<FileResizeResult, fidl::Error> {
9048            let _response = fidl::client::decode_transaction_body::<
9049                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9050                fidl::encoding::DefaultFuchsiaResourceDialect,
9051                0x2b80825f0535743a,
9052            >(_buf?)?;
9053            Ok(_response.map(|x| x))
9054        }
9055        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
9056            (length,),
9057            0x2b80825f0535743a,
9058            fidl::encoding::DynamicFlags::empty(),
9059            _decode,
9060        )
9061    }
9062
9063    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
9064        FileGetBackingMemoryResult,
9065        fidl::encoding::DefaultFuchsiaResourceDialect,
9066    >;
9067    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
9068        fn _decode(
9069            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9070        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
9071            let _response = fidl::client::decode_transaction_body::<
9072                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
9073                fidl::encoding::DefaultFuchsiaResourceDialect,
9074                0xa6a9e654cbf62b,
9075            >(_buf?)?;
9076            Ok(_response.map(|x| x.vmo))
9077        }
9078        self.client
9079            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
9080                (flags,),
9081                0xa6a9e654cbf62b,
9082                fidl::encoding::DynamicFlags::empty(),
9083                _decode,
9084            )
9085    }
9086
9087    type AllocateResponseFut = fidl::client::QueryResponseFut<
9088        FileAllocateResult,
9089        fidl::encoding::DefaultFuchsiaResourceDialect,
9090    >;
9091    fn r#allocate(
9092        &self,
9093        mut offset: u64,
9094        mut length: u64,
9095        mut mode: AllocateMode,
9096    ) -> Self::AllocateResponseFut {
9097        fn _decode(
9098            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9099        ) -> Result<FileAllocateResult, fidl::Error> {
9100            let _response = fidl::client::decode_transaction_body::<
9101                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9102                fidl::encoding::DefaultFuchsiaResourceDialect,
9103                0x77fa0c330b57fd2e,
9104            >(_buf?)?
9105            .into_result::<FileMarker>("allocate")?;
9106            Ok(_response.map(|x| x))
9107        }
9108        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
9109            (offset, length, mode),
9110            0x77fa0c330b57fd2e,
9111            fidl::encoding::DynamicFlags::FLEXIBLE,
9112            _decode,
9113        )
9114    }
9115
9116    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9117        FileEnableVerityResult,
9118        fidl::encoding::DefaultFuchsiaResourceDialect,
9119    >;
9120    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9121        fn _decode(
9122            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9123        ) -> Result<FileEnableVerityResult, fidl::Error> {
9124            let _response = fidl::client::decode_transaction_body::<
9125                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9126                fidl::encoding::DefaultFuchsiaResourceDialect,
9127                0x2c421ec3faaeb8bb,
9128            >(_buf?)?
9129            .into_result::<FileMarker>("enable_verity")?;
9130            Ok(_response.map(|x| x))
9131        }
9132        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9133            (options,),
9134            0x2c421ec3faaeb8bb,
9135            fidl::encoding::DynamicFlags::FLEXIBLE,
9136            _decode,
9137        )
9138    }
9139}
9140
9141pub struct FileEventStream {
9142    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9143}
9144
9145impl std::marker::Unpin for FileEventStream {}
9146
9147impl futures::stream::FusedStream for FileEventStream {
9148    fn is_terminated(&self) -> bool {
9149        self.event_receiver.is_terminated()
9150    }
9151}
9152
9153impl futures::Stream for FileEventStream {
9154    type Item = Result<FileEvent, fidl::Error>;
9155
9156    fn poll_next(
9157        mut self: std::pin::Pin<&mut Self>,
9158        cx: &mut std::task::Context<'_>,
9159    ) -> std::task::Poll<Option<Self::Item>> {
9160        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9161            &mut self.event_receiver,
9162            cx
9163        )?) {
9164            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9165            None => std::task::Poll::Ready(None),
9166        }
9167    }
9168}
9169
9170#[derive(Debug)]
9171pub enum FileEvent {
9172    OnOpen_ {
9173        s: i32,
9174        info: Option<Box<NodeInfoDeprecated>>,
9175    },
9176    OnRepresentation {
9177        payload: Representation,
9178    },
9179    #[non_exhaustive]
9180    _UnknownEvent {
9181        /// Ordinal of the event that was sent.
9182        ordinal: u64,
9183    },
9184}
9185
9186impl FileEvent {
9187    #[allow(irrefutable_let_patterns)]
9188    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9189        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9190    }
9191    #[allow(irrefutable_let_patterns)]
9192    pub fn into_on_representation(self) -> Option<Representation> {
9193        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9194    }
9195
9196    /// Decodes a message buffer as a [`FileEvent`].
9197    fn decode(
9198        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9199    ) -> Result<FileEvent, fidl::Error> {
9200        let (bytes, _handles) = buf.split_mut();
9201        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9202        debug_assert_eq!(tx_header.tx_id, 0);
9203        match tx_header.ordinal {
9204            0x7fc7bbb1dbfd1972 => {
9205                let mut out = fidl::new_empty!(
9206                    NodeOnOpenRequest,
9207                    fidl::encoding::DefaultFuchsiaResourceDialect
9208                );
9209                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9210                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9211            }
9212            0x5cb40567d80a510c => {
9213                let mut out =
9214                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9215                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9216                Ok((FileEvent::OnRepresentation { payload: out }))
9217            }
9218            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9219                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9220            }
9221            _ => Err(fidl::Error::UnknownOrdinal {
9222                ordinal: tx_header.ordinal,
9223                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9224            }),
9225        }
9226    }
9227}
9228
9229/// A Stream of incoming requests for fuchsia.io/File.
9230pub struct FileRequestStream {
9231    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9232    is_terminated: bool,
9233}
9234
9235impl std::marker::Unpin for FileRequestStream {}
9236
9237impl futures::stream::FusedStream for FileRequestStream {
9238    fn is_terminated(&self) -> bool {
9239        self.is_terminated
9240    }
9241}
9242
9243impl fidl::endpoints::RequestStream for FileRequestStream {
9244    type Protocol = FileMarker;
9245    type ControlHandle = FileControlHandle;
9246
9247    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9248        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9249    }
9250
9251    fn control_handle(&self) -> Self::ControlHandle {
9252        FileControlHandle { inner: self.inner.clone() }
9253    }
9254
9255    fn into_inner(
9256        self,
9257    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9258    {
9259        (self.inner, self.is_terminated)
9260    }
9261
9262    fn from_inner(
9263        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9264        is_terminated: bool,
9265    ) -> Self {
9266        Self { inner, is_terminated }
9267    }
9268}
9269
9270impl futures::Stream for FileRequestStream {
9271    type Item = Result<FileRequest, fidl::Error>;
9272
9273    fn poll_next(
9274        mut self: std::pin::Pin<&mut Self>,
9275        cx: &mut std::task::Context<'_>,
9276    ) -> std::task::Poll<Option<Self::Item>> {
9277        let this = &mut *self;
9278        if this.inner.check_shutdown(cx) {
9279            this.is_terminated = true;
9280            return std::task::Poll::Ready(None);
9281        }
9282        if this.is_terminated {
9283            panic!("polled FileRequestStream after completion");
9284        }
9285        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9286            |bytes, handles| {
9287                match this.inner.channel().read_etc(cx, bytes, handles) {
9288                    std::task::Poll::Ready(Ok(())) => {}
9289                    std::task::Poll::Pending => return std::task::Poll::Pending,
9290                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9291                        this.is_terminated = true;
9292                        return std::task::Poll::Ready(None);
9293                    }
9294                    std::task::Poll::Ready(Err(e)) => {
9295                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9296                            e.into(),
9297                        ))));
9298                    }
9299                }
9300
9301                // A message has been received from the channel
9302                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9303
9304                std::task::Poll::Ready(Some(match header.ordinal {
9305                    0x6ee9c0ad53ec87aa => {
9306                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9307                        let mut req = fidl::new_empty!(
9308                            AdvisoryLockingAdvisoryLockRequest,
9309                            fidl::encoding::DefaultFuchsiaResourceDialect
9310                        );
9311                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9312                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9313                        Ok(FileRequest::AdvisoryLock {
9314                            request: req.request,
9315
9316                            responder: FileAdvisoryLockResponder {
9317                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9318                                tx_id: header.tx_id,
9319                            },
9320                        })
9321                    }
9322                    0x54f3949246a03e74 => {
9323                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9324                        let mut req = fidl::new_empty!(
9325                            LinkableLinkIntoRequest,
9326                            fidl::encoding::DefaultFuchsiaResourceDialect
9327                        );
9328                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9329                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9330                        Ok(FileRequest::LinkInto {
9331                            dst_parent_token: req.dst_parent_token,
9332                            dst: req.dst,
9333
9334                            responder: FileLinkIntoResponder {
9335                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9336                                tx_id: header.tx_id,
9337                            },
9338                        })
9339                    }
9340                    0x20d8a7aba2168a79 => {
9341                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9342                        let mut req = fidl::new_empty!(
9343                            fidl_fuchsia_unknown::CloneableCloneRequest,
9344                            fidl::encoding::DefaultFuchsiaResourceDialect
9345                        );
9346                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9347                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9348                        Ok(FileRequest::Clone { request: req.request, control_handle })
9349                    }
9350                    0x5ac5d459ad7f657e => {
9351                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9352                        let mut req = fidl::new_empty!(
9353                            fidl::encoding::EmptyPayload,
9354                            fidl::encoding::DefaultFuchsiaResourceDialect
9355                        );
9356                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9357                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9358                        Ok(FileRequest::Close {
9359                            responder: FileCloseResponder {
9360                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9361                                tx_id: header.tx_id,
9362                            },
9363                        })
9364                    }
9365                    0x2658edee9decfc06 => {
9366                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9367                        let mut req = fidl::new_empty!(
9368                            fidl::encoding::EmptyPayload,
9369                            fidl::encoding::DefaultFuchsiaResourceDialect
9370                        );
9371                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9372                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9373                        Ok(FileRequest::Query {
9374                            responder: FileQueryResponder {
9375                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9376                                tx_id: header.tx_id,
9377                            },
9378                        })
9379                    }
9380                    0x5a61678f293ce16f => {
9381                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9382                        let mut req = fidl::new_empty!(
9383                            NodeDeprecatedCloneRequest,
9384                            fidl::encoding::DefaultFuchsiaResourceDialect
9385                        );
9386                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9387                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9388                        Ok(FileRequest::DeprecatedClone {
9389                            flags: req.flags,
9390                            object: req.object,
9391
9392                            control_handle,
9393                        })
9394                    }
9395                    0x78985e216314dafd => {
9396                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9397                        let mut req = fidl::new_empty!(
9398                            fidl::encoding::EmptyPayload,
9399                            fidl::encoding::DefaultFuchsiaResourceDialect
9400                        );
9401                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9402                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9403                        Ok(FileRequest::DeprecatedGetAttr {
9404                            responder: FileDeprecatedGetAttrResponder {
9405                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9406                                tx_id: header.tx_id,
9407                            },
9408                        })
9409                    }
9410                    0x4186c0f40d938f46 => {
9411                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9412                        let mut req = fidl::new_empty!(
9413                            NodeDeprecatedSetAttrRequest,
9414                            fidl::encoding::DefaultFuchsiaResourceDialect
9415                        );
9416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9417                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9418                        Ok(FileRequest::DeprecatedSetAttr {
9419                            flags: req.flags,
9420                            attributes: req.attributes,
9421
9422                            responder: FileDeprecatedSetAttrResponder {
9423                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9424                                tx_id: header.tx_id,
9425                            },
9426                        })
9427                    }
9428                    0x5b88fffb8eda3aa1 => {
9429                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9430                        let mut req = fidl::new_empty!(
9431                            fidl::encoding::EmptyPayload,
9432                            fidl::encoding::DefaultFuchsiaResourceDialect
9433                        );
9434                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9435                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9436                        Ok(FileRequest::DeprecatedGetFlags {
9437                            responder: FileDeprecatedGetFlagsResponder {
9438                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9439                                tx_id: header.tx_id,
9440                            },
9441                        })
9442                    }
9443                    0x5295b76c71fde733 => {
9444                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9445                        let mut req = fidl::new_empty!(
9446                            NodeDeprecatedSetFlagsRequest,
9447                            fidl::encoding::DefaultFuchsiaResourceDialect
9448                        );
9449                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9450                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9451                        Ok(FileRequest::DeprecatedSetFlags {
9452                            flags: req.flags,
9453
9454                            responder: FileDeprecatedSetFlagsResponder {
9455                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9456                                tx_id: header.tx_id,
9457                            },
9458                        })
9459                    }
9460                    0x176eb318f64ec23 => {
9461                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9462                        let mut req = fidl::new_empty!(
9463                            fidl::encoding::EmptyPayload,
9464                            fidl::encoding::DefaultFuchsiaResourceDialect
9465                        );
9466                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9467                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9468                        Ok(FileRequest::GetFlags {
9469                            responder: FileGetFlagsResponder {
9470                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9471                                tx_id: header.tx_id,
9472                            },
9473                        })
9474                    }
9475                    0x55a8028685791ea8 => {
9476                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9477                        let mut req = fidl::new_empty!(
9478                            NodeSetFlagsRequest,
9479                            fidl::encoding::DefaultFuchsiaResourceDialect
9480                        );
9481                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9482                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9483                        Ok(FileRequest::SetFlags {
9484                            flags: req.flags,
9485
9486                            responder: FileSetFlagsResponder {
9487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9488                                tx_id: header.tx_id,
9489                            },
9490                        })
9491                    }
9492                    0x6f344a1c6b0a0610 => {
9493                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9494                        let mut req = fidl::new_empty!(
9495                            fidl::encoding::EmptyPayload,
9496                            fidl::encoding::DefaultFuchsiaResourceDialect
9497                        );
9498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9499                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9500                        Ok(FileRequest::QueryFilesystem {
9501                            responder: FileQueryFilesystemResponder {
9502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9503                                tx_id: header.tx_id,
9504                            },
9505                        })
9506                    }
9507                    0x3d4396a638ea053b => {
9508                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9509                        let mut req = fidl::new_empty!(
9510                            NodeGetAttributesRequest,
9511                            fidl::encoding::DefaultFuchsiaResourceDialect
9512                        );
9513                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9514                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9515                        Ok(FileRequest::GetAttributes {
9516                            query: req.query,
9517
9518                            responder: FileGetAttributesResponder {
9519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9520                                tx_id: header.tx_id,
9521                            },
9522                        })
9523                    }
9524                    0x3308c1da5a89bf08 => {
9525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9526                        let mut req = fidl::new_empty!(
9527                            MutableNodeAttributes,
9528                            fidl::encoding::DefaultFuchsiaResourceDialect
9529                        );
9530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9531                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9532                        Ok(FileRequest::UpdateAttributes {
9533                            payload: req,
9534                            responder: FileUpdateAttributesResponder {
9535                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9536                                tx_id: header.tx_id,
9537                            },
9538                        })
9539                    }
9540                    0x2c5c27ca0ab5dc49 => {
9541                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9542                        let mut req = fidl::new_empty!(
9543                            fidl::encoding::EmptyPayload,
9544                            fidl::encoding::DefaultFuchsiaResourceDialect
9545                        );
9546                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9547                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9548                        Ok(FileRequest::Sync {
9549                            responder: FileSyncResponder {
9550                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9551                                tx_id: header.tx_id,
9552                            },
9553                        })
9554                    }
9555                    0x4b61033de007fcd0 => {
9556                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9557                        let mut req = fidl::new_empty!(
9558                            NodeListExtendedAttributesRequest,
9559                            fidl::encoding::DefaultFuchsiaResourceDialect
9560                        );
9561                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9562                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9563                        Ok(FileRequest::ListExtendedAttributes {
9564                            iterator: req.iterator,
9565
9566                            control_handle,
9567                        })
9568                    }
9569                    0x45ffa3ccfdeb76db => {
9570                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9571                        let mut req = fidl::new_empty!(
9572                            NodeGetExtendedAttributeRequest,
9573                            fidl::encoding::DefaultFuchsiaResourceDialect
9574                        );
9575                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9576                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9577                        Ok(FileRequest::GetExtendedAttribute {
9578                            name: req.name,
9579
9580                            responder: FileGetExtendedAttributeResponder {
9581                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9582                                tx_id: header.tx_id,
9583                            },
9584                        })
9585                    }
9586                    0x4a951362f681f23c => {
9587                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9588                        let mut req = fidl::new_empty!(
9589                            NodeSetExtendedAttributeRequest,
9590                            fidl::encoding::DefaultFuchsiaResourceDialect
9591                        );
9592                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9593                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9594                        Ok(FileRequest::SetExtendedAttribute {
9595                            name: req.name,
9596                            value: req.value,
9597                            mode: req.mode,
9598
9599                            responder: FileSetExtendedAttributeResponder {
9600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9601                                tx_id: header.tx_id,
9602                            },
9603                        })
9604                    }
9605                    0x7a0b9f3a9bf9032d => {
9606                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9607                        let mut req = fidl::new_empty!(
9608                            NodeRemoveExtendedAttributeRequest,
9609                            fidl::encoding::DefaultFuchsiaResourceDialect
9610                        );
9611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9612                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9613                        Ok(FileRequest::RemoveExtendedAttribute {
9614                            name: req.name,
9615
9616                            responder: FileRemoveExtendedAttributeResponder {
9617                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9618                                tx_id: header.tx_id,
9619                            },
9620                        })
9621                    }
9622                    0x57e419a298c8ede => {
9623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9624                        let mut req = fidl::new_empty!(
9625                            ReadableReadRequest,
9626                            fidl::encoding::DefaultFuchsiaResourceDialect
9627                        );
9628                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9629                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9630                        Ok(FileRequest::Read {
9631                            count: req.count,
9632
9633                            responder: FileReadResponder {
9634                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9635                                tx_id: header.tx_id,
9636                            },
9637                        })
9638                    }
9639                    0x6a31437832469f82 => {
9640                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9641                        let mut req = fidl::new_empty!(
9642                            WritableWriteRequest,
9643                            fidl::encoding::DefaultFuchsiaResourceDialect
9644                        );
9645                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9646                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9647                        Ok(FileRequest::Write {
9648                            data: req.data,
9649
9650                            responder: FileWriteResponder {
9651                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9652                                tx_id: header.tx_id,
9653                            },
9654                        })
9655                    }
9656                    0x68b5ac00c62906bc => {
9657                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9658                        let mut req = fidl::new_empty!(
9659                            fidl::encoding::EmptyPayload,
9660                            fidl::encoding::DefaultFuchsiaResourceDialect
9661                        );
9662                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9663                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9664                        Ok(FileRequest::Describe {
9665                            responder: FileDescribeResponder {
9666                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9667                                tx_id: header.tx_id,
9668                            },
9669                        })
9670                    }
9671                    0x78079168162c5207 => {
9672                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9673                        let mut req = fidl::new_empty!(
9674                            FileSeekRequest,
9675                            fidl::encoding::DefaultFuchsiaResourceDialect
9676                        );
9677                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9678                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9679                        Ok(FileRequest::Seek {
9680                            origin: req.origin,
9681                            offset: req.offset,
9682
9683                            responder: FileSeekResponder {
9684                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9685                                tx_id: header.tx_id,
9686                            },
9687                        })
9688                    }
9689                    0x1607a293a60d723e => {
9690                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9691                        let mut req = fidl::new_empty!(
9692                            FileReadAtRequest,
9693                            fidl::encoding::DefaultFuchsiaResourceDialect
9694                        );
9695                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9696                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9697                        Ok(FileRequest::ReadAt {
9698                            count: req.count,
9699                            offset: req.offset,
9700
9701                            responder: FileReadAtResponder {
9702                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9703                                tx_id: header.tx_id,
9704                            },
9705                        })
9706                    }
9707                    0x793eefc0045e792b => {
9708                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9709                        let mut req = fidl::new_empty!(
9710                            FileWriteAtRequest,
9711                            fidl::encoding::DefaultFuchsiaResourceDialect
9712                        );
9713                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9714                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9715                        Ok(FileRequest::WriteAt {
9716                            data: req.data,
9717                            offset: req.offset,
9718
9719                            responder: FileWriteAtResponder {
9720                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9721                                tx_id: header.tx_id,
9722                            },
9723                        })
9724                    }
9725                    0x2b80825f0535743a => {
9726                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9727                        let mut req = fidl::new_empty!(
9728                            FileResizeRequest,
9729                            fidl::encoding::DefaultFuchsiaResourceDialect
9730                        );
9731                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9732                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9733                        Ok(FileRequest::Resize {
9734                            length: req.length,
9735
9736                            responder: FileResizeResponder {
9737                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9738                                tx_id: header.tx_id,
9739                            },
9740                        })
9741                    }
9742                    0xa6a9e654cbf62b => {
9743                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9744                        let mut req = fidl::new_empty!(
9745                            FileGetBackingMemoryRequest,
9746                            fidl::encoding::DefaultFuchsiaResourceDialect
9747                        );
9748                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9749                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9750                        Ok(FileRequest::GetBackingMemory {
9751                            flags: req.flags,
9752
9753                            responder: FileGetBackingMemoryResponder {
9754                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9755                                tx_id: header.tx_id,
9756                            },
9757                        })
9758                    }
9759                    0x77fa0c330b57fd2e => {
9760                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9761                        let mut req = fidl::new_empty!(
9762                            FileAllocateRequest,
9763                            fidl::encoding::DefaultFuchsiaResourceDialect
9764                        );
9765                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9766                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9767                        Ok(FileRequest::Allocate {
9768                            offset: req.offset,
9769                            length: req.length,
9770                            mode: req.mode,
9771
9772                            responder: FileAllocateResponder {
9773                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9774                                tx_id: header.tx_id,
9775                            },
9776                        })
9777                    }
9778                    0x2c421ec3faaeb8bb => {
9779                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9780                        let mut req = fidl::new_empty!(
9781                            FileEnableVerityRequest,
9782                            fidl::encoding::DefaultFuchsiaResourceDialect
9783                        );
9784                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9785                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9786                        Ok(FileRequest::EnableVerity {
9787                            options: req.options,
9788
9789                            responder: FileEnableVerityResponder {
9790                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9791                                tx_id: header.tx_id,
9792                            },
9793                        })
9794                    }
9795                    _ if header.tx_id == 0
9796                        && header
9797                            .dynamic_flags()
9798                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9799                    {
9800                        Ok(FileRequest::_UnknownMethod {
9801                            ordinal: header.ordinal,
9802                            control_handle: FileControlHandle { inner: this.inner.clone() },
9803                            method_type: fidl::MethodType::OneWay,
9804                        })
9805                    }
9806                    _ if header
9807                        .dynamic_flags()
9808                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9809                    {
9810                        this.inner.send_framework_err(
9811                            fidl::encoding::FrameworkErr::UnknownMethod,
9812                            header.tx_id,
9813                            header.ordinal,
9814                            header.dynamic_flags(),
9815                            (bytes, handles),
9816                        )?;
9817                        Ok(FileRequest::_UnknownMethod {
9818                            ordinal: header.ordinal,
9819                            control_handle: FileControlHandle { inner: this.inner.clone() },
9820                            method_type: fidl::MethodType::TwoWay,
9821                        })
9822                    }
9823                    _ => Err(fidl::Error::UnknownOrdinal {
9824                        ordinal: header.ordinal,
9825                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9826                    }),
9827                }))
9828            },
9829        )
9830    }
9831}
9832
9833/// A [`Node`] which contains a sequence of bytes of definite length.
9834///
9835/// NOTE: cloned connections do not share their seek offset with their source
9836/// connection.
9837#[derive(Debug)]
9838pub enum FileRequest {
9839    /// Acquires an advisory lock on the underlying file.
9840    ///
9841    /// The lock lasts until either this connection is closed or
9842    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9843    /// explicitly.
9844    ///
9845    /// Advisory locks are purely advisory. They do not prevent actual read or
9846    /// write operations from occurring on the file, either through this
9847    /// connection or through other connections.
9848    ///
9849    /// This method requires the following rights:
9850    ///
9851    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9852    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9853    ///   [`AdvisoryLockType.WRITE`].
9854    ///
9855    /// # Errors
9856    ///
9857    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9858    ///   example, another connection might hold a conflicting lock type.
9859    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9860    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9861    ///   to acquire the given type of lock.
9862    AdvisoryLock {
9863        request: AdvisoryLockRequest,
9864        responder: FileAdvisoryLockResponder,
9865    },
9866    /// Creates a link to this this object with name `dst` in the directory represented by
9867    /// `dst_parent_token`.
9868    ///
9869    /// `dst` must be a resolved object name. Including "/" in the string will return
9870    /// `ZX_ERR_INVALID_ARGS`.
9871    ///
9872    /// This method requires the maximal set of rights supported by the filesystem for this object.
9873    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9874    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9875    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9876    /// `ZX_ERR_ACCESS_DENIED`.
9877    ///
9878    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9879    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9880    ///
9881    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9882    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9883    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9884    ///
9885    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9886    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9887    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9888    LinkInto {
9889        dst_parent_token: fidl::Event,
9890        dst: String,
9891        responder: FileLinkIntoResponder,
9892    },
9893    Clone {
9894        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9895        control_handle: FileControlHandle,
9896    },
9897    /// Terminates the connection.
9898    ///
9899    /// After calling `Close`, the client must not send any other requests.
9900    ///
9901    /// Servers, after sending the status response, should close the connection
9902    /// regardless of status and without sending an epitaph.
9903    ///
9904    /// Closing the client end of the channel should be semantically equivalent
9905    /// to calling `Close` without knowing when the close has completed or its
9906    /// status.
9907    Close {
9908        responder: FileCloseResponder,
9909    },
9910    Query {
9911        responder: FileQueryResponder,
9912    },
9913    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9914    DeprecatedClone {
9915        flags: OpenFlags,
9916        object: fidl::endpoints::ServerEnd<NodeMarker>,
9917        control_handle: FileControlHandle,
9918    },
9919    /// DEPRECATED - Use `Node.GetAttributes` instead.
9920    ///
9921    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9922    DeprecatedGetAttr {
9923        responder: FileDeprecatedGetAttrResponder,
9924    },
9925    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9926    DeprecatedSetAttr {
9927        flags: NodeAttributeFlags,
9928        attributes: NodeAttributes,
9929        responder: FileDeprecatedSetAttrResponder,
9930    },
9931    /// [DEPRECATED - Use new GetFlags method instead.]
9932    DeprecatedGetFlags {
9933        responder: FileDeprecatedGetFlagsResponder,
9934    },
9935    /// [DEPRECATED - Use new SetFlags method instead.]
9936    DeprecatedSetFlags {
9937        flags: OpenFlags,
9938        responder: FileDeprecatedSetFlagsResponder,
9939    },
9940    /// Queries the flags that apply to this node after it has been opened/created. This method does
9941    /// not require any rights.
9942    ///
9943    /// Note that the final set of flags that apply to the connection may differ from those
9944    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9945    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9946    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9947    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9948    GetFlags {
9949        responder: FileGetFlagsResponder,
9950    },
9951    /// Sets the flags that apply to this node after it has been opened. This method does not
9952    /// require any rights.
9953    ///
9954    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9955    /// clear append mode.
9956    ///
9957    /// Errors:
9958    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9959    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9960    SetFlags {
9961        flags: Flags,
9962        responder: FileSetFlagsResponder,
9963    },
9964    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
9965    /// volume has different settings or the storage is accounted seperately from the rest of the
9966    /// filesystem that may be reported instead of filesystem-wide details.
9967    QueryFilesystem {
9968        responder: FileQueryFilesystemResponder,
9969    },
9970    /// Acquires information about the node.
9971    ///
9972    /// The attributes of a node should be stable, independent of the
9973    /// specific protocol used to access it.
9974    ///
9975    /// If a particular attribute is not applicable or not supported,
9976    /// filesystems should leave the corresponding field absent.
9977    ///
9978    /// + `query` a bit-mask specifying which attributes to fetch. The server
9979    ///   should not return more than necessary.
9980    /// - `attributes` the returned attributes.
9981    ///
9982    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9983    GetAttributes {
9984        query: NodeAttributesQuery,
9985        responder: FileGetAttributesResponder,
9986    },
9987    /// Updates information about the node.
9988    ///
9989    /// + `attributes` the presence of a table field in `attributes` indicates
9990    /// the intent to update the corresponding attribute.
9991    ///
9992    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9993    ///
9994    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9995    UpdateAttributes {
9996        payload: MutableNodeAttributes,
9997        responder: FileUpdateAttributesResponder,
9998    },
9999    /// Synchronizes updates to the node to the underlying media, if it exists.
10000    ///
10001    /// This method will return when the filesystem server has flushed the
10002    /// relevant updates to the underlying media, but does not guarantee the
10003    /// underlying media has persisted the information, nor that any information
10004    /// is committed to hardware. Clients may use `Sync` to ensure ordering
10005    /// between operations.
10006    ///
10007    /// This method does not require any rights.
10008    Sync {
10009        responder: FileSyncResponder,
10010    },
10011    /// Creates an iterator over all the extended attribute names associated
10012    /// with this node. If an error occurs it is returned as an epitaph on the
10013    /// iterator request channel, and then the channel is closed.
10014    ///
10015    /// GetExtendedAttributes can be used with any of these names to retrieve
10016    /// the associated value.
10017    ///
10018    /// This method requires the [`Rights.READ_BYTES`] right.
10019    ListExtendedAttributes {
10020        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
10021        control_handle: FileControlHandle,
10022    },
10023    /// Get the value associated with the given attribute `name` for this node.
10024    ///
10025    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
10026    /// particular structure is imposed on them.
10027    ///
10028    /// This method requires the [`Rights.READ_BYTES`] right.
10029    GetExtendedAttribute {
10030        name: Vec<u8>,
10031        responder: FileGetExtendedAttributeResponder,
10032    },
10033    /// Set the value for the given attribute `name` to `value` for this node.
10034    ///
10035    /// The attribute name may exist, in which case the attribute is updated.
10036    /// If the attribute doesn't exist, it is created. The name should have no
10037    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
10038    ///
10039    /// This method requires the [`Rights.WRITE_BYTES`] right.
10040    SetExtendedAttribute {
10041        name: Vec<u8>,
10042        value: ExtendedAttributeValue,
10043        mode: SetExtendedAttributeMode,
10044        responder: FileSetExtendedAttributeResponder,
10045    },
10046    /// Remove the specified extended attribute.
10047    ///
10048    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
10049    ///
10050    /// This method requires the [`Rights.WRITE_BYTES`] right.
10051    RemoveExtendedAttribute {
10052        name: Vec<u8>,
10053        responder: FileRemoveExtendedAttributeResponder,
10054    },
10055    /// Reads up to 'count' bytes at the seek offset.
10056    /// The seek offset is moved forward by the number of bytes read.
10057    ///
10058    /// ## Invariants
10059    ///
10060    /// * The returned `data.length` will never be greater than `count`.
10061    /// * If `data.length` is less than `count`, it means that the seek offset
10062    ///   has reached the end of file as part of this operation.
10063    /// * If `data.length` is zero while `count` is not, it means that the
10064    ///   seek offset is already at or beyond the end of file, and no data could
10065    ///   be read.
10066    /// * If `count` is zero, the server should perform all the checks ensuring
10067    ///   read access without actually read anything, and return an empty
10068    ///   `data` vector.
10069    ///
10070    /// This method requires the [`Rights.READ_BYTES`] right.
10071    ///
10072    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10073    Read {
10074        count: u64,
10075        responder: FileReadResponder,
10076    },
10077    /// Writes data at the seek offset.
10078    /// The seek offset is moved forward by the number of bytes written.
10079    /// If the file is in append mode, the seek offset is first set to the end
10080    /// of the file, followed by the write, in one atomic step.
10081    ///
10082    /// The file size may grow if the seek offset plus `data.length` is beyond
10083    /// the current end of file.
10084    ///
10085    /// + request `data` the byte buffer to write to the file.
10086    /// - response `actual_count` the number of bytes written.
10087    ///
10088    /// ## Invariants
10089    ///
10090    /// * The returned `actual_count` will never be greater than `data.length`.
10091    /// * If the server is unable to write all the data due to e.g. not enough
10092    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10093    ///   could be written, an error is returned.
10094    /// * If `data.length` is zero, the server should perform all the checks
10095    ///   ensuring write access without mutating the file and return a
10096    ///   successful write of zero bytes.  The seek offset is still updated if
10097    ///   in append mode.
10098    ///
10099    /// This method requires the [`Rights.WRITE_BYTES`] right.
10100    Write {
10101        data: Vec<u8>,
10102        responder: FileWriteResponder,
10103    },
10104    Describe {
10105        responder: FileDescribeResponder,
10106    },
10107    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
10108    /// will occur. The seek offset is specific to each file connection.
10109    ///
10110    /// + request `origin` the reference point where `offset` will be based on.
10111    /// + request `offset` the number of bytes to seek.
10112    /// - response `offset_from_start` the adjusted seek offset, from the start
10113    ///   of the file.
10114    ///
10115    /// This method does not require any rights.
10116    Seek {
10117        origin: SeekOrigin,
10118        offset: i64,
10119        responder: FileSeekResponder,
10120    },
10121    /// Reads up to 'count' bytes at the provided offset.
10122    /// Does not affect the seek offset.
10123    ///
10124    /// ## Invariants
10125    ///
10126    /// * The returned `data.length` will never be greater than `count`.
10127    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10128    ///   the end of file as part of this operation.
10129    /// * If `data.length` is zero while `count` is not, it means that `offset`
10130    ///   is at or past the end of file, and no data can be read.
10131    /// * If `count` is zero, the server should perform all the checks ensuring
10132    ///   read access without actually reading anything, and return an empty
10133    ///   `data` vector.
10134    ///
10135    /// This method requires the [`Rights.READ_BYTES`] right.
10136    ///
10137    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10138    ReadAt {
10139        count: u64,
10140        offset: u64,
10141        responder: FileReadAtResponder,
10142    },
10143    /// Writes data at the provided offset.
10144    /// Does not affect the seek offset.
10145    ///
10146    /// The file size may grow if `offset` plus `data.length` is past the
10147    /// current end of file.
10148    ///
10149    /// + request `data` the byte buffer to write to the file.
10150    /// + request `offset` the offset from start of the file to begin writing.
10151    /// - response `actual_count` the number of bytes written.
10152    ///
10153    /// ## Invariants
10154    ///
10155    /// * The returned `actual_count` will never be greater than `data.length`.
10156    /// * If the server is unable to write all the data due to e.g. not enough
10157    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10158    ///   could be written, an error is returned.
10159    /// * If `data.length` is zero, the server should perform all the checks
10160    ///   ensuring write access without mutating the file, and will return a
10161    ///   successful write of zero bytes.
10162    ///
10163    /// This method requires the [`Rights.WRITE_BYTES`] right.
10164    WriteAt {
10165        data: Vec<u8>,
10166        offset: u64,
10167        responder: FileWriteAtResponder,
10168    },
10169    /// Shrinks or grows the file size to 'length' bytes.
10170    ///
10171    /// If file size is reduced by this operation, the extra trailing data'
10172    /// is discarded.
10173    /// If file size is increased by this operation, the extended area appears
10174    /// as if it was zeroed.
10175    ///
10176    /// This method requires the [`Rights.WRITE_BYTES`] right.
10177    Resize {
10178        length: u64,
10179        responder: FileResizeResponder,
10180    },
10181    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10182    /// with the requested access rights.
10183    ///
10184    /// Implementations are not required to implement files backed by VMOs so
10185    /// this request may fail. Additionally, implementations may only support
10186    /// a certain subset of the flags. Clients should be prepared with fallback
10187    /// behavior if this request fails.
10188    ///
10189    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10190    /// implementation is free to choose the semantics of the returned VMO.
10191    ///
10192    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10193    /// - response `vmo` the requested [`zx.Handle:VMO`].
10194    /// * error a [`zx.Status`] value indicating the failure.
10195    ///
10196    /// This method requires the following rights:
10197    ///
10198    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10199    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10200    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10201    GetBackingMemory {
10202        flags: VmoFlags,
10203        responder: FileGetBackingMemoryResponder,
10204    },
10205    /// Pre-allocate on-disk space for this file.
10206    Allocate {
10207        offset: u64,
10208        length: u64,
10209        mode: AllocateMode,
10210        responder: FileAllocateResponder,
10211    },
10212    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10213    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10214    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10215    /// rejected. This method can take some time to complete as it depends on the size of the file.
10216    /// This method can be aborted by closing the connection that this method was issued on.
10217    ///
10218    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10219    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10220    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10221    /// Also returns any error that might arise from reading the file, or from flushing the file,
10222    /// such as `ZX_ERR_IO`.
10223    EnableVerity {
10224        options: VerificationOptions,
10225        responder: FileEnableVerityResponder,
10226    },
10227    /// An interaction was received which does not match any known method.
10228    #[non_exhaustive]
10229    _UnknownMethod {
10230        /// Ordinal of the method that was called.
10231        ordinal: u64,
10232        control_handle: FileControlHandle,
10233        method_type: fidl::MethodType,
10234    },
10235}
10236
10237impl FileRequest {
10238    #[allow(irrefutable_let_patterns)]
10239    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10240        if let FileRequest::AdvisoryLock { request, responder } = self {
10241            Some((request, responder))
10242        } else {
10243            None
10244        }
10245    }
10246
10247    #[allow(irrefutable_let_patterns)]
10248    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10249        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10250            Some((dst_parent_token, dst, responder))
10251        } else {
10252            None
10253        }
10254    }
10255
10256    #[allow(irrefutable_let_patterns)]
10257    pub fn into_clone(
10258        self,
10259    ) -> Option<(
10260        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10261        FileControlHandle,
10262    )> {
10263        if let FileRequest::Clone { request, control_handle } = self {
10264            Some((request, control_handle))
10265        } else {
10266            None
10267        }
10268    }
10269
10270    #[allow(irrefutable_let_patterns)]
10271    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10272        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10273    }
10274
10275    #[allow(irrefutable_let_patterns)]
10276    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10277        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10278    }
10279
10280    #[allow(irrefutable_let_patterns)]
10281    pub fn into_deprecated_clone(
10282        self,
10283    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10284        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10285            Some((flags, object, control_handle))
10286        } else {
10287            None
10288        }
10289    }
10290
10291    #[allow(irrefutable_let_patterns)]
10292    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10293        if let FileRequest::DeprecatedGetAttr { responder } = self {
10294            Some((responder))
10295        } else {
10296            None
10297        }
10298    }
10299
10300    #[allow(irrefutable_let_patterns)]
10301    pub fn into_deprecated_set_attr(
10302        self,
10303    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10304        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10305            Some((flags, attributes, responder))
10306        } else {
10307            None
10308        }
10309    }
10310
10311    #[allow(irrefutable_let_patterns)]
10312    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10313        if let FileRequest::DeprecatedGetFlags { responder } = self {
10314            Some((responder))
10315        } else {
10316            None
10317        }
10318    }
10319
10320    #[allow(irrefutable_let_patterns)]
10321    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10322        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10323            Some((flags, responder))
10324        } else {
10325            None
10326        }
10327    }
10328
10329    #[allow(irrefutable_let_patterns)]
10330    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10331        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10332    }
10333
10334    #[allow(irrefutable_let_patterns)]
10335    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10336        if let FileRequest::SetFlags { flags, responder } = self {
10337            Some((flags, responder))
10338        } else {
10339            None
10340        }
10341    }
10342
10343    #[allow(irrefutable_let_patterns)]
10344    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10345        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10346    }
10347
10348    #[allow(irrefutable_let_patterns)]
10349    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10350        if let FileRequest::GetAttributes { query, responder } = self {
10351            Some((query, responder))
10352        } else {
10353            None
10354        }
10355    }
10356
10357    #[allow(irrefutable_let_patterns)]
10358    pub fn into_update_attributes(
10359        self,
10360    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10361        if let FileRequest::UpdateAttributes { payload, responder } = self {
10362            Some((payload, responder))
10363        } else {
10364            None
10365        }
10366    }
10367
10368    #[allow(irrefutable_let_patterns)]
10369    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10370        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10371    }
10372
10373    #[allow(irrefutable_let_patterns)]
10374    pub fn into_list_extended_attributes(
10375        self,
10376    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10377    {
10378        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10379            Some((iterator, control_handle))
10380        } else {
10381            None
10382        }
10383    }
10384
10385    #[allow(irrefutable_let_patterns)]
10386    pub fn into_get_extended_attribute(
10387        self,
10388    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10389        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10390            Some((name, responder))
10391        } else {
10392            None
10393        }
10394    }
10395
10396    #[allow(irrefutable_let_patterns)]
10397    pub fn into_set_extended_attribute(
10398        self,
10399    ) -> Option<(
10400        Vec<u8>,
10401        ExtendedAttributeValue,
10402        SetExtendedAttributeMode,
10403        FileSetExtendedAttributeResponder,
10404    )> {
10405        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10406            Some((name, value, mode, responder))
10407        } else {
10408            None
10409        }
10410    }
10411
10412    #[allow(irrefutable_let_patterns)]
10413    pub fn into_remove_extended_attribute(
10414        self,
10415    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10416        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10417            Some((name, responder))
10418        } else {
10419            None
10420        }
10421    }
10422
10423    #[allow(irrefutable_let_patterns)]
10424    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10425        if let FileRequest::Read { count, responder } = self {
10426            Some((count, responder))
10427        } else {
10428            None
10429        }
10430    }
10431
10432    #[allow(irrefutable_let_patterns)]
10433    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10434        if let FileRequest::Write { data, responder } = self {
10435            Some((data, responder))
10436        } else {
10437            None
10438        }
10439    }
10440
10441    #[allow(irrefutable_let_patterns)]
10442    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10443        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10444    }
10445
10446    #[allow(irrefutable_let_patterns)]
10447    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10448        if let FileRequest::Seek { origin, offset, responder } = self {
10449            Some((origin, offset, responder))
10450        } else {
10451            None
10452        }
10453    }
10454
10455    #[allow(irrefutable_let_patterns)]
10456    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10457        if let FileRequest::ReadAt { count, offset, responder } = self {
10458            Some((count, offset, responder))
10459        } else {
10460            None
10461        }
10462    }
10463
10464    #[allow(irrefutable_let_patterns)]
10465    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10466        if let FileRequest::WriteAt { data, offset, responder } = self {
10467            Some((data, offset, responder))
10468        } else {
10469            None
10470        }
10471    }
10472
10473    #[allow(irrefutable_let_patterns)]
10474    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10475        if let FileRequest::Resize { length, responder } = self {
10476            Some((length, responder))
10477        } else {
10478            None
10479        }
10480    }
10481
10482    #[allow(irrefutable_let_patterns)]
10483    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10484        if let FileRequest::GetBackingMemory { flags, responder } = self {
10485            Some((flags, responder))
10486        } else {
10487            None
10488        }
10489    }
10490
10491    #[allow(irrefutable_let_patterns)]
10492    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10493        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10494            Some((offset, length, mode, responder))
10495        } else {
10496            None
10497        }
10498    }
10499
10500    #[allow(irrefutable_let_patterns)]
10501    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10502        if let FileRequest::EnableVerity { options, responder } = self {
10503            Some((options, responder))
10504        } else {
10505            None
10506        }
10507    }
10508
10509    /// Name of the method defined in FIDL
10510    pub fn method_name(&self) -> &'static str {
10511        match *self {
10512            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10513            FileRequest::LinkInto { .. } => "link_into",
10514            FileRequest::Clone { .. } => "clone",
10515            FileRequest::Close { .. } => "close",
10516            FileRequest::Query { .. } => "query",
10517            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10518            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10519            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10520            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10521            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10522            FileRequest::GetFlags { .. } => "get_flags",
10523            FileRequest::SetFlags { .. } => "set_flags",
10524            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10525            FileRequest::GetAttributes { .. } => "get_attributes",
10526            FileRequest::UpdateAttributes { .. } => "update_attributes",
10527            FileRequest::Sync { .. } => "sync",
10528            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10529            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10530            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10531            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10532            FileRequest::Read { .. } => "read",
10533            FileRequest::Write { .. } => "write",
10534            FileRequest::Describe { .. } => "describe",
10535            FileRequest::Seek { .. } => "seek",
10536            FileRequest::ReadAt { .. } => "read_at",
10537            FileRequest::WriteAt { .. } => "write_at",
10538            FileRequest::Resize { .. } => "resize",
10539            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10540            FileRequest::Allocate { .. } => "allocate",
10541            FileRequest::EnableVerity { .. } => "enable_verity",
10542            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10543                "unknown one-way method"
10544            }
10545            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10546                "unknown two-way method"
10547            }
10548        }
10549    }
10550}
10551
10552#[derive(Debug, Clone)]
10553pub struct FileControlHandle {
10554    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10555}
10556
10557impl FileControlHandle {
10558    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10559        self.inner.shutdown_with_epitaph(status.into())
10560    }
10561}
10562
10563impl fidl::endpoints::ControlHandle for FileControlHandle {
10564    fn shutdown(&self) {
10565        self.inner.shutdown()
10566    }
10567
10568    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10569        self.inner.shutdown_with_epitaph(status)
10570    }
10571
10572    fn is_closed(&self) -> bool {
10573        self.inner.channel().is_closed()
10574    }
10575    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10576        self.inner.channel().on_closed()
10577    }
10578
10579    #[cfg(target_os = "fuchsia")]
10580    fn signal_peer(
10581        &self,
10582        clear_mask: zx::Signals,
10583        set_mask: zx::Signals,
10584    ) -> Result<(), zx_status::Status> {
10585        use fidl::Peered;
10586        self.inner.channel().signal_peer(clear_mask, set_mask)
10587    }
10588}
10589
10590impl FileControlHandle {
10591    pub fn send_on_open_(
10592        &self,
10593        mut s: i32,
10594        mut info: Option<NodeInfoDeprecated>,
10595    ) -> Result<(), fidl::Error> {
10596        self.inner.send::<NodeOnOpenRequest>(
10597            (s, info.as_mut()),
10598            0,
10599            0x7fc7bbb1dbfd1972,
10600            fidl::encoding::DynamicFlags::FLEXIBLE,
10601        )
10602    }
10603
10604    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10605        self.inner.send::<Representation>(
10606            &mut payload,
10607            0,
10608            0x5cb40567d80a510c,
10609            fidl::encoding::DynamicFlags::empty(),
10610        )
10611    }
10612}
10613
10614#[must_use = "FIDL methods require a response to be sent"]
10615#[derive(Debug)]
10616pub struct FileAdvisoryLockResponder {
10617    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10618    tx_id: u32,
10619}
10620
10621/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10622/// if the responder is dropped without sending a response, so that the client
10623/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10624impl std::ops::Drop for FileAdvisoryLockResponder {
10625    fn drop(&mut self) {
10626        self.control_handle.shutdown();
10627        // Safety: drops once, never accessed again
10628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10629    }
10630}
10631
10632impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10633    type ControlHandle = FileControlHandle;
10634
10635    fn control_handle(&self) -> &FileControlHandle {
10636        &self.control_handle
10637    }
10638
10639    fn drop_without_shutdown(mut self) {
10640        // Safety: drops once, never accessed again due to mem::forget
10641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10642        // Prevent Drop from running (which would shut down the channel)
10643        std::mem::forget(self);
10644    }
10645}
10646
10647impl FileAdvisoryLockResponder {
10648    /// Sends a response to the FIDL transaction.
10649    ///
10650    /// Sets the channel to shutdown if an error occurs.
10651    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10652        let _result = self.send_raw(result);
10653        if _result.is_err() {
10654            self.control_handle.shutdown();
10655        }
10656        self.drop_without_shutdown();
10657        _result
10658    }
10659
10660    /// Similar to "send" but does not shutdown the channel if an error occurs.
10661    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10662        let _result = self.send_raw(result);
10663        self.drop_without_shutdown();
10664        _result
10665    }
10666
10667    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10668        self.control_handle
10669            .inner
10670            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10671                result,
10672                self.tx_id,
10673                0x6ee9c0ad53ec87aa,
10674                fidl::encoding::DynamicFlags::empty(),
10675            )
10676    }
10677}
10678
10679#[must_use = "FIDL methods require a response to be sent"]
10680#[derive(Debug)]
10681pub struct FileLinkIntoResponder {
10682    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10683    tx_id: u32,
10684}
10685
10686/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10687/// if the responder is dropped without sending a response, so that the client
10688/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10689impl std::ops::Drop for FileLinkIntoResponder {
10690    fn drop(&mut self) {
10691        self.control_handle.shutdown();
10692        // Safety: drops once, never accessed again
10693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10694    }
10695}
10696
10697impl fidl::endpoints::Responder for FileLinkIntoResponder {
10698    type ControlHandle = FileControlHandle;
10699
10700    fn control_handle(&self) -> &FileControlHandle {
10701        &self.control_handle
10702    }
10703
10704    fn drop_without_shutdown(mut self) {
10705        // Safety: drops once, never accessed again due to mem::forget
10706        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10707        // Prevent Drop from running (which would shut down the channel)
10708        std::mem::forget(self);
10709    }
10710}
10711
10712impl FileLinkIntoResponder {
10713    /// Sends a response to the FIDL transaction.
10714    ///
10715    /// Sets the channel to shutdown if an error occurs.
10716    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10717        let _result = self.send_raw(result);
10718        if _result.is_err() {
10719            self.control_handle.shutdown();
10720        }
10721        self.drop_without_shutdown();
10722        _result
10723    }
10724
10725    /// Similar to "send" but does not shutdown the channel if an error occurs.
10726    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10727        let _result = self.send_raw(result);
10728        self.drop_without_shutdown();
10729        _result
10730    }
10731
10732    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10733        self.control_handle
10734            .inner
10735            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10736                result,
10737                self.tx_id,
10738                0x54f3949246a03e74,
10739                fidl::encoding::DynamicFlags::empty(),
10740            )
10741    }
10742}
10743
10744#[must_use = "FIDL methods require a response to be sent"]
10745#[derive(Debug)]
10746pub struct FileCloseResponder {
10747    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10748    tx_id: u32,
10749}
10750
10751/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10752/// if the responder is dropped without sending a response, so that the client
10753/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10754impl std::ops::Drop for FileCloseResponder {
10755    fn drop(&mut self) {
10756        self.control_handle.shutdown();
10757        // Safety: drops once, never accessed again
10758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10759    }
10760}
10761
10762impl fidl::endpoints::Responder for FileCloseResponder {
10763    type ControlHandle = FileControlHandle;
10764
10765    fn control_handle(&self) -> &FileControlHandle {
10766        &self.control_handle
10767    }
10768
10769    fn drop_without_shutdown(mut self) {
10770        // Safety: drops once, never accessed again due to mem::forget
10771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10772        // Prevent Drop from running (which would shut down the channel)
10773        std::mem::forget(self);
10774    }
10775}
10776
10777impl FileCloseResponder {
10778    /// Sends a response to the FIDL transaction.
10779    ///
10780    /// Sets the channel to shutdown if an error occurs.
10781    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10782        let _result = self.send_raw(result);
10783        if _result.is_err() {
10784            self.control_handle.shutdown();
10785        }
10786        self.drop_without_shutdown();
10787        _result
10788    }
10789
10790    /// Similar to "send" but does not shutdown the channel if an error occurs.
10791    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10792        let _result = self.send_raw(result);
10793        self.drop_without_shutdown();
10794        _result
10795    }
10796
10797    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10798        self.control_handle
10799            .inner
10800            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10801                result,
10802                self.tx_id,
10803                0x5ac5d459ad7f657e,
10804                fidl::encoding::DynamicFlags::empty(),
10805            )
10806    }
10807}
10808
10809#[must_use = "FIDL methods require a response to be sent"]
10810#[derive(Debug)]
10811pub struct FileQueryResponder {
10812    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10813    tx_id: u32,
10814}
10815
10816/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10817/// if the responder is dropped without sending a response, so that the client
10818/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10819impl std::ops::Drop for FileQueryResponder {
10820    fn drop(&mut self) {
10821        self.control_handle.shutdown();
10822        // Safety: drops once, never accessed again
10823        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10824    }
10825}
10826
10827impl fidl::endpoints::Responder for FileQueryResponder {
10828    type ControlHandle = FileControlHandle;
10829
10830    fn control_handle(&self) -> &FileControlHandle {
10831        &self.control_handle
10832    }
10833
10834    fn drop_without_shutdown(mut self) {
10835        // Safety: drops once, never accessed again due to mem::forget
10836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10837        // Prevent Drop from running (which would shut down the channel)
10838        std::mem::forget(self);
10839    }
10840}
10841
10842impl FileQueryResponder {
10843    /// Sends a response to the FIDL transaction.
10844    ///
10845    /// Sets the channel to shutdown if an error occurs.
10846    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10847        let _result = self.send_raw(protocol);
10848        if _result.is_err() {
10849            self.control_handle.shutdown();
10850        }
10851        self.drop_without_shutdown();
10852        _result
10853    }
10854
10855    /// Similar to "send" but does not shutdown the channel if an error occurs.
10856    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10857        let _result = self.send_raw(protocol);
10858        self.drop_without_shutdown();
10859        _result
10860    }
10861
10862    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10863        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10864            (protocol,),
10865            self.tx_id,
10866            0x2658edee9decfc06,
10867            fidl::encoding::DynamicFlags::empty(),
10868        )
10869    }
10870}
10871
10872#[must_use = "FIDL methods require a response to be sent"]
10873#[derive(Debug)]
10874pub struct FileDeprecatedGetAttrResponder {
10875    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10876    tx_id: u32,
10877}
10878
10879/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10880/// if the responder is dropped without sending a response, so that the client
10881/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10882impl std::ops::Drop for FileDeprecatedGetAttrResponder {
10883    fn drop(&mut self) {
10884        self.control_handle.shutdown();
10885        // Safety: drops once, never accessed again
10886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10887    }
10888}
10889
10890impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
10891    type ControlHandle = FileControlHandle;
10892
10893    fn control_handle(&self) -> &FileControlHandle {
10894        &self.control_handle
10895    }
10896
10897    fn drop_without_shutdown(mut self) {
10898        // Safety: drops once, never accessed again due to mem::forget
10899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10900        // Prevent Drop from running (which would shut down the channel)
10901        std::mem::forget(self);
10902    }
10903}
10904
10905impl FileDeprecatedGetAttrResponder {
10906    /// Sends a response to the FIDL transaction.
10907    ///
10908    /// Sets the channel to shutdown if an error occurs.
10909    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10910        let _result = self.send_raw(s, attributes);
10911        if _result.is_err() {
10912            self.control_handle.shutdown();
10913        }
10914        self.drop_without_shutdown();
10915        _result
10916    }
10917
10918    /// Similar to "send" but does not shutdown the channel if an error occurs.
10919    pub fn send_no_shutdown_on_err(
10920        self,
10921        mut s: i32,
10922        mut attributes: &NodeAttributes,
10923    ) -> Result<(), fidl::Error> {
10924        let _result = self.send_raw(s, attributes);
10925        self.drop_without_shutdown();
10926        _result
10927    }
10928
10929    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10930        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
10931            (s, attributes),
10932            self.tx_id,
10933            0x78985e216314dafd,
10934            fidl::encoding::DynamicFlags::empty(),
10935        )
10936    }
10937}
10938
10939#[must_use = "FIDL methods require a response to be sent"]
10940#[derive(Debug)]
10941pub struct FileDeprecatedSetAttrResponder {
10942    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10943    tx_id: u32,
10944}
10945
10946/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10947/// if the responder is dropped without sending a response, so that the client
10948/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10949impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10950    fn drop(&mut self) {
10951        self.control_handle.shutdown();
10952        // Safety: drops once, never accessed again
10953        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10954    }
10955}
10956
10957impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10958    type ControlHandle = FileControlHandle;
10959
10960    fn control_handle(&self) -> &FileControlHandle {
10961        &self.control_handle
10962    }
10963
10964    fn drop_without_shutdown(mut self) {
10965        // Safety: drops once, never accessed again due to mem::forget
10966        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10967        // Prevent Drop from running (which would shut down the channel)
10968        std::mem::forget(self);
10969    }
10970}
10971
10972impl FileDeprecatedSetAttrResponder {
10973    /// Sends a response to the FIDL transaction.
10974    ///
10975    /// Sets the channel to shutdown if an error occurs.
10976    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10977        let _result = self.send_raw(s);
10978        if _result.is_err() {
10979            self.control_handle.shutdown();
10980        }
10981        self.drop_without_shutdown();
10982        _result
10983    }
10984
10985    /// Similar to "send" but does not shutdown the channel if an error occurs.
10986    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10987        let _result = self.send_raw(s);
10988        self.drop_without_shutdown();
10989        _result
10990    }
10991
10992    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10993        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10994            (s,),
10995            self.tx_id,
10996            0x4186c0f40d938f46,
10997            fidl::encoding::DynamicFlags::empty(),
10998        )
10999    }
11000}
11001
11002#[must_use = "FIDL methods require a response to be sent"]
11003#[derive(Debug)]
11004pub struct FileDeprecatedGetFlagsResponder {
11005    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11006    tx_id: u32,
11007}
11008
11009/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11010/// if the responder is dropped without sending a response, so that the client
11011/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11012impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
11013    fn drop(&mut self) {
11014        self.control_handle.shutdown();
11015        // Safety: drops once, never accessed again
11016        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11017    }
11018}
11019
11020impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
11021    type ControlHandle = FileControlHandle;
11022
11023    fn control_handle(&self) -> &FileControlHandle {
11024        &self.control_handle
11025    }
11026
11027    fn drop_without_shutdown(mut self) {
11028        // Safety: drops once, never accessed again due to mem::forget
11029        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11030        // Prevent Drop from running (which would shut down the channel)
11031        std::mem::forget(self);
11032    }
11033}
11034
11035impl FileDeprecatedGetFlagsResponder {
11036    /// Sends a response to the FIDL transaction.
11037    ///
11038    /// Sets the channel to shutdown if an error occurs.
11039    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11040        let _result = self.send_raw(s, flags);
11041        if _result.is_err() {
11042            self.control_handle.shutdown();
11043        }
11044        self.drop_without_shutdown();
11045        _result
11046    }
11047
11048    /// Similar to "send" but does not shutdown the channel if an error occurs.
11049    pub fn send_no_shutdown_on_err(
11050        self,
11051        mut s: i32,
11052        mut flags: OpenFlags,
11053    ) -> Result<(), fidl::Error> {
11054        let _result = self.send_raw(s, flags);
11055        self.drop_without_shutdown();
11056        _result
11057    }
11058
11059    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11060        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
11061            (s, flags),
11062            self.tx_id,
11063            0x5b88fffb8eda3aa1,
11064            fidl::encoding::DynamicFlags::empty(),
11065        )
11066    }
11067}
11068
11069#[must_use = "FIDL methods require a response to be sent"]
11070#[derive(Debug)]
11071pub struct FileDeprecatedSetFlagsResponder {
11072    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11073    tx_id: u32,
11074}
11075
11076/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11077/// if the responder is dropped without sending a response, so that the client
11078/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11079impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
11080    fn drop(&mut self) {
11081        self.control_handle.shutdown();
11082        // Safety: drops once, never accessed again
11083        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11084    }
11085}
11086
11087impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
11088    type ControlHandle = FileControlHandle;
11089
11090    fn control_handle(&self) -> &FileControlHandle {
11091        &self.control_handle
11092    }
11093
11094    fn drop_without_shutdown(mut self) {
11095        // Safety: drops once, never accessed again due to mem::forget
11096        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11097        // Prevent Drop from running (which would shut down the channel)
11098        std::mem::forget(self);
11099    }
11100}
11101
11102impl FileDeprecatedSetFlagsResponder {
11103    /// Sends a response to the FIDL transaction.
11104    ///
11105    /// Sets the channel to shutdown if an error occurs.
11106    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11107        let _result = self.send_raw(s);
11108        if _result.is_err() {
11109            self.control_handle.shutdown();
11110        }
11111        self.drop_without_shutdown();
11112        _result
11113    }
11114
11115    /// Similar to "send" but does not shutdown the channel if an error occurs.
11116    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11117        let _result = self.send_raw(s);
11118        self.drop_without_shutdown();
11119        _result
11120    }
11121
11122    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11123        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11124            (s,),
11125            self.tx_id,
11126            0x5295b76c71fde733,
11127            fidl::encoding::DynamicFlags::empty(),
11128        )
11129    }
11130}
11131
11132#[must_use = "FIDL methods require a response to be sent"]
11133#[derive(Debug)]
11134pub struct FileGetFlagsResponder {
11135    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11136    tx_id: u32,
11137}
11138
11139/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11140/// if the responder is dropped without sending a response, so that the client
11141/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11142impl std::ops::Drop for FileGetFlagsResponder {
11143    fn drop(&mut self) {
11144        self.control_handle.shutdown();
11145        // Safety: drops once, never accessed again
11146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11147    }
11148}
11149
11150impl fidl::endpoints::Responder for FileGetFlagsResponder {
11151    type ControlHandle = FileControlHandle;
11152
11153    fn control_handle(&self) -> &FileControlHandle {
11154        &self.control_handle
11155    }
11156
11157    fn drop_without_shutdown(mut self) {
11158        // Safety: drops once, never accessed again due to mem::forget
11159        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11160        // Prevent Drop from running (which would shut down the channel)
11161        std::mem::forget(self);
11162    }
11163}
11164
11165impl FileGetFlagsResponder {
11166    /// Sends a response to the FIDL transaction.
11167    ///
11168    /// Sets the channel to shutdown if an error occurs.
11169    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11170        let _result = self.send_raw(result);
11171        if _result.is_err() {
11172            self.control_handle.shutdown();
11173        }
11174        self.drop_without_shutdown();
11175        _result
11176    }
11177
11178    /// Similar to "send" but does not shutdown the channel if an error occurs.
11179    pub fn send_no_shutdown_on_err(
11180        self,
11181        mut result: Result<Flags, i32>,
11182    ) -> Result<(), fidl::Error> {
11183        let _result = self.send_raw(result);
11184        self.drop_without_shutdown();
11185        _result
11186    }
11187
11188    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11189        self.control_handle
11190            .inner
11191            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11192                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11193                self.tx_id,
11194                0x176eb318f64ec23,
11195                fidl::encoding::DynamicFlags::FLEXIBLE,
11196            )
11197    }
11198}
11199
11200#[must_use = "FIDL methods require a response to be sent"]
11201#[derive(Debug)]
11202pub struct FileSetFlagsResponder {
11203    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11204    tx_id: u32,
11205}
11206
11207/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11208/// if the responder is dropped without sending a response, so that the client
11209/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11210impl std::ops::Drop for FileSetFlagsResponder {
11211    fn drop(&mut self) {
11212        self.control_handle.shutdown();
11213        // Safety: drops once, never accessed again
11214        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11215    }
11216}
11217
11218impl fidl::endpoints::Responder for FileSetFlagsResponder {
11219    type ControlHandle = FileControlHandle;
11220
11221    fn control_handle(&self) -> &FileControlHandle {
11222        &self.control_handle
11223    }
11224
11225    fn drop_without_shutdown(mut self) {
11226        // Safety: drops once, never accessed again due to mem::forget
11227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11228        // Prevent Drop from running (which would shut down the channel)
11229        std::mem::forget(self);
11230    }
11231}
11232
11233impl FileSetFlagsResponder {
11234    /// Sends a response to the FIDL transaction.
11235    ///
11236    /// Sets the channel to shutdown if an error occurs.
11237    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11238        let _result = self.send_raw(result);
11239        if _result.is_err() {
11240            self.control_handle.shutdown();
11241        }
11242        self.drop_without_shutdown();
11243        _result
11244    }
11245
11246    /// Similar to "send" but does not shutdown the channel if an error occurs.
11247    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11248        let _result = self.send_raw(result);
11249        self.drop_without_shutdown();
11250        _result
11251    }
11252
11253    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11254        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11255            fidl::encoding::EmptyStruct,
11256            i32,
11257        >>(
11258            fidl::encoding::FlexibleResult::new(result),
11259            self.tx_id,
11260            0x55a8028685791ea8,
11261            fidl::encoding::DynamicFlags::FLEXIBLE,
11262        )
11263    }
11264}
11265
11266#[must_use = "FIDL methods require a response to be sent"]
11267#[derive(Debug)]
11268pub struct FileQueryFilesystemResponder {
11269    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11270    tx_id: u32,
11271}
11272
11273/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11274/// if the responder is dropped without sending a response, so that the client
11275/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11276impl std::ops::Drop for FileQueryFilesystemResponder {
11277    fn drop(&mut self) {
11278        self.control_handle.shutdown();
11279        // Safety: drops once, never accessed again
11280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11281    }
11282}
11283
11284impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11285    type ControlHandle = FileControlHandle;
11286
11287    fn control_handle(&self) -> &FileControlHandle {
11288        &self.control_handle
11289    }
11290
11291    fn drop_without_shutdown(mut self) {
11292        // Safety: drops once, never accessed again due to mem::forget
11293        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11294        // Prevent Drop from running (which would shut down the channel)
11295        std::mem::forget(self);
11296    }
11297}
11298
11299impl FileQueryFilesystemResponder {
11300    /// Sends a response to the FIDL transaction.
11301    ///
11302    /// Sets the channel to shutdown if an error occurs.
11303    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11304        let _result = self.send_raw(s, info);
11305        if _result.is_err() {
11306            self.control_handle.shutdown();
11307        }
11308        self.drop_without_shutdown();
11309        _result
11310    }
11311
11312    /// Similar to "send" but does not shutdown the channel if an error occurs.
11313    pub fn send_no_shutdown_on_err(
11314        self,
11315        mut s: i32,
11316        mut info: Option<&FilesystemInfo>,
11317    ) -> Result<(), fidl::Error> {
11318        let _result = self.send_raw(s, info);
11319        self.drop_without_shutdown();
11320        _result
11321    }
11322
11323    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11324        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11325            (s, info),
11326            self.tx_id,
11327            0x6f344a1c6b0a0610,
11328            fidl::encoding::DynamicFlags::empty(),
11329        )
11330    }
11331}
11332
11333#[must_use = "FIDL methods require a response to be sent"]
11334#[derive(Debug)]
11335pub struct FileGetAttributesResponder {
11336    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11337    tx_id: u32,
11338}
11339
11340/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11341/// if the responder is dropped without sending a response, so that the client
11342/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11343impl std::ops::Drop for FileGetAttributesResponder {
11344    fn drop(&mut self) {
11345        self.control_handle.shutdown();
11346        // Safety: drops once, never accessed again
11347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11348    }
11349}
11350
11351impl fidl::endpoints::Responder for FileGetAttributesResponder {
11352    type ControlHandle = FileControlHandle;
11353
11354    fn control_handle(&self) -> &FileControlHandle {
11355        &self.control_handle
11356    }
11357
11358    fn drop_without_shutdown(mut self) {
11359        // Safety: drops once, never accessed again due to mem::forget
11360        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11361        // Prevent Drop from running (which would shut down the channel)
11362        std::mem::forget(self);
11363    }
11364}
11365
11366impl FileGetAttributesResponder {
11367    /// Sends a response to the FIDL transaction.
11368    ///
11369    /// Sets the channel to shutdown if an error occurs.
11370    pub fn send(
11371        self,
11372        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11373    ) -> Result<(), fidl::Error> {
11374        let _result = self.send_raw(result);
11375        if _result.is_err() {
11376            self.control_handle.shutdown();
11377        }
11378        self.drop_without_shutdown();
11379        _result
11380    }
11381
11382    /// Similar to "send" but does not shutdown the channel if an error occurs.
11383    pub fn send_no_shutdown_on_err(
11384        self,
11385        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11386    ) -> Result<(), fidl::Error> {
11387        let _result = self.send_raw(result);
11388        self.drop_without_shutdown();
11389        _result
11390    }
11391
11392    fn send_raw(
11393        &self,
11394        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11395    ) -> Result<(), fidl::Error> {
11396        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11397            result,
11398            self.tx_id,
11399            0x3d4396a638ea053b,
11400            fidl::encoding::DynamicFlags::empty(),
11401        )
11402    }
11403}
11404
11405#[must_use = "FIDL methods require a response to be sent"]
11406#[derive(Debug)]
11407pub struct FileUpdateAttributesResponder {
11408    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11409    tx_id: u32,
11410}
11411
11412/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11413/// if the responder is dropped without sending a response, so that the client
11414/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11415impl std::ops::Drop for FileUpdateAttributesResponder {
11416    fn drop(&mut self) {
11417        self.control_handle.shutdown();
11418        // Safety: drops once, never accessed again
11419        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11420    }
11421}
11422
11423impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11424    type ControlHandle = FileControlHandle;
11425
11426    fn control_handle(&self) -> &FileControlHandle {
11427        &self.control_handle
11428    }
11429
11430    fn drop_without_shutdown(mut self) {
11431        // Safety: drops once, never accessed again due to mem::forget
11432        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11433        // Prevent Drop from running (which would shut down the channel)
11434        std::mem::forget(self);
11435    }
11436}
11437
11438impl FileUpdateAttributesResponder {
11439    /// Sends a response to the FIDL transaction.
11440    ///
11441    /// Sets the channel to shutdown if an error occurs.
11442    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11443        let _result = self.send_raw(result);
11444        if _result.is_err() {
11445            self.control_handle.shutdown();
11446        }
11447        self.drop_without_shutdown();
11448        _result
11449    }
11450
11451    /// Similar to "send" but does not shutdown the channel if an error occurs.
11452    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11453        let _result = self.send_raw(result);
11454        self.drop_without_shutdown();
11455        _result
11456    }
11457
11458    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11459        self.control_handle
11460            .inner
11461            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11462                result,
11463                self.tx_id,
11464                0x3308c1da5a89bf08,
11465                fidl::encoding::DynamicFlags::empty(),
11466            )
11467    }
11468}
11469
11470#[must_use = "FIDL methods require a response to be sent"]
11471#[derive(Debug)]
11472pub struct FileSyncResponder {
11473    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11474    tx_id: u32,
11475}
11476
11477/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11478/// if the responder is dropped without sending a response, so that the client
11479/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11480impl std::ops::Drop for FileSyncResponder {
11481    fn drop(&mut self) {
11482        self.control_handle.shutdown();
11483        // Safety: drops once, never accessed again
11484        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11485    }
11486}
11487
11488impl fidl::endpoints::Responder for FileSyncResponder {
11489    type ControlHandle = FileControlHandle;
11490
11491    fn control_handle(&self) -> &FileControlHandle {
11492        &self.control_handle
11493    }
11494
11495    fn drop_without_shutdown(mut self) {
11496        // Safety: drops once, never accessed again due to mem::forget
11497        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11498        // Prevent Drop from running (which would shut down the channel)
11499        std::mem::forget(self);
11500    }
11501}
11502
11503impl FileSyncResponder {
11504    /// Sends a response to the FIDL transaction.
11505    ///
11506    /// Sets the channel to shutdown if an error occurs.
11507    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11508        let _result = self.send_raw(result);
11509        if _result.is_err() {
11510            self.control_handle.shutdown();
11511        }
11512        self.drop_without_shutdown();
11513        _result
11514    }
11515
11516    /// Similar to "send" but does not shutdown the channel if an error occurs.
11517    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11518        let _result = self.send_raw(result);
11519        self.drop_without_shutdown();
11520        _result
11521    }
11522
11523    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11524        self.control_handle
11525            .inner
11526            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11527                result,
11528                self.tx_id,
11529                0x2c5c27ca0ab5dc49,
11530                fidl::encoding::DynamicFlags::empty(),
11531            )
11532    }
11533}
11534
11535#[must_use = "FIDL methods require a response to be sent"]
11536#[derive(Debug)]
11537pub struct FileGetExtendedAttributeResponder {
11538    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11539    tx_id: u32,
11540}
11541
11542/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11543/// if the responder is dropped without sending a response, so that the client
11544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11545impl std::ops::Drop for FileGetExtendedAttributeResponder {
11546    fn drop(&mut self) {
11547        self.control_handle.shutdown();
11548        // Safety: drops once, never accessed again
11549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11550    }
11551}
11552
11553impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11554    type ControlHandle = FileControlHandle;
11555
11556    fn control_handle(&self) -> &FileControlHandle {
11557        &self.control_handle
11558    }
11559
11560    fn drop_without_shutdown(mut self) {
11561        // Safety: drops once, never accessed again due to mem::forget
11562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11563        // Prevent Drop from running (which would shut down the channel)
11564        std::mem::forget(self);
11565    }
11566}
11567
11568impl FileGetExtendedAttributeResponder {
11569    /// Sends a response to the FIDL transaction.
11570    ///
11571    /// Sets the channel to shutdown if an error occurs.
11572    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11573        let _result = self.send_raw(result);
11574        if _result.is_err() {
11575            self.control_handle.shutdown();
11576        }
11577        self.drop_without_shutdown();
11578        _result
11579    }
11580
11581    /// Similar to "send" but does not shutdown the channel if an error occurs.
11582    pub fn send_no_shutdown_on_err(
11583        self,
11584        mut result: Result<ExtendedAttributeValue, i32>,
11585    ) -> Result<(), fidl::Error> {
11586        let _result = self.send_raw(result);
11587        self.drop_without_shutdown();
11588        _result
11589    }
11590
11591    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11592        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11593            result.as_mut().map_err(|e| *e),
11594            self.tx_id,
11595            0x45ffa3ccfdeb76db,
11596            fidl::encoding::DynamicFlags::empty(),
11597        )
11598    }
11599}
11600
11601#[must_use = "FIDL methods require a response to be sent"]
11602#[derive(Debug)]
11603pub struct FileSetExtendedAttributeResponder {
11604    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11605    tx_id: u32,
11606}
11607
11608/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11609/// if the responder is dropped without sending a response, so that the client
11610/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11611impl std::ops::Drop for FileSetExtendedAttributeResponder {
11612    fn drop(&mut self) {
11613        self.control_handle.shutdown();
11614        // Safety: drops once, never accessed again
11615        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11616    }
11617}
11618
11619impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11620    type ControlHandle = FileControlHandle;
11621
11622    fn control_handle(&self) -> &FileControlHandle {
11623        &self.control_handle
11624    }
11625
11626    fn drop_without_shutdown(mut self) {
11627        // Safety: drops once, never accessed again due to mem::forget
11628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11629        // Prevent Drop from running (which would shut down the channel)
11630        std::mem::forget(self);
11631    }
11632}
11633
11634impl FileSetExtendedAttributeResponder {
11635    /// Sends a response to the FIDL transaction.
11636    ///
11637    /// Sets the channel to shutdown if an error occurs.
11638    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11639        let _result = self.send_raw(result);
11640        if _result.is_err() {
11641            self.control_handle.shutdown();
11642        }
11643        self.drop_without_shutdown();
11644        _result
11645    }
11646
11647    /// Similar to "send" but does not shutdown the channel if an error occurs.
11648    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11649        let _result = self.send_raw(result);
11650        self.drop_without_shutdown();
11651        _result
11652    }
11653
11654    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11655        self.control_handle
11656            .inner
11657            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11658                result,
11659                self.tx_id,
11660                0x4a951362f681f23c,
11661                fidl::encoding::DynamicFlags::empty(),
11662            )
11663    }
11664}
11665
11666#[must_use = "FIDL methods require a response to be sent"]
11667#[derive(Debug)]
11668pub struct FileRemoveExtendedAttributeResponder {
11669    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11670    tx_id: u32,
11671}
11672
11673/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11674/// if the responder is dropped without sending a response, so that the client
11675/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11676impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11677    fn drop(&mut self) {
11678        self.control_handle.shutdown();
11679        // Safety: drops once, never accessed again
11680        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11681    }
11682}
11683
11684impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11685    type ControlHandle = FileControlHandle;
11686
11687    fn control_handle(&self) -> &FileControlHandle {
11688        &self.control_handle
11689    }
11690
11691    fn drop_without_shutdown(mut self) {
11692        // Safety: drops once, never accessed again due to mem::forget
11693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11694        // Prevent Drop from running (which would shut down the channel)
11695        std::mem::forget(self);
11696    }
11697}
11698
11699impl FileRemoveExtendedAttributeResponder {
11700    /// Sends a response to the FIDL transaction.
11701    ///
11702    /// Sets the channel to shutdown if an error occurs.
11703    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11704        let _result = self.send_raw(result);
11705        if _result.is_err() {
11706            self.control_handle.shutdown();
11707        }
11708        self.drop_without_shutdown();
11709        _result
11710    }
11711
11712    /// Similar to "send" but does not shutdown the channel if an error occurs.
11713    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11714        let _result = self.send_raw(result);
11715        self.drop_without_shutdown();
11716        _result
11717    }
11718
11719    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11720        self.control_handle
11721            .inner
11722            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11723                result,
11724                self.tx_id,
11725                0x7a0b9f3a9bf9032d,
11726                fidl::encoding::DynamicFlags::empty(),
11727            )
11728    }
11729}
11730
11731#[must_use = "FIDL methods require a response to be sent"]
11732#[derive(Debug)]
11733pub struct FileReadResponder {
11734    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11735    tx_id: u32,
11736}
11737
11738/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11739/// if the responder is dropped without sending a response, so that the client
11740/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11741impl std::ops::Drop for FileReadResponder {
11742    fn drop(&mut self) {
11743        self.control_handle.shutdown();
11744        // Safety: drops once, never accessed again
11745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11746    }
11747}
11748
11749impl fidl::endpoints::Responder for FileReadResponder {
11750    type ControlHandle = FileControlHandle;
11751
11752    fn control_handle(&self) -> &FileControlHandle {
11753        &self.control_handle
11754    }
11755
11756    fn drop_without_shutdown(mut self) {
11757        // Safety: drops once, never accessed again due to mem::forget
11758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11759        // Prevent Drop from running (which would shut down the channel)
11760        std::mem::forget(self);
11761    }
11762}
11763
11764impl FileReadResponder {
11765    /// Sends a response to the FIDL transaction.
11766    ///
11767    /// Sets the channel to shutdown if an error occurs.
11768    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11769        let _result = self.send_raw(result);
11770        if _result.is_err() {
11771            self.control_handle.shutdown();
11772        }
11773        self.drop_without_shutdown();
11774        _result
11775    }
11776
11777    /// Similar to "send" but does not shutdown the channel if an error occurs.
11778    pub fn send_no_shutdown_on_err(
11779        self,
11780        mut result: Result<&[u8], i32>,
11781    ) -> Result<(), fidl::Error> {
11782        let _result = self.send_raw(result);
11783        self.drop_without_shutdown();
11784        _result
11785    }
11786
11787    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11788        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11789            result.map(|data| (data,)),
11790            self.tx_id,
11791            0x57e419a298c8ede,
11792            fidl::encoding::DynamicFlags::empty(),
11793        )
11794    }
11795}
11796
11797#[must_use = "FIDL methods require a response to be sent"]
11798#[derive(Debug)]
11799pub struct FileWriteResponder {
11800    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11801    tx_id: u32,
11802}
11803
11804/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11805/// if the responder is dropped without sending a response, so that the client
11806/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11807impl std::ops::Drop for FileWriteResponder {
11808    fn drop(&mut self) {
11809        self.control_handle.shutdown();
11810        // Safety: drops once, never accessed again
11811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11812    }
11813}
11814
11815impl fidl::endpoints::Responder for FileWriteResponder {
11816    type ControlHandle = FileControlHandle;
11817
11818    fn control_handle(&self) -> &FileControlHandle {
11819        &self.control_handle
11820    }
11821
11822    fn drop_without_shutdown(mut self) {
11823        // Safety: drops once, never accessed again due to mem::forget
11824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11825        // Prevent Drop from running (which would shut down the channel)
11826        std::mem::forget(self);
11827    }
11828}
11829
11830impl FileWriteResponder {
11831    /// Sends a response to the FIDL transaction.
11832    ///
11833    /// Sets the channel to shutdown if an error occurs.
11834    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11835        let _result = self.send_raw(result);
11836        if _result.is_err() {
11837            self.control_handle.shutdown();
11838        }
11839        self.drop_without_shutdown();
11840        _result
11841    }
11842
11843    /// Similar to "send" but does not shutdown the channel if an error occurs.
11844    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11845        let _result = self.send_raw(result);
11846        self.drop_without_shutdown();
11847        _result
11848    }
11849
11850    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11851        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11852            result.map(|actual_count| (actual_count,)),
11853            self.tx_id,
11854            0x6a31437832469f82,
11855            fidl::encoding::DynamicFlags::empty(),
11856        )
11857    }
11858}
11859
11860#[must_use = "FIDL methods require a response to be sent"]
11861#[derive(Debug)]
11862pub struct FileDescribeResponder {
11863    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11864    tx_id: u32,
11865}
11866
11867/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11868/// if the responder is dropped without sending a response, so that the client
11869/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11870impl std::ops::Drop for FileDescribeResponder {
11871    fn drop(&mut self) {
11872        self.control_handle.shutdown();
11873        // Safety: drops once, never accessed again
11874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11875    }
11876}
11877
11878impl fidl::endpoints::Responder for FileDescribeResponder {
11879    type ControlHandle = FileControlHandle;
11880
11881    fn control_handle(&self) -> &FileControlHandle {
11882        &self.control_handle
11883    }
11884
11885    fn drop_without_shutdown(mut self) {
11886        // Safety: drops once, never accessed again due to mem::forget
11887        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11888        // Prevent Drop from running (which would shut down the channel)
11889        std::mem::forget(self);
11890    }
11891}
11892
11893impl FileDescribeResponder {
11894    /// Sends a response to the FIDL transaction.
11895    ///
11896    /// Sets the channel to shutdown if an error occurs.
11897    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11898        let _result = self.send_raw(payload);
11899        if _result.is_err() {
11900            self.control_handle.shutdown();
11901        }
11902        self.drop_without_shutdown();
11903        _result
11904    }
11905
11906    /// Similar to "send" but does not shutdown the channel if an error occurs.
11907    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11908        let _result = self.send_raw(payload);
11909        self.drop_without_shutdown();
11910        _result
11911    }
11912
11913    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11914        self.control_handle.inner.send::<FileInfo>(
11915            &mut payload,
11916            self.tx_id,
11917            0x68b5ac00c62906bc,
11918            fidl::encoding::DynamicFlags::empty(),
11919        )
11920    }
11921}
11922
11923#[must_use = "FIDL methods require a response to be sent"]
11924#[derive(Debug)]
11925pub struct FileSeekResponder {
11926    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11927    tx_id: u32,
11928}
11929
11930/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11931/// if the responder is dropped without sending a response, so that the client
11932/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11933impl std::ops::Drop for FileSeekResponder {
11934    fn drop(&mut self) {
11935        self.control_handle.shutdown();
11936        // Safety: drops once, never accessed again
11937        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11938    }
11939}
11940
11941impl fidl::endpoints::Responder for FileSeekResponder {
11942    type ControlHandle = FileControlHandle;
11943
11944    fn control_handle(&self) -> &FileControlHandle {
11945        &self.control_handle
11946    }
11947
11948    fn drop_without_shutdown(mut self) {
11949        // Safety: drops once, never accessed again due to mem::forget
11950        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11951        // Prevent Drop from running (which would shut down the channel)
11952        std::mem::forget(self);
11953    }
11954}
11955
11956impl FileSeekResponder {
11957    /// Sends a response to the FIDL transaction.
11958    ///
11959    /// Sets the channel to shutdown if an error occurs.
11960    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11961        let _result = self.send_raw(result);
11962        if _result.is_err() {
11963            self.control_handle.shutdown();
11964        }
11965        self.drop_without_shutdown();
11966        _result
11967    }
11968
11969    /// Similar to "send" but does not shutdown the channel if an error occurs.
11970    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11971        let _result = self.send_raw(result);
11972        self.drop_without_shutdown();
11973        _result
11974    }
11975
11976    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11977        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11978            result.map(|offset_from_start| (offset_from_start,)),
11979            self.tx_id,
11980            0x78079168162c5207,
11981            fidl::encoding::DynamicFlags::empty(),
11982        )
11983    }
11984}
11985
11986#[must_use = "FIDL methods require a response to be sent"]
11987#[derive(Debug)]
11988pub struct FileReadAtResponder {
11989    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11990    tx_id: u32,
11991}
11992
11993/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11994/// if the responder is dropped without sending a response, so that the client
11995/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11996impl std::ops::Drop for FileReadAtResponder {
11997    fn drop(&mut self) {
11998        self.control_handle.shutdown();
11999        // Safety: drops once, never accessed again
12000        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12001    }
12002}
12003
12004impl fidl::endpoints::Responder for FileReadAtResponder {
12005    type ControlHandle = FileControlHandle;
12006
12007    fn control_handle(&self) -> &FileControlHandle {
12008        &self.control_handle
12009    }
12010
12011    fn drop_without_shutdown(mut self) {
12012        // Safety: drops once, never accessed again due to mem::forget
12013        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12014        // Prevent Drop from running (which would shut down the channel)
12015        std::mem::forget(self);
12016    }
12017}
12018
12019impl FileReadAtResponder {
12020    /// Sends a response to the FIDL transaction.
12021    ///
12022    /// Sets the channel to shutdown if an error occurs.
12023    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12024        let _result = self.send_raw(result);
12025        if _result.is_err() {
12026            self.control_handle.shutdown();
12027        }
12028        self.drop_without_shutdown();
12029        _result
12030    }
12031
12032    /// Similar to "send" but does not shutdown the channel if an error occurs.
12033    pub fn send_no_shutdown_on_err(
12034        self,
12035        mut result: Result<&[u8], i32>,
12036    ) -> Result<(), fidl::Error> {
12037        let _result = self.send_raw(result);
12038        self.drop_without_shutdown();
12039        _result
12040    }
12041
12042    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12043        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
12044            result.map(|data| (data,)),
12045            self.tx_id,
12046            0x1607a293a60d723e,
12047            fidl::encoding::DynamicFlags::empty(),
12048        )
12049    }
12050}
12051
12052#[must_use = "FIDL methods require a response to be sent"]
12053#[derive(Debug)]
12054pub struct FileWriteAtResponder {
12055    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12056    tx_id: u32,
12057}
12058
12059/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12060/// if the responder is dropped without sending a response, so that the client
12061/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12062impl std::ops::Drop for FileWriteAtResponder {
12063    fn drop(&mut self) {
12064        self.control_handle.shutdown();
12065        // Safety: drops once, never accessed again
12066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12067    }
12068}
12069
12070impl fidl::endpoints::Responder for FileWriteAtResponder {
12071    type ControlHandle = FileControlHandle;
12072
12073    fn control_handle(&self) -> &FileControlHandle {
12074        &self.control_handle
12075    }
12076
12077    fn drop_without_shutdown(mut self) {
12078        // Safety: drops once, never accessed again due to mem::forget
12079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12080        // Prevent Drop from running (which would shut down the channel)
12081        std::mem::forget(self);
12082    }
12083}
12084
12085impl FileWriteAtResponder {
12086    /// Sends a response to the FIDL transaction.
12087    ///
12088    /// Sets the channel to shutdown if an error occurs.
12089    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12090        let _result = self.send_raw(result);
12091        if _result.is_err() {
12092            self.control_handle.shutdown();
12093        }
12094        self.drop_without_shutdown();
12095        _result
12096    }
12097
12098    /// Similar to "send" but does not shutdown the channel if an error occurs.
12099    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12100        let _result = self.send_raw(result);
12101        self.drop_without_shutdown();
12102        _result
12103    }
12104
12105    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12106        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
12107            result.map(|actual_count| (actual_count,)),
12108            self.tx_id,
12109            0x793eefc0045e792b,
12110            fidl::encoding::DynamicFlags::empty(),
12111        )
12112    }
12113}
12114
12115#[must_use = "FIDL methods require a response to be sent"]
12116#[derive(Debug)]
12117pub struct FileResizeResponder {
12118    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12119    tx_id: u32,
12120}
12121
12122/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12123/// if the responder is dropped without sending a response, so that the client
12124/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12125impl std::ops::Drop for FileResizeResponder {
12126    fn drop(&mut self) {
12127        self.control_handle.shutdown();
12128        // Safety: drops once, never accessed again
12129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12130    }
12131}
12132
12133impl fidl::endpoints::Responder for FileResizeResponder {
12134    type ControlHandle = FileControlHandle;
12135
12136    fn control_handle(&self) -> &FileControlHandle {
12137        &self.control_handle
12138    }
12139
12140    fn drop_without_shutdown(mut self) {
12141        // Safety: drops once, never accessed again due to mem::forget
12142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12143        // Prevent Drop from running (which would shut down the channel)
12144        std::mem::forget(self);
12145    }
12146}
12147
12148impl FileResizeResponder {
12149    /// Sends a response to the FIDL transaction.
12150    ///
12151    /// Sets the channel to shutdown if an error occurs.
12152    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12153        let _result = self.send_raw(result);
12154        if _result.is_err() {
12155            self.control_handle.shutdown();
12156        }
12157        self.drop_without_shutdown();
12158        _result
12159    }
12160
12161    /// Similar to "send" but does not shutdown the channel if an error occurs.
12162    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12163        let _result = self.send_raw(result);
12164        self.drop_without_shutdown();
12165        _result
12166    }
12167
12168    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12169        self.control_handle
12170            .inner
12171            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12172                result,
12173                self.tx_id,
12174                0x2b80825f0535743a,
12175                fidl::encoding::DynamicFlags::empty(),
12176            )
12177    }
12178}
12179
12180#[must_use = "FIDL methods require a response to be sent"]
12181#[derive(Debug)]
12182pub struct FileGetBackingMemoryResponder {
12183    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12184    tx_id: u32,
12185}
12186
12187/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12188/// if the responder is dropped without sending a response, so that the client
12189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12190impl std::ops::Drop for FileGetBackingMemoryResponder {
12191    fn drop(&mut self) {
12192        self.control_handle.shutdown();
12193        // Safety: drops once, never accessed again
12194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12195    }
12196}
12197
12198impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12199    type ControlHandle = FileControlHandle;
12200
12201    fn control_handle(&self) -> &FileControlHandle {
12202        &self.control_handle
12203    }
12204
12205    fn drop_without_shutdown(mut self) {
12206        // Safety: drops once, never accessed again due to mem::forget
12207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12208        // Prevent Drop from running (which would shut down the channel)
12209        std::mem::forget(self);
12210    }
12211}
12212
12213impl FileGetBackingMemoryResponder {
12214    /// Sends a response to the FIDL transaction.
12215    ///
12216    /// Sets the channel to shutdown if an error occurs.
12217    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12218        let _result = self.send_raw(result);
12219        if _result.is_err() {
12220            self.control_handle.shutdown();
12221        }
12222        self.drop_without_shutdown();
12223        _result
12224    }
12225
12226    /// Similar to "send" but does not shutdown the channel if an error occurs.
12227    pub fn send_no_shutdown_on_err(
12228        self,
12229        mut result: Result<fidl::Vmo, i32>,
12230    ) -> Result<(), fidl::Error> {
12231        let _result = self.send_raw(result);
12232        self.drop_without_shutdown();
12233        _result
12234    }
12235
12236    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12237        self.control_handle
12238            .inner
12239            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12240                result.map(|vmo| (vmo,)),
12241                self.tx_id,
12242                0xa6a9e654cbf62b,
12243                fidl::encoding::DynamicFlags::empty(),
12244            )
12245    }
12246}
12247
12248#[must_use = "FIDL methods require a response to be sent"]
12249#[derive(Debug)]
12250pub struct FileAllocateResponder {
12251    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12252    tx_id: u32,
12253}
12254
12255/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12256/// if the responder is dropped without sending a response, so that the client
12257/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12258impl std::ops::Drop for FileAllocateResponder {
12259    fn drop(&mut self) {
12260        self.control_handle.shutdown();
12261        // Safety: drops once, never accessed again
12262        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12263    }
12264}
12265
12266impl fidl::endpoints::Responder for FileAllocateResponder {
12267    type ControlHandle = FileControlHandle;
12268
12269    fn control_handle(&self) -> &FileControlHandle {
12270        &self.control_handle
12271    }
12272
12273    fn drop_without_shutdown(mut self) {
12274        // Safety: drops once, never accessed again due to mem::forget
12275        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12276        // Prevent Drop from running (which would shut down the channel)
12277        std::mem::forget(self);
12278    }
12279}
12280
12281impl FileAllocateResponder {
12282    /// Sends a response to the FIDL transaction.
12283    ///
12284    /// Sets the channel to shutdown if an error occurs.
12285    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12286        let _result = self.send_raw(result);
12287        if _result.is_err() {
12288            self.control_handle.shutdown();
12289        }
12290        self.drop_without_shutdown();
12291        _result
12292    }
12293
12294    /// Similar to "send" but does not shutdown the channel if an error occurs.
12295    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12296        let _result = self.send_raw(result);
12297        self.drop_without_shutdown();
12298        _result
12299    }
12300
12301    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12302        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12303            fidl::encoding::EmptyStruct,
12304            i32,
12305        >>(
12306            fidl::encoding::FlexibleResult::new(result),
12307            self.tx_id,
12308            0x77fa0c330b57fd2e,
12309            fidl::encoding::DynamicFlags::FLEXIBLE,
12310        )
12311    }
12312}
12313
12314#[must_use = "FIDL methods require a response to be sent"]
12315#[derive(Debug)]
12316pub struct FileEnableVerityResponder {
12317    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12318    tx_id: u32,
12319}
12320
12321/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12322/// if the responder is dropped without sending a response, so that the client
12323/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12324impl std::ops::Drop for FileEnableVerityResponder {
12325    fn drop(&mut self) {
12326        self.control_handle.shutdown();
12327        // Safety: drops once, never accessed again
12328        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12329    }
12330}
12331
12332impl fidl::endpoints::Responder for FileEnableVerityResponder {
12333    type ControlHandle = FileControlHandle;
12334
12335    fn control_handle(&self) -> &FileControlHandle {
12336        &self.control_handle
12337    }
12338
12339    fn drop_without_shutdown(mut self) {
12340        // Safety: drops once, never accessed again due to mem::forget
12341        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12342        // Prevent Drop from running (which would shut down the channel)
12343        std::mem::forget(self);
12344    }
12345}
12346
12347impl FileEnableVerityResponder {
12348    /// Sends a response to the FIDL transaction.
12349    ///
12350    /// Sets the channel to shutdown if an error occurs.
12351    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12352        let _result = self.send_raw(result);
12353        if _result.is_err() {
12354            self.control_handle.shutdown();
12355        }
12356        self.drop_without_shutdown();
12357        _result
12358    }
12359
12360    /// Similar to "send" but does not shutdown the channel if an error occurs.
12361    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12362        let _result = self.send_raw(result);
12363        self.drop_without_shutdown();
12364        _result
12365    }
12366
12367    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12368        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12369            fidl::encoding::EmptyStruct,
12370            i32,
12371        >>(
12372            fidl::encoding::FlexibleResult::new(result),
12373            self.tx_id,
12374            0x2c421ec3faaeb8bb,
12375            fidl::encoding::DynamicFlags::FLEXIBLE,
12376        )
12377    }
12378}
12379
12380#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12381pub struct LinkableMarker;
12382
12383impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12384    type Proxy = LinkableProxy;
12385    type RequestStream = LinkableRequestStream;
12386    #[cfg(target_os = "fuchsia")]
12387    type SynchronousProxy = LinkableSynchronousProxy;
12388
12389    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12390}
12391pub type LinkableLinkIntoResult = Result<(), i32>;
12392
12393pub trait LinkableProxyInterface: Send + Sync {
12394    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12395        + Send;
12396    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12397}
12398#[derive(Debug)]
12399#[cfg(target_os = "fuchsia")]
12400pub struct LinkableSynchronousProxy {
12401    client: fidl::client::sync::Client,
12402}
12403
12404#[cfg(target_os = "fuchsia")]
12405impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12406    type Proxy = LinkableProxy;
12407    type Protocol = LinkableMarker;
12408
12409    fn from_channel(inner: fidl::Channel) -> Self {
12410        Self::new(inner)
12411    }
12412
12413    fn into_channel(self) -> fidl::Channel {
12414        self.client.into_channel()
12415    }
12416
12417    fn as_channel(&self) -> &fidl::Channel {
12418        self.client.as_channel()
12419    }
12420}
12421
12422#[cfg(target_os = "fuchsia")]
12423impl LinkableSynchronousProxy {
12424    pub fn new(channel: fidl::Channel) -> Self {
12425        Self { client: fidl::client::sync::Client::new(channel) }
12426    }
12427
12428    pub fn into_channel(self) -> fidl::Channel {
12429        self.client.into_channel()
12430    }
12431
12432    /// Waits until an event arrives and returns it. It is safe for other
12433    /// threads to make concurrent requests while waiting for an event.
12434    pub fn wait_for_event(
12435        &self,
12436        deadline: zx::MonotonicInstant,
12437    ) -> Result<LinkableEvent, fidl::Error> {
12438        LinkableEvent::decode(self.client.wait_for_event::<LinkableMarker>(deadline)?)
12439    }
12440
12441    /// Creates a link to this this object with name `dst` in the directory represented by
12442    /// `dst_parent_token`.
12443    ///
12444    /// `dst` must be a resolved object name. Including "/" in the string will return
12445    /// `ZX_ERR_INVALID_ARGS`.
12446    ///
12447    /// This method requires the maximal set of rights supported by the filesystem for this object.
12448    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12449    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12450    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12451    /// `ZX_ERR_ACCESS_DENIED`.
12452    ///
12453    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12454    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12455    ///
12456    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12457    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12458    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12459    ///
12460    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12461    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12462    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12463    pub fn r#link_into(
12464        &self,
12465        mut dst_parent_token: fidl::Event,
12466        mut dst: &str,
12467        ___deadline: zx::MonotonicInstant,
12468    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12469        let _response = self.client.send_query::<
12470            LinkableLinkIntoRequest,
12471            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12472            LinkableMarker,
12473        >(
12474            (dst_parent_token, dst,),
12475            0x54f3949246a03e74,
12476            fidl::encoding::DynamicFlags::empty(),
12477            ___deadline,
12478        )?;
12479        Ok(_response.map(|x| x))
12480    }
12481}
12482
12483#[cfg(target_os = "fuchsia")]
12484impl From<LinkableSynchronousProxy> for zx::NullableHandle {
12485    fn from(value: LinkableSynchronousProxy) -> Self {
12486        value.into_channel().into()
12487    }
12488}
12489
12490#[cfg(target_os = "fuchsia")]
12491impl From<fidl::Channel> for LinkableSynchronousProxy {
12492    fn from(value: fidl::Channel) -> Self {
12493        Self::new(value)
12494    }
12495}
12496
12497#[cfg(target_os = "fuchsia")]
12498impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12499    type Protocol = LinkableMarker;
12500
12501    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12502        Self::new(value.into_channel())
12503    }
12504}
12505
12506#[derive(Debug, Clone)]
12507pub struct LinkableProxy {
12508    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12509}
12510
12511impl fidl::endpoints::Proxy for LinkableProxy {
12512    type Protocol = LinkableMarker;
12513
12514    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12515        Self::new(inner)
12516    }
12517
12518    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12519        self.client.into_channel().map_err(|client| Self { client })
12520    }
12521
12522    fn as_channel(&self) -> &::fidl::AsyncChannel {
12523        self.client.as_channel()
12524    }
12525}
12526
12527impl LinkableProxy {
12528    /// Create a new Proxy for fuchsia.io/Linkable.
12529    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12530        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12531        Self { client: fidl::client::Client::new(channel, protocol_name) }
12532    }
12533
12534    /// Get a Stream of events from the remote end of the protocol.
12535    ///
12536    /// # Panics
12537    ///
12538    /// Panics if the event stream was already taken.
12539    pub fn take_event_stream(&self) -> LinkableEventStream {
12540        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12541    }
12542
12543    /// Creates a link to this this object with name `dst` in the directory represented by
12544    /// `dst_parent_token`.
12545    ///
12546    /// `dst` must be a resolved object name. Including "/" in the string will return
12547    /// `ZX_ERR_INVALID_ARGS`.
12548    ///
12549    /// This method requires the maximal set of rights supported by the filesystem for this object.
12550    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12551    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12552    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12553    /// `ZX_ERR_ACCESS_DENIED`.
12554    ///
12555    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12556    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12557    ///
12558    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12559    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12560    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12561    ///
12562    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12563    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12564    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12565    pub fn r#link_into(
12566        &self,
12567        mut dst_parent_token: fidl::Event,
12568        mut dst: &str,
12569    ) -> fidl::client::QueryResponseFut<
12570        LinkableLinkIntoResult,
12571        fidl::encoding::DefaultFuchsiaResourceDialect,
12572    > {
12573        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12574    }
12575}
12576
12577impl LinkableProxyInterface for LinkableProxy {
12578    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12579        LinkableLinkIntoResult,
12580        fidl::encoding::DefaultFuchsiaResourceDialect,
12581    >;
12582    fn r#link_into(
12583        &self,
12584        mut dst_parent_token: fidl::Event,
12585        mut dst: &str,
12586    ) -> Self::LinkIntoResponseFut {
12587        fn _decode(
12588            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12589        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12590            let _response = fidl::client::decode_transaction_body::<
12591                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12592                fidl::encoding::DefaultFuchsiaResourceDialect,
12593                0x54f3949246a03e74,
12594            >(_buf?)?;
12595            Ok(_response.map(|x| x))
12596        }
12597        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12598            (dst_parent_token, dst),
12599            0x54f3949246a03e74,
12600            fidl::encoding::DynamicFlags::empty(),
12601            _decode,
12602        )
12603    }
12604}
12605
12606pub struct LinkableEventStream {
12607    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12608}
12609
12610impl std::marker::Unpin for LinkableEventStream {}
12611
12612impl futures::stream::FusedStream for LinkableEventStream {
12613    fn is_terminated(&self) -> bool {
12614        self.event_receiver.is_terminated()
12615    }
12616}
12617
12618impl futures::Stream for LinkableEventStream {
12619    type Item = Result<LinkableEvent, fidl::Error>;
12620
12621    fn poll_next(
12622        mut self: std::pin::Pin<&mut Self>,
12623        cx: &mut std::task::Context<'_>,
12624    ) -> std::task::Poll<Option<Self::Item>> {
12625        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12626            &mut self.event_receiver,
12627            cx
12628        )?) {
12629            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12630            None => std::task::Poll::Ready(None),
12631        }
12632    }
12633}
12634
12635#[derive(Debug)]
12636pub enum LinkableEvent {}
12637
12638impl LinkableEvent {
12639    /// Decodes a message buffer as a [`LinkableEvent`].
12640    fn decode(
12641        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12642    ) -> Result<LinkableEvent, fidl::Error> {
12643        let (bytes, _handles) = buf.split_mut();
12644        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12645        debug_assert_eq!(tx_header.tx_id, 0);
12646        match tx_header.ordinal {
12647            _ => Err(fidl::Error::UnknownOrdinal {
12648                ordinal: tx_header.ordinal,
12649                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12650            }),
12651        }
12652    }
12653}
12654
12655/// A Stream of incoming requests for fuchsia.io/Linkable.
12656pub struct LinkableRequestStream {
12657    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12658    is_terminated: bool,
12659}
12660
12661impl std::marker::Unpin for LinkableRequestStream {}
12662
12663impl futures::stream::FusedStream for LinkableRequestStream {
12664    fn is_terminated(&self) -> bool {
12665        self.is_terminated
12666    }
12667}
12668
12669impl fidl::endpoints::RequestStream for LinkableRequestStream {
12670    type Protocol = LinkableMarker;
12671    type ControlHandle = LinkableControlHandle;
12672
12673    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12674        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12675    }
12676
12677    fn control_handle(&self) -> Self::ControlHandle {
12678        LinkableControlHandle { inner: self.inner.clone() }
12679    }
12680
12681    fn into_inner(
12682        self,
12683    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12684    {
12685        (self.inner, self.is_terminated)
12686    }
12687
12688    fn from_inner(
12689        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12690        is_terminated: bool,
12691    ) -> Self {
12692        Self { inner, is_terminated }
12693    }
12694}
12695
12696impl futures::Stream for LinkableRequestStream {
12697    type Item = Result<LinkableRequest, fidl::Error>;
12698
12699    fn poll_next(
12700        mut self: std::pin::Pin<&mut Self>,
12701        cx: &mut std::task::Context<'_>,
12702    ) -> std::task::Poll<Option<Self::Item>> {
12703        let this = &mut *self;
12704        if this.inner.check_shutdown(cx) {
12705            this.is_terminated = true;
12706            return std::task::Poll::Ready(None);
12707        }
12708        if this.is_terminated {
12709            panic!("polled LinkableRequestStream after completion");
12710        }
12711        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12712            |bytes, handles| {
12713                match this.inner.channel().read_etc(cx, bytes, handles) {
12714                    std::task::Poll::Ready(Ok(())) => {}
12715                    std::task::Poll::Pending => return std::task::Poll::Pending,
12716                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12717                        this.is_terminated = true;
12718                        return std::task::Poll::Ready(None);
12719                    }
12720                    std::task::Poll::Ready(Err(e)) => {
12721                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12722                            e.into(),
12723                        ))));
12724                    }
12725                }
12726
12727                // A message has been received from the channel
12728                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12729
12730                std::task::Poll::Ready(Some(match header.ordinal {
12731                    0x54f3949246a03e74 => {
12732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12733                        let mut req = fidl::new_empty!(
12734                            LinkableLinkIntoRequest,
12735                            fidl::encoding::DefaultFuchsiaResourceDialect
12736                        );
12737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12738                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12739                        Ok(LinkableRequest::LinkInto {
12740                            dst_parent_token: req.dst_parent_token,
12741                            dst: req.dst,
12742
12743                            responder: LinkableLinkIntoResponder {
12744                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12745                                tx_id: header.tx_id,
12746                            },
12747                        })
12748                    }
12749                    _ => Err(fidl::Error::UnknownOrdinal {
12750                        ordinal: header.ordinal,
12751                        protocol_name:
12752                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12753                    }),
12754                }))
12755            },
12756        )
12757    }
12758}
12759
12760#[derive(Debug)]
12761pub enum LinkableRequest {
12762    /// Creates a link to this this object with name `dst` in the directory represented by
12763    /// `dst_parent_token`.
12764    ///
12765    /// `dst` must be a resolved object name. Including "/" in the string will return
12766    /// `ZX_ERR_INVALID_ARGS`.
12767    ///
12768    /// This method requires the maximal set of rights supported by the filesystem for this object.
12769    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12770    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12771    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12772    /// `ZX_ERR_ACCESS_DENIED`.
12773    ///
12774    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12775    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12776    ///
12777    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12778    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12779    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12780    ///
12781    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12782    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12783    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12784    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12785}
12786
12787impl LinkableRequest {
12788    #[allow(irrefutable_let_patterns)]
12789    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12790        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12791            Some((dst_parent_token, dst, responder))
12792        } else {
12793            None
12794        }
12795    }
12796
12797    /// Name of the method defined in FIDL
12798    pub fn method_name(&self) -> &'static str {
12799        match *self {
12800            LinkableRequest::LinkInto { .. } => "link_into",
12801        }
12802    }
12803}
12804
12805#[derive(Debug, Clone)]
12806pub struct LinkableControlHandle {
12807    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12808}
12809
12810impl LinkableControlHandle {
12811    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12812        self.inner.shutdown_with_epitaph(status.into())
12813    }
12814}
12815
12816impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12817    fn shutdown(&self) {
12818        self.inner.shutdown()
12819    }
12820
12821    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12822        self.inner.shutdown_with_epitaph(status)
12823    }
12824
12825    fn is_closed(&self) -> bool {
12826        self.inner.channel().is_closed()
12827    }
12828    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12829        self.inner.channel().on_closed()
12830    }
12831
12832    #[cfg(target_os = "fuchsia")]
12833    fn signal_peer(
12834        &self,
12835        clear_mask: zx::Signals,
12836        set_mask: zx::Signals,
12837    ) -> Result<(), zx_status::Status> {
12838        use fidl::Peered;
12839        self.inner.channel().signal_peer(clear_mask, set_mask)
12840    }
12841}
12842
12843impl LinkableControlHandle {}
12844
12845#[must_use = "FIDL methods require a response to be sent"]
12846#[derive(Debug)]
12847pub struct LinkableLinkIntoResponder {
12848    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12849    tx_id: u32,
12850}
12851
12852/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12853/// if the responder is dropped without sending a response, so that the client
12854/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12855impl std::ops::Drop for LinkableLinkIntoResponder {
12856    fn drop(&mut self) {
12857        self.control_handle.shutdown();
12858        // Safety: drops once, never accessed again
12859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12860    }
12861}
12862
12863impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12864    type ControlHandle = LinkableControlHandle;
12865
12866    fn control_handle(&self) -> &LinkableControlHandle {
12867        &self.control_handle
12868    }
12869
12870    fn drop_without_shutdown(mut self) {
12871        // Safety: drops once, never accessed again due to mem::forget
12872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12873        // Prevent Drop from running (which would shut down the channel)
12874        std::mem::forget(self);
12875    }
12876}
12877
12878impl LinkableLinkIntoResponder {
12879    /// Sends a response to the FIDL transaction.
12880    ///
12881    /// Sets the channel to shutdown if an error occurs.
12882    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12883        let _result = self.send_raw(result);
12884        if _result.is_err() {
12885            self.control_handle.shutdown();
12886        }
12887        self.drop_without_shutdown();
12888        _result
12889    }
12890
12891    /// Similar to "send" but does not shutdown the channel if an error occurs.
12892    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12893        let _result = self.send_raw(result);
12894        self.drop_without_shutdown();
12895        _result
12896    }
12897
12898    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12899        self.control_handle
12900            .inner
12901            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12902                result,
12903                self.tx_id,
12904                0x54f3949246a03e74,
12905                fidl::encoding::DynamicFlags::empty(),
12906            )
12907    }
12908}
12909
12910#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12911pub struct NodeMarker;
12912
12913impl fidl::endpoints::ProtocolMarker for NodeMarker {
12914    type Proxy = NodeProxy;
12915    type RequestStream = NodeRequestStream;
12916    #[cfg(target_os = "fuchsia")]
12917    type SynchronousProxy = NodeSynchronousProxy;
12918
12919    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12920}
12921impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12922pub type NodeGetFlagsResult = Result<Flags, i32>;
12923pub type NodeSetFlagsResult = Result<(), i32>;
12924pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12925pub type NodeUpdateAttributesResult = Result<(), i32>;
12926pub type NodeSyncResult = Result<(), i32>;
12927pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12928pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12929pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12930
12931pub trait NodeProxyInterface: Send + Sync {
12932    fn r#clone(
12933        &self,
12934        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12935    ) -> Result<(), fidl::Error>;
12936    type CloseResponseFut: std::future::Future<
12937            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12938        > + Send;
12939    fn r#close(&self) -> Self::CloseResponseFut;
12940    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12941    fn r#query(&self) -> Self::QueryResponseFut;
12942    fn r#deprecated_clone(
12943        &self,
12944        flags: OpenFlags,
12945        object: fidl::endpoints::ServerEnd<NodeMarker>,
12946    ) -> Result<(), fidl::Error>;
12947    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12948        + Send;
12949    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
12950    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12951    fn r#deprecated_set_attr(
12952        &self,
12953        flags: NodeAttributeFlags,
12954        attributes: &NodeAttributes,
12955    ) -> Self::DeprecatedSetAttrResponseFut;
12956    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12957        + Send;
12958    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12959    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12960        + Send;
12961    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12962    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12963        + Send;
12964    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12965    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12966        + Send;
12967    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12968    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12969        + Send;
12970    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12971    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12972        + Send;
12973    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12974    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12975        + Send;
12976    fn r#update_attributes(
12977        &self,
12978        payload: &MutableNodeAttributes,
12979    ) -> Self::UpdateAttributesResponseFut;
12980    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12981    fn r#sync(&self) -> Self::SyncResponseFut;
12982    fn r#list_extended_attributes(
12983        &self,
12984        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12985    ) -> Result<(), fidl::Error>;
12986    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12987        + Send;
12988    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12989    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12990        + Send;
12991    fn r#set_extended_attribute(
12992        &self,
12993        name: &[u8],
12994        value: ExtendedAttributeValue,
12995        mode: SetExtendedAttributeMode,
12996    ) -> Self::SetExtendedAttributeResponseFut;
12997    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12998        + Send;
12999    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
13000}
13001#[derive(Debug)]
13002#[cfg(target_os = "fuchsia")]
13003pub struct NodeSynchronousProxy {
13004    client: fidl::client::sync::Client,
13005}
13006
13007#[cfg(target_os = "fuchsia")]
13008impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
13009    type Proxy = NodeProxy;
13010    type Protocol = NodeMarker;
13011
13012    fn from_channel(inner: fidl::Channel) -> Self {
13013        Self::new(inner)
13014    }
13015
13016    fn into_channel(self) -> fidl::Channel {
13017        self.client.into_channel()
13018    }
13019
13020    fn as_channel(&self) -> &fidl::Channel {
13021        self.client.as_channel()
13022    }
13023}
13024
13025#[cfg(target_os = "fuchsia")]
13026impl NodeSynchronousProxy {
13027    pub fn new(channel: fidl::Channel) -> Self {
13028        Self { client: fidl::client::sync::Client::new(channel) }
13029    }
13030
13031    pub fn into_channel(self) -> fidl::Channel {
13032        self.client.into_channel()
13033    }
13034
13035    /// Waits until an event arrives and returns it. It is safe for other
13036    /// threads to make concurrent requests while waiting for an event.
13037    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
13038        NodeEvent::decode(self.client.wait_for_event::<NodeMarker>(deadline)?)
13039    }
13040
13041    pub fn r#clone(
13042        &self,
13043        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13044    ) -> Result<(), fidl::Error> {
13045        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13046            (request,),
13047            0x20d8a7aba2168a79,
13048            fidl::encoding::DynamicFlags::empty(),
13049        )
13050    }
13051
13052    /// Terminates the connection.
13053    ///
13054    /// After calling `Close`, the client must not send any other requests.
13055    ///
13056    /// Servers, after sending the status response, should close the connection
13057    /// regardless of status and without sending an epitaph.
13058    ///
13059    /// Closing the client end of the channel should be semantically equivalent
13060    /// to calling `Close` without knowing when the close has completed or its
13061    /// status.
13062    pub fn r#close(
13063        &self,
13064        ___deadline: zx::MonotonicInstant,
13065    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13066        let _response = self.client.send_query::<
13067            fidl::encoding::EmptyPayload,
13068            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13069            NodeMarker,
13070        >(
13071            (),
13072            0x5ac5d459ad7f657e,
13073            fidl::encoding::DynamicFlags::empty(),
13074            ___deadline,
13075        )?;
13076        Ok(_response.map(|x| x))
13077    }
13078
13079    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
13080        let _response = self.client.send_query::<
13081            fidl::encoding::EmptyPayload,
13082            fidl_fuchsia_unknown::QueryableQueryResponse,
13083            NodeMarker,
13084        >(
13085            (),
13086            0x2658edee9decfc06,
13087            fidl::encoding::DynamicFlags::empty(),
13088            ___deadline,
13089        )?;
13090        Ok(_response.protocol)
13091    }
13092
13093    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13094    pub fn r#deprecated_clone(
13095        &self,
13096        mut flags: OpenFlags,
13097        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13098    ) -> Result<(), fidl::Error> {
13099        self.client.send::<NodeDeprecatedCloneRequest>(
13100            (flags, object),
13101            0x5a61678f293ce16f,
13102            fidl::encoding::DynamicFlags::FLEXIBLE,
13103        )
13104    }
13105
13106    /// DEPRECATED - Use `Node.GetAttributes` instead.
13107    ///
13108    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13109    pub fn r#deprecated_get_attr(
13110        &self,
13111        ___deadline: zx::MonotonicInstant,
13112    ) -> Result<(i32, NodeAttributes), fidl::Error> {
13113        let _response = self
13114            .client
13115            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, NodeMarker>(
13116                (),
13117                0x78985e216314dafd,
13118                fidl::encoding::DynamicFlags::empty(),
13119                ___deadline,
13120            )?;
13121        Ok((_response.s, _response.attributes))
13122    }
13123
13124    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13125    pub fn r#deprecated_set_attr(
13126        &self,
13127        mut flags: NodeAttributeFlags,
13128        mut attributes: &NodeAttributes,
13129        ___deadline: zx::MonotonicInstant,
13130    ) -> Result<i32, fidl::Error> {
13131        let _response = self
13132            .client
13133            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, NodeMarker>(
13134                (flags, attributes),
13135                0x4186c0f40d938f46,
13136                fidl::encoding::DynamicFlags::empty(),
13137                ___deadline,
13138            )?;
13139        Ok(_response.s)
13140    }
13141
13142    /// [DEPRECATED - Use new GetFlags method instead.]
13143    pub fn r#deprecated_get_flags(
13144        &self,
13145        ___deadline: zx::MonotonicInstant,
13146    ) -> Result<(i32, OpenFlags), fidl::Error> {
13147        let _response = self
13148            .client
13149            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, NodeMarker>(
13150                (),
13151                0x5b88fffb8eda3aa1,
13152                fidl::encoding::DynamicFlags::empty(),
13153                ___deadline,
13154            )?;
13155        Ok((_response.s, _response.flags))
13156    }
13157
13158    /// [DEPRECATED - Use new SetFlags method instead.]
13159    pub fn r#deprecated_set_flags(
13160        &self,
13161        mut flags: OpenFlags,
13162        ___deadline: zx::MonotonicInstant,
13163    ) -> Result<i32, fidl::Error> {
13164        let _response = self.client.send_query::<
13165            NodeDeprecatedSetFlagsRequest,
13166            NodeDeprecatedSetFlagsResponse,
13167            NodeMarker,
13168        >(
13169            (flags,),
13170            0x5295b76c71fde733,
13171            fidl::encoding::DynamicFlags::empty(),
13172            ___deadline,
13173        )?;
13174        Ok(_response.s)
13175    }
13176
13177    /// Queries the flags that apply to this node after it has been opened/created. This method does
13178    /// not require any rights.
13179    ///
13180    /// Note that the final set of flags that apply to the connection may differ from those
13181    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13182    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13183    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13184    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13185    pub fn r#get_flags(
13186        &self,
13187        ___deadline: zx::MonotonicInstant,
13188    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13189        let _response = self.client.send_query::<
13190            fidl::encoding::EmptyPayload,
13191            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13192            NodeMarker,
13193        >(
13194            (),
13195            0x176eb318f64ec23,
13196            fidl::encoding::DynamicFlags::FLEXIBLE,
13197            ___deadline,
13198        )?
13199        .into_result::<NodeMarker>("get_flags")?;
13200        Ok(_response.map(|x| x.flags))
13201    }
13202
13203    /// Sets the flags that apply to this node after it has been opened. This method does not
13204    /// require any rights.
13205    ///
13206    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13207    /// clear append mode.
13208    ///
13209    /// Errors:
13210    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13211    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13212    pub fn r#set_flags(
13213        &self,
13214        mut flags: Flags,
13215        ___deadline: zx::MonotonicInstant,
13216    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13217        let _response = self.client.send_query::<
13218            NodeSetFlagsRequest,
13219            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13220            NodeMarker,
13221        >(
13222            (flags,),
13223            0x55a8028685791ea8,
13224            fidl::encoding::DynamicFlags::FLEXIBLE,
13225            ___deadline,
13226        )?
13227        .into_result::<NodeMarker>("set_flags")?;
13228        Ok(_response.map(|x| x))
13229    }
13230
13231    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13232    /// volume has different settings or the storage is accounted seperately from the rest of the
13233    /// filesystem that may be reported instead of filesystem-wide details.
13234    pub fn r#query_filesystem(
13235        &self,
13236        ___deadline: zx::MonotonicInstant,
13237    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13238        let _response = self
13239            .client
13240            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, NodeMarker>(
13241                (),
13242                0x6f344a1c6b0a0610,
13243                fidl::encoding::DynamicFlags::empty(),
13244                ___deadline,
13245            )?;
13246        Ok((_response.s, _response.info))
13247    }
13248
13249    /// Acquires information about the node.
13250    ///
13251    /// The attributes of a node should be stable, independent of the
13252    /// specific protocol used to access it.
13253    ///
13254    /// If a particular attribute is not applicable or not supported,
13255    /// filesystems should leave the corresponding field absent.
13256    ///
13257    /// + `query` a bit-mask specifying which attributes to fetch. The server
13258    ///   should not return more than necessary.
13259    /// - `attributes` the returned attributes.
13260    ///
13261    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13262    pub fn r#get_attributes(
13263        &self,
13264        mut query: NodeAttributesQuery,
13265        ___deadline: zx::MonotonicInstant,
13266    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13267        let _response = self.client.send_query::<
13268            NodeGetAttributesRequest,
13269            fidl::encoding::ResultType<NodeAttributes2, i32>,
13270            NodeMarker,
13271        >(
13272            (query,),
13273            0x3d4396a638ea053b,
13274            fidl::encoding::DynamicFlags::empty(),
13275            ___deadline,
13276        )?;
13277        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13278    }
13279
13280    /// Updates information about the node.
13281    ///
13282    /// + `attributes` the presence of a table field in `attributes` indicates
13283    /// the intent to update the corresponding attribute.
13284    ///
13285    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13286    ///
13287    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13288    pub fn r#update_attributes(
13289        &self,
13290        mut payload: &MutableNodeAttributes,
13291        ___deadline: zx::MonotonicInstant,
13292    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13293        let _response = self.client.send_query::<
13294            MutableNodeAttributes,
13295            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13296            NodeMarker,
13297        >(
13298            payload,
13299            0x3308c1da5a89bf08,
13300            fidl::encoding::DynamicFlags::empty(),
13301            ___deadline,
13302        )?;
13303        Ok(_response.map(|x| x))
13304    }
13305
13306    /// Synchronizes updates to the node to the underlying media, if it exists.
13307    ///
13308    /// This method will return when the filesystem server has flushed the
13309    /// relevant updates to the underlying media, but does not guarantee the
13310    /// underlying media has persisted the information, nor that any information
13311    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13312    /// between operations.
13313    ///
13314    /// This method does not require any rights.
13315    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13316        let _response = self.client.send_query::<
13317            fidl::encoding::EmptyPayload,
13318            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13319            NodeMarker,
13320        >(
13321            (),
13322            0x2c5c27ca0ab5dc49,
13323            fidl::encoding::DynamicFlags::empty(),
13324            ___deadline,
13325        )?;
13326        Ok(_response.map(|x| x))
13327    }
13328
13329    /// Creates an iterator over all the extended attribute names associated
13330    /// with this node. If an error occurs it is returned as an epitaph on the
13331    /// iterator request channel, and then the channel is closed.
13332    ///
13333    /// GetExtendedAttributes can be used with any of these names to retrieve
13334    /// the associated value.
13335    ///
13336    /// This method requires the [`Rights.READ_BYTES`] right.
13337    pub fn r#list_extended_attributes(
13338        &self,
13339        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13340    ) -> Result<(), fidl::Error> {
13341        self.client.send::<NodeListExtendedAttributesRequest>(
13342            (iterator,),
13343            0x4b61033de007fcd0,
13344            fidl::encoding::DynamicFlags::empty(),
13345        )
13346    }
13347
13348    /// Get the value associated with the given attribute `name` for this node.
13349    ///
13350    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13351    /// particular structure is imposed on them.
13352    ///
13353    /// This method requires the [`Rights.READ_BYTES`] right.
13354    pub fn r#get_extended_attribute(
13355        &self,
13356        mut name: &[u8],
13357        ___deadline: zx::MonotonicInstant,
13358    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13359        let _response = self.client.send_query::<
13360            NodeGetExtendedAttributeRequest,
13361            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13362            NodeMarker,
13363        >(
13364            (name,),
13365            0x45ffa3ccfdeb76db,
13366            fidl::encoding::DynamicFlags::empty(),
13367            ___deadline,
13368        )?;
13369        Ok(_response.map(|x| x))
13370    }
13371
13372    /// Set the value for the given attribute `name` to `value` for this node.
13373    ///
13374    /// The attribute name may exist, in which case the attribute is updated.
13375    /// If the attribute doesn't exist, it is created. The name should have no
13376    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13377    ///
13378    /// This method requires the [`Rights.WRITE_BYTES`] right.
13379    pub fn r#set_extended_attribute(
13380        &self,
13381        mut name: &[u8],
13382        mut value: ExtendedAttributeValue,
13383        mut mode: SetExtendedAttributeMode,
13384        ___deadline: zx::MonotonicInstant,
13385    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13386        let _response = self.client.send_query::<
13387            NodeSetExtendedAttributeRequest,
13388            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13389            NodeMarker,
13390        >(
13391            (name, &mut value, mode,),
13392            0x4a951362f681f23c,
13393            fidl::encoding::DynamicFlags::empty(),
13394            ___deadline,
13395        )?;
13396        Ok(_response.map(|x| x))
13397    }
13398
13399    /// Remove the specified extended attribute.
13400    ///
13401    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13402    ///
13403    /// This method requires the [`Rights.WRITE_BYTES`] right.
13404    pub fn r#remove_extended_attribute(
13405        &self,
13406        mut name: &[u8],
13407        ___deadline: zx::MonotonicInstant,
13408    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13409        let _response = self.client.send_query::<
13410            NodeRemoveExtendedAttributeRequest,
13411            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13412            NodeMarker,
13413        >(
13414            (name,),
13415            0x7a0b9f3a9bf9032d,
13416            fidl::encoding::DynamicFlags::empty(),
13417            ___deadline,
13418        )?;
13419        Ok(_response.map(|x| x))
13420    }
13421}
13422
13423#[cfg(target_os = "fuchsia")]
13424impl From<NodeSynchronousProxy> for zx::NullableHandle {
13425    fn from(value: NodeSynchronousProxy) -> Self {
13426        value.into_channel().into()
13427    }
13428}
13429
13430#[cfg(target_os = "fuchsia")]
13431impl From<fidl::Channel> for NodeSynchronousProxy {
13432    fn from(value: fidl::Channel) -> Self {
13433        Self::new(value)
13434    }
13435}
13436
13437#[cfg(target_os = "fuchsia")]
13438impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13439    type Protocol = NodeMarker;
13440
13441    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13442        Self::new(value.into_channel())
13443    }
13444}
13445
13446#[derive(Debug, Clone)]
13447pub struct NodeProxy {
13448    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13449}
13450
13451impl fidl::endpoints::Proxy for NodeProxy {
13452    type Protocol = NodeMarker;
13453
13454    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13455        Self::new(inner)
13456    }
13457
13458    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13459        self.client.into_channel().map_err(|client| Self { client })
13460    }
13461
13462    fn as_channel(&self) -> &::fidl::AsyncChannel {
13463        self.client.as_channel()
13464    }
13465}
13466
13467impl NodeProxy {
13468    /// Create a new Proxy for fuchsia.io/Node.
13469    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13470        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13471        Self { client: fidl::client::Client::new(channel, protocol_name) }
13472    }
13473
13474    /// Get a Stream of events from the remote end of the protocol.
13475    ///
13476    /// # Panics
13477    ///
13478    /// Panics if the event stream was already taken.
13479    pub fn take_event_stream(&self) -> NodeEventStream {
13480        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13481    }
13482
13483    pub fn r#clone(
13484        &self,
13485        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13486    ) -> Result<(), fidl::Error> {
13487        NodeProxyInterface::r#clone(self, request)
13488    }
13489
13490    /// Terminates the connection.
13491    ///
13492    /// After calling `Close`, the client must not send any other requests.
13493    ///
13494    /// Servers, after sending the status response, should close the connection
13495    /// regardless of status and without sending an epitaph.
13496    ///
13497    /// Closing the client end of the channel should be semantically equivalent
13498    /// to calling `Close` without knowing when the close has completed or its
13499    /// status.
13500    pub fn r#close(
13501        &self,
13502    ) -> fidl::client::QueryResponseFut<
13503        fidl_fuchsia_unknown::CloseableCloseResult,
13504        fidl::encoding::DefaultFuchsiaResourceDialect,
13505    > {
13506        NodeProxyInterface::r#close(self)
13507    }
13508
13509    pub fn r#query(
13510        &self,
13511    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13512    {
13513        NodeProxyInterface::r#query(self)
13514    }
13515
13516    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13517    pub fn r#deprecated_clone(
13518        &self,
13519        mut flags: OpenFlags,
13520        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13521    ) -> Result<(), fidl::Error> {
13522        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13523    }
13524
13525    /// DEPRECATED - Use `Node.GetAttributes` instead.
13526    ///
13527    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13528    pub fn r#deprecated_get_attr(
13529        &self,
13530    ) -> fidl::client::QueryResponseFut<
13531        (i32, NodeAttributes),
13532        fidl::encoding::DefaultFuchsiaResourceDialect,
13533    > {
13534        NodeProxyInterface::r#deprecated_get_attr(self)
13535    }
13536
13537    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13538    pub fn r#deprecated_set_attr(
13539        &self,
13540        mut flags: NodeAttributeFlags,
13541        mut attributes: &NodeAttributes,
13542    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13543        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13544    }
13545
13546    /// [DEPRECATED - Use new GetFlags method instead.]
13547    pub fn r#deprecated_get_flags(
13548        &self,
13549    ) -> fidl::client::QueryResponseFut<
13550        (i32, OpenFlags),
13551        fidl::encoding::DefaultFuchsiaResourceDialect,
13552    > {
13553        NodeProxyInterface::r#deprecated_get_flags(self)
13554    }
13555
13556    /// [DEPRECATED - Use new SetFlags method instead.]
13557    pub fn r#deprecated_set_flags(
13558        &self,
13559        mut flags: OpenFlags,
13560    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13561        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13562    }
13563
13564    /// Queries the flags that apply to this node after it has been opened/created. This method does
13565    /// not require any rights.
13566    ///
13567    /// Note that the final set of flags that apply to the connection may differ from those
13568    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13569    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13570    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13571    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13572    pub fn r#get_flags(
13573        &self,
13574    ) -> fidl::client::QueryResponseFut<
13575        NodeGetFlagsResult,
13576        fidl::encoding::DefaultFuchsiaResourceDialect,
13577    > {
13578        NodeProxyInterface::r#get_flags(self)
13579    }
13580
13581    /// Sets the flags that apply to this node after it has been opened. This method does not
13582    /// require any rights.
13583    ///
13584    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13585    /// clear append mode.
13586    ///
13587    /// Errors:
13588    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13589    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13590    pub fn r#set_flags(
13591        &self,
13592        mut flags: Flags,
13593    ) -> fidl::client::QueryResponseFut<
13594        NodeSetFlagsResult,
13595        fidl::encoding::DefaultFuchsiaResourceDialect,
13596    > {
13597        NodeProxyInterface::r#set_flags(self, flags)
13598    }
13599
13600    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13601    /// volume has different settings or the storage is accounted seperately from the rest of the
13602    /// filesystem that may be reported instead of filesystem-wide details.
13603    pub fn r#query_filesystem(
13604        &self,
13605    ) -> fidl::client::QueryResponseFut<
13606        (i32, Option<Box<FilesystemInfo>>),
13607        fidl::encoding::DefaultFuchsiaResourceDialect,
13608    > {
13609        NodeProxyInterface::r#query_filesystem(self)
13610    }
13611
13612    /// Acquires information about the node.
13613    ///
13614    /// The attributes of a node should be stable, independent of the
13615    /// specific protocol used to access it.
13616    ///
13617    /// If a particular attribute is not applicable or not supported,
13618    /// filesystems should leave the corresponding field absent.
13619    ///
13620    /// + `query` a bit-mask specifying which attributes to fetch. The server
13621    ///   should not return more than necessary.
13622    /// - `attributes` the returned attributes.
13623    ///
13624    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13625    pub fn r#get_attributes(
13626        &self,
13627        mut query: NodeAttributesQuery,
13628    ) -> fidl::client::QueryResponseFut<
13629        NodeGetAttributesResult,
13630        fidl::encoding::DefaultFuchsiaResourceDialect,
13631    > {
13632        NodeProxyInterface::r#get_attributes(self, query)
13633    }
13634
13635    /// Updates information about the node.
13636    ///
13637    /// + `attributes` the presence of a table field in `attributes` indicates
13638    /// the intent to update the corresponding attribute.
13639    ///
13640    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13641    ///
13642    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13643    pub fn r#update_attributes(
13644        &self,
13645        mut payload: &MutableNodeAttributes,
13646    ) -> fidl::client::QueryResponseFut<
13647        NodeUpdateAttributesResult,
13648        fidl::encoding::DefaultFuchsiaResourceDialect,
13649    > {
13650        NodeProxyInterface::r#update_attributes(self, payload)
13651    }
13652
13653    /// Synchronizes updates to the node to the underlying media, if it exists.
13654    ///
13655    /// This method will return when the filesystem server has flushed the
13656    /// relevant updates to the underlying media, but does not guarantee the
13657    /// underlying media has persisted the information, nor that any information
13658    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13659    /// between operations.
13660    ///
13661    /// This method does not require any rights.
13662    pub fn r#sync(
13663        &self,
13664    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13665    {
13666        NodeProxyInterface::r#sync(self)
13667    }
13668
13669    /// Creates an iterator over all the extended attribute names associated
13670    /// with this node. If an error occurs it is returned as an epitaph on the
13671    /// iterator request channel, and then the channel is closed.
13672    ///
13673    /// GetExtendedAttributes can be used with any of these names to retrieve
13674    /// the associated value.
13675    ///
13676    /// This method requires the [`Rights.READ_BYTES`] right.
13677    pub fn r#list_extended_attributes(
13678        &self,
13679        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13680    ) -> Result<(), fidl::Error> {
13681        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13682    }
13683
13684    /// Get the value associated with the given attribute `name` for this node.
13685    ///
13686    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13687    /// particular structure is imposed on them.
13688    ///
13689    /// This method requires the [`Rights.READ_BYTES`] right.
13690    pub fn r#get_extended_attribute(
13691        &self,
13692        mut name: &[u8],
13693    ) -> fidl::client::QueryResponseFut<
13694        NodeGetExtendedAttributeResult,
13695        fidl::encoding::DefaultFuchsiaResourceDialect,
13696    > {
13697        NodeProxyInterface::r#get_extended_attribute(self, name)
13698    }
13699
13700    /// Set the value for the given attribute `name` to `value` for this node.
13701    ///
13702    /// The attribute name may exist, in which case the attribute is updated.
13703    /// If the attribute doesn't exist, it is created. The name should have no
13704    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13705    ///
13706    /// This method requires the [`Rights.WRITE_BYTES`] right.
13707    pub fn r#set_extended_attribute(
13708        &self,
13709        mut name: &[u8],
13710        mut value: ExtendedAttributeValue,
13711        mut mode: SetExtendedAttributeMode,
13712    ) -> fidl::client::QueryResponseFut<
13713        NodeSetExtendedAttributeResult,
13714        fidl::encoding::DefaultFuchsiaResourceDialect,
13715    > {
13716        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13717    }
13718
13719    /// Remove the specified extended attribute.
13720    ///
13721    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13722    ///
13723    /// This method requires the [`Rights.WRITE_BYTES`] right.
13724    pub fn r#remove_extended_attribute(
13725        &self,
13726        mut name: &[u8],
13727    ) -> fidl::client::QueryResponseFut<
13728        NodeRemoveExtendedAttributeResult,
13729        fidl::encoding::DefaultFuchsiaResourceDialect,
13730    > {
13731        NodeProxyInterface::r#remove_extended_attribute(self, name)
13732    }
13733}
13734
13735impl NodeProxyInterface for NodeProxy {
13736    fn r#clone(
13737        &self,
13738        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13739    ) -> Result<(), fidl::Error> {
13740        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13741            (request,),
13742            0x20d8a7aba2168a79,
13743            fidl::encoding::DynamicFlags::empty(),
13744        )
13745    }
13746
13747    type CloseResponseFut = fidl::client::QueryResponseFut<
13748        fidl_fuchsia_unknown::CloseableCloseResult,
13749        fidl::encoding::DefaultFuchsiaResourceDialect,
13750    >;
13751    fn r#close(&self) -> Self::CloseResponseFut {
13752        fn _decode(
13753            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13754        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13755            let _response = fidl::client::decode_transaction_body::<
13756                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13757                fidl::encoding::DefaultFuchsiaResourceDialect,
13758                0x5ac5d459ad7f657e,
13759            >(_buf?)?;
13760            Ok(_response.map(|x| x))
13761        }
13762        self.client.send_query_and_decode::<
13763            fidl::encoding::EmptyPayload,
13764            fidl_fuchsia_unknown::CloseableCloseResult,
13765        >(
13766            (),
13767            0x5ac5d459ad7f657e,
13768            fidl::encoding::DynamicFlags::empty(),
13769            _decode,
13770        )
13771    }
13772
13773    type QueryResponseFut =
13774        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13775    fn r#query(&self) -> Self::QueryResponseFut {
13776        fn _decode(
13777            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13778        ) -> Result<Vec<u8>, fidl::Error> {
13779            let _response = fidl::client::decode_transaction_body::<
13780                fidl_fuchsia_unknown::QueryableQueryResponse,
13781                fidl::encoding::DefaultFuchsiaResourceDialect,
13782                0x2658edee9decfc06,
13783            >(_buf?)?;
13784            Ok(_response.protocol)
13785        }
13786        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13787            (),
13788            0x2658edee9decfc06,
13789            fidl::encoding::DynamicFlags::empty(),
13790            _decode,
13791        )
13792    }
13793
13794    fn r#deprecated_clone(
13795        &self,
13796        mut flags: OpenFlags,
13797        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13798    ) -> Result<(), fidl::Error> {
13799        self.client.send::<NodeDeprecatedCloneRequest>(
13800            (flags, object),
13801            0x5a61678f293ce16f,
13802            fidl::encoding::DynamicFlags::FLEXIBLE,
13803        )
13804    }
13805
13806    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
13807        (i32, NodeAttributes),
13808        fidl::encoding::DefaultFuchsiaResourceDialect,
13809    >;
13810    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
13811        fn _decode(
13812            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13813        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13814            let _response = fidl::client::decode_transaction_body::<
13815                NodeDeprecatedGetAttrResponse,
13816                fidl::encoding::DefaultFuchsiaResourceDialect,
13817                0x78985e216314dafd,
13818            >(_buf?)?;
13819            Ok((_response.s, _response.attributes))
13820        }
13821        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13822            (),
13823            0x78985e216314dafd,
13824            fidl::encoding::DynamicFlags::empty(),
13825            _decode,
13826        )
13827    }
13828
13829    type DeprecatedSetAttrResponseFut =
13830        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13831    fn r#deprecated_set_attr(
13832        &self,
13833        mut flags: NodeAttributeFlags,
13834        mut attributes: &NodeAttributes,
13835    ) -> Self::DeprecatedSetAttrResponseFut {
13836        fn _decode(
13837            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13838        ) -> Result<i32, fidl::Error> {
13839            let _response = fidl::client::decode_transaction_body::<
13840                NodeDeprecatedSetAttrResponse,
13841                fidl::encoding::DefaultFuchsiaResourceDialect,
13842                0x4186c0f40d938f46,
13843            >(_buf?)?;
13844            Ok(_response.s)
13845        }
13846        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13847            (flags, attributes),
13848            0x4186c0f40d938f46,
13849            fidl::encoding::DynamicFlags::empty(),
13850            _decode,
13851        )
13852    }
13853
13854    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13855        (i32, OpenFlags),
13856        fidl::encoding::DefaultFuchsiaResourceDialect,
13857    >;
13858    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13859        fn _decode(
13860            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13861        ) -> Result<(i32, OpenFlags), fidl::Error> {
13862            let _response = fidl::client::decode_transaction_body::<
13863                NodeDeprecatedGetFlagsResponse,
13864                fidl::encoding::DefaultFuchsiaResourceDialect,
13865                0x5b88fffb8eda3aa1,
13866            >(_buf?)?;
13867            Ok((_response.s, _response.flags))
13868        }
13869        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13870            (),
13871            0x5b88fffb8eda3aa1,
13872            fidl::encoding::DynamicFlags::empty(),
13873            _decode,
13874        )
13875    }
13876
13877    type DeprecatedSetFlagsResponseFut =
13878        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13879    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13880        fn _decode(
13881            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13882        ) -> Result<i32, fidl::Error> {
13883            let _response = fidl::client::decode_transaction_body::<
13884                NodeDeprecatedSetFlagsResponse,
13885                fidl::encoding::DefaultFuchsiaResourceDialect,
13886                0x5295b76c71fde733,
13887            >(_buf?)?;
13888            Ok(_response.s)
13889        }
13890        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13891            (flags,),
13892            0x5295b76c71fde733,
13893            fidl::encoding::DynamicFlags::empty(),
13894            _decode,
13895        )
13896    }
13897
13898    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13899        NodeGetFlagsResult,
13900        fidl::encoding::DefaultFuchsiaResourceDialect,
13901    >;
13902    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13903        fn _decode(
13904            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13905        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13906            let _response = fidl::client::decode_transaction_body::<
13907                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13908                fidl::encoding::DefaultFuchsiaResourceDialect,
13909                0x176eb318f64ec23,
13910            >(_buf?)?
13911            .into_result::<NodeMarker>("get_flags")?;
13912            Ok(_response.map(|x| x.flags))
13913        }
13914        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13915            (),
13916            0x176eb318f64ec23,
13917            fidl::encoding::DynamicFlags::FLEXIBLE,
13918            _decode,
13919        )
13920    }
13921
13922    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13923        NodeSetFlagsResult,
13924        fidl::encoding::DefaultFuchsiaResourceDialect,
13925    >;
13926    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13927        fn _decode(
13928            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13929        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13930            let _response = fidl::client::decode_transaction_body::<
13931                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13932                fidl::encoding::DefaultFuchsiaResourceDialect,
13933                0x55a8028685791ea8,
13934            >(_buf?)?
13935            .into_result::<NodeMarker>("set_flags")?;
13936            Ok(_response.map(|x| x))
13937        }
13938        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13939            (flags,),
13940            0x55a8028685791ea8,
13941            fidl::encoding::DynamicFlags::FLEXIBLE,
13942            _decode,
13943        )
13944    }
13945
13946    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13947        (i32, Option<Box<FilesystemInfo>>),
13948        fidl::encoding::DefaultFuchsiaResourceDialect,
13949    >;
13950    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13951        fn _decode(
13952            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13953        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13954            let _response = fidl::client::decode_transaction_body::<
13955                NodeQueryFilesystemResponse,
13956                fidl::encoding::DefaultFuchsiaResourceDialect,
13957                0x6f344a1c6b0a0610,
13958            >(_buf?)?;
13959            Ok((_response.s, _response.info))
13960        }
13961        self.client.send_query_and_decode::<
13962            fidl::encoding::EmptyPayload,
13963            (i32, Option<Box<FilesystemInfo>>),
13964        >(
13965            (),
13966            0x6f344a1c6b0a0610,
13967            fidl::encoding::DynamicFlags::empty(),
13968            _decode,
13969        )
13970    }
13971
13972    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13973        NodeGetAttributesResult,
13974        fidl::encoding::DefaultFuchsiaResourceDialect,
13975    >;
13976    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13977        fn _decode(
13978            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13979        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13980            let _response = fidl::client::decode_transaction_body::<
13981                fidl::encoding::ResultType<NodeAttributes2, i32>,
13982                fidl::encoding::DefaultFuchsiaResourceDialect,
13983                0x3d4396a638ea053b,
13984            >(_buf?)?;
13985            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13986        }
13987        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13988            (query,),
13989            0x3d4396a638ea053b,
13990            fidl::encoding::DynamicFlags::empty(),
13991            _decode,
13992        )
13993    }
13994
13995    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13996        NodeUpdateAttributesResult,
13997        fidl::encoding::DefaultFuchsiaResourceDialect,
13998    >;
13999    fn r#update_attributes(
14000        &self,
14001        mut payload: &MutableNodeAttributes,
14002    ) -> Self::UpdateAttributesResponseFut {
14003        fn _decode(
14004            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14005        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
14006            let _response = fidl::client::decode_transaction_body::<
14007                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14008                fidl::encoding::DefaultFuchsiaResourceDialect,
14009                0x3308c1da5a89bf08,
14010            >(_buf?)?;
14011            Ok(_response.map(|x| x))
14012        }
14013        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
14014            payload,
14015            0x3308c1da5a89bf08,
14016            fidl::encoding::DynamicFlags::empty(),
14017            _decode,
14018        )
14019    }
14020
14021    type SyncResponseFut = fidl::client::QueryResponseFut<
14022        NodeSyncResult,
14023        fidl::encoding::DefaultFuchsiaResourceDialect,
14024    >;
14025    fn r#sync(&self) -> Self::SyncResponseFut {
14026        fn _decode(
14027            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14028        ) -> Result<NodeSyncResult, fidl::Error> {
14029            let _response = fidl::client::decode_transaction_body::<
14030                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14031                fidl::encoding::DefaultFuchsiaResourceDialect,
14032                0x2c5c27ca0ab5dc49,
14033            >(_buf?)?;
14034            Ok(_response.map(|x| x))
14035        }
14036        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
14037            (),
14038            0x2c5c27ca0ab5dc49,
14039            fidl::encoding::DynamicFlags::empty(),
14040            _decode,
14041        )
14042    }
14043
14044    fn r#list_extended_attributes(
14045        &self,
14046        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14047    ) -> Result<(), fidl::Error> {
14048        self.client.send::<NodeListExtendedAttributesRequest>(
14049            (iterator,),
14050            0x4b61033de007fcd0,
14051            fidl::encoding::DynamicFlags::empty(),
14052        )
14053    }
14054
14055    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14056        NodeGetExtendedAttributeResult,
14057        fidl::encoding::DefaultFuchsiaResourceDialect,
14058    >;
14059    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14060        fn _decode(
14061            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14062        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14063            let _response = fidl::client::decode_transaction_body::<
14064                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14065                fidl::encoding::DefaultFuchsiaResourceDialect,
14066                0x45ffa3ccfdeb76db,
14067            >(_buf?)?;
14068            Ok(_response.map(|x| x))
14069        }
14070        self.client.send_query_and_decode::<
14071            NodeGetExtendedAttributeRequest,
14072            NodeGetExtendedAttributeResult,
14073        >(
14074            (name,),
14075            0x45ffa3ccfdeb76db,
14076            fidl::encoding::DynamicFlags::empty(),
14077            _decode,
14078        )
14079    }
14080
14081    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14082        NodeSetExtendedAttributeResult,
14083        fidl::encoding::DefaultFuchsiaResourceDialect,
14084    >;
14085    fn r#set_extended_attribute(
14086        &self,
14087        mut name: &[u8],
14088        mut value: ExtendedAttributeValue,
14089        mut mode: SetExtendedAttributeMode,
14090    ) -> Self::SetExtendedAttributeResponseFut {
14091        fn _decode(
14092            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14093        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14094            let _response = fidl::client::decode_transaction_body::<
14095                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14096                fidl::encoding::DefaultFuchsiaResourceDialect,
14097                0x4a951362f681f23c,
14098            >(_buf?)?;
14099            Ok(_response.map(|x| x))
14100        }
14101        self.client.send_query_and_decode::<
14102            NodeSetExtendedAttributeRequest,
14103            NodeSetExtendedAttributeResult,
14104        >(
14105            (name, &mut value, mode,),
14106            0x4a951362f681f23c,
14107            fidl::encoding::DynamicFlags::empty(),
14108            _decode,
14109        )
14110    }
14111
14112    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14113        NodeRemoveExtendedAttributeResult,
14114        fidl::encoding::DefaultFuchsiaResourceDialect,
14115    >;
14116    fn r#remove_extended_attribute(
14117        &self,
14118        mut name: &[u8],
14119    ) -> Self::RemoveExtendedAttributeResponseFut {
14120        fn _decode(
14121            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14122        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14123            let _response = fidl::client::decode_transaction_body::<
14124                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14125                fidl::encoding::DefaultFuchsiaResourceDialect,
14126                0x7a0b9f3a9bf9032d,
14127            >(_buf?)?;
14128            Ok(_response.map(|x| x))
14129        }
14130        self.client.send_query_and_decode::<
14131            NodeRemoveExtendedAttributeRequest,
14132            NodeRemoveExtendedAttributeResult,
14133        >(
14134            (name,),
14135            0x7a0b9f3a9bf9032d,
14136            fidl::encoding::DynamicFlags::empty(),
14137            _decode,
14138        )
14139    }
14140}
14141
14142pub struct NodeEventStream {
14143    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
14144}
14145
14146impl std::marker::Unpin for NodeEventStream {}
14147
14148impl futures::stream::FusedStream for NodeEventStream {
14149    fn is_terminated(&self) -> bool {
14150        self.event_receiver.is_terminated()
14151    }
14152}
14153
14154impl futures::Stream for NodeEventStream {
14155    type Item = Result<NodeEvent, fidl::Error>;
14156
14157    fn poll_next(
14158        mut self: std::pin::Pin<&mut Self>,
14159        cx: &mut std::task::Context<'_>,
14160    ) -> std::task::Poll<Option<Self::Item>> {
14161        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14162            &mut self.event_receiver,
14163            cx
14164        )?) {
14165            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14166            None => std::task::Poll::Ready(None),
14167        }
14168    }
14169}
14170
14171#[derive(Debug)]
14172pub enum NodeEvent {
14173    OnOpen_ {
14174        s: i32,
14175        info: Option<Box<NodeInfoDeprecated>>,
14176    },
14177    OnRepresentation {
14178        payload: Representation,
14179    },
14180    #[non_exhaustive]
14181    _UnknownEvent {
14182        /// Ordinal of the event that was sent.
14183        ordinal: u64,
14184    },
14185}
14186
14187impl NodeEvent {
14188    #[allow(irrefutable_let_patterns)]
14189    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14190        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14191    }
14192    #[allow(irrefutable_let_patterns)]
14193    pub fn into_on_representation(self) -> Option<Representation> {
14194        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14195    }
14196
14197    /// Decodes a message buffer as a [`NodeEvent`].
14198    fn decode(
14199        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14200    ) -> Result<NodeEvent, fidl::Error> {
14201        let (bytes, _handles) = buf.split_mut();
14202        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14203        debug_assert_eq!(tx_header.tx_id, 0);
14204        match tx_header.ordinal {
14205            0x7fc7bbb1dbfd1972 => {
14206                let mut out = fidl::new_empty!(
14207                    NodeOnOpenRequest,
14208                    fidl::encoding::DefaultFuchsiaResourceDialect
14209                );
14210                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14211                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14212            }
14213            0x5cb40567d80a510c => {
14214                let mut out =
14215                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14216                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14217                Ok((NodeEvent::OnRepresentation { payload: out }))
14218            }
14219            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14220                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14221            }
14222            _ => Err(fidl::Error::UnknownOrdinal {
14223                ordinal: tx_header.ordinal,
14224                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14225            }),
14226        }
14227    }
14228}
14229
14230/// A Stream of incoming requests for fuchsia.io/Node.
14231pub struct NodeRequestStream {
14232    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14233    is_terminated: bool,
14234}
14235
14236impl std::marker::Unpin for NodeRequestStream {}
14237
14238impl futures::stream::FusedStream for NodeRequestStream {
14239    fn is_terminated(&self) -> bool {
14240        self.is_terminated
14241    }
14242}
14243
14244impl fidl::endpoints::RequestStream for NodeRequestStream {
14245    type Protocol = NodeMarker;
14246    type ControlHandle = NodeControlHandle;
14247
14248    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14249        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14250    }
14251
14252    fn control_handle(&self) -> Self::ControlHandle {
14253        NodeControlHandle { inner: self.inner.clone() }
14254    }
14255
14256    fn into_inner(
14257        self,
14258    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14259    {
14260        (self.inner, self.is_terminated)
14261    }
14262
14263    fn from_inner(
14264        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14265        is_terminated: bool,
14266    ) -> Self {
14267        Self { inner, is_terminated }
14268    }
14269}
14270
14271impl futures::Stream for NodeRequestStream {
14272    type Item = Result<NodeRequest, fidl::Error>;
14273
14274    fn poll_next(
14275        mut self: std::pin::Pin<&mut Self>,
14276        cx: &mut std::task::Context<'_>,
14277    ) -> std::task::Poll<Option<Self::Item>> {
14278        let this = &mut *self;
14279        if this.inner.check_shutdown(cx) {
14280            this.is_terminated = true;
14281            return std::task::Poll::Ready(None);
14282        }
14283        if this.is_terminated {
14284            panic!("polled NodeRequestStream after completion");
14285        }
14286        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14287            |bytes, handles| {
14288                match this.inner.channel().read_etc(cx, bytes, handles) {
14289                    std::task::Poll::Ready(Ok(())) => {}
14290                    std::task::Poll::Pending => return std::task::Poll::Pending,
14291                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14292                        this.is_terminated = true;
14293                        return std::task::Poll::Ready(None);
14294                    }
14295                    std::task::Poll::Ready(Err(e)) => {
14296                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14297                            e.into(),
14298                        ))));
14299                    }
14300                }
14301
14302                // A message has been received from the channel
14303                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14304
14305                std::task::Poll::Ready(Some(match header.ordinal {
14306                    0x20d8a7aba2168a79 => {
14307                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14308                        let mut req = fidl::new_empty!(
14309                            fidl_fuchsia_unknown::CloneableCloneRequest,
14310                            fidl::encoding::DefaultFuchsiaResourceDialect
14311                        );
14312                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14313                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14314                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14315                    }
14316                    0x5ac5d459ad7f657e => {
14317                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14318                        let mut req = fidl::new_empty!(
14319                            fidl::encoding::EmptyPayload,
14320                            fidl::encoding::DefaultFuchsiaResourceDialect
14321                        );
14322                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14323                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14324                        Ok(NodeRequest::Close {
14325                            responder: NodeCloseResponder {
14326                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14327                                tx_id: header.tx_id,
14328                            },
14329                        })
14330                    }
14331                    0x2658edee9decfc06 => {
14332                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14333                        let mut req = fidl::new_empty!(
14334                            fidl::encoding::EmptyPayload,
14335                            fidl::encoding::DefaultFuchsiaResourceDialect
14336                        );
14337                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14338                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14339                        Ok(NodeRequest::Query {
14340                            responder: NodeQueryResponder {
14341                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14342                                tx_id: header.tx_id,
14343                            },
14344                        })
14345                    }
14346                    0x5a61678f293ce16f => {
14347                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14348                        let mut req = fidl::new_empty!(
14349                            NodeDeprecatedCloneRequest,
14350                            fidl::encoding::DefaultFuchsiaResourceDialect
14351                        );
14352                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14353                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14354                        Ok(NodeRequest::DeprecatedClone {
14355                            flags: req.flags,
14356                            object: req.object,
14357
14358                            control_handle,
14359                        })
14360                    }
14361                    0x78985e216314dafd => {
14362                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14363                        let mut req = fidl::new_empty!(
14364                            fidl::encoding::EmptyPayload,
14365                            fidl::encoding::DefaultFuchsiaResourceDialect
14366                        );
14367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14368                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14369                        Ok(NodeRequest::DeprecatedGetAttr {
14370                            responder: NodeDeprecatedGetAttrResponder {
14371                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14372                                tx_id: header.tx_id,
14373                            },
14374                        })
14375                    }
14376                    0x4186c0f40d938f46 => {
14377                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14378                        let mut req = fidl::new_empty!(
14379                            NodeDeprecatedSetAttrRequest,
14380                            fidl::encoding::DefaultFuchsiaResourceDialect
14381                        );
14382                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14383                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14384                        Ok(NodeRequest::DeprecatedSetAttr {
14385                            flags: req.flags,
14386                            attributes: req.attributes,
14387
14388                            responder: NodeDeprecatedSetAttrResponder {
14389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14390                                tx_id: header.tx_id,
14391                            },
14392                        })
14393                    }
14394                    0x5b88fffb8eda3aa1 => {
14395                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14396                        let mut req = fidl::new_empty!(
14397                            fidl::encoding::EmptyPayload,
14398                            fidl::encoding::DefaultFuchsiaResourceDialect
14399                        );
14400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14401                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14402                        Ok(NodeRequest::DeprecatedGetFlags {
14403                            responder: NodeDeprecatedGetFlagsResponder {
14404                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14405                                tx_id: header.tx_id,
14406                            },
14407                        })
14408                    }
14409                    0x5295b76c71fde733 => {
14410                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14411                        let mut req = fidl::new_empty!(
14412                            NodeDeprecatedSetFlagsRequest,
14413                            fidl::encoding::DefaultFuchsiaResourceDialect
14414                        );
14415                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14416                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14417                        Ok(NodeRequest::DeprecatedSetFlags {
14418                            flags: req.flags,
14419
14420                            responder: NodeDeprecatedSetFlagsResponder {
14421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14422                                tx_id: header.tx_id,
14423                            },
14424                        })
14425                    }
14426                    0x176eb318f64ec23 => {
14427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14428                        let mut req = fidl::new_empty!(
14429                            fidl::encoding::EmptyPayload,
14430                            fidl::encoding::DefaultFuchsiaResourceDialect
14431                        );
14432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14433                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14434                        Ok(NodeRequest::GetFlags {
14435                            responder: NodeGetFlagsResponder {
14436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14437                                tx_id: header.tx_id,
14438                            },
14439                        })
14440                    }
14441                    0x55a8028685791ea8 => {
14442                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14443                        let mut req = fidl::new_empty!(
14444                            NodeSetFlagsRequest,
14445                            fidl::encoding::DefaultFuchsiaResourceDialect
14446                        );
14447                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14448                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14449                        Ok(NodeRequest::SetFlags {
14450                            flags: req.flags,
14451
14452                            responder: NodeSetFlagsResponder {
14453                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14454                                tx_id: header.tx_id,
14455                            },
14456                        })
14457                    }
14458                    0x6f344a1c6b0a0610 => {
14459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14460                        let mut req = fidl::new_empty!(
14461                            fidl::encoding::EmptyPayload,
14462                            fidl::encoding::DefaultFuchsiaResourceDialect
14463                        );
14464                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14465                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14466                        Ok(NodeRequest::QueryFilesystem {
14467                            responder: NodeQueryFilesystemResponder {
14468                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14469                                tx_id: header.tx_id,
14470                            },
14471                        })
14472                    }
14473                    0x3d4396a638ea053b => {
14474                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14475                        let mut req = fidl::new_empty!(
14476                            NodeGetAttributesRequest,
14477                            fidl::encoding::DefaultFuchsiaResourceDialect
14478                        );
14479                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14480                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14481                        Ok(NodeRequest::GetAttributes {
14482                            query: req.query,
14483
14484                            responder: NodeGetAttributesResponder {
14485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14486                                tx_id: header.tx_id,
14487                            },
14488                        })
14489                    }
14490                    0x3308c1da5a89bf08 => {
14491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14492                        let mut req = fidl::new_empty!(
14493                            MutableNodeAttributes,
14494                            fidl::encoding::DefaultFuchsiaResourceDialect
14495                        );
14496                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14497                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14498                        Ok(NodeRequest::UpdateAttributes {
14499                            payload: req,
14500                            responder: NodeUpdateAttributesResponder {
14501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14502                                tx_id: header.tx_id,
14503                            },
14504                        })
14505                    }
14506                    0x2c5c27ca0ab5dc49 => {
14507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14508                        let mut req = fidl::new_empty!(
14509                            fidl::encoding::EmptyPayload,
14510                            fidl::encoding::DefaultFuchsiaResourceDialect
14511                        );
14512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14513                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14514                        Ok(NodeRequest::Sync {
14515                            responder: NodeSyncResponder {
14516                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14517                                tx_id: header.tx_id,
14518                            },
14519                        })
14520                    }
14521                    0x4b61033de007fcd0 => {
14522                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14523                        let mut req = fidl::new_empty!(
14524                            NodeListExtendedAttributesRequest,
14525                            fidl::encoding::DefaultFuchsiaResourceDialect
14526                        );
14527                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14528                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14529                        Ok(NodeRequest::ListExtendedAttributes {
14530                            iterator: req.iterator,
14531
14532                            control_handle,
14533                        })
14534                    }
14535                    0x45ffa3ccfdeb76db => {
14536                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14537                        let mut req = fidl::new_empty!(
14538                            NodeGetExtendedAttributeRequest,
14539                            fidl::encoding::DefaultFuchsiaResourceDialect
14540                        );
14541                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14542                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14543                        Ok(NodeRequest::GetExtendedAttribute {
14544                            name: req.name,
14545
14546                            responder: NodeGetExtendedAttributeResponder {
14547                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14548                                tx_id: header.tx_id,
14549                            },
14550                        })
14551                    }
14552                    0x4a951362f681f23c => {
14553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14554                        let mut req = fidl::new_empty!(
14555                            NodeSetExtendedAttributeRequest,
14556                            fidl::encoding::DefaultFuchsiaResourceDialect
14557                        );
14558                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14559                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14560                        Ok(NodeRequest::SetExtendedAttribute {
14561                            name: req.name,
14562                            value: req.value,
14563                            mode: req.mode,
14564
14565                            responder: NodeSetExtendedAttributeResponder {
14566                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14567                                tx_id: header.tx_id,
14568                            },
14569                        })
14570                    }
14571                    0x7a0b9f3a9bf9032d => {
14572                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14573                        let mut req = fidl::new_empty!(
14574                            NodeRemoveExtendedAttributeRequest,
14575                            fidl::encoding::DefaultFuchsiaResourceDialect
14576                        );
14577                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14578                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14579                        Ok(NodeRequest::RemoveExtendedAttribute {
14580                            name: req.name,
14581
14582                            responder: NodeRemoveExtendedAttributeResponder {
14583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14584                                tx_id: header.tx_id,
14585                            },
14586                        })
14587                    }
14588                    _ if header.tx_id == 0
14589                        && header
14590                            .dynamic_flags()
14591                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14592                    {
14593                        Ok(NodeRequest::_UnknownMethod {
14594                            ordinal: header.ordinal,
14595                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14596                            method_type: fidl::MethodType::OneWay,
14597                        })
14598                    }
14599                    _ if header
14600                        .dynamic_flags()
14601                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14602                    {
14603                        this.inner.send_framework_err(
14604                            fidl::encoding::FrameworkErr::UnknownMethod,
14605                            header.tx_id,
14606                            header.ordinal,
14607                            header.dynamic_flags(),
14608                            (bytes, handles),
14609                        )?;
14610                        Ok(NodeRequest::_UnknownMethod {
14611                            ordinal: header.ordinal,
14612                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14613                            method_type: fidl::MethodType::TwoWay,
14614                        })
14615                    }
14616                    _ => Err(fidl::Error::UnknownOrdinal {
14617                        ordinal: header.ordinal,
14618                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14619                    }),
14620                }))
14621            },
14622        )
14623    }
14624}
14625
14626/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14627#[derive(Debug)]
14628pub enum NodeRequest {
14629    Clone {
14630        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14631        control_handle: NodeControlHandle,
14632    },
14633    /// Terminates the connection.
14634    ///
14635    /// After calling `Close`, the client must not send any other requests.
14636    ///
14637    /// Servers, after sending the status response, should close the connection
14638    /// regardless of status and without sending an epitaph.
14639    ///
14640    /// Closing the client end of the channel should be semantically equivalent
14641    /// to calling `Close` without knowing when the close has completed or its
14642    /// status.
14643    Close {
14644        responder: NodeCloseResponder,
14645    },
14646    Query {
14647        responder: NodeQueryResponder,
14648    },
14649    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14650    DeprecatedClone {
14651        flags: OpenFlags,
14652        object: fidl::endpoints::ServerEnd<NodeMarker>,
14653        control_handle: NodeControlHandle,
14654    },
14655    /// DEPRECATED - Use `Node.GetAttributes` instead.
14656    ///
14657    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14658    DeprecatedGetAttr {
14659        responder: NodeDeprecatedGetAttrResponder,
14660    },
14661    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14662    DeprecatedSetAttr {
14663        flags: NodeAttributeFlags,
14664        attributes: NodeAttributes,
14665        responder: NodeDeprecatedSetAttrResponder,
14666    },
14667    /// [DEPRECATED - Use new GetFlags method instead.]
14668    DeprecatedGetFlags {
14669        responder: NodeDeprecatedGetFlagsResponder,
14670    },
14671    /// [DEPRECATED - Use new SetFlags method instead.]
14672    DeprecatedSetFlags {
14673        flags: OpenFlags,
14674        responder: NodeDeprecatedSetFlagsResponder,
14675    },
14676    /// Queries the flags that apply to this node after it has been opened/created. This method does
14677    /// not require any rights.
14678    ///
14679    /// Note that the final set of flags that apply to the connection may differ from those
14680    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14681    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14682    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14683    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14684    GetFlags {
14685        responder: NodeGetFlagsResponder,
14686    },
14687    /// Sets the flags that apply to this node after it has been opened. This method does not
14688    /// require any rights.
14689    ///
14690    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14691    /// clear append mode.
14692    ///
14693    /// Errors:
14694    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14695    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14696    SetFlags {
14697        flags: Flags,
14698        responder: NodeSetFlagsResponder,
14699    },
14700    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14701    /// volume has different settings or the storage is accounted seperately from the rest of the
14702    /// filesystem that may be reported instead of filesystem-wide details.
14703    QueryFilesystem {
14704        responder: NodeQueryFilesystemResponder,
14705    },
14706    /// Acquires information about the node.
14707    ///
14708    /// The attributes of a node should be stable, independent of the
14709    /// specific protocol used to access it.
14710    ///
14711    /// If a particular attribute is not applicable or not supported,
14712    /// filesystems should leave the corresponding field absent.
14713    ///
14714    /// + `query` a bit-mask specifying which attributes to fetch. The server
14715    ///   should not return more than necessary.
14716    /// - `attributes` the returned attributes.
14717    ///
14718    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14719    GetAttributes {
14720        query: NodeAttributesQuery,
14721        responder: NodeGetAttributesResponder,
14722    },
14723    /// Updates information about the node.
14724    ///
14725    /// + `attributes` the presence of a table field in `attributes` indicates
14726    /// the intent to update the corresponding attribute.
14727    ///
14728    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14729    ///
14730    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14731    UpdateAttributes {
14732        payload: MutableNodeAttributes,
14733        responder: NodeUpdateAttributesResponder,
14734    },
14735    /// Synchronizes updates to the node to the underlying media, if it exists.
14736    ///
14737    /// This method will return when the filesystem server has flushed the
14738    /// relevant updates to the underlying media, but does not guarantee the
14739    /// underlying media has persisted the information, nor that any information
14740    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14741    /// between operations.
14742    ///
14743    /// This method does not require any rights.
14744    Sync {
14745        responder: NodeSyncResponder,
14746    },
14747    /// Creates an iterator over all the extended attribute names associated
14748    /// with this node. If an error occurs it is returned as an epitaph on the
14749    /// iterator request channel, and then the channel is closed.
14750    ///
14751    /// GetExtendedAttributes can be used with any of these names to retrieve
14752    /// the associated value.
14753    ///
14754    /// This method requires the [`Rights.READ_BYTES`] right.
14755    ListExtendedAttributes {
14756        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14757        control_handle: NodeControlHandle,
14758    },
14759    /// Get the value associated with the given attribute `name` for this node.
14760    ///
14761    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14762    /// particular structure is imposed on them.
14763    ///
14764    /// This method requires the [`Rights.READ_BYTES`] right.
14765    GetExtendedAttribute {
14766        name: Vec<u8>,
14767        responder: NodeGetExtendedAttributeResponder,
14768    },
14769    /// Set the value for the given attribute `name` to `value` for this node.
14770    ///
14771    /// The attribute name may exist, in which case the attribute is updated.
14772    /// If the attribute doesn't exist, it is created. The name should have no
14773    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14774    ///
14775    /// This method requires the [`Rights.WRITE_BYTES`] right.
14776    SetExtendedAttribute {
14777        name: Vec<u8>,
14778        value: ExtendedAttributeValue,
14779        mode: SetExtendedAttributeMode,
14780        responder: NodeSetExtendedAttributeResponder,
14781    },
14782    /// Remove the specified extended attribute.
14783    ///
14784    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14785    ///
14786    /// This method requires the [`Rights.WRITE_BYTES`] right.
14787    RemoveExtendedAttribute {
14788        name: Vec<u8>,
14789        responder: NodeRemoveExtendedAttributeResponder,
14790    },
14791    /// An interaction was received which does not match any known method.
14792    #[non_exhaustive]
14793    _UnknownMethod {
14794        /// Ordinal of the method that was called.
14795        ordinal: u64,
14796        control_handle: NodeControlHandle,
14797        method_type: fidl::MethodType,
14798    },
14799}
14800
14801impl NodeRequest {
14802    #[allow(irrefutable_let_patterns)]
14803    pub fn into_clone(
14804        self,
14805    ) -> Option<(
14806        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14807        NodeControlHandle,
14808    )> {
14809        if let NodeRequest::Clone { request, control_handle } = self {
14810            Some((request, control_handle))
14811        } else {
14812            None
14813        }
14814    }
14815
14816    #[allow(irrefutable_let_patterns)]
14817    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14818        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
14819    }
14820
14821    #[allow(irrefutable_let_patterns)]
14822    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14823        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
14824    }
14825
14826    #[allow(irrefutable_let_patterns)]
14827    pub fn into_deprecated_clone(
14828        self,
14829    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14830        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14831            Some((flags, object, control_handle))
14832        } else {
14833            None
14834        }
14835    }
14836
14837    #[allow(irrefutable_let_patterns)]
14838    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
14839        if let NodeRequest::DeprecatedGetAttr { responder } = self {
14840            Some((responder))
14841        } else {
14842            None
14843        }
14844    }
14845
14846    #[allow(irrefutable_let_patterns)]
14847    pub fn into_deprecated_set_attr(
14848        self,
14849    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14850        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14851            Some((flags, attributes, responder))
14852        } else {
14853            None
14854        }
14855    }
14856
14857    #[allow(irrefutable_let_patterns)]
14858    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14859        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14860            Some((responder))
14861        } else {
14862            None
14863        }
14864    }
14865
14866    #[allow(irrefutable_let_patterns)]
14867    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14868        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14869            Some((flags, responder))
14870        } else {
14871            None
14872        }
14873    }
14874
14875    #[allow(irrefutable_let_patterns)]
14876    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14877        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
14878    }
14879
14880    #[allow(irrefutable_let_patterns)]
14881    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14882        if let NodeRequest::SetFlags { flags, responder } = self {
14883            Some((flags, responder))
14884        } else {
14885            None
14886        }
14887    }
14888
14889    #[allow(irrefutable_let_patterns)]
14890    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14891        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
14892    }
14893
14894    #[allow(irrefutable_let_patterns)]
14895    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14896        if let NodeRequest::GetAttributes { query, responder } = self {
14897            Some((query, responder))
14898        } else {
14899            None
14900        }
14901    }
14902
14903    #[allow(irrefutable_let_patterns)]
14904    pub fn into_update_attributes(
14905        self,
14906    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14907        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14908            Some((payload, responder))
14909        } else {
14910            None
14911        }
14912    }
14913
14914    #[allow(irrefutable_let_patterns)]
14915    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14916        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
14917    }
14918
14919    #[allow(irrefutable_let_patterns)]
14920    pub fn into_list_extended_attributes(
14921        self,
14922    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14923    {
14924        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14925            Some((iterator, control_handle))
14926        } else {
14927            None
14928        }
14929    }
14930
14931    #[allow(irrefutable_let_patterns)]
14932    pub fn into_get_extended_attribute(
14933        self,
14934    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14935        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14936            Some((name, responder))
14937        } else {
14938            None
14939        }
14940    }
14941
14942    #[allow(irrefutable_let_patterns)]
14943    pub fn into_set_extended_attribute(
14944        self,
14945    ) -> Option<(
14946        Vec<u8>,
14947        ExtendedAttributeValue,
14948        SetExtendedAttributeMode,
14949        NodeSetExtendedAttributeResponder,
14950    )> {
14951        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14952            Some((name, value, mode, responder))
14953        } else {
14954            None
14955        }
14956    }
14957
14958    #[allow(irrefutable_let_patterns)]
14959    pub fn into_remove_extended_attribute(
14960        self,
14961    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14962        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14963            Some((name, responder))
14964        } else {
14965            None
14966        }
14967    }
14968
14969    /// Name of the method defined in FIDL
14970    pub fn method_name(&self) -> &'static str {
14971        match *self {
14972            NodeRequest::Clone { .. } => "clone",
14973            NodeRequest::Close { .. } => "close",
14974            NodeRequest::Query { .. } => "query",
14975            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14976            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
14977            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14978            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14979            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14980            NodeRequest::GetFlags { .. } => "get_flags",
14981            NodeRequest::SetFlags { .. } => "set_flags",
14982            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14983            NodeRequest::GetAttributes { .. } => "get_attributes",
14984            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14985            NodeRequest::Sync { .. } => "sync",
14986            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14987            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14988            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14989            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14990            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14991                "unknown one-way method"
14992            }
14993            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14994                "unknown two-way method"
14995            }
14996        }
14997    }
14998}
14999
15000#[derive(Debug, Clone)]
15001pub struct NodeControlHandle {
15002    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
15003}
15004
15005impl NodeControlHandle {
15006    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
15007        self.inner.shutdown_with_epitaph(status.into())
15008    }
15009}
15010
15011impl fidl::endpoints::ControlHandle for NodeControlHandle {
15012    fn shutdown(&self) {
15013        self.inner.shutdown()
15014    }
15015
15016    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
15017        self.inner.shutdown_with_epitaph(status)
15018    }
15019
15020    fn is_closed(&self) -> bool {
15021        self.inner.channel().is_closed()
15022    }
15023    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
15024        self.inner.channel().on_closed()
15025    }
15026
15027    #[cfg(target_os = "fuchsia")]
15028    fn signal_peer(
15029        &self,
15030        clear_mask: zx::Signals,
15031        set_mask: zx::Signals,
15032    ) -> Result<(), zx_status::Status> {
15033        use fidl::Peered;
15034        self.inner.channel().signal_peer(clear_mask, set_mask)
15035    }
15036}
15037
15038impl NodeControlHandle {
15039    pub fn send_on_open_(
15040        &self,
15041        mut s: i32,
15042        mut info: Option<NodeInfoDeprecated>,
15043    ) -> Result<(), fidl::Error> {
15044        self.inner.send::<NodeOnOpenRequest>(
15045            (s, info.as_mut()),
15046            0,
15047            0x7fc7bbb1dbfd1972,
15048            fidl::encoding::DynamicFlags::FLEXIBLE,
15049        )
15050    }
15051
15052    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
15053        self.inner.send::<Representation>(
15054            &mut payload,
15055            0,
15056            0x5cb40567d80a510c,
15057            fidl::encoding::DynamicFlags::empty(),
15058        )
15059    }
15060}
15061
15062#[must_use = "FIDL methods require a response to be sent"]
15063#[derive(Debug)]
15064pub struct NodeCloseResponder {
15065    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15066    tx_id: u32,
15067}
15068
15069/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15070/// if the responder is dropped without sending a response, so that the client
15071/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15072impl std::ops::Drop for NodeCloseResponder {
15073    fn drop(&mut self) {
15074        self.control_handle.shutdown();
15075        // Safety: drops once, never accessed again
15076        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15077    }
15078}
15079
15080impl fidl::endpoints::Responder for NodeCloseResponder {
15081    type ControlHandle = NodeControlHandle;
15082
15083    fn control_handle(&self) -> &NodeControlHandle {
15084        &self.control_handle
15085    }
15086
15087    fn drop_without_shutdown(mut self) {
15088        // Safety: drops once, never accessed again due to mem::forget
15089        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15090        // Prevent Drop from running (which would shut down the channel)
15091        std::mem::forget(self);
15092    }
15093}
15094
15095impl NodeCloseResponder {
15096    /// Sends a response to the FIDL transaction.
15097    ///
15098    /// Sets the channel to shutdown if an error occurs.
15099    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15100        let _result = self.send_raw(result);
15101        if _result.is_err() {
15102            self.control_handle.shutdown();
15103        }
15104        self.drop_without_shutdown();
15105        _result
15106    }
15107
15108    /// Similar to "send" but does not shutdown the channel if an error occurs.
15109    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15110        let _result = self.send_raw(result);
15111        self.drop_without_shutdown();
15112        _result
15113    }
15114
15115    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15116        self.control_handle
15117            .inner
15118            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15119                result,
15120                self.tx_id,
15121                0x5ac5d459ad7f657e,
15122                fidl::encoding::DynamicFlags::empty(),
15123            )
15124    }
15125}
15126
15127#[must_use = "FIDL methods require a response to be sent"]
15128#[derive(Debug)]
15129pub struct NodeQueryResponder {
15130    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15131    tx_id: u32,
15132}
15133
15134/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15135/// if the responder is dropped without sending a response, so that the client
15136/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15137impl std::ops::Drop for NodeQueryResponder {
15138    fn drop(&mut self) {
15139        self.control_handle.shutdown();
15140        // Safety: drops once, never accessed again
15141        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15142    }
15143}
15144
15145impl fidl::endpoints::Responder for NodeQueryResponder {
15146    type ControlHandle = NodeControlHandle;
15147
15148    fn control_handle(&self) -> &NodeControlHandle {
15149        &self.control_handle
15150    }
15151
15152    fn drop_without_shutdown(mut self) {
15153        // Safety: drops once, never accessed again due to mem::forget
15154        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15155        // Prevent Drop from running (which would shut down the channel)
15156        std::mem::forget(self);
15157    }
15158}
15159
15160impl NodeQueryResponder {
15161    /// Sends a response to the FIDL transaction.
15162    ///
15163    /// Sets the channel to shutdown if an error occurs.
15164    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15165        let _result = self.send_raw(protocol);
15166        if _result.is_err() {
15167            self.control_handle.shutdown();
15168        }
15169        self.drop_without_shutdown();
15170        _result
15171    }
15172
15173    /// Similar to "send" but does not shutdown the channel if an error occurs.
15174    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15175        let _result = self.send_raw(protocol);
15176        self.drop_without_shutdown();
15177        _result
15178    }
15179
15180    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15181        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15182            (protocol,),
15183            self.tx_id,
15184            0x2658edee9decfc06,
15185            fidl::encoding::DynamicFlags::empty(),
15186        )
15187    }
15188}
15189
15190#[must_use = "FIDL methods require a response to be sent"]
15191#[derive(Debug)]
15192pub struct NodeDeprecatedGetAttrResponder {
15193    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15194    tx_id: u32,
15195}
15196
15197/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15198/// if the responder is dropped without sending a response, so that the client
15199/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15200impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15201    fn drop(&mut self) {
15202        self.control_handle.shutdown();
15203        // Safety: drops once, never accessed again
15204        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15205    }
15206}
15207
15208impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15209    type ControlHandle = NodeControlHandle;
15210
15211    fn control_handle(&self) -> &NodeControlHandle {
15212        &self.control_handle
15213    }
15214
15215    fn drop_without_shutdown(mut self) {
15216        // Safety: drops once, never accessed again due to mem::forget
15217        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15218        // Prevent Drop from running (which would shut down the channel)
15219        std::mem::forget(self);
15220    }
15221}
15222
15223impl NodeDeprecatedGetAttrResponder {
15224    /// Sends a response to the FIDL transaction.
15225    ///
15226    /// Sets the channel to shutdown if an error occurs.
15227    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15228        let _result = self.send_raw(s, attributes);
15229        if _result.is_err() {
15230            self.control_handle.shutdown();
15231        }
15232        self.drop_without_shutdown();
15233        _result
15234    }
15235
15236    /// Similar to "send" but does not shutdown the channel if an error occurs.
15237    pub fn send_no_shutdown_on_err(
15238        self,
15239        mut s: i32,
15240        mut attributes: &NodeAttributes,
15241    ) -> Result<(), fidl::Error> {
15242        let _result = self.send_raw(s, attributes);
15243        self.drop_without_shutdown();
15244        _result
15245    }
15246
15247    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15248        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15249            (s, attributes),
15250            self.tx_id,
15251            0x78985e216314dafd,
15252            fidl::encoding::DynamicFlags::empty(),
15253        )
15254    }
15255}
15256
15257#[must_use = "FIDL methods require a response to be sent"]
15258#[derive(Debug)]
15259pub struct NodeDeprecatedSetAttrResponder {
15260    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15261    tx_id: u32,
15262}
15263
15264/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15265/// if the responder is dropped without sending a response, so that the client
15266/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15267impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15268    fn drop(&mut self) {
15269        self.control_handle.shutdown();
15270        // Safety: drops once, never accessed again
15271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15272    }
15273}
15274
15275impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15276    type ControlHandle = NodeControlHandle;
15277
15278    fn control_handle(&self) -> &NodeControlHandle {
15279        &self.control_handle
15280    }
15281
15282    fn drop_without_shutdown(mut self) {
15283        // Safety: drops once, never accessed again due to mem::forget
15284        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15285        // Prevent Drop from running (which would shut down the channel)
15286        std::mem::forget(self);
15287    }
15288}
15289
15290impl NodeDeprecatedSetAttrResponder {
15291    /// Sends a response to the FIDL transaction.
15292    ///
15293    /// Sets the channel to shutdown if an error occurs.
15294    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15295        let _result = self.send_raw(s);
15296        if _result.is_err() {
15297            self.control_handle.shutdown();
15298        }
15299        self.drop_without_shutdown();
15300        _result
15301    }
15302
15303    /// Similar to "send" but does not shutdown the channel if an error occurs.
15304    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15305        let _result = self.send_raw(s);
15306        self.drop_without_shutdown();
15307        _result
15308    }
15309
15310    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15311        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15312            (s,),
15313            self.tx_id,
15314            0x4186c0f40d938f46,
15315            fidl::encoding::DynamicFlags::empty(),
15316        )
15317    }
15318}
15319
15320#[must_use = "FIDL methods require a response to be sent"]
15321#[derive(Debug)]
15322pub struct NodeDeprecatedGetFlagsResponder {
15323    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15324    tx_id: u32,
15325}
15326
15327/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15328/// if the responder is dropped without sending a response, so that the client
15329/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15330impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15331    fn drop(&mut self) {
15332        self.control_handle.shutdown();
15333        // Safety: drops once, never accessed again
15334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15335    }
15336}
15337
15338impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15339    type ControlHandle = NodeControlHandle;
15340
15341    fn control_handle(&self) -> &NodeControlHandle {
15342        &self.control_handle
15343    }
15344
15345    fn drop_without_shutdown(mut self) {
15346        // Safety: drops once, never accessed again due to mem::forget
15347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15348        // Prevent Drop from running (which would shut down the channel)
15349        std::mem::forget(self);
15350    }
15351}
15352
15353impl NodeDeprecatedGetFlagsResponder {
15354    /// Sends a response to the FIDL transaction.
15355    ///
15356    /// Sets the channel to shutdown if an error occurs.
15357    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15358        let _result = self.send_raw(s, flags);
15359        if _result.is_err() {
15360            self.control_handle.shutdown();
15361        }
15362        self.drop_without_shutdown();
15363        _result
15364    }
15365
15366    /// Similar to "send" but does not shutdown the channel if an error occurs.
15367    pub fn send_no_shutdown_on_err(
15368        self,
15369        mut s: i32,
15370        mut flags: OpenFlags,
15371    ) -> Result<(), fidl::Error> {
15372        let _result = self.send_raw(s, flags);
15373        self.drop_without_shutdown();
15374        _result
15375    }
15376
15377    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15378        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15379            (s, flags),
15380            self.tx_id,
15381            0x5b88fffb8eda3aa1,
15382            fidl::encoding::DynamicFlags::empty(),
15383        )
15384    }
15385}
15386
15387#[must_use = "FIDL methods require a response to be sent"]
15388#[derive(Debug)]
15389pub struct NodeDeprecatedSetFlagsResponder {
15390    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15391    tx_id: u32,
15392}
15393
15394/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15395/// if the responder is dropped without sending a response, so that the client
15396/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15397impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15398    fn drop(&mut self) {
15399        self.control_handle.shutdown();
15400        // Safety: drops once, never accessed again
15401        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15402    }
15403}
15404
15405impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15406    type ControlHandle = NodeControlHandle;
15407
15408    fn control_handle(&self) -> &NodeControlHandle {
15409        &self.control_handle
15410    }
15411
15412    fn drop_without_shutdown(mut self) {
15413        // Safety: drops once, never accessed again due to mem::forget
15414        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15415        // Prevent Drop from running (which would shut down the channel)
15416        std::mem::forget(self);
15417    }
15418}
15419
15420impl NodeDeprecatedSetFlagsResponder {
15421    /// Sends a response to the FIDL transaction.
15422    ///
15423    /// Sets the channel to shutdown if an error occurs.
15424    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15425        let _result = self.send_raw(s);
15426        if _result.is_err() {
15427            self.control_handle.shutdown();
15428        }
15429        self.drop_without_shutdown();
15430        _result
15431    }
15432
15433    /// Similar to "send" but does not shutdown the channel if an error occurs.
15434    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15435        let _result = self.send_raw(s);
15436        self.drop_without_shutdown();
15437        _result
15438    }
15439
15440    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15441        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15442            (s,),
15443            self.tx_id,
15444            0x5295b76c71fde733,
15445            fidl::encoding::DynamicFlags::empty(),
15446        )
15447    }
15448}
15449
15450#[must_use = "FIDL methods require a response to be sent"]
15451#[derive(Debug)]
15452pub struct NodeGetFlagsResponder {
15453    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15454    tx_id: u32,
15455}
15456
15457/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15458/// if the responder is dropped without sending a response, so that the client
15459/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15460impl std::ops::Drop for NodeGetFlagsResponder {
15461    fn drop(&mut self) {
15462        self.control_handle.shutdown();
15463        // Safety: drops once, never accessed again
15464        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15465    }
15466}
15467
15468impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15469    type ControlHandle = NodeControlHandle;
15470
15471    fn control_handle(&self) -> &NodeControlHandle {
15472        &self.control_handle
15473    }
15474
15475    fn drop_without_shutdown(mut self) {
15476        // Safety: drops once, never accessed again due to mem::forget
15477        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15478        // Prevent Drop from running (which would shut down the channel)
15479        std::mem::forget(self);
15480    }
15481}
15482
15483impl NodeGetFlagsResponder {
15484    /// Sends a response to the FIDL transaction.
15485    ///
15486    /// Sets the channel to shutdown if an error occurs.
15487    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15488        let _result = self.send_raw(result);
15489        if _result.is_err() {
15490            self.control_handle.shutdown();
15491        }
15492        self.drop_without_shutdown();
15493        _result
15494    }
15495
15496    /// Similar to "send" but does not shutdown the channel if an error occurs.
15497    pub fn send_no_shutdown_on_err(
15498        self,
15499        mut result: Result<Flags, i32>,
15500    ) -> Result<(), fidl::Error> {
15501        let _result = self.send_raw(result);
15502        self.drop_without_shutdown();
15503        _result
15504    }
15505
15506    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15507        self.control_handle
15508            .inner
15509            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15510                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15511                self.tx_id,
15512                0x176eb318f64ec23,
15513                fidl::encoding::DynamicFlags::FLEXIBLE,
15514            )
15515    }
15516}
15517
15518#[must_use = "FIDL methods require a response to be sent"]
15519#[derive(Debug)]
15520pub struct NodeSetFlagsResponder {
15521    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15522    tx_id: u32,
15523}
15524
15525/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15526/// if the responder is dropped without sending a response, so that the client
15527/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15528impl std::ops::Drop for NodeSetFlagsResponder {
15529    fn drop(&mut self) {
15530        self.control_handle.shutdown();
15531        // Safety: drops once, never accessed again
15532        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15533    }
15534}
15535
15536impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15537    type ControlHandle = NodeControlHandle;
15538
15539    fn control_handle(&self) -> &NodeControlHandle {
15540        &self.control_handle
15541    }
15542
15543    fn drop_without_shutdown(mut self) {
15544        // Safety: drops once, never accessed again due to mem::forget
15545        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15546        // Prevent Drop from running (which would shut down the channel)
15547        std::mem::forget(self);
15548    }
15549}
15550
15551impl NodeSetFlagsResponder {
15552    /// Sends a response to the FIDL transaction.
15553    ///
15554    /// Sets the channel to shutdown if an error occurs.
15555    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15556        let _result = self.send_raw(result);
15557        if _result.is_err() {
15558            self.control_handle.shutdown();
15559        }
15560        self.drop_without_shutdown();
15561        _result
15562    }
15563
15564    /// Similar to "send" but does not shutdown the channel if an error occurs.
15565    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15566        let _result = self.send_raw(result);
15567        self.drop_without_shutdown();
15568        _result
15569    }
15570
15571    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15572        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15573            fidl::encoding::EmptyStruct,
15574            i32,
15575        >>(
15576            fidl::encoding::FlexibleResult::new(result),
15577            self.tx_id,
15578            0x55a8028685791ea8,
15579            fidl::encoding::DynamicFlags::FLEXIBLE,
15580        )
15581    }
15582}
15583
15584#[must_use = "FIDL methods require a response to be sent"]
15585#[derive(Debug)]
15586pub struct NodeQueryFilesystemResponder {
15587    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15588    tx_id: u32,
15589}
15590
15591/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15592/// if the responder is dropped without sending a response, so that the client
15593/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15594impl std::ops::Drop for NodeQueryFilesystemResponder {
15595    fn drop(&mut self) {
15596        self.control_handle.shutdown();
15597        // Safety: drops once, never accessed again
15598        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15599    }
15600}
15601
15602impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15603    type ControlHandle = NodeControlHandle;
15604
15605    fn control_handle(&self) -> &NodeControlHandle {
15606        &self.control_handle
15607    }
15608
15609    fn drop_without_shutdown(mut self) {
15610        // Safety: drops once, never accessed again due to mem::forget
15611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15612        // Prevent Drop from running (which would shut down the channel)
15613        std::mem::forget(self);
15614    }
15615}
15616
15617impl NodeQueryFilesystemResponder {
15618    /// Sends a response to the FIDL transaction.
15619    ///
15620    /// Sets the channel to shutdown if an error occurs.
15621    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15622        let _result = self.send_raw(s, info);
15623        if _result.is_err() {
15624            self.control_handle.shutdown();
15625        }
15626        self.drop_without_shutdown();
15627        _result
15628    }
15629
15630    /// Similar to "send" but does not shutdown the channel if an error occurs.
15631    pub fn send_no_shutdown_on_err(
15632        self,
15633        mut s: i32,
15634        mut info: Option<&FilesystemInfo>,
15635    ) -> Result<(), fidl::Error> {
15636        let _result = self.send_raw(s, info);
15637        self.drop_without_shutdown();
15638        _result
15639    }
15640
15641    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15642        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15643            (s, info),
15644            self.tx_id,
15645            0x6f344a1c6b0a0610,
15646            fidl::encoding::DynamicFlags::empty(),
15647        )
15648    }
15649}
15650
15651#[must_use = "FIDL methods require a response to be sent"]
15652#[derive(Debug)]
15653pub struct NodeGetAttributesResponder {
15654    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15655    tx_id: u32,
15656}
15657
15658/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15659/// if the responder is dropped without sending a response, so that the client
15660/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15661impl std::ops::Drop for NodeGetAttributesResponder {
15662    fn drop(&mut self) {
15663        self.control_handle.shutdown();
15664        // Safety: drops once, never accessed again
15665        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15666    }
15667}
15668
15669impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15670    type ControlHandle = NodeControlHandle;
15671
15672    fn control_handle(&self) -> &NodeControlHandle {
15673        &self.control_handle
15674    }
15675
15676    fn drop_without_shutdown(mut self) {
15677        // Safety: drops once, never accessed again due to mem::forget
15678        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15679        // Prevent Drop from running (which would shut down the channel)
15680        std::mem::forget(self);
15681    }
15682}
15683
15684impl NodeGetAttributesResponder {
15685    /// Sends a response to the FIDL transaction.
15686    ///
15687    /// Sets the channel to shutdown if an error occurs.
15688    pub fn send(
15689        self,
15690        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15691    ) -> Result<(), fidl::Error> {
15692        let _result = self.send_raw(result);
15693        if _result.is_err() {
15694            self.control_handle.shutdown();
15695        }
15696        self.drop_without_shutdown();
15697        _result
15698    }
15699
15700    /// Similar to "send" but does not shutdown the channel if an error occurs.
15701    pub fn send_no_shutdown_on_err(
15702        self,
15703        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15704    ) -> Result<(), fidl::Error> {
15705        let _result = self.send_raw(result);
15706        self.drop_without_shutdown();
15707        _result
15708    }
15709
15710    fn send_raw(
15711        &self,
15712        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15713    ) -> Result<(), fidl::Error> {
15714        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15715            result,
15716            self.tx_id,
15717            0x3d4396a638ea053b,
15718            fidl::encoding::DynamicFlags::empty(),
15719        )
15720    }
15721}
15722
15723#[must_use = "FIDL methods require a response to be sent"]
15724#[derive(Debug)]
15725pub struct NodeUpdateAttributesResponder {
15726    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15727    tx_id: u32,
15728}
15729
15730/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15731/// if the responder is dropped without sending a response, so that the client
15732/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15733impl std::ops::Drop for NodeUpdateAttributesResponder {
15734    fn drop(&mut self) {
15735        self.control_handle.shutdown();
15736        // Safety: drops once, never accessed again
15737        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15738    }
15739}
15740
15741impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15742    type ControlHandle = NodeControlHandle;
15743
15744    fn control_handle(&self) -> &NodeControlHandle {
15745        &self.control_handle
15746    }
15747
15748    fn drop_without_shutdown(mut self) {
15749        // Safety: drops once, never accessed again due to mem::forget
15750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15751        // Prevent Drop from running (which would shut down the channel)
15752        std::mem::forget(self);
15753    }
15754}
15755
15756impl NodeUpdateAttributesResponder {
15757    /// Sends a response to the FIDL transaction.
15758    ///
15759    /// Sets the channel to shutdown if an error occurs.
15760    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15761        let _result = self.send_raw(result);
15762        if _result.is_err() {
15763            self.control_handle.shutdown();
15764        }
15765        self.drop_without_shutdown();
15766        _result
15767    }
15768
15769    /// Similar to "send" but does not shutdown the channel if an error occurs.
15770    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15771        let _result = self.send_raw(result);
15772        self.drop_without_shutdown();
15773        _result
15774    }
15775
15776    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15777        self.control_handle
15778            .inner
15779            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15780                result,
15781                self.tx_id,
15782                0x3308c1da5a89bf08,
15783                fidl::encoding::DynamicFlags::empty(),
15784            )
15785    }
15786}
15787
15788#[must_use = "FIDL methods require a response to be sent"]
15789#[derive(Debug)]
15790pub struct NodeSyncResponder {
15791    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15792    tx_id: u32,
15793}
15794
15795/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15796/// if the responder is dropped without sending a response, so that the client
15797/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15798impl std::ops::Drop for NodeSyncResponder {
15799    fn drop(&mut self) {
15800        self.control_handle.shutdown();
15801        // Safety: drops once, never accessed again
15802        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15803    }
15804}
15805
15806impl fidl::endpoints::Responder for NodeSyncResponder {
15807    type ControlHandle = NodeControlHandle;
15808
15809    fn control_handle(&self) -> &NodeControlHandle {
15810        &self.control_handle
15811    }
15812
15813    fn drop_without_shutdown(mut self) {
15814        // Safety: drops once, never accessed again due to mem::forget
15815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15816        // Prevent Drop from running (which would shut down the channel)
15817        std::mem::forget(self);
15818    }
15819}
15820
15821impl NodeSyncResponder {
15822    /// Sends a response to the FIDL transaction.
15823    ///
15824    /// Sets the channel to shutdown if an error occurs.
15825    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15826        let _result = self.send_raw(result);
15827        if _result.is_err() {
15828            self.control_handle.shutdown();
15829        }
15830        self.drop_without_shutdown();
15831        _result
15832    }
15833
15834    /// Similar to "send" but does not shutdown the channel if an error occurs.
15835    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15836        let _result = self.send_raw(result);
15837        self.drop_without_shutdown();
15838        _result
15839    }
15840
15841    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15842        self.control_handle
15843            .inner
15844            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15845                result,
15846                self.tx_id,
15847                0x2c5c27ca0ab5dc49,
15848                fidl::encoding::DynamicFlags::empty(),
15849            )
15850    }
15851}
15852
15853#[must_use = "FIDL methods require a response to be sent"]
15854#[derive(Debug)]
15855pub struct NodeGetExtendedAttributeResponder {
15856    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15857    tx_id: u32,
15858}
15859
15860/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15861/// if the responder is dropped without sending a response, so that the client
15862/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15863impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15864    fn drop(&mut self) {
15865        self.control_handle.shutdown();
15866        // Safety: drops once, never accessed again
15867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15868    }
15869}
15870
15871impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15872    type ControlHandle = NodeControlHandle;
15873
15874    fn control_handle(&self) -> &NodeControlHandle {
15875        &self.control_handle
15876    }
15877
15878    fn drop_without_shutdown(mut self) {
15879        // Safety: drops once, never accessed again due to mem::forget
15880        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15881        // Prevent Drop from running (which would shut down the channel)
15882        std::mem::forget(self);
15883    }
15884}
15885
15886impl NodeGetExtendedAttributeResponder {
15887    /// Sends a response to the FIDL transaction.
15888    ///
15889    /// Sets the channel to shutdown if an error occurs.
15890    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15891        let _result = self.send_raw(result);
15892        if _result.is_err() {
15893            self.control_handle.shutdown();
15894        }
15895        self.drop_without_shutdown();
15896        _result
15897    }
15898
15899    /// Similar to "send" but does not shutdown the channel if an error occurs.
15900    pub fn send_no_shutdown_on_err(
15901        self,
15902        mut result: Result<ExtendedAttributeValue, i32>,
15903    ) -> Result<(), fidl::Error> {
15904        let _result = self.send_raw(result);
15905        self.drop_without_shutdown();
15906        _result
15907    }
15908
15909    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15910        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15911            result.as_mut().map_err(|e| *e),
15912            self.tx_id,
15913            0x45ffa3ccfdeb76db,
15914            fidl::encoding::DynamicFlags::empty(),
15915        )
15916    }
15917}
15918
15919#[must_use = "FIDL methods require a response to be sent"]
15920#[derive(Debug)]
15921pub struct NodeSetExtendedAttributeResponder {
15922    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15923    tx_id: u32,
15924}
15925
15926/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15927/// if the responder is dropped without sending a response, so that the client
15928/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15929impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15930    fn drop(&mut self) {
15931        self.control_handle.shutdown();
15932        // Safety: drops once, never accessed again
15933        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15934    }
15935}
15936
15937impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15938    type ControlHandle = NodeControlHandle;
15939
15940    fn control_handle(&self) -> &NodeControlHandle {
15941        &self.control_handle
15942    }
15943
15944    fn drop_without_shutdown(mut self) {
15945        // Safety: drops once, never accessed again due to mem::forget
15946        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15947        // Prevent Drop from running (which would shut down the channel)
15948        std::mem::forget(self);
15949    }
15950}
15951
15952impl NodeSetExtendedAttributeResponder {
15953    /// Sends a response to the FIDL transaction.
15954    ///
15955    /// Sets the channel to shutdown if an error occurs.
15956    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15957        let _result = self.send_raw(result);
15958        if _result.is_err() {
15959            self.control_handle.shutdown();
15960        }
15961        self.drop_without_shutdown();
15962        _result
15963    }
15964
15965    /// Similar to "send" but does not shutdown the channel if an error occurs.
15966    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15967        let _result = self.send_raw(result);
15968        self.drop_without_shutdown();
15969        _result
15970    }
15971
15972    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15973        self.control_handle
15974            .inner
15975            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15976                result,
15977                self.tx_id,
15978                0x4a951362f681f23c,
15979                fidl::encoding::DynamicFlags::empty(),
15980            )
15981    }
15982}
15983
15984#[must_use = "FIDL methods require a response to be sent"]
15985#[derive(Debug)]
15986pub struct NodeRemoveExtendedAttributeResponder {
15987    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15988    tx_id: u32,
15989}
15990
15991/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15992/// if the responder is dropped without sending a response, so that the client
15993/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15994impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15995    fn drop(&mut self) {
15996        self.control_handle.shutdown();
15997        // Safety: drops once, never accessed again
15998        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15999    }
16000}
16001
16002impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
16003    type ControlHandle = NodeControlHandle;
16004
16005    fn control_handle(&self) -> &NodeControlHandle {
16006        &self.control_handle
16007    }
16008
16009    fn drop_without_shutdown(mut self) {
16010        // Safety: drops once, never accessed again due to mem::forget
16011        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16012        // Prevent Drop from running (which would shut down the channel)
16013        std::mem::forget(self);
16014    }
16015}
16016
16017impl NodeRemoveExtendedAttributeResponder {
16018    /// Sends a response to the FIDL transaction.
16019    ///
16020    /// Sets the channel to shutdown if an error occurs.
16021    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16022        let _result = self.send_raw(result);
16023        if _result.is_err() {
16024            self.control_handle.shutdown();
16025        }
16026        self.drop_without_shutdown();
16027        _result
16028    }
16029
16030    /// Similar to "send" but does not shutdown the channel if an error occurs.
16031    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16032        let _result = self.send_raw(result);
16033        self.drop_without_shutdown();
16034        _result
16035    }
16036
16037    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16038        self.control_handle
16039            .inner
16040            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16041                result,
16042                self.tx_id,
16043                0x7a0b9f3a9bf9032d,
16044                fidl::encoding::DynamicFlags::empty(),
16045            )
16046    }
16047}
16048
16049#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16050pub struct OpenableMarker;
16051
16052impl fidl::endpoints::ProtocolMarker for OpenableMarker {
16053    type Proxy = OpenableProxy;
16054    type RequestStream = OpenableRequestStream;
16055    #[cfg(target_os = "fuchsia")]
16056    type SynchronousProxy = OpenableSynchronousProxy;
16057
16058    const DEBUG_NAME: &'static str = "(anonymous) Openable";
16059}
16060
16061pub trait OpenableProxyInterface: Send + Sync {
16062    fn r#open(
16063        &self,
16064        path: &str,
16065        flags: Flags,
16066        options: &Options,
16067        object: fidl::Channel,
16068    ) -> Result<(), fidl::Error>;
16069}
16070#[derive(Debug)]
16071#[cfg(target_os = "fuchsia")]
16072pub struct OpenableSynchronousProxy {
16073    client: fidl::client::sync::Client,
16074}
16075
16076#[cfg(target_os = "fuchsia")]
16077impl fidl::endpoints::SynchronousProxy for OpenableSynchronousProxy {
16078    type Proxy = OpenableProxy;
16079    type Protocol = OpenableMarker;
16080
16081    fn from_channel(inner: fidl::Channel) -> Self {
16082        Self::new(inner)
16083    }
16084
16085    fn into_channel(self) -> fidl::Channel {
16086        self.client.into_channel()
16087    }
16088
16089    fn as_channel(&self) -> &fidl::Channel {
16090        self.client.as_channel()
16091    }
16092}
16093
16094#[cfg(target_os = "fuchsia")]
16095impl OpenableSynchronousProxy {
16096    pub fn new(channel: fidl::Channel) -> Self {
16097        Self { client: fidl::client::sync::Client::new(channel) }
16098    }
16099
16100    pub fn into_channel(self) -> fidl::Channel {
16101        self.client.into_channel()
16102    }
16103
16104    /// Waits until an event arrives and returns it. It is safe for other
16105    /// threads to make concurrent requests while waiting for an event.
16106    pub fn wait_for_event(
16107        &self,
16108        deadline: zx::MonotonicInstant,
16109    ) -> Result<OpenableEvent, fidl::Error> {
16110        OpenableEvent::decode(self.client.wait_for_event::<OpenableMarker>(deadline)?)
16111    }
16112
16113    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16114    /// epitaph sent on the `object` channel.
16115    ///
16116    /// Errors:
16117    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16118    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16119    pub fn r#open(
16120        &self,
16121        mut path: &str,
16122        mut flags: Flags,
16123        mut options: &Options,
16124        mut object: fidl::Channel,
16125    ) -> Result<(), fidl::Error> {
16126        self.client.send::<OpenableOpenRequest>(
16127            (path, flags, options, object),
16128            0x568ddcb9a9cbb6d9,
16129            fidl::encoding::DynamicFlags::FLEXIBLE,
16130        )
16131    }
16132}
16133
16134#[cfg(target_os = "fuchsia")]
16135impl From<OpenableSynchronousProxy> for zx::NullableHandle {
16136    fn from(value: OpenableSynchronousProxy) -> Self {
16137        value.into_channel().into()
16138    }
16139}
16140
16141#[cfg(target_os = "fuchsia")]
16142impl From<fidl::Channel> for OpenableSynchronousProxy {
16143    fn from(value: fidl::Channel) -> Self {
16144        Self::new(value)
16145    }
16146}
16147
16148#[cfg(target_os = "fuchsia")]
16149impl fidl::endpoints::FromClient for OpenableSynchronousProxy {
16150    type Protocol = OpenableMarker;
16151
16152    fn from_client(value: fidl::endpoints::ClientEnd<OpenableMarker>) -> Self {
16153        Self::new(value.into_channel())
16154    }
16155}
16156
16157#[derive(Debug, Clone)]
16158pub struct OpenableProxy {
16159    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16160}
16161
16162impl fidl::endpoints::Proxy for OpenableProxy {
16163    type Protocol = OpenableMarker;
16164
16165    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16166        Self::new(inner)
16167    }
16168
16169    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16170        self.client.into_channel().map_err(|client| Self { client })
16171    }
16172
16173    fn as_channel(&self) -> &::fidl::AsyncChannel {
16174        self.client.as_channel()
16175    }
16176}
16177
16178impl OpenableProxy {
16179    /// Create a new Proxy for fuchsia.io/Openable.
16180    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16181        let protocol_name = <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16182        Self { client: fidl::client::Client::new(channel, protocol_name) }
16183    }
16184
16185    /// Get a Stream of events from the remote end of the protocol.
16186    ///
16187    /// # Panics
16188    ///
16189    /// Panics if the event stream was already taken.
16190    pub fn take_event_stream(&self) -> OpenableEventStream {
16191        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
16192    }
16193
16194    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16195    /// epitaph sent on the `object` channel.
16196    ///
16197    /// Errors:
16198    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16199    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16200    pub fn r#open(
16201        &self,
16202        mut path: &str,
16203        mut flags: Flags,
16204        mut options: &Options,
16205        mut object: fidl::Channel,
16206    ) -> Result<(), fidl::Error> {
16207        OpenableProxyInterface::r#open(self, path, flags, options, object)
16208    }
16209}
16210
16211impl OpenableProxyInterface for OpenableProxy {
16212    fn r#open(
16213        &self,
16214        mut path: &str,
16215        mut flags: Flags,
16216        mut options: &Options,
16217        mut object: fidl::Channel,
16218    ) -> Result<(), fidl::Error> {
16219        self.client.send::<OpenableOpenRequest>(
16220            (path, flags, options, object),
16221            0x568ddcb9a9cbb6d9,
16222            fidl::encoding::DynamicFlags::FLEXIBLE,
16223        )
16224    }
16225}
16226
16227pub struct OpenableEventStream {
16228    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16229}
16230
16231impl std::marker::Unpin for OpenableEventStream {}
16232
16233impl futures::stream::FusedStream for OpenableEventStream {
16234    fn is_terminated(&self) -> bool {
16235        self.event_receiver.is_terminated()
16236    }
16237}
16238
16239impl futures::Stream for OpenableEventStream {
16240    type Item = Result<OpenableEvent, fidl::Error>;
16241
16242    fn poll_next(
16243        mut self: std::pin::Pin<&mut Self>,
16244        cx: &mut std::task::Context<'_>,
16245    ) -> std::task::Poll<Option<Self::Item>> {
16246        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16247            &mut self.event_receiver,
16248            cx
16249        )?) {
16250            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
16251            None => std::task::Poll::Ready(None),
16252        }
16253    }
16254}
16255
16256#[derive(Debug)]
16257pub enum OpenableEvent {
16258    #[non_exhaustive]
16259    _UnknownEvent {
16260        /// Ordinal of the event that was sent.
16261        ordinal: u64,
16262    },
16263}
16264
16265impl OpenableEvent {
16266    /// Decodes a message buffer as a [`OpenableEvent`].
16267    fn decode(
16268        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16269    ) -> Result<OpenableEvent, fidl::Error> {
16270        let (bytes, _handles) = buf.split_mut();
16271        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16272        debug_assert_eq!(tx_header.tx_id, 0);
16273        match tx_header.ordinal {
16274            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
16275                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
16276            }
16277            _ => Err(fidl::Error::UnknownOrdinal {
16278                ordinal: tx_header.ordinal,
16279                protocol_name: <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16280            }),
16281        }
16282    }
16283}
16284
16285/// A Stream of incoming requests for fuchsia.io/Openable.
16286pub struct OpenableRequestStream {
16287    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16288    is_terminated: bool,
16289}
16290
16291impl std::marker::Unpin for OpenableRequestStream {}
16292
16293impl futures::stream::FusedStream for OpenableRequestStream {
16294    fn is_terminated(&self) -> bool {
16295        self.is_terminated
16296    }
16297}
16298
16299impl fidl::endpoints::RequestStream for OpenableRequestStream {
16300    type Protocol = OpenableMarker;
16301    type ControlHandle = OpenableControlHandle;
16302
16303    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16304        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16305    }
16306
16307    fn control_handle(&self) -> Self::ControlHandle {
16308        OpenableControlHandle { inner: self.inner.clone() }
16309    }
16310
16311    fn into_inner(
16312        self,
16313    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16314    {
16315        (self.inner, self.is_terminated)
16316    }
16317
16318    fn from_inner(
16319        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16320        is_terminated: bool,
16321    ) -> Self {
16322        Self { inner, is_terminated }
16323    }
16324}
16325
16326impl futures::Stream for OpenableRequestStream {
16327    type Item = Result<OpenableRequest, fidl::Error>;
16328
16329    fn poll_next(
16330        mut self: std::pin::Pin<&mut Self>,
16331        cx: &mut std::task::Context<'_>,
16332    ) -> std::task::Poll<Option<Self::Item>> {
16333        let this = &mut *self;
16334        if this.inner.check_shutdown(cx) {
16335            this.is_terminated = true;
16336            return std::task::Poll::Ready(None);
16337        }
16338        if this.is_terminated {
16339            panic!("polled OpenableRequestStream after completion");
16340        }
16341        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16342            |bytes, handles| {
16343                match this.inner.channel().read_etc(cx, bytes, handles) {
16344                    std::task::Poll::Ready(Ok(())) => {}
16345                    std::task::Poll::Pending => return std::task::Poll::Pending,
16346                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16347                        this.is_terminated = true;
16348                        return std::task::Poll::Ready(None);
16349                    }
16350                    std::task::Poll::Ready(Err(e)) => {
16351                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16352                            e.into(),
16353                        ))));
16354                    }
16355                }
16356
16357                // A message has been received from the channel
16358                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16359
16360                std::task::Poll::Ready(Some(match header.ordinal {
16361                    0x568ddcb9a9cbb6d9 => {
16362                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
16363                        let mut req = fidl::new_empty!(
16364                            OpenableOpenRequest,
16365                            fidl::encoding::DefaultFuchsiaResourceDialect
16366                        );
16367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
16368                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
16369                        Ok(OpenableRequest::Open {
16370                            path: req.path,
16371                            flags: req.flags,
16372                            options: req.options,
16373                            object: req.object,
16374
16375                            control_handle,
16376                        })
16377                    }
16378                    _ if header.tx_id == 0
16379                        && header
16380                            .dynamic_flags()
16381                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16382                    {
16383                        Ok(OpenableRequest::_UnknownMethod {
16384                            ordinal: header.ordinal,
16385                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16386                            method_type: fidl::MethodType::OneWay,
16387                        })
16388                    }
16389                    _ if header
16390                        .dynamic_flags()
16391                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16392                    {
16393                        this.inner.send_framework_err(
16394                            fidl::encoding::FrameworkErr::UnknownMethod,
16395                            header.tx_id,
16396                            header.ordinal,
16397                            header.dynamic_flags(),
16398                            (bytes, handles),
16399                        )?;
16400                        Ok(OpenableRequest::_UnknownMethod {
16401                            ordinal: header.ordinal,
16402                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16403                            method_type: fidl::MethodType::TwoWay,
16404                        })
16405                    }
16406                    _ => Err(fidl::Error::UnknownOrdinal {
16407                        ordinal: header.ordinal,
16408                        protocol_name:
16409                            <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16410                    }),
16411                }))
16412            },
16413        )
16414    }
16415}
16416
16417/// Openable defines a node which is capable of opening other objects.
16418#[derive(Debug)]
16419pub enum OpenableRequest {
16420    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16421    /// epitaph sent on the `object` channel.
16422    ///
16423    /// Errors:
16424    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16425    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16426    Open {
16427        path: String,
16428        flags: Flags,
16429        options: Options,
16430        object: fidl::Channel,
16431        control_handle: OpenableControlHandle,
16432    },
16433    /// An interaction was received which does not match any known method.
16434    #[non_exhaustive]
16435    _UnknownMethod {
16436        /// Ordinal of the method that was called.
16437        ordinal: u64,
16438        control_handle: OpenableControlHandle,
16439        method_type: fidl::MethodType,
16440    },
16441}
16442
16443impl OpenableRequest {
16444    #[allow(irrefutable_let_patterns)]
16445    pub fn into_open(
16446        self,
16447    ) -> Option<(String, Flags, Options, fidl::Channel, OpenableControlHandle)> {
16448        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
16449            Some((path, flags, options, object, control_handle))
16450        } else {
16451            None
16452        }
16453    }
16454
16455    /// Name of the method defined in FIDL
16456    pub fn method_name(&self) -> &'static str {
16457        match *self {
16458            OpenableRequest::Open { .. } => "open",
16459            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16460                "unknown one-way method"
16461            }
16462            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16463                "unknown two-way method"
16464            }
16465        }
16466    }
16467}
16468
16469#[derive(Debug, Clone)]
16470pub struct OpenableControlHandle {
16471    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16472}
16473
16474impl OpenableControlHandle {
16475    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16476        self.inner.shutdown_with_epitaph(status.into())
16477    }
16478}
16479
16480impl fidl::endpoints::ControlHandle for OpenableControlHandle {
16481    fn shutdown(&self) {
16482        self.inner.shutdown()
16483    }
16484
16485    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16486        self.inner.shutdown_with_epitaph(status)
16487    }
16488
16489    fn is_closed(&self) -> bool {
16490        self.inner.channel().is_closed()
16491    }
16492    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16493        self.inner.channel().on_closed()
16494    }
16495
16496    #[cfg(target_os = "fuchsia")]
16497    fn signal_peer(
16498        &self,
16499        clear_mask: zx::Signals,
16500        set_mask: zx::Signals,
16501    ) -> Result<(), zx_status::Status> {
16502        use fidl::Peered;
16503        self.inner.channel().signal_peer(clear_mask, set_mask)
16504    }
16505}
16506
16507impl OpenableControlHandle {}
16508
16509#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16510pub struct ReadableMarker;
16511
16512impl fidl::endpoints::ProtocolMarker for ReadableMarker {
16513    type Proxy = ReadableProxy;
16514    type RequestStream = ReadableRequestStream;
16515    #[cfg(target_os = "fuchsia")]
16516    type SynchronousProxy = ReadableSynchronousProxy;
16517
16518    const DEBUG_NAME: &'static str = "(anonymous) Readable";
16519}
16520pub type ReadableReadResult = Result<Vec<u8>, i32>;
16521
16522pub trait ReadableProxyInterface: Send + Sync {
16523    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
16524        + Send;
16525    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
16526}
16527#[derive(Debug)]
16528#[cfg(target_os = "fuchsia")]
16529pub struct ReadableSynchronousProxy {
16530    client: fidl::client::sync::Client,
16531}
16532
16533#[cfg(target_os = "fuchsia")]
16534impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
16535    type Proxy = ReadableProxy;
16536    type Protocol = ReadableMarker;
16537
16538    fn from_channel(inner: fidl::Channel) -> Self {
16539        Self::new(inner)
16540    }
16541
16542    fn into_channel(self) -> fidl::Channel {
16543        self.client.into_channel()
16544    }
16545
16546    fn as_channel(&self) -> &fidl::Channel {
16547        self.client.as_channel()
16548    }
16549}
16550
16551#[cfg(target_os = "fuchsia")]
16552impl ReadableSynchronousProxy {
16553    pub fn new(channel: fidl::Channel) -> Self {
16554        Self { client: fidl::client::sync::Client::new(channel) }
16555    }
16556
16557    pub fn into_channel(self) -> fidl::Channel {
16558        self.client.into_channel()
16559    }
16560
16561    /// Waits until an event arrives and returns it. It is safe for other
16562    /// threads to make concurrent requests while waiting for an event.
16563    pub fn wait_for_event(
16564        &self,
16565        deadline: zx::MonotonicInstant,
16566    ) -> Result<ReadableEvent, fidl::Error> {
16567        ReadableEvent::decode(self.client.wait_for_event::<ReadableMarker>(deadline)?)
16568    }
16569
16570    /// Reads up to 'count' bytes at the seek offset.
16571    /// The seek offset is moved forward by the number of bytes read.
16572    ///
16573    /// ## Invariants
16574    ///
16575    /// * The returned `data.length` will never be greater than `count`.
16576    /// * If `data.length` is less than `count`, it means that the seek offset
16577    ///   has reached the end of file as part of this operation.
16578    /// * If `data.length` is zero while `count` is not, it means that the
16579    ///   seek offset is already at or beyond the end of file, and no data could
16580    ///   be read.
16581    /// * If `count` is zero, the server should perform all the checks ensuring
16582    ///   read access without actually read anything, and return an empty
16583    ///   `data` vector.
16584    ///
16585    /// This method requires the [`Rights.READ_BYTES`] right.
16586    ///
16587    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16588    pub fn r#read(
16589        &self,
16590        mut count: u64,
16591        ___deadline: zx::MonotonicInstant,
16592    ) -> Result<ReadableReadResult, fidl::Error> {
16593        let _response = self.client.send_query::<
16594            ReadableReadRequest,
16595            fidl::encoding::ResultType<ReadableReadResponse, i32>,
16596            ReadableMarker,
16597        >(
16598            (count,),
16599            0x57e419a298c8ede,
16600            fidl::encoding::DynamicFlags::empty(),
16601            ___deadline,
16602        )?;
16603        Ok(_response.map(|x| x.data))
16604    }
16605}
16606
16607#[cfg(target_os = "fuchsia")]
16608impl From<ReadableSynchronousProxy> for zx::NullableHandle {
16609    fn from(value: ReadableSynchronousProxy) -> Self {
16610        value.into_channel().into()
16611    }
16612}
16613
16614#[cfg(target_os = "fuchsia")]
16615impl From<fidl::Channel> for ReadableSynchronousProxy {
16616    fn from(value: fidl::Channel) -> Self {
16617        Self::new(value)
16618    }
16619}
16620
16621#[cfg(target_os = "fuchsia")]
16622impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
16623    type Protocol = ReadableMarker;
16624
16625    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
16626        Self::new(value.into_channel())
16627    }
16628}
16629
16630#[derive(Debug, Clone)]
16631pub struct ReadableProxy {
16632    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16633}
16634
16635impl fidl::endpoints::Proxy for ReadableProxy {
16636    type Protocol = ReadableMarker;
16637
16638    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16639        Self::new(inner)
16640    }
16641
16642    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16643        self.client.into_channel().map_err(|client| Self { client })
16644    }
16645
16646    fn as_channel(&self) -> &::fidl::AsyncChannel {
16647        self.client.as_channel()
16648    }
16649}
16650
16651impl ReadableProxy {
16652    /// Create a new Proxy for fuchsia.io/Readable.
16653    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16654        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16655        Self { client: fidl::client::Client::new(channel, protocol_name) }
16656    }
16657
16658    /// Get a Stream of events from the remote end of the protocol.
16659    ///
16660    /// # Panics
16661    ///
16662    /// Panics if the event stream was already taken.
16663    pub fn take_event_stream(&self) -> ReadableEventStream {
16664        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16665    }
16666
16667    /// Reads up to 'count' bytes at the seek offset.
16668    /// The seek offset is moved forward by the number of bytes read.
16669    ///
16670    /// ## Invariants
16671    ///
16672    /// * The returned `data.length` will never be greater than `count`.
16673    /// * If `data.length` is less than `count`, it means that the seek offset
16674    ///   has reached the end of file as part of this operation.
16675    /// * If `data.length` is zero while `count` is not, it means that the
16676    ///   seek offset is already at or beyond the end of file, and no data could
16677    ///   be read.
16678    /// * If `count` is zero, the server should perform all the checks ensuring
16679    ///   read access without actually read anything, and return an empty
16680    ///   `data` vector.
16681    ///
16682    /// This method requires the [`Rights.READ_BYTES`] right.
16683    ///
16684    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16685    pub fn r#read(
16686        &self,
16687        mut count: u64,
16688    ) -> fidl::client::QueryResponseFut<
16689        ReadableReadResult,
16690        fidl::encoding::DefaultFuchsiaResourceDialect,
16691    > {
16692        ReadableProxyInterface::r#read(self, count)
16693    }
16694}
16695
16696impl ReadableProxyInterface for ReadableProxy {
16697    type ReadResponseFut = fidl::client::QueryResponseFut<
16698        ReadableReadResult,
16699        fidl::encoding::DefaultFuchsiaResourceDialect,
16700    >;
16701    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16702        fn _decode(
16703            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16704        ) -> Result<ReadableReadResult, fidl::Error> {
16705            let _response = fidl::client::decode_transaction_body::<
16706                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16707                fidl::encoding::DefaultFuchsiaResourceDialect,
16708                0x57e419a298c8ede,
16709            >(_buf?)?;
16710            Ok(_response.map(|x| x.data))
16711        }
16712        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16713            (count,),
16714            0x57e419a298c8ede,
16715            fidl::encoding::DynamicFlags::empty(),
16716            _decode,
16717        )
16718    }
16719}
16720
16721pub struct ReadableEventStream {
16722    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16723}
16724
16725impl std::marker::Unpin for ReadableEventStream {}
16726
16727impl futures::stream::FusedStream for ReadableEventStream {
16728    fn is_terminated(&self) -> bool {
16729        self.event_receiver.is_terminated()
16730    }
16731}
16732
16733impl futures::Stream for ReadableEventStream {
16734    type Item = Result<ReadableEvent, fidl::Error>;
16735
16736    fn poll_next(
16737        mut self: std::pin::Pin<&mut Self>,
16738        cx: &mut std::task::Context<'_>,
16739    ) -> std::task::Poll<Option<Self::Item>> {
16740        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16741            &mut self.event_receiver,
16742            cx
16743        )?) {
16744            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16745            None => std::task::Poll::Ready(None),
16746        }
16747    }
16748}
16749
16750#[derive(Debug)]
16751pub enum ReadableEvent {}
16752
16753impl ReadableEvent {
16754    /// Decodes a message buffer as a [`ReadableEvent`].
16755    fn decode(
16756        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16757    ) -> Result<ReadableEvent, fidl::Error> {
16758        let (bytes, _handles) = buf.split_mut();
16759        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16760        debug_assert_eq!(tx_header.tx_id, 0);
16761        match tx_header.ordinal {
16762            _ => Err(fidl::Error::UnknownOrdinal {
16763                ordinal: tx_header.ordinal,
16764                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16765            }),
16766        }
16767    }
16768}
16769
16770/// A Stream of incoming requests for fuchsia.io/Readable.
16771pub struct ReadableRequestStream {
16772    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16773    is_terminated: bool,
16774}
16775
16776impl std::marker::Unpin for ReadableRequestStream {}
16777
16778impl futures::stream::FusedStream for ReadableRequestStream {
16779    fn is_terminated(&self) -> bool {
16780        self.is_terminated
16781    }
16782}
16783
16784impl fidl::endpoints::RequestStream for ReadableRequestStream {
16785    type Protocol = ReadableMarker;
16786    type ControlHandle = ReadableControlHandle;
16787
16788    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16789        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16790    }
16791
16792    fn control_handle(&self) -> Self::ControlHandle {
16793        ReadableControlHandle { inner: self.inner.clone() }
16794    }
16795
16796    fn into_inner(
16797        self,
16798    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16799    {
16800        (self.inner, self.is_terminated)
16801    }
16802
16803    fn from_inner(
16804        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16805        is_terminated: bool,
16806    ) -> Self {
16807        Self { inner, is_terminated }
16808    }
16809}
16810
16811impl futures::Stream for ReadableRequestStream {
16812    type Item = Result<ReadableRequest, fidl::Error>;
16813
16814    fn poll_next(
16815        mut self: std::pin::Pin<&mut Self>,
16816        cx: &mut std::task::Context<'_>,
16817    ) -> std::task::Poll<Option<Self::Item>> {
16818        let this = &mut *self;
16819        if this.inner.check_shutdown(cx) {
16820            this.is_terminated = true;
16821            return std::task::Poll::Ready(None);
16822        }
16823        if this.is_terminated {
16824            panic!("polled ReadableRequestStream after completion");
16825        }
16826        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16827            |bytes, handles| {
16828                match this.inner.channel().read_etc(cx, bytes, handles) {
16829                    std::task::Poll::Ready(Ok(())) => {}
16830                    std::task::Poll::Pending => return std::task::Poll::Pending,
16831                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16832                        this.is_terminated = true;
16833                        return std::task::Poll::Ready(None);
16834                    }
16835                    std::task::Poll::Ready(Err(e)) => {
16836                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16837                            e.into(),
16838                        ))));
16839                    }
16840                }
16841
16842                // A message has been received from the channel
16843                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16844
16845                std::task::Poll::Ready(Some(match header.ordinal {
16846                    0x57e419a298c8ede => {
16847                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16848                        let mut req = fidl::new_empty!(
16849                            ReadableReadRequest,
16850                            fidl::encoding::DefaultFuchsiaResourceDialect
16851                        );
16852                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16853                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16854                        Ok(ReadableRequest::Read {
16855                            count: req.count,
16856
16857                            responder: ReadableReadResponder {
16858                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16859                                tx_id: header.tx_id,
16860                            },
16861                        })
16862                    }
16863                    _ => Err(fidl::Error::UnknownOrdinal {
16864                        ordinal: header.ordinal,
16865                        protocol_name:
16866                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16867                    }),
16868                }))
16869            },
16870        )
16871    }
16872}
16873
16874#[derive(Debug)]
16875pub enum ReadableRequest {
16876    /// Reads up to 'count' bytes at the seek offset.
16877    /// The seek offset is moved forward by the number of bytes read.
16878    ///
16879    /// ## Invariants
16880    ///
16881    /// * The returned `data.length` will never be greater than `count`.
16882    /// * If `data.length` is less than `count`, it means that the seek offset
16883    ///   has reached the end of file as part of this operation.
16884    /// * If `data.length` is zero while `count` is not, it means that the
16885    ///   seek offset is already at or beyond the end of file, and no data could
16886    ///   be read.
16887    /// * If `count` is zero, the server should perform all the checks ensuring
16888    ///   read access without actually read anything, and return an empty
16889    ///   `data` vector.
16890    ///
16891    /// This method requires the [`Rights.READ_BYTES`] right.
16892    ///
16893    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16894    Read { count: u64, responder: ReadableReadResponder },
16895}
16896
16897impl ReadableRequest {
16898    #[allow(irrefutable_let_patterns)]
16899    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16900        if let ReadableRequest::Read { count, responder } = self {
16901            Some((count, responder))
16902        } else {
16903            None
16904        }
16905    }
16906
16907    /// Name of the method defined in FIDL
16908    pub fn method_name(&self) -> &'static str {
16909        match *self {
16910            ReadableRequest::Read { .. } => "read",
16911        }
16912    }
16913}
16914
16915#[derive(Debug, Clone)]
16916pub struct ReadableControlHandle {
16917    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16918}
16919
16920impl ReadableControlHandle {
16921    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16922        self.inner.shutdown_with_epitaph(status.into())
16923    }
16924}
16925
16926impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16927    fn shutdown(&self) {
16928        self.inner.shutdown()
16929    }
16930
16931    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16932        self.inner.shutdown_with_epitaph(status)
16933    }
16934
16935    fn is_closed(&self) -> bool {
16936        self.inner.channel().is_closed()
16937    }
16938    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16939        self.inner.channel().on_closed()
16940    }
16941
16942    #[cfg(target_os = "fuchsia")]
16943    fn signal_peer(
16944        &self,
16945        clear_mask: zx::Signals,
16946        set_mask: zx::Signals,
16947    ) -> Result<(), zx_status::Status> {
16948        use fidl::Peered;
16949        self.inner.channel().signal_peer(clear_mask, set_mask)
16950    }
16951}
16952
16953impl ReadableControlHandle {}
16954
16955#[must_use = "FIDL methods require a response to be sent"]
16956#[derive(Debug)]
16957pub struct ReadableReadResponder {
16958    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16959    tx_id: u32,
16960}
16961
16962/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16963/// if the responder is dropped without sending a response, so that the client
16964/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16965impl std::ops::Drop for ReadableReadResponder {
16966    fn drop(&mut self) {
16967        self.control_handle.shutdown();
16968        // Safety: drops once, never accessed again
16969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16970    }
16971}
16972
16973impl fidl::endpoints::Responder for ReadableReadResponder {
16974    type ControlHandle = ReadableControlHandle;
16975
16976    fn control_handle(&self) -> &ReadableControlHandle {
16977        &self.control_handle
16978    }
16979
16980    fn drop_without_shutdown(mut self) {
16981        // Safety: drops once, never accessed again due to mem::forget
16982        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16983        // Prevent Drop from running (which would shut down the channel)
16984        std::mem::forget(self);
16985    }
16986}
16987
16988impl ReadableReadResponder {
16989    /// Sends a response to the FIDL transaction.
16990    ///
16991    /// Sets the channel to shutdown if an error occurs.
16992    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16993        let _result = self.send_raw(result);
16994        if _result.is_err() {
16995            self.control_handle.shutdown();
16996        }
16997        self.drop_without_shutdown();
16998        _result
16999    }
17000
17001    /// Similar to "send" but does not shutdown the channel if an error occurs.
17002    pub fn send_no_shutdown_on_err(
17003        self,
17004        mut result: Result<&[u8], i32>,
17005    ) -> Result<(), fidl::Error> {
17006        let _result = self.send_raw(result);
17007        self.drop_without_shutdown();
17008        _result
17009    }
17010
17011    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
17012        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
17013            result.map(|data| (data,)),
17014            self.tx_id,
17015            0x57e419a298c8ede,
17016            fidl::encoding::DynamicFlags::empty(),
17017        )
17018    }
17019}
17020
17021#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17022pub struct SymlinkMarker;
17023
17024impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
17025    type Proxy = SymlinkProxy;
17026    type RequestStream = SymlinkRequestStream;
17027    #[cfg(target_os = "fuchsia")]
17028    type SynchronousProxy = SymlinkSynchronousProxy;
17029
17030    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
17031}
17032impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
17033
17034pub trait SymlinkProxyInterface: Send + Sync {
17035    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
17036        + Send;
17037    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
17038    fn r#clone(
17039        &self,
17040        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17041    ) -> Result<(), fidl::Error>;
17042    type CloseResponseFut: std::future::Future<
17043            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
17044        > + Send;
17045    fn r#close(&self) -> Self::CloseResponseFut;
17046    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
17047    fn r#query(&self) -> Self::QueryResponseFut;
17048    fn r#deprecated_clone(
17049        &self,
17050        flags: OpenFlags,
17051        object: fidl::endpoints::ServerEnd<NodeMarker>,
17052    ) -> Result<(), fidl::Error>;
17053    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
17054        + Send;
17055    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
17056    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
17057    fn r#deprecated_set_attr(
17058        &self,
17059        flags: NodeAttributeFlags,
17060        attributes: &NodeAttributes,
17061    ) -> Self::DeprecatedSetAttrResponseFut;
17062    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
17063        + Send;
17064    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
17065    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
17066        + Send;
17067    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
17068    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
17069        + Send;
17070    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
17071    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
17072        + Send;
17073    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
17074    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
17075        + Send;
17076    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
17077    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
17078        + Send;
17079    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
17080    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
17081        + Send;
17082    fn r#update_attributes(
17083        &self,
17084        payload: &MutableNodeAttributes,
17085    ) -> Self::UpdateAttributesResponseFut;
17086    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
17087    fn r#sync(&self) -> Self::SyncResponseFut;
17088    fn r#list_extended_attributes(
17089        &self,
17090        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17091    ) -> Result<(), fidl::Error>;
17092    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
17093        + Send;
17094    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
17095    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
17096        + Send;
17097    fn r#set_extended_attribute(
17098        &self,
17099        name: &[u8],
17100        value: ExtendedAttributeValue,
17101        mode: SetExtendedAttributeMode,
17102    ) -> Self::SetExtendedAttributeResponseFut;
17103    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
17104        + Send;
17105    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
17106    fn r#open(
17107        &self,
17108        path: &str,
17109        flags: Flags,
17110        options: &Options,
17111        object: fidl::Channel,
17112    ) -> Result<(), fidl::Error>;
17113    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
17114    fn r#describe(&self) -> Self::DescribeResponseFut;
17115}
17116#[derive(Debug)]
17117#[cfg(target_os = "fuchsia")]
17118pub struct SymlinkSynchronousProxy {
17119    client: fidl::client::sync::Client,
17120}
17121
17122#[cfg(target_os = "fuchsia")]
17123impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
17124    type Proxy = SymlinkProxy;
17125    type Protocol = SymlinkMarker;
17126
17127    fn from_channel(inner: fidl::Channel) -> Self {
17128        Self::new(inner)
17129    }
17130
17131    fn into_channel(self) -> fidl::Channel {
17132        self.client.into_channel()
17133    }
17134
17135    fn as_channel(&self) -> &fidl::Channel {
17136        self.client.as_channel()
17137    }
17138}
17139
17140#[cfg(target_os = "fuchsia")]
17141impl SymlinkSynchronousProxy {
17142    pub fn new(channel: fidl::Channel) -> Self {
17143        Self { client: fidl::client::sync::Client::new(channel) }
17144    }
17145
17146    pub fn into_channel(self) -> fidl::Channel {
17147        self.client.into_channel()
17148    }
17149
17150    /// Waits until an event arrives and returns it. It is safe for other
17151    /// threads to make concurrent requests while waiting for an event.
17152    pub fn wait_for_event(
17153        &self,
17154        deadline: zx::MonotonicInstant,
17155    ) -> Result<SymlinkEvent, fidl::Error> {
17156        SymlinkEvent::decode(self.client.wait_for_event::<SymlinkMarker>(deadline)?)
17157    }
17158
17159    /// Creates a link to this this object with name `dst` in the directory represented by
17160    /// `dst_parent_token`.
17161    ///
17162    /// `dst` must be a resolved object name. Including "/" in the string will return
17163    /// `ZX_ERR_INVALID_ARGS`.
17164    ///
17165    /// This method requires the maximal set of rights supported by the filesystem for this object.
17166    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17167    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17168    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17169    /// `ZX_ERR_ACCESS_DENIED`.
17170    ///
17171    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17172    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17173    ///
17174    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17175    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17176    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17177    ///
17178    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17179    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17180    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17181    pub fn r#link_into(
17182        &self,
17183        mut dst_parent_token: fidl::Event,
17184        mut dst: &str,
17185        ___deadline: zx::MonotonicInstant,
17186    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17187        let _response = self.client.send_query::<
17188            LinkableLinkIntoRequest,
17189            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17190            SymlinkMarker,
17191        >(
17192            (dst_parent_token, dst,),
17193            0x54f3949246a03e74,
17194            fidl::encoding::DynamicFlags::empty(),
17195            ___deadline,
17196        )?;
17197        Ok(_response.map(|x| x))
17198    }
17199
17200    pub fn r#clone(
17201        &self,
17202        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17203    ) -> Result<(), fidl::Error> {
17204        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17205            (request,),
17206            0x20d8a7aba2168a79,
17207            fidl::encoding::DynamicFlags::empty(),
17208        )
17209    }
17210
17211    /// Terminates the connection.
17212    ///
17213    /// After calling `Close`, the client must not send any other requests.
17214    ///
17215    /// Servers, after sending the status response, should close the connection
17216    /// regardless of status and without sending an epitaph.
17217    ///
17218    /// Closing the client end of the channel should be semantically equivalent
17219    /// to calling `Close` without knowing when the close has completed or its
17220    /// status.
17221    pub fn r#close(
17222        &self,
17223        ___deadline: zx::MonotonicInstant,
17224    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17225        let _response = self.client.send_query::<
17226            fidl::encoding::EmptyPayload,
17227            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17228            SymlinkMarker,
17229        >(
17230            (),
17231            0x5ac5d459ad7f657e,
17232            fidl::encoding::DynamicFlags::empty(),
17233            ___deadline,
17234        )?;
17235        Ok(_response.map(|x| x))
17236    }
17237
17238    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
17239        let _response = self.client.send_query::<
17240            fidl::encoding::EmptyPayload,
17241            fidl_fuchsia_unknown::QueryableQueryResponse,
17242            SymlinkMarker,
17243        >(
17244            (),
17245            0x2658edee9decfc06,
17246            fidl::encoding::DynamicFlags::empty(),
17247            ___deadline,
17248        )?;
17249        Ok(_response.protocol)
17250    }
17251
17252    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17253    pub fn r#deprecated_clone(
17254        &self,
17255        mut flags: OpenFlags,
17256        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17257    ) -> Result<(), fidl::Error> {
17258        self.client.send::<NodeDeprecatedCloneRequest>(
17259            (flags, object),
17260            0x5a61678f293ce16f,
17261            fidl::encoding::DynamicFlags::FLEXIBLE,
17262        )
17263    }
17264
17265    /// DEPRECATED - Use `Node.GetAttributes` instead.
17266    ///
17267    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17268    pub fn r#deprecated_get_attr(
17269        &self,
17270        ___deadline: zx::MonotonicInstant,
17271    ) -> Result<(i32, NodeAttributes), fidl::Error> {
17272        let _response = self.client.send_query::<
17273            fidl::encoding::EmptyPayload,
17274            NodeDeprecatedGetAttrResponse,
17275            SymlinkMarker,
17276        >(
17277            (),
17278            0x78985e216314dafd,
17279            fidl::encoding::DynamicFlags::empty(),
17280            ___deadline,
17281        )?;
17282        Ok((_response.s, _response.attributes))
17283    }
17284
17285    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17286    pub fn r#deprecated_set_attr(
17287        &self,
17288        mut flags: NodeAttributeFlags,
17289        mut attributes: &NodeAttributes,
17290        ___deadline: zx::MonotonicInstant,
17291    ) -> Result<i32, fidl::Error> {
17292        let _response = self.client.send_query::<
17293            NodeDeprecatedSetAttrRequest,
17294            NodeDeprecatedSetAttrResponse,
17295            SymlinkMarker,
17296        >(
17297            (flags, attributes,),
17298            0x4186c0f40d938f46,
17299            fidl::encoding::DynamicFlags::empty(),
17300            ___deadline,
17301        )?;
17302        Ok(_response.s)
17303    }
17304
17305    /// [DEPRECATED - Use new GetFlags method instead.]
17306    pub fn r#deprecated_get_flags(
17307        &self,
17308        ___deadline: zx::MonotonicInstant,
17309    ) -> Result<(i32, OpenFlags), fidl::Error> {
17310        let _response = self.client.send_query::<
17311            fidl::encoding::EmptyPayload,
17312            NodeDeprecatedGetFlagsResponse,
17313            SymlinkMarker,
17314        >(
17315            (),
17316            0x5b88fffb8eda3aa1,
17317            fidl::encoding::DynamicFlags::empty(),
17318            ___deadline,
17319        )?;
17320        Ok((_response.s, _response.flags))
17321    }
17322
17323    /// [DEPRECATED - Use new SetFlags method instead.]
17324    pub fn r#deprecated_set_flags(
17325        &self,
17326        mut flags: OpenFlags,
17327        ___deadline: zx::MonotonicInstant,
17328    ) -> Result<i32, fidl::Error> {
17329        let _response = self.client.send_query::<
17330            NodeDeprecatedSetFlagsRequest,
17331            NodeDeprecatedSetFlagsResponse,
17332            SymlinkMarker,
17333        >(
17334            (flags,),
17335            0x5295b76c71fde733,
17336            fidl::encoding::DynamicFlags::empty(),
17337            ___deadline,
17338        )?;
17339        Ok(_response.s)
17340    }
17341
17342    /// Queries the flags that apply to this node after it has been opened/created. This method does
17343    /// not require any rights.
17344    ///
17345    /// Note that the final set of flags that apply to the connection may differ from those
17346    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17347    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17348    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17349    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17350    pub fn r#get_flags(
17351        &self,
17352        ___deadline: zx::MonotonicInstant,
17353    ) -> Result<NodeGetFlagsResult, fidl::Error> {
17354        let _response = self.client.send_query::<
17355            fidl::encoding::EmptyPayload,
17356            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17357            SymlinkMarker,
17358        >(
17359            (),
17360            0x176eb318f64ec23,
17361            fidl::encoding::DynamicFlags::FLEXIBLE,
17362            ___deadline,
17363        )?
17364        .into_result::<SymlinkMarker>("get_flags")?;
17365        Ok(_response.map(|x| x.flags))
17366    }
17367
17368    /// Sets the flags that apply to this node after it has been opened. This method does not
17369    /// require any rights.
17370    ///
17371    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17372    /// clear append mode.
17373    ///
17374    /// Errors:
17375    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17376    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17377    pub fn r#set_flags(
17378        &self,
17379        mut flags: Flags,
17380        ___deadline: zx::MonotonicInstant,
17381    ) -> Result<NodeSetFlagsResult, fidl::Error> {
17382        let _response = self.client.send_query::<
17383            NodeSetFlagsRequest,
17384            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17385            SymlinkMarker,
17386        >(
17387            (flags,),
17388            0x55a8028685791ea8,
17389            fidl::encoding::DynamicFlags::FLEXIBLE,
17390            ___deadline,
17391        )?
17392        .into_result::<SymlinkMarker>("set_flags")?;
17393        Ok(_response.map(|x| x))
17394    }
17395
17396    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17397    /// volume has different settings or the storage is accounted seperately from the rest of the
17398    /// filesystem that may be reported instead of filesystem-wide details.
17399    pub fn r#query_filesystem(
17400        &self,
17401        ___deadline: zx::MonotonicInstant,
17402    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17403        let _response = self
17404            .client
17405            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, SymlinkMarker>(
17406                (),
17407                0x6f344a1c6b0a0610,
17408                fidl::encoding::DynamicFlags::empty(),
17409                ___deadline,
17410            )?;
17411        Ok((_response.s, _response.info))
17412    }
17413
17414    /// Acquires information about the node.
17415    ///
17416    /// The attributes of a node should be stable, independent of the
17417    /// specific protocol used to access it.
17418    ///
17419    /// If a particular attribute is not applicable or not supported,
17420    /// filesystems should leave the corresponding field absent.
17421    ///
17422    /// + `query` a bit-mask specifying which attributes to fetch. The server
17423    ///   should not return more than necessary.
17424    /// - `attributes` the returned attributes.
17425    ///
17426    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17427    pub fn r#get_attributes(
17428        &self,
17429        mut query: NodeAttributesQuery,
17430        ___deadline: zx::MonotonicInstant,
17431    ) -> Result<NodeGetAttributesResult, fidl::Error> {
17432        let _response = self.client.send_query::<
17433            NodeGetAttributesRequest,
17434            fidl::encoding::ResultType<NodeAttributes2, i32>,
17435            SymlinkMarker,
17436        >(
17437            (query,),
17438            0x3d4396a638ea053b,
17439            fidl::encoding::DynamicFlags::empty(),
17440            ___deadline,
17441        )?;
17442        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17443    }
17444
17445    /// Updates information about the node.
17446    ///
17447    /// + `attributes` the presence of a table field in `attributes` indicates
17448    /// the intent to update the corresponding attribute.
17449    ///
17450    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17451    ///
17452    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17453    pub fn r#update_attributes(
17454        &self,
17455        mut payload: &MutableNodeAttributes,
17456        ___deadline: zx::MonotonicInstant,
17457    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17458        let _response = self.client.send_query::<
17459            MutableNodeAttributes,
17460            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17461            SymlinkMarker,
17462        >(
17463            payload,
17464            0x3308c1da5a89bf08,
17465            fidl::encoding::DynamicFlags::empty(),
17466            ___deadline,
17467        )?;
17468        Ok(_response.map(|x| x))
17469    }
17470
17471    /// Synchronizes updates to the node to the underlying media, if it exists.
17472    ///
17473    /// This method will return when the filesystem server has flushed the
17474    /// relevant updates to the underlying media, but does not guarantee the
17475    /// underlying media has persisted the information, nor that any information
17476    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17477    /// between operations.
17478    ///
17479    /// This method does not require any rights.
17480    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
17481        let _response = self.client.send_query::<
17482            fidl::encoding::EmptyPayload,
17483            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17484            SymlinkMarker,
17485        >(
17486            (),
17487            0x2c5c27ca0ab5dc49,
17488            fidl::encoding::DynamicFlags::empty(),
17489            ___deadline,
17490        )?;
17491        Ok(_response.map(|x| x))
17492    }
17493
17494    /// Creates an iterator over all the extended attribute names associated
17495    /// with this node. If an error occurs it is returned as an epitaph on the
17496    /// iterator request channel, and then the channel is closed.
17497    ///
17498    /// GetExtendedAttributes can be used with any of these names to retrieve
17499    /// the associated value.
17500    ///
17501    /// This method requires the [`Rights.READ_BYTES`] right.
17502    pub fn r#list_extended_attributes(
17503        &self,
17504        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17505    ) -> Result<(), fidl::Error> {
17506        self.client.send::<NodeListExtendedAttributesRequest>(
17507            (iterator,),
17508            0x4b61033de007fcd0,
17509            fidl::encoding::DynamicFlags::empty(),
17510        )
17511    }
17512
17513    /// Get the value associated with the given attribute `name` for this node.
17514    ///
17515    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17516    /// particular structure is imposed on them.
17517    ///
17518    /// This method requires the [`Rights.READ_BYTES`] right.
17519    pub fn r#get_extended_attribute(
17520        &self,
17521        mut name: &[u8],
17522        ___deadline: zx::MonotonicInstant,
17523    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17524        let _response = self.client.send_query::<
17525            NodeGetExtendedAttributeRequest,
17526            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17527            SymlinkMarker,
17528        >(
17529            (name,),
17530            0x45ffa3ccfdeb76db,
17531            fidl::encoding::DynamicFlags::empty(),
17532            ___deadline,
17533        )?;
17534        Ok(_response.map(|x| x))
17535    }
17536
17537    /// Set the value for the given attribute `name` to `value` for this node.
17538    ///
17539    /// The attribute name may exist, in which case the attribute is updated.
17540    /// If the attribute doesn't exist, it is created. The name should have no
17541    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17542    ///
17543    /// This method requires the [`Rights.WRITE_BYTES`] right.
17544    pub fn r#set_extended_attribute(
17545        &self,
17546        mut name: &[u8],
17547        mut value: ExtendedAttributeValue,
17548        mut mode: SetExtendedAttributeMode,
17549        ___deadline: zx::MonotonicInstant,
17550    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17551        let _response = self.client.send_query::<
17552            NodeSetExtendedAttributeRequest,
17553            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17554            SymlinkMarker,
17555        >(
17556            (name, &mut value, mode,),
17557            0x4a951362f681f23c,
17558            fidl::encoding::DynamicFlags::empty(),
17559            ___deadline,
17560        )?;
17561        Ok(_response.map(|x| x))
17562    }
17563
17564    /// Remove the specified extended attribute.
17565    ///
17566    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17567    ///
17568    /// This method requires the [`Rights.WRITE_BYTES`] right.
17569    pub fn r#remove_extended_attribute(
17570        &self,
17571        mut name: &[u8],
17572        ___deadline: zx::MonotonicInstant,
17573    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17574        let _response = self.client.send_query::<
17575            NodeRemoveExtendedAttributeRequest,
17576            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17577            SymlinkMarker,
17578        >(
17579            (name,),
17580            0x7a0b9f3a9bf9032d,
17581            fidl::encoding::DynamicFlags::empty(),
17582            ___deadline,
17583        )?;
17584        Ok(_response.map(|x| x))
17585    }
17586
17587    /// Open (or create) a node relative to this directory. Any errors are communicated via an
17588    /// epitaph sent on the `object` channel.
17589    ///
17590    /// Errors:
17591    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
17592    /// * See [`Flags`] for other errors which may be communicated based on `flags`
17593    pub fn r#open(
17594        &self,
17595        mut path: &str,
17596        mut flags: Flags,
17597        mut options: &Options,
17598        mut object: fidl::Channel,
17599    ) -> Result<(), fidl::Error> {
17600        self.client.send::<OpenableOpenRequest>(
17601            (path, flags, options, object),
17602            0x568ddcb9a9cbb6d9,
17603            fidl::encoding::DynamicFlags::FLEXIBLE,
17604        )
17605    }
17606
17607    pub fn r#describe(
17608        &self,
17609        ___deadline: zx::MonotonicInstant,
17610    ) -> Result<SymlinkInfo, fidl::Error> {
17611        let _response = self.client.send_query::<
17612            fidl::encoding::EmptyPayload,
17613            fidl::encoding::FlexibleType<SymlinkInfo>,
17614            SymlinkMarker,
17615        >(
17616            (),
17617            0x742c2ea5e89831f3,
17618            fidl::encoding::DynamicFlags::FLEXIBLE,
17619            ___deadline,
17620        )?
17621        .into_result::<SymlinkMarker>("describe")?;
17622        Ok(_response)
17623    }
17624}
17625
17626#[cfg(target_os = "fuchsia")]
17627impl From<SymlinkSynchronousProxy> for zx::NullableHandle {
17628    fn from(value: SymlinkSynchronousProxy) -> Self {
17629        value.into_channel().into()
17630    }
17631}
17632
17633#[cfg(target_os = "fuchsia")]
17634impl From<fidl::Channel> for SymlinkSynchronousProxy {
17635    fn from(value: fidl::Channel) -> Self {
17636        Self::new(value)
17637    }
17638}
17639
17640#[cfg(target_os = "fuchsia")]
17641impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
17642    type Protocol = SymlinkMarker;
17643
17644    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
17645        Self::new(value.into_channel())
17646    }
17647}
17648
17649#[derive(Debug, Clone)]
17650pub struct SymlinkProxy {
17651    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
17652}
17653
17654impl fidl::endpoints::Proxy for SymlinkProxy {
17655    type Protocol = SymlinkMarker;
17656
17657    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
17658        Self::new(inner)
17659    }
17660
17661    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
17662        self.client.into_channel().map_err(|client| Self { client })
17663    }
17664
17665    fn as_channel(&self) -> &::fidl::AsyncChannel {
17666        self.client.as_channel()
17667    }
17668}
17669
17670impl SymlinkProxy {
17671    /// Create a new Proxy for fuchsia.io/Symlink.
17672    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17673        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17674        Self { client: fidl::client::Client::new(channel, protocol_name) }
17675    }
17676
17677    /// Get a Stream of events from the remote end of the protocol.
17678    ///
17679    /// # Panics
17680    ///
17681    /// Panics if the event stream was already taken.
17682    pub fn take_event_stream(&self) -> SymlinkEventStream {
17683        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17684    }
17685
17686    /// Creates a link to this this object with name `dst` in the directory represented by
17687    /// `dst_parent_token`.
17688    ///
17689    /// `dst` must be a resolved object name. Including "/" in the string will return
17690    /// `ZX_ERR_INVALID_ARGS`.
17691    ///
17692    /// This method requires the maximal set of rights supported by the filesystem for this object.
17693    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17694    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17695    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17696    /// `ZX_ERR_ACCESS_DENIED`.
17697    ///
17698    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17699    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17700    ///
17701    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17702    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17703    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17704    ///
17705    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17706    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17707    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17708    pub fn r#link_into(
17709        &self,
17710        mut dst_parent_token: fidl::Event,
17711        mut dst: &str,
17712    ) -> fidl::client::QueryResponseFut<
17713        LinkableLinkIntoResult,
17714        fidl::encoding::DefaultFuchsiaResourceDialect,
17715    > {
17716        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17717    }
17718
17719    pub fn r#clone(
17720        &self,
17721        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17722    ) -> Result<(), fidl::Error> {
17723        SymlinkProxyInterface::r#clone(self, request)
17724    }
17725
17726    /// Terminates the connection.
17727    ///
17728    /// After calling `Close`, the client must not send any other requests.
17729    ///
17730    /// Servers, after sending the status response, should close the connection
17731    /// regardless of status and without sending an epitaph.
17732    ///
17733    /// Closing the client end of the channel should be semantically equivalent
17734    /// to calling `Close` without knowing when the close has completed or its
17735    /// status.
17736    pub fn r#close(
17737        &self,
17738    ) -> fidl::client::QueryResponseFut<
17739        fidl_fuchsia_unknown::CloseableCloseResult,
17740        fidl::encoding::DefaultFuchsiaResourceDialect,
17741    > {
17742        SymlinkProxyInterface::r#close(self)
17743    }
17744
17745    pub fn r#query(
17746        &self,
17747    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17748    {
17749        SymlinkProxyInterface::r#query(self)
17750    }
17751
17752    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17753    pub fn r#deprecated_clone(
17754        &self,
17755        mut flags: OpenFlags,
17756        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17757    ) -> Result<(), fidl::Error> {
17758        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17759    }
17760
17761    /// DEPRECATED - Use `Node.GetAttributes` instead.
17762    ///
17763    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17764    pub fn r#deprecated_get_attr(
17765        &self,
17766    ) -> fidl::client::QueryResponseFut<
17767        (i32, NodeAttributes),
17768        fidl::encoding::DefaultFuchsiaResourceDialect,
17769    > {
17770        SymlinkProxyInterface::r#deprecated_get_attr(self)
17771    }
17772
17773    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17774    pub fn r#deprecated_set_attr(
17775        &self,
17776        mut flags: NodeAttributeFlags,
17777        mut attributes: &NodeAttributes,
17778    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17779        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17780    }
17781
17782    /// [DEPRECATED - Use new GetFlags method instead.]
17783    pub fn r#deprecated_get_flags(
17784        &self,
17785    ) -> fidl::client::QueryResponseFut<
17786        (i32, OpenFlags),
17787        fidl::encoding::DefaultFuchsiaResourceDialect,
17788    > {
17789        SymlinkProxyInterface::r#deprecated_get_flags(self)
17790    }
17791
17792    /// [DEPRECATED - Use new SetFlags method instead.]
17793    pub fn r#deprecated_set_flags(
17794        &self,
17795        mut flags: OpenFlags,
17796    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17797        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17798    }
17799
17800    /// Queries the flags that apply to this node after it has been opened/created. This method does
17801    /// not require any rights.
17802    ///
17803    /// Note that the final set of flags that apply to the connection may differ from those
17804    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17805    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17806    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17807    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17808    pub fn r#get_flags(
17809        &self,
17810    ) -> fidl::client::QueryResponseFut<
17811        NodeGetFlagsResult,
17812        fidl::encoding::DefaultFuchsiaResourceDialect,
17813    > {
17814        SymlinkProxyInterface::r#get_flags(self)
17815    }
17816
17817    /// Sets the flags that apply to this node after it has been opened. This method does not
17818    /// require any rights.
17819    ///
17820    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17821    /// clear append mode.
17822    ///
17823    /// Errors:
17824    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17825    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17826    pub fn r#set_flags(
17827        &self,
17828        mut flags: Flags,
17829    ) -> fidl::client::QueryResponseFut<
17830        NodeSetFlagsResult,
17831        fidl::encoding::DefaultFuchsiaResourceDialect,
17832    > {
17833        SymlinkProxyInterface::r#set_flags(self, flags)
17834    }
17835
17836    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17837    /// volume has different settings or the storage is accounted seperately from the rest of the
17838    /// filesystem that may be reported instead of filesystem-wide details.
17839    pub fn r#query_filesystem(
17840        &self,
17841    ) -> fidl::client::QueryResponseFut<
17842        (i32, Option<Box<FilesystemInfo>>),
17843        fidl::encoding::DefaultFuchsiaResourceDialect,
17844    > {
17845        SymlinkProxyInterface::r#query_filesystem(self)
17846    }
17847
17848    /// Acquires information about the node.
17849    ///
17850    /// The attributes of a node should be stable, independent of the
17851    /// specific protocol used to access it.
17852    ///
17853    /// If a particular attribute is not applicable or not supported,
17854    /// filesystems should leave the corresponding field absent.
17855    ///
17856    /// + `query` a bit-mask specifying which attributes to fetch. The server
17857    ///   should not return more than necessary.
17858    /// - `attributes` the returned attributes.
17859    ///
17860    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17861    pub fn r#get_attributes(
17862        &self,
17863        mut query: NodeAttributesQuery,
17864    ) -> fidl::client::QueryResponseFut<
17865        NodeGetAttributesResult,
17866        fidl::encoding::DefaultFuchsiaResourceDialect,
17867    > {
17868        SymlinkProxyInterface::r#get_attributes(self, query)
17869    }
17870
17871    /// Updates information about the node.
17872    ///
17873    /// + `attributes` the presence of a table field in `attributes` indicates
17874    /// the intent to update the corresponding attribute.
17875    ///
17876    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17877    ///
17878    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17879    pub fn r#update_attributes(
17880        &self,
17881        mut payload: &MutableNodeAttributes,
17882    ) -> fidl::client::QueryResponseFut<
17883        NodeUpdateAttributesResult,
17884        fidl::encoding::DefaultFuchsiaResourceDialect,
17885    > {
17886        SymlinkProxyInterface::r#update_attributes(self, payload)
17887    }
17888
17889    /// Synchronizes updates to the node to the underlying media, if it exists.
17890    ///
17891    /// This method will return when the filesystem server has flushed the
17892    /// relevant updates to the underlying media, but does not guarantee the
17893    /// underlying media has persisted the information, nor that any information
17894    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17895    /// between operations.
17896    ///
17897    /// This method does not require any rights.
17898    pub fn r#sync(
17899        &self,
17900    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17901    {
17902        SymlinkProxyInterface::r#sync(self)
17903    }
17904
17905    /// Creates an iterator over all the extended attribute names associated
17906    /// with this node. If an error occurs it is returned as an epitaph on the
17907    /// iterator request channel, and then the channel is closed.
17908    ///
17909    /// GetExtendedAttributes can be used with any of these names to retrieve
17910    /// the associated value.
17911    ///
17912    /// This method requires the [`Rights.READ_BYTES`] right.
17913    pub fn r#list_extended_attributes(
17914        &self,
17915        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17916    ) -> Result<(), fidl::Error> {
17917        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17918    }
17919
17920    /// Get the value associated with the given attribute `name` for this node.
17921    ///
17922    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17923    /// particular structure is imposed on them.
17924    ///
17925    /// This method requires the [`Rights.READ_BYTES`] right.
17926    pub fn r#get_extended_attribute(
17927        &self,
17928        mut name: &[u8],
17929    ) -> fidl::client::QueryResponseFut<
17930        NodeGetExtendedAttributeResult,
17931        fidl::encoding::DefaultFuchsiaResourceDialect,
17932    > {
17933        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17934    }
17935
17936    /// Set the value for the given attribute `name` to `value` for this node.
17937    ///
17938    /// The attribute name may exist, in which case the attribute is updated.
17939    /// If the attribute doesn't exist, it is created. The name should have no
17940    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17941    ///
17942    /// This method requires the [`Rights.WRITE_BYTES`] right.
17943    pub fn r#set_extended_attribute(
17944        &self,
17945        mut name: &[u8],
17946        mut value: ExtendedAttributeValue,
17947        mut mode: SetExtendedAttributeMode,
17948    ) -> fidl::client::QueryResponseFut<
17949        NodeSetExtendedAttributeResult,
17950        fidl::encoding::DefaultFuchsiaResourceDialect,
17951    > {
17952        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17953    }
17954
17955    /// Remove the specified extended attribute.
17956    ///
17957    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17958    ///
17959    /// This method requires the [`Rights.WRITE_BYTES`] right.
17960    pub fn r#remove_extended_attribute(
17961        &self,
17962        mut name: &[u8],
17963    ) -> fidl::client::QueryResponseFut<
17964        NodeRemoveExtendedAttributeResult,
17965        fidl::encoding::DefaultFuchsiaResourceDialect,
17966    > {
17967        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17968    }
17969
17970    /// Open (or create) a node relative to this directory. Any errors are communicated via an
17971    /// epitaph sent on the `object` channel.
17972    ///
17973    /// Errors:
17974    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
17975    /// * See [`Flags`] for other errors which may be communicated based on `flags`
17976    pub fn r#open(
17977        &self,
17978        mut path: &str,
17979        mut flags: Flags,
17980        mut options: &Options,
17981        mut object: fidl::Channel,
17982    ) -> Result<(), fidl::Error> {
17983        SymlinkProxyInterface::r#open(self, path, flags, options, object)
17984    }
17985
17986    pub fn r#describe(
17987        &self,
17988    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17989    {
17990        SymlinkProxyInterface::r#describe(self)
17991    }
17992}
17993
17994impl SymlinkProxyInterface for SymlinkProxy {
17995    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17996        LinkableLinkIntoResult,
17997        fidl::encoding::DefaultFuchsiaResourceDialect,
17998    >;
17999    fn r#link_into(
18000        &self,
18001        mut dst_parent_token: fidl::Event,
18002        mut dst: &str,
18003    ) -> Self::LinkIntoResponseFut {
18004        fn _decode(
18005            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18006        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
18007            let _response = fidl::client::decode_transaction_body::<
18008                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18009                fidl::encoding::DefaultFuchsiaResourceDialect,
18010                0x54f3949246a03e74,
18011            >(_buf?)?;
18012            Ok(_response.map(|x| x))
18013        }
18014        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
18015            (dst_parent_token, dst),
18016            0x54f3949246a03e74,
18017            fidl::encoding::DynamicFlags::empty(),
18018            _decode,
18019        )
18020    }
18021
18022    fn r#clone(
18023        &self,
18024        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18025    ) -> Result<(), fidl::Error> {
18026        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
18027            (request,),
18028            0x20d8a7aba2168a79,
18029            fidl::encoding::DynamicFlags::empty(),
18030        )
18031    }
18032
18033    type CloseResponseFut = fidl::client::QueryResponseFut<
18034        fidl_fuchsia_unknown::CloseableCloseResult,
18035        fidl::encoding::DefaultFuchsiaResourceDialect,
18036    >;
18037    fn r#close(&self) -> Self::CloseResponseFut {
18038        fn _decode(
18039            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18040        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
18041            let _response = fidl::client::decode_transaction_body::<
18042                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18043                fidl::encoding::DefaultFuchsiaResourceDialect,
18044                0x5ac5d459ad7f657e,
18045            >(_buf?)?;
18046            Ok(_response.map(|x| x))
18047        }
18048        self.client.send_query_and_decode::<
18049            fidl::encoding::EmptyPayload,
18050            fidl_fuchsia_unknown::CloseableCloseResult,
18051        >(
18052            (),
18053            0x5ac5d459ad7f657e,
18054            fidl::encoding::DynamicFlags::empty(),
18055            _decode,
18056        )
18057    }
18058
18059    type QueryResponseFut =
18060        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
18061    fn r#query(&self) -> Self::QueryResponseFut {
18062        fn _decode(
18063            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18064        ) -> Result<Vec<u8>, fidl::Error> {
18065            let _response = fidl::client::decode_transaction_body::<
18066                fidl_fuchsia_unknown::QueryableQueryResponse,
18067                fidl::encoding::DefaultFuchsiaResourceDialect,
18068                0x2658edee9decfc06,
18069            >(_buf?)?;
18070            Ok(_response.protocol)
18071        }
18072        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
18073            (),
18074            0x2658edee9decfc06,
18075            fidl::encoding::DynamicFlags::empty(),
18076            _decode,
18077        )
18078    }
18079
18080    fn r#deprecated_clone(
18081        &self,
18082        mut flags: OpenFlags,
18083        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
18084    ) -> Result<(), fidl::Error> {
18085        self.client.send::<NodeDeprecatedCloneRequest>(
18086            (flags, object),
18087            0x5a61678f293ce16f,
18088            fidl::encoding::DynamicFlags::FLEXIBLE,
18089        )
18090    }
18091
18092    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
18093        (i32, NodeAttributes),
18094        fidl::encoding::DefaultFuchsiaResourceDialect,
18095    >;
18096    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
18097        fn _decode(
18098            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18099        ) -> Result<(i32, NodeAttributes), fidl::Error> {
18100            let _response = fidl::client::decode_transaction_body::<
18101                NodeDeprecatedGetAttrResponse,
18102                fidl::encoding::DefaultFuchsiaResourceDialect,
18103                0x78985e216314dafd,
18104            >(_buf?)?;
18105            Ok((_response.s, _response.attributes))
18106        }
18107        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
18108            (),
18109            0x78985e216314dafd,
18110            fidl::encoding::DynamicFlags::empty(),
18111            _decode,
18112        )
18113    }
18114
18115    type DeprecatedSetAttrResponseFut =
18116        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18117    fn r#deprecated_set_attr(
18118        &self,
18119        mut flags: NodeAttributeFlags,
18120        mut attributes: &NodeAttributes,
18121    ) -> Self::DeprecatedSetAttrResponseFut {
18122        fn _decode(
18123            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18124        ) -> Result<i32, fidl::Error> {
18125            let _response = fidl::client::decode_transaction_body::<
18126                NodeDeprecatedSetAttrResponse,
18127                fidl::encoding::DefaultFuchsiaResourceDialect,
18128                0x4186c0f40d938f46,
18129            >(_buf?)?;
18130            Ok(_response.s)
18131        }
18132        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
18133            (flags, attributes),
18134            0x4186c0f40d938f46,
18135            fidl::encoding::DynamicFlags::empty(),
18136            _decode,
18137        )
18138    }
18139
18140    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
18141        (i32, OpenFlags),
18142        fidl::encoding::DefaultFuchsiaResourceDialect,
18143    >;
18144    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
18145        fn _decode(
18146            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18147        ) -> Result<(i32, OpenFlags), fidl::Error> {
18148            let _response = fidl::client::decode_transaction_body::<
18149                NodeDeprecatedGetFlagsResponse,
18150                fidl::encoding::DefaultFuchsiaResourceDialect,
18151                0x5b88fffb8eda3aa1,
18152            >(_buf?)?;
18153            Ok((_response.s, _response.flags))
18154        }
18155        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
18156            (),
18157            0x5b88fffb8eda3aa1,
18158            fidl::encoding::DynamicFlags::empty(),
18159            _decode,
18160        )
18161    }
18162
18163    type DeprecatedSetFlagsResponseFut =
18164        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18165    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
18166        fn _decode(
18167            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18168        ) -> Result<i32, fidl::Error> {
18169            let _response = fidl::client::decode_transaction_body::<
18170                NodeDeprecatedSetFlagsResponse,
18171                fidl::encoding::DefaultFuchsiaResourceDialect,
18172                0x5295b76c71fde733,
18173            >(_buf?)?;
18174            Ok(_response.s)
18175        }
18176        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
18177            (flags,),
18178            0x5295b76c71fde733,
18179            fidl::encoding::DynamicFlags::empty(),
18180            _decode,
18181        )
18182    }
18183
18184    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
18185        NodeGetFlagsResult,
18186        fidl::encoding::DefaultFuchsiaResourceDialect,
18187    >;
18188    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
18189        fn _decode(
18190            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18191        ) -> Result<NodeGetFlagsResult, fidl::Error> {
18192            let _response = fidl::client::decode_transaction_body::<
18193                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
18194                fidl::encoding::DefaultFuchsiaResourceDialect,
18195                0x176eb318f64ec23,
18196            >(_buf?)?
18197            .into_result::<SymlinkMarker>("get_flags")?;
18198            Ok(_response.map(|x| x.flags))
18199        }
18200        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
18201            (),
18202            0x176eb318f64ec23,
18203            fidl::encoding::DynamicFlags::FLEXIBLE,
18204            _decode,
18205        )
18206    }
18207
18208    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
18209        NodeSetFlagsResult,
18210        fidl::encoding::DefaultFuchsiaResourceDialect,
18211    >;
18212    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
18213        fn _decode(
18214            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18215        ) -> Result<NodeSetFlagsResult, fidl::Error> {
18216            let _response = fidl::client::decode_transaction_body::<
18217                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
18218                fidl::encoding::DefaultFuchsiaResourceDialect,
18219                0x55a8028685791ea8,
18220            >(_buf?)?
18221            .into_result::<SymlinkMarker>("set_flags")?;
18222            Ok(_response.map(|x| x))
18223        }
18224        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
18225            (flags,),
18226            0x55a8028685791ea8,
18227            fidl::encoding::DynamicFlags::FLEXIBLE,
18228            _decode,
18229        )
18230    }
18231
18232    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
18233        (i32, Option<Box<FilesystemInfo>>),
18234        fidl::encoding::DefaultFuchsiaResourceDialect,
18235    >;
18236    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
18237        fn _decode(
18238            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18239        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
18240            let _response = fidl::client::decode_transaction_body::<
18241                NodeQueryFilesystemResponse,
18242                fidl::encoding::DefaultFuchsiaResourceDialect,
18243                0x6f344a1c6b0a0610,
18244            >(_buf?)?;
18245            Ok((_response.s, _response.info))
18246        }
18247        self.client.send_query_and_decode::<
18248            fidl::encoding::EmptyPayload,
18249            (i32, Option<Box<FilesystemInfo>>),
18250        >(
18251            (),
18252            0x6f344a1c6b0a0610,
18253            fidl::encoding::DynamicFlags::empty(),
18254            _decode,
18255        )
18256    }
18257
18258    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
18259        NodeGetAttributesResult,
18260        fidl::encoding::DefaultFuchsiaResourceDialect,
18261    >;
18262    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
18263        fn _decode(
18264            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18265        ) -> Result<NodeGetAttributesResult, fidl::Error> {
18266            let _response = fidl::client::decode_transaction_body::<
18267                fidl::encoding::ResultType<NodeAttributes2, i32>,
18268                fidl::encoding::DefaultFuchsiaResourceDialect,
18269                0x3d4396a638ea053b,
18270            >(_buf?)?;
18271            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
18272        }
18273        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
18274            (query,),
18275            0x3d4396a638ea053b,
18276            fidl::encoding::DynamicFlags::empty(),
18277            _decode,
18278        )
18279    }
18280
18281    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
18282        NodeUpdateAttributesResult,
18283        fidl::encoding::DefaultFuchsiaResourceDialect,
18284    >;
18285    fn r#update_attributes(
18286        &self,
18287        mut payload: &MutableNodeAttributes,
18288    ) -> Self::UpdateAttributesResponseFut {
18289        fn _decode(
18290            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18291        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
18292            let _response = fidl::client::decode_transaction_body::<
18293                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18294                fidl::encoding::DefaultFuchsiaResourceDialect,
18295                0x3308c1da5a89bf08,
18296            >(_buf?)?;
18297            Ok(_response.map(|x| x))
18298        }
18299        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
18300            payload,
18301            0x3308c1da5a89bf08,
18302            fidl::encoding::DynamicFlags::empty(),
18303            _decode,
18304        )
18305    }
18306
18307    type SyncResponseFut = fidl::client::QueryResponseFut<
18308        NodeSyncResult,
18309        fidl::encoding::DefaultFuchsiaResourceDialect,
18310    >;
18311    fn r#sync(&self) -> Self::SyncResponseFut {
18312        fn _decode(
18313            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18314        ) -> Result<NodeSyncResult, fidl::Error> {
18315            let _response = fidl::client::decode_transaction_body::<
18316                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18317                fidl::encoding::DefaultFuchsiaResourceDialect,
18318                0x2c5c27ca0ab5dc49,
18319            >(_buf?)?;
18320            Ok(_response.map(|x| x))
18321        }
18322        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
18323            (),
18324            0x2c5c27ca0ab5dc49,
18325            fidl::encoding::DynamicFlags::empty(),
18326            _decode,
18327        )
18328    }
18329
18330    fn r#list_extended_attributes(
18331        &self,
18332        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18333    ) -> Result<(), fidl::Error> {
18334        self.client.send::<NodeListExtendedAttributesRequest>(
18335            (iterator,),
18336            0x4b61033de007fcd0,
18337            fidl::encoding::DynamicFlags::empty(),
18338        )
18339    }
18340
18341    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18342        NodeGetExtendedAttributeResult,
18343        fidl::encoding::DefaultFuchsiaResourceDialect,
18344    >;
18345    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
18346        fn _decode(
18347            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18348        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
18349            let _response = fidl::client::decode_transaction_body::<
18350                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
18351                fidl::encoding::DefaultFuchsiaResourceDialect,
18352                0x45ffa3ccfdeb76db,
18353            >(_buf?)?;
18354            Ok(_response.map(|x| x))
18355        }
18356        self.client.send_query_and_decode::<
18357            NodeGetExtendedAttributeRequest,
18358            NodeGetExtendedAttributeResult,
18359        >(
18360            (name,),
18361            0x45ffa3ccfdeb76db,
18362            fidl::encoding::DynamicFlags::empty(),
18363            _decode,
18364        )
18365    }
18366
18367    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18368        NodeSetExtendedAttributeResult,
18369        fidl::encoding::DefaultFuchsiaResourceDialect,
18370    >;
18371    fn r#set_extended_attribute(
18372        &self,
18373        mut name: &[u8],
18374        mut value: ExtendedAttributeValue,
18375        mut mode: SetExtendedAttributeMode,
18376    ) -> Self::SetExtendedAttributeResponseFut {
18377        fn _decode(
18378            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18379        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
18380            let _response = fidl::client::decode_transaction_body::<
18381                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18382                fidl::encoding::DefaultFuchsiaResourceDialect,
18383                0x4a951362f681f23c,
18384            >(_buf?)?;
18385            Ok(_response.map(|x| x))
18386        }
18387        self.client.send_query_and_decode::<
18388            NodeSetExtendedAttributeRequest,
18389            NodeSetExtendedAttributeResult,
18390        >(
18391            (name, &mut value, mode,),
18392            0x4a951362f681f23c,
18393            fidl::encoding::DynamicFlags::empty(),
18394            _decode,
18395        )
18396    }
18397
18398    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18399        NodeRemoveExtendedAttributeResult,
18400        fidl::encoding::DefaultFuchsiaResourceDialect,
18401    >;
18402    fn r#remove_extended_attribute(
18403        &self,
18404        mut name: &[u8],
18405    ) -> Self::RemoveExtendedAttributeResponseFut {
18406        fn _decode(
18407            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18408        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
18409            let _response = fidl::client::decode_transaction_body::<
18410                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18411                fidl::encoding::DefaultFuchsiaResourceDialect,
18412                0x7a0b9f3a9bf9032d,
18413            >(_buf?)?;
18414            Ok(_response.map(|x| x))
18415        }
18416        self.client.send_query_and_decode::<
18417            NodeRemoveExtendedAttributeRequest,
18418            NodeRemoveExtendedAttributeResult,
18419        >(
18420            (name,),
18421            0x7a0b9f3a9bf9032d,
18422            fidl::encoding::DynamicFlags::empty(),
18423            _decode,
18424        )
18425    }
18426
18427    fn r#open(
18428        &self,
18429        mut path: &str,
18430        mut flags: Flags,
18431        mut options: &Options,
18432        mut object: fidl::Channel,
18433    ) -> Result<(), fidl::Error> {
18434        self.client.send::<OpenableOpenRequest>(
18435            (path, flags, options, object),
18436            0x568ddcb9a9cbb6d9,
18437            fidl::encoding::DynamicFlags::FLEXIBLE,
18438        )
18439    }
18440
18441    type DescribeResponseFut =
18442        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
18443    fn r#describe(&self) -> Self::DescribeResponseFut {
18444        fn _decode(
18445            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18446        ) -> Result<SymlinkInfo, fidl::Error> {
18447            let _response = fidl::client::decode_transaction_body::<
18448                fidl::encoding::FlexibleType<SymlinkInfo>,
18449                fidl::encoding::DefaultFuchsiaResourceDialect,
18450                0x742c2ea5e89831f3,
18451            >(_buf?)?
18452            .into_result::<SymlinkMarker>("describe")?;
18453            Ok(_response)
18454        }
18455        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
18456            (),
18457            0x742c2ea5e89831f3,
18458            fidl::encoding::DynamicFlags::FLEXIBLE,
18459            _decode,
18460        )
18461    }
18462}
18463
18464pub struct SymlinkEventStream {
18465    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
18466}
18467
18468impl std::marker::Unpin for SymlinkEventStream {}
18469
18470impl futures::stream::FusedStream for SymlinkEventStream {
18471    fn is_terminated(&self) -> bool {
18472        self.event_receiver.is_terminated()
18473    }
18474}
18475
18476impl futures::Stream for SymlinkEventStream {
18477    type Item = Result<SymlinkEvent, fidl::Error>;
18478
18479    fn poll_next(
18480        mut self: std::pin::Pin<&mut Self>,
18481        cx: &mut std::task::Context<'_>,
18482    ) -> std::task::Poll<Option<Self::Item>> {
18483        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
18484            &mut self.event_receiver,
18485            cx
18486        )?) {
18487            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
18488            None => std::task::Poll::Ready(None),
18489        }
18490    }
18491}
18492
18493#[derive(Debug)]
18494pub enum SymlinkEvent {
18495    OnOpen_ {
18496        s: i32,
18497        info: Option<Box<NodeInfoDeprecated>>,
18498    },
18499    OnRepresentation {
18500        payload: Representation,
18501    },
18502    #[non_exhaustive]
18503    _UnknownEvent {
18504        /// Ordinal of the event that was sent.
18505        ordinal: u64,
18506    },
18507}
18508
18509impl SymlinkEvent {
18510    #[allow(irrefutable_let_patterns)]
18511    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
18512        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
18513    }
18514    #[allow(irrefutable_let_patterns)]
18515    pub fn into_on_representation(self) -> Option<Representation> {
18516        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
18517    }
18518
18519    /// Decodes a message buffer as a [`SymlinkEvent`].
18520    fn decode(
18521        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
18522    ) -> Result<SymlinkEvent, fidl::Error> {
18523        let (bytes, _handles) = buf.split_mut();
18524        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18525        debug_assert_eq!(tx_header.tx_id, 0);
18526        match tx_header.ordinal {
18527            0x7fc7bbb1dbfd1972 => {
18528                let mut out = fidl::new_empty!(
18529                    NodeOnOpenRequest,
18530                    fidl::encoding::DefaultFuchsiaResourceDialect
18531                );
18532                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
18533                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
18534            }
18535            0x5cb40567d80a510c => {
18536                let mut out =
18537                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
18538                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
18539                Ok((SymlinkEvent::OnRepresentation { payload: out }))
18540            }
18541            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
18542                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
18543            }
18544            _ => Err(fidl::Error::UnknownOrdinal {
18545                ordinal: tx_header.ordinal,
18546                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18547            }),
18548        }
18549    }
18550}
18551
18552/// A Stream of incoming requests for fuchsia.io/Symlink.
18553pub struct SymlinkRequestStream {
18554    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18555    is_terminated: bool,
18556}
18557
18558impl std::marker::Unpin for SymlinkRequestStream {}
18559
18560impl futures::stream::FusedStream for SymlinkRequestStream {
18561    fn is_terminated(&self) -> bool {
18562        self.is_terminated
18563    }
18564}
18565
18566impl fidl::endpoints::RequestStream for SymlinkRequestStream {
18567    type Protocol = SymlinkMarker;
18568    type ControlHandle = SymlinkControlHandle;
18569
18570    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
18571        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
18572    }
18573
18574    fn control_handle(&self) -> Self::ControlHandle {
18575        SymlinkControlHandle { inner: self.inner.clone() }
18576    }
18577
18578    fn into_inner(
18579        self,
18580    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
18581    {
18582        (self.inner, self.is_terminated)
18583    }
18584
18585    fn from_inner(
18586        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18587        is_terminated: bool,
18588    ) -> Self {
18589        Self { inner, is_terminated }
18590    }
18591}
18592
18593impl futures::Stream for SymlinkRequestStream {
18594    type Item = Result<SymlinkRequest, fidl::Error>;
18595
18596    fn poll_next(
18597        mut self: std::pin::Pin<&mut Self>,
18598        cx: &mut std::task::Context<'_>,
18599    ) -> std::task::Poll<Option<Self::Item>> {
18600        let this = &mut *self;
18601        if this.inner.check_shutdown(cx) {
18602            this.is_terminated = true;
18603            return std::task::Poll::Ready(None);
18604        }
18605        if this.is_terminated {
18606            panic!("polled SymlinkRequestStream after completion");
18607        }
18608        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
18609            |bytes, handles| {
18610                match this.inner.channel().read_etc(cx, bytes, handles) {
18611                    std::task::Poll::Ready(Ok(())) => {}
18612                    std::task::Poll::Pending => return std::task::Poll::Pending,
18613                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
18614                        this.is_terminated = true;
18615                        return std::task::Poll::Ready(None);
18616                    }
18617                    std::task::Poll::Ready(Err(e)) => {
18618                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
18619                            e.into(),
18620                        ))));
18621                    }
18622                }
18623
18624                // A message has been received from the channel
18625                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18626
18627                std::task::Poll::Ready(Some(match header.ordinal {
18628                    0x54f3949246a03e74 => {
18629                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18630                        let mut req = fidl::new_empty!(
18631                            LinkableLinkIntoRequest,
18632                            fidl::encoding::DefaultFuchsiaResourceDialect
18633                        );
18634                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
18635                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18636                        Ok(SymlinkRequest::LinkInto {
18637                            dst_parent_token: req.dst_parent_token,
18638                            dst: req.dst,
18639
18640                            responder: SymlinkLinkIntoResponder {
18641                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18642                                tx_id: header.tx_id,
18643                            },
18644                        })
18645                    }
18646                    0x20d8a7aba2168a79 => {
18647                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18648                        let mut req = fidl::new_empty!(
18649                            fidl_fuchsia_unknown::CloneableCloneRequest,
18650                            fidl::encoding::DefaultFuchsiaResourceDialect
18651                        );
18652                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18653                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18654                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
18655                    }
18656                    0x5ac5d459ad7f657e => {
18657                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18658                        let mut req = fidl::new_empty!(
18659                            fidl::encoding::EmptyPayload,
18660                            fidl::encoding::DefaultFuchsiaResourceDialect
18661                        );
18662                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18663                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18664                        Ok(SymlinkRequest::Close {
18665                            responder: SymlinkCloseResponder {
18666                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18667                                tx_id: header.tx_id,
18668                            },
18669                        })
18670                    }
18671                    0x2658edee9decfc06 => {
18672                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18673                        let mut req = fidl::new_empty!(
18674                            fidl::encoding::EmptyPayload,
18675                            fidl::encoding::DefaultFuchsiaResourceDialect
18676                        );
18677                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18678                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18679                        Ok(SymlinkRequest::Query {
18680                            responder: SymlinkQueryResponder {
18681                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18682                                tx_id: header.tx_id,
18683                            },
18684                        })
18685                    }
18686                    0x5a61678f293ce16f => {
18687                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18688                        let mut req = fidl::new_empty!(
18689                            NodeDeprecatedCloneRequest,
18690                            fidl::encoding::DefaultFuchsiaResourceDialect
18691                        );
18692                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18693                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18694                        Ok(SymlinkRequest::DeprecatedClone {
18695                            flags: req.flags,
18696                            object: req.object,
18697
18698                            control_handle,
18699                        })
18700                    }
18701                    0x78985e216314dafd => {
18702                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18703                        let mut req = fidl::new_empty!(
18704                            fidl::encoding::EmptyPayload,
18705                            fidl::encoding::DefaultFuchsiaResourceDialect
18706                        );
18707                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18708                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18709                        Ok(SymlinkRequest::DeprecatedGetAttr {
18710                            responder: SymlinkDeprecatedGetAttrResponder {
18711                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18712                                tx_id: header.tx_id,
18713                            },
18714                        })
18715                    }
18716                    0x4186c0f40d938f46 => {
18717                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18718                        let mut req = fidl::new_empty!(
18719                            NodeDeprecatedSetAttrRequest,
18720                            fidl::encoding::DefaultFuchsiaResourceDialect
18721                        );
18722                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18723                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18724                        Ok(SymlinkRequest::DeprecatedSetAttr {
18725                            flags: req.flags,
18726                            attributes: req.attributes,
18727
18728                            responder: SymlinkDeprecatedSetAttrResponder {
18729                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18730                                tx_id: header.tx_id,
18731                            },
18732                        })
18733                    }
18734                    0x5b88fffb8eda3aa1 => {
18735                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18736                        let mut req = fidl::new_empty!(
18737                            fidl::encoding::EmptyPayload,
18738                            fidl::encoding::DefaultFuchsiaResourceDialect
18739                        );
18740                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18741                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18742                        Ok(SymlinkRequest::DeprecatedGetFlags {
18743                            responder: SymlinkDeprecatedGetFlagsResponder {
18744                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18745                                tx_id: header.tx_id,
18746                            },
18747                        })
18748                    }
18749                    0x5295b76c71fde733 => {
18750                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18751                        let mut req = fidl::new_empty!(
18752                            NodeDeprecatedSetFlagsRequest,
18753                            fidl::encoding::DefaultFuchsiaResourceDialect
18754                        );
18755                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18756                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18757                        Ok(SymlinkRequest::DeprecatedSetFlags {
18758                            flags: req.flags,
18759
18760                            responder: SymlinkDeprecatedSetFlagsResponder {
18761                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18762                                tx_id: header.tx_id,
18763                            },
18764                        })
18765                    }
18766                    0x176eb318f64ec23 => {
18767                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18768                        let mut req = fidl::new_empty!(
18769                            fidl::encoding::EmptyPayload,
18770                            fidl::encoding::DefaultFuchsiaResourceDialect
18771                        );
18772                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18773                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18774                        Ok(SymlinkRequest::GetFlags {
18775                            responder: SymlinkGetFlagsResponder {
18776                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18777                                tx_id: header.tx_id,
18778                            },
18779                        })
18780                    }
18781                    0x55a8028685791ea8 => {
18782                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18783                        let mut req = fidl::new_empty!(
18784                            NodeSetFlagsRequest,
18785                            fidl::encoding::DefaultFuchsiaResourceDialect
18786                        );
18787                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18788                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18789                        Ok(SymlinkRequest::SetFlags {
18790                            flags: req.flags,
18791
18792                            responder: SymlinkSetFlagsResponder {
18793                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18794                                tx_id: header.tx_id,
18795                            },
18796                        })
18797                    }
18798                    0x6f344a1c6b0a0610 => {
18799                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18800                        let mut req = fidl::new_empty!(
18801                            fidl::encoding::EmptyPayload,
18802                            fidl::encoding::DefaultFuchsiaResourceDialect
18803                        );
18804                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18805                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18806                        Ok(SymlinkRequest::QueryFilesystem {
18807                            responder: SymlinkQueryFilesystemResponder {
18808                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18809                                tx_id: header.tx_id,
18810                            },
18811                        })
18812                    }
18813                    0x3d4396a638ea053b => {
18814                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18815                        let mut req = fidl::new_empty!(
18816                            NodeGetAttributesRequest,
18817                            fidl::encoding::DefaultFuchsiaResourceDialect
18818                        );
18819                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18820                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18821                        Ok(SymlinkRequest::GetAttributes {
18822                            query: req.query,
18823
18824                            responder: SymlinkGetAttributesResponder {
18825                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18826                                tx_id: header.tx_id,
18827                            },
18828                        })
18829                    }
18830                    0x3308c1da5a89bf08 => {
18831                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18832                        let mut req = fidl::new_empty!(
18833                            MutableNodeAttributes,
18834                            fidl::encoding::DefaultFuchsiaResourceDialect
18835                        );
18836                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18837                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18838                        Ok(SymlinkRequest::UpdateAttributes {
18839                            payload: req,
18840                            responder: SymlinkUpdateAttributesResponder {
18841                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18842                                tx_id: header.tx_id,
18843                            },
18844                        })
18845                    }
18846                    0x2c5c27ca0ab5dc49 => {
18847                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18848                        let mut req = fidl::new_empty!(
18849                            fidl::encoding::EmptyPayload,
18850                            fidl::encoding::DefaultFuchsiaResourceDialect
18851                        );
18852                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18853                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18854                        Ok(SymlinkRequest::Sync {
18855                            responder: SymlinkSyncResponder {
18856                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18857                                tx_id: header.tx_id,
18858                            },
18859                        })
18860                    }
18861                    0x4b61033de007fcd0 => {
18862                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18863                        let mut req = fidl::new_empty!(
18864                            NodeListExtendedAttributesRequest,
18865                            fidl::encoding::DefaultFuchsiaResourceDialect
18866                        );
18867                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18868                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18869                        Ok(SymlinkRequest::ListExtendedAttributes {
18870                            iterator: req.iterator,
18871
18872                            control_handle,
18873                        })
18874                    }
18875                    0x45ffa3ccfdeb76db => {
18876                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18877                        let mut req = fidl::new_empty!(
18878                            NodeGetExtendedAttributeRequest,
18879                            fidl::encoding::DefaultFuchsiaResourceDialect
18880                        );
18881                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18882                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18883                        Ok(SymlinkRequest::GetExtendedAttribute {
18884                            name: req.name,
18885
18886                            responder: SymlinkGetExtendedAttributeResponder {
18887                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18888                                tx_id: header.tx_id,
18889                            },
18890                        })
18891                    }
18892                    0x4a951362f681f23c => {
18893                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18894                        let mut req = fidl::new_empty!(
18895                            NodeSetExtendedAttributeRequest,
18896                            fidl::encoding::DefaultFuchsiaResourceDialect
18897                        );
18898                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18899                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18900                        Ok(SymlinkRequest::SetExtendedAttribute {
18901                            name: req.name,
18902                            value: req.value,
18903                            mode: req.mode,
18904
18905                            responder: SymlinkSetExtendedAttributeResponder {
18906                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18907                                tx_id: header.tx_id,
18908                            },
18909                        })
18910                    }
18911                    0x7a0b9f3a9bf9032d => {
18912                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18913                        let mut req = fidl::new_empty!(
18914                            NodeRemoveExtendedAttributeRequest,
18915                            fidl::encoding::DefaultFuchsiaResourceDialect
18916                        );
18917                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18918                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18919                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18920                            name: req.name,
18921
18922                            responder: SymlinkRemoveExtendedAttributeResponder {
18923                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18924                                tx_id: header.tx_id,
18925                            },
18926                        })
18927                    }
18928                    0x568ddcb9a9cbb6d9 => {
18929                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18930                        let mut req = fidl::new_empty!(
18931                            OpenableOpenRequest,
18932                            fidl::encoding::DefaultFuchsiaResourceDialect
18933                        );
18934                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
18935                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18936                        Ok(SymlinkRequest::Open {
18937                            path: req.path,
18938                            flags: req.flags,
18939                            options: req.options,
18940                            object: req.object,
18941
18942                            control_handle,
18943                        })
18944                    }
18945                    0x742c2ea5e89831f3 => {
18946                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18947                        let mut req = fidl::new_empty!(
18948                            fidl::encoding::EmptyPayload,
18949                            fidl::encoding::DefaultFuchsiaResourceDialect
18950                        );
18951                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18952                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18953                        Ok(SymlinkRequest::Describe {
18954                            responder: SymlinkDescribeResponder {
18955                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18956                                tx_id: header.tx_id,
18957                            },
18958                        })
18959                    }
18960                    _ if header.tx_id == 0
18961                        && header
18962                            .dynamic_flags()
18963                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18964                    {
18965                        Ok(SymlinkRequest::_UnknownMethod {
18966                            ordinal: header.ordinal,
18967                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18968                            method_type: fidl::MethodType::OneWay,
18969                        })
18970                    }
18971                    _ if header
18972                        .dynamic_flags()
18973                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18974                    {
18975                        this.inner.send_framework_err(
18976                            fidl::encoding::FrameworkErr::UnknownMethod,
18977                            header.tx_id,
18978                            header.ordinal,
18979                            header.dynamic_flags(),
18980                            (bytes, handles),
18981                        )?;
18982                        Ok(SymlinkRequest::_UnknownMethod {
18983                            ordinal: header.ordinal,
18984                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18985                            method_type: fidl::MethodType::TwoWay,
18986                        })
18987                    }
18988                    _ => Err(fidl::Error::UnknownOrdinal {
18989                        ordinal: header.ordinal,
18990                        protocol_name:
18991                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18992                    }),
18993                }))
18994            },
18995        )
18996    }
18997}
18998
18999/// A ['Node'] which contains a symbolic link.
19000#[derive(Debug)]
19001pub enum SymlinkRequest {
19002    /// Creates a link to this this object with name `dst` in the directory represented by
19003    /// `dst_parent_token`.
19004    ///
19005    /// `dst` must be a resolved object name. Including "/" in the string will return
19006    /// `ZX_ERR_INVALID_ARGS`.
19007    ///
19008    /// This method requires the maximal set of rights supported by the filesystem for this object.
19009    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
19010    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
19011    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
19012    /// `ZX_ERR_ACCESS_DENIED`.
19013    ///
19014    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
19015    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
19016    ///
19017    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
19018    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
19019    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
19020    ///
19021    /// This method does not have the same atomicity properties has the `Directory::Link` method,
19022    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
19023    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
19024    LinkInto {
19025        dst_parent_token: fidl::Event,
19026        dst: String,
19027        responder: SymlinkLinkIntoResponder,
19028    },
19029    Clone {
19030        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19031        control_handle: SymlinkControlHandle,
19032    },
19033    /// Terminates the connection.
19034    ///
19035    /// After calling `Close`, the client must not send any other requests.
19036    ///
19037    /// Servers, after sending the status response, should close the connection
19038    /// regardless of status and without sending an epitaph.
19039    ///
19040    /// Closing the client end of the channel should be semantically equivalent
19041    /// to calling `Close` without knowing when the close has completed or its
19042    /// status.
19043    Close {
19044        responder: SymlinkCloseResponder,
19045    },
19046    Query {
19047        responder: SymlinkQueryResponder,
19048    },
19049    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
19050    DeprecatedClone {
19051        flags: OpenFlags,
19052        object: fidl::endpoints::ServerEnd<NodeMarker>,
19053        control_handle: SymlinkControlHandle,
19054    },
19055    /// DEPRECATED - Use `Node.GetAttributes` instead.
19056    ///
19057    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19058    DeprecatedGetAttr {
19059        responder: SymlinkDeprecatedGetAttrResponder,
19060    },
19061    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
19062    DeprecatedSetAttr {
19063        flags: NodeAttributeFlags,
19064        attributes: NodeAttributes,
19065        responder: SymlinkDeprecatedSetAttrResponder,
19066    },
19067    /// [DEPRECATED - Use new GetFlags method instead.]
19068    DeprecatedGetFlags {
19069        responder: SymlinkDeprecatedGetFlagsResponder,
19070    },
19071    /// [DEPRECATED - Use new SetFlags method instead.]
19072    DeprecatedSetFlags {
19073        flags: OpenFlags,
19074        responder: SymlinkDeprecatedSetFlagsResponder,
19075    },
19076    /// Queries the flags that apply to this node after it has been opened/created. This method does
19077    /// not require any rights.
19078    ///
19079    /// Note that the final set of flags that apply to the connection may differ from those
19080    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
19081    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
19082    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
19083    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
19084    GetFlags {
19085        responder: SymlinkGetFlagsResponder,
19086    },
19087    /// Sets the flags that apply to this node after it has been opened. This method does not
19088    /// require any rights.
19089    ///
19090    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
19091    /// clear append mode.
19092    ///
19093    /// Errors:
19094    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
19095    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
19096    SetFlags {
19097        flags: Flags,
19098        responder: SymlinkSetFlagsResponder,
19099    },
19100    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
19101    /// volume has different settings or the storage is accounted seperately from the rest of the
19102    /// filesystem that may be reported instead of filesystem-wide details.
19103    QueryFilesystem {
19104        responder: SymlinkQueryFilesystemResponder,
19105    },
19106    /// Acquires information about the node.
19107    ///
19108    /// The attributes of a node should be stable, independent of the
19109    /// specific protocol used to access it.
19110    ///
19111    /// If a particular attribute is not applicable or not supported,
19112    /// filesystems should leave the corresponding field absent.
19113    ///
19114    /// + `query` a bit-mask specifying which attributes to fetch. The server
19115    ///   should not return more than necessary.
19116    /// - `attributes` the returned attributes.
19117    ///
19118    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19119    GetAttributes {
19120        query: NodeAttributesQuery,
19121        responder: SymlinkGetAttributesResponder,
19122    },
19123    /// Updates information about the node.
19124    ///
19125    /// + `attributes` the presence of a table field in `attributes` indicates
19126    /// the intent to update the corresponding attribute.
19127    ///
19128    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
19129    ///
19130    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19131    UpdateAttributes {
19132        payload: MutableNodeAttributes,
19133        responder: SymlinkUpdateAttributesResponder,
19134    },
19135    /// Synchronizes updates to the node to the underlying media, if it exists.
19136    ///
19137    /// This method will return when the filesystem server has flushed the
19138    /// relevant updates to the underlying media, but does not guarantee the
19139    /// underlying media has persisted the information, nor that any information
19140    /// is committed to hardware. Clients may use `Sync` to ensure ordering
19141    /// between operations.
19142    ///
19143    /// This method does not require any rights.
19144    Sync {
19145        responder: SymlinkSyncResponder,
19146    },
19147    /// Creates an iterator over all the extended attribute names associated
19148    /// with this node. If an error occurs it is returned as an epitaph on the
19149    /// iterator request channel, and then the channel is closed.
19150    ///
19151    /// GetExtendedAttributes can be used with any of these names to retrieve
19152    /// the associated value.
19153    ///
19154    /// This method requires the [`Rights.READ_BYTES`] right.
19155    ListExtendedAttributes {
19156        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
19157        control_handle: SymlinkControlHandle,
19158    },
19159    /// Get the value associated with the given attribute `name` for this node.
19160    ///
19161    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
19162    /// particular structure is imposed on them.
19163    ///
19164    /// This method requires the [`Rights.READ_BYTES`] right.
19165    GetExtendedAttribute {
19166        name: Vec<u8>,
19167        responder: SymlinkGetExtendedAttributeResponder,
19168    },
19169    /// Set the value for the given attribute `name` to `value` for this node.
19170    ///
19171    /// The attribute name may exist, in which case the attribute is updated.
19172    /// If the attribute doesn't exist, it is created. The name should have no
19173    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
19174    ///
19175    /// This method requires the [`Rights.WRITE_BYTES`] right.
19176    SetExtendedAttribute {
19177        name: Vec<u8>,
19178        value: ExtendedAttributeValue,
19179        mode: SetExtendedAttributeMode,
19180        responder: SymlinkSetExtendedAttributeResponder,
19181    },
19182    /// Remove the specified extended attribute.
19183    ///
19184    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
19185    ///
19186    /// This method requires the [`Rights.WRITE_BYTES`] right.
19187    RemoveExtendedAttribute {
19188        name: Vec<u8>,
19189        responder: SymlinkRemoveExtendedAttributeResponder,
19190    },
19191    /// Open (or create) a node relative to this directory. Any errors are communicated via an
19192    /// epitaph sent on the `object` channel.
19193    ///
19194    /// Errors:
19195    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
19196    /// * See [`Flags`] for other errors which may be communicated based on `flags`
19197    Open {
19198        path: String,
19199        flags: Flags,
19200        options: Options,
19201        object: fidl::Channel,
19202        control_handle: SymlinkControlHandle,
19203    },
19204    Describe {
19205        responder: SymlinkDescribeResponder,
19206    },
19207    /// An interaction was received which does not match any known method.
19208    #[non_exhaustive]
19209    _UnknownMethod {
19210        /// Ordinal of the method that was called.
19211        ordinal: u64,
19212        control_handle: SymlinkControlHandle,
19213        method_type: fidl::MethodType,
19214    },
19215}
19216
19217impl SymlinkRequest {
19218    #[allow(irrefutable_let_patterns)]
19219    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
19220        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
19221            Some((dst_parent_token, dst, responder))
19222        } else {
19223            None
19224        }
19225    }
19226
19227    #[allow(irrefutable_let_patterns)]
19228    pub fn into_clone(
19229        self,
19230    ) -> Option<(
19231        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19232        SymlinkControlHandle,
19233    )> {
19234        if let SymlinkRequest::Clone { request, control_handle } = self {
19235            Some((request, control_handle))
19236        } else {
19237            None
19238        }
19239    }
19240
19241    #[allow(irrefutable_let_patterns)]
19242    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
19243        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
19244    }
19245
19246    #[allow(irrefutable_let_patterns)]
19247    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
19248        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
19249    }
19250
19251    #[allow(irrefutable_let_patterns)]
19252    pub fn into_deprecated_clone(
19253        self,
19254    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
19255        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
19256            Some((flags, object, control_handle))
19257        } else {
19258            None
19259        }
19260    }
19261
19262    #[allow(irrefutable_let_patterns)]
19263    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
19264        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
19265            Some((responder))
19266        } else {
19267            None
19268        }
19269    }
19270
19271    #[allow(irrefutable_let_patterns)]
19272    pub fn into_deprecated_set_attr(
19273        self,
19274    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
19275        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
19276            Some((flags, attributes, responder))
19277        } else {
19278            None
19279        }
19280    }
19281
19282    #[allow(irrefutable_let_patterns)]
19283    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
19284        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
19285            Some((responder))
19286        } else {
19287            None
19288        }
19289    }
19290
19291    #[allow(irrefutable_let_patterns)]
19292    pub fn into_deprecated_set_flags(
19293        self,
19294    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
19295        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
19296            Some((flags, responder))
19297        } else {
19298            None
19299        }
19300    }
19301
19302    #[allow(irrefutable_let_patterns)]
19303    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
19304        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
19305    }
19306
19307    #[allow(irrefutable_let_patterns)]
19308    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
19309        if let SymlinkRequest::SetFlags { flags, responder } = self {
19310            Some((flags, responder))
19311        } else {
19312            None
19313        }
19314    }
19315
19316    #[allow(irrefutable_let_patterns)]
19317    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
19318        if let SymlinkRequest::QueryFilesystem { responder } = self {
19319            Some((responder))
19320        } else {
19321            None
19322        }
19323    }
19324
19325    #[allow(irrefutable_let_patterns)]
19326    pub fn into_get_attributes(
19327        self,
19328    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
19329        if let SymlinkRequest::GetAttributes { query, responder } = self {
19330            Some((query, responder))
19331        } else {
19332            None
19333        }
19334    }
19335
19336    #[allow(irrefutable_let_patterns)]
19337    pub fn into_update_attributes(
19338        self,
19339    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
19340        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
19341            Some((payload, responder))
19342        } else {
19343            None
19344        }
19345    }
19346
19347    #[allow(irrefutable_let_patterns)]
19348    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
19349        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
19350    }
19351
19352    #[allow(irrefutable_let_patterns)]
19353    pub fn into_list_extended_attributes(
19354        self,
19355    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
19356    {
19357        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
19358            Some((iterator, control_handle))
19359        } else {
19360            None
19361        }
19362    }
19363
19364    #[allow(irrefutable_let_patterns)]
19365    pub fn into_get_extended_attribute(
19366        self,
19367    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
19368        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
19369            Some((name, responder))
19370        } else {
19371            None
19372        }
19373    }
19374
19375    #[allow(irrefutable_let_patterns)]
19376    pub fn into_set_extended_attribute(
19377        self,
19378    ) -> Option<(
19379        Vec<u8>,
19380        ExtendedAttributeValue,
19381        SetExtendedAttributeMode,
19382        SymlinkSetExtendedAttributeResponder,
19383    )> {
19384        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
19385            Some((name, value, mode, responder))
19386        } else {
19387            None
19388        }
19389    }
19390
19391    #[allow(irrefutable_let_patterns)]
19392    pub fn into_remove_extended_attribute(
19393        self,
19394    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
19395        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
19396            Some((name, responder))
19397        } else {
19398            None
19399        }
19400    }
19401
19402    #[allow(irrefutable_let_patterns)]
19403    pub fn into_open(
19404        self,
19405    ) -> Option<(String, Flags, Options, fidl::Channel, SymlinkControlHandle)> {
19406        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
19407            Some((path, flags, options, object, control_handle))
19408        } else {
19409            None
19410        }
19411    }
19412
19413    #[allow(irrefutable_let_patterns)]
19414    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
19415        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
19416    }
19417
19418    /// Name of the method defined in FIDL
19419    pub fn method_name(&self) -> &'static str {
19420        match *self {
19421            SymlinkRequest::LinkInto { .. } => "link_into",
19422            SymlinkRequest::Clone { .. } => "clone",
19423            SymlinkRequest::Close { .. } => "close",
19424            SymlinkRequest::Query { .. } => "query",
19425            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
19426            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
19427            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
19428            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
19429            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
19430            SymlinkRequest::GetFlags { .. } => "get_flags",
19431            SymlinkRequest::SetFlags { .. } => "set_flags",
19432            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
19433            SymlinkRequest::GetAttributes { .. } => "get_attributes",
19434            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
19435            SymlinkRequest::Sync { .. } => "sync",
19436            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
19437            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
19438            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
19439            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
19440            SymlinkRequest::Open { .. } => "open",
19441            SymlinkRequest::Describe { .. } => "describe",
19442            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
19443                "unknown one-way method"
19444            }
19445            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
19446                "unknown two-way method"
19447            }
19448        }
19449    }
19450}
19451
19452#[derive(Debug, Clone)]
19453pub struct SymlinkControlHandle {
19454    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
19455}
19456
19457impl SymlinkControlHandle {
19458    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
19459        self.inner.shutdown_with_epitaph(status.into())
19460    }
19461}
19462
19463impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
19464    fn shutdown(&self) {
19465        self.inner.shutdown()
19466    }
19467
19468    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
19469        self.inner.shutdown_with_epitaph(status)
19470    }
19471
19472    fn is_closed(&self) -> bool {
19473        self.inner.channel().is_closed()
19474    }
19475    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
19476        self.inner.channel().on_closed()
19477    }
19478
19479    #[cfg(target_os = "fuchsia")]
19480    fn signal_peer(
19481        &self,
19482        clear_mask: zx::Signals,
19483        set_mask: zx::Signals,
19484    ) -> Result<(), zx_status::Status> {
19485        use fidl::Peered;
19486        self.inner.channel().signal_peer(clear_mask, set_mask)
19487    }
19488}
19489
19490impl SymlinkControlHandle {
19491    pub fn send_on_open_(
19492        &self,
19493        mut s: i32,
19494        mut info: Option<NodeInfoDeprecated>,
19495    ) -> Result<(), fidl::Error> {
19496        self.inner.send::<NodeOnOpenRequest>(
19497            (s, info.as_mut()),
19498            0,
19499            0x7fc7bbb1dbfd1972,
19500            fidl::encoding::DynamicFlags::FLEXIBLE,
19501        )
19502    }
19503
19504    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
19505        self.inner.send::<Representation>(
19506            &mut payload,
19507            0,
19508            0x5cb40567d80a510c,
19509            fidl::encoding::DynamicFlags::empty(),
19510        )
19511    }
19512}
19513
19514#[must_use = "FIDL methods require a response to be sent"]
19515#[derive(Debug)]
19516pub struct SymlinkLinkIntoResponder {
19517    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19518    tx_id: u32,
19519}
19520
19521/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19522/// if the responder is dropped without sending a response, so that the client
19523/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19524impl std::ops::Drop for SymlinkLinkIntoResponder {
19525    fn drop(&mut self) {
19526        self.control_handle.shutdown();
19527        // Safety: drops once, never accessed again
19528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19529    }
19530}
19531
19532impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
19533    type ControlHandle = SymlinkControlHandle;
19534
19535    fn control_handle(&self) -> &SymlinkControlHandle {
19536        &self.control_handle
19537    }
19538
19539    fn drop_without_shutdown(mut self) {
19540        // Safety: drops once, never accessed again due to mem::forget
19541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19542        // Prevent Drop from running (which would shut down the channel)
19543        std::mem::forget(self);
19544    }
19545}
19546
19547impl SymlinkLinkIntoResponder {
19548    /// Sends a response to the FIDL transaction.
19549    ///
19550    /// Sets the channel to shutdown if an error occurs.
19551    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19552        let _result = self.send_raw(result);
19553        if _result.is_err() {
19554            self.control_handle.shutdown();
19555        }
19556        self.drop_without_shutdown();
19557        _result
19558    }
19559
19560    /// Similar to "send" but does not shutdown the channel if an error occurs.
19561    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19562        let _result = self.send_raw(result);
19563        self.drop_without_shutdown();
19564        _result
19565    }
19566
19567    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19568        self.control_handle
19569            .inner
19570            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19571                result,
19572                self.tx_id,
19573                0x54f3949246a03e74,
19574                fidl::encoding::DynamicFlags::empty(),
19575            )
19576    }
19577}
19578
19579#[must_use = "FIDL methods require a response to be sent"]
19580#[derive(Debug)]
19581pub struct SymlinkCloseResponder {
19582    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19583    tx_id: u32,
19584}
19585
19586/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19587/// if the responder is dropped without sending a response, so that the client
19588/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19589impl std::ops::Drop for SymlinkCloseResponder {
19590    fn drop(&mut self) {
19591        self.control_handle.shutdown();
19592        // Safety: drops once, never accessed again
19593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19594    }
19595}
19596
19597impl fidl::endpoints::Responder for SymlinkCloseResponder {
19598    type ControlHandle = SymlinkControlHandle;
19599
19600    fn control_handle(&self) -> &SymlinkControlHandle {
19601        &self.control_handle
19602    }
19603
19604    fn drop_without_shutdown(mut self) {
19605        // Safety: drops once, never accessed again due to mem::forget
19606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19607        // Prevent Drop from running (which would shut down the channel)
19608        std::mem::forget(self);
19609    }
19610}
19611
19612impl SymlinkCloseResponder {
19613    /// Sends a response to the FIDL transaction.
19614    ///
19615    /// Sets the channel to shutdown if an error occurs.
19616    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19617        let _result = self.send_raw(result);
19618        if _result.is_err() {
19619            self.control_handle.shutdown();
19620        }
19621        self.drop_without_shutdown();
19622        _result
19623    }
19624
19625    /// Similar to "send" but does not shutdown the channel if an error occurs.
19626    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19627        let _result = self.send_raw(result);
19628        self.drop_without_shutdown();
19629        _result
19630    }
19631
19632    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19633        self.control_handle
19634            .inner
19635            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19636                result,
19637                self.tx_id,
19638                0x5ac5d459ad7f657e,
19639                fidl::encoding::DynamicFlags::empty(),
19640            )
19641    }
19642}
19643
19644#[must_use = "FIDL methods require a response to be sent"]
19645#[derive(Debug)]
19646pub struct SymlinkQueryResponder {
19647    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19648    tx_id: u32,
19649}
19650
19651/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19652/// if the responder is dropped without sending a response, so that the client
19653/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19654impl std::ops::Drop for SymlinkQueryResponder {
19655    fn drop(&mut self) {
19656        self.control_handle.shutdown();
19657        // Safety: drops once, never accessed again
19658        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19659    }
19660}
19661
19662impl fidl::endpoints::Responder for SymlinkQueryResponder {
19663    type ControlHandle = SymlinkControlHandle;
19664
19665    fn control_handle(&self) -> &SymlinkControlHandle {
19666        &self.control_handle
19667    }
19668
19669    fn drop_without_shutdown(mut self) {
19670        // Safety: drops once, never accessed again due to mem::forget
19671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19672        // Prevent Drop from running (which would shut down the channel)
19673        std::mem::forget(self);
19674    }
19675}
19676
19677impl SymlinkQueryResponder {
19678    /// Sends a response to the FIDL transaction.
19679    ///
19680    /// Sets the channel to shutdown if an error occurs.
19681    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19682        let _result = self.send_raw(protocol);
19683        if _result.is_err() {
19684            self.control_handle.shutdown();
19685        }
19686        self.drop_without_shutdown();
19687        _result
19688    }
19689
19690    /// Similar to "send" but does not shutdown the channel if an error occurs.
19691    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19692        let _result = self.send_raw(protocol);
19693        self.drop_without_shutdown();
19694        _result
19695    }
19696
19697    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19698        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
19699            (protocol,),
19700            self.tx_id,
19701            0x2658edee9decfc06,
19702            fidl::encoding::DynamicFlags::empty(),
19703        )
19704    }
19705}
19706
19707#[must_use = "FIDL methods require a response to be sent"]
19708#[derive(Debug)]
19709pub struct SymlinkDeprecatedGetAttrResponder {
19710    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19711    tx_id: u32,
19712}
19713
19714/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19715/// if the responder is dropped without sending a response, so that the client
19716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19717impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
19718    fn drop(&mut self) {
19719        self.control_handle.shutdown();
19720        // Safety: drops once, never accessed again
19721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19722    }
19723}
19724
19725impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
19726    type ControlHandle = SymlinkControlHandle;
19727
19728    fn control_handle(&self) -> &SymlinkControlHandle {
19729        &self.control_handle
19730    }
19731
19732    fn drop_without_shutdown(mut self) {
19733        // Safety: drops once, never accessed again due to mem::forget
19734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19735        // Prevent Drop from running (which would shut down the channel)
19736        std::mem::forget(self);
19737    }
19738}
19739
19740impl SymlinkDeprecatedGetAttrResponder {
19741    /// Sends a response to the FIDL transaction.
19742    ///
19743    /// Sets the channel to shutdown if an error occurs.
19744    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19745        let _result = self.send_raw(s, attributes);
19746        if _result.is_err() {
19747            self.control_handle.shutdown();
19748        }
19749        self.drop_without_shutdown();
19750        _result
19751    }
19752
19753    /// Similar to "send" but does not shutdown the channel if an error occurs.
19754    pub fn send_no_shutdown_on_err(
19755        self,
19756        mut s: i32,
19757        mut attributes: &NodeAttributes,
19758    ) -> Result<(), fidl::Error> {
19759        let _result = self.send_raw(s, attributes);
19760        self.drop_without_shutdown();
19761        _result
19762    }
19763
19764    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19765        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
19766            (s, attributes),
19767            self.tx_id,
19768            0x78985e216314dafd,
19769            fidl::encoding::DynamicFlags::empty(),
19770        )
19771    }
19772}
19773
19774#[must_use = "FIDL methods require a response to be sent"]
19775#[derive(Debug)]
19776pub struct SymlinkDeprecatedSetAttrResponder {
19777    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19778    tx_id: u32,
19779}
19780
19781/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19782/// if the responder is dropped without sending a response, so that the client
19783/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19784impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
19785    fn drop(&mut self) {
19786        self.control_handle.shutdown();
19787        // Safety: drops once, never accessed again
19788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19789    }
19790}
19791
19792impl fidl::endpoints::Responder for SymlinkDeprecatedSetAttrResponder {
19793    type ControlHandle = SymlinkControlHandle;
19794
19795    fn control_handle(&self) -> &SymlinkControlHandle {
19796        &self.control_handle
19797    }
19798
19799    fn drop_without_shutdown(mut self) {
19800        // Safety: drops once, never accessed again due to mem::forget
19801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19802        // Prevent Drop from running (which would shut down the channel)
19803        std::mem::forget(self);
19804    }
19805}
19806
19807impl SymlinkDeprecatedSetAttrResponder {
19808    /// Sends a response to the FIDL transaction.
19809    ///
19810    /// Sets the channel to shutdown if an error occurs.
19811    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19812        let _result = self.send_raw(s);
19813        if _result.is_err() {
19814            self.control_handle.shutdown();
19815        }
19816        self.drop_without_shutdown();
19817        _result
19818    }
19819
19820    /// Similar to "send" but does not shutdown the channel if an error occurs.
19821    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19822        let _result = self.send_raw(s);
19823        self.drop_without_shutdown();
19824        _result
19825    }
19826
19827    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19828        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19829            (s,),
19830            self.tx_id,
19831            0x4186c0f40d938f46,
19832            fidl::encoding::DynamicFlags::empty(),
19833        )
19834    }
19835}
19836
19837#[must_use = "FIDL methods require a response to be sent"]
19838#[derive(Debug)]
19839pub struct SymlinkDeprecatedGetFlagsResponder {
19840    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19841    tx_id: u32,
19842}
19843
19844/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19845/// if the responder is dropped without sending a response, so that the client
19846/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19847impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19848    fn drop(&mut self) {
19849        self.control_handle.shutdown();
19850        // Safety: drops once, never accessed again
19851        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19852    }
19853}
19854
19855impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19856    type ControlHandle = SymlinkControlHandle;
19857
19858    fn control_handle(&self) -> &SymlinkControlHandle {
19859        &self.control_handle
19860    }
19861
19862    fn drop_without_shutdown(mut self) {
19863        // Safety: drops once, never accessed again due to mem::forget
19864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19865        // Prevent Drop from running (which would shut down the channel)
19866        std::mem::forget(self);
19867    }
19868}
19869
19870impl SymlinkDeprecatedGetFlagsResponder {
19871    /// Sends a response to the FIDL transaction.
19872    ///
19873    /// Sets the channel to shutdown if an error occurs.
19874    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19875        let _result = self.send_raw(s, flags);
19876        if _result.is_err() {
19877            self.control_handle.shutdown();
19878        }
19879        self.drop_without_shutdown();
19880        _result
19881    }
19882
19883    /// Similar to "send" but does not shutdown the channel if an error occurs.
19884    pub fn send_no_shutdown_on_err(
19885        self,
19886        mut s: i32,
19887        mut flags: OpenFlags,
19888    ) -> Result<(), fidl::Error> {
19889        let _result = self.send_raw(s, flags);
19890        self.drop_without_shutdown();
19891        _result
19892    }
19893
19894    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19895        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19896            (s, flags),
19897            self.tx_id,
19898            0x5b88fffb8eda3aa1,
19899            fidl::encoding::DynamicFlags::empty(),
19900        )
19901    }
19902}
19903
19904#[must_use = "FIDL methods require a response to be sent"]
19905#[derive(Debug)]
19906pub struct SymlinkDeprecatedSetFlagsResponder {
19907    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19908    tx_id: u32,
19909}
19910
19911/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19912/// if the responder is dropped without sending a response, so that the client
19913/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19914impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19915    fn drop(&mut self) {
19916        self.control_handle.shutdown();
19917        // Safety: drops once, never accessed again
19918        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19919    }
19920}
19921
19922impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19923    type ControlHandle = SymlinkControlHandle;
19924
19925    fn control_handle(&self) -> &SymlinkControlHandle {
19926        &self.control_handle
19927    }
19928
19929    fn drop_without_shutdown(mut self) {
19930        // Safety: drops once, never accessed again due to mem::forget
19931        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19932        // Prevent Drop from running (which would shut down the channel)
19933        std::mem::forget(self);
19934    }
19935}
19936
19937impl SymlinkDeprecatedSetFlagsResponder {
19938    /// Sends a response to the FIDL transaction.
19939    ///
19940    /// Sets the channel to shutdown if an error occurs.
19941    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19942        let _result = self.send_raw(s);
19943        if _result.is_err() {
19944            self.control_handle.shutdown();
19945        }
19946        self.drop_without_shutdown();
19947        _result
19948    }
19949
19950    /// Similar to "send" but does not shutdown the channel if an error occurs.
19951    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19952        let _result = self.send_raw(s);
19953        self.drop_without_shutdown();
19954        _result
19955    }
19956
19957    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19958        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19959            (s,),
19960            self.tx_id,
19961            0x5295b76c71fde733,
19962            fidl::encoding::DynamicFlags::empty(),
19963        )
19964    }
19965}
19966
19967#[must_use = "FIDL methods require a response to be sent"]
19968#[derive(Debug)]
19969pub struct SymlinkGetFlagsResponder {
19970    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19971    tx_id: u32,
19972}
19973
19974/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19975/// if the responder is dropped without sending a response, so that the client
19976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19977impl std::ops::Drop for SymlinkGetFlagsResponder {
19978    fn drop(&mut self) {
19979        self.control_handle.shutdown();
19980        // Safety: drops once, never accessed again
19981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19982    }
19983}
19984
19985impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19986    type ControlHandle = SymlinkControlHandle;
19987
19988    fn control_handle(&self) -> &SymlinkControlHandle {
19989        &self.control_handle
19990    }
19991
19992    fn drop_without_shutdown(mut self) {
19993        // Safety: drops once, never accessed again due to mem::forget
19994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19995        // Prevent Drop from running (which would shut down the channel)
19996        std::mem::forget(self);
19997    }
19998}
19999
20000impl SymlinkGetFlagsResponder {
20001    /// Sends a response to the FIDL transaction.
20002    ///
20003    /// Sets the channel to shutdown if an error occurs.
20004    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
20005        let _result = self.send_raw(result);
20006        if _result.is_err() {
20007            self.control_handle.shutdown();
20008        }
20009        self.drop_without_shutdown();
20010        _result
20011    }
20012
20013    /// Similar to "send" but does not shutdown the channel if an error occurs.
20014    pub fn send_no_shutdown_on_err(
20015        self,
20016        mut result: Result<Flags, i32>,
20017    ) -> Result<(), fidl::Error> {
20018        let _result = self.send_raw(result);
20019        self.drop_without_shutdown();
20020        _result
20021    }
20022
20023    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
20024        self.control_handle
20025            .inner
20026            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
20027                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
20028                self.tx_id,
20029                0x176eb318f64ec23,
20030                fidl::encoding::DynamicFlags::FLEXIBLE,
20031            )
20032    }
20033}
20034
20035#[must_use = "FIDL methods require a response to be sent"]
20036#[derive(Debug)]
20037pub struct SymlinkSetFlagsResponder {
20038    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20039    tx_id: u32,
20040}
20041
20042/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20043/// if the responder is dropped without sending a response, so that the client
20044/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20045impl std::ops::Drop for SymlinkSetFlagsResponder {
20046    fn drop(&mut self) {
20047        self.control_handle.shutdown();
20048        // Safety: drops once, never accessed again
20049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20050    }
20051}
20052
20053impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
20054    type ControlHandle = SymlinkControlHandle;
20055
20056    fn control_handle(&self) -> &SymlinkControlHandle {
20057        &self.control_handle
20058    }
20059
20060    fn drop_without_shutdown(mut self) {
20061        // Safety: drops once, never accessed again due to mem::forget
20062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20063        // Prevent Drop from running (which would shut down the channel)
20064        std::mem::forget(self);
20065    }
20066}
20067
20068impl SymlinkSetFlagsResponder {
20069    /// Sends a response to the FIDL transaction.
20070    ///
20071    /// Sets the channel to shutdown if an error occurs.
20072    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20073        let _result = self.send_raw(result);
20074        if _result.is_err() {
20075            self.control_handle.shutdown();
20076        }
20077        self.drop_without_shutdown();
20078        _result
20079    }
20080
20081    /// Similar to "send" but does not shutdown the channel if an error occurs.
20082    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20083        let _result = self.send_raw(result);
20084        self.drop_without_shutdown();
20085        _result
20086    }
20087
20088    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20089        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
20090            fidl::encoding::EmptyStruct,
20091            i32,
20092        >>(
20093            fidl::encoding::FlexibleResult::new(result),
20094            self.tx_id,
20095            0x55a8028685791ea8,
20096            fidl::encoding::DynamicFlags::FLEXIBLE,
20097        )
20098    }
20099}
20100
20101#[must_use = "FIDL methods require a response to be sent"]
20102#[derive(Debug)]
20103pub struct SymlinkQueryFilesystemResponder {
20104    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20105    tx_id: u32,
20106}
20107
20108/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20109/// if the responder is dropped without sending a response, so that the client
20110/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20111impl std::ops::Drop for SymlinkQueryFilesystemResponder {
20112    fn drop(&mut self) {
20113        self.control_handle.shutdown();
20114        // Safety: drops once, never accessed again
20115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20116    }
20117}
20118
20119impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
20120    type ControlHandle = SymlinkControlHandle;
20121
20122    fn control_handle(&self) -> &SymlinkControlHandle {
20123        &self.control_handle
20124    }
20125
20126    fn drop_without_shutdown(mut self) {
20127        // Safety: drops once, never accessed again due to mem::forget
20128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20129        // Prevent Drop from running (which would shut down the channel)
20130        std::mem::forget(self);
20131    }
20132}
20133
20134impl SymlinkQueryFilesystemResponder {
20135    /// Sends a response to the FIDL transaction.
20136    ///
20137    /// Sets the channel to shutdown if an error occurs.
20138    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20139        let _result = self.send_raw(s, info);
20140        if _result.is_err() {
20141            self.control_handle.shutdown();
20142        }
20143        self.drop_without_shutdown();
20144        _result
20145    }
20146
20147    /// Similar to "send" but does not shutdown the channel if an error occurs.
20148    pub fn send_no_shutdown_on_err(
20149        self,
20150        mut s: i32,
20151        mut info: Option<&FilesystemInfo>,
20152    ) -> Result<(), fidl::Error> {
20153        let _result = self.send_raw(s, info);
20154        self.drop_without_shutdown();
20155        _result
20156    }
20157
20158    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20159        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
20160            (s, info),
20161            self.tx_id,
20162            0x6f344a1c6b0a0610,
20163            fidl::encoding::DynamicFlags::empty(),
20164        )
20165    }
20166}
20167
20168#[must_use = "FIDL methods require a response to be sent"]
20169#[derive(Debug)]
20170pub struct SymlinkGetAttributesResponder {
20171    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20172    tx_id: u32,
20173}
20174
20175/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20176/// if the responder is dropped without sending a response, so that the client
20177/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20178impl std::ops::Drop for SymlinkGetAttributesResponder {
20179    fn drop(&mut self) {
20180        self.control_handle.shutdown();
20181        // Safety: drops once, never accessed again
20182        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20183    }
20184}
20185
20186impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
20187    type ControlHandle = SymlinkControlHandle;
20188
20189    fn control_handle(&self) -> &SymlinkControlHandle {
20190        &self.control_handle
20191    }
20192
20193    fn drop_without_shutdown(mut self) {
20194        // Safety: drops once, never accessed again due to mem::forget
20195        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20196        // Prevent Drop from running (which would shut down the channel)
20197        std::mem::forget(self);
20198    }
20199}
20200
20201impl SymlinkGetAttributesResponder {
20202    /// Sends a response to the FIDL transaction.
20203    ///
20204    /// Sets the channel to shutdown if an error occurs.
20205    pub fn send(
20206        self,
20207        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20208    ) -> Result<(), fidl::Error> {
20209        let _result = self.send_raw(result);
20210        if _result.is_err() {
20211            self.control_handle.shutdown();
20212        }
20213        self.drop_without_shutdown();
20214        _result
20215    }
20216
20217    /// Similar to "send" but does not shutdown the channel if an error occurs.
20218    pub fn send_no_shutdown_on_err(
20219        self,
20220        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20221    ) -> Result<(), fidl::Error> {
20222        let _result = self.send_raw(result);
20223        self.drop_without_shutdown();
20224        _result
20225    }
20226
20227    fn send_raw(
20228        &self,
20229        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20230    ) -> Result<(), fidl::Error> {
20231        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
20232            result,
20233            self.tx_id,
20234            0x3d4396a638ea053b,
20235            fidl::encoding::DynamicFlags::empty(),
20236        )
20237    }
20238}
20239
20240#[must_use = "FIDL methods require a response to be sent"]
20241#[derive(Debug)]
20242pub struct SymlinkUpdateAttributesResponder {
20243    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20244    tx_id: u32,
20245}
20246
20247/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20248/// if the responder is dropped without sending a response, so that the client
20249/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20250impl std::ops::Drop for SymlinkUpdateAttributesResponder {
20251    fn drop(&mut self) {
20252        self.control_handle.shutdown();
20253        // Safety: drops once, never accessed again
20254        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20255    }
20256}
20257
20258impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
20259    type ControlHandle = SymlinkControlHandle;
20260
20261    fn control_handle(&self) -> &SymlinkControlHandle {
20262        &self.control_handle
20263    }
20264
20265    fn drop_without_shutdown(mut self) {
20266        // Safety: drops once, never accessed again due to mem::forget
20267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20268        // Prevent Drop from running (which would shut down the channel)
20269        std::mem::forget(self);
20270    }
20271}
20272
20273impl SymlinkUpdateAttributesResponder {
20274    /// Sends a response to the FIDL transaction.
20275    ///
20276    /// Sets the channel to shutdown if an error occurs.
20277    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20278        let _result = self.send_raw(result);
20279        if _result.is_err() {
20280            self.control_handle.shutdown();
20281        }
20282        self.drop_without_shutdown();
20283        _result
20284    }
20285
20286    /// Similar to "send" but does not shutdown the channel if an error occurs.
20287    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20288        let _result = self.send_raw(result);
20289        self.drop_without_shutdown();
20290        _result
20291    }
20292
20293    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20294        self.control_handle
20295            .inner
20296            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20297                result,
20298                self.tx_id,
20299                0x3308c1da5a89bf08,
20300                fidl::encoding::DynamicFlags::empty(),
20301            )
20302    }
20303}
20304
20305#[must_use = "FIDL methods require a response to be sent"]
20306#[derive(Debug)]
20307pub struct SymlinkSyncResponder {
20308    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20309    tx_id: u32,
20310}
20311
20312/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20313/// if the responder is dropped without sending a response, so that the client
20314/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20315impl std::ops::Drop for SymlinkSyncResponder {
20316    fn drop(&mut self) {
20317        self.control_handle.shutdown();
20318        // Safety: drops once, never accessed again
20319        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20320    }
20321}
20322
20323impl fidl::endpoints::Responder for SymlinkSyncResponder {
20324    type ControlHandle = SymlinkControlHandle;
20325
20326    fn control_handle(&self) -> &SymlinkControlHandle {
20327        &self.control_handle
20328    }
20329
20330    fn drop_without_shutdown(mut self) {
20331        // Safety: drops once, never accessed again due to mem::forget
20332        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20333        // Prevent Drop from running (which would shut down the channel)
20334        std::mem::forget(self);
20335    }
20336}
20337
20338impl SymlinkSyncResponder {
20339    /// Sends a response to the FIDL transaction.
20340    ///
20341    /// Sets the channel to shutdown if an error occurs.
20342    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20343        let _result = self.send_raw(result);
20344        if _result.is_err() {
20345            self.control_handle.shutdown();
20346        }
20347        self.drop_without_shutdown();
20348        _result
20349    }
20350
20351    /// Similar to "send" but does not shutdown the channel if an error occurs.
20352    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20353        let _result = self.send_raw(result);
20354        self.drop_without_shutdown();
20355        _result
20356    }
20357
20358    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20359        self.control_handle
20360            .inner
20361            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20362                result,
20363                self.tx_id,
20364                0x2c5c27ca0ab5dc49,
20365                fidl::encoding::DynamicFlags::empty(),
20366            )
20367    }
20368}
20369
20370#[must_use = "FIDL methods require a response to be sent"]
20371#[derive(Debug)]
20372pub struct SymlinkGetExtendedAttributeResponder {
20373    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20374    tx_id: u32,
20375}
20376
20377/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20378/// if the responder is dropped without sending a response, so that the client
20379/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20380impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
20381    fn drop(&mut self) {
20382        self.control_handle.shutdown();
20383        // Safety: drops once, never accessed again
20384        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20385    }
20386}
20387
20388impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
20389    type ControlHandle = SymlinkControlHandle;
20390
20391    fn control_handle(&self) -> &SymlinkControlHandle {
20392        &self.control_handle
20393    }
20394
20395    fn drop_without_shutdown(mut self) {
20396        // Safety: drops once, never accessed again due to mem::forget
20397        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20398        // Prevent Drop from running (which would shut down the channel)
20399        std::mem::forget(self);
20400    }
20401}
20402
20403impl SymlinkGetExtendedAttributeResponder {
20404    /// Sends a response to the FIDL transaction.
20405    ///
20406    /// Sets the channel to shutdown if an error occurs.
20407    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20408        let _result = self.send_raw(result);
20409        if _result.is_err() {
20410            self.control_handle.shutdown();
20411        }
20412        self.drop_without_shutdown();
20413        _result
20414    }
20415
20416    /// Similar to "send" but does not shutdown the channel if an error occurs.
20417    pub fn send_no_shutdown_on_err(
20418        self,
20419        mut result: Result<ExtendedAttributeValue, i32>,
20420    ) -> Result<(), fidl::Error> {
20421        let _result = self.send_raw(result);
20422        self.drop_without_shutdown();
20423        _result
20424    }
20425
20426    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20427        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
20428            result.as_mut().map_err(|e| *e),
20429            self.tx_id,
20430            0x45ffa3ccfdeb76db,
20431            fidl::encoding::DynamicFlags::empty(),
20432        )
20433    }
20434}
20435
20436#[must_use = "FIDL methods require a response to be sent"]
20437#[derive(Debug)]
20438pub struct SymlinkSetExtendedAttributeResponder {
20439    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20440    tx_id: u32,
20441}
20442
20443/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20444/// if the responder is dropped without sending a response, so that the client
20445/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20446impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
20447    fn drop(&mut self) {
20448        self.control_handle.shutdown();
20449        // Safety: drops once, never accessed again
20450        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20451    }
20452}
20453
20454impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
20455    type ControlHandle = SymlinkControlHandle;
20456
20457    fn control_handle(&self) -> &SymlinkControlHandle {
20458        &self.control_handle
20459    }
20460
20461    fn drop_without_shutdown(mut self) {
20462        // Safety: drops once, never accessed again due to mem::forget
20463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20464        // Prevent Drop from running (which would shut down the channel)
20465        std::mem::forget(self);
20466    }
20467}
20468
20469impl SymlinkSetExtendedAttributeResponder {
20470    /// Sends a response to the FIDL transaction.
20471    ///
20472    /// Sets the channel to shutdown if an error occurs.
20473    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20474        let _result = self.send_raw(result);
20475        if _result.is_err() {
20476            self.control_handle.shutdown();
20477        }
20478        self.drop_without_shutdown();
20479        _result
20480    }
20481
20482    /// Similar to "send" but does not shutdown the channel if an error occurs.
20483    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20484        let _result = self.send_raw(result);
20485        self.drop_without_shutdown();
20486        _result
20487    }
20488
20489    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20490        self.control_handle
20491            .inner
20492            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20493                result,
20494                self.tx_id,
20495                0x4a951362f681f23c,
20496                fidl::encoding::DynamicFlags::empty(),
20497            )
20498    }
20499}
20500
20501#[must_use = "FIDL methods require a response to be sent"]
20502#[derive(Debug)]
20503pub struct SymlinkRemoveExtendedAttributeResponder {
20504    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20505    tx_id: u32,
20506}
20507
20508/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20509/// if the responder is dropped without sending a response, so that the client
20510/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20511impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
20512    fn drop(&mut self) {
20513        self.control_handle.shutdown();
20514        // Safety: drops once, never accessed again
20515        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20516    }
20517}
20518
20519impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
20520    type ControlHandle = SymlinkControlHandle;
20521
20522    fn control_handle(&self) -> &SymlinkControlHandle {
20523        &self.control_handle
20524    }
20525
20526    fn drop_without_shutdown(mut self) {
20527        // Safety: drops once, never accessed again due to mem::forget
20528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20529        // Prevent Drop from running (which would shut down the channel)
20530        std::mem::forget(self);
20531    }
20532}
20533
20534impl SymlinkRemoveExtendedAttributeResponder {
20535    /// Sends a response to the FIDL transaction.
20536    ///
20537    /// Sets the channel to shutdown if an error occurs.
20538    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20539        let _result = self.send_raw(result);
20540        if _result.is_err() {
20541            self.control_handle.shutdown();
20542        }
20543        self.drop_without_shutdown();
20544        _result
20545    }
20546
20547    /// Similar to "send" but does not shutdown the channel if an error occurs.
20548    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20549        let _result = self.send_raw(result);
20550        self.drop_without_shutdown();
20551        _result
20552    }
20553
20554    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20555        self.control_handle
20556            .inner
20557            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20558                result,
20559                self.tx_id,
20560                0x7a0b9f3a9bf9032d,
20561                fidl::encoding::DynamicFlags::empty(),
20562            )
20563    }
20564}
20565
20566#[must_use = "FIDL methods require a response to be sent"]
20567#[derive(Debug)]
20568pub struct SymlinkDescribeResponder {
20569    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20570    tx_id: u32,
20571}
20572
20573/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20574/// if the responder is dropped without sending a response, so that the client
20575/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20576impl std::ops::Drop for SymlinkDescribeResponder {
20577    fn drop(&mut self) {
20578        self.control_handle.shutdown();
20579        // Safety: drops once, never accessed again
20580        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20581    }
20582}
20583
20584impl fidl::endpoints::Responder for SymlinkDescribeResponder {
20585    type ControlHandle = SymlinkControlHandle;
20586
20587    fn control_handle(&self) -> &SymlinkControlHandle {
20588        &self.control_handle
20589    }
20590
20591    fn drop_without_shutdown(mut self) {
20592        // Safety: drops once, never accessed again due to mem::forget
20593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20594        // Prevent Drop from running (which would shut down the channel)
20595        std::mem::forget(self);
20596    }
20597}
20598
20599impl SymlinkDescribeResponder {
20600    /// Sends a response to the FIDL transaction.
20601    ///
20602    /// Sets the channel to shutdown if an error occurs.
20603    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20604        let _result = self.send_raw(payload);
20605        if _result.is_err() {
20606            self.control_handle.shutdown();
20607        }
20608        self.drop_without_shutdown();
20609        _result
20610    }
20611
20612    /// Similar to "send" but does not shutdown the channel if an error occurs.
20613    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20614        let _result = self.send_raw(payload);
20615        self.drop_without_shutdown();
20616        _result
20617    }
20618
20619    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20620        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
20621            fidl::encoding::Flexible::new(payload),
20622            self.tx_id,
20623            0x742c2ea5e89831f3,
20624            fidl::encoding::DynamicFlags::FLEXIBLE,
20625        )
20626    }
20627}
20628
20629#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
20630pub struct WritableMarker;
20631
20632impl fidl::endpoints::ProtocolMarker for WritableMarker {
20633    type Proxy = WritableProxy;
20634    type RequestStream = WritableRequestStream;
20635    #[cfg(target_os = "fuchsia")]
20636    type SynchronousProxy = WritableSynchronousProxy;
20637
20638    const DEBUG_NAME: &'static str = "(anonymous) Writable";
20639}
20640pub type WritableWriteResult = Result<u64, i32>;
20641
20642pub trait WritableProxyInterface: Send + Sync {
20643    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
20644        + Send;
20645    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
20646}
20647#[derive(Debug)]
20648#[cfg(target_os = "fuchsia")]
20649pub struct WritableSynchronousProxy {
20650    client: fidl::client::sync::Client,
20651}
20652
20653#[cfg(target_os = "fuchsia")]
20654impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
20655    type Proxy = WritableProxy;
20656    type Protocol = WritableMarker;
20657
20658    fn from_channel(inner: fidl::Channel) -> Self {
20659        Self::new(inner)
20660    }
20661
20662    fn into_channel(self) -> fidl::Channel {
20663        self.client.into_channel()
20664    }
20665
20666    fn as_channel(&self) -> &fidl::Channel {
20667        self.client.as_channel()
20668    }
20669}
20670
20671#[cfg(target_os = "fuchsia")]
20672impl WritableSynchronousProxy {
20673    pub fn new(channel: fidl::Channel) -> Self {
20674        Self { client: fidl::client::sync::Client::new(channel) }
20675    }
20676
20677    pub fn into_channel(self) -> fidl::Channel {
20678        self.client.into_channel()
20679    }
20680
20681    /// Waits until an event arrives and returns it. It is safe for other
20682    /// threads to make concurrent requests while waiting for an event.
20683    pub fn wait_for_event(
20684        &self,
20685        deadline: zx::MonotonicInstant,
20686    ) -> Result<WritableEvent, fidl::Error> {
20687        WritableEvent::decode(self.client.wait_for_event::<WritableMarker>(deadline)?)
20688    }
20689
20690    /// Writes data at the seek offset.
20691    /// The seek offset is moved forward by the number of bytes written.
20692    /// If the file is in append mode, the seek offset is first set to the end
20693    /// of the file, followed by the write, in one atomic step.
20694    ///
20695    /// The file size may grow if the seek offset plus `data.length` is beyond
20696    /// the current end of file.
20697    ///
20698    /// + request `data` the byte buffer to write to the file.
20699    /// - response `actual_count` the number of bytes written.
20700    ///
20701    /// ## Invariants
20702    ///
20703    /// * The returned `actual_count` will never be greater than `data.length`.
20704    /// * If the server is unable to write all the data due to e.g. not enough
20705    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20706    ///   could be written, an error is returned.
20707    /// * If `data.length` is zero, the server should perform all the checks
20708    ///   ensuring write access without mutating the file and return a
20709    ///   successful write of zero bytes.  The seek offset is still updated if
20710    ///   in append mode.
20711    ///
20712    /// This method requires the [`Rights.WRITE_BYTES`] right.
20713    pub fn r#write(
20714        &self,
20715        mut data: &[u8],
20716        ___deadline: zx::MonotonicInstant,
20717    ) -> Result<WritableWriteResult, fidl::Error> {
20718        let _response = self.client.send_query::<
20719            WritableWriteRequest,
20720            fidl::encoding::ResultType<WritableWriteResponse, i32>,
20721            WritableMarker,
20722        >(
20723            (data,),
20724            0x6a31437832469f82,
20725            fidl::encoding::DynamicFlags::empty(),
20726            ___deadline,
20727        )?;
20728        Ok(_response.map(|x| x.actual_count))
20729    }
20730}
20731
20732#[cfg(target_os = "fuchsia")]
20733impl From<WritableSynchronousProxy> for zx::NullableHandle {
20734    fn from(value: WritableSynchronousProxy) -> Self {
20735        value.into_channel().into()
20736    }
20737}
20738
20739#[cfg(target_os = "fuchsia")]
20740impl From<fidl::Channel> for WritableSynchronousProxy {
20741    fn from(value: fidl::Channel) -> Self {
20742        Self::new(value)
20743    }
20744}
20745
20746#[cfg(target_os = "fuchsia")]
20747impl fidl::endpoints::FromClient for WritableSynchronousProxy {
20748    type Protocol = WritableMarker;
20749
20750    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
20751        Self::new(value.into_channel())
20752    }
20753}
20754
20755#[derive(Debug, Clone)]
20756pub struct WritableProxy {
20757    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
20758}
20759
20760impl fidl::endpoints::Proxy for WritableProxy {
20761    type Protocol = WritableMarker;
20762
20763    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
20764        Self::new(inner)
20765    }
20766
20767    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
20768        self.client.into_channel().map_err(|client| Self { client })
20769    }
20770
20771    fn as_channel(&self) -> &::fidl::AsyncChannel {
20772        self.client.as_channel()
20773    }
20774}
20775
20776impl WritableProxy {
20777    /// Create a new Proxy for fuchsia.io/Writable.
20778    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20779        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20780        Self { client: fidl::client::Client::new(channel, protocol_name) }
20781    }
20782
20783    /// Get a Stream of events from the remote end of the protocol.
20784    ///
20785    /// # Panics
20786    ///
20787    /// Panics if the event stream was already taken.
20788    pub fn take_event_stream(&self) -> WritableEventStream {
20789        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20790    }
20791
20792    /// Writes data at the seek offset.
20793    /// The seek offset is moved forward by the number of bytes written.
20794    /// If the file is in append mode, the seek offset is first set to the end
20795    /// of the file, followed by the write, in one atomic step.
20796    ///
20797    /// The file size may grow if the seek offset plus `data.length` is beyond
20798    /// the current end of file.
20799    ///
20800    /// + request `data` the byte buffer to write to the file.
20801    /// - response `actual_count` the number of bytes written.
20802    ///
20803    /// ## Invariants
20804    ///
20805    /// * The returned `actual_count` will never be greater than `data.length`.
20806    /// * If the server is unable to write all the data due to e.g. not enough
20807    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20808    ///   could be written, an error is returned.
20809    /// * If `data.length` is zero, the server should perform all the checks
20810    ///   ensuring write access without mutating the file and return a
20811    ///   successful write of zero bytes.  The seek offset is still updated if
20812    ///   in append mode.
20813    ///
20814    /// This method requires the [`Rights.WRITE_BYTES`] right.
20815    pub fn r#write(
20816        &self,
20817        mut data: &[u8],
20818    ) -> fidl::client::QueryResponseFut<
20819        WritableWriteResult,
20820        fidl::encoding::DefaultFuchsiaResourceDialect,
20821    > {
20822        WritableProxyInterface::r#write(self, data)
20823    }
20824}
20825
20826impl WritableProxyInterface for WritableProxy {
20827    type WriteResponseFut = fidl::client::QueryResponseFut<
20828        WritableWriteResult,
20829        fidl::encoding::DefaultFuchsiaResourceDialect,
20830    >;
20831    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20832        fn _decode(
20833            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20834        ) -> Result<WritableWriteResult, fidl::Error> {
20835            let _response = fidl::client::decode_transaction_body::<
20836                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20837                fidl::encoding::DefaultFuchsiaResourceDialect,
20838                0x6a31437832469f82,
20839            >(_buf?)?;
20840            Ok(_response.map(|x| x.actual_count))
20841        }
20842        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20843            (data,),
20844            0x6a31437832469f82,
20845            fidl::encoding::DynamicFlags::empty(),
20846            _decode,
20847        )
20848    }
20849}
20850
20851pub struct WritableEventStream {
20852    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20853}
20854
20855impl std::marker::Unpin for WritableEventStream {}
20856
20857impl futures::stream::FusedStream for WritableEventStream {
20858    fn is_terminated(&self) -> bool {
20859        self.event_receiver.is_terminated()
20860    }
20861}
20862
20863impl futures::Stream for WritableEventStream {
20864    type Item = Result<WritableEvent, fidl::Error>;
20865
20866    fn poll_next(
20867        mut self: std::pin::Pin<&mut Self>,
20868        cx: &mut std::task::Context<'_>,
20869    ) -> std::task::Poll<Option<Self::Item>> {
20870        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20871            &mut self.event_receiver,
20872            cx
20873        )?) {
20874            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20875            None => std::task::Poll::Ready(None),
20876        }
20877    }
20878}
20879
20880#[derive(Debug)]
20881pub enum WritableEvent {}
20882
20883impl WritableEvent {
20884    /// Decodes a message buffer as a [`WritableEvent`].
20885    fn decode(
20886        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20887    ) -> Result<WritableEvent, fidl::Error> {
20888        let (bytes, _handles) = buf.split_mut();
20889        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20890        debug_assert_eq!(tx_header.tx_id, 0);
20891        match tx_header.ordinal {
20892            _ => Err(fidl::Error::UnknownOrdinal {
20893                ordinal: tx_header.ordinal,
20894                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20895            }),
20896        }
20897    }
20898}
20899
20900/// A Stream of incoming requests for fuchsia.io/Writable.
20901pub struct WritableRequestStream {
20902    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20903    is_terminated: bool,
20904}
20905
20906impl std::marker::Unpin for WritableRequestStream {}
20907
20908impl futures::stream::FusedStream for WritableRequestStream {
20909    fn is_terminated(&self) -> bool {
20910        self.is_terminated
20911    }
20912}
20913
20914impl fidl::endpoints::RequestStream for WritableRequestStream {
20915    type Protocol = WritableMarker;
20916    type ControlHandle = WritableControlHandle;
20917
20918    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20919        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20920    }
20921
20922    fn control_handle(&self) -> Self::ControlHandle {
20923        WritableControlHandle { inner: self.inner.clone() }
20924    }
20925
20926    fn into_inner(
20927        self,
20928    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20929    {
20930        (self.inner, self.is_terminated)
20931    }
20932
20933    fn from_inner(
20934        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20935        is_terminated: bool,
20936    ) -> Self {
20937        Self { inner, is_terminated }
20938    }
20939}
20940
20941impl futures::Stream for WritableRequestStream {
20942    type Item = Result<WritableRequest, fidl::Error>;
20943
20944    fn poll_next(
20945        mut self: std::pin::Pin<&mut Self>,
20946        cx: &mut std::task::Context<'_>,
20947    ) -> std::task::Poll<Option<Self::Item>> {
20948        let this = &mut *self;
20949        if this.inner.check_shutdown(cx) {
20950            this.is_terminated = true;
20951            return std::task::Poll::Ready(None);
20952        }
20953        if this.is_terminated {
20954            panic!("polled WritableRequestStream after completion");
20955        }
20956        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20957            |bytes, handles| {
20958                match this.inner.channel().read_etc(cx, bytes, handles) {
20959                    std::task::Poll::Ready(Ok(())) => {}
20960                    std::task::Poll::Pending => return std::task::Poll::Pending,
20961                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20962                        this.is_terminated = true;
20963                        return std::task::Poll::Ready(None);
20964                    }
20965                    std::task::Poll::Ready(Err(e)) => {
20966                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20967                            e.into(),
20968                        ))));
20969                    }
20970                }
20971
20972                // A message has been received from the channel
20973                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20974
20975                std::task::Poll::Ready(Some(match header.ordinal {
20976                    0x6a31437832469f82 => {
20977                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20978                        let mut req = fidl::new_empty!(
20979                            WritableWriteRequest,
20980                            fidl::encoding::DefaultFuchsiaResourceDialect
20981                        );
20982                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20983                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20984                        Ok(WritableRequest::Write {
20985                            data: req.data,
20986
20987                            responder: WritableWriteResponder {
20988                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20989                                tx_id: header.tx_id,
20990                            },
20991                        })
20992                    }
20993                    _ => Err(fidl::Error::UnknownOrdinal {
20994                        ordinal: header.ordinal,
20995                        protocol_name:
20996                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20997                    }),
20998                }))
20999            },
21000        )
21001    }
21002}
21003
21004#[derive(Debug)]
21005pub enum WritableRequest {
21006    /// Writes data at the seek offset.
21007    /// The seek offset is moved forward by the number of bytes written.
21008    /// If the file is in append mode, the seek offset is first set to the end
21009    /// of the file, followed by the write, in one atomic step.
21010    ///
21011    /// The file size may grow if the seek offset plus `data.length` is beyond
21012    /// the current end of file.
21013    ///
21014    /// + request `data` the byte buffer to write to the file.
21015    /// - response `actual_count` the number of bytes written.
21016    ///
21017    /// ## Invariants
21018    ///
21019    /// * The returned `actual_count` will never be greater than `data.length`.
21020    /// * If the server is unable to write all the data due to e.g. not enough
21021    ///   space, `actual_count` may be less than `data.length`.  If no bytes
21022    ///   could be written, an error is returned.
21023    /// * If `data.length` is zero, the server should perform all the checks
21024    ///   ensuring write access without mutating the file and return a
21025    ///   successful write of zero bytes.  The seek offset is still updated if
21026    ///   in append mode.
21027    ///
21028    /// This method requires the [`Rights.WRITE_BYTES`] right.
21029    Write { data: Vec<u8>, responder: WritableWriteResponder },
21030}
21031
21032impl WritableRequest {
21033    #[allow(irrefutable_let_patterns)]
21034    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
21035        if let WritableRequest::Write { data, responder } = self {
21036            Some((data, responder))
21037        } else {
21038            None
21039        }
21040    }
21041
21042    /// Name of the method defined in FIDL
21043    pub fn method_name(&self) -> &'static str {
21044        match *self {
21045            WritableRequest::Write { .. } => "write",
21046        }
21047    }
21048}
21049
21050#[derive(Debug, Clone)]
21051pub struct WritableControlHandle {
21052    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
21053}
21054
21055impl WritableControlHandle {
21056    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
21057        self.inner.shutdown_with_epitaph(status.into())
21058    }
21059}
21060
21061impl fidl::endpoints::ControlHandle for WritableControlHandle {
21062    fn shutdown(&self) {
21063        self.inner.shutdown()
21064    }
21065
21066    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
21067        self.inner.shutdown_with_epitaph(status)
21068    }
21069
21070    fn is_closed(&self) -> bool {
21071        self.inner.channel().is_closed()
21072    }
21073    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
21074        self.inner.channel().on_closed()
21075    }
21076
21077    #[cfg(target_os = "fuchsia")]
21078    fn signal_peer(
21079        &self,
21080        clear_mask: zx::Signals,
21081        set_mask: zx::Signals,
21082    ) -> Result<(), zx_status::Status> {
21083        use fidl::Peered;
21084        self.inner.channel().signal_peer(clear_mask, set_mask)
21085    }
21086}
21087
21088impl WritableControlHandle {}
21089
21090#[must_use = "FIDL methods require a response to be sent"]
21091#[derive(Debug)]
21092pub struct WritableWriteResponder {
21093    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
21094    tx_id: u32,
21095}
21096
21097/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
21098/// if the responder is dropped without sending a response, so that the client
21099/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
21100impl std::ops::Drop for WritableWriteResponder {
21101    fn drop(&mut self) {
21102        self.control_handle.shutdown();
21103        // Safety: drops once, never accessed again
21104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21105    }
21106}
21107
21108impl fidl::endpoints::Responder for WritableWriteResponder {
21109    type ControlHandle = WritableControlHandle;
21110
21111    fn control_handle(&self) -> &WritableControlHandle {
21112        &self.control_handle
21113    }
21114
21115    fn drop_without_shutdown(mut self) {
21116        // Safety: drops once, never accessed again due to mem::forget
21117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21118        // Prevent Drop from running (which would shut down the channel)
21119        std::mem::forget(self);
21120    }
21121}
21122
21123impl WritableWriteResponder {
21124    /// Sends a response to the FIDL transaction.
21125    ///
21126    /// Sets the channel to shutdown if an error occurs.
21127    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21128        let _result = self.send_raw(result);
21129        if _result.is_err() {
21130            self.control_handle.shutdown();
21131        }
21132        self.drop_without_shutdown();
21133        _result
21134    }
21135
21136    /// Similar to "send" but does not shutdown the channel if an error occurs.
21137    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21138        let _result = self.send_raw(result);
21139        self.drop_without_shutdown();
21140        _result
21141    }
21142
21143    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21144        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
21145            result.map(|actual_count| (actual_count,)),
21146            self.tx_id,
21147            0x6a31437832469f82,
21148            fidl::encoding::DynamicFlags::empty(),
21149        )
21150    }
21151}
21152
21153mod internal {
21154    use super::*;
21155
21156    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
21157        type Borrowed<'a> = &'a mut Self;
21158        fn take_or_borrow<'a>(
21159            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21160        ) -> Self::Borrowed<'a> {
21161            value
21162        }
21163    }
21164
21165    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
21166        type Owned = Self;
21167
21168        #[inline(always)]
21169        fn inline_align(_context: fidl::encoding::Context) -> usize {
21170            8
21171        }
21172
21173        #[inline(always)]
21174        fn inline_size(_context: fidl::encoding::Context) -> usize {
21175            40
21176        }
21177    }
21178
21179    unsafe impl
21180        fidl::encoding::Encode<
21181            DirectoryCreateSymlinkRequest,
21182            fidl::encoding::DefaultFuchsiaResourceDialect,
21183        > for &mut DirectoryCreateSymlinkRequest
21184    {
21185        #[inline]
21186        unsafe fn encode(
21187            self,
21188            encoder: &mut fidl::encoding::Encoder<
21189                '_,
21190                fidl::encoding::DefaultFuchsiaResourceDialect,
21191            >,
21192            offset: usize,
21193            _depth: fidl::encoding::Depth,
21194        ) -> fidl::Result<()> {
21195            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21196            // Delegate to tuple encoding.
21197            fidl::encoding::Encode::<
21198                DirectoryCreateSymlinkRequest,
21199                fidl::encoding::DefaultFuchsiaResourceDialect,
21200            >::encode(
21201                (
21202                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21203                        &self.name,
21204                    ),
21205                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
21206                        &self.target,
21207                    ),
21208                    <fidl::encoding::Optional<
21209                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21210                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21211                        &mut self.connection
21212                    ),
21213                ),
21214                encoder,
21215                offset,
21216                _depth,
21217            )
21218        }
21219    }
21220    unsafe impl<
21221        T0: fidl::encoding::Encode<
21222                fidl::encoding::BoundedString<255>,
21223                fidl::encoding::DefaultFuchsiaResourceDialect,
21224            >,
21225        T1: fidl::encoding::Encode<
21226                fidl::encoding::Vector<u8, 4095>,
21227                fidl::encoding::DefaultFuchsiaResourceDialect,
21228            >,
21229        T2: fidl::encoding::Encode<
21230                fidl::encoding::Optional<
21231                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21232                >,
21233                fidl::encoding::DefaultFuchsiaResourceDialect,
21234            >,
21235    >
21236        fidl::encoding::Encode<
21237            DirectoryCreateSymlinkRequest,
21238            fidl::encoding::DefaultFuchsiaResourceDialect,
21239        > for (T0, T1, T2)
21240    {
21241        #[inline]
21242        unsafe fn encode(
21243            self,
21244            encoder: &mut fidl::encoding::Encoder<
21245                '_,
21246                fidl::encoding::DefaultFuchsiaResourceDialect,
21247            >,
21248            offset: usize,
21249            depth: fidl::encoding::Depth,
21250        ) -> fidl::Result<()> {
21251            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21252            // Zero out padding regions. There's no need to apply masks
21253            // because the unmasked parts will be overwritten by fields.
21254            unsafe {
21255                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
21256                (ptr as *mut u64).write_unaligned(0);
21257            }
21258            // Write the fields.
21259            self.0.encode(encoder, offset + 0, depth)?;
21260            self.1.encode(encoder, offset + 16, depth)?;
21261            self.2.encode(encoder, offset + 32, depth)?;
21262            Ok(())
21263        }
21264    }
21265
21266    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21267        for DirectoryCreateSymlinkRequest
21268    {
21269        #[inline(always)]
21270        fn new_empty() -> Self {
21271            Self {
21272                name: fidl::new_empty!(
21273                    fidl::encoding::BoundedString<255>,
21274                    fidl::encoding::DefaultFuchsiaResourceDialect
21275                ),
21276                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
21277                connection: fidl::new_empty!(
21278                    fidl::encoding::Optional<
21279                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21280                    >,
21281                    fidl::encoding::DefaultFuchsiaResourceDialect
21282                ),
21283            }
21284        }
21285
21286        #[inline]
21287        unsafe fn decode(
21288            &mut self,
21289            decoder: &mut fidl::encoding::Decoder<
21290                '_,
21291                fidl::encoding::DefaultFuchsiaResourceDialect,
21292            >,
21293            offset: usize,
21294            _depth: fidl::encoding::Depth,
21295        ) -> fidl::Result<()> {
21296            decoder.debug_check_bounds::<Self>(offset);
21297            // Verify that padding bytes are zero.
21298            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
21299            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21300            let mask = 0xffffffff00000000u64;
21301            let maskedval = padval & mask;
21302            if maskedval != 0 {
21303                return Err(fidl::Error::NonZeroPadding {
21304                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
21305                });
21306            }
21307            fidl::decode!(
21308                fidl::encoding::BoundedString<255>,
21309                fidl::encoding::DefaultFuchsiaResourceDialect,
21310                &mut self.name,
21311                decoder,
21312                offset + 0,
21313                _depth
21314            )?;
21315            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
21316            fidl::decode!(
21317                fidl::encoding::Optional<
21318                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21319                >,
21320                fidl::encoding::DefaultFuchsiaResourceDialect,
21321                &mut self.connection,
21322                decoder,
21323                offset + 32,
21324                _depth
21325            )?;
21326            Ok(())
21327        }
21328    }
21329
21330    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
21331        type Borrowed<'a> = &'a mut Self;
21332        fn take_or_borrow<'a>(
21333            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21334        ) -> Self::Borrowed<'a> {
21335            value
21336        }
21337    }
21338
21339    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
21340        type Owned = Self;
21341
21342        #[inline(always)]
21343        fn inline_align(_context: fidl::encoding::Context) -> usize {
21344            8
21345        }
21346
21347        #[inline(always)]
21348        fn inline_size(_context: fidl::encoding::Context) -> usize {
21349            32
21350        }
21351    }
21352
21353    unsafe impl
21354        fidl::encoding::Encode<
21355            DirectoryDeprecatedOpenRequest,
21356            fidl::encoding::DefaultFuchsiaResourceDialect,
21357        > for &mut DirectoryDeprecatedOpenRequest
21358    {
21359        #[inline]
21360        unsafe fn encode(
21361            self,
21362            encoder: &mut fidl::encoding::Encoder<
21363                '_,
21364                fidl::encoding::DefaultFuchsiaResourceDialect,
21365            >,
21366            offset: usize,
21367            _depth: fidl::encoding::Depth,
21368        ) -> fidl::Result<()> {
21369            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21370            // Delegate to tuple encoding.
21371            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21372                (
21373                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21374                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21375                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21376                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21377                ),
21378                encoder, offset, _depth
21379            )
21380        }
21381    }
21382    unsafe impl<
21383        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21384        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
21385        T2: fidl::encoding::Encode<
21386                fidl::encoding::BoundedString<4095>,
21387                fidl::encoding::DefaultFuchsiaResourceDialect,
21388            >,
21389        T3: fidl::encoding::Encode<
21390                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21391                fidl::encoding::DefaultFuchsiaResourceDialect,
21392            >,
21393    >
21394        fidl::encoding::Encode<
21395            DirectoryDeprecatedOpenRequest,
21396            fidl::encoding::DefaultFuchsiaResourceDialect,
21397        > for (T0, T1, T2, T3)
21398    {
21399        #[inline]
21400        unsafe fn encode(
21401            self,
21402            encoder: &mut fidl::encoding::Encoder<
21403                '_,
21404                fidl::encoding::DefaultFuchsiaResourceDialect,
21405            >,
21406            offset: usize,
21407            depth: fidl::encoding::Depth,
21408        ) -> fidl::Result<()> {
21409            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21410            // Zero out padding regions. There's no need to apply masks
21411            // because the unmasked parts will be overwritten by fields.
21412            unsafe {
21413                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
21414                (ptr as *mut u64).write_unaligned(0);
21415            }
21416            // Write the fields.
21417            self.0.encode(encoder, offset + 0, depth)?;
21418            self.1.encode(encoder, offset + 4, depth)?;
21419            self.2.encode(encoder, offset + 8, depth)?;
21420            self.3.encode(encoder, offset + 24, depth)?;
21421            Ok(())
21422        }
21423    }
21424
21425    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21426        for DirectoryDeprecatedOpenRequest
21427    {
21428        #[inline(always)]
21429        fn new_empty() -> Self {
21430            Self {
21431                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
21432                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
21433                path: fidl::new_empty!(
21434                    fidl::encoding::BoundedString<4095>,
21435                    fidl::encoding::DefaultFuchsiaResourceDialect
21436                ),
21437                object: fidl::new_empty!(
21438                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21439                    fidl::encoding::DefaultFuchsiaResourceDialect
21440                ),
21441            }
21442        }
21443
21444        #[inline]
21445        unsafe fn decode(
21446            &mut self,
21447            decoder: &mut fidl::encoding::Decoder<
21448                '_,
21449                fidl::encoding::DefaultFuchsiaResourceDialect,
21450            >,
21451            offset: usize,
21452            _depth: fidl::encoding::Depth,
21453        ) -> fidl::Result<()> {
21454            decoder.debug_check_bounds::<Self>(offset);
21455            // Verify that padding bytes are zero.
21456            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
21457            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21458            let mask = 0xffffffff00000000u64;
21459            let maskedval = padval & mask;
21460            if maskedval != 0 {
21461                return Err(fidl::Error::NonZeroPadding {
21462                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
21463                });
21464            }
21465            fidl::decode!(
21466                OpenFlags,
21467                fidl::encoding::DefaultFuchsiaResourceDialect,
21468                &mut self.flags,
21469                decoder,
21470                offset + 0,
21471                _depth
21472            )?;
21473            fidl::decode!(
21474                ModeType,
21475                fidl::encoding::DefaultFuchsiaResourceDialect,
21476                &mut self.mode,
21477                decoder,
21478                offset + 4,
21479                _depth
21480            )?;
21481            fidl::decode!(
21482                fidl::encoding::BoundedString<4095>,
21483                fidl::encoding::DefaultFuchsiaResourceDialect,
21484                &mut self.path,
21485                decoder,
21486                offset + 8,
21487                _depth
21488            )?;
21489            fidl::decode!(
21490                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21491                fidl::encoding::DefaultFuchsiaResourceDialect,
21492                &mut self.object,
21493                decoder,
21494                offset + 24,
21495                _depth
21496            )?;
21497            Ok(())
21498        }
21499    }
21500
21501    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
21502        type Borrowed<'a> = &'a mut Self;
21503        fn take_or_borrow<'a>(
21504            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21505        ) -> Self::Borrowed<'a> {
21506            value
21507        }
21508    }
21509
21510    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
21511        type Owned = Self;
21512
21513        #[inline(always)]
21514        fn inline_align(_context: fidl::encoding::Context) -> usize {
21515            4
21516        }
21517
21518        #[inline(always)]
21519        fn inline_size(_context: fidl::encoding::Context) -> usize {
21520            8
21521        }
21522    }
21523
21524    unsafe impl
21525        fidl::encoding::Encode<
21526            DirectoryGetTokenResponse,
21527            fidl::encoding::DefaultFuchsiaResourceDialect,
21528        > for &mut DirectoryGetTokenResponse
21529    {
21530        #[inline]
21531        unsafe fn encode(
21532            self,
21533            encoder: &mut fidl::encoding::Encoder<
21534                '_,
21535                fidl::encoding::DefaultFuchsiaResourceDialect,
21536            >,
21537            offset: usize,
21538            _depth: fidl::encoding::Depth,
21539        ) -> fidl::Result<()> {
21540            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21541            // Delegate to tuple encoding.
21542            fidl::encoding::Encode::<
21543                DirectoryGetTokenResponse,
21544                fidl::encoding::DefaultFuchsiaResourceDialect,
21545            >::encode(
21546                (
21547                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
21548                    <fidl::encoding::Optional<
21549                        fidl::encoding::HandleType<
21550                            fidl::NullableHandle,
21551                            { fidl::ObjectType::NONE.into_raw() },
21552                            2147483648,
21553                        >,
21554                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21555                        &mut self.token
21556                    ),
21557                ),
21558                encoder,
21559                offset,
21560                _depth,
21561            )
21562        }
21563    }
21564    unsafe impl<
21565        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21566        T1: fidl::encoding::Encode<
21567                fidl::encoding::Optional<
21568                    fidl::encoding::HandleType<
21569                        fidl::NullableHandle,
21570                        { fidl::ObjectType::NONE.into_raw() },
21571                        2147483648,
21572                    >,
21573                >,
21574                fidl::encoding::DefaultFuchsiaResourceDialect,
21575            >,
21576    >
21577        fidl::encoding::Encode<
21578            DirectoryGetTokenResponse,
21579            fidl::encoding::DefaultFuchsiaResourceDialect,
21580        > for (T0, T1)
21581    {
21582        #[inline]
21583        unsafe fn encode(
21584            self,
21585            encoder: &mut fidl::encoding::Encoder<
21586                '_,
21587                fidl::encoding::DefaultFuchsiaResourceDialect,
21588            >,
21589            offset: usize,
21590            depth: fidl::encoding::Depth,
21591        ) -> fidl::Result<()> {
21592            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21593            // Zero out padding regions. There's no need to apply masks
21594            // because the unmasked parts will be overwritten by fields.
21595            // Write the fields.
21596            self.0.encode(encoder, offset + 0, depth)?;
21597            self.1.encode(encoder, offset + 4, depth)?;
21598            Ok(())
21599        }
21600    }
21601
21602    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21603        for DirectoryGetTokenResponse
21604    {
21605        #[inline(always)]
21606        fn new_empty() -> Self {
21607            Self {
21608                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
21609                token: fidl::new_empty!(
21610                    fidl::encoding::Optional<
21611                        fidl::encoding::HandleType<
21612                            fidl::NullableHandle,
21613                            { fidl::ObjectType::NONE.into_raw() },
21614                            2147483648,
21615                        >,
21616                    >,
21617                    fidl::encoding::DefaultFuchsiaResourceDialect
21618                ),
21619            }
21620        }
21621
21622        #[inline]
21623        unsafe fn decode(
21624            &mut self,
21625            decoder: &mut fidl::encoding::Decoder<
21626                '_,
21627                fidl::encoding::DefaultFuchsiaResourceDialect,
21628            >,
21629            offset: usize,
21630            _depth: fidl::encoding::Depth,
21631        ) -> fidl::Result<()> {
21632            decoder.debug_check_bounds::<Self>(offset);
21633            // Verify that padding bytes are zero.
21634            fidl::decode!(
21635                i32,
21636                fidl::encoding::DefaultFuchsiaResourceDialect,
21637                &mut self.s,
21638                decoder,
21639                offset + 0,
21640                _depth
21641            )?;
21642            fidl::decode!(
21643                fidl::encoding::Optional<
21644                    fidl::encoding::HandleType<
21645                        fidl::NullableHandle,
21646                        { fidl::ObjectType::NONE.into_raw() },
21647                        2147483648,
21648                    >,
21649                >,
21650                fidl::encoding::DefaultFuchsiaResourceDialect,
21651                &mut self.token,
21652                decoder,
21653                offset + 4,
21654                _depth
21655            )?;
21656            Ok(())
21657        }
21658    }
21659
21660    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
21661        type Borrowed<'a> = &'a mut Self;
21662        fn take_or_borrow<'a>(
21663            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21664        ) -> Self::Borrowed<'a> {
21665            value
21666        }
21667    }
21668
21669    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
21670        type Owned = Self;
21671
21672        #[inline(always)]
21673        fn inline_align(_context: fidl::encoding::Context) -> usize {
21674            8
21675        }
21676
21677        #[inline(always)]
21678        fn inline_size(_context: fidl::encoding::Context) -> usize {
21679            40
21680        }
21681    }
21682
21683    unsafe impl
21684        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21685        for &mut DirectoryLinkRequest
21686    {
21687        #[inline]
21688        unsafe fn encode(
21689            self,
21690            encoder: &mut fidl::encoding::Encoder<
21691                '_,
21692                fidl::encoding::DefaultFuchsiaResourceDialect,
21693            >,
21694            offset: usize,
21695            _depth: fidl::encoding::Depth,
21696        ) -> fidl::Result<()> {
21697            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21698            // Delegate to tuple encoding.
21699            fidl::encoding::Encode::<
21700                DirectoryLinkRequest,
21701                fidl::encoding::DefaultFuchsiaResourceDialect,
21702            >::encode(
21703                (
21704                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21705                        &self.src,
21706                    ),
21707                    <fidl::encoding::HandleType<
21708                        fidl::NullableHandle,
21709                        { fidl::ObjectType::NONE.into_raw() },
21710                        2147483648,
21711                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21712                        &mut self.dst_parent_token,
21713                    ),
21714                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21715                        &self.dst,
21716                    ),
21717                ),
21718                encoder,
21719                offset,
21720                _depth,
21721            )
21722        }
21723    }
21724    unsafe impl<
21725        T0: fidl::encoding::Encode<
21726                fidl::encoding::BoundedString<255>,
21727                fidl::encoding::DefaultFuchsiaResourceDialect,
21728            >,
21729        T1: fidl::encoding::Encode<
21730                fidl::encoding::HandleType<
21731                    fidl::NullableHandle,
21732                    { fidl::ObjectType::NONE.into_raw() },
21733                    2147483648,
21734                >,
21735                fidl::encoding::DefaultFuchsiaResourceDialect,
21736            >,
21737        T2: fidl::encoding::Encode<
21738                fidl::encoding::BoundedString<255>,
21739                fidl::encoding::DefaultFuchsiaResourceDialect,
21740            >,
21741    >
21742        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21743        for (T0, T1, T2)
21744    {
21745        #[inline]
21746        unsafe fn encode(
21747            self,
21748            encoder: &mut fidl::encoding::Encoder<
21749                '_,
21750                fidl::encoding::DefaultFuchsiaResourceDialect,
21751            >,
21752            offset: usize,
21753            depth: fidl::encoding::Depth,
21754        ) -> fidl::Result<()> {
21755            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21756            // Zero out padding regions. There's no need to apply masks
21757            // because the unmasked parts will be overwritten by fields.
21758            unsafe {
21759                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21760                (ptr as *mut u64).write_unaligned(0);
21761            }
21762            // Write the fields.
21763            self.0.encode(encoder, offset + 0, depth)?;
21764            self.1.encode(encoder, offset + 16, depth)?;
21765            self.2.encode(encoder, offset + 24, depth)?;
21766            Ok(())
21767        }
21768    }
21769
21770    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21771        for DirectoryLinkRequest
21772    {
21773        #[inline(always)]
21774        fn new_empty() -> Self {
21775            Self {
21776                src: fidl::new_empty!(
21777                    fidl::encoding::BoundedString<255>,
21778                    fidl::encoding::DefaultFuchsiaResourceDialect
21779                ),
21780                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21781                dst: fidl::new_empty!(
21782                    fidl::encoding::BoundedString<255>,
21783                    fidl::encoding::DefaultFuchsiaResourceDialect
21784                ),
21785            }
21786        }
21787
21788        #[inline]
21789        unsafe fn decode(
21790            &mut self,
21791            decoder: &mut fidl::encoding::Decoder<
21792                '_,
21793                fidl::encoding::DefaultFuchsiaResourceDialect,
21794            >,
21795            offset: usize,
21796            _depth: fidl::encoding::Depth,
21797        ) -> fidl::Result<()> {
21798            decoder.debug_check_bounds::<Self>(offset);
21799            // Verify that padding bytes are zero.
21800            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21801            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21802            let mask = 0xffffffff00000000u64;
21803            let maskedval = padval & mask;
21804            if maskedval != 0 {
21805                return Err(fidl::Error::NonZeroPadding {
21806                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21807                });
21808            }
21809            fidl::decode!(
21810                fidl::encoding::BoundedString<255>,
21811                fidl::encoding::DefaultFuchsiaResourceDialect,
21812                &mut self.src,
21813                decoder,
21814                offset + 0,
21815                _depth
21816            )?;
21817            fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21818            fidl::decode!(
21819                fidl::encoding::BoundedString<255>,
21820                fidl::encoding::DefaultFuchsiaResourceDialect,
21821                &mut self.dst,
21822                decoder,
21823                offset + 24,
21824                _depth
21825            )?;
21826            Ok(())
21827        }
21828    }
21829
21830    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21831        type Borrowed<'a> = &'a mut Self;
21832        fn take_or_borrow<'a>(
21833            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21834        ) -> Self::Borrowed<'a> {
21835            value
21836        }
21837    }
21838
21839    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21840        type Owned = Self;
21841
21842        #[inline(always)]
21843        fn inline_align(_context: fidl::encoding::Context) -> usize {
21844            8
21845        }
21846
21847        #[inline(always)]
21848        fn inline_size(_context: fidl::encoding::Context) -> usize {
21849            40
21850        }
21851    }
21852
21853    unsafe impl
21854        fidl::encoding::Encode<
21855            DirectoryRenameRequest,
21856            fidl::encoding::DefaultFuchsiaResourceDialect,
21857        > for &mut DirectoryRenameRequest
21858    {
21859        #[inline]
21860        unsafe fn encode(
21861            self,
21862            encoder: &mut fidl::encoding::Encoder<
21863                '_,
21864                fidl::encoding::DefaultFuchsiaResourceDialect,
21865            >,
21866            offset: usize,
21867            _depth: fidl::encoding::Depth,
21868        ) -> fidl::Result<()> {
21869            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21870            // Delegate to tuple encoding.
21871            fidl::encoding::Encode::<
21872                DirectoryRenameRequest,
21873                fidl::encoding::DefaultFuchsiaResourceDialect,
21874            >::encode(
21875                (
21876                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21877                        &self.src,
21878                    ),
21879                    <fidl::encoding::HandleType<
21880                        fidl::Event,
21881                        { fidl::ObjectType::EVENT.into_raw() },
21882                        2147483648,
21883                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21884                        &mut self.dst_parent_token,
21885                    ),
21886                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21887                        &self.dst,
21888                    ),
21889                ),
21890                encoder,
21891                offset,
21892                _depth,
21893            )
21894        }
21895    }
21896    unsafe impl<
21897        T0: fidl::encoding::Encode<
21898                fidl::encoding::BoundedString<255>,
21899                fidl::encoding::DefaultFuchsiaResourceDialect,
21900            >,
21901        T1: fidl::encoding::Encode<
21902                fidl::encoding::HandleType<
21903                    fidl::Event,
21904                    { fidl::ObjectType::EVENT.into_raw() },
21905                    2147483648,
21906                >,
21907                fidl::encoding::DefaultFuchsiaResourceDialect,
21908            >,
21909        T2: fidl::encoding::Encode<
21910                fidl::encoding::BoundedString<255>,
21911                fidl::encoding::DefaultFuchsiaResourceDialect,
21912            >,
21913    >
21914        fidl::encoding::Encode<
21915            DirectoryRenameRequest,
21916            fidl::encoding::DefaultFuchsiaResourceDialect,
21917        > for (T0, T1, T2)
21918    {
21919        #[inline]
21920        unsafe fn encode(
21921            self,
21922            encoder: &mut fidl::encoding::Encoder<
21923                '_,
21924                fidl::encoding::DefaultFuchsiaResourceDialect,
21925            >,
21926            offset: usize,
21927            depth: fidl::encoding::Depth,
21928        ) -> fidl::Result<()> {
21929            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21930            // Zero out padding regions. There's no need to apply masks
21931            // because the unmasked parts will be overwritten by fields.
21932            unsafe {
21933                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21934                (ptr as *mut u64).write_unaligned(0);
21935            }
21936            // Write the fields.
21937            self.0.encode(encoder, offset + 0, depth)?;
21938            self.1.encode(encoder, offset + 16, depth)?;
21939            self.2.encode(encoder, offset + 24, depth)?;
21940            Ok(())
21941        }
21942    }
21943
21944    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21945        for DirectoryRenameRequest
21946    {
21947        #[inline(always)]
21948        fn new_empty() -> Self {
21949            Self {
21950                src: fidl::new_empty!(
21951                    fidl::encoding::BoundedString<255>,
21952                    fidl::encoding::DefaultFuchsiaResourceDialect
21953                ),
21954                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21955                dst: fidl::new_empty!(
21956                    fidl::encoding::BoundedString<255>,
21957                    fidl::encoding::DefaultFuchsiaResourceDialect
21958                ),
21959            }
21960        }
21961
21962        #[inline]
21963        unsafe fn decode(
21964            &mut self,
21965            decoder: &mut fidl::encoding::Decoder<
21966                '_,
21967                fidl::encoding::DefaultFuchsiaResourceDialect,
21968            >,
21969            offset: usize,
21970            _depth: fidl::encoding::Depth,
21971        ) -> fidl::Result<()> {
21972            decoder.debug_check_bounds::<Self>(offset);
21973            // Verify that padding bytes are zero.
21974            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21975            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21976            let mask = 0xffffffff00000000u64;
21977            let maskedval = padval & mask;
21978            if maskedval != 0 {
21979                return Err(fidl::Error::NonZeroPadding {
21980                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21981                });
21982            }
21983            fidl::decode!(
21984                fidl::encoding::BoundedString<255>,
21985                fidl::encoding::DefaultFuchsiaResourceDialect,
21986                &mut self.src,
21987                decoder,
21988                offset + 0,
21989                _depth
21990            )?;
21991            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21992            fidl::decode!(
21993                fidl::encoding::BoundedString<255>,
21994                fidl::encoding::DefaultFuchsiaResourceDialect,
21995                &mut self.dst,
21996                decoder,
21997                offset + 24,
21998                _depth
21999            )?;
22000            Ok(())
22001        }
22002    }
22003
22004    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
22005        type Borrowed<'a> = &'a mut Self;
22006        fn take_or_borrow<'a>(
22007            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22008        ) -> Self::Borrowed<'a> {
22009            value
22010        }
22011    }
22012
22013    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
22014        type Owned = Self;
22015
22016        #[inline(always)]
22017        fn inline_align(_context: fidl::encoding::Context) -> usize {
22018            4
22019        }
22020
22021        #[inline(always)]
22022        fn inline_size(_context: fidl::encoding::Context) -> usize {
22023            12
22024        }
22025    }
22026
22027    unsafe impl
22028        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22029        for &mut DirectoryWatchRequest
22030    {
22031        #[inline]
22032        unsafe fn encode(
22033            self,
22034            encoder: &mut fidl::encoding::Encoder<
22035                '_,
22036                fidl::encoding::DefaultFuchsiaResourceDialect,
22037            >,
22038            offset: usize,
22039            _depth: fidl::encoding::Depth,
22040        ) -> fidl::Result<()> {
22041            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22042            // Delegate to tuple encoding.
22043            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22044                (
22045                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
22046                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
22047                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
22048                ),
22049                encoder, offset, _depth
22050            )
22051        }
22052    }
22053    unsafe impl<
22054        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
22055        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22056        T2: fidl::encoding::Encode<
22057                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22058                fidl::encoding::DefaultFuchsiaResourceDialect,
22059            >,
22060    >
22061        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22062        for (T0, T1, T2)
22063    {
22064        #[inline]
22065        unsafe fn encode(
22066            self,
22067            encoder: &mut fidl::encoding::Encoder<
22068                '_,
22069                fidl::encoding::DefaultFuchsiaResourceDialect,
22070            >,
22071            offset: usize,
22072            depth: fidl::encoding::Depth,
22073        ) -> fidl::Result<()> {
22074            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22075            // Zero out padding regions. There's no need to apply masks
22076            // because the unmasked parts will be overwritten by fields.
22077            // Write the fields.
22078            self.0.encode(encoder, offset + 0, depth)?;
22079            self.1.encode(encoder, offset + 4, depth)?;
22080            self.2.encode(encoder, offset + 8, depth)?;
22081            Ok(())
22082        }
22083    }
22084
22085    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22086        for DirectoryWatchRequest
22087    {
22088        #[inline(always)]
22089        fn new_empty() -> Self {
22090            Self {
22091                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
22092                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
22093                watcher: fidl::new_empty!(
22094                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22095                    fidl::encoding::DefaultFuchsiaResourceDialect
22096                ),
22097            }
22098        }
22099
22100        #[inline]
22101        unsafe fn decode(
22102            &mut self,
22103            decoder: &mut fidl::encoding::Decoder<
22104                '_,
22105                fidl::encoding::DefaultFuchsiaResourceDialect,
22106            >,
22107            offset: usize,
22108            _depth: fidl::encoding::Depth,
22109        ) -> fidl::Result<()> {
22110            decoder.debug_check_bounds::<Self>(offset);
22111            // Verify that padding bytes are zero.
22112            fidl::decode!(
22113                WatchMask,
22114                fidl::encoding::DefaultFuchsiaResourceDialect,
22115                &mut self.mask,
22116                decoder,
22117                offset + 0,
22118                _depth
22119            )?;
22120            fidl::decode!(
22121                u32,
22122                fidl::encoding::DefaultFuchsiaResourceDialect,
22123                &mut self.options,
22124                decoder,
22125                offset + 4,
22126                _depth
22127            )?;
22128            fidl::decode!(
22129                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22130                fidl::encoding::DefaultFuchsiaResourceDialect,
22131                &mut self.watcher,
22132                decoder,
22133                offset + 8,
22134                _depth
22135            )?;
22136            Ok(())
22137        }
22138    }
22139
22140    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
22141        type Borrowed<'a> = &'a mut Self;
22142        fn take_or_borrow<'a>(
22143            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22144        ) -> Self::Borrowed<'a> {
22145            value
22146        }
22147    }
22148
22149    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
22150        type Owned = Self;
22151
22152        #[inline(always)]
22153        fn inline_align(_context: fidl::encoding::Context) -> usize {
22154            8
22155        }
22156
22157        #[inline(always)]
22158        fn inline_size(_context: fidl::encoding::Context) -> usize {
22159            24
22160        }
22161    }
22162
22163    unsafe impl
22164        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22165        for &mut FileAllocateRequest
22166    {
22167        #[inline]
22168        unsafe fn encode(
22169            self,
22170            encoder: &mut fidl::encoding::Encoder<
22171                '_,
22172                fidl::encoding::DefaultFuchsiaResourceDialect,
22173            >,
22174            offset: usize,
22175            _depth: fidl::encoding::Depth,
22176        ) -> fidl::Result<()> {
22177            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22178            // Delegate to tuple encoding.
22179            fidl::encoding::Encode::<
22180                FileAllocateRequest,
22181                fidl::encoding::DefaultFuchsiaResourceDialect,
22182            >::encode(
22183                (
22184                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
22185                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
22186                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
22187                ),
22188                encoder,
22189                offset,
22190                _depth,
22191            )
22192        }
22193    }
22194    unsafe impl<
22195        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22196        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22197        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
22198    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22199        for (T0, T1, T2)
22200    {
22201        #[inline]
22202        unsafe fn encode(
22203            self,
22204            encoder: &mut fidl::encoding::Encoder<
22205                '_,
22206                fidl::encoding::DefaultFuchsiaResourceDialect,
22207            >,
22208            offset: usize,
22209            depth: fidl::encoding::Depth,
22210        ) -> fidl::Result<()> {
22211            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22212            // Zero out padding regions. There's no need to apply masks
22213            // because the unmasked parts will be overwritten by fields.
22214            unsafe {
22215                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22216                (ptr as *mut u64).write_unaligned(0);
22217            }
22218            // Write the fields.
22219            self.0.encode(encoder, offset + 0, depth)?;
22220            self.1.encode(encoder, offset + 8, depth)?;
22221            self.2.encode(encoder, offset + 16, depth)?;
22222            Ok(())
22223        }
22224    }
22225
22226    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22227        for FileAllocateRequest
22228    {
22229        #[inline(always)]
22230        fn new_empty() -> Self {
22231            Self {
22232                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22233                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22234                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
22235            }
22236        }
22237
22238        #[inline]
22239        unsafe fn decode(
22240            &mut self,
22241            decoder: &mut fidl::encoding::Decoder<
22242                '_,
22243                fidl::encoding::DefaultFuchsiaResourceDialect,
22244            >,
22245            offset: usize,
22246            _depth: fidl::encoding::Depth,
22247        ) -> fidl::Result<()> {
22248            decoder.debug_check_bounds::<Self>(offset);
22249            // Verify that padding bytes are zero.
22250            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22251            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22252            let mask = 0xffffffff00000000u64;
22253            let maskedval = padval & mask;
22254            if maskedval != 0 {
22255                return Err(fidl::Error::NonZeroPadding {
22256                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22257                });
22258            }
22259            fidl::decode!(
22260                u64,
22261                fidl::encoding::DefaultFuchsiaResourceDialect,
22262                &mut self.offset,
22263                decoder,
22264                offset + 0,
22265                _depth
22266            )?;
22267            fidl::decode!(
22268                u64,
22269                fidl::encoding::DefaultFuchsiaResourceDialect,
22270                &mut self.length,
22271                decoder,
22272                offset + 8,
22273                _depth
22274            )?;
22275            fidl::decode!(
22276                AllocateMode,
22277                fidl::encoding::DefaultFuchsiaResourceDialect,
22278                &mut self.mode,
22279                decoder,
22280                offset + 16,
22281                _depth
22282            )?;
22283            Ok(())
22284        }
22285    }
22286
22287    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
22288        type Borrowed<'a> = &'a mut Self;
22289        fn take_or_borrow<'a>(
22290            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22291        ) -> Self::Borrowed<'a> {
22292            value
22293        }
22294    }
22295
22296    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
22297        type Owned = Self;
22298
22299        #[inline(always)]
22300        fn inline_align(_context: fidl::encoding::Context) -> usize {
22301            8
22302        }
22303
22304        #[inline(always)]
22305        fn inline_size(_context: fidl::encoding::Context) -> usize {
22306            16
22307        }
22308    }
22309
22310    unsafe impl
22311        fidl::encoding::Encode<
22312            FileEnableVerityRequest,
22313            fidl::encoding::DefaultFuchsiaResourceDialect,
22314        > for &mut FileEnableVerityRequest
22315    {
22316        #[inline]
22317        unsafe fn encode(
22318            self,
22319            encoder: &mut fidl::encoding::Encoder<
22320                '_,
22321                fidl::encoding::DefaultFuchsiaResourceDialect,
22322            >,
22323            offset: usize,
22324            _depth: fidl::encoding::Depth,
22325        ) -> fidl::Result<()> {
22326            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22327            // Delegate to tuple encoding.
22328            fidl::encoding::Encode::<
22329                FileEnableVerityRequest,
22330                fidl::encoding::DefaultFuchsiaResourceDialect,
22331            >::encode(
22332                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
22333                encoder,
22334                offset,
22335                _depth,
22336            )
22337        }
22338    }
22339    unsafe impl<
22340        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
22341    >
22342        fidl::encoding::Encode<
22343            FileEnableVerityRequest,
22344            fidl::encoding::DefaultFuchsiaResourceDialect,
22345        > for (T0,)
22346    {
22347        #[inline]
22348        unsafe fn encode(
22349            self,
22350            encoder: &mut fidl::encoding::Encoder<
22351                '_,
22352                fidl::encoding::DefaultFuchsiaResourceDialect,
22353            >,
22354            offset: usize,
22355            depth: fidl::encoding::Depth,
22356        ) -> fidl::Result<()> {
22357            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22358            // Zero out padding regions. There's no need to apply masks
22359            // because the unmasked parts will be overwritten by fields.
22360            // Write the fields.
22361            self.0.encode(encoder, offset + 0, depth)?;
22362            Ok(())
22363        }
22364    }
22365
22366    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22367        for FileEnableVerityRequest
22368    {
22369        #[inline(always)]
22370        fn new_empty() -> Self {
22371            Self {
22372                options: fidl::new_empty!(
22373                    VerificationOptions,
22374                    fidl::encoding::DefaultFuchsiaResourceDialect
22375                ),
22376            }
22377        }
22378
22379        #[inline]
22380        unsafe fn decode(
22381            &mut self,
22382            decoder: &mut fidl::encoding::Decoder<
22383                '_,
22384                fidl::encoding::DefaultFuchsiaResourceDialect,
22385            >,
22386            offset: usize,
22387            _depth: fidl::encoding::Depth,
22388        ) -> fidl::Result<()> {
22389            decoder.debug_check_bounds::<Self>(offset);
22390            // Verify that padding bytes are zero.
22391            fidl::decode!(
22392                VerificationOptions,
22393                fidl::encoding::DefaultFuchsiaResourceDialect,
22394                &mut self.options,
22395                decoder,
22396                offset + 0,
22397                _depth
22398            )?;
22399            Ok(())
22400        }
22401    }
22402
22403    impl fidl::encoding::ResourceTypeMarker for FileObject {
22404        type Borrowed<'a> = &'a mut Self;
22405        fn take_or_borrow<'a>(
22406            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22407        ) -> Self::Borrowed<'a> {
22408            value
22409        }
22410    }
22411
22412    unsafe impl fidl::encoding::TypeMarker for FileObject {
22413        type Owned = Self;
22414
22415        #[inline(always)]
22416        fn inline_align(_context: fidl::encoding::Context) -> usize {
22417            4
22418        }
22419
22420        #[inline(always)]
22421        fn inline_size(_context: fidl::encoding::Context) -> usize {
22422            8
22423        }
22424    }
22425
22426    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22427        for &mut FileObject
22428    {
22429        #[inline]
22430        unsafe fn encode(
22431            self,
22432            encoder: &mut fidl::encoding::Encoder<
22433                '_,
22434                fidl::encoding::DefaultFuchsiaResourceDialect,
22435            >,
22436            offset: usize,
22437            _depth: fidl::encoding::Depth,
22438        ) -> fidl::Result<()> {
22439            encoder.debug_check_bounds::<FileObject>(offset);
22440            // Delegate to tuple encoding.
22441            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22442                (
22443                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
22444                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
22445                ),
22446                encoder, offset, _depth
22447            )
22448        }
22449    }
22450    unsafe impl<
22451        T0: fidl::encoding::Encode<
22452                fidl::encoding::Optional<
22453                    fidl::encoding::HandleType<
22454                        fidl::Event,
22455                        { fidl::ObjectType::EVENT.into_raw() },
22456                        2147483648,
22457                    >,
22458                >,
22459                fidl::encoding::DefaultFuchsiaResourceDialect,
22460            >,
22461        T1: fidl::encoding::Encode<
22462                fidl::encoding::Optional<
22463                    fidl::encoding::HandleType<
22464                        fidl::Stream,
22465                        { fidl::ObjectType::STREAM.into_raw() },
22466                        2147483648,
22467                    >,
22468                >,
22469                fidl::encoding::DefaultFuchsiaResourceDialect,
22470            >,
22471    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22472        for (T0, T1)
22473    {
22474        #[inline]
22475        unsafe fn encode(
22476            self,
22477            encoder: &mut fidl::encoding::Encoder<
22478                '_,
22479                fidl::encoding::DefaultFuchsiaResourceDialect,
22480            >,
22481            offset: usize,
22482            depth: fidl::encoding::Depth,
22483        ) -> fidl::Result<()> {
22484            encoder.debug_check_bounds::<FileObject>(offset);
22485            // Zero out padding regions. There's no need to apply masks
22486            // because the unmasked parts will be overwritten by fields.
22487            // Write the fields.
22488            self.0.encode(encoder, offset + 0, depth)?;
22489            self.1.encode(encoder, offset + 4, depth)?;
22490            Ok(())
22491        }
22492    }
22493
22494    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
22495        #[inline(always)]
22496        fn new_empty() -> Self {
22497            Self {
22498                event: fidl::new_empty!(
22499                    fidl::encoding::Optional<
22500                        fidl::encoding::HandleType<
22501                            fidl::Event,
22502                            { fidl::ObjectType::EVENT.into_raw() },
22503                            2147483648,
22504                        >,
22505                    >,
22506                    fidl::encoding::DefaultFuchsiaResourceDialect
22507                ),
22508                stream: fidl::new_empty!(
22509                    fidl::encoding::Optional<
22510                        fidl::encoding::HandleType<
22511                            fidl::Stream,
22512                            { fidl::ObjectType::STREAM.into_raw() },
22513                            2147483648,
22514                        >,
22515                    >,
22516                    fidl::encoding::DefaultFuchsiaResourceDialect
22517                ),
22518            }
22519        }
22520
22521        #[inline]
22522        unsafe fn decode(
22523            &mut self,
22524            decoder: &mut fidl::encoding::Decoder<
22525                '_,
22526                fidl::encoding::DefaultFuchsiaResourceDialect,
22527            >,
22528            offset: usize,
22529            _depth: fidl::encoding::Depth,
22530        ) -> fidl::Result<()> {
22531            decoder.debug_check_bounds::<Self>(offset);
22532            // Verify that padding bytes are zero.
22533            fidl::decode!(
22534                fidl::encoding::Optional<
22535                    fidl::encoding::HandleType<
22536                        fidl::Event,
22537                        { fidl::ObjectType::EVENT.into_raw() },
22538                        2147483648,
22539                    >,
22540                >,
22541                fidl::encoding::DefaultFuchsiaResourceDialect,
22542                &mut self.event,
22543                decoder,
22544                offset + 0,
22545                _depth
22546            )?;
22547            fidl::decode!(
22548                fidl::encoding::Optional<
22549                    fidl::encoding::HandleType<
22550                        fidl::Stream,
22551                        { fidl::ObjectType::STREAM.into_raw() },
22552                        2147483648,
22553                    >,
22554                >,
22555                fidl::encoding::DefaultFuchsiaResourceDialect,
22556                &mut self.stream,
22557                decoder,
22558                offset + 4,
22559                _depth
22560            )?;
22561            Ok(())
22562        }
22563    }
22564
22565    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
22566        type Borrowed<'a> = &'a mut Self;
22567        fn take_or_borrow<'a>(
22568            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22569        ) -> Self::Borrowed<'a> {
22570            value
22571        }
22572    }
22573
22574    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
22575        type Owned = Self;
22576
22577        #[inline(always)]
22578        fn inline_align(_context: fidl::encoding::Context) -> usize {
22579            4
22580        }
22581
22582        #[inline(always)]
22583        fn inline_size(_context: fidl::encoding::Context) -> usize {
22584            4
22585        }
22586    }
22587
22588    unsafe impl
22589        fidl::encoding::Encode<
22590            FileGetBackingMemoryResponse,
22591            fidl::encoding::DefaultFuchsiaResourceDialect,
22592        > for &mut FileGetBackingMemoryResponse
22593    {
22594        #[inline]
22595        unsafe fn encode(
22596            self,
22597            encoder: &mut fidl::encoding::Encoder<
22598                '_,
22599                fidl::encoding::DefaultFuchsiaResourceDialect,
22600            >,
22601            offset: usize,
22602            _depth: fidl::encoding::Depth,
22603        ) -> fidl::Result<()> {
22604            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22605            // Delegate to tuple encoding.
22606            fidl::encoding::Encode::<
22607                FileGetBackingMemoryResponse,
22608                fidl::encoding::DefaultFuchsiaResourceDialect,
22609            >::encode(
22610                (<fidl::encoding::HandleType<
22611                    fidl::Vmo,
22612                    { fidl::ObjectType::VMO.into_raw() },
22613                    2147483648,
22614                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22615                    &mut self.vmo
22616                ),),
22617                encoder,
22618                offset,
22619                _depth,
22620            )
22621        }
22622    }
22623    unsafe impl<
22624        T0: fidl::encoding::Encode<
22625                fidl::encoding::HandleType<
22626                    fidl::Vmo,
22627                    { fidl::ObjectType::VMO.into_raw() },
22628                    2147483648,
22629                >,
22630                fidl::encoding::DefaultFuchsiaResourceDialect,
22631            >,
22632    >
22633        fidl::encoding::Encode<
22634            FileGetBackingMemoryResponse,
22635            fidl::encoding::DefaultFuchsiaResourceDialect,
22636        > for (T0,)
22637    {
22638        #[inline]
22639        unsafe fn encode(
22640            self,
22641            encoder: &mut fidl::encoding::Encoder<
22642                '_,
22643                fidl::encoding::DefaultFuchsiaResourceDialect,
22644            >,
22645            offset: usize,
22646            depth: fidl::encoding::Depth,
22647        ) -> fidl::Result<()> {
22648            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22649            // Zero out padding regions. There's no need to apply masks
22650            // because the unmasked parts will be overwritten by fields.
22651            // Write the fields.
22652            self.0.encode(encoder, offset + 0, depth)?;
22653            Ok(())
22654        }
22655    }
22656
22657    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22658        for FileGetBackingMemoryResponse
22659    {
22660        #[inline(always)]
22661        fn new_empty() -> Self {
22662            Self {
22663                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22664            }
22665        }
22666
22667        #[inline]
22668        unsafe fn decode(
22669            &mut self,
22670            decoder: &mut fidl::encoding::Decoder<
22671                '_,
22672                fidl::encoding::DefaultFuchsiaResourceDialect,
22673            >,
22674            offset: usize,
22675            _depth: fidl::encoding::Depth,
22676        ) -> fidl::Result<()> {
22677            decoder.debug_check_bounds::<Self>(offset);
22678            // Verify that padding bytes are zero.
22679            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22680            Ok(())
22681        }
22682    }
22683
22684    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22685        type Borrowed<'a> = &'a mut Self;
22686        fn take_or_borrow<'a>(
22687            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22688        ) -> Self::Borrowed<'a> {
22689            value
22690        }
22691    }
22692
22693    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22694        type Owned = Self;
22695
22696        #[inline(always)]
22697        fn inline_align(_context: fidl::encoding::Context) -> usize {
22698            8
22699        }
22700
22701        #[inline(always)]
22702        fn inline_size(_context: fidl::encoding::Context) -> usize {
22703            24
22704        }
22705    }
22706
22707    unsafe impl
22708        fidl::encoding::Encode<
22709            LinkableLinkIntoRequest,
22710            fidl::encoding::DefaultFuchsiaResourceDialect,
22711        > for &mut LinkableLinkIntoRequest
22712    {
22713        #[inline]
22714        unsafe fn encode(
22715            self,
22716            encoder: &mut fidl::encoding::Encoder<
22717                '_,
22718                fidl::encoding::DefaultFuchsiaResourceDialect,
22719            >,
22720            offset: usize,
22721            _depth: fidl::encoding::Depth,
22722        ) -> fidl::Result<()> {
22723            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22724            // Delegate to tuple encoding.
22725            fidl::encoding::Encode::<
22726                LinkableLinkIntoRequest,
22727                fidl::encoding::DefaultFuchsiaResourceDialect,
22728            >::encode(
22729                (
22730                    <fidl::encoding::HandleType<
22731                        fidl::Event,
22732                        { fidl::ObjectType::EVENT.into_raw() },
22733                        2147483648,
22734                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22735                        &mut self.dst_parent_token,
22736                    ),
22737                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22738                        &self.dst,
22739                    ),
22740                ),
22741                encoder,
22742                offset,
22743                _depth,
22744            )
22745        }
22746    }
22747    unsafe impl<
22748        T0: fidl::encoding::Encode<
22749                fidl::encoding::HandleType<
22750                    fidl::Event,
22751                    { fidl::ObjectType::EVENT.into_raw() },
22752                    2147483648,
22753                >,
22754                fidl::encoding::DefaultFuchsiaResourceDialect,
22755            >,
22756        T1: fidl::encoding::Encode<
22757                fidl::encoding::BoundedString<255>,
22758                fidl::encoding::DefaultFuchsiaResourceDialect,
22759            >,
22760    >
22761        fidl::encoding::Encode<
22762            LinkableLinkIntoRequest,
22763            fidl::encoding::DefaultFuchsiaResourceDialect,
22764        > for (T0, T1)
22765    {
22766        #[inline]
22767        unsafe fn encode(
22768            self,
22769            encoder: &mut fidl::encoding::Encoder<
22770                '_,
22771                fidl::encoding::DefaultFuchsiaResourceDialect,
22772            >,
22773            offset: usize,
22774            depth: fidl::encoding::Depth,
22775        ) -> fidl::Result<()> {
22776            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22777            // Zero out padding regions. There's no need to apply masks
22778            // because the unmasked parts will be overwritten by fields.
22779            unsafe {
22780                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22781                (ptr as *mut u64).write_unaligned(0);
22782            }
22783            // Write the fields.
22784            self.0.encode(encoder, offset + 0, depth)?;
22785            self.1.encode(encoder, offset + 8, depth)?;
22786            Ok(())
22787        }
22788    }
22789
22790    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22791        for LinkableLinkIntoRequest
22792    {
22793        #[inline(always)]
22794        fn new_empty() -> Self {
22795            Self {
22796                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22797                dst: fidl::new_empty!(
22798                    fidl::encoding::BoundedString<255>,
22799                    fidl::encoding::DefaultFuchsiaResourceDialect
22800                ),
22801            }
22802        }
22803
22804        #[inline]
22805        unsafe fn decode(
22806            &mut self,
22807            decoder: &mut fidl::encoding::Decoder<
22808                '_,
22809                fidl::encoding::DefaultFuchsiaResourceDialect,
22810            >,
22811            offset: usize,
22812            _depth: fidl::encoding::Depth,
22813        ) -> fidl::Result<()> {
22814            decoder.debug_check_bounds::<Self>(offset);
22815            // Verify that padding bytes are zero.
22816            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22817            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22818            let mask = 0xffffffff00000000u64;
22819            let maskedval = padval & mask;
22820            if maskedval != 0 {
22821                return Err(fidl::Error::NonZeroPadding {
22822                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22823                });
22824            }
22825            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 0, _depth)?;
22826            fidl::decode!(
22827                fidl::encoding::BoundedString<255>,
22828                fidl::encoding::DefaultFuchsiaResourceDialect,
22829                &mut self.dst,
22830                decoder,
22831                offset + 8,
22832                _depth
22833            )?;
22834            Ok(())
22835        }
22836    }
22837
22838    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22839        type Borrowed<'a> = &'a mut Self;
22840        fn take_or_borrow<'a>(
22841            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22842        ) -> Self::Borrowed<'a> {
22843            value
22844        }
22845    }
22846
22847    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22848        type Owned = Self;
22849
22850        #[inline(always)]
22851        fn inline_align(_context: fidl::encoding::Context) -> usize {
22852            4
22853        }
22854
22855        #[inline(always)]
22856        fn inline_size(_context: fidl::encoding::Context) -> usize {
22857            8
22858        }
22859    }
22860
22861    unsafe impl
22862        fidl::encoding::Encode<
22863            NodeDeprecatedCloneRequest,
22864            fidl::encoding::DefaultFuchsiaResourceDialect,
22865        > for &mut NodeDeprecatedCloneRequest
22866    {
22867        #[inline]
22868        unsafe fn encode(
22869            self,
22870            encoder: &mut fidl::encoding::Encoder<
22871                '_,
22872                fidl::encoding::DefaultFuchsiaResourceDialect,
22873            >,
22874            offset: usize,
22875            _depth: fidl::encoding::Depth,
22876        ) -> fidl::Result<()> {
22877            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22878            // Delegate to tuple encoding.
22879            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22880                (
22881                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22882                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22883                ),
22884                encoder, offset, _depth
22885            )
22886        }
22887    }
22888    unsafe impl<
22889        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22890        T1: fidl::encoding::Encode<
22891                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22892                fidl::encoding::DefaultFuchsiaResourceDialect,
22893            >,
22894    >
22895        fidl::encoding::Encode<
22896            NodeDeprecatedCloneRequest,
22897            fidl::encoding::DefaultFuchsiaResourceDialect,
22898        > for (T0, T1)
22899    {
22900        #[inline]
22901        unsafe fn encode(
22902            self,
22903            encoder: &mut fidl::encoding::Encoder<
22904                '_,
22905                fidl::encoding::DefaultFuchsiaResourceDialect,
22906            >,
22907            offset: usize,
22908            depth: fidl::encoding::Depth,
22909        ) -> fidl::Result<()> {
22910            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22911            // Zero out padding regions. There's no need to apply masks
22912            // because the unmasked parts will be overwritten by fields.
22913            // Write the fields.
22914            self.0.encode(encoder, offset + 0, depth)?;
22915            self.1.encode(encoder, offset + 4, depth)?;
22916            Ok(())
22917        }
22918    }
22919
22920    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22921        for NodeDeprecatedCloneRequest
22922    {
22923        #[inline(always)]
22924        fn new_empty() -> Self {
22925            Self {
22926                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22927                object: fidl::new_empty!(
22928                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22929                    fidl::encoding::DefaultFuchsiaResourceDialect
22930                ),
22931            }
22932        }
22933
22934        #[inline]
22935        unsafe fn decode(
22936            &mut self,
22937            decoder: &mut fidl::encoding::Decoder<
22938                '_,
22939                fidl::encoding::DefaultFuchsiaResourceDialect,
22940            >,
22941            offset: usize,
22942            _depth: fidl::encoding::Depth,
22943        ) -> fidl::Result<()> {
22944            decoder.debug_check_bounds::<Self>(offset);
22945            // Verify that padding bytes are zero.
22946            fidl::decode!(
22947                OpenFlags,
22948                fidl::encoding::DefaultFuchsiaResourceDialect,
22949                &mut self.flags,
22950                decoder,
22951                offset + 0,
22952                _depth
22953            )?;
22954            fidl::decode!(
22955                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22956                fidl::encoding::DefaultFuchsiaResourceDialect,
22957                &mut self.object,
22958                decoder,
22959                offset + 4,
22960                _depth
22961            )?;
22962            Ok(())
22963        }
22964    }
22965
22966    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22967        type Borrowed<'a> = &'a mut Self;
22968        fn take_or_borrow<'a>(
22969            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22970        ) -> Self::Borrowed<'a> {
22971            value
22972        }
22973    }
22974
22975    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22976        type Owned = Self;
22977
22978        #[inline(always)]
22979        fn inline_align(_context: fidl::encoding::Context) -> usize {
22980            4
22981        }
22982
22983        #[inline(always)]
22984        fn inline_size(_context: fidl::encoding::Context) -> usize {
22985            4
22986        }
22987    }
22988
22989    unsafe impl
22990        fidl::encoding::Encode<
22991            NodeListExtendedAttributesRequest,
22992            fidl::encoding::DefaultFuchsiaResourceDialect,
22993        > for &mut NodeListExtendedAttributesRequest
22994    {
22995        #[inline]
22996        unsafe fn encode(
22997            self,
22998            encoder: &mut fidl::encoding::Encoder<
22999                '_,
23000                fidl::encoding::DefaultFuchsiaResourceDialect,
23001            >,
23002            offset: usize,
23003            _depth: fidl::encoding::Depth,
23004        ) -> fidl::Result<()> {
23005            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23006            // Delegate to tuple encoding.
23007            fidl::encoding::Encode::<
23008                NodeListExtendedAttributesRequest,
23009                fidl::encoding::DefaultFuchsiaResourceDialect,
23010            >::encode(
23011                (<fidl::encoding::Endpoint<
23012                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23013                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23014                    &mut self.iterator
23015                ),),
23016                encoder,
23017                offset,
23018                _depth,
23019            )
23020        }
23021    }
23022    unsafe impl<
23023        T0: fidl::encoding::Encode<
23024                fidl::encoding::Endpoint<
23025                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23026                >,
23027                fidl::encoding::DefaultFuchsiaResourceDialect,
23028            >,
23029    >
23030        fidl::encoding::Encode<
23031            NodeListExtendedAttributesRequest,
23032            fidl::encoding::DefaultFuchsiaResourceDialect,
23033        > for (T0,)
23034    {
23035        #[inline]
23036        unsafe fn encode(
23037            self,
23038            encoder: &mut fidl::encoding::Encoder<
23039                '_,
23040                fidl::encoding::DefaultFuchsiaResourceDialect,
23041            >,
23042            offset: usize,
23043            depth: fidl::encoding::Depth,
23044        ) -> fidl::Result<()> {
23045            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23046            // Zero out padding regions. There's no need to apply masks
23047            // because the unmasked parts will be overwritten by fields.
23048            // Write the fields.
23049            self.0.encode(encoder, offset + 0, depth)?;
23050            Ok(())
23051        }
23052    }
23053
23054    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23055        for NodeListExtendedAttributesRequest
23056    {
23057        #[inline(always)]
23058        fn new_empty() -> Self {
23059            Self {
23060                iterator: fidl::new_empty!(
23061                    fidl::encoding::Endpoint<
23062                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23063                    >,
23064                    fidl::encoding::DefaultFuchsiaResourceDialect
23065                ),
23066            }
23067        }
23068
23069        #[inline]
23070        unsafe fn decode(
23071            &mut self,
23072            decoder: &mut fidl::encoding::Decoder<
23073                '_,
23074                fidl::encoding::DefaultFuchsiaResourceDialect,
23075            >,
23076            offset: usize,
23077            _depth: fidl::encoding::Depth,
23078        ) -> fidl::Result<()> {
23079            decoder.debug_check_bounds::<Self>(offset);
23080            // Verify that padding bytes are zero.
23081            fidl::decode!(
23082                fidl::encoding::Endpoint<
23083                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23084                >,
23085                fidl::encoding::DefaultFuchsiaResourceDialect,
23086                &mut self.iterator,
23087                decoder,
23088                offset + 0,
23089                _depth
23090            )?;
23091            Ok(())
23092        }
23093    }
23094
23095    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
23096        type Borrowed<'a> = &'a mut Self;
23097        fn take_or_borrow<'a>(
23098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23099        ) -> Self::Borrowed<'a> {
23100            value
23101        }
23102    }
23103
23104    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
23105        type Owned = Self;
23106
23107        #[inline(always)]
23108        fn inline_align(_context: fidl::encoding::Context) -> usize {
23109            8
23110        }
23111
23112        #[inline(always)]
23113        fn inline_size(_context: fidl::encoding::Context) -> usize {
23114            24
23115        }
23116    }
23117
23118    unsafe impl
23119        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23120        for &mut NodeOnOpenRequest
23121    {
23122        #[inline]
23123        unsafe fn encode(
23124            self,
23125            encoder: &mut fidl::encoding::Encoder<
23126                '_,
23127                fidl::encoding::DefaultFuchsiaResourceDialect,
23128            >,
23129            offset: usize,
23130            _depth: fidl::encoding::Depth,
23131        ) -> fidl::Result<()> {
23132            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23133            // Delegate to tuple encoding.
23134            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23135                (
23136                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
23137                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
23138                ),
23139                encoder, offset, _depth
23140            )
23141        }
23142    }
23143    unsafe impl<
23144        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
23145        T1: fidl::encoding::Encode<
23146                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23147                fidl::encoding::DefaultFuchsiaResourceDialect,
23148            >,
23149    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23150        for (T0, T1)
23151    {
23152        #[inline]
23153        unsafe fn encode(
23154            self,
23155            encoder: &mut fidl::encoding::Encoder<
23156                '_,
23157                fidl::encoding::DefaultFuchsiaResourceDialect,
23158            >,
23159            offset: usize,
23160            depth: fidl::encoding::Depth,
23161        ) -> fidl::Result<()> {
23162            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23163            // Zero out padding regions. There's no need to apply masks
23164            // because the unmasked parts will be overwritten by fields.
23165            unsafe {
23166                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
23167                (ptr as *mut u64).write_unaligned(0);
23168            }
23169            // Write the fields.
23170            self.0.encode(encoder, offset + 0, depth)?;
23171            self.1.encode(encoder, offset + 8, depth)?;
23172            Ok(())
23173        }
23174    }
23175
23176    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23177        for NodeOnOpenRequest
23178    {
23179        #[inline(always)]
23180        fn new_empty() -> Self {
23181            Self {
23182                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
23183                info: fidl::new_empty!(
23184                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23185                    fidl::encoding::DefaultFuchsiaResourceDialect
23186                ),
23187            }
23188        }
23189
23190        #[inline]
23191        unsafe fn decode(
23192            &mut self,
23193            decoder: &mut fidl::encoding::Decoder<
23194                '_,
23195                fidl::encoding::DefaultFuchsiaResourceDialect,
23196            >,
23197            offset: usize,
23198            _depth: fidl::encoding::Depth,
23199        ) -> fidl::Result<()> {
23200            decoder.debug_check_bounds::<Self>(offset);
23201            // Verify that padding bytes are zero.
23202            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
23203            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23204            let mask = 0xffffffff00000000u64;
23205            let maskedval = padval & mask;
23206            if maskedval != 0 {
23207                return Err(fidl::Error::NonZeroPadding {
23208                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
23209                });
23210            }
23211            fidl::decode!(
23212                i32,
23213                fidl::encoding::DefaultFuchsiaResourceDialect,
23214                &mut self.s,
23215                decoder,
23216                offset + 0,
23217                _depth
23218            )?;
23219            fidl::decode!(
23220                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23221                fidl::encoding::DefaultFuchsiaResourceDialect,
23222                &mut self.info,
23223                decoder,
23224                offset + 8,
23225                _depth
23226            )?;
23227            Ok(())
23228        }
23229    }
23230
23231    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
23232        type Borrowed<'a> = &'a mut Self;
23233        fn take_or_borrow<'a>(
23234            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23235        ) -> Self::Borrowed<'a> {
23236            value
23237        }
23238    }
23239
23240    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
23241        type Owned = Self;
23242
23243        #[inline(always)]
23244        fn inline_align(_context: fidl::encoding::Context) -> usize {
23245            8
23246        }
23247
23248        #[inline(always)]
23249        fn inline_size(_context: fidl::encoding::Context) -> usize {
23250            40
23251        }
23252    }
23253
23254    unsafe impl
23255        fidl::encoding::Encode<
23256            NodeSetExtendedAttributeRequest,
23257            fidl::encoding::DefaultFuchsiaResourceDialect,
23258        > for &mut NodeSetExtendedAttributeRequest
23259    {
23260        #[inline]
23261        unsafe fn encode(
23262            self,
23263            encoder: &mut fidl::encoding::Encoder<
23264                '_,
23265                fidl::encoding::DefaultFuchsiaResourceDialect,
23266            >,
23267            offset: usize,
23268            _depth: fidl::encoding::Depth,
23269        ) -> fidl::Result<()> {
23270            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23271            // Delegate to tuple encoding.
23272            fidl::encoding::Encode::<
23273                NodeSetExtendedAttributeRequest,
23274                fidl::encoding::DefaultFuchsiaResourceDialect,
23275            >::encode(
23276                (
23277                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
23278                        &self.name,
23279                    ),
23280                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23281                        &mut self.value,
23282                    ),
23283                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
23284                        &self.mode,
23285                    ),
23286                ),
23287                encoder,
23288                offset,
23289                _depth,
23290            )
23291        }
23292    }
23293    unsafe impl<
23294        T0: fidl::encoding::Encode<
23295                fidl::encoding::Vector<u8, 255>,
23296                fidl::encoding::DefaultFuchsiaResourceDialect,
23297            >,
23298        T1: fidl::encoding::Encode<
23299                ExtendedAttributeValue,
23300                fidl::encoding::DefaultFuchsiaResourceDialect,
23301            >,
23302        T2: fidl::encoding::Encode<
23303                SetExtendedAttributeMode,
23304                fidl::encoding::DefaultFuchsiaResourceDialect,
23305            >,
23306    >
23307        fidl::encoding::Encode<
23308            NodeSetExtendedAttributeRequest,
23309            fidl::encoding::DefaultFuchsiaResourceDialect,
23310        > for (T0, T1, T2)
23311    {
23312        #[inline]
23313        unsafe fn encode(
23314            self,
23315            encoder: &mut fidl::encoding::Encoder<
23316                '_,
23317                fidl::encoding::DefaultFuchsiaResourceDialect,
23318            >,
23319            offset: usize,
23320            depth: fidl::encoding::Depth,
23321        ) -> fidl::Result<()> {
23322            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23323            // Zero out padding regions. There's no need to apply masks
23324            // because the unmasked parts will be overwritten by fields.
23325            unsafe {
23326                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
23327                (ptr as *mut u64).write_unaligned(0);
23328            }
23329            // Write the fields.
23330            self.0.encode(encoder, offset + 0, depth)?;
23331            self.1.encode(encoder, offset + 16, depth)?;
23332            self.2.encode(encoder, offset + 32, depth)?;
23333            Ok(())
23334        }
23335    }
23336
23337    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23338        for NodeSetExtendedAttributeRequest
23339    {
23340        #[inline(always)]
23341        fn new_empty() -> Self {
23342            Self {
23343                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
23344                value: fidl::new_empty!(
23345                    ExtendedAttributeValue,
23346                    fidl::encoding::DefaultFuchsiaResourceDialect
23347                ),
23348                mode: fidl::new_empty!(
23349                    SetExtendedAttributeMode,
23350                    fidl::encoding::DefaultFuchsiaResourceDialect
23351                ),
23352            }
23353        }
23354
23355        #[inline]
23356        unsafe fn decode(
23357            &mut self,
23358            decoder: &mut fidl::encoding::Decoder<
23359                '_,
23360                fidl::encoding::DefaultFuchsiaResourceDialect,
23361            >,
23362            offset: usize,
23363            _depth: fidl::encoding::Depth,
23364        ) -> fidl::Result<()> {
23365            decoder.debug_check_bounds::<Self>(offset);
23366            // Verify that padding bytes are zero.
23367            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
23368            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23369            let mask = 0xffffffff00000000u64;
23370            let maskedval = padval & mask;
23371            if maskedval != 0 {
23372                return Err(fidl::Error::NonZeroPadding {
23373                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
23374                });
23375            }
23376            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
23377            fidl::decode!(
23378                ExtendedAttributeValue,
23379                fidl::encoding::DefaultFuchsiaResourceDialect,
23380                &mut self.value,
23381                decoder,
23382                offset + 16,
23383                _depth
23384            )?;
23385            fidl::decode!(
23386                SetExtendedAttributeMode,
23387                fidl::encoding::DefaultFuchsiaResourceDialect,
23388                &mut self.mode,
23389                decoder,
23390                offset + 32,
23391                _depth
23392            )?;
23393            Ok(())
23394        }
23395    }
23396
23397    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
23398        type Borrowed<'a> = &'a mut Self;
23399        fn take_or_borrow<'a>(
23400            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23401        ) -> Self::Borrowed<'a> {
23402            value
23403        }
23404    }
23405
23406    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
23407        type Owned = Self;
23408
23409        #[inline(always)]
23410        fn inline_align(_context: fidl::encoding::Context) -> usize {
23411            8
23412        }
23413
23414        #[inline(always)]
23415        fn inline_size(_context: fidl::encoding::Context) -> usize {
23416            48
23417        }
23418    }
23419
23420    unsafe impl
23421        fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23422        for &mut OpenableOpenRequest
23423    {
23424        #[inline]
23425        unsafe fn encode(
23426            self,
23427            encoder: &mut fidl::encoding::Encoder<
23428                '_,
23429                fidl::encoding::DefaultFuchsiaResourceDialect,
23430            >,
23431            offset: usize,
23432            _depth: fidl::encoding::Depth,
23433        ) -> fidl::Result<()> {
23434            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23435            // Delegate to tuple encoding.
23436            fidl::encoding::Encode::<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23437                (
23438                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
23439                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
23440                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
23441                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
23442                ),
23443                encoder, offset, _depth
23444            )
23445        }
23446    }
23447    unsafe impl<
23448        T0: fidl::encoding::Encode<
23449                fidl::encoding::BoundedString<4095>,
23450                fidl::encoding::DefaultFuchsiaResourceDialect,
23451            >,
23452        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
23453        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
23454        T3: fidl::encoding::Encode<
23455                fidl::encoding::HandleType<
23456                    fidl::Channel,
23457                    { fidl::ObjectType::CHANNEL.into_raw() },
23458                    2147483648,
23459                >,
23460                fidl::encoding::DefaultFuchsiaResourceDialect,
23461            >,
23462    > fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23463        for (T0, T1, T2, T3)
23464    {
23465        #[inline]
23466        unsafe fn encode(
23467            self,
23468            encoder: &mut fidl::encoding::Encoder<
23469                '_,
23470                fidl::encoding::DefaultFuchsiaResourceDialect,
23471            >,
23472            offset: usize,
23473            depth: fidl::encoding::Depth,
23474        ) -> fidl::Result<()> {
23475            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23476            // Zero out padding regions. There's no need to apply masks
23477            // because the unmasked parts will be overwritten by fields.
23478            unsafe {
23479                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
23480                (ptr as *mut u64).write_unaligned(0);
23481            }
23482            // Write the fields.
23483            self.0.encode(encoder, offset + 0, depth)?;
23484            self.1.encode(encoder, offset + 16, depth)?;
23485            self.2.encode(encoder, offset + 24, depth)?;
23486            self.3.encode(encoder, offset + 40, depth)?;
23487            Ok(())
23488        }
23489    }
23490
23491    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23492        for OpenableOpenRequest
23493    {
23494        #[inline(always)]
23495        fn new_empty() -> Self {
23496            Self {
23497                path: fidl::new_empty!(
23498                    fidl::encoding::BoundedString<4095>,
23499                    fidl::encoding::DefaultFuchsiaResourceDialect
23500                ),
23501                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
23502                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
23503                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23504            }
23505        }
23506
23507        #[inline]
23508        unsafe fn decode(
23509            &mut self,
23510            decoder: &mut fidl::encoding::Decoder<
23511                '_,
23512                fidl::encoding::DefaultFuchsiaResourceDialect,
23513            >,
23514            offset: usize,
23515            _depth: fidl::encoding::Depth,
23516        ) -> fidl::Result<()> {
23517            decoder.debug_check_bounds::<Self>(offset);
23518            // Verify that padding bytes are zero.
23519            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
23520            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23521            let mask = 0xffffffff00000000u64;
23522            let maskedval = padval & mask;
23523            if maskedval != 0 {
23524                return Err(fidl::Error::NonZeroPadding {
23525                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
23526                });
23527            }
23528            fidl::decode!(
23529                fidl::encoding::BoundedString<4095>,
23530                fidl::encoding::DefaultFuchsiaResourceDialect,
23531                &mut self.path,
23532                decoder,
23533                offset + 0,
23534                _depth
23535            )?;
23536            fidl::decode!(
23537                Flags,
23538                fidl::encoding::DefaultFuchsiaResourceDialect,
23539                &mut self.flags,
23540                decoder,
23541                offset + 16,
23542                _depth
23543            )?;
23544            fidl::decode!(
23545                Options,
23546                fidl::encoding::DefaultFuchsiaResourceDialect,
23547                &mut self.options,
23548                decoder,
23549                offset + 24,
23550                _depth
23551            )?;
23552            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
23553            Ok(())
23554        }
23555    }
23556
23557    impl ConnectionInfo {
23558        #[inline(always)]
23559        fn max_ordinal_present(&self) -> u64 {
23560            if let Some(_) = self.rights {
23561                return 1;
23562            }
23563            0
23564        }
23565    }
23566
23567    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
23568        type Borrowed<'a> = &'a mut Self;
23569        fn take_or_borrow<'a>(
23570            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23571        ) -> Self::Borrowed<'a> {
23572            value
23573        }
23574    }
23575
23576    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
23577        type Owned = Self;
23578
23579        #[inline(always)]
23580        fn inline_align(_context: fidl::encoding::Context) -> usize {
23581            8
23582        }
23583
23584        #[inline(always)]
23585        fn inline_size(_context: fidl::encoding::Context) -> usize {
23586            16
23587        }
23588    }
23589
23590    unsafe impl
23591        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23592        for &mut ConnectionInfo
23593    {
23594        unsafe fn encode(
23595            self,
23596            encoder: &mut fidl::encoding::Encoder<
23597                '_,
23598                fidl::encoding::DefaultFuchsiaResourceDialect,
23599            >,
23600            offset: usize,
23601            mut depth: fidl::encoding::Depth,
23602        ) -> fidl::Result<()> {
23603            encoder.debug_check_bounds::<ConnectionInfo>(offset);
23604            // Vector header
23605            let max_ordinal: u64 = self.max_ordinal_present();
23606            encoder.write_num(max_ordinal, offset);
23607            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23608            // Calling encoder.out_of_line_offset(0) is not allowed.
23609            if max_ordinal == 0 {
23610                return Ok(());
23611            }
23612            depth.increment()?;
23613            let envelope_size = 8;
23614            let bytes_len = max_ordinal as usize * envelope_size;
23615            #[allow(unused_variables)]
23616            let offset = encoder.out_of_line_offset(bytes_len);
23617            let mut _prev_end_offset: usize = 0;
23618            if 1 > max_ordinal {
23619                return Ok(());
23620            }
23621
23622            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23623            // are envelope_size bytes.
23624            let cur_offset: usize = (1 - 1) * envelope_size;
23625
23626            // Zero reserved fields.
23627            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23628
23629            // Safety:
23630            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23631            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23632            //   envelope_size bytes, there is always sufficient room.
23633            fidl::encoding::encode_in_envelope_optional::<
23634                Operations,
23635                fidl::encoding::DefaultFuchsiaResourceDialect,
23636            >(
23637                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
23638                encoder,
23639                offset + cur_offset,
23640                depth,
23641            )?;
23642
23643            _prev_end_offset = cur_offset + envelope_size;
23644
23645            Ok(())
23646        }
23647    }
23648
23649    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23650        for ConnectionInfo
23651    {
23652        #[inline(always)]
23653        fn new_empty() -> Self {
23654            Self::default()
23655        }
23656
23657        unsafe fn decode(
23658            &mut self,
23659            decoder: &mut fidl::encoding::Decoder<
23660                '_,
23661                fidl::encoding::DefaultFuchsiaResourceDialect,
23662            >,
23663            offset: usize,
23664            mut depth: fidl::encoding::Depth,
23665        ) -> fidl::Result<()> {
23666            decoder.debug_check_bounds::<Self>(offset);
23667            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23668                None => return Err(fidl::Error::NotNullable),
23669                Some(len) => len,
23670            };
23671            // Calling decoder.out_of_line_offset(0) is not allowed.
23672            if len == 0 {
23673                return Ok(());
23674            };
23675            depth.increment()?;
23676            let envelope_size = 8;
23677            let bytes_len = len * envelope_size;
23678            let offset = decoder.out_of_line_offset(bytes_len)?;
23679            // Decode the envelope for each type.
23680            let mut _next_ordinal_to_read = 0;
23681            let mut next_offset = offset;
23682            let end_offset = offset + bytes_len;
23683            _next_ordinal_to_read += 1;
23684            if next_offset >= end_offset {
23685                return Ok(());
23686            }
23687
23688            // Decode unknown envelopes for gaps in ordinals.
23689            while _next_ordinal_to_read < 1 {
23690                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23691                _next_ordinal_to_read += 1;
23692                next_offset += envelope_size;
23693            }
23694
23695            let next_out_of_line = decoder.next_out_of_line();
23696            let handles_before = decoder.remaining_handles();
23697            if let Some((inlined, num_bytes, num_handles)) =
23698                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23699            {
23700                let member_inline_size =
23701                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23702                if inlined != (member_inline_size <= 4) {
23703                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23704                }
23705                let inner_offset;
23706                let mut inner_depth = depth.clone();
23707                if inlined {
23708                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23709                    inner_offset = next_offset;
23710                } else {
23711                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23712                    inner_depth.increment()?;
23713                }
23714                let val_ref = self.rights.get_or_insert_with(|| {
23715                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
23716                });
23717                fidl::decode!(
23718                    Operations,
23719                    fidl::encoding::DefaultFuchsiaResourceDialect,
23720                    val_ref,
23721                    decoder,
23722                    inner_offset,
23723                    inner_depth
23724                )?;
23725                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23726                {
23727                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23728                }
23729                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23730                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23731                }
23732            }
23733
23734            next_offset += envelope_size;
23735
23736            // Decode the remaining unknown envelopes.
23737            while next_offset < end_offset {
23738                _next_ordinal_to_read += 1;
23739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23740                next_offset += envelope_size;
23741            }
23742
23743            Ok(())
23744        }
23745    }
23746
23747    impl FileInfo {
23748        #[inline(always)]
23749        fn max_ordinal_present(&self) -> u64 {
23750            if let Some(_) = self.attributes {
23751                return 4;
23752            }
23753            if let Some(_) = self.stream {
23754                return 3;
23755            }
23756            if let Some(_) = self.observer {
23757                return 2;
23758            }
23759            if let Some(_) = self.is_append {
23760                return 1;
23761            }
23762            0
23763        }
23764    }
23765
23766    impl fidl::encoding::ResourceTypeMarker for FileInfo {
23767        type Borrowed<'a> = &'a mut Self;
23768        fn take_or_borrow<'a>(
23769            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23770        ) -> Self::Borrowed<'a> {
23771            value
23772        }
23773    }
23774
23775    unsafe impl fidl::encoding::TypeMarker for FileInfo {
23776        type Owned = Self;
23777
23778        #[inline(always)]
23779        fn inline_align(_context: fidl::encoding::Context) -> usize {
23780            8
23781        }
23782
23783        #[inline(always)]
23784        fn inline_size(_context: fidl::encoding::Context) -> usize {
23785            16
23786        }
23787    }
23788
23789    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23790        for &mut FileInfo
23791    {
23792        unsafe fn encode(
23793            self,
23794            encoder: &mut fidl::encoding::Encoder<
23795                '_,
23796                fidl::encoding::DefaultFuchsiaResourceDialect,
23797            >,
23798            offset: usize,
23799            mut depth: fidl::encoding::Depth,
23800        ) -> fidl::Result<()> {
23801            encoder.debug_check_bounds::<FileInfo>(offset);
23802            // Vector header
23803            let max_ordinal: u64 = self.max_ordinal_present();
23804            encoder.write_num(max_ordinal, offset);
23805            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23806            // Calling encoder.out_of_line_offset(0) is not allowed.
23807            if max_ordinal == 0 {
23808                return Ok(());
23809            }
23810            depth.increment()?;
23811            let envelope_size = 8;
23812            let bytes_len = max_ordinal as usize * envelope_size;
23813            #[allow(unused_variables)]
23814            let offset = encoder.out_of_line_offset(bytes_len);
23815            let mut _prev_end_offset: usize = 0;
23816            if 1 > max_ordinal {
23817                return Ok(());
23818            }
23819
23820            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23821            // are envelope_size bytes.
23822            let cur_offset: usize = (1 - 1) * envelope_size;
23823
23824            // Zero reserved fields.
23825            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23826
23827            // Safety:
23828            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23829            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23830            //   envelope_size bytes, there is always sufficient room.
23831            fidl::encoding::encode_in_envelope_optional::<
23832                bool,
23833                fidl::encoding::DefaultFuchsiaResourceDialect,
23834            >(
23835                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23836                encoder,
23837                offset + cur_offset,
23838                depth,
23839            )?;
23840
23841            _prev_end_offset = cur_offset + envelope_size;
23842            if 2 > max_ordinal {
23843                return Ok(());
23844            }
23845
23846            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23847            // are envelope_size bytes.
23848            let cur_offset: usize = (2 - 1) * envelope_size;
23849
23850            // Zero reserved fields.
23851            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23852
23853            // Safety:
23854            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23855            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23856            //   envelope_size bytes, there is always sufficient room.
23857            fidl::encoding::encode_in_envelope_optional::<
23858                fidl::encoding::HandleType<
23859                    fidl::Event,
23860                    { fidl::ObjectType::EVENT.into_raw() },
23861                    2147483648,
23862                >,
23863                fidl::encoding::DefaultFuchsiaResourceDialect,
23864            >(
23865                self.observer.as_mut().map(
23866                    <fidl::encoding::HandleType<
23867                        fidl::Event,
23868                        { fidl::ObjectType::EVENT.into_raw() },
23869                        2147483648,
23870                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23871                ),
23872                encoder,
23873                offset + cur_offset,
23874                depth,
23875            )?;
23876
23877            _prev_end_offset = cur_offset + envelope_size;
23878            if 3 > max_ordinal {
23879                return Ok(());
23880            }
23881
23882            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23883            // are envelope_size bytes.
23884            let cur_offset: usize = (3 - 1) * envelope_size;
23885
23886            // Zero reserved fields.
23887            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23888
23889            // Safety:
23890            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23891            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23892            //   envelope_size bytes, there is always sufficient room.
23893            fidl::encoding::encode_in_envelope_optional::<
23894                fidl::encoding::HandleType<
23895                    fidl::Stream,
23896                    { fidl::ObjectType::STREAM.into_raw() },
23897                    2147483648,
23898                >,
23899                fidl::encoding::DefaultFuchsiaResourceDialect,
23900            >(
23901                self.stream.as_mut().map(
23902                    <fidl::encoding::HandleType<
23903                        fidl::Stream,
23904                        { fidl::ObjectType::STREAM.into_raw() },
23905                        2147483648,
23906                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23907                ),
23908                encoder,
23909                offset + cur_offset,
23910                depth,
23911            )?;
23912
23913            _prev_end_offset = cur_offset + envelope_size;
23914            if 4 > max_ordinal {
23915                return Ok(());
23916            }
23917
23918            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23919            // are envelope_size bytes.
23920            let cur_offset: usize = (4 - 1) * envelope_size;
23921
23922            // Zero reserved fields.
23923            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23924
23925            // Safety:
23926            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23927            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23928            //   envelope_size bytes, there is always sufficient room.
23929            fidl::encoding::encode_in_envelope_optional::<
23930                NodeAttributes2,
23931                fidl::encoding::DefaultFuchsiaResourceDialect,
23932            >(
23933                self.attributes
23934                    .as_ref()
23935                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23936                encoder,
23937                offset + cur_offset,
23938                depth,
23939            )?;
23940
23941            _prev_end_offset = cur_offset + envelope_size;
23942
23943            Ok(())
23944        }
23945    }
23946
23947    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23948        #[inline(always)]
23949        fn new_empty() -> Self {
23950            Self::default()
23951        }
23952
23953        unsafe fn decode(
23954            &mut self,
23955            decoder: &mut fidl::encoding::Decoder<
23956                '_,
23957                fidl::encoding::DefaultFuchsiaResourceDialect,
23958            >,
23959            offset: usize,
23960            mut depth: fidl::encoding::Depth,
23961        ) -> fidl::Result<()> {
23962            decoder.debug_check_bounds::<Self>(offset);
23963            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23964                None => return Err(fidl::Error::NotNullable),
23965                Some(len) => len,
23966            };
23967            // Calling decoder.out_of_line_offset(0) is not allowed.
23968            if len == 0 {
23969                return Ok(());
23970            };
23971            depth.increment()?;
23972            let envelope_size = 8;
23973            let bytes_len = len * envelope_size;
23974            let offset = decoder.out_of_line_offset(bytes_len)?;
23975            // Decode the envelope for each type.
23976            let mut _next_ordinal_to_read = 0;
23977            let mut next_offset = offset;
23978            let end_offset = offset + bytes_len;
23979            _next_ordinal_to_read += 1;
23980            if next_offset >= end_offset {
23981                return Ok(());
23982            }
23983
23984            // Decode unknown envelopes for gaps in ordinals.
23985            while _next_ordinal_to_read < 1 {
23986                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23987                _next_ordinal_to_read += 1;
23988                next_offset += envelope_size;
23989            }
23990
23991            let next_out_of_line = decoder.next_out_of_line();
23992            let handles_before = decoder.remaining_handles();
23993            if let Some((inlined, num_bytes, num_handles)) =
23994                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23995            {
23996                let member_inline_size =
23997                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23998                if inlined != (member_inline_size <= 4) {
23999                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24000                }
24001                let inner_offset;
24002                let mut inner_depth = depth.clone();
24003                if inlined {
24004                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24005                    inner_offset = next_offset;
24006                } else {
24007                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24008                    inner_depth.increment()?;
24009                }
24010                let val_ref = self.is_append.get_or_insert_with(|| {
24011                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
24012                });
24013                fidl::decode!(
24014                    bool,
24015                    fidl::encoding::DefaultFuchsiaResourceDialect,
24016                    val_ref,
24017                    decoder,
24018                    inner_offset,
24019                    inner_depth
24020                )?;
24021                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24022                {
24023                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24024                }
24025                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24026                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24027                }
24028            }
24029
24030            next_offset += envelope_size;
24031            _next_ordinal_to_read += 1;
24032            if next_offset >= end_offset {
24033                return Ok(());
24034            }
24035
24036            // Decode unknown envelopes for gaps in ordinals.
24037            while _next_ordinal_to_read < 2 {
24038                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24039                _next_ordinal_to_read += 1;
24040                next_offset += envelope_size;
24041            }
24042
24043            let next_out_of_line = decoder.next_out_of_line();
24044            let handles_before = decoder.remaining_handles();
24045            if let Some((inlined, num_bytes, num_handles)) =
24046                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24047            {
24048                let member_inline_size = <fidl::encoding::HandleType<
24049                    fidl::Event,
24050                    { fidl::ObjectType::EVENT.into_raw() },
24051                    2147483648,
24052                > as fidl::encoding::TypeMarker>::inline_size(
24053                    decoder.context
24054                );
24055                if inlined != (member_inline_size <= 4) {
24056                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24057                }
24058                let inner_offset;
24059                let mut inner_depth = depth.clone();
24060                if inlined {
24061                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24062                    inner_offset = next_offset;
24063                } else {
24064                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24065                    inner_depth.increment()?;
24066                }
24067                let val_ref =
24068                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24069                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24071                {
24072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24073                }
24074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24076                }
24077            }
24078
24079            next_offset += envelope_size;
24080            _next_ordinal_to_read += 1;
24081            if next_offset >= end_offset {
24082                return Ok(());
24083            }
24084
24085            // Decode unknown envelopes for gaps in ordinals.
24086            while _next_ordinal_to_read < 3 {
24087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24088                _next_ordinal_to_read += 1;
24089                next_offset += envelope_size;
24090            }
24091
24092            let next_out_of_line = decoder.next_out_of_line();
24093            let handles_before = decoder.remaining_handles();
24094            if let Some((inlined, num_bytes, num_handles)) =
24095                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24096            {
24097                let member_inline_size = <fidl::encoding::HandleType<
24098                    fidl::Stream,
24099                    { fidl::ObjectType::STREAM.into_raw() },
24100                    2147483648,
24101                > as fidl::encoding::TypeMarker>::inline_size(
24102                    decoder.context
24103                );
24104                if inlined != (member_inline_size <= 4) {
24105                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24106                }
24107                let inner_offset;
24108                let mut inner_depth = depth.clone();
24109                if inlined {
24110                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24111                    inner_offset = next_offset;
24112                } else {
24113                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24114                    inner_depth.increment()?;
24115                }
24116                let val_ref =
24117                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24118                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24119                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24120                {
24121                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24122                }
24123                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24124                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24125                }
24126            }
24127
24128            next_offset += envelope_size;
24129            _next_ordinal_to_read += 1;
24130            if next_offset >= end_offset {
24131                return Ok(());
24132            }
24133
24134            // Decode unknown envelopes for gaps in ordinals.
24135            while _next_ordinal_to_read < 4 {
24136                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24137                _next_ordinal_to_read += 1;
24138                next_offset += envelope_size;
24139            }
24140
24141            let next_out_of_line = decoder.next_out_of_line();
24142            let handles_before = decoder.remaining_handles();
24143            if let Some((inlined, num_bytes, num_handles)) =
24144                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24145            {
24146                let member_inline_size =
24147                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24148                if inlined != (member_inline_size <= 4) {
24149                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24150                }
24151                let inner_offset;
24152                let mut inner_depth = depth.clone();
24153                if inlined {
24154                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24155                    inner_offset = next_offset;
24156                } else {
24157                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24158                    inner_depth.increment()?;
24159                }
24160                let val_ref = self.attributes.get_or_insert_with(|| {
24161                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
24162                });
24163                fidl::decode!(
24164                    NodeAttributes2,
24165                    fidl::encoding::DefaultFuchsiaResourceDialect,
24166                    val_ref,
24167                    decoder,
24168                    inner_offset,
24169                    inner_depth
24170                )?;
24171                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24172                {
24173                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24174                }
24175                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24176                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24177                }
24178            }
24179
24180            next_offset += envelope_size;
24181
24182            // Decode the remaining unknown envelopes.
24183            while next_offset < end_offset {
24184                _next_ordinal_to_read += 1;
24185                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24186                next_offset += envelope_size;
24187            }
24188
24189            Ok(())
24190        }
24191    }
24192
24193    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
24194        type Borrowed<'a> = &'a mut Self;
24195        fn take_or_borrow<'a>(
24196            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24197        ) -> Self::Borrowed<'a> {
24198            value
24199        }
24200    }
24201
24202    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
24203        type Owned = Self;
24204
24205        #[inline(always)]
24206        fn inline_align(_context: fidl::encoding::Context) -> usize {
24207            8
24208        }
24209
24210        #[inline(always)]
24211        fn inline_size(_context: fidl::encoding::Context) -> usize {
24212            16
24213        }
24214    }
24215
24216    unsafe impl
24217        fidl::encoding::Encode<
24218            ExtendedAttributeValue,
24219            fidl::encoding::DefaultFuchsiaResourceDialect,
24220        > for &mut ExtendedAttributeValue
24221    {
24222        #[inline]
24223        unsafe fn encode(
24224            self,
24225            encoder: &mut fidl::encoding::Encoder<
24226                '_,
24227                fidl::encoding::DefaultFuchsiaResourceDialect,
24228            >,
24229            offset: usize,
24230            _depth: fidl::encoding::Depth,
24231        ) -> fidl::Result<()> {
24232            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
24233            encoder.write_num::<u64>(self.ordinal(), offset);
24234            match self {
24235                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
24236                    fidl::encoding::Vector<u8, 32768>,
24237                    fidl::encoding::DefaultFuchsiaResourceDialect,
24238                >(
24239                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
24240                        val,
24241                    ),
24242                    encoder,
24243                    offset + 8,
24244                    _depth,
24245                ),
24246                ExtendedAttributeValue::Buffer(ref mut val) => {
24247                    fidl::encoding::encode_in_envelope::<
24248                        fidl::encoding::HandleType<
24249                            fidl::Vmo,
24250                            { fidl::ObjectType::VMO.into_raw() },
24251                            2147483648,
24252                        >,
24253                        fidl::encoding::DefaultFuchsiaResourceDialect,
24254                    >(
24255                        <fidl::encoding::HandleType<
24256                            fidl::Vmo,
24257                            { fidl::ObjectType::VMO.into_raw() },
24258                            2147483648,
24259                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
24260                            val
24261                        ),
24262                        encoder,
24263                        offset + 8,
24264                        _depth,
24265                    )
24266                }
24267                ExtendedAttributeValue::__SourceBreaking { .. } => {
24268                    Err(fidl::Error::UnknownUnionTag)
24269                }
24270            }
24271        }
24272    }
24273
24274    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24275        for ExtendedAttributeValue
24276    {
24277        #[inline(always)]
24278        fn new_empty() -> Self {
24279            Self::__SourceBreaking { unknown_ordinal: 0 }
24280        }
24281
24282        #[inline]
24283        unsafe fn decode(
24284            &mut self,
24285            decoder: &mut fidl::encoding::Decoder<
24286                '_,
24287                fidl::encoding::DefaultFuchsiaResourceDialect,
24288            >,
24289            offset: usize,
24290            mut depth: fidl::encoding::Depth,
24291        ) -> fidl::Result<()> {
24292            decoder.debug_check_bounds::<Self>(offset);
24293            #[allow(unused_variables)]
24294            let next_out_of_line = decoder.next_out_of_line();
24295            let handles_before = decoder.remaining_handles();
24296            let (ordinal, inlined, num_bytes, num_handles) =
24297                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24298
24299            let member_inline_size = match ordinal {
24300                1 => {
24301                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
24302                        decoder.context,
24303                    )
24304                }
24305                2 => <fidl::encoding::HandleType<
24306                    fidl::Vmo,
24307                    { fidl::ObjectType::VMO.into_raw() },
24308                    2147483648,
24309                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24310                0 => return Err(fidl::Error::UnknownUnionTag),
24311                _ => num_bytes as usize,
24312            };
24313
24314            if inlined != (member_inline_size <= 4) {
24315                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24316            }
24317            let _inner_offset;
24318            if inlined {
24319                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24320                _inner_offset = offset + 8;
24321            } else {
24322                depth.increment()?;
24323                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24324            }
24325            match ordinal {
24326                1 => {
24327                    #[allow(irrefutable_let_patterns)]
24328                    if let ExtendedAttributeValue::Bytes(_) = self {
24329                        // Do nothing, read the value into the object
24330                    } else {
24331                        // Initialize `self` to the right variant
24332                        *self = ExtendedAttributeValue::Bytes(
24333                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
24334                        );
24335                    }
24336                    #[allow(irrefutable_let_patterns)]
24337                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
24338                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24339                    } else {
24340                        unreachable!()
24341                    }
24342                }
24343                2 => {
24344                    #[allow(irrefutable_let_patterns)]
24345                    if let ExtendedAttributeValue::Buffer(_) = self {
24346                        // Do nothing, read the value into the object
24347                    } else {
24348                        // Initialize `self` to the right variant
24349                        *self = ExtendedAttributeValue::Buffer(
24350                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
24351                        );
24352                    }
24353                    #[allow(irrefutable_let_patterns)]
24354                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
24355                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24356                    } else {
24357                        unreachable!()
24358                    }
24359                }
24360                #[allow(deprecated)]
24361                ordinal => {
24362                    for _ in 0..num_handles {
24363                        decoder.drop_next_handle()?;
24364                    }
24365                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
24366                }
24367            }
24368            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24369                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24370            }
24371            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24372                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24373            }
24374            Ok(())
24375        }
24376    }
24377
24378    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
24379        type Borrowed<'a> = &'a mut Self;
24380        fn take_or_borrow<'a>(
24381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24382        ) -> Self::Borrowed<'a> {
24383            value
24384        }
24385    }
24386
24387    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
24388        type Owned = Self;
24389
24390        #[inline(always)]
24391        fn inline_align(_context: fidl::encoding::Context) -> usize {
24392            8
24393        }
24394
24395        #[inline(always)]
24396        fn inline_size(_context: fidl::encoding::Context) -> usize {
24397            16
24398        }
24399    }
24400
24401    unsafe impl
24402        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
24403        for &mut NodeInfoDeprecated
24404    {
24405        #[inline]
24406        unsafe fn encode(
24407            self,
24408            encoder: &mut fidl::encoding::Encoder<
24409                '_,
24410                fidl::encoding::DefaultFuchsiaResourceDialect,
24411            >,
24412            offset: usize,
24413            _depth: fidl::encoding::Depth,
24414        ) -> fidl::Result<()> {
24415            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
24416            encoder.write_num::<u64>(self.ordinal(), offset);
24417            match self {
24418                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
24419                    Service,
24420                    fidl::encoding::DefaultFuchsiaResourceDialect,
24421                >(
24422                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
24423                    encoder,
24424                    offset + 8,
24425                    _depth,
24426                ),
24427                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24428                    FileObject,
24429                    fidl::encoding::DefaultFuchsiaResourceDialect,
24430                >(
24431                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24432                    encoder,
24433                    offset + 8,
24434                    _depth,
24435                ),
24436                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24437                    DirectoryObject,
24438                    fidl::encoding::DefaultFuchsiaResourceDialect,
24439                >(
24440                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24441                    encoder,
24442                    offset + 8,
24443                    _depth,
24444                ),
24445                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24446                    SymlinkObject,
24447                    fidl::encoding::DefaultFuchsiaResourceDialect,
24448                >(
24449                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24450                    encoder,
24451                    offset + 8,
24452                    _depth,
24453                ),
24454            }
24455        }
24456    }
24457
24458    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24459        for NodeInfoDeprecated
24460    {
24461        #[inline(always)]
24462        fn new_empty() -> Self {
24463            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
24464        }
24465
24466        #[inline]
24467        unsafe fn decode(
24468            &mut self,
24469            decoder: &mut fidl::encoding::Decoder<
24470                '_,
24471                fidl::encoding::DefaultFuchsiaResourceDialect,
24472            >,
24473            offset: usize,
24474            mut depth: fidl::encoding::Depth,
24475        ) -> fidl::Result<()> {
24476            decoder.debug_check_bounds::<Self>(offset);
24477            #[allow(unused_variables)]
24478            let next_out_of_line = decoder.next_out_of_line();
24479            let handles_before = decoder.remaining_handles();
24480            let (ordinal, inlined, num_bytes, num_handles) =
24481                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24482
24483            let member_inline_size = match ordinal {
24484                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24485                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24486                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24487                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24488                _ => return Err(fidl::Error::UnknownUnionTag),
24489            };
24490
24491            if inlined != (member_inline_size <= 4) {
24492                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24493            }
24494            let _inner_offset;
24495            if inlined {
24496                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24497                _inner_offset = offset + 8;
24498            } else {
24499                depth.increment()?;
24500                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24501            }
24502            match ordinal {
24503                1 => {
24504                    #[allow(irrefutable_let_patterns)]
24505                    if let NodeInfoDeprecated::Service(_) = self {
24506                        // Do nothing, read the value into the object
24507                    } else {
24508                        // Initialize `self` to the right variant
24509                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
24510                            Service,
24511                            fidl::encoding::DefaultFuchsiaResourceDialect
24512                        ));
24513                    }
24514                    #[allow(irrefutable_let_patterns)]
24515                    if let NodeInfoDeprecated::Service(ref mut val) = self {
24516                        fidl::decode!(
24517                            Service,
24518                            fidl::encoding::DefaultFuchsiaResourceDialect,
24519                            val,
24520                            decoder,
24521                            _inner_offset,
24522                            depth
24523                        )?;
24524                    } else {
24525                        unreachable!()
24526                    }
24527                }
24528                2 => {
24529                    #[allow(irrefutable_let_patterns)]
24530                    if let NodeInfoDeprecated::File(_) = self {
24531                        // Do nothing, read the value into the object
24532                    } else {
24533                        // Initialize `self` to the right variant
24534                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
24535                            FileObject,
24536                            fidl::encoding::DefaultFuchsiaResourceDialect
24537                        ));
24538                    }
24539                    #[allow(irrefutable_let_patterns)]
24540                    if let NodeInfoDeprecated::File(ref mut val) = self {
24541                        fidl::decode!(
24542                            FileObject,
24543                            fidl::encoding::DefaultFuchsiaResourceDialect,
24544                            val,
24545                            decoder,
24546                            _inner_offset,
24547                            depth
24548                        )?;
24549                    } else {
24550                        unreachable!()
24551                    }
24552                }
24553                3 => {
24554                    #[allow(irrefutable_let_patterns)]
24555                    if let NodeInfoDeprecated::Directory(_) = self {
24556                        // Do nothing, read the value into the object
24557                    } else {
24558                        // Initialize `self` to the right variant
24559                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
24560                            DirectoryObject,
24561                            fidl::encoding::DefaultFuchsiaResourceDialect
24562                        ));
24563                    }
24564                    #[allow(irrefutable_let_patterns)]
24565                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
24566                        fidl::decode!(
24567                            DirectoryObject,
24568                            fidl::encoding::DefaultFuchsiaResourceDialect,
24569                            val,
24570                            decoder,
24571                            _inner_offset,
24572                            depth
24573                        )?;
24574                    } else {
24575                        unreachable!()
24576                    }
24577                }
24578                4 => {
24579                    #[allow(irrefutable_let_patterns)]
24580                    if let NodeInfoDeprecated::Symlink(_) = self {
24581                        // Do nothing, read the value into the object
24582                    } else {
24583                        // Initialize `self` to the right variant
24584                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
24585                            SymlinkObject,
24586                            fidl::encoding::DefaultFuchsiaResourceDialect
24587                        ));
24588                    }
24589                    #[allow(irrefutable_let_patterns)]
24590                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
24591                        fidl::decode!(
24592                            SymlinkObject,
24593                            fidl::encoding::DefaultFuchsiaResourceDialect,
24594                            val,
24595                            decoder,
24596                            _inner_offset,
24597                            depth
24598                        )?;
24599                    } else {
24600                        unreachable!()
24601                    }
24602                }
24603                ordinal => panic!("unexpected ordinal {:?}", ordinal),
24604            }
24605            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24606                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24607            }
24608            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24609                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24610            }
24611            Ok(())
24612        }
24613    }
24614
24615    impl fidl::encoding::ResourceTypeMarker for Representation {
24616        type Borrowed<'a> = &'a mut Self;
24617        fn take_or_borrow<'a>(
24618            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24619        ) -> Self::Borrowed<'a> {
24620            value
24621        }
24622    }
24623
24624    unsafe impl fidl::encoding::TypeMarker for Representation {
24625        type Owned = Self;
24626
24627        #[inline(always)]
24628        fn inline_align(_context: fidl::encoding::Context) -> usize {
24629            8
24630        }
24631
24632        #[inline(always)]
24633        fn inline_size(_context: fidl::encoding::Context) -> usize {
24634            16
24635        }
24636    }
24637
24638    unsafe impl
24639        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
24640        for &mut Representation
24641    {
24642        #[inline]
24643        unsafe fn encode(
24644            self,
24645            encoder: &mut fidl::encoding::Encoder<
24646                '_,
24647                fidl::encoding::DefaultFuchsiaResourceDialect,
24648            >,
24649            offset: usize,
24650            _depth: fidl::encoding::Depth,
24651        ) -> fidl::Result<()> {
24652            encoder.debug_check_bounds::<Representation>(offset);
24653            encoder.write_num::<u64>(self.ordinal(), offset);
24654            match self {
24655                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
24656                    NodeInfo,
24657                    fidl::encoding::DefaultFuchsiaResourceDialect,
24658                >(
24659                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24660                    encoder,
24661                    offset + 8,
24662                    _depth,
24663                ),
24664                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24665                    DirectoryInfo,
24666                    fidl::encoding::DefaultFuchsiaResourceDialect,
24667                >(
24668                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24669                    encoder,
24670                    offset + 8,
24671                    _depth,
24672                ),
24673                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24674                    FileInfo,
24675                    fidl::encoding::DefaultFuchsiaResourceDialect,
24676                >(
24677                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24678                    encoder,
24679                    offset + 8,
24680                    _depth,
24681                ),
24682                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24683                    SymlinkInfo,
24684                    fidl::encoding::DefaultFuchsiaResourceDialect,
24685                >(
24686                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24687                    encoder,
24688                    offset + 8,
24689                    _depth,
24690                ),
24691                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24692            }
24693        }
24694    }
24695
24696    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24697        for Representation
24698    {
24699        #[inline(always)]
24700        fn new_empty() -> Self {
24701            Self::__SourceBreaking { unknown_ordinal: 0 }
24702        }
24703
24704        #[inline]
24705        unsafe fn decode(
24706            &mut self,
24707            decoder: &mut fidl::encoding::Decoder<
24708                '_,
24709                fidl::encoding::DefaultFuchsiaResourceDialect,
24710            >,
24711            offset: usize,
24712            mut depth: fidl::encoding::Depth,
24713        ) -> fidl::Result<()> {
24714            decoder.debug_check_bounds::<Self>(offset);
24715            #[allow(unused_variables)]
24716            let next_out_of_line = decoder.next_out_of_line();
24717            let handles_before = decoder.remaining_handles();
24718            let (ordinal, inlined, num_bytes, num_handles) =
24719                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24720
24721            let member_inline_size = match ordinal {
24722                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24723                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24724                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24725                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24726                0 => return Err(fidl::Error::UnknownUnionTag),
24727                _ => num_bytes as usize,
24728            };
24729
24730            if inlined != (member_inline_size <= 4) {
24731                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24732            }
24733            let _inner_offset;
24734            if inlined {
24735                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24736                _inner_offset = offset + 8;
24737            } else {
24738                depth.increment()?;
24739                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24740            }
24741            match ordinal {
24742                1 => {
24743                    #[allow(irrefutable_let_patterns)]
24744                    if let Representation::Node(_) = self {
24745                        // Do nothing, read the value into the object
24746                    } else {
24747                        // Initialize `self` to the right variant
24748                        *self = Representation::Node(fidl::new_empty!(
24749                            NodeInfo,
24750                            fidl::encoding::DefaultFuchsiaResourceDialect
24751                        ));
24752                    }
24753                    #[allow(irrefutable_let_patterns)]
24754                    if let Representation::Node(ref mut val) = self {
24755                        fidl::decode!(
24756                            NodeInfo,
24757                            fidl::encoding::DefaultFuchsiaResourceDialect,
24758                            val,
24759                            decoder,
24760                            _inner_offset,
24761                            depth
24762                        )?;
24763                    } else {
24764                        unreachable!()
24765                    }
24766                }
24767                2 => {
24768                    #[allow(irrefutable_let_patterns)]
24769                    if let Representation::Directory(_) = self {
24770                        // Do nothing, read the value into the object
24771                    } else {
24772                        // Initialize `self` to the right variant
24773                        *self = Representation::Directory(fidl::new_empty!(
24774                            DirectoryInfo,
24775                            fidl::encoding::DefaultFuchsiaResourceDialect
24776                        ));
24777                    }
24778                    #[allow(irrefutable_let_patterns)]
24779                    if let Representation::Directory(ref mut val) = self {
24780                        fidl::decode!(
24781                            DirectoryInfo,
24782                            fidl::encoding::DefaultFuchsiaResourceDialect,
24783                            val,
24784                            decoder,
24785                            _inner_offset,
24786                            depth
24787                        )?;
24788                    } else {
24789                        unreachable!()
24790                    }
24791                }
24792                3 => {
24793                    #[allow(irrefutable_let_patterns)]
24794                    if let Representation::File(_) = self {
24795                        // Do nothing, read the value into the object
24796                    } else {
24797                        // Initialize `self` to the right variant
24798                        *self = Representation::File(fidl::new_empty!(
24799                            FileInfo,
24800                            fidl::encoding::DefaultFuchsiaResourceDialect
24801                        ));
24802                    }
24803                    #[allow(irrefutable_let_patterns)]
24804                    if let Representation::File(ref mut val) = self {
24805                        fidl::decode!(
24806                            FileInfo,
24807                            fidl::encoding::DefaultFuchsiaResourceDialect,
24808                            val,
24809                            decoder,
24810                            _inner_offset,
24811                            depth
24812                        )?;
24813                    } else {
24814                        unreachable!()
24815                    }
24816                }
24817                4 => {
24818                    #[allow(irrefutable_let_patterns)]
24819                    if let Representation::Symlink(_) = self {
24820                        // Do nothing, read the value into the object
24821                    } else {
24822                        // Initialize `self` to the right variant
24823                        *self = Representation::Symlink(fidl::new_empty!(
24824                            SymlinkInfo,
24825                            fidl::encoding::DefaultFuchsiaResourceDialect
24826                        ));
24827                    }
24828                    #[allow(irrefutable_let_patterns)]
24829                    if let Representation::Symlink(ref mut val) = self {
24830                        fidl::decode!(
24831                            SymlinkInfo,
24832                            fidl::encoding::DefaultFuchsiaResourceDialect,
24833                            val,
24834                            decoder,
24835                            _inner_offset,
24836                            depth
24837                        )?;
24838                    } else {
24839                        unreachable!()
24840                    }
24841                }
24842                #[allow(deprecated)]
24843                ordinal => {
24844                    for _ in 0..num_handles {
24845                        decoder.drop_next_handle()?;
24846                    }
24847                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24848                }
24849            }
24850            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24851                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24852            }
24853            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24854                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24855            }
24856            Ok(())
24857        }
24858    }
24859}