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 DirectoryDeprecatedGetTokenResponse {
32    pub s: i32,
33    pub token: Option<fidl::NullableHandle>,
34}
35
36impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
37    for DirectoryDeprecatedGetTokenResponse
38{
39}
40
41#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42pub struct DirectoryDeprecatedOpenRequest {
43    pub flags: OpenFlags,
44    pub mode: ModeType,
45    pub path: String,
46    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
50    for DirectoryDeprecatedOpenRequest
51{
52}
53
54#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55pub struct DirectoryLinkRequest {
56    pub src: String,
57    pub dst_parent_token: fidl::NullableHandle,
58    pub dst: String,
59}
60
61impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryLinkRequest {}
62
63#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
64pub struct DirectoryRenameRequest {
65    pub src: String,
66    pub dst_parent_token: fidl::Event,
67    pub dst: String,
68}
69
70impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryRenameRequest {}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct DirectoryWatchRequest {
74    pub mask: WatchMask,
75    pub options: u32,
76    pub watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryWatchRequest {}
80
81#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
82pub struct FileAllocateRequest {
83    pub offset: u64,
84    pub length: u64,
85    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
86    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
87    /// support a particular provided mode bit, or combination of mode bits, an error is
88    /// returned.
89    pub mode: AllocateMode,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileAllocateRequest {}
93
94#[derive(Debug, PartialEq)]
95pub struct FileEnableVerityRequest {
96    pub options: VerificationOptions,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileEnableVerityRequest {}
100
101#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
102pub struct FileObject {
103    /// An optional event which transmits information about an object's readability
104    /// or writability. This event relays information about the underlying object, not
105    /// the capability granted to client: this event may be signalled "readable" on a
106    /// connection that does not have the capability to read.
107    ///
108    /// The "`FILE_SIGNAL_`" values may be observed on this event.
109    pub event: Option<fidl::Event>,
110    /// A placeholder for future stream support.
111    ///
112    /// Currently, servers are required not to send a handle in this field.
113    pub stream: Option<fidl::Stream>,
114}
115
116impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {}
117
118#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119pub struct FileGetBackingMemoryResponse {
120    pub vmo: fidl::Vmo,
121}
122
123impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
124    for FileGetBackingMemoryResponse
125{
126}
127
128#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129pub struct LinkableLinkIntoRequest {
130    pub dst_parent_token: fidl::Event,
131    pub dst: String,
132}
133
134impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LinkableLinkIntoRequest {}
135
136#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137pub struct NodeListExtendedAttributesRequest {
138    pub iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
139}
140
141impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
142    for NodeListExtendedAttributesRequest
143{
144}
145
146#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct NodeOnOpenRequest {
148    pub s: i32,
149    pub info: Option<Box<NodeInfoDeprecated>>,
150}
151
152impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeOnOpenRequest {}
153
154#[derive(Debug, PartialEq)]
155pub struct NodeSetExtendedAttributeRequest {
156    pub name: Vec<u8>,
157    pub value: ExtendedAttributeValue,
158    /// Specifies the behavior based on the current state of the attribute.
159    pub mode: SetExtendedAttributeMode,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163    for NodeSetExtendedAttributeRequest
164{
165}
166
167#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168pub struct NodeGetTokenResponse {
169    pub token: fidl::Event,
170}
171
172impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeGetTokenResponse {}
173
174#[derive(Debug, PartialEq)]
175pub struct OpenableOpenRequest {
176    pub path: String,
177    pub flags: Flags,
178    pub options: Options,
179    pub object: fidl::Channel,
180}
181
182impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for OpenableOpenRequest {}
183
184#[derive(Debug, Default, PartialEq)]
185pub struct ConnectionInfo {
186    /// The rights possessed by the current connection. Note: `rights` limits
187    /// the set of operations allowed on the connection, but does not guarantee
188    /// their availability. For example, one may have the [`Rights.EXECUTE`]
189    /// right on a file connection, but the file itself does not have the
190    /// `EXECUTE` ability, and hence cannot be executed. See
191    /// [`ConnectionOptions.rights`].
192    pub rights: Option<Operations>,
193    #[doc(hidden)]
194    pub __source_breaking: fidl::marker::SourceBreaking,
195}
196
197impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectionInfo {}
198
199/// Auxiliary data for the file representation of a node.
200#[derive(Debug, Default, PartialEq)]
201pub struct FileInfo {
202    /// True if the file is opened in append mode.
203    /// In append mode, the seek offset is moved to the end before every
204    /// write, the two steps performed in an atomic manner.
205    pub is_append: Option<bool>,
206    /// An optional event which transmits information about an object's
207    /// readability or writability. This event relays information about the
208    /// underlying object, not the capability granted to client: this event
209    /// may be signalled "readable" on a connection that does not have
210    /// the capability to read.
211    ///
212    /// This event will be present if the following conditions are met:
213    ///
214    /// - The `available_operations` on the file connection is not empty.
215    /// - The filesystem supports signalling readability/writability events.
216    ///
217    /// The [`FileSignal`] values may be observed on this event.
218    pub observer: Option<fidl::Event>,
219    /// An optional stream object, which can be used to read to and write from
220    /// the file more quickly than with fidl.
221    ///
222    /// The channel for the file *must* be held open while the stream is in use.
223    /// Using a stream object that has outlived the channel it came from may
224    /// result in failures or unexpected results.
225    pub stream: Option<fidl::Stream>,
226    /// Requested attributes for the file. This is only populated if requested.
227    pub attributes: Option<NodeAttributes2>,
228    #[doc(hidden)]
229    pub __source_breaking: fidl::marker::SourceBreaking,
230}
231
232impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {}
233
234/// The value type for an extended attribute. If the value is less than 32768
235/// bytes, then it is included inline. Values larger than this size are written
236/// into a vmo buffer.
237#[derive(Debug)]
238pub enum ExtendedAttributeValue {
239    Bytes(Vec<u8>),
240    Buffer(fidl::Vmo),
241    #[doc(hidden)]
242    __SourceBreaking {
243        unknown_ordinal: u64,
244    },
245}
246
247/// Pattern that matches an unknown `ExtendedAttributeValue` member.
248#[macro_export]
249macro_rules! ExtendedAttributeValueUnknown {
250    () => {
251        _
252    };
253}
254
255// Custom PartialEq so that unknown variants are not equal to themselves.
256impl PartialEq for ExtendedAttributeValue {
257    fn eq(&self, other: &Self) -> bool {
258        match (self, other) {
259            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
260            (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
261            _ => false,
262        }
263    }
264}
265
266impl ExtendedAttributeValue {
267    #[inline]
268    pub fn ordinal(&self) -> u64 {
269        match *self {
270            Self::Bytes(_) => 1,
271            Self::Buffer(_) => 2,
272            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
273        }
274    }
275
276    #[inline]
277    pub fn unknown_variant_for_testing() -> Self {
278        Self::__SourceBreaking { unknown_ordinal: 0 }
279    }
280
281    #[inline]
282    pub fn is_unknown(&self) -> bool {
283        match self {
284            Self::__SourceBreaking { .. } => true,
285            _ => false,
286        }
287    }
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ExtendedAttributeValue {}
291
292#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
293pub enum NodeInfoDeprecated {
294    /// No protocol information was supplied by the connection.
295    Service(Service),
296    /// The connection composes [`File`].
297    File(FileObject),
298    /// The connection composes [`Directory`].
299    Directory(DirectoryObject),
300    /// The connection composes ['Symlink'].
301    Symlink(SymlinkObject),
302}
303
304impl NodeInfoDeprecated {
305    #[inline]
306    pub fn ordinal(&self) -> u64 {
307        match *self {
308            Self::Service(_) => 1,
309            Self::File(_) => 2,
310            Self::Directory(_) => 3,
311            Self::Symlink(_) => 4,
312        }
313    }
314}
315
316impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeInfoDeprecated {}
317
318#[derive(Debug)]
319pub enum Representation {
320    /// The [`Node`] protocol was negotiated for this connection.
321    Node(NodeInfo),
322    /// The [`File`] protocol was negotiated for this connection.
323    Directory(DirectoryInfo),
324    /// The [`File`] protocol was negotiated for this connection.
325    File(FileInfo),
326    /// The [`Symlink`] protocol was negotiated for this connection.
327    Symlink(SymlinkInfo),
328    #[doc(hidden)]
329    __SourceBreaking { unknown_ordinal: u64 },
330}
331
332/// Pattern that matches an unknown `Representation` member.
333#[macro_export]
334macro_rules! RepresentationUnknown {
335    () => {
336        _
337    };
338}
339
340// Custom PartialEq so that unknown variants are not equal to themselves.
341impl PartialEq for Representation {
342    fn eq(&self, other: &Self) -> bool {
343        match (self, other) {
344            (Self::Node(x), Self::Node(y)) => *x == *y,
345            (Self::Directory(x), Self::Directory(y)) => *x == *y,
346            (Self::File(x), Self::File(y)) => *x == *y,
347            (Self::Symlink(x), Self::Symlink(y)) => *x == *y,
348            _ => false,
349        }
350    }
351}
352
353impl Representation {
354    #[inline]
355    pub fn ordinal(&self) -> u64 {
356        match *self {
357            Self::Node(_) => 1,
358            Self::Directory(_) => 2,
359            Self::File(_) => 3,
360            Self::Symlink(_) => 4,
361            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
362        }
363    }
364
365    #[inline]
366    pub fn unknown_variant_for_testing() -> Self {
367        Self::__SourceBreaking { unknown_ordinal: 0 }
368    }
369
370    #[inline]
371    pub fn is_unknown(&self) -> bool {
372        match self {
373            Self::__SourceBreaking { .. } => true,
374            _ => false,
375        }
376    }
377}
378
379impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Representation {}
380
381#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
382pub struct AdvisoryLockingMarker;
383
384impl fidl::endpoints::ProtocolMarker for AdvisoryLockingMarker {
385    type Proxy = AdvisoryLockingProxy;
386    type RequestStream = AdvisoryLockingRequestStream;
387    #[cfg(target_os = "fuchsia")]
388    type SynchronousProxy = AdvisoryLockingSynchronousProxy;
389
390    const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
391}
392pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
393
394pub trait AdvisoryLockingProxyInterface: Send + Sync {
395    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
396        + Send;
397    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
398}
399#[derive(Debug)]
400#[cfg(target_os = "fuchsia")]
401pub struct AdvisoryLockingSynchronousProxy {
402    client: fidl::client::sync::Client,
403}
404
405#[cfg(target_os = "fuchsia")]
406impl fidl::endpoints::SynchronousProxy for AdvisoryLockingSynchronousProxy {
407    type Proxy = AdvisoryLockingProxy;
408    type Protocol = AdvisoryLockingMarker;
409
410    fn from_channel(inner: fidl::Channel) -> Self {
411        Self::new(inner)
412    }
413
414    fn into_channel(self) -> fidl::Channel {
415        self.client.into_channel()
416    }
417
418    fn as_channel(&self) -> &fidl::Channel {
419        self.client.as_channel()
420    }
421}
422
423#[cfg(target_os = "fuchsia")]
424impl AdvisoryLockingSynchronousProxy {
425    pub fn new(channel: fidl::Channel) -> Self {
426        Self { client: fidl::client::sync::Client::new(channel) }
427    }
428
429    pub fn into_channel(self) -> fidl::Channel {
430        self.client.into_channel()
431    }
432
433    /// Waits until an event arrives and returns it. It is safe for other
434    /// threads to make concurrent requests while waiting for an event.
435    pub fn wait_for_event(
436        &self,
437        deadline: zx::MonotonicInstant,
438    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
439        AdvisoryLockingEvent::decode(self.client.wait_for_event::<AdvisoryLockingMarker>(deadline)?)
440    }
441
442    /// Acquires an advisory lock on the underlying file.
443    ///
444    /// The lock lasts until either this connection is closed or
445    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
446    /// explicitly.
447    ///
448    /// Advisory locks are purely advisory. They do not prevent actual read or
449    /// write operations from occurring on the file, either through this
450    /// connection or through other connections.
451    ///
452    /// This method requires the following rights:
453    ///
454    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
455    /// * [`Rights.WRITE_BYTES`] if `request.type` is
456    ///   [`AdvisoryLockType.WRITE`].
457    ///
458    /// # Errors
459    ///
460    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
461    ///   example, another connection might hold a conflicting lock type.
462    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
463    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
464    ///   to acquire the given type of lock.
465    pub fn r#advisory_lock(
466        &self,
467        mut request: &AdvisoryLockRequest,
468        ___deadline: zx::MonotonicInstant,
469    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
470        let _response = self.client.send_query::<
471            AdvisoryLockingAdvisoryLockRequest,
472            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
473            AdvisoryLockingMarker,
474        >(
475            (request,),
476            0x6ee9c0ad53ec87aa,
477            fidl::encoding::DynamicFlags::empty(),
478            ___deadline,
479        )?;
480        Ok(_response.map(|x| x))
481    }
482}
483
484#[cfg(target_os = "fuchsia")]
485impl From<AdvisoryLockingSynchronousProxy> for zx::NullableHandle {
486    fn from(value: AdvisoryLockingSynchronousProxy) -> Self {
487        value.into_channel().into()
488    }
489}
490
491#[cfg(target_os = "fuchsia")]
492impl From<fidl::Channel> for AdvisoryLockingSynchronousProxy {
493    fn from(value: fidl::Channel) -> Self {
494        Self::new(value)
495    }
496}
497
498#[cfg(target_os = "fuchsia")]
499impl fidl::endpoints::FromClient for AdvisoryLockingSynchronousProxy {
500    type Protocol = AdvisoryLockingMarker;
501
502    fn from_client(value: fidl::endpoints::ClientEnd<AdvisoryLockingMarker>) -> Self {
503        Self::new(value.into_channel())
504    }
505}
506
507#[derive(Debug, Clone)]
508pub struct AdvisoryLockingProxy {
509    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
510}
511
512impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
513    type Protocol = AdvisoryLockingMarker;
514
515    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
516        Self::new(inner)
517    }
518
519    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
520        self.client.into_channel().map_err(|client| Self { client })
521    }
522
523    fn as_channel(&self) -> &::fidl::AsyncChannel {
524        self.client.as_channel()
525    }
526}
527
528impl AdvisoryLockingProxy {
529    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
530    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
531        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
532        Self { client: fidl::client::Client::new(channel, protocol_name) }
533    }
534
535    /// Get a Stream of events from the remote end of the protocol.
536    ///
537    /// # Panics
538    ///
539    /// Panics if the event stream was already taken.
540    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
541        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
542    }
543
544    /// Acquires an advisory lock on the underlying file.
545    ///
546    /// The lock lasts until either this connection is closed or
547    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
548    /// explicitly.
549    ///
550    /// Advisory locks are purely advisory. They do not prevent actual read or
551    /// write operations from occurring on the file, either through this
552    /// connection or through other connections.
553    ///
554    /// This method requires the following rights:
555    ///
556    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
557    /// * [`Rights.WRITE_BYTES`] if `request.type` is
558    ///   [`AdvisoryLockType.WRITE`].
559    ///
560    /// # Errors
561    ///
562    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
563    ///   example, another connection might hold a conflicting lock type.
564    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
565    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
566    ///   to acquire the given type of lock.
567    pub fn r#advisory_lock(
568        &self,
569        mut request: &AdvisoryLockRequest,
570    ) -> fidl::client::QueryResponseFut<
571        AdvisoryLockingAdvisoryLockResult,
572        fidl::encoding::DefaultFuchsiaResourceDialect,
573    > {
574        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
575    }
576}
577
578impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
579    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
580        AdvisoryLockingAdvisoryLockResult,
581        fidl::encoding::DefaultFuchsiaResourceDialect,
582    >;
583    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
584        fn _decode(
585            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
586        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
587            let _response = fidl::client::decode_transaction_body::<
588                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
589                fidl::encoding::DefaultFuchsiaResourceDialect,
590                0x6ee9c0ad53ec87aa,
591            >(_buf?)?;
592            Ok(_response.map(|x| x))
593        }
594        self.client.send_query_and_decode::<
595            AdvisoryLockingAdvisoryLockRequest,
596            AdvisoryLockingAdvisoryLockResult,
597        >(
598            (request,),
599            0x6ee9c0ad53ec87aa,
600            fidl::encoding::DynamicFlags::empty(),
601            _decode,
602        )
603    }
604}
605
606pub struct AdvisoryLockingEventStream {
607    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
608}
609
610impl std::marker::Unpin for AdvisoryLockingEventStream {}
611
612impl futures::stream::FusedStream for AdvisoryLockingEventStream {
613    fn is_terminated(&self) -> bool {
614        self.event_receiver.is_terminated()
615    }
616}
617
618impl futures::Stream for AdvisoryLockingEventStream {
619    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
620
621    fn poll_next(
622        mut self: std::pin::Pin<&mut Self>,
623        cx: &mut std::task::Context<'_>,
624    ) -> std::task::Poll<Option<Self::Item>> {
625        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
626            &mut self.event_receiver,
627            cx
628        )?) {
629            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
630            None => std::task::Poll::Ready(None),
631        }
632    }
633}
634
635#[derive(Debug)]
636pub enum AdvisoryLockingEvent {}
637
638impl AdvisoryLockingEvent {
639    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
640    fn decode(
641        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
642    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
643        let (bytes, _handles) = buf.split_mut();
644        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
645        debug_assert_eq!(tx_header.tx_id, 0);
646        match tx_header.ordinal {
647            _ => Err(fidl::Error::UnknownOrdinal {
648                ordinal: tx_header.ordinal,
649                protocol_name:
650                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
651            }),
652        }
653    }
654}
655
656/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
657pub struct AdvisoryLockingRequestStream {
658    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
659    is_terminated: bool,
660}
661
662impl std::marker::Unpin for AdvisoryLockingRequestStream {}
663
664impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
665    fn is_terminated(&self) -> bool {
666        self.is_terminated
667    }
668}
669
670impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
671    type Protocol = AdvisoryLockingMarker;
672    type ControlHandle = AdvisoryLockingControlHandle;
673
674    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
675        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
676    }
677
678    fn control_handle(&self) -> Self::ControlHandle {
679        AdvisoryLockingControlHandle { inner: self.inner.clone() }
680    }
681
682    fn into_inner(
683        self,
684    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
685    {
686        (self.inner, self.is_terminated)
687    }
688
689    fn from_inner(
690        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
691        is_terminated: bool,
692    ) -> Self {
693        Self { inner, is_terminated }
694    }
695}
696
697impl futures::Stream for AdvisoryLockingRequestStream {
698    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
699
700    fn poll_next(
701        mut self: std::pin::Pin<&mut Self>,
702        cx: &mut std::task::Context<'_>,
703    ) -> std::task::Poll<Option<Self::Item>> {
704        let this = &mut *self;
705        if this.inner.check_shutdown(cx) {
706            this.is_terminated = true;
707            return std::task::Poll::Ready(None);
708        }
709        if this.is_terminated {
710            panic!("polled AdvisoryLockingRequestStream after completion");
711        }
712        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
713            |bytes, handles| {
714                match this.inner.channel().read_etc(cx, bytes, handles) {
715                    std::task::Poll::Ready(Ok(())) => {}
716                    std::task::Poll::Pending => return std::task::Poll::Pending,
717                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
718                        this.is_terminated = true;
719                        return std::task::Poll::Ready(None);
720                    }
721                    std::task::Poll::Ready(Err(e)) => {
722                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
723                            e.into(),
724                        ))));
725                    }
726                }
727
728                // A message has been received from the channel
729                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
730
731                std::task::Poll::Ready(Some(match header.ordinal {
732                    0x6ee9c0ad53ec87aa => {
733                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
734                        let mut req = fidl::new_empty!(
735                            AdvisoryLockingAdvisoryLockRequest,
736                            fidl::encoding::DefaultFuchsiaResourceDialect
737                        );
738                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
739                        let control_handle =
740                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
741                        Ok(AdvisoryLockingRequest::AdvisoryLock {
742                            request: req.request,
743
744                            responder: AdvisoryLockingAdvisoryLockResponder {
745                                control_handle: std::mem::ManuallyDrop::new(control_handle),
746                                tx_id: header.tx_id,
747                            },
748                        })
749                    }
750                    _ => Err(fidl::Error::UnknownOrdinal {
751                        ordinal: header.ordinal,
752                        protocol_name:
753                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
754                    }),
755                }))
756            },
757        )
758    }
759}
760
761/// Advisory locking protocol.
762///
763/// This protocol is intended to be composed into the |File| protocol to
764/// provide support for advisory locking.
765///
766/// Advisory locks are purely advisory. They do not prevent actual read or
767/// write operations from occurring on the file, either through this
768/// connection or through other connections.
769///
770/// These primitives are designed to support the flock() and fcntl(),
771/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
772/// running on Fuchsia expects from other operating systems.
773#[derive(Debug)]
774pub enum AdvisoryLockingRequest {
775    /// Acquires an advisory lock on the underlying file.
776    ///
777    /// The lock lasts until either this connection is closed or
778    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
779    /// explicitly.
780    ///
781    /// Advisory locks are purely advisory. They do not prevent actual read or
782    /// write operations from occurring on the file, either through this
783    /// connection or through other connections.
784    ///
785    /// This method requires the following rights:
786    ///
787    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
788    /// * [`Rights.WRITE_BYTES`] if `request.type` is
789    ///   [`AdvisoryLockType.WRITE`].
790    ///
791    /// # Errors
792    ///
793    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
794    ///   example, another connection might hold a conflicting lock type.
795    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
796    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
797    ///   to acquire the given type of lock.
798    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
799}
800
801impl AdvisoryLockingRequest {
802    #[allow(irrefutable_let_patterns)]
803    pub fn into_advisory_lock(
804        self,
805    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
806        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
807            Some((request, responder))
808        } else {
809            None
810        }
811    }
812
813    /// Name of the method defined in FIDL
814    pub fn method_name(&self) -> &'static str {
815        match *self {
816            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
817        }
818    }
819}
820
821#[derive(Debug, Clone)]
822pub struct AdvisoryLockingControlHandle {
823    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
824}
825
826impl AdvisoryLockingControlHandle {
827    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
828        self.inner.shutdown_with_epitaph(status.into())
829    }
830}
831
832impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
833    fn shutdown(&self) {
834        self.inner.shutdown()
835    }
836
837    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
838        self.inner.shutdown_with_epitaph(status)
839    }
840
841    fn is_closed(&self) -> bool {
842        self.inner.channel().is_closed()
843    }
844    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
845        self.inner.channel().on_closed()
846    }
847
848    #[cfg(target_os = "fuchsia")]
849    fn signal_peer(
850        &self,
851        clear_mask: zx::Signals,
852        set_mask: zx::Signals,
853    ) -> Result<(), zx_status::Status> {
854        use fidl::Peered;
855        self.inner.channel().signal_peer(clear_mask, set_mask)
856    }
857}
858
859impl AdvisoryLockingControlHandle {}
860
861#[must_use = "FIDL methods require a response to be sent"]
862#[derive(Debug)]
863pub struct AdvisoryLockingAdvisoryLockResponder {
864    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
865    tx_id: u32,
866}
867
868/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
869/// if the responder is dropped without sending a response, so that the client
870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
871impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
872    fn drop(&mut self) {
873        self.control_handle.shutdown();
874        // Safety: drops once, never accessed again
875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
876    }
877}
878
879impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
880    type ControlHandle = AdvisoryLockingControlHandle;
881
882    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
883        &self.control_handle
884    }
885
886    fn drop_without_shutdown(mut self) {
887        // Safety: drops once, never accessed again due to mem::forget
888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
889        // Prevent Drop from running (which would shut down the channel)
890        std::mem::forget(self);
891    }
892}
893
894impl AdvisoryLockingAdvisoryLockResponder {
895    /// Sends a response to the FIDL transaction.
896    ///
897    /// Sets the channel to shutdown if an error occurs.
898    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
899        let _result = self.send_raw(result);
900        if _result.is_err() {
901            self.control_handle.shutdown();
902        }
903        self.drop_without_shutdown();
904        _result
905    }
906
907    /// Similar to "send" but does not shutdown the channel if an error occurs.
908    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
909        let _result = self.send_raw(result);
910        self.drop_without_shutdown();
911        _result
912    }
913
914    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
915        self.control_handle
916            .inner
917            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
918                result,
919                self.tx_id,
920                0x6ee9c0ad53ec87aa,
921                fidl::encoding::DynamicFlags::empty(),
922            )
923    }
924}
925
926#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
927pub struct DirectoryMarker;
928
929impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
930    type Proxy = DirectoryProxy;
931    type RequestStream = DirectoryRequestStream;
932    #[cfg(target_os = "fuchsia")]
933    type SynchronousProxy = DirectorySynchronousProxy;
934
935    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
936}
937impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
938pub type DirectoryUnlinkResult = Result<(), i32>;
939pub type DirectoryRenameResult = Result<(), i32>;
940pub type DirectoryCreateSymlinkResult = Result<(), i32>;
941
942pub trait DirectoryProxyInterface: Send + Sync {
943    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
944        + Send;
945    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
946    fn r#clone(
947        &self,
948        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
949    ) -> Result<(), fidl::Error>;
950    type CloseResponseFut: std::future::Future<
951            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
952        > + Send;
953    fn r#close(&self) -> Self::CloseResponseFut;
954    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
955    fn r#query(&self) -> Self::QueryResponseFut;
956    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
957        + Send;
958    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
959    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
960    fn r#deprecated_set_attr(
961        &self,
962        flags: NodeAttributeFlags,
963        attributes: &NodeAttributes,
964    ) -> Self::DeprecatedSetAttrResponseFut;
965    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
966        + Send;
967    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
968    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
969        + Send;
970    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
971    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
972        + Send;
973    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
974    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
975        + Send;
976    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
977    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
978        + Send;
979    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
980    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
981        + Send;
982    fn r#get_token(&self) -> Self::GetTokenResponseFut;
983    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
984        + Send;
985    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
986    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
987        + Send;
988    fn r#update_attributes(
989        &self,
990        payload: &MutableNodeAttributes,
991    ) -> Self::UpdateAttributesResponseFut;
992    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
993    fn r#sync(&self) -> Self::SyncResponseFut;
994    fn r#list_extended_attributes(
995        &self,
996        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
997    ) -> Result<(), fidl::Error>;
998    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
999        + Send;
1000    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
1001    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
1002        + Send;
1003    fn r#set_extended_attribute(
1004        &self,
1005        name: &[u8],
1006        value: ExtendedAttributeValue,
1007        mode: SetExtendedAttributeMode,
1008    ) -> Self::SetExtendedAttributeResponseFut;
1009    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1010        + Send;
1011    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1012    fn r#open(
1013        &self,
1014        path: &str,
1015        flags: Flags,
1016        options: &Options,
1017        object: fidl::Channel,
1018    ) -> Result<(), fidl::Error>;
1019    fn r#deprecated_open(
1020        &self,
1021        flags: OpenFlags,
1022        mode: ModeType,
1023        path: &str,
1024        object: fidl::endpoints::ServerEnd<NodeMarker>,
1025    ) -> Result<(), fidl::Error>;
1026    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1027        + Send;
1028    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1029    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1030    fn r#rewind(&self) -> Self::RewindResponseFut;
1031    type DeprecatedGetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::NullableHandle>), fidl::Error>>
1032        + Send;
1033    fn r#deprecated_get_token(&self) -> Self::DeprecatedGetTokenResponseFut;
1034    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1035    fn r#link(
1036        &self,
1037        src: &str,
1038        dst_parent_token: fidl::NullableHandle,
1039        dst: &str,
1040    ) -> Self::LinkResponseFut;
1041    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1042        + Send;
1043    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1044    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1045        + Send;
1046    fn r#rename(
1047        &self,
1048        src: &str,
1049        dst_parent_token: fidl::Event,
1050        dst: &str,
1051    ) -> Self::RenameResponseFut;
1052    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1053        + Send;
1054    fn r#create_symlink(
1055        &self,
1056        name: &str,
1057        target: &[u8],
1058        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1059    ) -> Self::CreateSymlinkResponseFut;
1060    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1061    fn r#watch(
1062        &self,
1063        mask: WatchMask,
1064        options: u32,
1065        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1066    ) -> Self::WatchResponseFut;
1067}
1068#[derive(Debug)]
1069#[cfg(target_os = "fuchsia")]
1070pub struct DirectorySynchronousProxy {
1071    client: fidl::client::sync::Client,
1072}
1073
1074#[cfg(target_os = "fuchsia")]
1075impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1076    type Proxy = DirectoryProxy;
1077    type Protocol = DirectoryMarker;
1078
1079    fn from_channel(inner: fidl::Channel) -> Self {
1080        Self::new(inner)
1081    }
1082
1083    fn into_channel(self) -> fidl::Channel {
1084        self.client.into_channel()
1085    }
1086
1087    fn as_channel(&self) -> &fidl::Channel {
1088        self.client.as_channel()
1089    }
1090}
1091
1092#[cfg(target_os = "fuchsia")]
1093impl DirectorySynchronousProxy {
1094    pub fn new(channel: fidl::Channel) -> Self {
1095        Self { client: fidl::client::sync::Client::new(channel) }
1096    }
1097
1098    pub fn into_channel(self) -> fidl::Channel {
1099        self.client.into_channel()
1100    }
1101
1102    /// Waits until an event arrives and returns it. It is safe for other
1103    /// threads to make concurrent requests while waiting for an event.
1104    pub fn wait_for_event(
1105        &self,
1106        deadline: zx::MonotonicInstant,
1107    ) -> Result<DirectoryEvent, fidl::Error> {
1108        DirectoryEvent::decode(self.client.wait_for_event::<DirectoryMarker>(deadline)?)
1109    }
1110
1111    /// Acquires an advisory lock on the underlying file.
1112    ///
1113    /// The lock lasts until either this connection is closed or
1114    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1115    /// explicitly.
1116    ///
1117    /// Advisory locks are purely advisory. They do not prevent actual read or
1118    /// write operations from occurring on the file, either through this
1119    /// connection or through other connections.
1120    ///
1121    /// This method requires the following rights:
1122    ///
1123    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1124    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1125    ///   [`AdvisoryLockType.WRITE`].
1126    ///
1127    /// # Errors
1128    ///
1129    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1130    ///   example, another connection might hold a conflicting lock type.
1131    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1132    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1133    ///   to acquire the given type of lock.
1134    pub fn r#advisory_lock(
1135        &self,
1136        mut request: &AdvisoryLockRequest,
1137        ___deadline: zx::MonotonicInstant,
1138    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1139        let _response = self.client.send_query::<
1140            AdvisoryLockingAdvisoryLockRequest,
1141            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1142            DirectoryMarker,
1143        >(
1144            (request,),
1145            0x6ee9c0ad53ec87aa,
1146            fidl::encoding::DynamicFlags::empty(),
1147            ___deadline,
1148        )?;
1149        Ok(_response.map(|x| x))
1150    }
1151
1152    pub fn r#clone(
1153        &self,
1154        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1155    ) -> Result<(), fidl::Error> {
1156        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1157            (request,),
1158            0x20d8a7aba2168a79,
1159            fidl::encoding::DynamicFlags::empty(),
1160        )
1161    }
1162
1163    /// Terminates the connection.
1164    ///
1165    /// After calling `Close`, the client must not send any other requests.
1166    ///
1167    /// Servers, after sending the status response, should close the connection
1168    /// regardless of status and without sending an epitaph.
1169    ///
1170    /// Closing the client end of the channel should be semantically equivalent
1171    /// to calling `Close` without knowing when the close has completed or its
1172    /// status.
1173    pub fn r#close(
1174        &self,
1175        ___deadline: zx::MonotonicInstant,
1176    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1177        let _response = self.client.send_query::<
1178            fidl::encoding::EmptyPayload,
1179            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1180            DirectoryMarker,
1181        >(
1182            (),
1183            0x5ac5d459ad7f657e,
1184            fidl::encoding::DynamicFlags::empty(),
1185            ___deadline,
1186        )?;
1187        Ok(_response.map(|x| x))
1188    }
1189
1190    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1191        let _response = self.client.send_query::<
1192            fidl::encoding::EmptyPayload,
1193            fidl_fuchsia_unknown::QueryableQueryResponse,
1194            DirectoryMarker,
1195        >(
1196            (),
1197            0x2658edee9decfc06,
1198            fidl::encoding::DynamicFlags::empty(),
1199            ___deadline,
1200        )?;
1201        Ok(_response.protocol)
1202    }
1203
1204    /// DEPRECATED - Use `Node.GetAttributes` instead.
1205    ///
1206    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1207    pub fn r#deprecated_get_attr(
1208        &self,
1209        ___deadline: zx::MonotonicInstant,
1210    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1211        let _response = self.client.send_query::<
1212            fidl::encoding::EmptyPayload,
1213            NodeDeprecatedGetAttrResponse,
1214            DirectoryMarker,
1215        >(
1216            (),
1217            0x78985e216314dafd,
1218            fidl::encoding::DynamicFlags::empty(),
1219            ___deadline,
1220        )?;
1221        Ok((_response.s, _response.attributes))
1222    }
1223
1224    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1225    pub fn r#deprecated_set_attr(
1226        &self,
1227        mut flags: NodeAttributeFlags,
1228        mut attributes: &NodeAttributes,
1229        ___deadline: zx::MonotonicInstant,
1230    ) -> Result<i32, fidl::Error> {
1231        let _response = self.client.send_query::<
1232            NodeDeprecatedSetAttrRequest,
1233            NodeDeprecatedSetAttrResponse,
1234            DirectoryMarker,
1235        >(
1236            (flags, attributes,),
1237            0x4186c0f40d938f46,
1238            fidl::encoding::DynamicFlags::empty(),
1239            ___deadline,
1240        )?;
1241        Ok(_response.s)
1242    }
1243
1244    /// [DEPRECATED - Use new GetFlags method instead.]
1245    pub fn r#deprecated_get_flags(
1246        &self,
1247        ___deadline: zx::MonotonicInstant,
1248    ) -> Result<(i32, OpenFlags), fidl::Error> {
1249        let _response = self.client.send_query::<
1250            fidl::encoding::EmptyPayload,
1251            NodeDeprecatedGetFlagsResponse,
1252            DirectoryMarker,
1253        >(
1254            (),
1255            0x5b88fffb8eda3aa1,
1256            fidl::encoding::DynamicFlags::empty(),
1257            ___deadline,
1258        )?;
1259        Ok((_response.s, _response.flags))
1260    }
1261
1262    /// [DEPRECATED - Use new SetFlags method instead.]
1263    pub fn r#deprecated_set_flags(
1264        &self,
1265        mut flags: OpenFlags,
1266        ___deadline: zx::MonotonicInstant,
1267    ) -> Result<i32, fidl::Error> {
1268        let _response = self.client.send_query::<
1269            NodeDeprecatedSetFlagsRequest,
1270            NodeDeprecatedSetFlagsResponse,
1271            DirectoryMarker,
1272        >(
1273            (flags,),
1274            0x5295b76c71fde733,
1275            fidl::encoding::DynamicFlags::empty(),
1276            ___deadline,
1277        )?;
1278        Ok(_response.s)
1279    }
1280
1281    /// Queries the flags that apply to this node after it has been opened/created. This method does
1282    /// not require any rights.
1283    ///
1284    /// Note that the final set of flags that apply to the connection may differ from those
1285    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1286    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1287    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1288    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1289    pub fn r#get_flags(
1290        &self,
1291        ___deadline: zx::MonotonicInstant,
1292    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1293        let _response = self.client.send_query::<
1294            fidl::encoding::EmptyPayload,
1295            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1296            DirectoryMarker,
1297        >(
1298            (),
1299            0x176eb318f64ec23,
1300            fidl::encoding::DynamicFlags::FLEXIBLE,
1301            ___deadline,
1302        )?
1303        .into_result::<DirectoryMarker>("get_flags")?;
1304        Ok(_response.map(|x| x.flags))
1305    }
1306
1307    /// Sets the flags that apply to this node after it has been opened. This method does not
1308    /// require any rights.
1309    ///
1310    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1311    /// clear append mode.
1312    ///
1313    /// Errors:
1314    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1315    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1316    pub fn r#set_flags(
1317        &self,
1318        mut flags: Flags,
1319        ___deadline: zx::MonotonicInstant,
1320    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1321        let _response = self.client.send_query::<
1322            NodeSetFlagsRequest,
1323            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1324            DirectoryMarker,
1325        >(
1326            (flags,),
1327            0x55a8028685791ea8,
1328            fidl::encoding::DynamicFlags::FLEXIBLE,
1329            ___deadline,
1330        )?
1331        .into_result::<DirectoryMarker>("set_flags")?;
1332        Ok(_response.map(|x| x))
1333    }
1334
1335    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1336    /// volume has different settings or the storage is accounted seperately from the rest of the
1337    /// filesystem that may be reported instead of filesystem-wide details.
1338    pub fn r#query_filesystem(
1339        &self,
1340        ___deadline: zx::MonotonicInstant,
1341    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1342        let _response = self.client.send_query::<
1343            fidl::encoding::EmptyPayload,
1344            NodeQueryFilesystemResponse,
1345            DirectoryMarker,
1346        >(
1347            (),
1348            0x6f344a1c6b0a0610,
1349            fidl::encoding::DynamicFlags::empty(),
1350            ___deadline,
1351        )?;
1352        Ok((_response.s, _response.info))
1353    }
1354
1355    /// Acquires a token which can be used to identify this connection at a later point in
1356    /// time. The token will remain valid for as long as the connection requesting the token
1357    /// remains open.
1358    ///
1359    /// This method does not require any rights. Note that the token identifies
1360    /// the connection, hence carries the rights information on this connection.
1361    pub fn r#get_token(
1362        &self,
1363        ___deadline: zx::MonotonicInstant,
1364    ) -> Result<NodeGetTokenResult, fidl::Error> {
1365        let _response = self.client.send_query::<
1366            fidl::encoding::EmptyPayload,
1367            fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
1368            DirectoryMarker,
1369        >(
1370            (),
1371            0x5054f0ade7076cec,
1372            fidl::encoding::DynamicFlags::FLEXIBLE,
1373            ___deadline,
1374        )?
1375        .into_result::<DirectoryMarker>("get_token")?;
1376        Ok(_response.map(|x| x.token))
1377    }
1378
1379    /// Acquires information about the node.
1380    ///
1381    /// The attributes of a node should be stable, independent of the
1382    /// specific protocol used to access it.
1383    ///
1384    /// If a particular attribute is not applicable or not supported,
1385    /// filesystems should leave the corresponding field absent.
1386    ///
1387    /// + `query` a bit-mask specifying which attributes to fetch. The server
1388    ///   should not return more than necessary.
1389    /// - `attributes` the returned attributes.
1390    ///
1391    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1392    pub fn r#get_attributes(
1393        &self,
1394        mut query: NodeAttributesQuery,
1395        ___deadline: zx::MonotonicInstant,
1396    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1397        let _response = self.client.send_query::<
1398            NodeGetAttributesRequest,
1399            fidl::encoding::ResultType<NodeAttributes2, i32>,
1400            DirectoryMarker,
1401        >(
1402            (query,),
1403            0x3d4396a638ea053b,
1404            fidl::encoding::DynamicFlags::empty(),
1405            ___deadline,
1406        )?;
1407        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1408    }
1409
1410    /// Updates information about the node.
1411    ///
1412    /// + `attributes` the presence of a table field in `attributes` indicates
1413    /// the intent to update the corresponding attribute.
1414    ///
1415    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1416    ///
1417    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1418    pub fn r#update_attributes(
1419        &self,
1420        mut payload: &MutableNodeAttributes,
1421        ___deadline: zx::MonotonicInstant,
1422    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1423        let _response = self.client.send_query::<
1424            MutableNodeAttributes,
1425            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1426            DirectoryMarker,
1427        >(
1428            payload,
1429            0x3308c1da5a89bf08,
1430            fidl::encoding::DynamicFlags::empty(),
1431            ___deadline,
1432        )?;
1433        Ok(_response.map(|x| x))
1434    }
1435
1436    /// Synchronizes updates to the node to the underlying media, if it exists.
1437    ///
1438    /// This method will return when the filesystem server has flushed the
1439    /// relevant updates to the underlying media, but does not guarantee the
1440    /// underlying media has persisted the information, nor that any information
1441    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1442    /// between operations.
1443    ///
1444    /// This method does not require any rights.
1445    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1446        let _response = self.client.send_query::<
1447            fidl::encoding::EmptyPayload,
1448            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1449            DirectoryMarker,
1450        >(
1451            (),
1452            0x2c5c27ca0ab5dc49,
1453            fidl::encoding::DynamicFlags::empty(),
1454            ___deadline,
1455        )?;
1456        Ok(_response.map(|x| x))
1457    }
1458
1459    /// Creates an iterator over all the extended attribute names associated
1460    /// with this node. If an error occurs it is returned as an epitaph on the
1461    /// iterator request channel, and then the channel is closed.
1462    ///
1463    /// GetExtendedAttributes can be used with any of these names to retrieve
1464    /// the associated value.
1465    ///
1466    /// This method requires the [`Rights.READ_BYTES`] right.
1467    pub fn r#list_extended_attributes(
1468        &self,
1469        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1470    ) -> Result<(), fidl::Error> {
1471        self.client.send::<NodeListExtendedAttributesRequest>(
1472            (iterator,),
1473            0x4b61033de007fcd0,
1474            fidl::encoding::DynamicFlags::empty(),
1475        )
1476    }
1477
1478    /// Get the value associated with the given attribute `name` for this node.
1479    ///
1480    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1481    /// particular structure is imposed on them.
1482    ///
1483    /// This method requires the [`Rights.READ_BYTES`] right.
1484    pub fn r#get_extended_attribute(
1485        &self,
1486        mut name: &[u8],
1487        ___deadline: zx::MonotonicInstant,
1488    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1489        let _response = self.client.send_query::<
1490            NodeGetExtendedAttributeRequest,
1491            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1492            DirectoryMarker,
1493        >(
1494            (name,),
1495            0x45ffa3ccfdeb76db,
1496            fidl::encoding::DynamicFlags::empty(),
1497            ___deadline,
1498        )?;
1499        Ok(_response.map(|x| x))
1500    }
1501
1502    /// Set the value for the given attribute `name` to `value` for this node.
1503    ///
1504    /// The attribute name may exist, in which case the attribute is updated.
1505    /// If the attribute doesn't exist, it is created. The name should have no
1506    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1507    ///
1508    /// This method requires the [`Rights.WRITE_BYTES`] right.
1509    pub fn r#set_extended_attribute(
1510        &self,
1511        mut name: &[u8],
1512        mut value: ExtendedAttributeValue,
1513        mut mode: SetExtendedAttributeMode,
1514        ___deadline: zx::MonotonicInstant,
1515    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1516        let _response = self.client.send_query::<
1517            NodeSetExtendedAttributeRequest,
1518            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1519            DirectoryMarker,
1520        >(
1521            (name, &mut value, mode,),
1522            0x4a951362f681f23c,
1523            fidl::encoding::DynamicFlags::empty(),
1524            ___deadline,
1525        )?;
1526        Ok(_response.map(|x| x))
1527    }
1528
1529    /// Remove the specified extended attribute.
1530    ///
1531    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1532    ///
1533    /// This method requires the [`Rights.WRITE_BYTES`] right.
1534    pub fn r#remove_extended_attribute(
1535        &self,
1536        mut name: &[u8],
1537        ___deadline: zx::MonotonicInstant,
1538    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1539        let _response = self.client.send_query::<
1540            NodeRemoveExtendedAttributeRequest,
1541            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1542            DirectoryMarker,
1543        >(
1544            (name,),
1545            0x7a0b9f3a9bf9032d,
1546            fidl::encoding::DynamicFlags::empty(),
1547            ___deadline,
1548        )?;
1549        Ok(_response.map(|x| x))
1550    }
1551
1552    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1553    /// epitaph sent on the `object` channel.
1554    ///
1555    /// Errors:
1556    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1557    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1558    pub fn r#open(
1559        &self,
1560        mut path: &str,
1561        mut flags: Flags,
1562        mut options: &Options,
1563        mut object: fidl::Channel,
1564    ) -> Result<(), fidl::Error> {
1565        self.client.send::<OpenableOpenRequest>(
1566            (path, flags, options, object),
1567            0x568ddcb9a9cbb6d9,
1568            fidl::encoding::DynamicFlags::FLEXIBLE,
1569        )
1570    }
1571
1572    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1573    pub fn r#deprecated_open(
1574        &self,
1575        mut flags: OpenFlags,
1576        mut mode: ModeType,
1577        mut path: &str,
1578        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1579    ) -> Result<(), fidl::Error> {
1580        self.client.send::<DirectoryDeprecatedOpenRequest>(
1581            (flags, mode, path, object),
1582            0x2c5044561d685ec0,
1583            fidl::encoding::DynamicFlags::FLEXIBLE,
1584        )
1585    }
1586
1587    /// Reads a collection of variably sized dirents into a buffer.
1588    /// The number of dirents in a directory may be very large: akin to
1589    /// calling read multiple times on a file, directories have a seek
1590    /// offset which is updated on subsequent calls to ReadDirents.
1591    /// Each call to ReadDirents will only return whole dirent structures,
1592    /// they will not get split across ReadDirent calls. When the seek
1593    /// offset reaches the end, `dirents` will be empty.
1594    ///
1595    /// These dirents are of the form:
1596    /// ```
1597    /// struct dirent {
1598    ///   // Describes the inode of the entry.
1599    ///   uint64 ino;
1600    ///   // Describes the length of the dirent name in bytes.
1601    ///   uint8 size;
1602    ///   // Describes the type of the entry. Aligned with the
1603    ///   // POSIX d_type values. Use `DirentType` constants.
1604    ///   uint8 type;
1605    ///   // Unterminated name of entry.
1606    ///   char name[0];
1607    /// }
1608    /// ```
1609    ///
1610    /// This method requires the following rights:
1611    ///
1612    /// * [`Rights.ENUMERATE`]
1613    pub fn r#read_dirents(
1614        &self,
1615        mut max_bytes: u64,
1616        ___deadline: zx::MonotonicInstant,
1617    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1618        let _response = self.client.send_query::<
1619            DirectoryReadDirentsRequest,
1620            DirectoryReadDirentsResponse,
1621            DirectoryMarker,
1622        >(
1623            (max_bytes,),
1624            0x3582806bf27faa0a,
1625            fidl::encoding::DynamicFlags::empty(),
1626            ___deadline,
1627        )?;
1628        Ok((_response.s, _response.dirents))
1629    }
1630
1631    /// Resets the directory seek offset.
1632    ///
1633    /// This method requires the following rights:
1634    ///
1635    /// * [`Rights.ENUMERATE`]
1636    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1637        let _response = self
1638            .client
1639            .send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse, DirectoryMarker>(
1640                (),
1641                0x16b1202af0f34c71,
1642                fidl::encoding::DynamicFlags::empty(),
1643                ___deadline,
1644            )?;
1645        Ok(_response.s)
1646    }
1647
1648    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1649    /// in time. The token will remain valid for as long as the connection requesting the token
1650    /// remains open.
1651    ///
1652    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1653    /// `ZX_ERR_BAD_HANDLE`.
1654    ///
1655    /// This method is deprecated: use `fuchsia.io/Node.GetToken` instead (once it is added).
1656    pub fn r#deprecated_get_token(
1657        &self,
1658        ___deadline: zx::MonotonicInstant,
1659    ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
1660        let _response = self.client.send_query::<
1661            fidl::encoding::EmptyPayload,
1662            DirectoryDeprecatedGetTokenResponse,
1663            DirectoryMarker,
1664        >(
1665            (),
1666            0x26ae9d18763c8655,
1667            fidl::encoding::DynamicFlags::empty(),
1668            ___deadline,
1669        )?;
1670        Ok((_response.s, _response.token))
1671    }
1672
1673    /// Creates a link to an object named src by the name dst, within a directory represented by
1674    /// token.
1675    ///
1676    /// `src` must be a resolved object name. Including "/" in the string will
1677    /// return `ZX_ERR_INVALID_ARGS`.
1678    ///
1679    /// `dst` must be a resolved object name. Including "/" in the string will
1680    /// return `ZX_ERR_INVALID_ARGS`.
1681    ///
1682    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1683    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1684    ///
1685    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1686    /// there are two actors operating concurrently, and one actor performs a rename that affects
1687    /// the source within this directory, and the other does a link, each will appear to occur
1688    /// atomically in an unspecified order.
1689    pub fn r#link(
1690        &self,
1691        mut src: &str,
1692        mut dst_parent_token: fidl::NullableHandle,
1693        mut dst: &str,
1694        ___deadline: zx::MonotonicInstant,
1695    ) -> Result<i32, fidl::Error> {
1696        let _response = self
1697            .client
1698            .send_query::<DirectoryLinkRequest, DirectoryLinkResponse, DirectoryMarker>(
1699                (src, dst_parent_token, dst),
1700                0x740604c0c7c930e7,
1701                fidl::encoding::DynamicFlags::empty(),
1702                ___deadline,
1703            )?;
1704        Ok(_response.s)
1705    }
1706
1707    /// Removes a child node from the this directory's list of entries.
1708    ///
1709    /// Note: this does not guarantee that the underlying object is destroyed.
1710    /// Although the link will be removed from the containing directory,
1711    /// objects with multiple references (such as files which are still open)
1712    /// will not actually be destroyed until all references are closed.
1713    ///
1714    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1715    ///   [`Rights.WRITE_BYTES`].
1716    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1717    ///   support writing.
1718    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1719    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1720    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1721    ///   containing a remote channel.
1722    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1723    ///     something other than a directory was found.
1724    ///
1725    /// Other errors may be returned for filesystem-specific reasons.
1726    ///
1727    /// This method requires the following rights:
1728    ///
1729    /// * [`Rights.ENUMERATE`]
1730    /// * [`Rights.MODIFY_DIRECTORY`]
1731    pub fn r#unlink(
1732        &self,
1733        mut name: &str,
1734        mut options: &UnlinkOptions,
1735        ___deadline: zx::MonotonicInstant,
1736    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1737        let _response = self.client.send_query::<
1738            DirectoryUnlinkRequest,
1739            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1740            DirectoryMarker,
1741        >(
1742            (name, options,),
1743            0x750a0326a78d7bed,
1744            fidl::encoding::DynamicFlags::empty(),
1745            ___deadline,
1746        )?;
1747        Ok(_response.map(|x| x))
1748    }
1749
1750    /// Renames a node named `src` to the name `dst`, in a directory represented
1751    /// by `dst_parent_token`.
1752    ///
1753    /// `src` and `dst` must be valid node names.
1754    /// See [`Name`] for what constitutes a valid name.
1755    ///
1756    /// This method requires the following rights on both the current connection, and the connection
1757    /// identified by `dst_parent_token`:
1758    ///
1759    /// * [`Rights.ENUMERATE`]
1760    /// * [`Rights.MODIFY_DIRECTORY`]
1761    ///
1762    /// The following requirements are necessary to avoid rights escalations.
1763    ///
1764    /// If the source and destination directory differ, the source directory must also have the
1765    /// maximal set of abilities supported for files, which would typically be
1766    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1767    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1768    /// right.
1769    ///
1770    /// If `src` refers to a directory, and differs from the destination directory, then the source
1771    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1772    ///
1773    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1774    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1775    pub fn r#rename(
1776        &self,
1777        mut src: &str,
1778        mut dst_parent_token: fidl::Event,
1779        mut dst: &str,
1780        ___deadline: zx::MonotonicInstant,
1781    ) -> Result<DirectoryRenameResult, fidl::Error> {
1782        let _response = self.client.send_query::<
1783            DirectoryRenameRequest,
1784            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1785            DirectoryMarker,
1786        >(
1787            (src, dst_parent_token, dst,),
1788            0x7060e7723b9928de,
1789            fidl::encoding::DynamicFlags::empty(),
1790            ___deadline,
1791        )?;
1792        Ok(_response.map(|x| x))
1793    }
1794
1795    /// Creates a symbolic link.
1796    ///
1797    /// `name` is the name to be given to the created symbolic link.
1798    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1799    /// will perform no validation of `target` except for a server chosen maximum length.
1800    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1801    /// on the successfully created node.
1802    ///
1803    /// * [`Rights.MODIFY_DIRECTORY`]
1804    ///
1805    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1806    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1807    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1808    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1809    pub fn r#create_symlink(
1810        &self,
1811        mut name: &str,
1812        mut target: &[u8],
1813        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1814        ___deadline: zx::MonotonicInstant,
1815    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1816        let _response = self.client.send_query::<
1817            DirectoryCreateSymlinkRequest,
1818            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1819            DirectoryMarker,
1820        >(
1821            (name, target, connection,),
1822            0x21ce0f19ec043889,
1823            fidl::encoding::DynamicFlags::empty(),
1824            ___deadline,
1825        )?;
1826        Ok(_response.map(|x| x))
1827    }
1828
1829    /// Watches a directory, receiving events of added messages on the
1830    /// watcher request channel.
1831    ///
1832    /// Options must be zero; it is reserved.
1833    ///
1834    /// This method requires the following rights:
1835    ///
1836    /// * [`Rights.ENUMERATE`]
1837    pub fn r#watch(
1838        &self,
1839        mut mask: WatchMask,
1840        mut options: u32,
1841        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1842        ___deadline: zx::MonotonicInstant,
1843    ) -> Result<i32, fidl::Error> {
1844        let _response = self
1845            .client
1846            .send_query::<DirectoryWatchRequest, DirectoryWatchResponse, DirectoryMarker>(
1847                (mask, options, watcher),
1848                0x5717193a59d66d91,
1849                fidl::encoding::DynamicFlags::empty(),
1850                ___deadline,
1851            )?;
1852        Ok(_response.s)
1853    }
1854}
1855
1856#[cfg(target_os = "fuchsia")]
1857impl From<DirectorySynchronousProxy> for zx::NullableHandle {
1858    fn from(value: DirectorySynchronousProxy) -> Self {
1859        value.into_channel().into()
1860    }
1861}
1862
1863#[cfg(target_os = "fuchsia")]
1864impl From<fidl::Channel> for DirectorySynchronousProxy {
1865    fn from(value: fidl::Channel) -> Self {
1866        Self::new(value)
1867    }
1868}
1869
1870#[cfg(target_os = "fuchsia")]
1871impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1872    type Protocol = DirectoryMarker;
1873
1874    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1875        Self::new(value.into_channel())
1876    }
1877}
1878
1879#[derive(Debug, Clone)]
1880pub struct DirectoryProxy {
1881    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1882}
1883
1884impl fidl::endpoints::Proxy for DirectoryProxy {
1885    type Protocol = DirectoryMarker;
1886
1887    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1888        Self::new(inner)
1889    }
1890
1891    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1892        self.client.into_channel().map_err(|client| Self { client })
1893    }
1894
1895    fn as_channel(&self) -> &::fidl::AsyncChannel {
1896        self.client.as_channel()
1897    }
1898}
1899
1900impl DirectoryProxy {
1901    /// Create a new Proxy for fuchsia.io/Directory.
1902    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1903        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1904        Self { client: fidl::client::Client::new(channel, protocol_name) }
1905    }
1906
1907    /// Get a Stream of events from the remote end of the protocol.
1908    ///
1909    /// # Panics
1910    ///
1911    /// Panics if the event stream was already taken.
1912    pub fn take_event_stream(&self) -> DirectoryEventStream {
1913        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1914    }
1915
1916    /// Acquires an advisory lock on the underlying file.
1917    ///
1918    /// The lock lasts until either this connection is closed or
1919    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1920    /// explicitly.
1921    ///
1922    /// Advisory locks are purely advisory. They do not prevent actual read or
1923    /// write operations from occurring on the file, either through this
1924    /// connection or through other connections.
1925    ///
1926    /// This method requires the following rights:
1927    ///
1928    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1929    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1930    ///   [`AdvisoryLockType.WRITE`].
1931    ///
1932    /// # Errors
1933    ///
1934    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1935    ///   example, another connection might hold a conflicting lock type.
1936    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1937    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1938    ///   to acquire the given type of lock.
1939    pub fn r#advisory_lock(
1940        &self,
1941        mut request: &AdvisoryLockRequest,
1942    ) -> fidl::client::QueryResponseFut<
1943        AdvisoryLockingAdvisoryLockResult,
1944        fidl::encoding::DefaultFuchsiaResourceDialect,
1945    > {
1946        DirectoryProxyInterface::r#advisory_lock(self, request)
1947    }
1948
1949    pub fn r#clone(
1950        &self,
1951        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1952    ) -> Result<(), fidl::Error> {
1953        DirectoryProxyInterface::r#clone(self, request)
1954    }
1955
1956    /// Terminates the connection.
1957    ///
1958    /// After calling `Close`, the client must not send any other requests.
1959    ///
1960    /// Servers, after sending the status response, should close the connection
1961    /// regardless of status and without sending an epitaph.
1962    ///
1963    /// Closing the client end of the channel should be semantically equivalent
1964    /// to calling `Close` without knowing when the close has completed or its
1965    /// status.
1966    pub fn r#close(
1967        &self,
1968    ) -> fidl::client::QueryResponseFut<
1969        fidl_fuchsia_unknown::CloseableCloseResult,
1970        fidl::encoding::DefaultFuchsiaResourceDialect,
1971    > {
1972        DirectoryProxyInterface::r#close(self)
1973    }
1974
1975    pub fn r#query(
1976        &self,
1977    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1978    {
1979        DirectoryProxyInterface::r#query(self)
1980    }
1981
1982    /// DEPRECATED - Use `Node.GetAttributes` instead.
1983    ///
1984    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1985    pub fn r#deprecated_get_attr(
1986        &self,
1987    ) -> fidl::client::QueryResponseFut<
1988        (i32, NodeAttributes),
1989        fidl::encoding::DefaultFuchsiaResourceDialect,
1990    > {
1991        DirectoryProxyInterface::r#deprecated_get_attr(self)
1992    }
1993
1994    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1995    pub fn r#deprecated_set_attr(
1996        &self,
1997        mut flags: NodeAttributeFlags,
1998        mut attributes: &NodeAttributes,
1999    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2000        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
2001    }
2002
2003    /// [DEPRECATED - Use new GetFlags method instead.]
2004    pub fn r#deprecated_get_flags(
2005        &self,
2006    ) -> fidl::client::QueryResponseFut<
2007        (i32, OpenFlags),
2008        fidl::encoding::DefaultFuchsiaResourceDialect,
2009    > {
2010        DirectoryProxyInterface::r#deprecated_get_flags(self)
2011    }
2012
2013    /// [DEPRECATED - Use new SetFlags method instead.]
2014    pub fn r#deprecated_set_flags(
2015        &self,
2016        mut flags: OpenFlags,
2017    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2018        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
2019    }
2020
2021    /// Queries the flags that apply to this node after it has been opened/created. This method does
2022    /// not require any rights.
2023    ///
2024    /// Note that the final set of flags that apply to the connection may differ from those
2025    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2026    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2027    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2028    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2029    pub fn r#get_flags(
2030        &self,
2031    ) -> fidl::client::QueryResponseFut<
2032        NodeGetFlagsResult,
2033        fidl::encoding::DefaultFuchsiaResourceDialect,
2034    > {
2035        DirectoryProxyInterface::r#get_flags(self)
2036    }
2037
2038    /// Sets the flags that apply to this node after it has been opened. This method does not
2039    /// require any rights.
2040    ///
2041    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2042    /// clear append mode.
2043    ///
2044    /// Errors:
2045    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2046    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2047    pub fn r#set_flags(
2048        &self,
2049        mut flags: Flags,
2050    ) -> fidl::client::QueryResponseFut<
2051        NodeSetFlagsResult,
2052        fidl::encoding::DefaultFuchsiaResourceDialect,
2053    > {
2054        DirectoryProxyInterface::r#set_flags(self, flags)
2055    }
2056
2057    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2058    /// volume has different settings or the storage is accounted seperately from the rest of the
2059    /// filesystem that may be reported instead of filesystem-wide details.
2060    pub fn r#query_filesystem(
2061        &self,
2062    ) -> fidl::client::QueryResponseFut<
2063        (i32, Option<Box<FilesystemInfo>>),
2064        fidl::encoding::DefaultFuchsiaResourceDialect,
2065    > {
2066        DirectoryProxyInterface::r#query_filesystem(self)
2067    }
2068
2069    /// Acquires a token which can be used to identify this connection at a later point in
2070    /// time. The token will remain valid for as long as the connection requesting the token
2071    /// remains open.
2072    ///
2073    /// This method does not require any rights. Note that the token identifies
2074    /// the connection, hence carries the rights information on this connection.
2075    pub fn r#get_token(
2076        &self,
2077    ) -> fidl::client::QueryResponseFut<
2078        NodeGetTokenResult,
2079        fidl::encoding::DefaultFuchsiaResourceDialect,
2080    > {
2081        DirectoryProxyInterface::r#get_token(self)
2082    }
2083
2084    /// Acquires information about the node.
2085    ///
2086    /// The attributes of a node should be stable, independent of the
2087    /// specific protocol used to access it.
2088    ///
2089    /// If a particular attribute is not applicable or not supported,
2090    /// filesystems should leave the corresponding field absent.
2091    ///
2092    /// + `query` a bit-mask specifying which attributes to fetch. The server
2093    ///   should not return more than necessary.
2094    /// - `attributes` the returned attributes.
2095    ///
2096    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2097    pub fn r#get_attributes(
2098        &self,
2099        mut query: NodeAttributesQuery,
2100    ) -> fidl::client::QueryResponseFut<
2101        NodeGetAttributesResult,
2102        fidl::encoding::DefaultFuchsiaResourceDialect,
2103    > {
2104        DirectoryProxyInterface::r#get_attributes(self, query)
2105    }
2106
2107    /// Updates information about the node.
2108    ///
2109    /// + `attributes` the presence of a table field in `attributes` indicates
2110    /// the intent to update the corresponding attribute.
2111    ///
2112    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2113    ///
2114    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2115    pub fn r#update_attributes(
2116        &self,
2117        mut payload: &MutableNodeAttributes,
2118    ) -> fidl::client::QueryResponseFut<
2119        NodeUpdateAttributesResult,
2120        fidl::encoding::DefaultFuchsiaResourceDialect,
2121    > {
2122        DirectoryProxyInterface::r#update_attributes(self, payload)
2123    }
2124
2125    /// Synchronizes updates to the node to the underlying media, if it exists.
2126    ///
2127    /// This method will return when the filesystem server has flushed the
2128    /// relevant updates to the underlying media, but does not guarantee the
2129    /// underlying media has persisted the information, nor that any information
2130    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2131    /// between operations.
2132    ///
2133    /// This method does not require any rights.
2134    pub fn r#sync(
2135        &self,
2136    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2137    {
2138        DirectoryProxyInterface::r#sync(self)
2139    }
2140
2141    /// Creates an iterator over all the extended attribute names associated
2142    /// with this node. If an error occurs it is returned as an epitaph on the
2143    /// iterator request channel, and then the channel is closed.
2144    ///
2145    /// GetExtendedAttributes can be used with any of these names to retrieve
2146    /// the associated value.
2147    ///
2148    /// This method requires the [`Rights.READ_BYTES`] right.
2149    pub fn r#list_extended_attributes(
2150        &self,
2151        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2152    ) -> Result<(), fidl::Error> {
2153        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2154    }
2155
2156    /// Get the value associated with the given attribute `name` for this node.
2157    ///
2158    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2159    /// particular structure is imposed on them.
2160    ///
2161    /// This method requires the [`Rights.READ_BYTES`] right.
2162    pub fn r#get_extended_attribute(
2163        &self,
2164        mut name: &[u8],
2165    ) -> fidl::client::QueryResponseFut<
2166        NodeGetExtendedAttributeResult,
2167        fidl::encoding::DefaultFuchsiaResourceDialect,
2168    > {
2169        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2170    }
2171
2172    /// Set the value for the given attribute `name` to `value` for this node.
2173    ///
2174    /// The attribute name may exist, in which case the attribute is updated.
2175    /// If the attribute doesn't exist, it is created. The name should have no
2176    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2177    ///
2178    /// This method requires the [`Rights.WRITE_BYTES`] right.
2179    pub fn r#set_extended_attribute(
2180        &self,
2181        mut name: &[u8],
2182        mut value: ExtendedAttributeValue,
2183        mut mode: SetExtendedAttributeMode,
2184    ) -> fidl::client::QueryResponseFut<
2185        NodeSetExtendedAttributeResult,
2186        fidl::encoding::DefaultFuchsiaResourceDialect,
2187    > {
2188        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2189    }
2190
2191    /// Remove the specified extended attribute.
2192    ///
2193    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2194    ///
2195    /// This method requires the [`Rights.WRITE_BYTES`] right.
2196    pub fn r#remove_extended_attribute(
2197        &self,
2198        mut name: &[u8],
2199    ) -> fidl::client::QueryResponseFut<
2200        NodeRemoveExtendedAttributeResult,
2201        fidl::encoding::DefaultFuchsiaResourceDialect,
2202    > {
2203        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2204    }
2205
2206    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2207    /// epitaph sent on the `object` channel.
2208    ///
2209    /// Errors:
2210    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2211    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2212    pub fn r#open(
2213        &self,
2214        mut path: &str,
2215        mut flags: Flags,
2216        mut options: &Options,
2217        mut object: fidl::Channel,
2218    ) -> Result<(), fidl::Error> {
2219        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2220    }
2221
2222    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2223    pub fn r#deprecated_open(
2224        &self,
2225        mut flags: OpenFlags,
2226        mut mode: ModeType,
2227        mut path: &str,
2228        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2229    ) -> Result<(), fidl::Error> {
2230        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2231    }
2232
2233    /// Reads a collection of variably sized dirents into a buffer.
2234    /// The number of dirents in a directory may be very large: akin to
2235    /// calling read multiple times on a file, directories have a seek
2236    /// offset which is updated on subsequent calls to ReadDirents.
2237    /// Each call to ReadDirents will only return whole dirent structures,
2238    /// they will not get split across ReadDirent calls. When the seek
2239    /// offset reaches the end, `dirents` will be empty.
2240    ///
2241    /// These dirents are of the form:
2242    /// ```
2243    /// struct dirent {
2244    ///   // Describes the inode of the entry.
2245    ///   uint64 ino;
2246    ///   // Describes the length of the dirent name in bytes.
2247    ///   uint8 size;
2248    ///   // Describes the type of the entry. Aligned with the
2249    ///   // POSIX d_type values. Use `DirentType` constants.
2250    ///   uint8 type;
2251    ///   // Unterminated name of entry.
2252    ///   char name[0];
2253    /// }
2254    /// ```
2255    ///
2256    /// This method requires the following rights:
2257    ///
2258    /// * [`Rights.ENUMERATE`]
2259    pub fn r#read_dirents(
2260        &self,
2261        mut max_bytes: u64,
2262    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2263    {
2264        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2265    }
2266
2267    /// Resets the directory seek offset.
2268    ///
2269    /// This method requires the following rights:
2270    ///
2271    /// * [`Rights.ENUMERATE`]
2272    pub fn r#rewind(
2273        &self,
2274    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2275        DirectoryProxyInterface::r#rewind(self)
2276    }
2277
2278    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2279    /// in time. The token will remain valid for as long as the connection requesting the token
2280    /// remains open.
2281    ///
2282    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2283    /// `ZX_ERR_BAD_HANDLE`.
2284    ///
2285    /// This method is deprecated: use `fuchsia.io/Node.GetToken` instead (once it is added).
2286    pub fn r#deprecated_get_token(
2287        &self,
2288    ) -> fidl::client::QueryResponseFut<
2289        (i32, Option<fidl::NullableHandle>),
2290        fidl::encoding::DefaultFuchsiaResourceDialect,
2291    > {
2292        DirectoryProxyInterface::r#deprecated_get_token(self)
2293    }
2294
2295    /// Creates a link to an object named src by the name dst, within a directory represented by
2296    /// token.
2297    ///
2298    /// `src` must be a resolved object name. Including "/" in the string will
2299    /// return `ZX_ERR_INVALID_ARGS`.
2300    ///
2301    /// `dst` must be a resolved object name. Including "/" in the string will
2302    /// return `ZX_ERR_INVALID_ARGS`.
2303    ///
2304    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2305    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2306    ///
2307    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2308    /// there are two actors operating concurrently, and one actor performs a rename that affects
2309    /// the source within this directory, and the other does a link, each will appear to occur
2310    /// atomically in an unspecified order.
2311    pub fn r#link(
2312        &self,
2313        mut src: &str,
2314        mut dst_parent_token: fidl::NullableHandle,
2315        mut dst: &str,
2316    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2317        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2318    }
2319
2320    /// Removes a child node from the this directory's list of entries.
2321    ///
2322    /// Note: this does not guarantee that the underlying object is destroyed.
2323    /// Although the link will be removed from the containing directory,
2324    /// objects with multiple references (such as files which are still open)
2325    /// will not actually be destroyed until all references are closed.
2326    ///
2327    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2328    ///   [`Rights.WRITE_BYTES`].
2329    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2330    ///   support writing.
2331    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2332    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2333    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2334    ///   containing a remote channel.
2335    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2336    ///     something other than a directory was found.
2337    ///
2338    /// Other errors may be returned for filesystem-specific reasons.
2339    ///
2340    /// This method requires the following rights:
2341    ///
2342    /// * [`Rights.ENUMERATE`]
2343    /// * [`Rights.MODIFY_DIRECTORY`]
2344    pub fn r#unlink(
2345        &self,
2346        mut name: &str,
2347        mut options: &UnlinkOptions,
2348    ) -> fidl::client::QueryResponseFut<
2349        DirectoryUnlinkResult,
2350        fidl::encoding::DefaultFuchsiaResourceDialect,
2351    > {
2352        DirectoryProxyInterface::r#unlink(self, name, options)
2353    }
2354
2355    /// Renames a node named `src` to the name `dst`, in a directory represented
2356    /// by `dst_parent_token`.
2357    ///
2358    /// `src` and `dst` must be valid node names.
2359    /// See [`Name`] for what constitutes a valid name.
2360    ///
2361    /// This method requires the following rights on both the current connection, and the connection
2362    /// identified by `dst_parent_token`:
2363    ///
2364    /// * [`Rights.ENUMERATE`]
2365    /// * [`Rights.MODIFY_DIRECTORY`]
2366    ///
2367    /// The following requirements are necessary to avoid rights escalations.
2368    ///
2369    /// If the source and destination directory differ, the source directory must also have the
2370    /// maximal set of abilities supported for files, which would typically be
2371    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2372    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2373    /// right.
2374    ///
2375    /// If `src` refers to a directory, and differs from the destination directory, then the source
2376    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2377    ///
2378    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2379    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2380    pub fn r#rename(
2381        &self,
2382        mut src: &str,
2383        mut dst_parent_token: fidl::Event,
2384        mut dst: &str,
2385    ) -> fidl::client::QueryResponseFut<
2386        DirectoryRenameResult,
2387        fidl::encoding::DefaultFuchsiaResourceDialect,
2388    > {
2389        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2390    }
2391
2392    /// Creates a symbolic link.
2393    ///
2394    /// `name` is the name to be given to the created symbolic link.
2395    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2396    /// will perform no validation of `target` except for a server chosen maximum length.
2397    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2398    /// on the successfully created node.
2399    ///
2400    /// * [`Rights.MODIFY_DIRECTORY`]
2401    ///
2402    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2403    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2404    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2405    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2406    pub fn r#create_symlink(
2407        &self,
2408        mut name: &str,
2409        mut target: &[u8],
2410        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2411    ) -> fidl::client::QueryResponseFut<
2412        DirectoryCreateSymlinkResult,
2413        fidl::encoding::DefaultFuchsiaResourceDialect,
2414    > {
2415        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2416    }
2417
2418    /// Watches a directory, receiving events of added messages on the
2419    /// watcher request channel.
2420    ///
2421    /// Options must be zero; it is reserved.
2422    ///
2423    /// This method requires the following rights:
2424    ///
2425    /// * [`Rights.ENUMERATE`]
2426    pub fn r#watch(
2427        &self,
2428        mut mask: WatchMask,
2429        mut options: u32,
2430        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2431    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2432        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2433    }
2434}
2435
2436impl DirectoryProxyInterface for DirectoryProxy {
2437    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2438        AdvisoryLockingAdvisoryLockResult,
2439        fidl::encoding::DefaultFuchsiaResourceDialect,
2440    >;
2441    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2442        fn _decode(
2443            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2444        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2445            let _response = fidl::client::decode_transaction_body::<
2446                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2447                fidl::encoding::DefaultFuchsiaResourceDialect,
2448                0x6ee9c0ad53ec87aa,
2449            >(_buf?)?;
2450            Ok(_response.map(|x| x))
2451        }
2452        self.client.send_query_and_decode::<
2453            AdvisoryLockingAdvisoryLockRequest,
2454            AdvisoryLockingAdvisoryLockResult,
2455        >(
2456            (request,),
2457            0x6ee9c0ad53ec87aa,
2458            fidl::encoding::DynamicFlags::empty(),
2459            _decode,
2460        )
2461    }
2462
2463    fn r#clone(
2464        &self,
2465        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2466    ) -> Result<(), fidl::Error> {
2467        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2468            (request,),
2469            0x20d8a7aba2168a79,
2470            fidl::encoding::DynamicFlags::empty(),
2471        )
2472    }
2473
2474    type CloseResponseFut = fidl::client::QueryResponseFut<
2475        fidl_fuchsia_unknown::CloseableCloseResult,
2476        fidl::encoding::DefaultFuchsiaResourceDialect,
2477    >;
2478    fn r#close(&self) -> Self::CloseResponseFut {
2479        fn _decode(
2480            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2481        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2482            let _response = fidl::client::decode_transaction_body::<
2483                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2484                fidl::encoding::DefaultFuchsiaResourceDialect,
2485                0x5ac5d459ad7f657e,
2486            >(_buf?)?;
2487            Ok(_response.map(|x| x))
2488        }
2489        self.client.send_query_and_decode::<
2490            fidl::encoding::EmptyPayload,
2491            fidl_fuchsia_unknown::CloseableCloseResult,
2492        >(
2493            (),
2494            0x5ac5d459ad7f657e,
2495            fidl::encoding::DynamicFlags::empty(),
2496            _decode,
2497        )
2498    }
2499
2500    type QueryResponseFut =
2501        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2502    fn r#query(&self) -> Self::QueryResponseFut {
2503        fn _decode(
2504            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2505        ) -> Result<Vec<u8>, fidl::Error> {
2506            let _response = fidl::client::decode_transaction_body::<
2507                fidl_fuchsia_unknown::QueryableQueryResponse,
2508                fidl::encoding::DefaultFuchsiaResourceDialect,
2509                0x2658edee9decfc06,
2510            >(_buf?)?;
2511            Ok(_response.protocol)
2512        }
2513        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2514            (),
2515            0x2658edee9decfc06,
2516            fidl::encoding::DynamicFlags::empty(),
2517            _decode,
2518        )
2519    }
2520
2521    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2522        (i32, NodeAttributes),
2523        fidl::encoding::DefaultFuchsiaResourceDialect,
2524    >;
2525    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2526        fn _decode(
2527            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2528        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2529            let _response = fidl::client::decode_transaction_body::<
2530                NodeDeprecatedGetAttrResponse,
2531                fidl::encoding::DefaultFuchsiaResourceDialect,
2532                0x78985e216314dafd,
2533            >(_buf?)?;
2534            Ok((_response.s, _response.attributes))
2535        }
2536        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2537            (),
2538            0x78985e216314dafd,
2539            fidl::encoding::DynamicFlags::empty(),
2540            _decode,
2541        )
2542    }
2543
2544    type DeprecatedSetAttrResponseFut =
2545        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2546    fn r#deprecated_set_attr(
2547        &self,
2548        mut flags: NodeAttributeFlags,
2549        mut attributes: &NodeAttributes,
2550    ) -> Self::DeprecatedSetAttrResponseFut {
2551        fn _decode(
2552            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2553        ) -> Result<i32, fidl::Error> {
2554            let _response = fidl::client::decode_transaction_body::<
2555                NodeDeprecatedSetAttrResponse,
2556                fidl::encoding::DefaultFuchsiaResourceDialect,
2557                0x4186c0f40d938f46,
2558            >(_buf?)?;
2559            Ok(_response.s)
2560        }
2561        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2562            (flags, attributes),
2563            0x4186c0f40d938f46,
2564            fidl::encoding::DynamicFlags::empty(),
2565            _decode,
2566        )
2567    }
2568
2569    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2570        (i32, OpenFlags),
2571        fidl::encoding::DefaultFuchsiaResourceDialect,
2572    >;
2573    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2574        fn _decode(
2575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2576        ) -> Result<(i32, OpenFlags), fidl::Error> {
2577            let _response = fidl::client::decode_transaction_body::<
2578                NodeDeprecatedGetFlagsResponse,
2579                fidl::encoding::DefaultFuchsiaResourceDialect,
2580                0x5b88fffb8eda3aa1,
2581            >(_buf?)?;
2582            Ok((_response.s, _response.flags))
2583        }
2584        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2585            (),
2586            0x5b88fffb8eda3aa1,
2587            fidl::encoding::DynamicFlags::empty(),
2588            _decode,
2589        )
2590    }
2591
2592    type DeprecatedSetFlagsResponseFut =
2593        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2594    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2595        fn _decode(
2596            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2597        ) -> Result<i32, fidl::Error> {
2598            let _response = fidl::client::decode_transaction_body::<
2599                NodeDeprecatedSetFlagsResponse,
2600                fidl::encoding::DefaultFuchsiaResourceDialect,
2601                0x5295b76c71fde733,
2602            >(_buf?)?;
2603            Ok(_response.s)
2604        }
2605        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2606            (flags,),
2607            0x5295b76c71fde733,
2608            fidl::encoding::DynamicFlags::empty(),
2609            _decode,
2610        )
2611    }
2612
2613    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2614        NodeGetFlagsResult,
2615        fidl::encoding::DefaultFuchsiaResourceDialect,
2616    >;
2617    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2618        fn _decode(
2619            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2620        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2621            let _response = fidl::client::decode_transaction_body::<
2622                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2623                fidl::encoding::DefaultFuchsiaResourceDialect,
2624                0x176eb318f64ec23,
2625            >(_buf?)?
2626            .into_result::<DirectoryMarker>("get_flags")?;
2627            Ok(_response.map(|x| x.flags))
2628        }
2629        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2630            (),
2631            0x176eb318f64ec23,
2632            fidl::encoding::DynamicFlags::FLEXIBLE,
2633            _decode,
2634        )
2635    }
2636
2637    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2638        NodeSetFlagsResult,
2639        fidl::encoding::DefaultFuchsiaResourceDialect,
2640    >;
2641    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2642        fn _decode(
2643            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2644        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2645            let _response = fidl::client::decode_transaction_body::<
2646                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2647                fidl::encoding::DefaultFuchsiaResourceDialect,
2648                0x55a8028685791ea8,
2649            >(_buf?)?
2650            .into_result::<DirectoryMarker>("set_flags")?;
2651            Ok(_response.map(|x| x))
2652        }
2653        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2654            (flags,),
2655            0x55a8028685791ea8,
2656            fidl::encoding::DynamicFlags::FLEXIBLE,
2657            _decode,
2658        )
2659    }
2660
2661    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2662        (i32, Option<Box<FilesystemInfo>>),
2663        fidl::encoding::DefaultFuchsiaResourceDialect,
2664    >;
2665    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2666        fn _decode(
2667            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2668        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2669            let _response = fidl::client::decode_transaction_body::<
2670                NodeQueryFilesystemResponse,
2671                fidl::encoding::DefaultFuchsiaResourceDialect,
2672                0x6f344a1c6b0a0610,
2673            >(_buf?)?;
2674            Ok((_response.s, _response.info))
2675        }
2676        self.client.send_query_and_decode::<
2677            fidl::encoding::EmptyPayload,
2678            (i32, Option<Box<FilesystemInfo>>),
2679        >(
2680            (),
2681            0x6f344a1c6b0a0610,
2682            fidl::encoding::DynamicFlags::empty(),
2683            _decode,
2684        )
2685    }
2686
2687    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2688        NodeGetTokenResult,
2689        fidl::encoding::DefaultFuchsiaResourceDialect,
2690    >;
2691    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2692        fn _decode(
2693            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2694        ) -> Result<NodeGetTokenResult, fidl::Error> {
2695            let _response = fidl::client::decode_transaction_body::<
2696                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
2697                fidl::encoding::DefaultFuchsiaResourceDialect,
2698                0x5054f0ade7076cec,
2699            >(_buf?)?
2700            .into_result::<DirectoryMarker>("get_token")?;
2701            Ok(_response.map(|x| x.token))
2702        }
2703        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
2704            (),
2705            0x5054f0ade7076cec,
2706            fidl::encoding::DynamicFlags::FLEXIBLE,
2707            _decode,
2708        )
2709    }
2710
2711    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2712        NodeGetAttributesResult,
2713        fidl::encoding::DefaultFuchsiaResourceDialect,
2714    >;
2715    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2716        fn _decode(
2717            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2718        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2719            let _response = fidl::client::decode_transaction_body::<
2720                fidl::encoding::ResultType<NodeAttributes2, i32>,
2721                fidl::encoding::DefaultFuchsiaResourceDialect,
2722                0x3d4396a638ea053b,
2723            >(_buf?)?;
2724            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2725        }
2726        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2727            (query,),
2728            0x3d4396a638ea053b,
2729            fidl::encoding::DynamicFlags::empty(),
2730            _decode,
2731        )
2732    }
2733
2734    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2735        NodeUpdateAttributesResult,
2736        fidl::encoding::DefaultFuchsiaResourceDialect,
2737    >;
2738    fn r#update_attributes(
2739        &self,
2740        mut payload: &MutableNodeAttributes,
2741    ) -> Self::UpdateAttributesResponseFut {
2742        fn _decode(
2743            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2744        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2745            let _response = fidl::client::decode_transaction_body::<
2746                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2747                fidl::encoding::DefaultFuchsiaResourceDialect,
2748                0x3308c1da5a89bf08,
2749            >(_buf?)?;
2750            Ok(_response.map(|x| x))
2751        }
2752        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2753            payload,
2754            0x3308c1da5a89bf08,
2755            fidl::encoding::DynamicFlags::empty(),
2756            _decode,
2757        )
2758    }
2759
2760    type SyncResponseFut = fidl::client::QueryResponseFut<
2761        NodeSyncResult,
2762        fidl::encoding::DefaultFuchsiaResourceDialect,
2763    >;
2764    fn r#sync(&self) -> Self::SyncResponseFut {
2765        fn _decode(
2766            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2767        ) -> Result<NodeSyncResult, fidl::Error> {
2768            let _response = fidl::client::decode_transaction_body::<
2769                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2770                fidl::encoding::DefaultFuchsiaResourceDialect,
2771                0x2c5c27ca0ab5dc49,
2772            >(_buf?)?;
2773            Ok(_response.map(|x| x))
2774        }
2775        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2776            (),
2777            0x2c5c27ca0ab5dc49,
2778            fidl::encoding::DynamicFlags::empty(),
2779            _decode,
2780        )
2781    }
2782
2783    fn r#list_extended_attributes(
2784        &self,
2785        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2786    ) -> Result<(), fidl::Error> {
2787        self.client.send::<NodeListExtendedAttributesRequest>(
2788            (iterator,),
2789            0x4b61033de007fcd0,
2790            fidl::encoding::DynamicFlags::empty(),
2791        )
2792    }
2793
2794    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2795        NodeGetExtendedAttributeResult,
2796        fidl::encoding::DefaultFuchsiaResourceDialect,
2797    >;
2798    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2799        fn _decode(
2800            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2801        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2802            let _response = fidl::client::decode_transaction_body::<
2803                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2804                fidl::encoding::DefaultFuchsiaResourceDialect,
2805                0x45ffa3ccfdeb76db,
2806            >(_buf?)?;
2807            Ok(_response.map(|x| x))
2808        }
2809        self.client.send_query_and_decode::<
2810            NodeGetExtendedAttributeRequest,
2811            NodeGetExtendedAttributeResult,
2812        >(
2813            (name,),
2814            0x45ffa3ccfdeb76db,
2815            fidl::encoding::DynamicFlags::empty(),
2816            _decode,
2817        )
2818    }
2819
2820    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2821        NodeSetExtendedAttributeResult,
2822        fidl::encoding::DefaultFuchsiaResourceDialect,
2823    >;
2824    fn r#set_extended_attribute(
2825        &self,
2826        mut name: &[u8],
2827        mut value: ExtendedAttributeValue,
2828        mut mode: SetExtendedAttributeMode,
2829    ) -> Self::SetExtendedAttributeResponseFut {
2830        fn _decode(
2831            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2832        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2833            let _response = fidl::client::decode_transaction_body::<
2834                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2835                fidl::encoding::DefaultFuchsiaResourceDialect,
2836                0x4a951362f681f23c,
2837            >(_buf?)?;
2838            Ok(_response.map(|x| x))
2839        }
2840        self.client.send_query_and_decode::<
2841            NodeSetExtendedAttributeRequest,
2842            NodeSetExtendedAttributeResult,
2843        >(
2844            (name, &mut value, mode,),
2845            0x4a951362f681f23c,
2846            fidl::encoding::DynamicFlags::empty(),
2847            _decode,
2848        )
2849    }
2850
2851    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2852        NodeRemoveExtendedAttributeResult,
2853        fidl::encoding::DefaultFuchsiaResourceDialect,
2854    >;
2855    fn r#remove_extended_attribute(
2856        &self,
2857        mut name: &[u8],
2858    ) -> Self::RemoveExtendedAttributeResponseFut {
2859        fn _decode(
2860            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2861        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2862            let _response = fidl::client::decode_transaction_body::<
2863                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2864                fidl::encoding::DefaultFuchsiaResourceDialect,
2865                0x7a0b9f3a9bf9032d,
2866            >(_buf?)?;
2867            Ok(_response.map(|x| x))
2868        }
2869        self.client.send_query_and_decode::<
2870            NodeRemoveExtendedAttributeRequest,
2871            NodeRemoveExtendedAttributeResult,
2872        >(
2873            (name,),
2874            0x7a0b9f3a9bf9032d,
2875            fidl::encoding::DynamicFlags::empty(),
2876            _decode,
2877        )
2878    }
2879
2880    fn r#open(
2881        &self,
2882        mut path: &str,
2883        mut flags: Flags,
2884        mut options: &Options,
2885        mut object: fidl::Channel,
2886    ) -> Result<(), fidl::Error> {
2887        self.client.send::<OpenableOpenRequest>(
2888            (path, flags, options, object),
2889            0x568ddcb9a9cbb6d9,
2890            fidl::encoding::DynamicFlags::FLEXIBLE,
2891        )
2892    }
2893
2894    fn r#deprecated_open(
2895        &self,
2896        mut flags: OpenFlags,
2897        mut mode: ModeType,
2898        mut path: &str,
2899        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2900    ) -> Result<(), fidl::Error> {
2901        self.client.send::<DirectoryDeprecatedOpenRequest>(
2902            (flags, mode, path, object),
2903            0x2c5044561d685ec0,
2904            fidl::encoding::DynamicFlags::FLEXIBLE,
2905        )
2906    }
2907
2908    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2909        (i32, Vec<u8>),
2910        fidl::encoding::DefaultFuchsiaResourceDialect,
2911    >;
2912    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2913        fn _decode(
2914            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2915        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2916            let _response = fidl::client::decode_transaction_body::<
2917                DirectoryReadDirentsResponse,
2918                fidl::encoding::DefaultFuchsiaResourceDialect,
2919                0x3582806bf27faa0a,
2920            >(_buf?)?;
2921            Ok((_response.s, _response.dirents))
2922        }
2923        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2924            (max_bytes,),
2925            0x3582806bf27faa0a,
2926            fidl::encoding::DynamicFlags::empty(),
2927            _decode,
2928        )
2929    }
2930
2931    type RewindResponseFut =
2932        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2933    fn r#rewind(&self) -> Self::RewindResponseFut {
2934        fn _decode(
2935            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2936        ) -> Result<i32, fidl::Error> {
2937            let _response = fidl::client::decode_transaction_body::<
2938                DirectoryRewindResponse,
2939                fidl::encoding::DefaultFuchsiaResourceDialect,
2940                0x16b1202af0f34c71,
2941            >(_buf?)?;
2942            Ok(_response.s)
2943        }
2944        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2945            (),
2946            0x16b1202af0f34c71,
2947            fidl::encoding::DynamicFlags::empty(),
2948            _decode,
2949        )
2950    }
2951
2952    type DeprecatedGetTokenResponseFut = fidl::client::QueryResponseFut<
2953        (i32, Option<fidl::NullableHandle>),
2954        fidl::encoding::DefaultFuchsiaResourceDialect,
2955    >;
2956    fn r#deprecated_get_token(&self) -> Self::DeprecatedGetTokenResponseFut {
2957        fn _decode(
2958            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2959        ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
2960            let _response = fidl::client::decode_transaction_body::<
2961                DirectoryDeprecatedGetTokenResponse,
2962                fidl::encoding::DefaultFuchsiaResourceDialect,
2963                0x26ae9d18763c8655,
2964            >(_buf?)?;
2965            Ok((_response.s, _response.token))
2966        }
2967        self.client.send_query_and_decode::<
2968            fidl::encoding::EmptyPayload,
2969            (i32, Option<fidl::NullableHandle>),
2970        >(
2971            (),
2972            0x26ae9d18763c8655,
2973            fidl::encoding::DynamicFlags::empty(),
2974            _decode,
2975        )
2976    }
2977
2978    type LinkResponseFut =
2979        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2980    fn r#link(
2981        &self,
2982        mut src: &str,
2983        mut dst_parent_token: fidl::NullableHandle,
2984        mut dst: &str,
2985    ) -> Self::LinkResponseFut {
2986        fn _decode(
2987            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2988        ) -> Result<i32, fidl::Error> {
2989            let _response = fidl::client::decode_transaction_body::<
2990                DirectoryLinkResponse,
2991                fidl::encoding::DefaultFuchsiaResourceDialect,
2992                0x740604c0c7c930e7,
2993            >(_buf?)?;
2994            Ok(_response.s)
2995        }
2996        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2997            (src, dst_parent_token, dst),
2998            0x740604c0c7c930e7,
2999            fidl::encoding::DynamicFlags::empty(),
3000            _decode,
3001        )
3002    }
3003
3004    type UnlinkResponseFut = fidl::client::QueryResponseFut<
3005        DirectoryUnlinkResult,
3006        fidl::encoding::DefaultFuchsiaResourceDialect,
3007    >;
3008    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
3009        fn _decode(
3010            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3011        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
3012            let _response = fidl::client::decode_transaction_body::<
3013                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3014                fidl::encoding::DefaultFuchsiaResourceDialect,
3015                0x750a0326a78d7bed,
3016            >(_buf?)?;
3017            Ok(_response.map(|x| x))
3018        }
3019        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
3020            (name, options),
3021            0x750a0326a78d7bed,
3022            fidl::encoding::DynamicFlags::empty(),
3023            _decode,
3024        )
3025    }
3026
3027    type RenameResponseFut = fidl::client::QueryResponseFut<
3028        DirectoryRenameResult,
3029        fidl::encoding::DefaultFuchsiaResourceDialect,
3030    >;
3031    fn r#rename(
3032        &self,
3033        mut src: &str,
3034        mut dst_parent_token: fidl::Event,
3035        mut dst: &str,
3036    ) -> Self::RenameResponseFut {
3037        fn _decode(
3038            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3039        ) -> Result<DirectoryRenameResult, fidl::Error> {
3040            let _response = fidl::client::decode_transaction_body::<
3041                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3042                fidl::encoding::DefaultFuchsiaResourceDialect,
3043                0x7060e7723b9928de,
3044            >(_buf?)?;
3045            Ok(_response.map(|x| x))
3046        }
3047        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
3048            (src, dst_parent_token, dst),
3049            0x7060e7723b9928de,
3050            fidl::encoding::DynamicFlags::empty(),
3051            _decode,
3052        )
3053    }
3054
3055    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
3056        DirectoryCreateSymlinkResult,
3057        fidl::encoding::DefaultFuchsiaResourceDialect,
3058    >;
3059    fn r#create_symlink(
3060        &self,
3061        mut name: &str,
3062        mut target: &[u8],
3063        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
3064    ) -> Self::CreateSymlinkResponseFut {
3065        fn _decode(
3066            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3067        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
3068            let _response = fidl::client::decode_transaction_body::<
3069                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3070                fidl::encoding::DefaultFuchsiaResourceDialect,
3071                0x21ce0f19ec043889,
3072            >(_buf?)?;
3073            Ok(_response.map(|x| x))
3074        }
3075        self.client
3076            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
3077                (name, target, connection),
3078                0x21ce0f19ec043889,
3079                fidl::encoding::DynamicFlags::empty(),
3080                _decode,
3081            )
3082    }
3083
3084    type WatchResponseFut =
3085        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3086    fn r#watch(
3087        &self,
3088        mut mask: WatchMask,
3089        mut options: u32,
3090        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
3091    ) -> Self::WatchResponseFut {
3092        fn _decode(
3093            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3094        ) -> Result<i32, fidl::Error> {
3095            let _response = fidl::client::decode_transaction_body::<
3096                DirectoryWatchResponse,
3097                fidl::encoding::DefaultFuchsiaResourceDialect,
3098                0x5717193a59d66d91,
3099            >(_buf?)?;
3100            Ok(_response.s)
3101        }
3102        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3103            (mask, options, watcher),
3104            0x5717193a59d66d91,
3105            fidl::encoding::DynamicFlags::empty(),
3106            _decode,
3107        )
3108    }
3109}
3110
3111pub struct DirectoryEventStream {
3112    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3113}
3114
3115impl std::marker::Unpin for DirectoryEventStream {}
3116
3117impl futures::stream::FusedStream for DirectoryEventStream {
3118    fn is_terminated(&self) -> bool {
3119        self.event_receiver.is_terminated()
3120    }
3121}
3122
3123impl futures::Stream for DirectoryEventStream {
3124    type Item = Result<DirectoryEvent, fidl::Error>;
3125
3126    fn poll_next(
3127        mut self: std::pin::Pin<&mut Self>,
3128        cx: &mut std::task::Context<'_>,
3129    ) -> std::task::Poll<Option<Self::Item>> {
3130        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3131            &mut self.event_receiver,
3132            cx
3133        )?) {
3134            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3135            None => std::task::Poll::Ready(None),
3136        }
3137    }
3138}
3139
3140#[derive(Debug)]
3141pub enum DirectoryEvent {
3142    OnOpen_ {
3143        s: i32,
3144        info: Option<Box<NodeInfoDeprecated>>,
3145    },
3146    OnRepresentation {
3147        payload: Representation,
3148    },
3149    #[non_exhaustive]
3150    _UnknownEvent {
3151        /// Ordinal of the event that was sent.
3152        ordinal: u64,
3153    },
3154}
3155
3156impl DirectoryEvent {
3157    #[allow(irrefutable_let_patterns)]
3158    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3159        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3160    }
3161    #[allow(irrefutable_let_patterns)]
3162    pub fn into_on_representation(self) -> Option<Representation> {
3163        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3164    }
3165
3166    /// Decodes a message buffer as a [`DirectoryEvent`].
3167    fn decode(
3168        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3169    ) -> Result<DirectoryEvent, fidl::Error> {
3170        let (bytes, _handles) = buf.split_mut();
3171        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3172        debug_assert_eq!(tx_header.tx_id, 0);
3173        match tx_header.ordinal {
3174            0x7fc7bbb1dbfd1972 => {
3175                let mut out = fidl::new_empty!(
3176                    NodeOnOpenRequest,
3177                    fidl::encoding::DefaultFuchsiaResourceDialect
3178                );
3179                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3180                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3181            }
3182            0x5cb40567d80a510c => {
3183                let mut out =
3184                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3185                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3186                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3187            }
3188            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3189                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3190            }
3191            _ => Err(fidl::Error::UnknownOrdinal {
3192                ordinal: tx_header.ordinal,
3193                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3194            }),
3195        }
3196    }
3197}
3198
3199/// A Stream of incoming requests for fuchsia.io/Directory.
3200pub struct DirectoryRequestStream {
3201    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3202    is_terminated: bool,
3203}
3204
3205impl std::marker::Unpin for DirectoryRequestStream {}
3206
3207impl futures::stream::FusedStream for DirectoryRequestStream {
3208    fn is_terminated(&self) -> bool {
3209        self.is_terminated
3210    }
3211}
3212
3213impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3214    type Protocol = DirectoryMarker;
3215    type ControlHandle = DirectoryControlHandle;
3216
3217    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3218        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3219    }
3220
3221    fn control_handle(&self) -> Self::ControlHandle {
3222        DirectoryControlHandle { inner: self.inner.clone() }
3223    }
3224
3225    fn into_inner(
3226        self,
3227    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3228    {
3229        (self.inner, self.is_terminated)
3230    }
3231
3232    fn from_inner(
3233        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3234        is_terminated: bool,
3235    ) -> Self {
3236        Self { inner, is_terminated }
3237    }
3238}
3239
3240impl futures::Stream for DirectoryRequestStream {
3241    type Item = Result<DirectoryRequest, fidl::Error>;
3242
3243    fn poll_next(
3244        mut self: std::pin::Pin<&mut Self>,
3245        cx: &mut std::task::Context<'_>,
3246    ) -> std::task::Poll<Option<Self::Item>> {
3247        let this = &mut *self;
3248        if this.inner.check_shutdown(cx) {
3249            this.is_terminated = true;
3250            return std::task::Poll::Ready(None);
3251        }
3252        if this.is_terminated {
3253            panic!("polled DirectoryRequestStream after completion");
3254        }
3255        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3256            |bytes, handles| {
3257                match this.inner.channel().read_etc(cx, bytes, handles) {
3258                    std::task::Poll::Ready(Ok(())) => {}
3259                    std::task::Poll::Pending => return std::task::Poll::Pending,
3260                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3261                        this.is_terminated = true;
3262                        return std::task::Poll::Ready(None);
3263                    }
3264                    std::task::Poll::Ready(Err(e)) => {
3265                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3266                            e.into(),
3267                        ))));
3268                    }
3269                }
3270
3271                // A message has been received from the channel
3272                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3273
3274                std::task::Poll::Ready(Some(match header.ordinal {
3275                    0x6ee9c0ad53ec87aa => {
3276                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3277                        let mut req = fidl::new_empty!(
3278                            AdvisoryLockingAdvisoryLockRequest,
3279                            fidl::encoding::DefaultFuchsiaResourceDialect
3280                        );
3281                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3282                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3283                        Ok(DirectoryRequest::AdvisoryLock {
3284                            request: req.request,
3285
3286                            responder: DirectoryAdvisoryLockResponder {
3287                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3288                                tx_id: header.tx_id,
3289                            },
3290                        })
3291                    }
3292                    0x20d8a7aba2168a79 => {
3293                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3294                        let mut req = fidl::new_empty!(
3295                            fidl_fuchsia_unknown::CloneableCloneRequest,
3296                            fidl::encoding::DefaultFuchsiaResourceDialect
3297                        );
3298                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3299                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3300                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3301                    }
3302                    0x5ac5d459ad7f657e => {
3303                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3304                        let mut req = fidl::new_empty!(
3305                            fidl::encoding::EmptyPayload,
3306                            fidl::encoding::DefaultFuchsiaResourceDialect
3307                        );
3308                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3309                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3310                        Ok(DirectoryRequest::Close {
3311                            responder: DirectoryCloseResponder {
3312                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3313                                tx_id: header.tx_id,
3314                            },
3315                        })
3316                    }
3317                    0x2658edee9decfc06 => {
3318                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3319                        let mut req = fidl::new_empty!(
3320                            fidl::encoding::EmptyPayload,
3321                            fidl::encoding::DefaultFuchsiaResourceDialect
3322                        );
3323                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3324                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3325                        Ok(DirectoryRequest::Query {
3326                            responder: DirectoryQueryResponder {
3327                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3328                                tx_id: header.tx_id,
3329                            },
3330                        })
3331                    }
3332                    0x78985e216314dafd => {
3333                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3334                        let mut req = fidl::new_empty!(
3335                            fidl::encoding::EmptyPayload,
3336                            fidl::encoding::DefaultFuchsiaResourceDialect
3337                        );
3338                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3339                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3340                        Ok(DirectoryRequest::DeprecatedGetAttr {
3341                            responder: DirectoryDeprecatedGetAttrResponder {
3342                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3343                                tx_id: header.tx_id,
3344                            },
3345                        })
3346                    }
3347                    0x4186c0f40d938f46 => {
3348                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3349                        let mut req = fidl::new_empty!(
3350                            NodeDeprecatedSetAttrRequest,
3351                            fidl::encoding::DefaultFuchsiaResourceDialect
3352                        );
3353                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3354                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3355                        Ok(DirectoryRequest::DeprecatedSetAttr {
3356                            flags: req.flags,
3357                            attributes: req.attributes,
3358
3359                            responder: DirectoryDeprecatedSetAttrResponder {
3360                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3361                                tx_id: header.tx_id,
3362                            },
3363                        })
3364                    }
3365                    0x5b88fffb8eda3aa1 => {
3366                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3367                        let mut req = fidl::new_empty!(
3368                            fidl::encoding::EmptyPayload,
3369                            fidl::encoding::DefaultFuchsiaResourceDialect
3370                        );
3371                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3372                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3373                        Ok(DirectoryRequest::DeprecatedGetFlags {
3374                            responder: DirectoryDeprecatedGetFlagsResponder {
3375                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3376                                tx_id: header.tx_id,
3377                            },
3378                        })
3379                    }
3380                    0x5295b76c71fde733 => {
3381                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3382                        let mut req = fidl::new_empty!(
3383                            NodeDeprecatedSetFlagsRequest,
3384                            fidl::encoding::DefaultFuchsiaResourceDialect
3385                        );
3386                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3387                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3388                        Ok(DirectoryRequest::DeprecatedSetFlags {
3389                            flags: req.flags,
3390
3391                            responder: DirectoryDeprecatedSetFlagsResponder {
3392                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3393                                tx_id: header.tx_id,
3394                            },
3395                        })
3396                    }
3397                    0x176eb318f64ec23 => {
3398                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3399                        let mut req = fidl::new_empty!(
3400                            fidl::encoding::EmptyPayload,
3401                            fidl::encoding::DefaultFuchsiaResourceDialect
3402                        );
3403                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3404                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3405                        Ok(DirectoryRequest::GetFlags {
3406                            responder: DirectoryGetFlagsResponder {
3407                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3408                                tx_id: header.tx_id,
3409                            },
3410                        })
3411                    }
3412                    0x55a8028685791ea8 => {
3413                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3414                        let mut req = fidl::new_empty!(
3415                            NodeSetFlagsRequest,
3416                            fidl::encoding::DefaultFuchsiaResourceDialect
3417                        );
3418                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3419                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3420                        Ok(DirectoryRequest::SetFlags {
3421                            flags: req.flags,
3422
3423                            responder: DirectorySetFlagsResponder {
3424                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3425                                tx_id: header.tx_id,
3426                            },
3427                        })
3428                    }
3429                    0x6f344a1c6b0a0610 => {
3430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3431                        let mut req = fidl::new_empty!(
3432                            fidl::encoding::EmptyPayload,
3433                            fidl::encoding::DefaultFuchsiaResourceDialect
3434                        );
3435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3436                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3437                        Ok(DirectoryRequest::QueryFilesystem {
3438                            responder: DirectoryQueryFilesystemResponder {
3439                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3440                                tx_id: header.tx_id,
3441                            },
3442                        })
3443                    }
3444                    0x5054f0ade7076cec => {
3445                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3446                        let mut req = fidl::new_empty!(
3447                            fidl::encoding::EmptyPayload,
3448                            fidl::encoding::DefaultFuchsiaResourceDialect
3449                        );
3450                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3451                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3452                        Ok(DirectoryRequest::GetToken {
3453                            responder: DirectoryGetTokenResponder {
3454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3455                                tx_id: header.tx_id,
3456                            },
3457                        })
3458                    }
3459                    0x3d4396a638ea053b => {
3460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3461                        let mut req = fidl::new_empty!(
3462                            NodeGetAttributesRequest,
3463                            fidl::encoding::DefaultFuchsiaResourceDialect
3464                        );
3465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3466                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3467                        Ok(DirectoryRequest::GetAttributes {
3468                            query: req.query,
3469
3470                            responder: DirectoryGetAttributesResponder {
3471                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3472                                tx_id: header.tx_id,
3473                            },
3474                        })
3475                    }
3476                    0x3308c1da5a89bf08 => {
3477                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3478                        let mut req = fidl::new_empty!(
3479                            MutableNodeAttributes,
3480                            fidl::encoding::DefaultFuchsiaResourceDialect
3481                        );
3482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3483                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3484                        Ok(DirectoryRequest::UpdateAttributes {
3485                            payload: req,
3486                            responder: DirectoryUpdateAttributesResponder {
3487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3488                                tx_id: header.tx_id,
3489                            },
3490                        })
3491                    }
3492                    0x2c5c27ca0ab5dc49 => {
3493                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3494                        let mut req = fidl::new_empty!(
3495                            fidl::encoding::EmptyPayload,
3496                            fidl::encoding::DefaultFuchsiaResourceDialect
3497                        );
3498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3499                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3500                        Ok(DirectoryRequest::Sync {
3501                            responder: DirectorySyncResponder {
3502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3503                                tx_id: header.tx_id,
3504                            },
3505                        })
3506                    }
3507                    0x4b61033de007fcd0 => {
3508                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3509                        let mut req = fidl::new_empty!(
3510                            NodeListExtendedAttributesRequest,
3511                            fidl::encoding::DefaultFuchsiaResourceDialect
3512                        );
3513                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3514                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3515                        Ok(DirectoryRequest::ListExtendedAttributes {
3516                            iterator: req.iterator,
3517
3518                            control_handle,
3519                        })
3520                    }
3521                    0x45ffa3ccfdeb76db => {
3522                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3523                        let mut req = fidl::new_empty!(
3524                            NodeGetExtendedAttributeRequest,
3525                            fidl::encoding::DefaultFuchsiaResourceDialect
3526                        );
3527                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3528                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3529                        Ok(DirectoryRequest::GetExtendedAttribute {
3530                            name: req.name,
3531
3532                            responder: DirectoryGetExtendedAttributeResponder {
3533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3534                                tx_id: header.tx_id,
3535                            },
3536                        })
3537                    }
3538                    0x4a951362f681f23c => {
3539                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3540                        let mut req = fidl::new_empty!(
3541                            NodeSetExtendedAttributeRequest,
3542                            fidl::encoding::DefaultFuchsiaResourceDialect
3543                        );
3544                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3545                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3546                        Ok(DirectoryRequest::SetExtendedAttribute {
3547                            name: req.name,
3548                            value: req.value,
3549                            mode: req.mode,
3550
3551                            responder: DirectorySetExtendedAttributeResponder {
3552                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3553                                tx_id: header.tx_id,
3554                            },
3555                        })
3556                    }
3557                    0x7a0b9f3a9bf9032d => {
3558                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3559                        let mut req = fidl::new_empty!(
3560                            NodeRemoveExtendedAttributeRequest,
3561                            fidl::encoding::DefaultFuchsiaResourceDialect
3562                        );
3563                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3564                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3565                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3566                            name: req.name,
3567
3568                            responder: DirectoryRemoveExtendedAttributeResponder {
3569                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3570                                tx_id: header.tx_id,
3571                            },
3572                        })
3573                    }
3574                    0x568ddcb9a9cbb6d9 => {
3575                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3576                        let mut req = fidl::new_empty!(
3577                            OpenableOpenRequest,
3578                            fidl::encoding::DefaultFuchsiaResourceDialect
3579                        );
3580                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3581                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3582                        Ok(DirectoryRequest::Open {
3583                            path: req.path,
3584                            flags: req.flags,
3585                            options: req.options,
3586                            object: req.object,
3587
3588                            control_handle,
3589                        })
3590                    }
3591                    0x2c5044561d685ec0 => {
3592                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3593                        let mut req = fidl::new_empty!(
3594                            DirectoryDeprecatedOpenRequest,
3595                            fidl::encoding::DefaultFuchsiaResourceDialect
3596                        );
3597                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3598                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3599                        Ok(DirectoryRequest::DeprecatedOpen {
3600                            flags: req.flags,
3601                            mode: req.mode,
3602                            path: req.path,
3603                            object: req.object,
3604
3605                            control_handle,
3606                        })
3607                    }
3608                    0x3582806bf27faa0a => {
3609                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3610                        let mut req = fidl::new_empty!(
3611                            DirectoryReadDirentsRequest,
3612                            fidl::encoding::DefaultFuchsiaResourceDialect
3613                        );
3614                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3615                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3616                        Ok(DirectoryRequest::ReadDirents {
3617                            max_bytes: req.max_bytes,
3618
3619                            responder: DirectoryReadDirentsResponder {
3620                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3621                                tx_id: header.tx_id,
3622                            },
3623                        })
3624                    }
3625                    0x16b1202af0f34c71 => {
3626                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3627                        let mut req = fidl::new_empty!(
3628                            fidl::encoding::EmptyPayload,
3629                            fidl::encoding::DefaultFuchsiaResourceDialect
3630                        );
3631                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3632                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3633                        Ok(DirectoryRequest::Rewind {
3634                            responder: DirectoryRewindResponder {
3635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3636                                tx_id: header.tx_id,
3637                            },
3638                        })
3639                    }
3640                    0x26ae9d18763c8655 => {
3641                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3642                        let mut req = fidl::new_empty!(
3643                            fidl::encoding::EmptyPayload,
3644                            fidl::encoding::DefaultFuchsiaResourceDialect
3645                        );
3646                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3647                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3648                        Ok(DirectoryRequest::DeprecatedGetToken {
3649                            responder: DirectoryDeprecatedGetTokenResponder {
3650                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3651                                tx_id: header.tx_id,
3652                            },
3653                        })
3654                    }
3655                    0x740604c0c7c930e7 => {
3656                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3657                        let mut req = fidl::new_empty!(
3658                            DirectoryLinkRequest,
3659                            fidl::encoding::DefaultFuchsiaResourceDialect
3660                        );
3661                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3662                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3663                        Ok(DirectoryRequest::Link {
3664                            src: req.src,
3665                            dst_parent_token: req.dst_parent_token,
3666                            dst: req.dst,
3667
3668                            responder: DirectoryLinkResponder {
3669                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3670                                tx_id: header.tx_id,
3671                            },
3672                        })
3673                    }
3674                    0x750a0326a78d7bed => {
3675                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3676                        let mut req = fidl::new_empty!(
3677                            DirectoryUnlinkRequest,
3678                            fidl::encoding::DefaultFuchsiaResourceDialect
3679                        );
3680                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3681                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3682                        Ok(DirectoryRequest::Unlink {
3683                            name: req.name,
3684                            options: req.options,
3685
3686                            responder: DirectoryUnlinkResponder {
3687                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3688                                tx_id: header.tx_id,
3689                            },
3690                        })
3691                    }
3692                    0x7060e7723b9928de => {
3693                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3694                        let mut req = fidl::new_empty!(
3695                            DirectoryRenameRequest,
3696                            fidl::encoding::DefaultFuchsiaResourceDialect
3697                        );
3698                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3699                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3700                        Ok(DirectoryRequest::Rename {
3701                            src: req.src,
3702                            dst_parent_token: req.dst_parent_token,
3703                            dst: req.dst,
3704
3705                            responder: DirectoryRenameResponder {
3706                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3707                                tx_id: header.tx_id,
3708                            },
3709                        })
3710                    }
3711                    0x21ce0f19ec043889 => {
3712                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3713                        let mut req = fidl::new_empty!(
3714                            DirectoryCreateSymlinkRequest,
3715                            fidl::encoding::DefaultFuchsiaResourceDialect
3716                        );
3717                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3718                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3719                        Ok(DirectoryRequest::CreateSymlink {
3720                            name: req.name,
3721                            target: req.target,
3722                            connection: req.connection,
3723
3724                            responder: DirectoryCreateSymlinkResponder {
3725                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3726                                tx_id: header.tx_id,
3727                            },
3728                        })
3729                    }
3730                    0x5717193a59d66d91 => {
3731                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3732                        let mut req = fidl::new_empty!(
3733                            DirectoryWatchRequest,
3734                            fidl::encoding::DefaultFuchsiaResourceDialect
3735                        );
3736                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3737                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3738                        Ok(DirectoryRequest::Watch {
3739                            mask: req.mask,
3740                            options: req.options,
3741                            watcher: req.watcher,
3742
3743                            responder: DirectoryWatchResponder {
3744                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3745                                tx_id: header.tx_id,
3746                            },
3747                        })
3748                    }
3749                    _ if header.tx_id == 0
3750                        && header
3751                            .dynamic_flags()
3752                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3753                    {
3754                        Ok(DirectoryRequest::_UnknownMethod {
3755                            ordinal: header.ordinal,
3756                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3757                            method_type: fidl::MethodType::OneWay,
3758                        })
3759                    }
3760                    _ if header
3761                        .dynamic_flags()
3762                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3763                    {
3764                        this.inner.send_framework_err(
3765                            fidl::encoding::FrameworkErr::UnknownMethod,
3766                            header.tx_id,
3767                            header.ordinal,
3768                            header.dynamic_flags(),
3769                            (bytes, handles),
3770                        )?;
3771                        Ok(DirectoryRequest::_UnknownMethod {
3772                            ordinal: header.ordinal,
3773                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3774                            method_type: fidl::MethodType::TwoWay,
3775                        })
3776                    }
3777                    _ => Err(fidl::Error::UnknownOrdinal {
3778                        ordinal: header.ordinal,
3779                        protocol_name:
3780                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3781                    }),
3782                }))
3783            },
3784        )
3785    }
3786}
3787
3788/// Directory defines a node which is capable of containing other Objects.
3789#[derive(Debug)]
3790pub enum DirectoryRequest {
3791    /// Acquires an advisory lock on the underlying file.
3792    ///
3793    /// The lock lasts until either this connection is closed or
3794    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3795    /// explicitly.
3796    ///
3797    /// Advisory locks are purely advisory. They do not prevent actual read or
3798    /// write operations from occurring on the file, either through this
3799    /// connection or through other connections.
3800    ///
3801    /// This method requires the following rights:
3802    ///
3803    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3804    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3805    ///   [`AdvisoryLockType.WRITE`].
3806    ///
3807    /// # Errors
3808    ///
3809    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3810    ///   example, another connection might hold a conflicting lock type.
3811    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3812    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3813    ///   to acquire the given type of lock.
3814    AdvisoryLock {
3815        request: AdvisoryLockRequest,
3816        responder: DirectoryAdvisoryLockResponder,
3817    },
3818    Clone {
3819        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3820        control_handle: DirectoryControlHandle,
3821    },
3822    /// Terminates the connection.
3823    ///
3824    /// After calling `Close`, the client must not send any other requests.
3825    ///
3826    /// Servers, after sending the status response, should close the connection
3827    /// regardless of status and without sending an epitaph.
3828    ///
3829    /// Closing the client end of the channel should be semantically equivalent
3830    /// to calling `Close` without knowing when the close has completed or its
3831    /// status.
3832    Close {
3833        responder: DirectoryCloseResponder,
3834    },
3835    Query {
3836        responder: DirectoryQueryResponder,
3837    },
3838    /// DEPRECATED - Use `Node.GetAttributes` instead.
3839    ///
3840    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3841    DeprecatedGetAttr {
3842        responder: DirectoryDeprecatedGetAttrResponder,
3843    },
3844    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3845    DeprecatedSetAttr {
3846        flags: NodeAttributeFlags,
3847        attributes: NodeAttributes,
3848        responder: DirectoryDeprecatedSetAttrResponder,
3849    },
3850    /// [DEPRECATED - Use new GetFlags method instead.]
3851    DeprecatedGetFlags {
3852        responder: DirectoryDeprecatedGetFlagsResponder,
3853    },
3854    /// [DEPRECATED - Use new SetFlags method instead.]
3855    DeprecatedSetFlags {
3856        flags: OpenFlags,
3857        responder: DirectoryDeprecatedSetFlagsResponder,
3858    },
3859    /// Queries the flags that apply to this node after it has been opened/created. This method does
3860    /// not require any rights.
3861    ///
3862    /// Note that the final set of flags that apply to the connection may differ from those
3863    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3864    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3865    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3866    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3867    GetFlags {
3868        responder: DirectoryGetFlagsResponder,
3869    },
3870    /// Sets the flags that apply to this node after it has been opened. This method does not
3871    /// require any rights.
3872    ///
3873    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3874    /// clear append mode.
3875    ///
3876    /// Errors:
3877    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3878    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3879    SetFlags {
3880        flags: Flags,
3881        responder: DirectorySetFlagsResponder,
3882    },
3883    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
3884    /// volume has different settings or the storage is accounted seperately from the rest of the
3885    /// filesystem that may be reported instead of filesystem-wide details.
3886    QueryFilesystem {
3887        responder: DirectoryQueryFilesystemResponder,
3888    },
3889    /// Acquires a token which can be used to identify this connection at a later point in
3890    /// time. The token will remain valid for as long as the connection requesting the token
3891    /// remains open.
3892    ///
3893    /// This method does not require any rights. Note that the token identifies
3894    /// the connection, hence carries the rights information on this connection.
3895    GetToken {
3896        responder: DirectoryGetTokenResponder,
3897    },
3898    /// Acquires information about the node.
3899    ///
3900    /// The attributes of a node should be stable, independent of the
3901    /// specific protocol used to access it.
3902    ///
3903    /// If a particular attribute is not applicable or not supported,
3904    /// filesystems should leave the corresponding field absent.
3905    ///
3906    /// + `query` a bit-mask specifying which attributes to fetch. The server
3907    ///   should not return more than necessary.
3908    /// - `attributes` the returned attributes.
3909    ///
3910    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3911    GetAttributes {
3912        query: NodeAttributesQuery,
3913        responder: DirectoryGetAttributesResponder,
3914    },
3915    /// Updates information about the node.
3916    ///
3917    /// + `attributes` the presence of a table field in `attributes` indicates
3918    /// the intent to update the corresponding attribute.
3919    ///
3920    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3921    ///
3922    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3923    UpdateAttributes {
3924        payload: MutableNodeAttributes,
3925        responder: DirectoryUpdateAttributesResponder,
3926    },
3927    /// Synchronizes updates to the node to the underlying media, if it exists.
3928    ///
3929    /// This method will return when the filesystem server has flushed the
3930    /// relevant updates to the underlying media, but does not guarantee the
3931    /// underlying media has persisted the information, nor that any information
3932    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3933    /// between operations.
3934    ///
3935    /// This method does not require any rights.
3936    Sync {
3937        responder: DirectorySyncResponder,
3938    },
3939    /// Creates an iterator over all the extended attribute names associated
3940    /// with this node. If an error occurs it is returned as an epitaph on the
3941    /// iterator request channel, and then the channel is closed.
3942    ///
3943    /// GetExtendedAttributes can be used with any of these names to retrieve
3944    /// the associated value.
3945    ///
3946    /// This method requires the [`Rights.READ_BYTES`] right.
3947    ListExtendedAttributes {
3948        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3949        control_handle: DirectoryControlHandle,
3950    },
3951    /// Get the value associated with the given attribute `name` for this node.
3952    ///
3953    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3954    /// particular structure is imposed on them.
3955    ///
3956    /// This method requires the [`Rights.READ_BYTES`] right.
3957    GetExtendedAttribute {
3958        name: Vec<u8>,
3959        responder: DirectoryGetExtendedAttributeResponder,
3960    },
3961    /// Set the value for the given attribute `name` to `value` for this node.
3962    ///
3963    /// The attribute name may exist, in which case the attribute is updated.
3964    /// If the attribute doesn't exist, it is created. The name should have no
3965    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3966    ///
3967    /// This method requires the [`Rights.WRITE_BYTES`] right.
3968    SetExtendedAttribute {
3969        name: Vec<u8>,
3970        value: ExtendedAttributeValue,
3971        mode: SetExtendedAttributeMode,
3972        responder: DirectorySetExtendedAttributeResponder,
3973    },
3974    /// Remove the specified extended attribute.
3975    ///
3976    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3977    ///
3978    /// This method requires the [`Rights.WRITE_BYTES`] right.
3979    RemoveExtendedAttribute {
3980        name: Vec<u8>,
3981        responder: DirectoryRemoveExtendedAttributeResponder,
3982    },
3983    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3984    /// epitaph sent on the `object` channel.
3985    ///
3986    /// Errors:
3987    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3988    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3989    Open {
3990        path: String,
3991        flags: Flags,
3992        options: Options,
3993        object: fidl::Channel,
3994        control_handle: DirectoryControlHandle,
3995    },
3996    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3997    DeprecatedOpen {
3998        flags: OpenFlags,
3999        mode: ModeType,
4000        path: String,
4001        object: fidl::endpoints::ServerEnd<NodeMarker>,
4002        control_handle: DirectoryControlHandle,
4003    },
4004    /// Reads a collection of variably sized dirents into a buffer.
4005    /// The number of dirents in a directory may be very large: akin to
4006    /// calling read multiple times on a file, directories have a seek
4007    /// offset which is updated on subsequent calls to ReadDirents.
4008    /// Each call to ReadDirents will only return whole dirent structures,
4009    /// they will not get split across ReadDirent calls. When the seek
4010    /// offset reaches the end, `dirents` will be empty.
4011    ///
4012    /// These dirents are of the form:
4013    /// ```
4014    /// struct dirent {
4015    ///   // Describes the inode of the entry.
4016    ///   uint64 ino;
4017    ///   // Describes the length of the dirent name in bytes.
4018    ///   uint8 size;
4019    ///   // Describes the type of the entry. Aligned with the
4020    ///   // POSIX d_type values. Use `DirentType` constants.
4021    ///   uint8 type;
4022    ///   // Unterminated name of entry.
4023    ///   char name[0];
4024    /// }
4025    /// ```
4026    ///
4027    /// This method requires the following rights:
4028    ///
4029    /// * [`Rights.ENUMERATE`]
4030    ReadDirents {
4031        max_bytes: u64,
4032        responder: DirectoryReadDirentsResponder,
4033    },
4034    /// Resets the directory seek offset.
4035    ///
4036    /// This method requires the following rights:
4037    ///
4038    /// * [`Rights.ENUMERATE`]
4039    Rewind {
4040        responder: DirectoryRewindResponder,
4041    },
4042    /// Acquires a token to a Directory which can be used to identify access to it at a later point
4043    /// in time. The token will remain valid for as long as the connection requesting the token
4044    /// remains open.
4045    ///
4046    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
4047    /// `ZX_ERR_BAD_HANDLE`.
4048    ///
4049    /// This method is deprecated: use `fuchsia.io/Node.GetToken` instead (once it is added).
4050    DeprecatedGetToken {
4051        responder: DirectoryDeprecatedGetTokenResponder,
4052    },
4053    /// Creates a link to an object named src by the name dst, within a directory represented by
4054    /// token.
4055    ///
4056    /// `src` must be a resolved object name. Including "/" in the string will
4057    /// return `ZX_ERR_INVALID_ARGS`.
4058    ///
4059    /// `dst` must be a resolved object name. Including "/" in the string will
4060    /// return `ZX_ERR_INVALID_ARGS`.
4061    ///
4062    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
4063    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
4064    ///
4065    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
4066    /// there are two actors operating concurrently, and one actor performs a rename that affects
4067    /// the source within this directory, and the other does a link, each will appear to occur
4068    /// atomically in an unspecified order.
4069    Link {
4070        src: String,
4071        dst_parent_token: fidl::NullableHandle,
4072        dst: String,
4073        responder: DirectoryLinkResponder,
4074    },
4075    /// Removes a child node from the this directory's list of entries.
4076    ///
4077    /// Note: this does not guarantee that the underlying object is destroyed.
4078    /// Although the link will be removed from the containing directory,
4079    /// objects with multiple references (such as files which are still open)
4080    /// will not actually be destroyed until all references are closed.
4081    ///
4082    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
4083    ///   [`Rights.WRITE_BYTES`].
4084    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
4085    ///   support writing.
4086    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
4087    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
4088    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
4089    ///   containing a remote channel.
4090    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
4091    ///     something other than a directory was found.
4092    ///
4093    /// Other errors may be returned for filesystem-specific reasons.
4094    ///
4095    /// This method requires the following rights:
4096    ///
4097    /// * [`Rights.ENUMERATE`]
4098    /// * [`Rights.MODIFY_DIRECTORY`]
4099    Unlink {
4100        name: String,
4101        options: UnlinkOptions,
4102        responder: DirectoryUnlinkResponder,
4103    },
4104    /// Renames a node named `src` to the name `dst`, in a directory represented
4105    /// by `dst_parent_token`.
4106    ///
4107    /// `src` and `dst` must be valid node names.
4108    /// See [`Name`] for what constitutes a valid name.
4109    ///
4110    /// This method requires the following rights on both the current connection, and the connection
4111    /// identified by `dst_parent_token`:
4112    ///
4113    /// * [`Rights.ENUMERATE`]
4114    /// * [`Rights.MODIFY_DIRECTORY`]
4115    ///
4116    /// The following requirements are necessary to avoid rights escalations.
4117    ///
4118    /// If the source and destination directory differ, the source directory must also have the
4119    /// maximal set of abilities supported for files, which would typically be
4120    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4121    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4122    /// right.
4123    ///
4124    /// If `src` refers to a directory, and differs from the destination directory, then the source
4125    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4126    ///
4127    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4128    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4129    Rename {
4130        src: String,
4131        dst_parent_token: fidl::Event,
4132        dst: String,
4133        responder: DirectoryRenameResponder,
4134    },
4135    /// Creates a symbolic link.
4136    ///
4137    /// `name` is the name to be given to the created symbolic link.
4138    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4139    /// will perform no validation of `target` except for a server chosen maximum length.
4140    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4141    /// on the successfully created node.
4142    ///
4143    /// * [`Rights.MODIFY_DIRECTORY`]
4144    ///
4145    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4146    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4147    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4148    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4149    CreateSymlink {
4150        name: String,
4151        target: Vec<u8>,
4152        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4153        responder: DirectoryCreateSymlinkResponder,
4154    },
4155    /// Watches a directory, receiving events of added messages on the
4156    /// watcher request channel.
4157    ///
4158    /// Options must be zero; it is reserved.
4159    ///
4160    /// This method requires the following rights:
4161    ///
4162    /// * [`Rights.ENUMERATE`]
4163    Watch {
4164        mask: WatchMask,
4165        options: u32,
4166        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4167        responder: DirectoryWatchResponder,
4168    },
4169    /// An interaction was received which does not match any known method.
4170    #[non_exhaustive]
4171    _UnknownMethod {
4172        /// Ordinal of the method that was called.
4173        ordinal: u64,
4174        control_handle: DirectoryControlHandle,
4175        method_type: fidl::MethodType,
4176    },
4177}
4178
4179impl DirectoryRequest {
4180    #[allow(irrefutable_let_patterns)]
4181    pub fn into_advisory_lock(
4182        self,
4183    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4184        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4185            Some((request, responder))
4186        } else {
4187            None
4188        }
4189    }
4190
4191    #[allow(irrefutable_let_patterns)]
4192    pub fn into_clone(
4193        self,
4194    ) -> Option<(
4195        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4196        DirectoryControlHandle,
4197    )> {
4198        if let DirectoryRequest::Clone { request, control_handle } = self {
4199            Some((request, control_handle))
4200        } else {
4201            None
4202        }
4203    }
4204
4205    #[allow(irrefutable_let_patterns)]
4206    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4207        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4208    }
4209
4210    #[allow(irrefutable_let_patterns)]
4211    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4212        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4213    }
4214
4215    #[allow(irrefutable_let_patterns)]
4216    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4217        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4218            Some((responder))
4219        } else {
4220            None
4221        }
4222    }
4223
4224    #[allow(irrefutable_let_patterns)]
4225    pub fn into_deprecated_set_attr(
4226        self,
4227    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4228        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4229            Some((flags, attributes, responder))
4230        } else {
4231            None
4232        }
4233    }
4234
4235    #[allow(irrefutable_let_patterns)]
4236    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4237        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4238            Some((responder))
4239        } else {
4240            None
4241        }
4242    }
4243
4244    #[allow(irrefutable_let_patterns)]
4245    pub fn into_deprecated_set_flags(
4246        self,
4247    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4248        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4249            Some((flags, responder))
4250        } else {
4251            None
4252        }
4253    }
4254
4255    #[allow(irrefutable_let_patterns)]
4256    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4257        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4258    }
4259
4260    #[allow(irrefutable_let_patterns)]
4261    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4262        if let DirectoryRequest::SetFlags { flags, responder } = self {
4263            Some((flags, responder))
4264        } else {
4265            None
4266        }
4267    }
4268
4269    #[allow(irrefutable_let_patterns)]
4270    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4271        if let DirectoryRequest::QueryFilesystem { responder } = self {
4272            Some((responder))
4273        } else {
4274            None
4275        }
4276    }
4277
4278    #[allow(irrefutable_let_patterns)]
4279    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4280        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4281    }
4282
4283    #[allow(irrefutable_let_patterns)]
4284    pub fn into_get_attributes(
4285        self,
4286    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4287        if let DirectoryRequest::GetAttributes { query, responder } = self {
4288            Some((query, responder))
4289        } else {
4290            None
4291        }
4292    }
4293
4294    #[allow(irrefutable_let_patterns)]
4295    pub fn into_update_attributes(
4296        self,
4297    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4298        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4299            Some((payload, responder))
4300        } else {
4301            None
4302        }
4303    }
4304
4305    #[allow(irrefutable_let_patterns)]
4306    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4307        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4308    }
4309
4310    #[allow(irrefutable_let_patterns)]
4311    pub fn into_list_extended_attributes(
4312        self,
4313    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4314    {
4315        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4316            Some((iterator, control_handle))
4317        } else {
4318            None
4319        }
4320    }
4321
4322    #[allow(irrefutable_let_patterns)]
4323    pub fn into_get_extended_attribute(
4324        self,
4325    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4326        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4327            Some((name, responder))
4328        } else {
4329            None
4330        }
4331    }
4332
4333    #[allow(irrefutable_let_patterns)]
4334    pub fn into_set_extended_attribute(
4335        self,
4336    ) -> Option<(
4337        Vec<u8>,
4338        ExtendedAttributeValue,
4339        SetExtendedAttributeMode,
4340        DirectorySetExtendedAttributeResponder,
4341    )> {
4342        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4343            Some((name, value, mode, responder))
4344        } else {
4345            None
4346        }
4347    }
4348
4349    #[allow(irrefutable_let_patterns)]
4350    pub fn into_remove_extended_attribute(
4351        self,
4352    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4353        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4354            Some((name, responder))
4355        } else {
4356            None
4357        }
4358    }
4359
4360    #[allow(irrefutable_let_patterns)]
4361    pub fn into_open(
4362        self,
4363    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4364        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4365            Some((path, flags, options, object, control_handle))
4366        } else {
4367            None
4368        }
4369    }
4370
4371    #[allow(irrefutable_let_patterns)]
4372    pub fn into_deprecated_open(
4373        self,
4374    ) -> Option<(
4375        OpenFlags,
4376        ModeType,
4377        String,
4378        fidl::endpoints::ServerEnd<NodeMarker>,
4379        DirectoryControlHandle,
4380    )> {
4381        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4382        {
4383            Some((flags, mode, path, object, control_handle))
4384        } else {
4385            None
4386        }
4387    }
4388
4389    #[allow(irrefutable_let_patterns)]
4390    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4391        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4392            Some((max_bytes, responder))
4393        } else {
4394            None
4395        }
4396    }
4397
4398    #[allow(irrefutable_let_patterns)]
4399    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4400        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4401    }
4402
4403    #[allow(irrefutable_let_patterns)]
4404    pub fn into_deprecated_get_token(self) -> Option<(DirectoryDeprecatedGetTokenResponder)> {
4405        if let DirectoryRequest::DeprecatedGetToken { responder } = self {
4406            Some((responder))
4407        } else {
4408            None
4409        }
4410    }
4411
4412    #[allow(irrefutable_let_patterns)]
4413    pub fn into_link(
4414        self,
4415    ) -> Option<(String, fidl::NullableHandle, String, DirectoryLinkResponder)> {
4416        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4417            Some((src, dst_parent_token, dst, responder))
4418        } else {
4419            None
4420        }
4421    }
4422
4423    #[allow(irrefutable_let_patterns)]
4424    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4425        if let DirectoryRequest::Unlink { name, options, responder } = self {
4426            Some((name, options, responder))
4427        } else {
4428            None
4429        }
4430    }
4431
4432    #[allow(irrefutable_let_patterns)]
4433    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4434        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4435            Some((src, dst_parent_token, dst, responder))
4436        } else {
4437            None
4438        }
4439    }
4440
4441    #[allow(irrefutable_let_patterns)]
4442    pub fn into_create_symlink(
4443        self,
4444    ) -> Option<(
4445        String,
4446        Vec<u8>,
4447        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4448        DirectoryCreateSymlinkResponder,
4449    )> {
4450        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4451            Some((name, target, connection, responder))
4452        } else {
4453            None
4454        }
4455    }
4456
4457    #[allow(irrefutable_let_patterns)]
4458    pub fn into_watch(
4459        self,
4460    ) -> Option<(
4461        WatchMask,
4462        u32,
4463        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4464        DirectoryWatchResponder,
4465    )> {
4466        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4467            Some((mask, options, watcher, responder))
4468        } else {
4469            None
4470        }
4471    }
4472
4473    /// Name of the method defined in FIDL
4474    pub fn method_name(&self) -> &'static str {
4475        match *self {
4476            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4477            DirectoryRequest::Clone { .. } => "clone",
4478            DirectoryRequest::Close { .. } => "close",
4479            DirectoryRequest::Query { .. } => "query",
4480            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4481            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4482            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4483            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4484            DirectoryRequest::GetFlags { .. } => "get_flags",
4485            DirectoryRequest::SetFlags { .. } => "set_flags",
4486            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4487            DirectoryRequest::GetToken { .. } => "get_token",
4488            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4489            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4490            DirectoryRequest::Sync { .. } => "sync",
4491            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4492            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4493            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4494            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4495            DirectoryRequest::Open { .. } => "open",
4496            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4497            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4498            DirectoryRequest::Rewind { .. } => "rewind",
4499            DirectoryRequest::DeprecatedGetToken { .. } => "deprecated_get_token",
4500            DirectoryRequest::Link { .. } => "link",
4501            DirectoryRequest::Unlink { .. } => "unlink",
4502            DirectoryRequest::Rename { .. } => "rename",
4503            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4504            DirectoryRequest::Watch { .. } => "watch",
4505            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4506                "unknown one-way method"
4507            }
4508            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4509                "unknown two-way method"
4510            }
4511        }
4512    }
4513}
4514
4515#[derive(Debug, Clone)]
4516pub struct DirectoryControlHandle {
4517    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4518}
4519
4520impl DirectoryControlHandle {
4521    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4522        self.inner.shutdown_with_epitaph(status.into())
4523    }
4524}
4525
4526impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4527    fn shutdown(&self) {
4528        self.inner.shutdown()
4529    }
4530
4531    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4532        self.inner.shutdown_with_epitaph(status)
4533    }
4534
4535    fn is_closed(&self) -> bool {
4536        self.inner.channel().is_closed()
4537    }
4538    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4539        self.inner.channel().on_closed()
4540    }
4541
4542    #[cfg(target_os = "fuchsia")]
4543    fn signal_peer(
4544        &self,
4545        clear_mask: zx::Signals,
4546        set_mask: zx::Signals,
4547    ) -> Result<(), zx_status::Status> {
4548        use fidl::Peered;
4549        self.inner.channel().signal_peer(clear_mask, set_mask)
4550    }
4551}
4552
4553impl DirectoryControlHandle {
4554    pub fn send_on_open_(
4555        &self,
4556        mut s: i32,
4557        mut info: Option<NodeInfoDeprecated>,
4558    ) -> Result<(), fidl::Error> {
4559        self.inner.send::<NodeOnOpenRequest>(
4560            (s, info.as_mut()),
4561            0,
4562            0x7fc7bbb1dbfd1972,
4563            fidl::encoding::DynamicFlags::FLEXIBLE,
4564        )
4565    }
4566
4567    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4568        self.inner.send::<Representation>(
4569            &mut payload,
4570            0,
4571            0x5cb40567d80a510c,
4572            fidl::encoding::DynamicFlags::empty(),
4573        )
4574    }
4575}
4576
4577#[must_use = "FIDL methods require a response to be sent"]
4578#[derive(Debug)]
4579pub struct DirectoryAdvisoryLockResponder {
4580    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4581    tx_id: u32,
4582}
4583
4584/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4585/// if the responder is dropped without sending a response, so that the client
4586/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4587impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4588    fn drop(&mut self) {
4589        self.control_handle.shutdown();
4590        // Safety: drops once, never accessed again
4591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4592    }
4593}
4594
4595impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4596    type ControlHandle = DirectoryControlHandle;
4597
4598    fn control_handle(&self) -> &DirectoryControlHandle {
4599        &self.control_handle
4600    }
4601
4602    fn drop_without_shutdown(mut self) {
4603        // Safety: drops once, never accessed again due to mem::forget
4604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4605        // Prevent Drop from running (which would shut down the channel)
4606        std::mem::forget(self);
4607    }
4608}
4609
4610impl DirectoryAdvisoryLockResponder {
4611    /// Sends a response to the FIDL transaction.
4612    ///
4613    /// Sets the channel to shutdown if an error occurs.
4614    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4615        let _result = self.send_raw(result);
4616        if _result.is_err() {
4617            self.control_handle.shutdown();
4618        }
4619        self.drop_without_shutdown();
4620        _result
4621    }
4622
4623    /// Similar to "send" but does not shutdown the channel if an error occurs.
4624    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4625        let _result = self.send_raw(result);
4626        self.drop_without_shutdown();
4627        _result
4628    }
4629
4630    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4631        self.control_handle
4632            .inner
4633            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4634                result,
4635                self.tx_id,
4636                0x6ee9c0ad53ec87aa,
4637                fidl::encoding::DynamicFlags::empty(),
4638            )
4639    }
4640}
4641
4642#[must_use = "FIDL methods require a response to be sent"]
4643#[derive(Debug)]
4644pub struct DirectoryCloseResponder {
4645    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4646    tx_id: u32,
4647}
4648
4649/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4650/// if the responder is dropped without sending a response, so that the client
4651/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4652impl std::ops::Drop for DirectoryCloseResponder {
4653    fn drop(&mut self) {
4654        self.control_handle.shutdown();
4655        // Safety: drops once, never accessed again
4656        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4657    }
4658}
4659
4660impl fidl::endpoints::Responder for DirectoryCloseResponder {
4661    type ControlHandle = DirectoryControlHandle;
4662
4663    fn control_handle(&self) -> &DirectoryControlHandle {
4664        &self.control_handle
4665    }
4666
4667    fn drop_without_shutdown(mut self) {
4668        // Safety: drops once, never accessed again due to mem::forget
4669        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4670        // Prevent Drop from running (which would shut down the channel)
4671        std::mem::forget(self);
4672    }
4673}
4674
4675impl DirectoryCloseResponder {
4676    /// Sends a response to the FIDL transaction.
4677    ///
4678    /// Sets the channel to shutdown if an error occurs.
4679    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4680        let _result = self.send_raw(result);
4681        if _result.is_err() {
4682            self.control_handle.shutdown();
4683        }
4684        self.drop_without_shutdown();
4685        _result
4686    }
4687
4688    /// Similar to "send" but does not shutdown the channel if an error occurs.
4689    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4690        let _result = self.send_raw(result);
4691        self.drop_without_shutdown();
4692        _result
4693    }
4694
4695    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4696        self.control_handle
4697            .inner
4698            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4699                result,
4700                self.tx_id,
4701                0x5ac5d459ad7f657e,
4702                fidl::encoding::DynamicFlags::empty(),
4703            )
4704    }
4705}
4706
4707#[must_use = "FIDL methods require a response to be sent"]
4708#[derive(Debug)]
4709pub struct DirectoryQueryResponder {
4710    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4711    tx_id: u32,
4712}
4713
4714/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4715/// if the responder is dropped without sending a response, so that the client
4716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4717impl std::ops::Drop for DirectoryQueryResponder {
4718    fn drop(&mut self) {
4719        self.control_handle.shutdown();
4720        // Safety: drops once, never accessed again
4721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4722    }
4723}
4724
4725impl fidl::endpoints::Responder for DirectoryQueryResponder {
4726    type ControlHandle = DirectoryControlHandle;
4727
4728    fn control_handle(&self) -> &DirectoryControlHandle {
4729        &self.control_handle
4730    }
4731
4732    fn drop_without_shutdown(mut self) {
4733        // Safety: drops once, never accessed again due to mem::forget
4734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4735        // Prevent Drop from running (which would shut down the channel)
4736        std::mem::forget(self);
4737    }
4738}
4739
4740impl DirectoryQueryResponder {
4741    /// Sends a response to the FIDL transaction.
4742    ///
4743    /// Sets the channel to shutdown if an error occurs.
4744    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4745        let _result = self.send_raw(protocol);
4746        if _result.is_err() {
4747            self.control_handle.shutdown();
4748        }
4749        self.drop_without_shutdown();
4750        _result
4751    }
4752
4753    /// Similar to "send" but does not shutdown the channel if an error occurs.
4754    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4755        let _result = self.send_raw(protocol);
4756        self.drop_without_shutdown();
4757        _result
4758    }
4759
4760    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4761        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4762            (protocol,),
4763            self.tx_id,
4764            0x2658edee9decfc06,
4765            fidl::encoding::DynamicFlags::empty(),
4766        )
4767    }
4768}
4769
4770#[must_use = "FIDL methods require a response to be sent"]
4771#[derive(Debug)]
4772pub struct DirectoryDeprecatedGetAttrResponder {
4773    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4774    tx_id: u32,
4775}
4776
4777/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4778/// if the responder is dropped without sending a response, so that the client
4779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4780impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4781    fn drop(&mut self) {
4782        self.control_handle.shutdown();
4783        // Safety: drops once, never accessed again
4784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4785    }
4786}
4787
4788impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4789    type ControlHandle = DirectoryControlHandle;
4790
4791    fn control_handle(&self) -> &DirectoryControlHandle {
4792        &self.control_handle
4793    }
4794
4795    fn drop_without_shutdown(mut self) {
4796        // Safety: drops once, never accessed again due to mem::forget
4797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4798        // Prevent Drop from running (which would shut down the channel)
4799        std::mem::forget(self);
4800    }
4801}
4802
4803impl DirectoryDeprecatedGetAttrResponder {
4804    /// Sends a response to the FIDL transaction.
4805    ///
4806    /// Sets the channel to shutdown if an error occurs.
4807    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4808        let _result = self.send_raw(s, attributes);
4809        if _result.is_err() {
4810            self.control_handle.shutdown();
4811        }
4812        self.drop_without_shutdown();
4813        _result
4814    }
4815
4816    /// Similar to "send" but does not shutdown the channel if an error occurs.
4817    pub fn send_no_shutdown_on_err(
4818        self,
4819        mut s: i32,
4820        mut attributes: &NodeAttributes,
4821    ) -> Result<(), fidl::Error> {
4822        let _result = self.send_raw(s, attributes);
4823        self.drop_without_shutdown();
4824        _result
4825    }
4826
4827    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4828        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4829            (s, attributes),
4830            self.tx_id,
4831            0x78985e216314dafd,
4832            fidl::encoding::DynamicFlags::empty(),
4833        )
4834    }
4835}
4836
4837#[must_use = "FIDL methods require a response to be sent"]
4838#[derive(Debug)]
4839pub struct DirectoryDeprecatedSetAttrResponder {
4840    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4841    tx_id: u32,
4842}
4843
4844/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4845/// if the responder is dropped without sending a response, so that the client
4846/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4847impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4848    fn drop(&mut self) {
4849        self.control_handle.shutdown();
4850        // Safety: drops once, never accessed again
4851        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4852    }
4853}
4854
4855impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4856    type ControlHandle = DirectoryControlHandle;
4857
4858    fn control_handle(&self) -> &DirectoryControlHandle {
4859        &self.control_handle
4860    }
4861
4862    fn drop_without_shutdown(mut self) {
4863        // Safety: drops once, never accessed again due to mem::forget
4864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4865        // Prevent Drop from running (which would shut down the channel)
4866        std::mem::forget(self);
4867    }
4868}
4869
4870impl DirectoryDeprecatedSetAttrResponder {
4871    /// Sends a response to the FIDL transaction.
4872    ///
4873    /// Sets the channel to shutdown if an error occurs.
4874    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4875        let _result = self.send_raw(s);
4876        if _result.is_err() {
4877            self.control_handle.shutdown();
4878        }
4879        self.drop_without_shutdown();
4880        _result
4881    }
4882
4883    /// Similar to "send" but does not shutdown the channel if an error occurs.
4884    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4885        let _result = self.send_raw(s);
4886        self.drop_without_shutdown();
4887        _result
4888    }
4889
4890    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4891        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4892            (s,),
4893            self.tx_id,
4894            0x4186c0f40d938f46,
4895            fidl::encoding::DynamicFlags::empty(),
4896        )
4897    }
4898}
4899
4900#[must_use = "FIDL methods require a response to be sent"]
4901#[derive(Debug)]
4902pub struct DirectoryDeprecatedGetFlagsResponder {
4903    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4904    tx_id: u32,
4905}
4906
4907/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4908/// if the responder is dropped without sending a response, so that the client
4909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4910impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4911    fn drop(&mut self) {
4912        self.control_handle.shutdown();
4913        // Safety: drops once, never accessed again
4914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4915    }
4916}
4917
4918impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4919    type ControlHandle = DirectoryControlHandle;
4920
4921    fn control_handle(&self) -> &DirectoryControlHandle {
4922        &self.control_handle
4923    }
4924
4925    fn drop_without_shutdown(mut self) {
4926        // Safety: drops once, never accessed again due to mem::forget
4927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4928        // Prevent Drop from running (which would shut down the channel)
4929        std::mem::forget(self);
4930    }
4931}
4932
4933impl DirectoryDeprecatedGetFlagsResponder {
4934    /// Sends a response to the FIDL transaction.
4935    ///
4936    /// Sets the channel to shutdown if an error occurs.
4937    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4938        let _result = self.send_raw(s, flags);
4939        if _result.is_err() {
4940            self.control_handle.shutdown();
4941        }
4942        self.drop_without_shutdown();
4943        _result
4944    }
4945
4946    /// Similar to "send" but does not shutdown the channel if an error occurs.
4947    pub fn send_no_shutdown_on_err(
4948        self,
4949        mut s: i32,
4950        mut flags: OpenFlags,
4951    ) -> Result<(), fidl::Error> {
4952        let _result = self.send_raw(s, flags);
4953        self.drop_without_shutdown();
4954        _result
4955    }
4956
4957    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4958        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4959            (s, flags),
4960            self.tx_id,
4961            0x5b88fffb8eda3aa1,
4962            fidl::encoding::DynamicFlags::empty(),
4963        )
4964    }
4965}
4966
4967#[must_use = "FIDL methods require a response to be sent"]
4968#[derive(Debug)]
4969pub struct DirectoryDeprecatedSetFlagsResponder {
4970    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4971    tx_id: u32,
4972}
4973
4974/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4975/// if the responder is dropped without sending a response, so that the client
4976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4977impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4978    fn drop(&mut self) {
4979        self.control_handle.shutdown();
4980        // Safety: drops once, never accessed again
4981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4982    }
4983}
4984
4985impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4986    type ControlHandle = DirectoryControlHandle;
4987
4988    fn control_handle(&self) -> &DirectoryControlHandle {
4989        &self.control_handle
4990    }
4991
4992    fn drop_without_shutdown(mut self) {
4993        // Safety: drops once, never accessed again due to mem::forget
4994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4995        // Prevent Drop from running (which would shut down the channel)
4996        std::mem::forget(self);
4997    }
4998}
4999
5000impl DirectoryDeprecatedSetFlagsResponder {
5001    /// Sends a response to the FIDL transaction.
5002    ///
5003    /// Sets the channel to shutdown if an error occurs.
5004    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5005        let _result = self.send_raw(s);
5006        if _result.is_err() {
5007            self.control_handle.shutdown();
5008        }
5009        self.drop_without_shutdown();
5010        _result
5011    }
5012
5013    /// Similar to "send" but does not shutdown the channel if an error occurs.
5014    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5015        let _result = self.send_raw(s);
5016        self.drop_without_shutdown();
5017        _result
5018    }
5019
5020    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5021        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
5022            (s,),
5023            self.tx_id,
5024            0x5295b76c71fde733,
5025            fidl::encoding::DynamicFlags::empty(),
5026        )
5027    }
5028}
5029
5030#[must_use = "FIDL methods require a response to be sent"]
5031#[derive(Debug)]
5032pub struct DirectoryGetFlagsResponder {
5033    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5034    tx_id: u32,
5035}
5036
5037/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5038/// if the responder is dropped without sending a response, so that the client
5039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5040impl std::ops::Drop for DirectoryGetFlagsResponder {
5041    fn drop(&mut self) {
5042        self.control_handle.shutdown();
5043        // Safety: drops once, never accessed again
5044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5045    }
5046}
5047
5048impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
5049    type ControlHandle = DirectoryControlHandle;
5050
5051    fn control_handle(&self) -> &DirectoryControlHandle {
5052        &self.control_handle
5053    }
5054
5055    fn drop_without_shutdown(mut self) {
5056        // Safety: drops once, never accessed again due to mem::forget
5057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5058        // Prevent Drop from running (which would shut down the channel)
5059        std::mem::forget(self);
5060    }
5061}
5062
5063impl DirectoryGetFlagsResponder {
5064    /// Sends a response to the FIDL transaction.
5065    ///
5066    /// Sets the channel to shutdown if an error occurs.
5067    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5068        let _result = self.send_raw(result);
5069        if _result.is_err() {
5070            self.control_handle.shutdown();
5071        }
5072        self.drop_without_shutdown();
5073        _result
5074    }
5075
5076    /// Similar to "send" but does not shutdown the channel if an error occurs.
5077    pub fn send_no_shutdown_on_err(
5078        self,
5079        mut result: Result<Flags, i32>,
5080    ) -> Result<(), fidl::Error> {
5081        let _result = self.send_raw(result);
5082        self.drop_without_shutdown();
5083        _result
5084    }
5085
5086    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5087        self.control_handle
5088            .inner
5089            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
5090                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
5091                self.tx_id,
5092                0x176eb318f64ec23,
5093                fidl::encoding::DynamicFlags::FLEXIBLE,
5094            )
5095    }
5096}
5097
5098#[must_use = "FIDL methods require a response to be sent"]
5099#[derive(Debug)]
5100pub struct DirectorySetFlagsResponder {
5101    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5102    tx_id: u32,
5103}
5104
5105/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5106/// if the responder is dropped without sending a response, so that the client
5107/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5108impl std::ops::Drop for DirectorySetFlagsResponder {
5109    fn drop(&mut self) {
5110        self.control_handle.shutdown();
5111        // Safety: drops once, never accessed again
5112        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5113    }
5114}
5115
5116impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5117    type ControlHandle = DirectoryControlHandle;
5118
5119    fn control_handle(&self) -> &DirectoryControlHandle {
5120        &self.control_handle
5121    }
5122
5123    fn drop_without_shutdown(mut self) {
5124        // Safety: drops once, never accessed again due to mem::forget
5125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5126        // Prevent Drop from running (which would shut down the channel)
5127        std::mem::forget(self);
5128    }
5129}
5130
5131impl DirectorySetFlagsResponder {
5132    /// Sends a response to the FIDL transaction.
5133    ///
5134    /// Sets the channel to shutdown if an error occurs.
5135    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5136        let _result = self.send_raw(result);
5137        if _result.is_err() {
5138            self.control_handle.shutdown();
5139        }
5140        self.drop_without_shutdown();
5141        _result
5142    }
5143
5144    /// Similar to "send" but does not shutdown the channel if an error occurs.
5145    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5146        let _result = self.send_raw(result);
5147        self.drop_without_shutdown();
5148        _result
5149    }
5150
5151    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5152        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5153            fidl::encoding::EmptyStruct,
5154            i32,
5155        >>(
5156            fidl::encoding::FlexibleResult::new(result),
5157            self.tx_id,
5158            0x55a8028685791ea8,
5159            fidl::encoding::DynamicFlags::FLEXIBLE,
5160        )
5161    }
5162}
5163
5164#[must_use = "FIDL methods require a response to be sent"]
5165#[derive(Debug)]
5166pub struct DirectoryQueryFilesystemResponder {
5167    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5168    tx_id: u32,
5169}
5170
5171/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5172/// if the responder is dropped without sending a response, so that the client
5173/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5174impl std::ops::Drop for DirectoryQueryFilesystemResponder {
5175    fn drop(&mut self) {
5176        self.control_handle.shutdown();
5177        // Safety: drops once, never accessed again
5178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5179    }
5180}
5181
5182impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
5183    type ControlHandle = DirectoryControlHandle;
5184
5185    fn control_handle(&self) -> &DirectoryControlHandle {
5186        &self.control_handle
5187    }
5188
5189    fn drop_without_shutdown(mut self) {
5190        // Safety: drops once, never accessed again due to mem::forget
5191        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5192        // Prevent Drop from running (which would shut down the channel)
5193        std::mem::forget(self);
5194    }
5195}
5196
5197impl DirectoryQueryFilesystemResponder {
5198    /// Sends a response to the FIDL transaction.
5199    ///
5200    /// Sets the channel to shutdown if an error occurs.
5201    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5202        let _result = self.send_raw(s, info);
5203        if _result.is_err() {
5204            self.control_handle.shutdown();
5205        }
5206        self.drop_without_shutdown();
5207        _result
5208    }
5209
5210    /// Similar to "send" but does not shutdown the channel if an error occurs.
5211    pub fn send_no_shutdown_on_err(
5212        self,
5213        mut s: i32,
5214        mut info: Option<&FilesystemInfo>,
5215    ) -> Result<(), fidl::Error> {
5216        let _result = self.send_raw(s, info);
5217        self.drop_without_shutdown();
5218        _result
5219    }
5220
5221    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5222        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5223            (s, info),
5224            self.tx_id,
5225            0x6f344a1c6b0a0610,
5226            fidl::encoding::DynamicFlags::empty(),
5227        )
5228    }
5229}
5230
5231#[must_use = "FIDL methods require a response to be sent"]
5232#[derive(Debug)]
5233pub struct DirectoryGetTokenResponder {
5234    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5235    tx_id: u32,
5236}
5237
5238/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5239/// if the responder is dropped without sending a response, so that the client
5240/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5241impl std::ops::Drop for DirectoryGetTokenResponder {
5242    fn drop(&mut self) {
5243        self.control_handle.shutdown();
5244        // Safety: drops once, never accessed again
5245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5246    }
5247}
5248
5249impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5250    type ControlHandle = DirectoryControlHandle;
5251
5252    fn control_handle(&self) -> &DirectoryControlHandle {
5253        &self.control_handle
5254    }
5255
5256    fn drop_without_shutdown(mut self) {
5257        // Safety: drops once, never accessed again due to mem::forget
5258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5259        // Prevent Drop from running (which would shut down the channel)
5260        std::mem::forget(self);
5261    }
5262}
5263
5264impl DirectoryGetTokenResponder {
5265    /// Sends a response to the FIDL transaction.
5266    ///
5267    /// Sets the channel to shutdown if an error occurs.
5268    pub fn send(self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
5269        let _result = self.send_raw(result);
5270        if _result.is_err() {
5271            self.control_handle.shutdown();
5272        }
5273        self.drop_without_shutdown();
5274        _result
5275    }
5276
5277    /// Similar to "send" but does not shutdown the channel if an error occurs.
5278    pub fn send_no_shutdown_on_err(
5279        self,
5280        mut result: Result<fidl::Event, i32>,
5281    ) -> Result<(), fidl::Error> {
5282        let _result = self.send_raw(result);
5283        self.drop_without_shutdown();
5284        _result
5285    }
5286
5287    fn send_raw(&self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
5288        self.control_handle
5289            .inner
5290            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
5291                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
5292                self.tx_id,
5293                0x5054f0ade7076cec,
5294                fidl::encoding::DynamicFlags::FLEXIBLE,
5295            )
5296    }
5297}
5298
5299#[must_use = "FIDL methods require a response to be sent"]
5300#[derive(Debug)]
5301pub struct DirectoryGetAttributesResponder {
5302    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5303    tx_id: u32,
5304}
5305
5306/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5307/// if the responder is dropped without sending a response, so that the client
5308/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5309impl std::ops::Drop for DirectoryGetAttributesResponder {
5310    fn drop(&mut self) {
5311        self.control_handle.shutdown();
5312        // Safety: drops once, never accessed again
5313        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5314    }
5315}
5316
5317impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5318    type ControlHandle = DirectoryControlHandle;
5319
5320    fn control_handle(&self) -> &DirectoryControlHandle {
5321        &self.control_handle
5322    }
5323
5324    fn drop_without_shutdown(mut self) {
5325        // Safety: drops once, never accessed again due to mem::forget
5326        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5327        // Prevent Drop from running (which would shut down the channel)
5328        std::mem::forget(self);
5329    }
5330}
5331
5332impl DirectoryGetAttributesResponder {
5333    /// Sends a response to the FIDL transaction.
5334    ///
5335    /// Sets the channel to shutdown if an error occurs.
5336    pub fn send(
5337        self,
5338        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5339    ) -> Result<(), fidl::Error> {
5340        let _result = self.send_raw(result);
5341        if _result.is_err() {
5342            self.control_handle.shutdown();
5343        }
5344        self.drop_without_shutdown();
5345        _result
5346    }
5347
5348    /// Similar to "send" but does not shutdown the channel if an error occurs.
5349    pub fn send_no_shutdown_on_err(
5350        self,
5351        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5352    ) -> Result<(), fidl::Error> {
5353        let _result = self.send_raw(result);
5354        self.drop_without_shutdown();
5355        _result
5356    }
5357
5358    fn send_raw(
5359        &self,
5360        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5361    ) -> Result<(), fidl::Error> {
5362        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5363            result,
5364            self.tx_id,
5365            0x3d4396a638ea053b,
5366            fidl::encoding::DynamicFlags::empty(),
5367        )
5368    }
5369}
5370
5371#[must_use = "FIDL methods require a response to be sent"]
5372#[derive(Debug)]
5373pub struct DirectoryUpdateAttributesResponder {
5374    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5375    tx_id: u32,
5376}
5377
5378/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5379/// if the responder is dropped without sending a response, so that the client
5380/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5381impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5382    fn drop(&mut self) {
5383        self.control_handle.shutdown();
5384        // Safety: drops once, never accessed again
5385        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5386    }
5387}
5388
5389impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5390    type ControlHandle = DirectoryControlHandle;
5391
5392    fn control_handle(&self) -> &DirectoryControlHandle {
5393        &self.control_handle
5394    }
5395
5396    fn drop_without_shutdown(mut self) {
5397        // Safety: drops once, never accessed again due to mem::forget
5398        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5399        // Prevent Drop from running (which would shut down the channel)
5400        std::mem::forget(self);
5401    }
5402}
5403
5404impl DirectoryUpdateAttributesResponder {
5405    /// Sends a response to the FIDL transaction.
5406    ///
5407    /// Sets the channel to shutdown if an error occurs.
5408    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5409        let _result = self.send_raw(result);
5410        if _result.is_err() {
5411            self.control_handle.shutdown();
5412        }
5413        self.drop_without_shutdown();
5414        _result
5415    }
5416
5417    /// Similar to "send" but does not shutdown the channel if an error occurs.
5418    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5419        let _result = self.send_raw(result);
5420        self.drop_without_shutdown();
5421        _result
5422    }
5423
5424    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5425        self.control_handle
5426            .inner
5427            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5428                result,
5429                self.tx_id,
5430                0x3308c1da5a89bf08,
5431                fidl::encoding::DynamicFlags::empty(),
5432            )
5433    }
5434}
5435
5436#[must_use = "FIDL methods require a response to be sent"]
5437#[derive(Debug)]
5438pub struct DirectorySyncResponder {
5439    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5440    tx_id: u32,
5441}
5442
5443/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5444/// if the responder is dropped without sending a response, so that the client
5445/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5446impl std::ops::Drop for DirectorySyncResponder {
5447    fn drop(&mut self) {
5448        self.control_handle.shutdown();
5449        // Safety: drops once, never accessed again
5450        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5451    }
5452}
5453
5454impl fidl::endpoints::Responder for DirectorySyncResponder {
5455    type ControlHandle = DirectoryControlHandle;
5456
5457    fn control_handle(&self) -> &DirectoryControlHandle {
5458        &self.control_handle
5459    }
5460
5461    fn drop_without_shutdown(mut self) {
5462        // Safety: drops once, never accessed again due to mem::forget
5463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5464        // Prevent Drop from running (which would shut down the channel)
5465        std::mem::forget(self);
5466    }
5467}
5468
5469impl DirectorySyncResponder {
5470    /// Sends a response to the FIDL transaction.
5471    ///
5472    /// Sets the channel to shutdown if an error occurs.
5473    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5474        let _result = self.send_raw(result);
5475        if _result.is_err() {
5476            self.control_handle.shutdown();
5477        }
5478        self.drop_without_shutdown();
5479        _result
5480    }
5481
5482    /// Similar to "send" but does not shutdown the channel if an error occurs.
5483    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5484        let _result = self.send_raw(result);
5485        self.drop_without_shutdown();
5486        _result
5487    }
5488
5489    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5490        self.control_handle
5491            .inner
5492            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5493                result,
5494                self.tx_id,
5495                0x2c5c27ca0ab5dc49,
5496                fidl::encoding::DynamicFlags::empty(),
5497            )
5498    }
5499}
5500
5501#[must_use = "FIDL methods require a response to be sent"]
5502#[derive(Debug)]
5503pub struct DirectoryGetExtendedAttributeResponder {
5504    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5505    tx_id: u32,
5506}
5507
5508/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5509/// if the responder is dropped without sending a response, so that the client
5510/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5511impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5512    fn drop(&mut self) {
5513        self.control_handle.shutdown();
5514        // Safety: drops once, never accessed again
5515        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5516    }
5517}
5518
5519impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5520    type ControlHandle = DirectoryControlHandle;
5521
5522    fn control_handle(&self) -> &DirectoryControlHandle {
5523        &self.control_handle
5524    }
5525
5526    fn drop_without_shutdown(mut self) {
5527        // Safety: drops once, never accessed again due to mem::forget
5528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5529        // Prevent Drop from running (which would shut down the channel)
5530        std::mem::forget(self);
5531    }
5532}
5533
5534impl DirectoryGetExtendedAttributeResponder {
5535    /// Sends a response to the FIDL transaction.
5536    ///
5537    /// Sets the channel to shutdown if an error occurs.
5538    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5539        let _result = self.send_raw(result);
5540        if _result.is_err() {
5541            self.control_handle.shutdown();
5542        }
5543        self.drop_without_shutdown();
5544        _result
5545    }
5546
5547    /// Similar to "send" but does not shutdown the channel if an error occurs.
5548    pub fn send_no_shutdown_on_err(
5549        self,
5550        mut result: Result<ExtendedAttributeValue, i32>,
5551    ) -> Result<(), fidl::Error> {
5552        let _result = self.send_raw(result);
5553        self.drop_without_shutdown();
5554        _result
5555    }
5556
5557    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5558        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5559            result.as_mut().map_err(|e| *e),
5560            self.tx_id,
5561            0x45ffa3ccfdeb76db,
5562            fidl::encoding::DynamicFlags::empty(),
5563        )
5564    }
5565}
5566
5567#[must_use = "FIDL methods require a response to be sent"]
5568#[derive(Debug)]
5569pub struct DirectorySetExtendedAttributeResponder {
5570    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5571    tx_id: u32,
5572}
5573
5574/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5575/// if the responder is dropped without sending a response, so that the client
5576/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5577impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5578    fn drop(&mut self) {
5579        self.control_handle.shutdown();
5580        // Safety: drops once, never accessed again
5581        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5582    }
5583}
5584
5585impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5586    type ControlHandle = DirectoryControlHandle;
5587
5588    fn control_handle(&self) -> &DirectoryControlHandle {
5589        &self.control_handle
5590    }
5591
5592    fn drop_without_shutdown(mut self) {
5593        // Safety: drops once, never accessed again due to mem::forget
5594        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5595        // Prevent Drop from running (which would shut down the channel)
5596        std::mem::forget(self);
5597    }
5598}
5599
5600impl DirectorySetExtendedAttributeResponder {
5601    /// Sends a response to the FIDL transaction.
5602    ///
5603    /// Sets the channel to shutdown if an error occurs.
5604    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5605        let _result = self.send_raw(result);
5606        if _result.is_err() {
5607            self.control_handle.shutdown();
5608        }
5609        self.drop_without_shutdown();
5610        _result
5611    }
5612
5613    /// Similar to "send" but does not shutdown the channel if an error occurs.
5614    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5615        let _result = self.send_raw(result);
5616        self.drop_without_shutdown();
5617        _result
5618    }
5619
5620    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5621        self.control_handle
5622            .inner
5623            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5624                result,
5625                self.tx_id,
5626                0x4a951362f681f23c,
5627                fidl::encoding::DynamicFlags::empty(),
5628            )
5629    }
5630}
5631
5632#[must_use = "FIDL methods require a response to be sent"]
5633#[derive(Debug)]
5634pub struct DirectoryRemoveExtendedAttributeResponder {
5635    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5636    tx_id: u32,
5637}
5638
5639/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5640/// if the responder is dropped without sending a response, so that the client
5641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5642impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5643    fn drop(&mut self) {
5644        self.control_handle.shutdown();
5645        // Safety: drops once, never accessed again
5646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5647    }
5648}
5649
5650impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5651    type ControlHandle = DirectoryControlHandle;
5652
5653    fn control_handle(&self) -> &DirectoryControlHandle {
5654        &self.control_handle
5655    }
5656
5657    fn drop_without_shutdown(mut self) {
5658        // Safety: drops once, never accessed again due to mem::forget
5659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5660        // Prevent Drop from running (which would shut down the channel)
5661        std::mem::forget(self);
5662    }
5663}
5664
5665impl DirectoryRemoveExtendedAttributeResponder {
5666    /// Sends a response to the FIDL transaction.
5667    ///
5668    /// Sets the channel to shutdown if an error occurs.
5669    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5670        let _result = self.send_raw(result);
5671        if _result.is_err() {
5672            self.control_handle.shutdown();
5673        }
5674        self.drop_without_shutdown();
5675        _result
5676    }
5677
5678    /// Similar to "send" but does not shutdown the channel if an error occurs.
5679    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5680        let _result = self.send_raw(result);
5681        self.drop_without_shutdown();
5682        _result
5683    }
5684
5685    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5686        self.control_handle
5687            .inner
5688            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5689                result,
5690                self.tx_id,
5691                0x7a0b9f3a9bf9032d,
5692                fidl::encoding::DynamicFlags::empty(),
5693            )
5694    }
5695}
5696
5697#[must_use = "FIDL methods require a response to be sent"]
5698#[derive(Debug)]
5699pub struct DirectoryReadDirentsResponder {
5700    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5701    tx_id: u32,
5702}
5703
5704/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5705/// if the responder is dropped without sending a response, so that the client
5706/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5707impl std::ops::Drop for DirectoryReadDirentsResponder {
5708    fn drop(&mut self) {
5709        self.control_handle.shutdown();
5710        // Safety: drops once, never accessed again
5711        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5712    }
5713}
5714
5715impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5716    type ControlHandle = DirectoryControlHandle;
5717
5718    fn control_handle(&self) -> &DirectoryControlHandle {
5719        &self.control_handle
5720    }
5721
5722    fn drop_without_shutdown(mut self) {
5723        // Safety: drops once, never accessed again due to mem::forget
5724        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5725        // Prevent Drop from running (which would shut down the channel)
5726        std::mem::forget(self);
5727    }
5728}
5729
5730impl DirectoryReadDirentsResponder {
5731    /// Sends a response to the FIDL transaction.
5732    ///
5733    /// Sets the channel to shutdown if an error occurs.
5734    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5735        let _result = self.send_raw(s, dirents);
5736        if _result.is_err() {
5737            self.control_handle.shutdown();
5738        }
5739        self.drop_without_shutdown();
5740        _result
5741    }
5742
5743    /// Similar to "send" but does not shutdown the channel if an error occurs.
5744    pub fn send_no_shutdown_on_err(
5745        self,
5746        mut s: i32,
5747        mut dirents: &[u8],
5748    ) -> Result<(), fidl::Error> {
5749        let _result = self.send_raw(s, dirents);
5750        self.drop_without_shutdown();
5751        _result
5752    }
5753
5754    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5755        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5756            (s, dirents),
5757            self.tx_id,
5758            0x3582806bf27faa0a,
5759            fidl::encoding::DynamicFlags::empty(),
5760        )
5761    }
5762}
5763
5764#[must_use = "FIDL methods require a response to be sent"]
5765#[derive(Debug)]
5766pub struct DirectoryRewindResponder {
5767    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5768    tx_id: u32,
5769}
5770
5771/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5772/// if the responder is dropped without sending a response, so that the client
5773/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5774impl std::ops::Drop for DirectoryRewindResponder {
5775    fn drop(&mut self) {
5776        self.control_handle.shutdown();
5777        // Safety: drops once, never accessed again
5778        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5779    }
5780}
5781
5782impl fidl::endpoints::Responder for DirectoryRewindResponder {
5783    type ControlHandle = DirectoryControlHandle;
5784
5785    fn control_handle(&self) -> &DirectoryControlHandle {
5786        &self.control_handle
5787    }
5788
5789    fn drop_without_shutdown(mut self) {
5790        // Safety: drops once, never accessed again due to mem::forget
5791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5792        // Prevent Drop from running (which would shut down the channel)
5793        std::mem::forget(self);
5794    }
5795}
5796
5797impl DirectoryRewindResponder {
5798    /// Sends a response to the FIDL transaction.
5799    ///
5800    /// Sets the channel to shutdown if an error occurs.
5801    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5802        let _result = self.send_raw(s);
5803        if _result.is_err() {
5804            self.control_handle.shutdown();
5805        }
5806        self.drop_without_shutdown();
5807        _result
5808    }
5809
5810    /// Similar to "send" but does not shutdown the channel if an error occurs.
5811    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5812        let _result = self.send_raw(s);
5813        self.drop_without_shutdown();
5814        _result
5815    }
5816
5817    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5818        self.control_handle.inner.send::<DirectoryRewindResponse>(
5819            (s,),
5820            self.tx_id,
5821            0x16b1202af0f34c71,
5822            fidl::encoding::DynamicFlags::empty(),
5823        )
5824    }
5825}
5826
5827#[must_use = "FIDL methods require a response to be sent"]
5828#[derive(Debug)]
5829pub struct DirectoryDeprecatedGetTokenResponder {
5830    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5831    tx_id: u32,
5832}
5833
5834/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5835/// if the responder is dropped without sending a response, so that the client
5836/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5837impl std::ops::Drop for DirectoryDeprecatedGetTokenResponder {
5838    fn drop(&mut self) {
5839        self.control_handle.shutdown();
5840        // Safety: drops once, never accessed again
5841        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5842    }
5843}
5844
5845impl fidl::endpoints::Responder for DirectoryDeprecatedGetTokenResponder {
5846    type ControlHandle = DirectoryControlHandle;
5847
5848    fn control_handle(&self) -> &DirectoryControlHandle {
5849        &self.control_handle
5850    }
5851
5852    fn drop_without_shutdown(mut self) {
5853        // Safety: drops once, never accessed again due to mem::forget
5854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5855        // Prevent Drop from running (which would shut down the channel)
5856        std::mem::forget(self);
5857    }
5858}
5859
5860impl DirectoryDeprecatedGetTokenResponder {
5861    /// Sends a response to the FIDL transaction.
5862    ///
5863    /// Sets the channel to shutdown if an error occurs.
5864    pub fn send(
5865        self,
5866        mut s: i32,
5867        mut token: Option<fidl::NullableHandle>,
5868    ) -> Result<(), fidl::Error> {
5869        let _result = self.send_raw(s, token);
5870        if _result.is_err() {
5871            self.control_handle.shutdown();
5872        }
5873        self.drop_without_shutdown();
5874        _result
5875    }
5876
5877    /// Similar to "send" but does not shutdown the channel if an error occurs.
5878    pub fn send_no_shutdown_on_err(
5879        self,
5880        mut s: i32,
5881        mut token: Option<fidl::NullableHandle>,
5882    ) -> Result<(), fidl::Error> {
5883        let _result = self.send_raw(s, token);
5884        self.drop_without_shutdown();
5885        _result
5886    }
5887
5888    fn send_raw(
5889        &self,
5890        mut s: i32,
5891        mut token: Option<fidl::NullableHandle>,
5892    ) -> Result<(), fidl::Error> {
5893        self.control_handle.inner.send::<DirectoryDeprecatedGetTokenResponse>(
5894            (s, token),
5895            self.tx_id,
5896            0x26ae9d18763c8655,
5897            fidl::encoding::DynamicFlags::empty(),
5898        )
5899    }
5900}
5901
5902#[must_use = "FIDL methods require a response to be sent"]
5903#[derive(Debug)]
5904pub struct DirectoryLinkResponder {
5905    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5906    tx_id: u32,
5907}
5908
5909/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5910/// if the responder is dropped without sending a response, so that the client
5911/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5912impl std::ops::Drop for DirectoryLinkResponder {
5913    fn drop(&mut self) {
5914        self.control_handle.shutdown();
5915        // Safety: drops once, never accessed again
5916        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5917    }
5918}
5919
5920impl fidl::endpoints::Responder for DirectoryLinkResponder {
5921    type ControlHandle = DirectoryControlHandle;
5922
5923    fn control_handle(&self) -> &DirectoryControlHandle {
5924        &self.control_handle
5925    }
5926
5927    fn drop_without_shutdown(mut self) {
5928        // Safety: drops once, never accessed again due to mem::forget
5929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5930        // Prevent Drop from running (which would shut down the channel)
5931        std::mem::forget(self);
5932    }
5933}
5934
5935impl DirectoryLinkResponder {
5936    /// Sends a response to the FIDL transaction.
5937    ///
5938    /// Sets the channel to shutdown if an error occurs.
5939    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5940        let _result = self.send_raw(s);
5941        if _result.is_err() {
5942            self.control_handle.shutdown();
5943        }
5944        self.drop_without_shutdown();
5945        _result
5946    }
5947
5948    /// Similar to "send" but does not shutdown the channel if an error occurs.
5949    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5950        let _result = self.send_raw(s);
5951        self.drop_without_shutdown();
5952        _result
5953    }
5954
5955    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5956        self.control_handle.inner.send::<DirectoryLinkResponse>(
5957            (s,),
5958            self.tx_id,
5959            0x740604c0c7c930e7,
5960            fidl::encoding::DynamicFlags::empty(),
5961        )
5962    }
5963}
5964
5965#[must_use = "FIDL methods require a response to be sent"]
5966#[derive(Debug)]
5967pub struct DirectoryUnlinkResponder {
5968    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5969    tx_id: u32,
5970}
5971
5972/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5973/// if the responder is dropped without sending a response, so that the client
5974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5975impl std::ops::Drop for DirectoryUnlinkResponder {
5976    fn drop(&mut self) {
5977        self.control_handle.shutdown();
5978        // Safety: drops once, never accessed again
5979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5980    }
5981}
5982
5983impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5984    type ControlHandle = DirectoryControlHandle;
5985
5986    fn control_handle(&self) -> &DirectoryControlHandle {
5987        &self.control_handle
5988    }
5989
5990    fn drop_without_shutdown(mut self) {
5991        // Safety: drops once, never accessed again due to mem::forget
5992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5993        // Prevent Drop from running (which would shut down the channel)
5994        std::mem::forget(self);
5995    }
5996}
5997
5998impl DirectoryUnlinkResponder {
5999    /// Sends a response to the FIDL transaction.
6000    ///
6001    /// Sets the channel to shutdown if an error occurs.
6002    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6003        let _result = self.send_raw(result);
6004        if _result.is_err() {
6005            self.control_handle.shutdown();
6006        }
6007        self.drop_without_shutdown();
6008        _result
6009    }
6010
6011    /// Similar to "send" but does not shutdown the channel if an error occurs.
6012    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6013        let _result = self.send_raw(result);
6014        self.drop_without_shutdown();
6015        _result
6016    }
6017
6018    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6019        self.control_handle
6020            .inner
6021            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6022                result,
6023                self.tx_id,
6024                0x750a0326a78d7bed,
6025                fidl::encoding::DynamicFlags::empty(),
6026            )
6027    }
6028}
6029
6030#[must_use = "FIDL methods require a response to be sent"]
6031#[derive(Debug)]
6032pub struct DirectoryRenameResponder {
6033    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6034    tx_id: u32,
6035}
6036
6037/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6038/// if the responder is dropped without sending a response, so that the client
6039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6040impl std::ops::Drop for DirectoryRenameResponder {
6041    fn drop(&mut self) {
6042        self.control_handle.shutdown();
6043        // Safety: drops once, never accessed again
6044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6045    }
6046}
6047
6048impl fidl::endpoints::Responder for DirectoryRenameResponder {
6049    type ControlHandle = DirectoryControlHandle;
6050
6051    fn control_handle(&self) -> &DirectoryControlHandle {
6052        &self.control_handle
6053    }
6054
6055    fn drop_without_shutdown(mut self) {
6056        // Safety: drops once, never accessed again due to mem::forget
6057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6058        // Prevent Drop from running (which would shut down the channel)
6059        std::mem::forget(self);
6060    }
6061}
6062
6063impl DirectoryRenameResponder {
6064    /// Sends a response to the FIDL transaction.
6065    ///
6066    /// Sets the channel to shutdown if an error occurs.
6067    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6068        let _result = self.send_raw(result);
6069        if _result.is_err() {
6070            self.control_handle.shutdown();
6071        }
6072        self.drop_without_shutdown();
6073        _result
6074    }
6075
6076    /// Similar to "send" but does not shutdown the channel if an error occurs.
6077    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6078        let _result = self.send_raw(result);
6079        self.drop_without_shutdown();
6080        _result
6081    }
6082
6083    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6084        self.control_handle
6085            .inner
6086            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6087                result,
6088                self.tx_id,
6089                0x7060e7723b9928de,
6090                fidl::encoding::DynamicFlags::empty(),
6091            )
6092    }
6093}
6094
6095#[must_use = "FIDL methods require a response to be sent"]
6096#[derive(Debug)]
6097pub struct DirectoryCreateSymlinkResponder {
6098    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6099    tx_id: u32,
6100}
6101
6102/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6103/// if the responder is dropped without sending a response, so that the client
6104/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6105impl std::ops::Drop for DirectoryCreateSymlinkResponder {
6106    fn drop(&mut self) {
6107        self.control_handle.shutdown();
6108        // Safety: drops once, never accessed again
6109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6110    }
6111}
6112
6113impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
6114    type ControlHandle = DirectoryControlHandle;
6115
6116    fn control_handle(&self) -> &DirectoryControlHandle {
6117        &self.control_handle
6118    }
6119
6120    fn drop_without_shutdown(mut self) {
6121        // Safety: drops once, never accessed again due to mem::forget
6122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6123        // Prevent Drop from running (which would shut down the channel)
6124        std::mem::forget(self);
6125    }
6126}
6127
6128impl DirectoryCreateSymlinkResponder {
6129    /// Sends a response to the FIDL transaction.
6130    ///
6131    /// Sets the channel to shutdown if an error occurs.
6132    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6133        let _result = self.send_raw(result);
6134        if _result.is_err() {
6135            self.control_handle.shutdown();
6136        }
6137        self.drop_without_shutdown();
6138        _result
6139    }
6140
6141    /// Similar to "send" but does not shutdown the channel if an error occurs.
6142    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6143        let _result = self.send_raw(result);
6144        self.drop_without_shutdown();
6145        _result
6146    }
6147
6148    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6149        self.control_handle
6150            .inner
6151            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6152                result,
6153                self.tx_id,
6154                0x21ce0f19ec043889,
6155                fidl::encoding::DynamicFlags::empty(),
6156            )
6157    }
6158}
6159
6160#[must_use = "FIDL methods require a response to be sent"]
6161#[derive(Debug)]
6162pub struct DirectoryWatchResponder {
6163    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6164    tx_id: u32,
6165}
6166
6167/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6168/// if the responder is dropped without sending a response, so that the client
6169/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6170impl std::ops::Drop for DirectoryWatchResponder {
6171    fn drop(&mut self) {
6172        self.control_handle.shutdown();
6173        // Safety: drops once, never accessed again
6174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6175    }
6176}
6177
6178impl fidl::endpoints::Responder for DirectoryWatchResponder {
6179    type ControlHandle = DirectoryControlHandle;
6180
6181    fn control_handle(&self) -> &DirectoryControlHandle {
6182        &self.control_handle
6183    }
6184
6185    fn drop_without_shutdown(mut self) {
6186        // Safety: drops once, never accessed again due to mem::forget
6187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6188        // Prevent Drop from running (which would shut down the channel)
6189        std::mem::forget(self);
6190    }
6191}
6192
6193impl DirectoryWatchResponder {
6194    /// Sends a response to the FIDL transaction.
6195    ///
6196    /// Sets the channel to shutdown if an error occurs.
6197    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6198        let _result = self.send_raw(s);
6199        if _result.is_err() {
6200            self.control_handle.shutdown();
6201        }
6202        self.drop_without_shutdown();
6203        _result
6204    }
6205
6206    /// Similar to "send" but does not shutdown the channel if an error occurs.
6207    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6208        let _result = self.send_raw(s);
6209        self.drop_without_shutdown();
6210        _result
6211    }
6212
6213    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6214        self.control_handle.inner.send::<DirectoryWatchResponse>(
6215            (s,),
6216            self.tx_id,
6217            0x5717193a59d66d91,
6218            fidl::encoding::DynamicFlags::empty(),
6219        )
6220    }
6221}
6222
6223#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6224pub struct DirectoryWatcherMarker;
6225
6226impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6227    type Proxy = DirectoryWatcherProxy;
6228    type RequestStream = DirectoryWatcherRequestStream;
6229    #[cfg(target_os = "fuchsia")]
6230    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6231
6232    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6233}
6234
6235pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6236#[derive(Debug)]
6237#[cfg(target_os = "fuchsia")]
6238pub struct DirectoryWatcherSynchronousProxy {
6239    client: fidl::client::sync::Client,
6240}
6241
6242#[cfg(target_os = "fuchsia")]
6243impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6244    type Proxy = DirectoryWatcherProxy;
6245    type Protocol = DirectoryWatcherMarker;
6246
6247    fn from_channel(inner: fidl::Channel) -> Self {
6248        Self::new(inner)
6249    }
6250
6251    fn into_channel(self) -> fidl::Channel {
6252        self.client.into_channel()
6253    }
6254
6255    fn as_channel(&self) -> &fidl::Channel {
6256        self.client.as_channel()
6257    }
6258}
6259
6260#[cfg(target_os = "fuchsia")]
6261impl DirectoryWatcherSynchronousProxy {
6262    pub fn new(channel: fidl::Channel) -> Self {
6263        Self { client: fidl::client::sync::Client::new(channel) }
6264    }
6265
6266    pub fn into_channel(self) -> fidl::Channel {
6267        self.client.into_channel()
6268    }
6269
6270    /// Waits until an event arrives and returns it. It is safe for other
6271    /// threads to make concurrent requests while waiting for an event.
6272    pub fn wait_for_event(
6273        &self,
6274        deadline: zx::MonotonicInstant,
6275    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6276        DirectoryWatcherEvent::decode(
6277            self.client.wait_for_event::<DirectoryWatcherMarker>(deadline)?,
6278        )
6279    }
6280}
6281
6282#[cfg(target_os = "fuchsia")]
6283impl From<DirectoryWatcherSynchronousProxy> for zx::NullableHandle {
6284    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6285        value.into_channel().into()
6286    }
6287}
6288
6289#[cfg(target_os = "fuchsia")]
6290impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6291    fn from(value: fidl::Channel) -> Self {
6292        Self::new(value)
6293    }
6294}
6295
6296#[cfg(target_os = "fuchsia")]
6297impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6298    type Protocol = DirectoryWatcherMarker;
6299
6300    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6301        Self::new(value.into_channel())
6302    }
6303}
6304
6305#[derive(Debug, Clone)]
6306pub struct DirectoryWatcherProxy {
6307    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6308}
6309
6310impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6311    type Protocol = DirectoryWatcherMarker;
6312
6313    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6314        Self::new(inner)
6315    }
6316
6317    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6318        self.client.into_channel().map_err(|client| Self { client })
6319    }
6320
6321    fn as_channel(&self) -> &::fidl::AsyncChannel {
6322        self.client.as_channel()
6323    }
6324}
6325
6326impl DirectoryWatcherProxy {
6327    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6328    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6329        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6330        Self { client: fidl::client::Client::new(channel, protocol_name) }
6331    }
6332
6333    /// Get a Stream of events from the remote end of the protocol.
6334    ///
6335    /// # Panics
6336    ///
6337    /// Panics if the event stream was already taken.
6338    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6339        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6340    }
6341}
6342
6343impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6344
6345pub struct DirectoryWatcherEventStream {
6346    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6347}
6348
6349impl std::marker::Unpin for DirectoryWatcherEventStream {}
6350
6351impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6352    fn is_terminated(&self) -> bool {
6353        self.event_receiver.is_terminated()
6354    }
6355}
6356
6357impl futures::Stream for DirectoryWatcherEventStream {
6358    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6359
6360    fn poll_next(
6361        mut self: std::pin::Pin<&mut Self>,
6362        cx: &mut std::task::Context<'_>,
6363    ) -> std::task::Poll<Option<Self::Item>> {
6364        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6365            &mut self.event_receiver,
6366            cx
6367        )?) {
6368            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6369            None => std::task::Poll::Ready(None),
6370        }
6371    }
6372}
6373
6374#[derive(Debug)]
6375pub enum DirectoryWatcherEvent {}
6376
6377impl DirectoryWatcherEvent {
6378    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6379    fn decode(
6380        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6381    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6382        let (bytes, _handles) = buf.split_mut();
6383        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6384        debug_assert_eq!(tx_header.tx_id, 0);
6385        match tx_header.ordinal {
6386            _ => Err(fidl::Error::UnknownOrdinal {
6387                ordinal: tx_header.ordinal,
6388                protocol_name:
6389                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6390            }),
6391        }
6392    }
6393}
6394
6395/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6396pub struct DirectoryWatcherRequestStream {
6397    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6398    is_terminated: bool,
6399}
6400
6401impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6402
6403impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6404    fn is_terminated(&self) -> bool {
6405        self.is_terminated
6406    }
6407}
6408
6409impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6410    type Protocol = DirectoryWatcherMarker;
6411    type ControlHandle = DirectoryWatcherControlHandle;
6412
6413    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6414        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6415    }
6416
6417    fn control_handle(&self) -> Self::ControlHandle {
6418        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6419    }
6420
6421    fn into_inner(
6422        self,
6423    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6424    {
6425        (self.inner, self.is_terminated)
6426    }
6427
6428    fn from_inner(
6429        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6430        is_terminated: bool,
6431    ) -> Self {
6432        Self { inner, is_terminated }
6433    }
6434}
6435
6436impl futures::Stream for DirectoryWatcherRequestStream {
6437    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6438
6439    fn poll_next(
6440        mut self: std::pin::Pin<&mut Self>,
6441        cx: &mut std::task::Context<'_>,
6442    ) -> std::task::Poll<Option<Self::Item>> {
6443        let this = &mut *self;
6444        if this.inner.check_shutdown(cx) {
6445            this.is_terminated = true;
6446            return std::task::Poll::Ready(None);
6447        }
6448        if this.is_terminated {
6449            panic!("polled DirectoryWatcherRequestStream after completion");
6450        }
6451        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6452            |bytes, handles| {
6453                match this.inner.channel().read_etc(cx, bytes, handles) {
6454                    std::task::Poll::Ready(Ok(())) => {}
6455                    std::task::Poll::Pending => return std::task::Poll::Pending,
6456                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6457                        this.is_terminated = true;
6458                        return std::task::Poll::Ready(None);
6459                    }
6460                    std::task::Poll::Ready(Err(e)) => {
6461                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6462                            e.into(),
6463                        ))));
6464                    }
6465                }
6466
6467                // A message has been received from the channel
6468                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6469
6470                std::task::Poll::Ready(Some(match header.ordinal {
6471                    _ => Err(fidl::Error::UnknownOrdinal {
6472                        ordinal: header.ordinal,
6473                        protocol_name:
6474                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6475                    }),
6476                }))
6477            },
6478        )
6479    }
6480}
6481
6482/// DirectoryWatcher transmits messages from a filesystem server
6483/// about events happening in the filesystem. Clients can register
6484/// new watchers using the `Directory.Watch` method, where they can
6485/// filter which events they want to receive notifications for.
6486///
6487/// The DirectoryWatcher will send messages of the form:
6488/// ```
6489/// struct {
6490///   uint8 event;
6491///   uint8 len;
6492///   char name[];
6493/// };
6494/// ```
6495/// Where names are NOT null-terminated. The name is the relative
6496/// path to the entry the event is refering to. It will be empty if
6497/// the event isn't referencing a particular entry (e.g. for the
6498/// `IDLE` event).
6499#[derive(Debug)]
6500pub enum DirectoryWatcherRequest {}
6501
6502impl DirectoryWatcherRequest {
6503    /// Name of the method defined in FIDL
6504    pub fn method_name(&self) -> &'static str {
6505        match *self {}
6506    }
6507}
6508
6509#[derive(Debug, Clone)]
6510pub struct DirectoryWatcherControlHandle {
6511    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6512}
6513
6514impl DirectoryWatcherControlHandle {
6515    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6516        self.inner.shutdown_with_epitaph(status.into())
6517    }
6518}
6519
6520impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6521    fn shutdown(&self) {
6522        self.inner.shutdown()
6523    }
6524
6525    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6526        self.inner.shutdown_with_epitaph(status)
6527    }
6528
6529    fn is_closed(&self) -> bool {
6530        self.inner.channel().is_closed()
6531    }
6532    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6533        self.inner.channel().on_closed()
6534    }
6535
6536    #[cfg(target_os = "fuchsia")]
6537    fn signal_peer(
6538        &self,
6539        clear_mask: zx::Signals,
6540        set_mask: zx::Signals,
6541    ) -> Result<(), zx_status::Status> {
6542        use fidl::Peered;
6543        self.inner.channel().signal_peer(clear_mask, set_mask)
6544    }
6545}
6546
6547impl DirectoryWatcherControlHandle {}
6548
6549#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6550pub struct ExtendedAttributeIteratorMarker;
6551
6552impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6553    type Proxy = ExtendedAttributeIteratorProxy;
6554    type RequestStream = ExtendedAttributeIteratorRequestStream;
6555    #[cfg(target_os = "fuchsia")]
6556    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6557
6558    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6559}
6560pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6561
6562pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6563    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6564        + Send;
6565    fn r#get_next(&self) -> Self::GetNextResponseFut;
6566}
6567#[derive(Debug)]
6568#[cfg(target_os = "fuchsia")]
6569pub struct ExtendedAttributeIteratorSynchronousProxy {
6570    client: fidl::client::sync::Client,
6571}
6572
6573#[cfg(target_os = "fuchsia")]
6574impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6575    type Proxy = ExtendedAttributeIteratorProxy;
6576    type Protocol = ExtendedAttributeIteratorMarker;
6577
6578    fn from_channel(inner: fidl::Channel) -> Self {
6579        Self::new(inner)
6580    }
6581
6582    fn into_channel(self) -> fidl::Channel {
6583        self.client.into_channel()
6584    }
6585
6586    fn as_channel(&self) -> &fidl::Channel {
6587        self.client.as_channel()
6588    }
6589}
6590
6591#[cfg(target_os = "fuchsia")]
6592impl ExtendedAttributeIteratorSynchronousProxy {
6593    pub fn new(channel: fidl::Channel) -> Self {
6594        Self { client: fidl::client::sync::Client::new(channel) }
6595    }
6596
6597    pub fn into_channel(self) -> fidl::Channel {
6598        self.client.into_channel()
6599    }
6600
6601    /// Waits until an event arrives and returns it. It is safe for other
6602    /// threads to make concurrent requests while waiting for an event.
6603    pub fn wait_for_event(
6604        &self,
6605        deadline: zx::MonotonicInstant,
6606    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6607        ExtendedAttributeIteratorEvent::decode(
6608            self.client.wait_for_event::<ExtendedAttributeIteratorMarker>(deadline)?,
6609        )
6610    }
6611
6612    /// Get the next chunk of extended attribute names. If this is the last
6613    /// chunk, last will be true, and the channel will be closed after the
6614    /// call.
6615    pub fn r#get_next(
6616        &self,
6617        ___deadline: zx::MonotonicInstant,
6618    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6619        let _response = self.client.send_query::<
6620            fidl::encoding::EmptyPayload,
6621            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6622            ExtendedAttributeIteratorMarker,
6623        >(
6624            (),
6625            0x3ba664a1c2e45a7,
6626            fidl::encoding::DynamicFlags::empty(),
6627            ___deadline,
6628        )?;
6629        Ok(_response.map(|x| (x.attributes, x.last)))
6630    }
6631}
6632
6633#[cfg(target_os = "fuchsia")]
6634impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::NullableHandle {
6635    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6636        value.into_channel().into()
6637    }
6638}
6639
6640#[cfg(target_os = "fuchsia")]
6641impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6642    fn from(value: fidl::Channel) -> Self {
6643        Self::new(value)
6644    }
6645}
6646
6647#[cfg(target_os = "fuchsia")]
6648impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6649    type Protocol = ExtendedAttributeIteratorMarker;
6650
6651    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6652        Self::new(value.into_channel())
6653    }
6654}
6655
6656#[derive(Debug, Clone)]
6657pub struct ExtendedAttributeIteratorProxy {
6658    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6659}
6660
6661impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6662    type Protocol = ExtendedAttributeIteratorMarker;
6663
6664    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6665        Self::new(inner)
6666    }
6667
6668    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6669        self.client.into_channel().map_err(|client| Self { client })
6670    }
6671
6672    fn as_channel(&self) -> &::fidl::AsyncChannel {
6673        self.client.as_channel()
6674    }
6675}
6676
6677impl ExtendedAttributeIteratorProxy {
6678    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6679    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6680        let protocol_name =
6681            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6682        Self { client: fidl::client::Client::new(channel, protocol_name) }
6683    }
6684
6685    /// Get a Stream of events from the remote end of the protocol.
6686    ///
6687    /// # Panics
6688    ///
6689    /// Panics if the event stream was already taken.
6690    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6691        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6692    }
6693
6694    /// Get the next chunk of extended attribute names. If this is the last
6695    /// chunk, last will be true, and the channel will be closed after the
6696    /// call.
6697    pub fn r#get_next(
6698        &self,
6699    ) -> fidl::client::QueryResponseFut<
6700        ExtendedAttributeIteratorGetNextResult,
6701        fidl::encoding::DefaultFuchsiaResourceDialect,
6702    > {
6703        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6704    }
6705}
6706
6707impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6708    type GetNextResponseFut = fidl::client::QueryResponseFut<
6709        ExtendedAttributeIteratorGetNextResult,
6710        fidl::encoding::DefaultFuchsiaResourceDialect,
6711    >;
6712    fn r#get_next(&self) -> Self::GetNextResponseFut {
6713        fn _decode(
6714            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6715        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6716            let _response = fidl::client::decode_transaction_body::<
6717                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6718                fidl::encoding::DefaultFuchsiaResourceDialect,
6719                0x3ba664a1c2e45a7,
6720            >(_buf?)?;
6721            Ok(_response.map(|x| (x.attributes, x.last)))
6722        }
6723        self.client.send_query_and_decode::<
6724            fidl::encoding::EmptyPayload,
6725            ExtendedAttributeIteratorGetNextResult,
6726        >(
6727            (),
6728            0x3ba664a1c2e45a7,
6729            fidl::encoding::DynamicFlags::empty(),
6730            _decode,
6731        )
6732    }
6733}
6734
6735pub struct ExtendedAttributeIteratorEventStream {
6736    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6737}
6738
6739impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6740
6741impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6742    fn is_terminated(&self) -> bool {
6743        self.event_receiver.is_terminated()
6744    }
6745}
6746
6747impl futures::Stream for ExtendedAttributeIteratorEventStream {
6748    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6749
6750    fn poll_next(
6751        mut self: std::pin::Pin<&mut Self>,
6752        cx: &mut std::task::Context<'_>,
6753    ) -> std::task::Poll<Option<Self::Item>> {
6754        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6755            &mut self.event_receiver,
6756            cx
6757        )?) {
6758            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6759            None => std::task::Poll::Ready(None),
6760        }
6761    }
6762}
6763
6764#[derive(Debug)]
6765pub enum ExtendedAttributeIteratorEvent {}
6766
6767impl ExtendedAttributeIteratorEvent {
6768    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6769    fn decode(
6770        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6771    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6772        let (bytes, _handles) = buf.split_mut();
6773        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6774        debug_assert_eq!(tx_header.tx_id, 0);
6775        match tx_header.ordinal {
6776            _ => Err(fidl::Error::UnknownOrdinal {
6777                ordinal: tx_header.ordinal,
6778                protocol_name:
6779                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6780            }),
6781        }
6782    }
6783}
6784
6785/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6786pub struct ExtendedAttributeIteratorRequestStream {
6787    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6788    is_terminated: bool,
6789}
6790
6791impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6792
6793impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6794    fn is_terminated(&self) -> bool {
6795        self.is_terminated
6796    }
6797}
6798
6799impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6800    type Protocol = ExtendedAttributeIteratorMarker;
6801    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6802
6803    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6804        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6805    }
6806
6807    fn control_handle(&self) -> Self::ControlHandle {
6808        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6809    }
6810
6811    fn into_inner(
6812        self,
6813    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6814    {
6815        (self.inner, self.is_terminated)
6816    }
6817
6818    fn from_inner(
6819        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6820        is_terminated: bool,
6821    ) -> Self {
6822        Self { inner, is_terminated }
6823    }
6824}
6825
6826impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6827    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6828
6829    fn poll_next(
6830        mut self: std::pin::Pin<&mut Self>,
6831        cx: &mut std::task::Context<'_>,
6832    ) -> std::task::Poll<Option<Self::Item>> {
6833        let this = &mut *self;
6834        if this.inner.check_shutdown(cx) {
6835            this.is_terminated = true;
6836            return std::task::Poll::Ready(None);
6837        }
6838        if this.is_terminated {
6839            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6840        }
6841        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6842            |bytes, handles| {
6843                match this.inner.channel().read_etc(cx, bytes, handles) {
6844                    std::task::Poll::Ready(Ok(())) => {}
6845                    std::task::Poll::Pending => return std::task::Poll::Pending,
6846                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6847                        this.is_terminated = true;
6848                        return std::task::Poll::Ready(None);
6849                    }
6850                    std::task::Poll::Ready(Err(e)) => {
6851                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6852                            e.into(),
6853                        ))));
6854                    }
6855                }
6856
6857                // A message has been received from the channel
6858                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6859
6860                std::task::Poll::Ready(Some(match header.ordinal {
6861                0x3ba664a1c2e45a7 => {
6862                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6863                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6864                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6865                    let control_handle = ExtendedAttributeIteratorControlHandle {
6866                        inner: this.inner.clone(),
6867                    };
6868                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6869                        responder: ExtendedAttributeIteratorGetNextResponder {
6870                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6871                            tx_id: header.tx_id,
6872                        },
6873                    })
6874                }
6875                _ => Err(fidl::Error::UnknownOrdinal {
6876                    ordinal: header.ordinal,
6877                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6878                }),
6879            }))
6880            },
6881        )
6882    }
6883}
6884
6885#[derive(Debug)]
6886pub enum ExtendedAttributeIteratorRequest {
6887    /// Get the next chunk of extended attribute names. If this is the last
6888    /// chunk, last will be true, and the channel will be closed after the
6889    /// call.
6890    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6891}
6892
6893impl ExtendedAttributeIteratorRequest {
6894    #[allow(irrefutable_let_patterns)]
6895    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6896        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6897            Some((responder))
6898        } else {
6899            None
6900        }
6901    }
6902
6903    /// Name of the method defined in FIDL
6904    pub fn method_name(&self) -> &'static str {
6905        match *self {
6906            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6907        }
6908    }
6909}
6910
6911#[derive(Debug, Clone)]
6912pub struct ExtendedAttributeIteratorControlHandle {
6913    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6914}
6915
6916impl ExtendedAttributeIteratorControlHandle {
6917    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6918        self.inner.shutdown_with_epitaph(status.into())
6919    }
6920}
6921
6922impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6923    fn shutdown(&self) {
6924        self.inner.shutdown()
6925    }
6926
6927    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6928        self.inner.shutdown_with_epitaph(status)
6929    }
6930
6931    fn is_closed(&self) -> bool {
6932        self.inner.channel().is_closed()
6933    }
6934    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6935        self.inner.channel().on_closed()
6936    }
6937
6938    #[cfg(target_os = "fuchsia")]
6939    fn signal_peer(
6940        &self,
6941        clear_mask: zx::Signals,
6942        set_mask: zx::Signals,
6943    ) -> Result<(), zx_status::Status> {
6944        use fidl::Peered;
6945        self.inner.channel().signal_peer(clear_mask, set_mask)
6946    }
6947}
6948
6949impl ExtendedAttributeIteratorControlHandle {}
6950
6951#[must_use = "FIDL methods require a response to be sent"]
6952#[derive(Debug)]
6953pub struct ExtendedAttributeIteratorGetNextResponder {
6954    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6955    tx_id: u32,
6956}
6957
6958/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6959/// if the responder is dropped without sending a response, so that the client
6960/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6961impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6962    fn drop(&mut self) {
6963        self.control_handle.shutdown();
6964        // Safety: drops once, never accessed again
6965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6966    }
6967}
6968
6969impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6970    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6971
6972    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6973        &self.control_handle
6974    }
6975
6976    fn drop_without_shutdown(mut self) {
6977        // Safety: drops once, never accessed again due to mem::forget
6978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6979        // Prevent Drop from running (which would shut down the channel)
6980        std::mem::forget(self);
6981    }
6982}
6983
6984impl ExtendedAttributeIteratorGetNextResponder {
6985    /// Sends a response to the FIDL transaction.
6986    ///
6987    /// Sets the channel to shutdown if an error occurs.
6988    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6989        let _result = self.send_raw(result);
6990        if _result.is_err() {
6991            self.control_handle.shutdown();
6992        }
6993        self.drop_without_shutdown();
6994        _result
6995    }
6996
6997    /// Similar to "send" but does not shutdown the channel if an error occurs.
6998    pub fn send_no_shutdown_on_err(
6999        self,
7000        mut result: Result<(&[Vec<u8>], bool), i32>,
7001    ) -> Result<(), fidl::Error> {
7002        let _result = self.send_raw(result);
7003        self.drop_without_shutdown();
7004        _result
7005    }
7006
7007    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
7008        self.control_handle.inner.send::<fidl::encoding::ResultType<
7009            ExtendedAttributeIteratorGetNextResponse,
7010            i32,
7011        >>(
7012            result,
7013            self.tx_id,
7014            0x3ba664a1c2e45a7,
7015            fidl::encoding::DynamicFlags::empty(),
7016        )
7017    }
7018}
7019
7020#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7021pub struct FileMarker;
7022
7023impl fidl::endpoints::ProtocolMarker for FileMarker {
7024    type Proxy = FileProxy;
7025    type RequestStream = FileRequestStream;
7026    #[cfg(target_os = "fuchsia")]
7027    type SynchronousProxy = FileSynchronousProxy;
7028
7029    const DEBUG_NAME: &'static str = "fuchsia.io.File";
7030}
7031impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
7032pub type FileSeekResult = Result<u64, i32>;
7033pub type FileReadAtResult = Result<Vec<u8>, i32>;
7034pub type FileWriteAtResult = Result<u64, i32>;
7035pub type FileResizeResult = Result<(), i32>;
7036pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
7037pub type FileAllocateResult = Result<(), i32>;
7038pub type FileEnableVerityResult = Result<(), i32>;
7039
7040pub trait FileProxyInterface: Send + Sync {
7041    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
7042        + Send;
7043    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
7044    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
7045        + Send;
7046    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
7047    fn r#clone(
7048        &self,
7049        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7050    ) -> Result<(), fidl::Error>;
7051    type CloseResponseFut: std::future::Future<
7052            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
7053        > + Send;
7054    fn r#close(&self) -> Self::CloseResponseFut;
7055    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
7056    fn r#query(&self) -> Self::QueryResponseFut;
7057    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
7058        + Send;
7059    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
7060    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
7061    fn r#deprecated_set_attr(
7062        &self,
7063        flags: NodeAttributeFlags,
7064        attributes: &NodeAttributes,
7065    ) -> Self::DeprecatedSetAttrResponseFut;
7066    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
7067        + Send;
7068    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
7069    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
7070        + Send;
7071    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
7072    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
7073        + Send;
7074    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
7075    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
7076        + Send;
7077    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
7078    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
7079        + Send;
7080    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
7081    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
7082        + Send;
7083    fn r#get_token(&self) -> Self::GetTokenResponseFut;
7084    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
7085        + Send;
7086    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
7087    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
7088        + Send;
7089    fn r#update_attributes(
7090        &self,
7091        payload: &MutableNodeAttributes,
7092    ) -> Self::UpdateAttributesResponseFut;
7093    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
7094    fn r#sync(&self) -> Self::SyncResponseFut;
7095    fn r#list_extended_attributes(
7096        &self,
7097        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7098    ) -> Result<(), fidl::Error>;
7099    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
7100        + Send;
7101    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
7102    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
7103        + Send;
7104    fn r#set_extended_attribute(
7105        &self,
7106        name: &[u8],
7107        value: ExtendedAttributeValue,
7108        mode: SetExtendedAttributeMode,
7109    ) -> Self::SetExtendedAttributeResponseFut;
7110    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
7111        + Send;
7112    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
7113    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
7114        + Send;
7115    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
7116    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
7117        + Send;
7118    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
7119    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
7120    fn r#describe(&self) -> Self::DescribeResponseFut;
7121    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
7122    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
7123    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
7124        + Send;
7125    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
7126    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
7127        + Send;
7128    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
7129    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
7130        + Send;
7131    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
7132    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
7133        + Send;
7134    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
7135    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
7136        + Send;
7137    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
7138    -> Self::AllocateResponseFut;
7139    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
7140        + Send;
7141    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
7142}
7143#[derive(Debug)]
7144#[cfg(target_os = "fuchsia")]
7145pub struct FileSynchronousProxy {
7146    client: fidl::client::sync::Client,
7147}
7148
7149#[cfg(target_os = "fuchsia")]
7150impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
7151    type Proxy = FileProxy;
7152    type Protocol = FileMarker;
7153
7154    fn from_channel(inner: fidl::Channel) -> Self {
7155        Self::new(inner)
7156    }
7157
7158    fn into_channel(self) -> fidl::Channel {
7159        self.client.into_channel()
7160    }
7161
7162    fn as_channel(&self) -> &fidl::Channel {
7163        self.client.as_channel()
7164    }
7165}
7166
7167#[cfg(target_os = "fuchsia")]
7168impl FileSynchronousProxy {
7169    pub fn new(channel: fidl::Channel) -> Self {
7170        Self { client: fidl::client::sync::Client::new(channel) }
7171    }
7172
7173    pub fn into_channel(self) -> fidl::Channel {
7174        self.client.into_channel()
7175    }
7176
7177    /// Waits until an event arrives and returns it. It is safe for other
7178    /// threads to make concurrent requests while waiting for an event.
7179    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
7180        FileEvent::decode(self.client.wait_for_event::<FileMarker>(deadline)?)
7181    }
7182
7183    /// Acquires an advisory lock on the underlying file.
7184    ///
7185    /// The lock lasts until either this connection is closed or
7186    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7187    /// explicitly.
7188    ///
7189    /// Advisory locks are purely advisory. They do not prevent actual read or
7190    /// write operations from occurring on the file, either through this
7191    /// connection or through other connections.
7192    ///
7193    /// This method requires the following rights:
7194    ///
7195    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7196    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7197    ///   [`AdvisoryLockType.WRITE`].
7198    ///
7199    /// # Errors
7200    ///
7201    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7202    ///   example, another connection might hold a conflicting lock type.
7203    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7204    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7205    ///   to acquire the given type of lock.
7206    pub fn r#advisory_lock(
7207        &self,
7208        mut request: &AdvisoryLockRequest,
7209        ___deadline: zx::MonotonicInstant,
7210    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7211        let _response = self.client.send_query::<
7212            AdvisoryLockingAdvisoryLockRequest,
7213            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7214            FileMarker,
7215        >(
7216            (request,),
7217            0x6ee9c0ad53ec87aa,
7218            fidl::encoding::DynamicFlags::empty(),
7219            ___deadline,
7220        )?;
7221        Ok(_response.map(|x| x))
7222    }
7223
7224    /// Creates a link to this this object with name `dst` in the directory represented by
7225    /// `dst_parent_token`.
7226    ///
7227    /// `dst` must be a resolved object name. Including "/" in the string will return
7228    /// `ZX_ERR_INVALID_ARGS`.
7229    ///
7230    /// This method requires the maximal set of rights supported by the filesystem for this object.
7231    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7232    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7233    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7234    /// `ZX_ERR_ACCESS_DENIED`.
7235    ///
7236    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7237    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7238    ///
7239    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7240    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7241    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7242    ///
7243    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7244    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7245    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7246    pub fn r#link_into(
7247        &self,
7248        mut dst_parent_token: fidl::Event,
7249        mut dst: &str,
7250        ___deadline: zx::MonotonicInstant,
7251    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7252        let _response = self.client.send_query::<
7253            LinkableLinkIntoRequest,
7254            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7255            FileMarker,
7256        >(
7257            (dst_parent_token, dst,),
7258            0x54f3949246a03e74,
7259            fidl::encoding::DynamicFlags::empty(),
7260            ___deadline,
7261        )?;
7262        Ok(_response.map(|x| x))
7263    }
7264
7265    pub fn r#clone(
7266        &self,
7267        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7268    ) -> Result<(), fidl::Error> {
7269        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7270            (request,),
7271            0x20d8a7aba2168a79,
7272            fidl::encoding::DynamicFlags::empty(),
7273        )
7274    }
7275
7276    /// Terminates the connection.
7277    ///
7278    /// After calling `Close`, the client must not send any other requests.
7279    ///
7280    /// Servers, after sending the status response, should close the connection
7281    /// regardless of status and without sending an epitaph.
7282    ///
7283    /// Closing the client end of the channel should be semantically equivalent
7284    /// to calling `Close` without knowing when the close has completed or its
7285    /// status.
7286    pub fn r#close(
7287        &self,
7288        ___deadline: zx::MonotonicInstant,
7289    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7290        let _response = self.client.send_query::<
7291            fidl::encoding::EmptyPayload,
7292            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7293            FileMarker,
7294        >(
7295            (),
7296            0x5ac5d459ad7f657e,
7297            fidl::encoding::DynamicFlags::empty(),
7298            ___deadline,
7299        )?;
7300        Ok(_response.map(|x| x))
7301    }
7302
7303    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7304        let _response = self.client.send_query::<
7305            fidl::encoding::EmptyPayload,
7306            fidl_fuchsia_unknown::QueryableQueryResponse,
7307            FileMarker,
7308        >(
7309            (),
7310            0x2658edee9decfc06,
7311            fidl::encoding::DynamicFlags::empty(),
7312            ___deadline,
7313        )?;
7314        Ok(_response.protocol)
7315    }
7316
7317    /// DEPRECATED - Use `Node.GetAttributes` instead.
7318    ///
7319    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7320    pub fn r#deprecated_get_attr(
7321        &self,
7322        ___deadline: zx::MonotonicInstant,
7323    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7324        let _response = self
7325            .client
7326            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, FileMarker>(
7327                (),
7328                0x78985e216314dafd,
7329                fidl::encoding::DynamicFlags::empty(),
7330                ___deadline,
7331            )?;
7332        Ok((_response.s, _response.attributes))
7333    }
7334
7335    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7336    pub fn r#deprecated_set_attr(
7337        &self,
7338        mut flags: NodeAttributeFlags,
7339        mut attributes: &NodeAttributes,
7340        ___deadline: zx::MonotonicInstant,
7341    ) -> Result<i32, fidl::Error> {
7342        let _response = self
7343            .client
7344            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, FileMarker>(
7345                (flags, attributes),
7346                0x4186c0f40d938f46,
7347                fidl::encoding::DynamicFlags::empty(),
7348                ___deadline,
7349            )?;
7350        Ok(_response.s)
7351    }
7352
7353    /// [DEPRECATED - Use new GetFlags method instead.]
7354    pub fn r#deprecated_get_flags(
7355        &self,
7356        ___deadline: zx::MonotonicInstant,
7357    ) -> Result<(i32, OpenFlags), fidl::Error> {
7358        let _response = self
7359            .client
7360            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, FileMarker>(
7361                (),
7362                0x5b88fffb8eda3aa1,
7363                fidl::encoding::DynamicFlags::empty(),
7364                ___deadline,
7365            )?;
7366        Ok((_response.s, _response.flags))
7367    }
7368
7369    /// [DEPRECATED - Use new SetFlags method instead.]
7370    pub fn r#deprecated_set_flags(
7371        &self,
7372        mut flags: OpenFlags,
7373        ___deadline: zx::MonotonicInstant,
7374    ) -> Result<i32, fidl::Error> {
7375        let _response = self.client.send_query::<
7376            NodeDeprecatedSetFlagsRequest,
7377            NodeDeprecatedSetFlagsResponse,
7378            FileMarker,
7379        >(
7380            (flags,),
7381            0x5295b76c71fde733,
7382            fidl::encoding::DynamicFlags::empty(),
7383            ___deadline,
7384        )?;
7385        Ok(_response.s)
7386    }
7387
7388    /// Queries the flags that apply to this node after it has been opened/created. This method does
7389    /// not require any rights.
7390    ///
7391    /// Note that the final set of flags that apply to the connection may differ from those
7392    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7393    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7394    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7395    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7396    pub fn r#get_flags(
7397        &self,
7398        ___deadline: zx::MonotonicInstant,
7399    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7400        let _response = self.client.send_query::<
7401            fidl::encoding::EmptyPayload,
7402            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7403            FileMarker,
7404        >(
7405            (),
7406            0x176eb318f64ec23,
7407            fidl::encoding::DynamicFlags::FLEXIBLE,
7408            ___deadline,
7409        )?
7410        .into_result::<FileMarker>("get_flags")?;
7411        Ok(_response.map(|x| x.flags))
7412    }
7413
7414    /// Sets the flags that apply to this node after it has been opened. This method does not
7415    /// require any rights.
7416    ///
7417    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7418    /// clear append mode.
7419    ///
7420    /// Errors:
7421    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7422    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7423    pub fn r#set_flags(
7424        &self,
7425        mut flags: Flags,
7426        ___deadline: zx::MonotonicInstant,
7427    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7428        let _response = self.client.send_query::<
7429            NodeSetFlagsRequest,
7430            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7431            FileMarker,
7432        >(
7433            (flags,),
7434            0x55a8028685791ea8,
7435            fidl::encoding::DynamicFlags::FLEXIBLE,
7436            ___deadline,
7437        )?
7438        .into_result::<FileMarker>("set_flags")?;
7439        Ok(_response.map(|x| x))
7440    }
7441
7442    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
7443    /// volume has different settings or the storage is accounted seperately from the rest of the
7444    /// filesystem that may be reported instead of filesystem-wide details.
7445    pub fn r#query_filesystem(
7446        &self,
7447        ___deadline: zx::MonotonicInstant,
7448    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7449        let _response = self
7450            .client
7451            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, FileMarker>(
7452                (),
7453                0x6f344a1c6b0a0610,
7454                fidl::encoding::DynamicFlags::empty(),
7455                ___deadline,
7456            )?;
7457        Ok((_response.s, _response.info))
7458    }
7459
7460    /// Acquires a token which can be used to identify this connection at a later point in
7461    /// time. The token will remain valid for as long as the connection requesting the token
7462    /// remains open.
7463    ///
7464    /// This method does not require any rights. Note that the token identifies
7465    /// the connection, hence carries the rights information on this connection.
7466    pub fn r#get_token(
7467        &self,
7468        ___deadline: zx::MonotonicInstant,
7469    ) -> Result<NodeGetTokenResult, fidl::Error> {
7470        let _response = self.client.send_query::<
7471            fidl::encoding::EmptyPayload,
7472            fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
7473            FileMarker,
7474        >(
7475            (),
7476            0x5054f0ade7076cec,
7477            fidl::encoding::DynamicFlags::FLEXIBLE,
7478            ___deadline,
7479        )?
7480        .into_result::<FileMarker>("get_token")?;
7481        Ok(_response.map(|x| x.token))
7482    }
7483
7484    /// Acquires information about the node.
7485    ///
7486    /// The attributes of a node should be stable, independent of the
7487    /// specific protocol used to access it.
7488    ///
7489    /// If a particular attribute is not applicable or not supported,
7490    /// filesystems should leave the corresponding field absent.
7491    ///
7492    /// + `query` a bit-mask specifying which attributes to fetch. The server
7493    ///   should not return more than necessary.
7494    /// - `attributes` the returned attributes.
7495    ///
7496    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7497    pub fn r#get_attributes(
7498        &self,
7499        mut query: NodeAttributesQuery,
7500        ___deadline: zx::MonotonicInstant,
7501    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7502        let _response = self.client.send_query::<
7503            NodeGetAttributesRequest,
7504            fidl::encoding::ResultType<NodeAttributes2, i32>,
7505            FileMarker,
7506        >(
7507            (query,),
7508            0x3d4396a638ea053b,
7509            fidl::encoding::DynamicFlags::empty(),
7510            ___deadline,
7511        )?;
7512        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7513    }
7514
7515    /// Updates information about the node.
7516    ///
7517    /// + `attributes` the presence of a table field in `attributes` indicates
7518    /// the intent to update the corresponding attribute.
7519    ///
7520    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7521    ///
7522    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7523    pub fn r#update_attributes(
7524        &self,
7525        mut payload: &MutableNodeAttributes,
7526        ___deadline: zx::MonotonicInstant,
7527    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7528        let _response = self.client.send_query::<
7529            MutableNodeAttributes,
7530            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7531            FileMarker,
7532        >(
7533            payload,
7534            0x3308c1da5a89bf08,
7535            fidl::encoding::DynamicFlags::empty(),
7536            ___deadline,
7537        )?;
7538        Ok(_response.map(|x| x))
7539    }
7540
7541    /// Synchronizes updates to the node to the underlying media, if it exists.
7542    ///
7543    /// This method will return when the filesystem server has flushed the
7544    /// relevant updates to the underlying media, but does not guarantee the
7545    /// underlying media has persisted the information, nor that any information
7546    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7547    /// between operations.
7548    ///
7549    /// This method does not require any rights.
7550    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7551        let _response = self.client.send_query::<
7552            fidl::encoding::EmptyPayload,
7553            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7554            FileMarker,
7555        >(
7556            (),
7557            0x2c5c27ca0ab5dc49,
7558            fidl::encoding::DynamicFlags::empty(),
7559            ___deadline,
7560        )?;
7561        Ok(_response.map(|x| x))
7562    }
7563
7564    /// Creates an iterator over all the extended attribute names associated
7565    /// with this node. If an error occurs it is returned as an epitaph on the
7566    /// iterator request channel, and then the channel is closed.
7567    ///
7568    /// GetExtendedAttributes can be used with any of these names to retrieve
7569    /// the associated value.
7570    ///
7571    /// This method requires the [`Rights.READ_BYTES`] right.
7572    pub fn r#list_extended_attributes(
7573        &self,
7574        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7575    ) -> Result<(), fidl::Error> {
7576        self.client.send::<NodeListExtendedAttributesRequest>(
7577            (iterator,),
7578            0x4b61033de007fcd0,
7579            fidl::encoding::DynamicFlags::empty(),
7580        )
7581    }
7582
7583    /// Get the value associated with the given attribute `name` for this node.
7584    ///
7585    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7586    /// particular structure is imposed on them.
7587    ///
7588    /// This method requires the [`Rights.READ_BYTES`] right.
7589    pub fn r#get_extended_attribute(
7590        &self,
7591        mut name: &[u8],
7592        ___deadline: zx::MonotonicInstant,
7593    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7594        let _response = self.client.send_query::<
7595            NodeGetExtendedAttributeRequest,
7596            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7597            FileMarker,
7598        >(
7599            (name,),
7600            0x45ffa3ccfdeb76db,
7601            fidl::encoding::DynamicFlags::empty(),
7602            ___deadline,
7603        )?;
7604        Ok(_response.map(|x| x))
7605    }
7606
7607    /// Set the value for the given attribute `name` to `value` for this node.
7608    ///
7609    /// The attribute name may exist, in which case the attribute is updated.
7610    /// If the attribute doesn't exist, it is created. The name should have no
7611    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7612    ///
7613    /// This method requires the [`Rights.WRITE_BYTES`] right.
7614    pub fn r#set_extended_attribute(
7615        &self,
7616        mut name: &[u8],
7617        mut value: ExtendedAttributeValue,
7618        mut mode: SetExtendedAttributeMode,
7619        ___deadline: zx::MonotonicInstant,
7620    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7621        let _response = self.client.send_query::<
7622            NodeSetExtendedAttributeRequest,
7623            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7624            FileMarker,
7625        >(
7626            (name, &mut value, mode,),
7627            0x4a951362f681f23c,
7628            fidl::encoding::DynamicFlags::empty(),
7629            ___deadline,
7630        )?;
7631        Ok(_response.map(|x| x))
7632    }
7633
7634    /// Remove the specified extended attribute.
7635    ///
7636    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7637    ///
7638    /// This method requires the [`Rights.WRITE_BYTES`] right.
7639    pub fn r#remove_extended_attribute(
7640        &self,
7641        mut name: &[u8],
7642        ___deadline: zx::MonotonicInstant,
7643    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7644        let _response = self.client.send_query::<
7645            NodeRemoveExtendedAttributeRequest,
7646            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7647            FileMarker,
7648        >(
7649            (name,),
7650            0x7a0b9f3a9bf9032d,
7651            fidl::encoding::DynamicFlags::empty(),
7652            ___deadline,
7653        )?;
7654        Ok(_response.map(|x| x))
7655    }
7656
7657    /// Reads up to 'count' bytes at the seek offset.
7658    /// The seek offset is moved forward by the number of bytes read.
7659    ///
7660    /// ## Invariants
7661    ///
7662    /// * The returned `data.length` will never be greater than `count`.
7663    /// * If `data.length` is less than `count`, it means that the seek offset
7664    ///   has reached the end of file as part of this operation.
7665    /// * If `data.length` is zero while `count` is not, it means that the
7666    ///   seek offset is already at or beyond the end of file, and no data could
7667    ///   be read.
7668    /// * If `count` is zero, the server should perform all the checks ensuring
7669    ///   read access without actually read anything, and return an empty
7670    ///   `data` vector.
7671    ///
7672    /// This method requires the [`Rights.READ_BYTES`] right.
7673    ///
7674    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7675    pub fn r#read(
7676        &self,
7677        mut count: u64,
7678        ___deadline: zx::MonotonicInstant,
7679    ) -> Result<ReadableReadResult, fidl::Error> {
7680        let _response = self.client.send_query::<
7681            ReadableReadRequest,
7682            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7683            FileMarker,
7684        >(
7685            (count,),
7686            0x57e419a298c8ede,
7687            fidl::encoding::DynamicFlags::empty(),
7688            ___deadline,
7689        )?;
7690        Ok(_response.map(|x| x.data))
7691    }
7692
7693    /// Writes data at the seek offset.
7694    /// The seek offset is moved forward by the number of bytes written.
7695    /// If the file is in append mode, the seek offset is first set to the end
7696    /// of the file, followed by the write, in one atomic step.
7697    ///
7698    /// The file size may grow if the seek offset plus `data.length` is beyond
7699    /// the current end of file.
7700    ///
7701    /// + request `data` the byte buffer to write to the file.
7702    /// - response `actual_count` the number of bytes written.
7703    ///
7704    /// ## Invariants
7705    ///
7706    /// * The returned `actual_count` will never be greater than `data.length`.
7707    /// * If the server is unable to write all the data due to e.g. not enough
7708    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7709    ///   could be written, an error is returned.
7710    /// * If `data.length` is zero, the server should perform all the checks
7711    ///   ensuring write access without mutating the file and return a
7712    ///   successful write of zero bytes.  The seek offset is still updated if
7713    ///   in append mode.
7714    ///
7715    /// This method requires the [`Rights.WRITE_BYTES`] right.
7716    pub fn r#write(
7717        &self,
7718        mut data: &[u8],
7719        ___deadline: zx::MonotonicInstant,
7720    ) -> Result<WritableWriteResult, fidl::Error> {
7721        let _response = self.client.send_query::<
7722            WritableWriteRequest,
7723            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7724            FileMarker,
7725        >(
7726            (data,),
7727            0x6a31437832469f82,
7728            fidl::encoding::DynamicFlags::empty(),
7729            ___deadline,
7730        )?;
7731        Ok(_response.map(|x| x.actual_count))
7732    }
7733
7734    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7735        let _response =
7736            self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo, FileMarker>(
7737                (),
7738                0x68b5ac00c62906bc,
7739                fidl::encoding::DynamicFlags::empty(),
7740                ___deadline,
7741            )?;
7742        Ok(_response)
7743    }
7744
7745    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7746    /// will occur. The seek offset is specific to each file connection.
7747    ///
7748    /// + request `origin` the reference point where `offset` will be based on.
7749    /// + request `offset` the number of bytes to seek.
7750    /// - response `offset_from_start` the adjusted seek offset, from the start
7751    ///   of the file.
7752    ///
7753    /// This method does not require any rights.
7754    pub fn r#seek(
7755        &self,
7756        mut origin: SeekOrigin,
7757        mut offset: i64,
7758        ___deadline: zx::MonotonicInstant,
7759    ) -> Result<FileSeekResult, fidl::Error> {
7760        let _response = self.client.send_query::<
7761            FileSeekRequest,
7762            fidl::encoding::ResultType<FileSeekResponse, i32>,
7763            FileMarker,
7764        >(
7765            (origin, offset,),
7766            0x78079168162c5207,
7767            fidl::encoding::DynamicFlags::empty(),
7768            ___deadline,
7769        )?;
7770        Ok(_response.map(|x| x.offset_from_start))
7771    }
7772
7773    /// Reads up to 'count' bytes at the provided offset.
7774    /// Does not affect the seek offset.
7775    ///
7776    /// ## Invariants
7777    ///
7778    /// * The returned `data.length` will never be greater than `count`.
7779    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7780    ///   the end of file as part of this operation.
7781    /// * If `data.length` is zero while `count` is not, it means that `offset`
7782    ///   is at or past the end of file, and no data can be read.
7783    /// * If `count` is zero, the server should perform all the checks ensuring
7784    ///   read access without actually reading anything, and return an empty
7785    ///   `data` vector.
7786    ///
7787    /// This method requires the [`Rights.READ_BYTES`] right.
7788    ///
7789    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7790    pub fn r#read_at(
7791        &self,
7792        mut count: u64,
7793        mut offset: u64,
7794        ___deadline: zx::MonotonicInstant,
7795    ) -> Result<FileReadAtResult, fidl::Error> {
7796        let _response = self.client.send_query::<
7797            FileReadAtRequest,
7798            fidl::encoding::ResultType<FileReadAtResponse, i32>,
7799            FileMarker,
7800        >(
7801            (count, offset,),
7802            0x1607a293a60d723e,
7803            fidl::encoding::DynamicFlags::empty(),
7804            ___deadline,
7805        )?;
7806        Ok(_response.map(|x| x.data))
7807    }
7808
7809    /// Writes data at the provided offset.
7810    /// Does not affect the seek offset.
7811    ///
7812    /// The file size may grow if `offset` plus `data.length` is past the
7813    /// current end of file.
7814    ///
7815    /// + request `data` the byte buffer to write to the file.
7816    /// + request `offset` the offset from start of the file to begin writing.
7817    /// - response `actual_count` the number of bytes written.
7818    ///
7819    /// ## Invariants
7820    ///
7821    /// * The returned `actual_count` will never be greater than `data.length`.
7822    /// * If the server is unable to write all the data due to e.g. not enough
7823    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7824    ///   could be written, an error is returned.
7825    /// * If `data.length` is zero, the server should perform all the checks
7826    ///   ensuring write access without mutating the file, and will return a
7827    ///   successful write of zero bytes.
7828    ///
7829    /// This method requires the [`Rights.WRITE_BYTES`] right.
7830    pub fn r#write_at(
7831        &self,
7832        mut data: &[u8],
7833        mut offset: u64,
7834        ___deadline: zx::MonotonicInstant,
7835    ) -> Result<FileWriteAtResult, fidl::Error> {
7836        let _response = self.client.send_query::<
7837            FileWriteAtRequest,
7838            fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7839            FileMarker,
7840        >(
7841            (data, offset,),
7842            0x793eefc0045e792b,
7843            fidl::encoding::DynamicFlags::empty(),
7844            ___deadline,
7845        )?;
7846        Ok(_response.map(|x| x.actual_count))
7847    }
7848
7849    /// Shrinks or grows the file size to 'length' bytes.
7850    ///
7851    /// If file size is reduced by this operation, the extra trailing data'
7852    /// is discarded.
7853    /// If file size is increased by this operation, the extended area appears
7854    /// as if it was zeroed.
7855    ///
7856    /// This method requires the [`Rights.WRITE_BYTES`] right.
7857    pub fn r#resize(
7858        &self,
7859        mut length: u64,
7860        ___deadline: zx::MonotonicInstant,
7861    ) -> Result<FileResizeResult, fidl::Error> {
7862        let _response = self.client.send_query::<
7863            FileResizeRequest,
7864            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7865            FileMarker,
7866        >(
7867            (length,),
7868            0x2b80825f0535743a,
7869            fidl::encoding::DynamicFlags::empty(),
7870            ___deadline,
7871        )?;
7872        Ok(_response.map(|x| x))
7873    }
7874
7875    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7876    /// with the requested access rights.
7877    ///
7878    /// Implementations are not required to implement files backed by VMOs so
7879    /// this request may fail. Additionally, implementations may only support
7880    /// a certain subset of the flags. Clients should be prepared with fallback
7881    /// behavior if this request fails.
7882    ///
7883    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7884    /// implementation is free to choose the semantics of the returned VMO.
7885    ///
7886    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7887    /// - response `vmo` the requested [`zx.Handle:VMO`].
7888    /// * error a [`zx.Status`] value indicating the failure.
7889    ///
7890    /// This method requires the following rights:
7891    ///
7892    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7893    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7894    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7895    pub fn r#get_backing_memory(
7896        &self,
7897        mut flags: VmoFlags,
7898        ___deadline: zx::MonotonicInstant,
7899    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7900        let _response = self.client.send_query::<
7901            FileGetBackingMemoryRequest,
7902            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7903            FileMarker,
7904        >(
7905            (flags,),
7906            0xa6a9e654cbf62b,
7907            fidl::encoding::DynamicFlags::empty(),
7908            ___deadline,
7909        )?;
7910        Ok(_response.map(|x| x.vmo))
7911    }
7912
7913    /// Pre-allocate on-disk space for this file.
7914    pub fn r#allocate(
7915        &self,
7916        mut offset: u64,
7917        mut length: u64,
7918        mut mode: AllocateMode,
7919        ___deadline: zx::MonotonicInstant,
7920    ) -> Result<FileAllocateResult, fidl::Error> {
7921        let _response = self.client.send_query::<
7922            FileAllocateRequest,
7923            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7924            FileMarker,
7925        >(
7926            (offset, length, mode,),
7927            0x77fa0c330b57fd2e,
7928            fidl::encoding::DynamicFlags::FLEXIBLE,
7929            ___deadline,
7930        )?
7931        .into_result::<FileMarker>("allocate")?;
7932        Ok(_response.map(|x| x))
7933    }
7934
7935    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7936    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7937    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7938    /// rejected. This method can take some time to complete as it depends on the size of the file.
7939    /// This method can be aborted by closing the connection that this method was issued on.
7940    ///
7941    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7942    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7943    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7944    /// Also returns any error that might arise from reading the file, or from flushing the file,
7945    /// such as `ZX_ERR_IO`.
7946    pub fn r#enable_verity(
7947        &self,
7948        mut options: &VerificationOptions,
7949        ___deadline: zx::MonotonicInstant,
7950    ) -> Result<FileEnableVerityResult, fidl::Error> {
7951        let _response = self.client.send_query::<
7952            FileEnableVerityRequest,
7953            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7954            FileMarker,
7955        >(
7956            (options,),
7957            0x2c421ec3faaeb8bb,
7958            fidl::encoding::DynamicFlags::FLEXIBLE,
7959            ___deadline,
7960        )?
7961        .into_result::<FileMarker>("enable_verity")?;
7962        Ok(_response.map(|x| x))
7963    }
7964}
7965
7966#[cfg(target_os = "fuchsia")]
7967impl From<FileSynchronousProxy> for zx::NullableHandle {
7968    fn from(value: FileSynchronousProxy) -> Self {
7969        value.into_channel().into()
7970    }
7971}
7972
7973#[cfg(target_os = "fuchsia")]
7974impl From<fidl::Channel> for FileSynchronousProxy {
7975    fn from(value: fidl::Channel) -> Self {
7976        Self::new(value)
7977    }
7978}
7979
7980#[cfg(target_os = "fuchsia")]
7981impl fidl::endpoints::FromClient for FileSynchronousProxy {
7982    type Protocol = FileMarker;
7983
7984    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7985        Self::new(value.into_channel())
7986    }
7987}
7988
7989#[derive(Debug, Clone)]
7990pub struct FileProxy {
7991    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7992}
7993
7994impl fidl::endpoints::Proxy for FileProxy {
7995    type Protocol = FileMarker;
7996
7997    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7998        Self::new(inner)
7999    }
8000
8001    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8002        self.client.into_channel().map_err(|client| Self { client })
8003    }
8004
8005    fn as_channel(&self) -> &::fidl::AsyncChannel {
8006        self.client.as_channel()
8007    }
8008}
8009
8010impl FileProxy {
8011    /// Create a new Proxy for fuchsia.io/File.
8012    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8013        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8014        Self { client: fidl::client::Client::new(channel, protocol_name) }
8015    }
8016
8017    /// Get a Stream of events from the remote end of the protocol.
8018    ///
8019    /// # Panics
8020    ///
8021    /// Panics if the event stream was already taken.
8022    pub fn take_event_stream(&self) -> FileEventStream {
8023        FileEventStream { event_receiver: self.client.take_event_receiver() }
8024    }
8025
8026    /// Acquires an advisory lock on the underlying file.
8027    ///
8028    /// The lock lasts until either this connection is closed or
8029    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
8030    /// explicitly.
8031    ///
8032    /// Advisory locks are purely advisory. They do not prevent actual read or
8033    /// write operations from occurring on the file, either through this
8034    /// connection or through other connections.
8035    ///
8036    /// This method requires the following rights:
8037    ///
8038    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
8039    /// * [`Rights.WRITE_BYTES`] if `request.type` is
8040    ///   [`AdvisoryLockType.WRITE`].
8041    ///
8042    /// # Errors
8043    ///
8044    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
8045    ///   example, another connection might hold a conflicting lock type.
8046    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
8047    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
8048    ///   to acquire the given type of lock.
8049    pub fn r#advisory_lock(
8050        &self,
8051        mut request: &AdvisoryLockRequest,
8052    ) -> fidl::client::QueryResponseFut<
8053        AdvisoryLockingAdvisoryLockResult,
8054        fidl::encoding::DefaultFuchsiaResourceDialect,
8055    > {
8056        FileProxyInterface::r#advisory_lock(self, request)
8057    }
8058
8059    /// Creates a link to this this object with name `dst` in the directory represented by
8060    /// `dst_parent_token`.
8061    ///
8062    /// `dst` must be a resolved object name. Including "/" in the string will return
8063    /// `ZX_ERR_INVALID_ARGS`.
8064    ///
8065    /// This method requires the maximal set of rights supported by the filesystem for this object.
8066    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
8067    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
8068    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
8069    /// `ZX_ERR_ACCESS_DENIED`.
8070    ///
8071    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
8072    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
8073    ///
8074    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
8075    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
8076    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
8077    ///
8078    /// This method does not have the same atomicity properties has the `Directory::Link` method,
8079    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
8080    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
8081    pub fn r#link_into(
8082        &self,
8083        mut dst_parent_token: fidl::Event,
8084        mut dst: &str,
8085    ) -> fidl::client::QueryResponseFut<
8086        LinkableLinkIntoResult,
8087        fidl::encoding::DefaultFuchsiaResourceDialect,
8088    > {
8089        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
8090    }
8091
8092    pub fn r#clone(
8093        &self,
8094        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8095    ) -> Result<(), fidl::Error> {
8096        FileProxyInterface::r#clone(self, request)
8097    }
8098
8099    /// Terminates the connection.
8100    ///
8101    /// After calling `Close`, the client must not send any other requests.
8102    ///
8103    /// Servers, after sending the status response, should close the connection
8104    /// regardless of status and without sending an epitaph.
8105    ///
8106    /// Closing the client end of the channel should be semantically equivalent
8107    /// to calling `Close` without knowing when the close has completed or its
8108    /// status.
8109    pub fn r#close(
8110        &self,
8111    ) -> fidl::client::QueryResponseFut<
8112        fidl_fuchsia_unknown::CloseableCloseResult,
8113        fidl::encoding::DefaultFuchsiaResourceDialect,
8114    > {
8115        FileProxyInterface::r#close(self)
8116    }
8117
8118    pub fn r#query(
8119        &self,
8120    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
8121    {
8122        FileProxyInterface::r#query(self)
8123    }
8124
8125    /// DEPRECATED - Use `Node.GetAttributes` instead.
8126    ///
8127    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8128    pub fn r#deprecated_get_attr(
8129        &self,
8130    ) -> fidl::client::QueryResponseFut<
8131        (i32, NodeAttributes),
8132        fidl::encoding::DefaultFuchsiaResourceDialect,
8133    > {
8134        FileProxyInterface::r#deprecated_get_attr(self)
8135    }
8136
8137    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
8138    pub fn r#deprecated_set_attr(
8139        &self,
8140        mut flags: NodeAttributeFlags,
8141        mut attributes: &NodeAttributes,
8142    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8143        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
8144    }
8145
8146    /// [DEPRECATED - Use new GetFlags method instead.]
8147    pub fn r#deprecated_get_flags(
8148        &self,
8149    ) -> fidl::client::QueryResponseFut<
8150        (i32, OpenFlags),
8151        fidl::encoding::DefaultFuchsiaResourceDialect,
8152    > {
8153        FileProxyInterface::r#deprecated_get_flags(self)
8154    }
8155
8156    /// [DEPRECATED - Use new SetFlags method instead.]
8157    pub fn r#deprecated_set_flags(
8158        &self,
8159        mut flags: OpenFlags,
8160    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8161        FileProxyInterface::r#deprecated_set_flags(self, flags)
8162    }
8163
8164    /// Queries the flags that apply to this node after it has been opened/created. This method does
8165    /// not require any rights.
8166    ///
8167    /// Note that the final set of flags that apply to the connection may differ from those
8168    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8169    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8170    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8171    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8172    pub fn r#get_flags(
8173        &self,
8174    ) -> fidl::client::QueryResponseFut<
8175        NodeGetFlagsResult,
8176        fidl::encoding::DefaultFuchsiaResourceDialect,
8177    > {
8178        FileProxyInterface::r#get_flags(self)
8179    }
8180
8181    /// Sets the flags that apply to this node after it has been opened. This method does not
8182    /// require any rights.
8183    ///
8184    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8185    /// clear append mode.
8186    ///
8187    /// Errors:
8188    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8189    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8190    pub fn r#set_flags(
8191        &self,
8192        mut flags: Flags,
8193    ) -> fidl::client::QueryResponseFut<
8194        NodeSetFlagsResult,
8195        fidl::encoding::DefaultFuchsiaResourceDialect,
8196    > {
8197        FileProxyInterface::r#set_flags(self, flags)
8198    }
8199
8200    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8201    /// volume has different settings or the storage is accounted seperately from the rest of the
8202    /// filesystem that may be reported instead of filesystem-wide details.
8203    pub fn r#query_filesystem(
8204        &self,
8205    ) -> fidl::client::QueryResponseFut<
8206        (i32, Option<Box<FilesystemInfo>>),
8207        fidl::encoding::DefaultFuchsiaResourceDialect,
8208    > {
8209        FileProxyInterface::r#query_filesystem(self)
8210    }
8211
8212    /// Acquires a token which can be used to identify this connection at a later point in
8213    /// time. The token will remain valid for as long as the connection requesting the token
8214    /// remains open.
8215    ///
8216    /// This method does not require any rights. Note that the token identifies
8217    /// the connection, hence carries the rights information on this connection.
8218    pub fn r#get_token(
8219        &self,
8220    ) -> fidl::client::QueryResponseFut<
8221        NodeGetTokenResult,
8222        fidl::encoding::DefaultFuchsiaResourceDialect,
8223    > {
8224        FileProxyInterface::r#get_token(self)
8225    }
8226
8227    /// Acquires information about the node.
8228    ///
8229    /// The attributes of a node should be stable, independent of the
8230    /// specific protocol used to access it.
8231    ///
8232    /// If a particular attribute is not applicable or not supported,
8233    /// filesystems should leave the corresponding field absent.
8234    ///
8235    /// + `query` a bit-mask specifying which attributes to fetch. The server
8236    ///   should not return more than necessary.
8237    /// - `attributes` the returned attributes.
8238    ///
8239    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8240    pub fn r#get_attributes(
8241        &self,
8242        mut query: NodeAttributesQuery,
8243    ) -> fidl::client::QueryResponseFut<
8244        NodeGetAttributesResult,
8245        fidl::encoding::DefaultFuchsiaResourceDialect,
8246    > {
8247        FileProxyInterface::r#get_attributes(self, query)
8248    }
8249
8250    /// Updates information about the node.
8251    ///
8252    /// + `attributes` the presence of a table field in `attributes` indicates
8253    /// the intent to update the corresponding attribute.
8254    ///
8255    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8256    ///
8257    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8258    pub fn r#update_attributes(
8259        &self,
8260        mut payload: &MutableNodeAttributes,
8261    ) -> fidl::client::QueryResponseFut<
8262        NodeUpdateAttributesResult,
8263        fidl::encoding::DefaultFuchsiaResourceDialect,
8264    > {
8265        FileProxyInterface::r#update_attributes(self, payload)
8266    }
8267
8268    /// Synchronizes updates to the node to the underlying media, if it exists.
8269    ///
8270    /// This method will return when the filesystem server has flushed the
8271    /// relevant updates to the underlying media, but does not guarantee the
8272    /// underlying media has persisted the information, nor that any information
8273    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8274    /// between operations.
8275    ///
8276    /// This method does not require any rights.
8277    pub fn r#sync(
8278        &self,
8279    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8280    {
8281        FileProxyInterface::r#sync(self)
8282    }
8283
8284    /// Creates an iterator over all the extended attribute names associated
8285    /// with this node. If an error occurs it is returned as an epitaph on the
8286    /// iterator request channel, and then the channel is closed.
8287    ///
8288    /// GetExtendedAttributes can be used with any of these names to retrieve
8289    /// the associated value.
8290    ///
8291    /// This method requires the [`Rights.READ_BYTES`] right.
8292    pub fn r#list_extended_attributes(
8293        &self,
8294        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8295    ) -> Result<(), fidl::Error> {
8296        FileProxyInterface::r#list_extended_attributes(self, iterator)
8297    }
8298
8299    /// Get the value associated with the given attribute `name` for this node.
8300    ///
8301    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8302    /// particular structure is imposed on them.
8303    ///
8304    /// This method requires the [`Rights.READ_BYTES`] right.
8305    pub fn r#get_extended_attribute(
8306        &self,
8307        mut name: &[u8],
8308    ) -> fidl::client::QueryResponseFut<
8309        NodeGetExtendedAttributeResult,
8310        fidl::encoding::DefaultFuchsiaResourceDialect,
8311    > {
8312        FileProxyInterface::r#get_extended_attribute(self, name)
8313    }
8314
8315    /// Set the value for the given attribute `name` to `value` for this node.
8316    ///
8317    /// The attribute name may exist, in which case the attribute is updated.
8318    /// If the attribute doesn't exist, it is created. The name should have no
8319    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8320    ///
8321    /// This method requires the [`Rights.WRITE_BYTES`] right.
8322    pub fn r#set_extended_attribute(
8323        &self,
8324        mut name: &[u8],
8325        mut value: ExtendedAttributeValue,
8326        mut mode: SetExtendedAttributeMode,
8327    ) -> fidl::client::QueryResponseFut<
8328        NodeSetExtendedAttributeResult,
8329        fidl::encoding::DefaultFuchsiaResourceDialect,
8330    > {
8331        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8332    }
8333
8334    /// Remove the specified extended attribute.
8335    ///
8336    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8337    ///
8338    /// This method requires the [`Rights.WRITE_BYTES`] right.
8339    pub fn r#remove_extended_attribute(
8340        &self,
8341        mut name: &[u8],
8342    ) -> fidl::client::QueryResponseFut<
8343        NodeRemoveExtendedAttributeResult,
8344        fidl::encoding::DefaultFuchsiaResourceDialect,
8345    > {
8346        FileProxyInterface::r#remove_extended_attribute(self, name)
8347    }
8348
8349    /// Reads up to 'count' bytes at the seek offset.
8350    /// The seek offset is moved forward by the number of bytes read.
8351    ///
8352    /// ## Invariants
8353    ///
8354    /// * The returned `data.length` will never be greater than `count`.
8355    /// * If `data.length` is less than `count`, it means that the seek offset
8356    ///   has reached the end of file as part of this operation.
8357    /// * If `data.length` is zero while `count` is not, it means that the
8358    ///   seek offset is already at or beyond the end of file, and no data could
8359    ///   be read.
8360    /// * If `count` is zero, the server should perform all the checks ensuring
8361    ///   read access without actually read anything, and return an empty
8362    ///   `data` vector.
8363    ///
8364    /// This method requires the [`Rights.READ_BYTES`] right.
8365    ///
8366    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8367    pub fn r#read(
8368        &self,
8369        mut count: u64,
8370    ) -> fidl::client::QueryResponseFut<
8371        ReadableReadResult,
8372        fidl::encoding::DefaultFuchsiaResourceDialect,
8373    > {
8374        FileProxyInterface::r#read(self, count)
8375    }
8376
8377    /// Writes data at the seek offset.
8378    /// The seek offset is moved forward by the number of bytes written.
8379    /// If the file is in append mode, the seek offset is first set to the end
8380    /// of the file, followed by the write, in one atomic step.
8381    ///
8382    /// The file size may grow if the seek offset plus `data.length` is beyond
8383    /// the current end of file.
8384    ///
8385    /// + request `data` the byte buffer to write to the file.
8386    /// - response `actual_count` the number of bytes written.
8387    ///
8388    /// ## Invariants
8389    ///
8390    /// * The returned `actual_count` will never be greater than `data.length`.
8391    /// * If the server is unable to write all the data due to e.g. not enough
8392    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8393    ///   could be written, an error is returned.
8394    /// * If `data.length` is zero, the server should perform all the checks
8395    ///   ensuring write access without mutating the file and return a
8396    ///   successful write of zero bytes.  The seek offset is still updated if
8397    ///   in append mode.
8398    ///
8399    /// This method requires the [`Rights.WRITE_BYTES`] right.
8400    pub fn r#write(
8401        &self,
8402        mut data: &[u8],
8403    ) -> fidl::client::QueryResponseFut<
8404        WritableWriteResult,
8405        fidl::encoding::DefaultFuchsiaResourceDialect,
8406    > {
8407        FileProxyInterface::r#write(self, data)
8408    }
8409
8410    pub fn r#describe(
8411        &self,
8412    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8413    {
8414        FileProxyInterface::r#describe(self)
8415    }
8416
8417    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8418    /// will occur. The seek offset is specific to each file connection.
8419    ///
8420    /// + request `origin` the reference point where `offset` will be based on.
8421    /// + request `offset` the number of bytes to seek.
8422    /// - response `offset_from_start` the adjusted seek offset, from the start
8423    ///   of the file.
8424    ///
8425    /// This method does not require any rights.
8426    pub fn r#seek(
8427        &self,
8428        mut origin: SeekOrigin,
8429        mut offset: i64,
8430    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8431    {
8432        FileProxyInterface::r#seek(self, origin, offset)
8433    }
8434
8435    /// Reads up to 'count' bytes at the provided offset.
8436    /// Does not affect the seek offset.
8437    ///
8438    /// ## Invariants
8439    ///
8440    /// * The returned `data.length` will never be greater than `count`.
8441    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8442    ///   the end of file as part of this operation.
8443    /// * If `data.length` is zero while `count` is not, it means that `offset`
8444    ///   is at or past the end of file, and no data can be read.
8445    /// * If `count` is zero, the server should perform all the checks ensuring
8446    ///   read access without actually reading anything, and return an empty
8447    ///   `data` vector.
8448    ///
8449    /// This method requires the [`Rights.READ_BYTES`] right.
8450    ///
8451    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8452    pub fn r#read_at(
8453        &self,
8454        mut count: u64,
8455        mut offset: u64,
8456    ) -> fidl::client::QueryResponseFut<
8457        FileReadAtResult,
8458        fidl::encoding::DefaultFuchsiaResourceDialect,
8459    > {
8460        FileProxyInterface::r#read_at(self, count, offset)
8461    }
8462
8463    /// Writes data at the provided offset.
8464    /// Does not affect the seek offset.
8465    ///
8466    /// The file size may grow if `offset` plus `data.length` is past the
8467    /// current end of file.
8468    ///
8469    /// + request `data` the byte buffer to write to the file.
8470    /// + request `offset` the offset from start of the file to begin writing.
8471    /// - response `actual_count` the number of bytes written.
8472    ///
8473    /// ## Invariants
8474    ///
8475    /// * The returned `actual_count` will never be greater than `data.length`.
8476    /// * If the server is unable to write all the data due to e.g. not enough
8477    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8478    ///   could be written, an error is returned.
8479    /// * If `data.length` is zero, the server should perform all the checks
8480    ///   ensuring write access without mutating the file, and will return a
8481    ///   successful write of zero bytes.
8482    ///
8483    /// This method requires the [`Rights.WRITE_BYTES`] right.
8484    pub fn r#write_at(
8485        &self,
8486        mut data: &[u8],
8487        mut offset: u64,
8488    ) -> fidl::client::QueryResponseFut<
8489        FileWriteAtResult,
8490        fidl::encoding::DefaultFuchsiaResourceDialect,
8491    > {
8492        FileProxyInterface::r#write_at(self, data, offset)
8493    }
8494
8495    /// Shrinks or grows the file size to 'length' bytes.
8496    ///
8497    /// If file size is reduced by this operation, the extra trailing data'
8498    /// is discarded.
8499    /// If file size is increased by this operation, the extended area appears
8500    /// as if it was zeroed.
8501    ///
8502    /// This method requires the [`Rights.WRITE_BYTES`] right.
8503    pub fn r#resize(
8504        &self,
8505        mut length: u64,
8506    ) -> fidl::client::QueryResponseFut<
8507        FileResizeResult,
8508        fidl::encoding::DefaultFuchsiaResourceDialect,
8509    > {
8510        FileProxyInterface::r#resize(self, length)
8511    }
8512
8513    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8514    /// with the requested access rights.
8515    ///
8516    /// Implementations are not required to implement files backed by VMOs so
8517    /// this request may fail. Additionally, implementations may only support
8518    /// a certain subset of the flags. Clients should be prepared with fallback
8519    /// behavior if this request fails.
8520    ///
8521    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8522    /// implementation is free to choose the semantics of the returned VMO.
8523    ///
8524    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8525    /// - response `vmo` the requested [`zx.Handle:VMO`].
8526    /// * error a [`zx.Status`] value indicating the failure.
8527    ///
8528    /// This method requires the following rights:
8529    ///
8530    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8531    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8532    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8533    pub fn r#get_backing_memory(
8534        &self,
8535        mut flags: VmoFlags,
8536    ) -> fidl::client::QueryResponseFut<
8537        FileGetBackingMemoryResult,
8538        fidl::encoding::DefaultFuchsiaResourceDialect,
8539    > {
8540        FileProxyInterface::r#get_backing_memory(self, flags)
8541    }
8542
8543    /// Pre-allocate on-disk space for this file.
8544    pub fn r#allocate(
8545        &self,
8546        mut offset: u64,
8547        mut length: u64,
8548        mut mode: AllocateMode,
8549    ) -> fidl::client::QueryResponseFut<
8550        FileAllocateResult,
8551        fidl::encoding::DefaultFuchsiaResourceDialect,
8552    > {
8553        FileProxyInterface::r#allocate(self, offset, length, mode)
8554    }
8555
8556    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8557    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8558    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8559    /// rejected. This method can take some time to complete as it depends on the size of the file.
8560    /// This method can be aborted by closing the connection that this method was issued on.
8561    ///
8562    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8563    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8564    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8565    /// Also returns any error that might arise from reading the file, or from flushing the file,
8566    /// such as `ZX_ERR_IO`.
8567    pub fn r#enable_verity(
8568        &self,
8569        mut options: &VerificationOptions,
8570    ) -> fidl::client::QueryResponseFut<
8571        FileEnableVerityResult,
8572        fidl::encoding::DefaultFuchsiaResourceDialect,
8573    > {
8574        FileProxyInterface::r#enable_verity(self, options)
8575    }
8576}
8577
8578impl FileProxyInterface for FileProxy {
8579    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8580        AdvisoryLockingAdvisoryLockResult,
8581        fidl::encoding::DefaultFuchsiaResourceDialect,
8582    >;
8583    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8584        fn _decode(
8585            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8586        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8587            let _response = fidl::client::decode_transaction_body::<
8588                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8589                fidl::encoding::DefaultFuchsiaResourceDialect,
8590                0x6ee9c0ad53ec87aa,
8591            >(_buf?)?;
8592            Ok(_response.map(|x| x))
8593        }
8594        self.client.send_query_and_decode::<
8595            AdvisoryLockingAdvisoryLockRequest,
8596            AdvisoryLockingAdvisoryLockResult,
8597        >(
8598            (request,),
8599            0x6ee9c0ad53ec87aa,
8600            fidl::encoding::DynamicFlags::empty(),
8601            _decode,
8602        )
8603    }
8604
8605    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8606        LinkableLinkIntoResult,
8607        fidl::encoding::DefaultFuchsiaResourceDialect,
8608    >;
8609    fn r#link_into(
8610        &self,
8611        mut dst_parent_token: fidl::Event,
8612        mut dst: &str,
8613    ) -> Self::LinkIntoResponseFut {
8614        fn _decode(
8615            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8616        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8617            let _response = fidl::client::decode_transaction_body::<
8618                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8619                fidl::encoding::DefaultFuchsiaResourceDialect,
8620                0x54f3949246a03e74,
8621            >(_buf?)?;
8622            Ok(_response.map(|x| x))
8623        }
8624        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8625            (dst_parent_token, dst),
8626            0x54f3949246a03e74,
8627            fidl::encoding::DynamicFlags::empty(),
8628            _decode,
8629        )
8630    }
8631
8632    fn r#clone(
8633        &self,
8634        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8635    ) -> Result<(), fidl::Error> {
8636        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8637            (request,),
8638            0x20d8a7aba2168a79,
8639            fidl::encoding::DynamicFlags::empty(),
8640        )
8641    }
8642
8643    type CloseResponseFut = fidl::client::QueryResponseFut<
8644        fidl_fuchsia_unknown::CloseableCloseResult,
8645        fidl::encoding::DefaultFuchsiaResourceDialect,
8646    >;
8647    fn r#close(&self) -> Self::CloseResponseFut {
8648        fn _decode(
8649            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8650        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8651            let _response = fidl::client::decode_transaction_body::<
8652                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8653                fidl::encoding::DefaultFuchsiaResourceDialect,
8654                0x5ac5d459ad7f657e,
8655            >(_buf?)?;
8656            Ok(_response.map(|x| x))
8657        }
8658        self.client.send_query_and_decode::<
8659            fidl::encoding::EmptyPayload,
8660            fidl_fuchsia_unknown::CloseableCloseResult,
8661        >(
8662            (),
8663            0x5ac5d459ad7f657e,
8664            fidl::encoding::DynamicFlags::empty(),
8665            _decode,
8666        )
8667    }
8668
8669    type QueryResponseFut =
8670        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8671    fn r#query(&self) -> Self::QueryResponseFut {
8672        fn _decode(
8673            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8674        ) -> Result<Vec<u8>, fidl::Error> {
8675            let _response = fidl::client::decode_transaction_body::<
8676                fidl_fuchsia_unknown::QueryableQueryResponse,
8677                fidl::encoding::DefaultFuchsiaResourceDialect,
8678                0x2658edee9decfc06,
8679            >(_buf?)?;
8680            Ok(_response.protocol)
8681        }
8682        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8683            (),
8684            0x2658edee9decfc06,
8685            fidl::encoding::DynamicFlags::empty(),
8686            _decode,
8687        )
8688    }
8689
8690    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8691        (i32, NodeAttributes),
8692        fidl::encoding::DefaultFuchsiaResourceDialect,
8693    >;
8694    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8695        fn _decode(
8696            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8697        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8698            let _response = fidl::client::decode_transaction_body::<
8699                NodeDeprecatedGetAttrResponse,
8700                fidl::encoding::DefaultFuchsiaResourceDialect,
8701                0x78985e216314dafd,
8702            >(_buf?)?;
8703            Ok((_response.s, _response.attributes))
8704        }
8705        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8706            (),
8707            0x78985e216314dafd,
8708            fidl::encoding::DynamicFlags::empty(),
8709            _decode,
8710        )
8711    }
8712
8713    type DeprecatedSetAttrResponseFut =
8714        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8715    fn r#deprecated_set_attr(
8716        &self,
8717        mut flags: NodeAttributeFlags,
8718        mut attributes: &NodeAttributes,
8719    ) -> Self::DeprecatedSetAttrResponseFut {
8720        fn _decode(
8721            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8722        ) -> Result<i32, fidl::Error> {
8723            let _response = fidl::client::decode_transaction_body::<
8724                NodeDeprecatedSetAttrResponse,
8725                fidl::encoding::DefaultFuchsiaResourceDialect,
8726                0x4186c0f40d938f46,
8727            >(_buf?)?;
8728            Ok(_response.s)
8729        }
8730        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8731            (flags, attributes),
8732            0x4186c0f40d938f46,
8733            fidl::encoding::DynamicFlags::empty(),
8734            _decode,
8735        )
8736    }
8737
8738    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8739        (i32, OpenFlags),
8740        fidl::encoding::DefaultFuchsiaResourceDialect,
8741    >;
8742    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8743        fn _decode(
8744            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8745        ) -> Result<(i32, OpenFlags), fidl::Error> {
8746            let _response = fidl::client::decode_transaction_body::<
8747                NodeDeprecatedGetFlagsResponse,
8748                fidl::encoding::DefaultFuchsiaResourceDialect,
8749                0x5b88fffb8eda3aa1,
8750            >(_buf?)?;
8751            Ok((_response.s, _response.flags))
8752        }
8753        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8754            (),
8755            0x5b88fffb8eda3aa1,
8756            fidl::encoding::DynamicFlags::empty(),
8757            _decode,
8758        )
8759    }
8760
8761    type DeprecatedSetFlagsResponseFut =
8762        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8763    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8764        fn _decode(
8765            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8766        ) -> Result<i32, fidl::Error> {
8767            let _response = fidl::client::decode_transaction_body::<
8768                NodeDeprecatedSetFlagsResponse,
8769                fidl::encoding::DefaultFuchsiaResourceDialect,
8770                0x5295b76c71fde733,
8771            >(_buf?)?;
8772            Ok(_response.s)
8773        }
8774        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8775            (flags,),
8776            0x5295b76c71fde733,
8777            fidl::encoding::DynamicFlags::empty(),
8778            _decode,
8779        )
8780    }
8781
8782    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8783        NodeGetFlagsResult,
8784        fidl::encoding::DefaultFuchsiaResourceDialect,
8785    >;
8786    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8787        fn _decode(
8788            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8789        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8790            let _response = fidl::client::decode_transaction_body::<
8791                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8792                fidl::encoding::DefaultFuchsiaResourceDialect,
8793                0x176eb318f64ec23,
8794            >(_buf?)?
8795            .into_result::<FileMarker>("get_flags")?;
8796            Ok(_response.map(|x| x.flags))
8797        }
8798        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8799            (),
8800            0x176eb318f64ec23,
8801            fidl::encoding::DynamicFlags::FLEXIBLE,
8802            _decode,
8803        )
8804    }
8805
8806    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8807        NodeSetFlagsResult,
8808        fidl::encoding::DefaultFuchsiaResourceDialect,
8809    >;
8810    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8811        fn _decode(
8812            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8813        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8814            let _response = fidl::client::decode_transaction_body::<
8815                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8816                fidl::encoding::DefaultFuchsiaResourceDialect,
8817                0x55a8028685791ea8,
8818            >(_buf?)?
8819            .into_result::<FileMarker>("set_flags")?;
8820            Ok(_response.map(|x| x))
8821        }
8822        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8823            (flags,),
8824            0x55a8028685791ea8,
8825            fidl::encoding::DynamicFlags::FLEXIBLE,
8826            _decode,
8827        )
8828    }
8829
8830    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8831        (i32, Option<Box<FilesystemInfo>>),
8832        fidl::encoding::DefaultFuchsiaResourceDialect,
8833    >;
8834    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8835        fn _decode(
8836            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8837        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8838            let _response = fidl::client::decode_transaction_body::<
8839                NodeQueryFilesystemResponse,
8840                fidl::encoding::DefaultFuchsiaResourceDialect,
8841                0x6f344a1c6b0a0610,
8842            >(_buf?)?;
8843            Ok((_response.s, _response.info))
8844        }
8845        self.client.send_query_and_decode::<
8846            fidl::encoding::EmptyPayload,
8847            (i32, Option<Box<FilesystemInfo>>),
8848        >(
8849            (),
8850            0x6f344a1c6b0a0610,
8851            fidl::encoding::DynamicFlags::empty(),
8852            _decode,
8853        )
8854    }
8855
8856    type GetTokenResponseFut = fidl::client::QueryResponseFut<
8857        NodeGetTokenResult,
8858        fidl::encoding::DefaultFuchsiaResourceDialect,
8859    >;
8860    fn r#get_token(&self) -> Self::GetTokenResponseFut {
8861        fn _decode(
8862            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8863        ) -> Result<NodeGetTokenResult, fidl::Error> {
8864            let _response = fidl::client::decode_transaction_body::<
8865                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
8866                fidl::encoding::DefaultFuchsiaResourceDialect,
8867                0x5054f0ade7076cec,
8868            >(_buf?)?
8869            .into_result::<FileMarker>("get_token")?;
8870            Ok(_response.map(|x| x.token))
8871        }
8872        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
8873            (),
8874            0x5054f0ade7076cec,
8875            fidl::encoding::DynamicFlags::FLEXIBLE,
8876            _decode,
8877        )
8878    }
8879
8880    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8881        NodeGetAttributesResult,
8882        fidl::encoding::DefaultFuchsiaResourceDialect,
8883    >;
8884    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8885        fn _decode(
8886            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8887        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8888            let _response = fidl::client::decode_transaction_body::<
8889                fidl::encoding::ResultType<NodeAttributes2, i32>,
8890                fidl::encoding::DefaultFuchsiaResourceDialect,
8891                0x3d4396a638ea053b,
8892            >(_buf?)?;
8893            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8894        }
8895        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8896            (query,),
8897            0x3d4396a638ea053b,
8898            fidl::encoding::DynamicFlags::empty(),
8899            _decode,
8900        )
8901    }
8902
8903    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8904        NodeUpdateAttributesResult,
8905        fidl::encoding::DefaultFuchsiaResourceDialect,
8906    >;
8907    fn r#update_attributes(
8908        &self,
8909        mut payload: &MutableNodeAttributes,
8910    ) -> Self::UpdateAttributesResponseFut {
8911        fn _decode(
8912            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8913        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8914            let _response = fidl::client::decode_transaction_body::<
8915                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8916                fidl::encoding::DefaultFuchsiaResourceDialect,
8917                0x3308c1da5a89bf08,
8918            >(_buf?)?;
8919            Ok(_response.map(|x| x))
8920        }
8921        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8922            payload,
8923            0x3308c1da5a89bf08,
8924            fidl::encoding::DynamicFlags::empty(),
8925            _decode,
8926        )
8927    }
8928
8929    type SyncResponseFut = fidl::client::QueryResponseFut<
8930        NodeSyncResult,
8931        fidl::encoding::DefaultFuchsiaResourceDialect,
8932    >;
8933    fn r#sync(&self) -> Self::SyncResponseFut {
8934        fn _decode(
8935            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8936        ) -> Result<NodeSyncResult, fidl::Error> {
8937            let _response = fidl::client::decode_transaction_body::<
8938                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8939                fidl::encoding::DefaultFuchsiaResourceDialect,
8940                0x2c5c27ca0ab5dc49,
8941            >(_buf?)?;
8942            Ok(_response.map(|x| x))
8943        }
8944        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8945            (),
8946            0x2c5c27ca0ab5dc49,
8947            fidl::encoding::DynamicFlags::empty(),
8948            _decode,
8949        )
8950    }
8951
8952    fn r#list_extended_attributes(
8953        &self,
8954        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8955    ) -> Result<(), fidl::Error> {
8956        self.client.send::<NodeListExtendedAttributesRequest>(
8957            (iterator,),
8958            0x4b61033de007fcd0,
8959            fidl::encoding::DynamicFlags::empty(),
8960        )
8961    }
8962
8963    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8964        NodeGetExtendedAttributeResult,
8965        fidl::encoding::DefaultFuchsiaResourceDialect,
8966    >;
8967    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8968        fn _decode(
8969            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8970        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8971            let _response = fidl::client::decode_transaction_body::<
8972                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8973                fidl::encoding::DefaultFuchsiaResourceDialect,
8974                0x45ffa3ccfdeb76db,
8975            >(_buf?)?;
8976            Ok(_response.map(|x| x))
8977        }
8978        self.client.send_query_and_decode::<
8979            NodeGetExtendedAttributeRequest,
8980            NodeGetExtendedAttributeResult,
8981        >(
8982            (name,),
8983            0x45ffa3ccfdeb76db,
8984            fidl::encoding::DynamicFlags::empty(),
8985            _decode,
8986        )
8987    }
8988
8989    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8990        NodeSetExtendedAttributeResult,
8991        fidl::encoding::DefaultFuchsiaResourceDialect,
8992    >;
8993    fn r#set_extended_attribute(
8994        &self,
8995        mut name: &[u8],
8996        mut value: ExtendedAttributeValue,
8997        mut mode: SetExtendedAttributeMode,
8998    ) -> Self::SetExtendedAttributeResponseFut {
8999        fn _decode(
9000            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9001        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
9002            let _response = fidl::client::decode_transaction_body::<
9003                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9004                fidl::encoding::DefaultFuchsiaResourceDialect,
9005                0x4a951362f681f23c,
9006            >(_buf?)?;
9007            Ok(_response.map(|x| x))
9008        }
9009        self.client.send_query_and_decode::<
9010            NodeSetExtendedAttributeRequest,
9011            NodeSetExtendedAttributeResult,
9012        >(
9013            (name, &mut value, mode,),
9014            0x4a951362f681f23c,
9015            fidl::encoding::DynamicFlags::empty(),
9016            _decode,
9017        )
9018    }
9019
9020    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
9021        NodeRemoveExtendedAttributeResult,
9022        fidl::encoding::DefaultFuchsiaResourceDialect,
9023    >;
9024    fn r#remove_extended_attribute(
9025        &self,
9026        mut name: &[u8],
9027    ) -> Self::RemoveExtendedAttributeResponseFut {
9028        fn _decode(
9029            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9030        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
9031            let _response = fidl::client::decode_transaction_body::<
9032                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9033                fidl::encoding::DefaultFuchsiaResourceDialect,
9034                0x7a0b9f3a9bf9032d,
9035            >(_buf?)?;
9036            Ok(_response.map(|x| x))
9037        }
9038        self.client.send_query_and_decode::<
9039            NodeRemoveExtendedAttributeRequest,
9040            NodeRemoveExtendedAttributeResult,
9041        >(
9042            (name,),
9043            0x7a0b9f3a9bf9032d,
9044            fidl::encoding::DynamicFlags::empty(),
9045            _decode,
9046        )
9047    }
9048
9049    type ReadResponseFut = fidl::client::QueryResponseFut<
9050        ReadableReadResult,
9051        fidl::encoding::DefaultFuchsiaResourceDialect,
9052    >;
9053    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
9054        fn _decode(
9055            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9056        ) -> Result<ReadableReadResult, fidl::Error> {
9057            let _response = fidl::client::decode_transaction_body::<
9058                fidl::encoding::ResultType<ReadableReadResponse, i32>,
9059                fidl::encoding::DefaultFuchsiaResourceDialect,
9060                0x57e419a298c8ede,
9061            >(_buf?)?;
9062            Ok(_response.map(|x| x.data))
9063        }
9064        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
9065            (count,),
9066            0x57e419a298c8ede,
9067            fidl::encoding::DynamicFlags::empty(),
9068            _decode,
9069        )
9070    }
9071
9072    type WriteResponseFut = fidl::client::QueryResponseFut<
9073        WritableWriteResult,
9074        fidl::encoding::DefaultFuchsiaResourceDialect,
9075    >;
9076    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
9077        fn _decode(
9078            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9079        ) -> Result<WritableWriteResult, fidl::Error> {
9080            let _response = fidl::client::decode_transaction_body::<
9081                fidl::encoding::ResultType<WritableWriteResponse, i32>,
9082                fidl::encoding::DefaultFuchsiaResourceDialect,
9083                0x6a31437832469f82,
9084            >(_buf?)?;
9085            Ok(_response.map(|x| x.actual_count))
9086        }
9087        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
9088            (data,),
9089            0x6a31437832469f82,
9090            fidl::encoding::DynamicFlags::empty(),
9091            _decode,
9092        )
9093    }
9094
9095    type DescribeResponseFut =
9096        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
9097    fn r#describe(&self) -> Self::DescribeResponseFut {
9098        fn _decode(
9099            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9100        ) -> Result<FileInfo, fidl::Error> {
9101            let _response = fidl::client::decode_transaction_body::<
9102                FileInfo,
9103                fidl::encoding::DefaultFuchsiaResourceDialect,
9104                0x68b5ac00c62906bc,
9105            >(_buf?)?;
9106            Ok(_response)
9107        }
9108        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
9109            (),
9110            0x68b5ac00c62906bc,
9111            fidl::encoding::DynamicFlags::empty(),
9112            _decode,
9113        )
9114    }
9115
9116    type SeekResponseFut = fidl::client::QueryResponseFut<
9117        FileSeekResult,
9118        fidl::encoding::DefaultFuchsiaResourceDialect,
9119    >;
9120    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
9121        fn _decode(
9122            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9123        ) -> Result<FileSeekResult, fidl::Error> {
9124            let _response = fidl::client::decode_transaction_body::<
9125                fidl::encoding::ResultType<FileSeekResponse, i32>,
9126                fidl::encoding::DefaultFuchsiaResourceDialect,
9127                0x78079168162c5207,
9128            >(_buf?)?;
9129            Ok(_response.map(|x| x.offset_from_start))
9130        }
9131        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
9132            (origin, offset),
9133            0x78079168162c5207,
9134            fidl::encoding::DynamicFlags::empty(),
9135            _decode,
9136        )
9137    }
9138
9139    type ReadAtResponseFut = fidl::client::QueryResponseFut<
9140        FileReadAtResult,
9141        fidl::encoding::DefaultFuchsiaResourceDialect,
9142    >;
9143    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
9144        fn _decode(
9145            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9146        ) -> Result<FileReadAtResult, fidl::Error> {
9147            let _response = fidl::client::decode_transaction_body::<
9148                fidl::encoding::ResultType<FileReadAtResponse, i32>,
9149                fidl::encoding::DefaultFuchsiaResourceDialect,
9150                0x1607a293a60d723e,
9151            >(_buf?)?;
9152            Ok(_response.map(|x| x.data))
9153        }
9154        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
9155            (count, offset),
9156            0x1607a293a60d723e,
9157            fidl::encoding::DynamicFlags::empty(),
9158            _decode,
9159        )
9160    }
9161
9162    type WriteAtResponseFut = fidl::client::QueryResponseFut<
9163        FileWriteAtResult,
9164        fidl::encoding::DefaultFuchsiaResourceDialect,
9165    >;
9166    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
9167        fn _decode(
9168            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9169        ) -> Result<FileWriteAtResult, fidl::Error> {
9170            let _response = fidl::client::decode_transaction_body::<
9171                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
9172                fidl::encoding::DefaultFuchsiaResourceDialect,
9173                0x793eefc0045e792b,
9174            >(_buf?)?;
9175            Ok(_response.map(|x| x.actual_count))
9176        }
9177        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
9178            (data, offset),
9179            0x793eefc0045e792b,
9180            fidl::encoding::DynamicFlags::empty(),
9181            _decode,
9182        )
9183    }
9184
9185    type ResizeResponseFut = fidl::client::QueryResponseFut<
9186        FileResizeResult,
9187        fidl::encoding::DefaultFuchsiaResourceDialect,
9188    >;
9189    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
9190        fn _decode(
9191            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9192        ) -> Result<FileResizeResult, fidl::Error> {
9193            let _response = fidl::client::decode_transaction_body::<
9194                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9195                fidl::encoding::DefaultFuchsiaResourceDialect,
9196                0x2b80825f0535743a,
9197            >(_buf?)?;
9198            Ok(_response.map(|x| x))
9199        }
9200        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
9201            (length,),
9202            0x2b80825f0535743a,
9203            fidl::encoding::DynamicFlags::empty(),
9204            _decode,
9205        )
9206    }
9207
9208    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
9209        FileGetBackingMemoryResult,
9210        fidl::encoding::DefaultFuchsiaResourceDialect,
9211    >;
9212    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
9213        fn _decode(
9214            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9215        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
9216            let _response = fidl::client::decode_transaction_body::<
9217                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
9218                fidl::encoding::DefaultFuchsiaResourceDialect,
9219                0xa6a9e654cbf62b,
9220            >(_buf?)?;
9221            Ok(_response.map(|x| x.vmo))
9222        }
9223        self.client
9224            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
9225                (flags,),
9226                0xa6a9e654cbf62b,
9227                fidl::encoding::DynamicFlags::empty(),
9228                _decode,
9229            )
9230    }
9231
9232    type AllocateResponseFut = fidl::client::QueryResponseFut<
9233        FileAllocateResult,
9234        fidl::encoding::DefaultFuchsiaResourceDialect,
9235    >;
9236    fn r#allocate(
9237        &self,
9238        mut offset: u64,
9239        mut length: u64,
9240        mut mode: AllocateMode,
9241    ) -> Self::AllocateResponseFut {
9242        fn _decode(
9243            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9244        ) -> Result<FileAllocateResult, fidl::Error> {
9245            let _response = fidl::client::decode_transaction_body::<
9246                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9247                fidl::encoding::DefaultFuchsiaResourceDialect,
9248                0x77fa0c330b57fd2e,
9249            >(_buf?)?
9250            .into_result::<FileMarker>("allocate")?;
9251            Ok(_response.map(|x| x))
9252        }
9253        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
9254            (offset, length, mode),
9255            0x77fa0c330b57fd2e,
9256            fidl::encoding::DynamicFlags::FLEXIBLE,
9257            _decode,
9258        )
9259    }
9260
9261    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9262        FileEnableVerityResult,
9263        fidl::encoding::DefaultFuchsiaResourceDialect,
9264    >;
9265    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9266        fn _decode(
9267            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9268        ) -> Result<FileEnableVerityResult, fidl::Error> {
9269            let _response = fidl::client::decode_transaction_body::<
9270                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9271                fidl::encoding::DefaultFuchsiaResourceDialect,
9272                0x2c421ec3faaeb8bb,
9273            >(_buf?)?
9274            .into_result::<FileMarker>("enable_verity")?;
9275            Ok(_response.map(|x| x))
9276        }
9277        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9278            (options,),
9279            0x2c421ec3faaeb8bb,
9280            fidl::encoding::DynamicFlags::FLEXIBLE,
9281            _decode,
9282        )
9283    }
9284}
9285
9286pub struct FileEventStream {
9287    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9288}
9289
9290impl std::marker::Unpin for FileEventStream {}
9291
9292impl futures::stream::FusedStream for FileEventStream {
9293    fn is_terminated(&self) -> bool {
9294        self.event_receiver.is_terminated()
9295    }
9296}
9297
9298impl futures::Stream for FileEventStream {
9299    type Item = Result<FileEvent, fidl::Error>;
9300
9301    fn poll_next(
9302        mut self: std::pin::Pin<&mut Self>,
9303        cx: &mut std::task::Context<'_>,
9304    ) -> std::task::Poll<Option<Self::Item>> {
9305        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9306            &mut self.event_receiver,
9307            cx
9308        )?) {
9309            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9310            None => std::task::Poll::Ready(None),
9311        }
9312    }
9313}
9314
9315#[derive(Debug)]
9316pub enum FileEvent {
9317    OnOpen_ {
9318        s: i32,
9319        info: Option<Box<NodeInfoDeprecated>>,
9320    },
9321    OnRepresentation {
9322        payload: Representation,
9323    },
9324    #[non_exhaustive]
9325    _UnknownEvent {
9326        /// Ordinal of the event that was sent.
9327        ordinal: u64,
9328    },
9329}
9330
9331impl FileEvent {
9332    #[allow(irrefutable_let_patterns)]
9333    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9334        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9335    }
9336    #[allow(irrefutable_let_patterns)]
9337    pub fn into_on_representation(self) -> Option<Representation> {
9338        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9339    }
9340
9341    /// Decodes a message buffer as a [`FileEvent`].
9342    fn decode(
9343        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9344    ) -> Result<FileEvent, fidl::Error> {
9345        let (bytes, _handles) = buf.split_mut();
9346        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9347        debug_assert_eq!(tx_header.tx_id, 0);
9348        match tx_header.ordinal {
9349            0x7fc7bbb1dbfd1972 => {
9350                let mut out = fidl::new_empty!(
9351                    NodeOnOpenRequest,
9352                    fidl::encoding::DefaultFuchsiaResourceDialect
9353                );
9354                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9355                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9356            }
9357            0x5cb40567d80a510c => {
9358                let mut out =
9359                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9360                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9361                Ok((FileEvent::OnRepresentation { payload: out }))
9362            }
9363            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9364                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9365            }
9366            _ => Err(fidl::Error::UnknownOrdinal {
9367                ordinal: tx_header.ordinal,
9368                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9369            }),
9370        }
9371    }
9372}
9373
9374/// A Stream of incoming requests for fuchsia.io/File.
9375pub struct FileRequestStream {
9376    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9377    is_terminated: bool,
9378}
9379
9380impl std::marker::Unpin for FileRequestStream {}
9381
9382impl futures::stream::FusedStream for FileRequestStream {
9383    fn is_terminated(&self) -> bool {
9384        self.is_terminated
9385    }
9386}
9387
9388impl fidl::endpoints::RequestStream for FileRequestStream {
9389    type Protocol = FileMarker;
9390    type ControlHandle = FileControlHandle;
9391
9392    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9393        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9394    }
9395
9396    fn control_handle(&self) -> Self::ControlHandle {
9397        FileControlHandle { inner: self.inner.clone() }
9398    }
9399
9400    fn into_inner(
9401        self,
9402    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9403    {
9404        (self.inner, self.is_terminated)
9405    }
9406
9407    fn from_inner(
9408        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9409        is_terminated: bool,
9410    ) -> Self {
9411        Self { inner, is_terminated }
9412    }
9413}
9414
9415impl futures::Stream for FileRequestStream {
9416    type Item = Result<FileRequest, fidl::Error>;
9417
9418    fn poll_next(
9419        mut self: std::pin::Pin<&mut Self>,
9420        cx: &mut std::task::Context<'_>,
9421    ) -> std::task::Poll<Option<Self::Item>> {
9422        let this = &mut *self;
9423        if this.inner.check_shutdown(cx) {
9424            this.is_terminated = true;
9425            return std::task::Poll::Ready(None);
9426        }
9427        if this.is_terminated {
9428            panic!("polled FileRequestStream after completion");
9429        }
9430        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9431            |bytes, handles| {
9432                match this.inner.channel().read_etc(cx, bytes, handles) {
9433                    std::task::Poll::Ready(Ok(())) => {}
9434                    std::task::Poll::Pending => return std::task::Poll::Pending,
9435                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9436                        this.is_terminated = true;
9437                        return std::task::Poll::Ready(None);
9438                    }
9439                    std::task::Poll::Ready(Err(e)) => {
9440                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9441                            e.into(),
9442                        ))));
9443                    }
9444                }
9445
9446                // A message has been received from the channel
9447                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9448
9449                std::task::Poll::Ready(Some(match header.ordinal {
9450                    0x6ee9c0ad53ec87aa => {
9451                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9452                        let mut req = fidl::new_empty!(
9453                            AdvisoryLockingAdvisoryLockRequest,
9454                            fidl::encoding::DefaultFuchsiaResourceDialect
9455                        );
9456                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9457                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9458                        Ok(FileRequest::AdvisoryLock {
9459                            request: req.request,
9460
9461                            responder: FileAdvisoryLockResponder {
9462                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9463                                tx_id: header.tx_id,
9464                            },
9465                        })
9466                    }
9467                    0x54f3949246a03e74 => {
9468                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9469                        let mut req = fidl::new_empty!(
9470                            LinkableLinkIntoRequest,
9471                            fidl::encoding::DefaultFuchsiaResourceDialect
9472                        );
9473                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9474                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9475                        Ok(FileRequest::LinkInto {
9476                            dst_parent_token: req.dst_parent_token,
9477                            dst: req.dst,
9478
9479                            responder: FileLinkIntoResponder {
9480                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9481                                tx_id: header.tx_id,
9482                            },
9483                        })
9484                    }
9485                    0x20d8a7aba2168a79 => {
9486                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9487                        let mut req = fidl::new_empty!(
9488                            fidl_fuchsia_unknown::CloneableCloneRequest,
9489                            fidl::encoding::DefaultFuchsiaResourceDialect
9490                        );
9491                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9492                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9493                        Ok(FileRequest::Clone { request: req.request, control_handle })
9494                    }
9495                    0x5ac5d459ad7f657e => {
9496                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9497                        let mut req = fidl::new_empty!(
9498                            fidl::encoding::EmptyPayload,
9499                            fidl::encoding::DefaultFuchsiaResourceDialect
9500                        );
9501                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9502                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9503                        Ok(FileRequest::Close {
9504                            responder: FileCloseResponder {
9505                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9506                                tx_id: header.tx_id,
9507                            },
9508                        })
9509                    }
9510                    0x2658edee9decfc06 => {
9511                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9512                        let mut req = fidl::new_empty!(
9513                            fidl::encoding::EmptyPayload,
9514                            fidl::encoding::DefaultFuchsiaResourceDialect
9515                        );
9516                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9517                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9518                        Ok(FileRequest::Query {
9519                            responder: FileQueryResponder {
9520                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9521                                tx_id: header.tx_id,
9522                            },
9523                        })
9524                    }
9525                    0x78985e216314dafd => {
9526                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9527                        let mut req = fidl::new_empty!(
9528                            fidl::encoding::EmptyPayload,
9529                            fidl::encoding::DefaultFuchsiaResourceDialect
9530                        );
9531                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9532                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9533                        Ok(FileRequest::DeprecatedGetAttr {
9534                            responder: FileDeprecatedGetAttrResponder {
9535                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9536                                tx_id: header.tx_id,
9537                            },
9538                        })
9539                    }
9540                    0x4186c0f40d938f46 => {
9541                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9542                        let mut req = fidl::new_empty!(
9543                            NodeDeprecatedSetAttrRequest,
9544                            fidl::encoding::DefaultFuchsiaResourceDialect
9545                        );
9546                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9547                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9548                        Ok(FileRequest::DeprecatedSetAttr {
9549                            flags: req.flags,
9550                            attributes: req.attributes,
9551
9552                            responder: FileDeprecatedSetAttrResponder {
9553                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9554                                tx_id: header.tx_id,
9555                            },
9556                        })
9557                    }
9558                    0x5b88fffb8eda3aa1 => {
9559                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9560                        let mut req = fidl::new_empty!(
9561                            fidl::encoding::EmptyPayload,
9562                            fidl::encoding::DefaultFuchsiaResourceDialect
9563                        );
9564                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9565                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9566                        Ok(FileRequest::DeprecatedGetFlags {
9567                            responder: FileDeprecatedGetFlagsResponder {
9568                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9569                                tx_id: header.tx_id,
9570                            },
9571                        })
9572                    }
9573                    0x5295b76c71fde733 => {
9574                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9575                        let mut req = fidl::new_empty!(
9576                            NodeDeprecatedSetFlagsRequest,
9577                            fidl::encoding::DefaultFuchsiaResourceDialect
9578                        );
9579                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9580                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9581                        Ok(FileRequest::DeprecatedSetFlags {
9582                            flags: req.flags,
9583
9584                            responder: FileDeprecatedSetFlagsResponder {
9585                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9586                                tx_id: header.tx_id,
9587                            },
9588                        })
9589                    }
9590                    0x176eb318f64ec23 => {
9591                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9592                        let mut req = fidl::new_empty!(
9593                            fidl::encoding::EmptyPayload,
9594                            fidl::encoding::DefaultFuchsiaResourceDialect
9595                        );
9596                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9597                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9598                        Ok(FileRequest::GetFlags {
9599                            responder: FileGetFlagsResponder {
9600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9601                                tx_id: header.tx_id,
9602                            },
9603                        })
9604                    }
9605                    0x55a8028685791ea8 => {
9606                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9607                        let mut req = fidl::new_empty!(
9608                            NodeSetFlagsRequest,
9609                            fidl::encoding::DefaultFuchsiaResourceDialect
9610                        );
9611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9612                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9613                        Ok(FileRequest::SetFlags {
9614                            flags: req.flags,
9615
9616                            responder: FileSetFlagsResponder {
9617                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9618                                tx_id: header.tx_id,
9619                            },
9620                        })
9621                    }
9622                    0x6f344a1c6b0a0610 => {
9623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9624                        let mut req = fidl::new_empty!(
9625                            fidl::encoding::EmptyPayload,
9626                            fidl::encoding::DefaultFuchsiaResourceDialect
9627                        );
9628                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9629                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9630                        Ok(FileRequest::QueryFilesystem {
9631                            responder: FileQueryFilesystemResponder {
9632                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9633                                tx_id: header.tx_id,
9634                            },
9635                        })
9636                    }
9637                    0x5054f0ade7076cec => {
9638                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9639                        let mut req = fidl::new_empty!(
9640                            fidl::encoding::EmptyPayload,
9641                            fidl::encoding::DefaultFuchsiaResourceDialect
9642                        );
9643                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9644                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9645                        Ok(FileRequest::GetToken {
9646                            responder: FileGetTokenResponder {
9647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9648                                tx_id: header.tx_id,
9649                            },
9650                        })
9651                    }
9652                    0x3d4396a638ea053b => {
9653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9654                        let mut req = fidl::new_empty!(
9655                            NodeGetAttributesRequest,
9656                            fidl::encoding::DefaultFuchsiaResourceDialect
9657                        );
9658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9659                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9660                        Ok(FileRequest::GetAttributes {
9661                            query: req.query,
9662
9663                            responder: FileGetAttributesResponder {
9664                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9665                                tx_id: header.tx_id,
9666                            },
9667                        })
9668                    }
9669                    0x3308c1da5a89bf08 => {
9670                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9671                        let mut req = fidl::new_empty!(
9672                            MutableNodeAttributes,
9673                            fidl::encoding::DefaultFuchsiaResourceDialect
9674                        );
9675                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9676                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9677                        Ok(FileRequest::UpdateAttributes {
9678                            payload: req,
9679                            responder: FileUpdateAttributesResponder {
9680                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9681                                tx_id: header.tx_id,
9682                            },
9683                        })
9684                    }
9685                    0x2c5c27ca0ab5dc49 => {
9686                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9687                        let mut req = fidl::new_empty!(
9688                            fidl::encoding::EmptyPayload,
9689                            fidl::encoding::DefaultFuchsiaResourceDialect
9690                        );
9691                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9692                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9693                        Ok(FileRequest::Sync {
9694                            responder: FileSyncResponder {
9695                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9696                                tx_id: header.tx_id,
9697                            },
9698                        })
9699                    }
9700                    0x4b61033de007fcd0 => {
9701                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9702                        let mut req = fidl::new_empty!(
9703                            NodeListExtendedAttributesRequest,
9704                            fidl::encoding::DefaultFuchsiaResourceDialect
9705                        );
9706                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9707                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9708                        Ok(FileRequest::ListExtendedAttributes {
9709                            iterator: req.iterator,
9710
9711                            control_handle,
9712                        })
9713                    }
9714                    0x45ffa3ccfdeb76db => {
9715                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9716                        let mut req = fidl::new_empty!(
9717                            NodeGetExtendedAttributeRequest,
9718                            fidl::encoding::DefaultFuchsiaResourceDialect
9719                        );
9720                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9721                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9722                        Ok(FileRequest::GetExtendedAttribute {
9723                            name: req.name,
9724
9725                            responder: FileGetExtendedAttributeResponder {
9726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9727                                tx_id: header.tx_id,
9728                            },
9729                        })
9730                    }
9731                    0x4a951362f681f23c => {
9732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9733                        let mut req = fidl::new_empty!(
9734                            NodeSetExtendedAttributeRequest,
9735                            fidl::encoding::DefaultFuchsiaResourceDialect
9736                        );
9737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9738                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9739                        Ok(FileRequest::SetExtendedAttribute {
9740                            name: req.name,
9741                            value: req.value,
9742                            mode: req.mode,
9743
9744                            responder: FileSetExtendedAttributeResponder {
9745                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9746                                tx_id: header.tx_id,
9747                            },
9748                        })
9749                    }
9750                    0x7a0b9f3a9bf9032d => {
9751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9752                        let mut req = fidl::new_empty!(
9753                            NodeRemoveExtendedAttributeRequest,
9754                            fidl::encoding::DefaultFuchsiaResourceDialect
9755                        );
9756                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9757                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9758                        Ok(FileRequest::RemoveExtendedAttribute {
9759                            name: req.name,
9760
9761                            responder: FileRemoveExtendedAttributeResponder {
9762                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9763                                tx_id: header.tx_id,
9764                            },
9765                        })
9766                    }
9767                    0x57e419a298c8ede => {
9768                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9769                        let mut req = fidl::new_empty!(
9770                            ReadableReadRequest,
9771                            fidl::encoding::DefaultFuchsiaResourceDialect
9772                        );
9773                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9774                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9775                        Ok(FileRequest::Read {
9776                            count: req.count,
9777
9778                            responder: FileReadResponder {
9779                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9780                                tx_id: header.tx_id,
9781                            },
9782                        })
9783                    }
9784                    0x6a31437832469f82 => {
9785                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9786                        let mut req = fidl::new_empty!(
9787                            WritableWriteRequest,
9788                            fidl::encoding::DefaultFuchsiaResourceDialect
9789                        );
9790                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9791                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9792                        Ok(FileRequest::Write {
9793                            data: req.data,
9794
9795                            responder: FileWriteResponder {
9796                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9797                                tx_id: header.tx_id,
9798                            },
9799                        })
9800                    }
9801                    0x68b5ac00c62906bc => {
9802                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9803                        let mut req = fidl::new_empty!(
9804                            fidl::encoding::EmptyPayload,
9805                            fidl::encoding::DefaultFuchsiaResourceDialect
9806                        );
9807                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9808                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9809                        Ok(FileRequest::Describe {
9810                            responder: FileDescribeResponder {
9811                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9812                                tx_id: header.tx_id,
9813                            },
9814                        })
9815                    }
9816                    0x78079168162c5207 => {
9817                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9818                        let mut req = fidl::new_empty!(
9819                            FileSeekRequest,
9820                            fidl::encoding::DefaultFuchsiaResourceDialect
9821                        );
9822                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9823                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9824                        Ok(FileRequest::Seek {
9825                            origin: req.origin,
9826                            offset: req.offset,
9827
9828                            responder: FileSeekResponder {
9829                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9830                                tx_id: header.tx_id,
9831                            },
9832                        })
9833                    }
9834                    0x1607a293a60d723e => {
9835                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9836                        let mut req = fidl::new_empty!(
9837                            FileReadAtRequest,
9838                            fidl::encoding::DefaultFuchsiaResourceDialect
9839                        );
9840                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9841                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9842                        Ok(FileRequest::ReadAt {
9843                            count: req.count,
9844                            offset: req.offset,
9845
9846                            responder: FileReadAtResponder {
9847                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9848                                tx_id: header.tx_id,
9849                            },
9850                        })
9851                    }
9852                    0x793eefc0045e792b => {
9853                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9854                        let mut req = fidl::new_empty!(
9855                            FileWriteAtRequest,
9856                            fidl::encoding::DefaultFuchsiaResourceDialect
9857                        );
9858                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9859                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9860                        Ok(FileRequest::WriteAt {
9861                            data: req.data,
9862                            offset: req.offset,
9863
9864                            responder: FileWriteAtResponder {
9865                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9866                                tx_id: header.tx_id,
9867                            },
9868                        })
9869                    }
9870                    0x2b80825f0535743a => {
9871                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9872                        let mut req = fidl::new_empty!(
9873                            FileResizeRequest,
9874                            fidl::encoding::DefaultFuchsiaResourceDialect
9875                        );
9876                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9877                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9878                        Ok(FileRequest::Resize {
9879                            length: req.length,
9880
9881                            responder: FileResizeResponder {
9882                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9883                                tx_id: header.tx_id,
9884                            },
9885                        })
9886                    }
9887                    0xa6a9e654cbf62b => {
9888                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9889                        let mut req = fidl::new_empty!(
9890                            FileGetBackingMemoryRequest,
9891                            fidl::encoding::DefaultFuchsiaResourceDialect
9892                        );
9893                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9894                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9895                        Ok(FileRequest::GetBackingMemory {
9896                            flags: req.flags,
9897
9898                            responder: FileGetBackingMemoryResponder {
9899                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9900                                tx_id: header.tx_id,
9901                            },
9902                        })
9903                    }
9904                    0x77fa0c330b57fd2e => {
9905                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9906                        let mut req = fidl::new_empty!(
9907                            FileAllocateRequest,
9908                            fidl::encoding::DefaultFuchsiaResourceDialect
9909                        );
9910                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9911                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9912                        Ok(FileRequest::Allocate {
9913                            offset: req.offset,
9914                            length: req.length,
9915                            mode: req.mode,
9916
9917                            responder: FileAllocateResponder {
9918                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9919                                tx_id: header.tx_id,
9920                            },
9921                        })
9922                    }
9923                    0x2c421ec3faaeb8bb => {
9924                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9925                        let mut req = fidl::new_empty!(
9926                            FileEnableVerityRequest,
9927                            fidl::encoding::DefaultFuchsiaResourceDialect
9928                        );
9929                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9930                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9931                        Ok(FileRequest::EnableVerity {
9932                            options: req.options,
9933
9934                            responder: FileEnableVerityResponder {
9935                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9936                                tx_id: header.tx_id,
9937                            },
9938                        })
9939                    }
9940                    _ if header.tx_id == 0
9941                        && header
9942                            .dynamic_flags()
9943                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9944                    {
9945                        Ok(FileRequest::_UnknownMethod {
9946                            ordinal: header.ordinal,
9947                            control_handle: FileControlHandle { inner: this.inner.clone() },
9948                            method_type: fidl::MethodType::OneWay,
9949                        })
9950                    }
9951                    _ if header
9952                        .dynamic_flags()
9953                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9954                    {
9955                        this.inner.send_framework_err(
9956                            fidl::encoding::FrameworkErr::UnknownMethod,
9957                            header.tx_id,
9958                            header.ordinal,
9959                            header.dynamic_flags(),
9960                            (bytes, handles),
9961                        )?;
9962                        Ok(FileRequest::_UnknownMethod {
9963                            ordinal: header.ordinal,
9964                            control_handle: FileControlHandle { inner: this.inner.clone() },
9965                            method_type: fidl::MethodType::TwoWay,
9966                        })
9967                    }
9968                    _ => Err(fidl::Error::UnknownOrdinal {
9969                        ordinal: header.ordinal,
9970                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9971                    }),
9972                }))
9973            },
9974        )
9975    }
9976}
9977
9978/// A [`Node`] which contains a sequence of bytes of definite length.
9979///
9980/// NOTE: cloned connections do not share their seek offset with their source
9981/// connection.
9982#[derive(Debug)]
9983pub enum FileRequest {
9984    /// Acquires an advisory lock on the underlying file.
9985    ///
9986    /// The lock lasts until either this connection is closed or
9987    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9988    /// explicitly.
9989    ///
9990    /// Advisory locks are purely advisory. They do not prevent actual read or
9991    /// write operations from occurring on the file, either through this
9992    /// connection or through other connections.
9993    ///
9994    /// This method requires the following rights:
9995    ///
9996    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9997    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9998    ///   [`AdvisoryLockType.WRITE`].
9999    ///
10000    /// # Errors
10001    ///
10002    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
10003    ///   example, another connection might hold a conflicting lock type.
10004    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
10005    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
10006    ///   to acquire the given type of lock.
10007    AdvisoryLock {
10008        request: AdvisoryLockRequest,
10009        responder: FileAdvisoryLockResponder,
10010    },
10011    /// Creates a link to this this object with name `dst` in the directory represented by
10012    /// `dst_parent_token`.
10013    ///
10014    /// `dst` must be a resolved object name. Including "/" in the string will return
10015    /// `ZX_ERR_INVALID_ARGS`.
10016    ///
10017    /// This method requires the maximal set of rights supported by the filesystem for this object.
10018    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10019    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10020    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10021    /// `ZX_ERR_ACCESS_DENIED`.
10022    ///
10023    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10024    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10025    ///
10026    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10027    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10028    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10029    ///
10030    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10031    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10032    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10033    LinkInto {
10034        dst_parent_token: fidl::Event,
10035        dst: String,
10036        responder: FileLinkIntoResponder,
10037    },
10038    Clone {
10039        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10040        control_handle: FileControlHandle,
10041    },
10042    /// Terminates the connection.
10043    ///
10044    /// After calling `Close`, the client must not send any other requests.
10045    ///
10046    /// Servers, after sending the status response, should close the connection
10047    /// regardless of status and without sending an epitaph.
10048    ///
10049    /// Closing the client end of the channel should be semantically equivalent
10050    /// to calling `Close` without knowing when the close has completed or its
10051    /// status.
10052    Close {
10053        responder: FileCloseResponder,
10054    },
10055    Query {
10056        responder: FileQueryResponder,
10057    },
10058    /// DEPRECATED - Use `Node.GetAttributes` instead.
10059    ///
10060    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
10061    DeprecatedGetAttr {
10062        responder: FileDeprecatedGetAttrResponder,
10063    },
10064    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
10065    DeprecatedSetAttr {
10066        flags: NodeAttributeFlags,
10067        attributes: NodeAttributes,
10068        responder: FileDeprecatedSetAttrResponder,
10069    },
10070    /// [DEPRECATED - Use new GetFlags method instead.]
10071    DeprecatedGetFlags {
10072        responder: FileDeprecatedGetFlagsResponder,
10073    },
10074    /// [DEPRECATED - Use new SetFlags method instead.]
10075    DeprecatedSetFlags {
10076        flags: OpenFlags,
10077        responder: FileDeprecatedSetFlagsResponder,
10078    },
10079    /// Queries the flags that apply to this node after it has been opened/created. This method does
10080    /// not require any rights.
10081    ///
10082    /// Note that the final set of flags that apply to the connection may differ from those
10083    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
10084    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
10085    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
10086    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
10087    GetFlags {
10088        responder: FileGetFlagsResponder,
10089    },
10090    /// Sets the flags that apply to this node after it has been opened. This method does not
10091    /// require any rights.
10092    ///
10093    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
10094    /// clear append mode.
10095    ///
10096    /// Errors:
10097    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
10098    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
10099    SetFlags {
10100        flags: Flags,
10101        responder: FileSetFlagsResponder,
10102    },
10103    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
10104    /// volume has different settings or the storage is accounted seperately from the rest of the
10105    /// filesystem that may be reported instead of filesystem-wide details.
10106    QueryFilesystem {
10107        responder: FileQueryFilesystemResponder,
10108    },
10109    /// Acquires a token which can be used to identify this connection at a later point in
10110    /// time. The token will remain valid for as long as the connection requesting the token
10111    /// remains open.
10112    ///
10113    /// This method does not require any rights. Note that the token identifies
10114    /// the connection, hence carries the rights information on this connection.
10115    GetToken {
10116        responder: FileGetTokenResponder,
10117    },
10118    /// Acquires information about the node.
10119    ///
10120    /// The attributes of a node should be stable, independent of the
10121    /// specific protocol used to access it.
10122    ///
10123    /// If a particular attribute is not applicable or not supported,
10124    /// filesystems should leave the corresponding field absent.
10125    ///
10126    /// + `query` a bit-mask specifying which attributes to fetch. The server
10127    ///   should not return more than necessary.
10128    /// - `attributes` the returned attributes.
10129    ///
10130    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
10131    GetAttributes {
10132        query: NodeAttributesQuery,
10133        responder: FileGetAttributesResponder,
10134    },
10135    /// Updates information about the node.
10136    ///
10137    /// + `attributes` the presence of a table field in `attributes` indicates
10138    /// the intent to update the corresponding attribute.
10139    ///
10140    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
10141    ///
10142    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10143    UpdateAttributes {
10144        payload: MutableNodeAttributes,
10145        responder: FileUpdateAttributesResponder,
10146    },
10147    /// Synchronizes updates to the node to the underlying media, if it exists.
10148    ///
10149    /// This method will return when the filesystem server has flushed the
10150    /// relevant updates to the underlying media, but does not guarantee the
10151    /// underlying media has persisted the information, nor that any information
10152    /// is committed to hardware. Clients may use `Sync` to ensure ordering
10153    /// between operations.
10154    ///
10155    /// This method does not require any rights.
10156    Sync {
10157        responder: FileSyncResponder,
10158    },
10159    /// Creates an iterator over all the extended attribute names associated
10160    /// with this node. If an error occurs it is returned as an epitaph on the
10161    /// iterator request channel, and then the channel is closed.
10162    ///
10163    /// GetExtendedAttributes can be used with any of these names to retrieve
10164    /// the associated value.
10165    ///
10166    /// This method requires the [`Rights.READ_BYTES`] right.
10167    ListExtendedAttributes {
10168        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
10169        control_handle: FileControlHandle,
10170    },
10171    /// Get the value associated with the given attribute `name` for this node.
10172    ///
10173    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
10174    /// particular structure is imposed on them.
10175    ///
10176    /// This method requires the [`Rights.READ_BYTES`] right.
10177    GetExtendedAttribute {
10178        name: Vec<u8>,
10179        responder: FileGetExtendedAttributeResponder,
10180    },
10181    /// Set the value for the given attribute `name` to `value` for this node.
10182    ///
10183    /// The attribute name may exist, in which case the attribute is updated.
10184    /// If the attribute doesn't exist, it is created. The name should have no
10185    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
10186    ///
10187    /// This method requires the [`Rights.WRITE_BYTES`] right.
10188    SetExtendedAttribute {
10189        name: Vec<u8>,
10190        value: ExtendedAttributeValue,
10191        mode: SetExtendedAttributeMode,
10192        responder: FileSetExtendedAttributeResponder,
10193    },
10194    /// Remove the specified extended attribute.
10195    ///
10196    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
10197    ///
10198    /// This method requires the [`Rights.WRITE_BYTES`] right.
10199    RemoveExtendedAttribute {
10200        name: Vec<u8>,
10201        responder: FileRemoveExtendedAttributeResponder,
10202    },
10203    /// Reads up to 'count' bytes at the seek offset.
10204    /// The seek offset is moved forward by the number of bytes read.
10205    ///
10206    /// ## Invariants
10207    ///
10208    /// * The returned `data.length` will never be greater than `count`.
10209    /// * If `data.length` is less than `count`, it means that the seek offset
10210    ///   has reached the end of file as part of this operation.
10211    /// * If `data.length` is zero while `count` is not, it means that the
10212    ///   seek offset is already at or beyond the end of file, and no data could
10213    ///   be read.
10214    /// * If `count` is zero, the server should perform all the checks ensuring
10215    ///   read access without actually read anything, and return an empty
10216    ///   `data` vector.
10217    ///
10218    /// This method requires the [`Rights.READ_BYTES`] right.
10219    ///
10220    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10221    Read {
10222        count: u64,
10223        responder: FileReadResponder,
10224    },
10225    /// Writes data at the seek offset.
10226    /// The seek offset is moved forward by the number of bytes written.
10227    /// If the file is in append mode, the seek offset is first set to the end
10228    /// of the file, followed by the write, in one atomic step.
10229    ///
10230    /// The file size may grow if the seek offset plus `data.length` is beyond
10231    /// the current end of file.
10232    ///
10233    /// + request `data` the byte buffer to write to the file.
10234    /// - response `actual_count` the number of bytes written.
10235    ///
10236    /// ## Invariants
10237    ///
10238    /// * The returned `actual_count` will never be greater than `data.length`.
10239    /// * If the server is unable to write all the data due to e.g. not enough
10240    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10241    ///   could be written, an error is returned.
10242    /// * If `data.length` is zero, the server should perform all the checks
10243    ///   ensuring write access without mutating the file and return a
10244    ///   successful write of zero bytes.  The seek offset is still updated if
10245    ///   in append mode.
10246    ///
10247    /// This method requires the [`Rights.WRITE_BYTES`] right.
10248    Write {
10249        data: Vec<u8>,
10250        responder: FileWriteResponder,
10251    },
10252    Describe {
10253        responder: FileDescribeResponder,
10254    },
10255    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
10256    /// will occur. The seek offset is specific to each file connection.
10257    ///
10258    /// + request `origin` the reference point where `offset` will be based on.
10259    /// + request `offset` the number of bytes to seek.
10260    /// - response `offset_from_start` the adjusted seek offset, from the start
10261    ///   of the file.
10262    ///
10263    /// This method does not require any rights.
10264    Seek {
10265        origin: SeekOrigin,
10266        offset: i64,
10267        responder: FileSeekResponder,
10268    },
10269    /// Reads up to 'count' bytes at the provided offset.
10270    /// Does not affect the seek offset.
10271    ///
10272    /// ## Invariants
10273    ///
10274    /// * The returned `data.length` will never be greater than `count`.
10275    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10276    ///   the end of file as part of this operation.
10277    /// * If `data.length` is zero while `count` is not, it means that `offset`
10278    ///   is at or past the end of file, and no data can be read.
10279    /// * If `count` is zero, the server should perform all the checks ensuring
10280    ///   read access without actually reading anything, and return an empty
10281    ///   `data` vector.
10282    ///
10283    /// This method requires the [`Rights.READ_BYTES`] right.
10284    ///
10285    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10286    ReadAt {
10287        count: u64,
10288        offset: u64,
10289        responder: FileReadAtResponder,
10290    },
10291    /// Writes data at the provided offset.
10292    /// Does not affect the seek offset.
10293    ///
10294    /// The file size may grow if `offset` plus `data.length` is past the
10295    /// current end of file.
10296    ///
10297    /// + request `data` the byte buffer to write to the file.
10298    /// + request `offset` the offset from start of the file to begin writing.
10299    /// - response `actual_count` the number of bytes written.
10300    ///
10301    /// ## Invariants
10302    ///
10303    /// * The returned `actual_count` will never be greater than `data.length`.
10304    /// * If the server is unable to write all the data due to e.g. not enough
10305    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10306    ///   could be written, an error is returned.
10307    /// * If `data.length` is zero, the server should perform all the checks
10308    ///   ensuring write access without mutating the file, and will return a
10309    ///   successful write of zero bytes.
10310    ///
10311    /// This method requires the [`Rights.WRITE_BYTES`] right.
10312    WriteAt {
10313        data: Vec<u8>,
10314        offset: u64,
10315        responder: FileWriteAtResponder,
10316    },
10317    /// Shrinks or grows the file size to 'length' bytes.
10318    ///
10319    /// If file size is reduced by this operation, the extra trailing data'
10320    /// is discarded.
10321    /// If file size is increased by this operation, the extended area appears
10322    /// as if it was zeroed.
10323    ///
10324    /// This method requires the [`Rights.WRITE_BYTES`] right.
10325    Resize {
10326        length: u64,
10327        responder: FileResizeResponder,
10328    },
10329    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10330    /// with the requested access rights.
10331    ///
10332    /// Implementations are not required to implement files backed by VMOs so
10333    /// this request may fail. Additionally, implementations may only support
10334    /// a certain subset of the flags. Clients should be prepared with fallback
10335    /// behavior if this request fails.
10336    ///
10337    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10338    /// implementation is free to choose the semantics of the returned VMO.
10339    ///
10340    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10341    /// - response `vmo` the requested [`zx.Handle:VMO`].
10342    /// * error a [`zx.Status`] value indicating the failure.
10343    ///
10344    /// This method requires the following rights:
10345    ///
10346    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10347    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10348    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10349    GetBackingMemory {
10350        flags: VmoFlags,
10351        responder: FileGetBackingMemoryResponder,
10352    },
10353    /// Pre-allocate on-disk space for this file.
10354    Allocate {
10355        offset: u64,
10356        length: u64,
10357        mode: AllocateMode,
10358        responder: FileAllocateResponder,
10359    },
10360    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10361    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10362    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10363    /// rejected. This method can take some time to complete as it depends on the size of the file.
10364    /// This method can be aborted by closing the connection that this method was issued on.
10365    ///
10366    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10367    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10368    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10369    /// Also returns any error that might arise from reading the file, or from flushing the file,
10370    /// such as `ZX_ERR_IO`.
10371    EnableVerity {
10372        options: VerificationOptions,
10373        responder: FileEnableVerityResponder,
10374    },
10375    /// An interaction was received which does not match any known method.
10376    #[non_exhaustive]
10377    _UnknownMethod {
10378        /// Ordinal of the method that was called.
10379        ordinal: u64,
10380        control_handle: FileControlHandle,
10381        method_type: fidl::MethodType,
10382    },
10383}
10384
10385impl FileRequest {
10386    #[allow(irrefutable_let_patterns)]
10387    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10388        if let FileRequest::AdvisoryLock { request, responder } = self {
10389            Some((request, responder))
10390        } else {
10391            None
10392        }
10393    }
10394
10395    #[allow(irrefutable_let_patterns)]
10396    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10397        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10398            Some((dst_parent_token, dst, responder))
10399        } else {
10400            None
10401        }
10402    }
10403
10404    #[allow(irrefutable_let_patterns)]
10405    pub fn into_clone(
10406        self,
10407    ) -> Option<(
10408        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10409        FileControlHandle,
10410    )> {
10411        if let FileRequest::Clone { request, control_handle } = self {
10412            Some((request, control_handle))
10413        } else {
10414            None
10415        }
10416    }
10417
10418    #[allow(irrefutable_let_patterns)]
10419    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10420        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10421    }
10422
10423    #[allow(irrefutable_let_patterns)]
10424    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10425        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10426    }
10427
10428    #[allow(irrefutable_let_patterns)]
10429    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10430        if let FileRequest::DeprecatedGetAttr { responder } = self {
10431            Some((responder))
10432        } else {
10433            None
10434        }
10435    }
10436
10437    #[allow(irrefutable_let_patterns)]
10438    pub fn into_deprecated_set_attr(
10439        self,
10440    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10441        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10442            Some((flags, attributes, responder))
10443        } else {
10444            None
10445        }
10446    }
10447
10448    #[allow(irrefutable_let_patterns)]
10449    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10450        if let FileRequest::DeprecatedGetFlags { responder } = self {
10451            Some((responder))
10452        } else {
10453            None
10454        }
10455    }
10456
10457    #[allow(irrefutable_let_patterns)]
10458    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10459        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10460            Some((flags, responder))
10461        } else {
10462            None
10463        }
10464    }
10465
10466    #[allow(irrefutable_let_patterns)]
10467    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10468        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10469    }
10470
10471    #[allow(irrefutable_let_patterns)]
10472    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10473        if let FileRequest::SetFlags { flags, responder } = self {
10474            Some((flags, responder))
10475        } else {
10476            None
10477        }
10478    }
10479
10480    #[allow(irrefutable_let_patterns)]
10481    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10482        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10483    }
10484
10485    #[allow(irrefutable_let_patterns)]
10486    pub fn into_get_token(self) -> Option<(FileGetTokenResponder)> {
10487        if let FileRequest::GetToken { responder } = self { Some((responder)) } else { None }
10488    }
10489
10490    #[allow(irrefutable_let_patterns)]
10491    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10492        if let FileRequest::GetAttributes { query, responder } = self {
10493            Some((query, responder))
10494        } else {
10495            None
10496        }
10497    }
10498
10499    #[allow(irrefutable_let_patterns)]
10500    pub fn into_update_attributes(
10501        self,
10502    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10503        if let FileRequest::UpdateAttributes { payload, responder } = self {
10504            Some((payload, responder))
10505        } else {
10506            None
10507        }
10508    }
10509
10510    #[allow(irrefutable_let_patterns)]
10511    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10512        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10513    }
10514
10515    #[allow(irrefutable_let_patterns)]
10516    pub fn into_list_extended_attributes(
10517        self,
10518    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10519    {
10520        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10521            Some((iterator, control_handle))
10522        } else {
10523            None
10524        }
10525    }
10526
10527    #[allow(irrefutable_let_patterns)]
10528    pub fn into_get_extended_attribute(
10529        self,
10530    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10531        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10532            Some((name, responder))
10533        } else {
10534            None
10535        }
10536    }
10537
10538    #[allow(irrefutable_let_patterns)]
10539    pub fn into_set_extended_attribute(
10540        self,
10541    ) -> Option<(
10542        Vec<u8>,
10543        ExtendedAttributeValue,
10544        SetExtendedAttributeMode,
10545        FileSetExtendedAttributeResponder,
10546    )> {
10547        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10548            Some((name, value, mode, responder))
10549        } else {
10550            None
10551        }
10552    }
10553
10554    #[allow(irrefutable_let_patterns)]
10555    pub fn into_remove_extended_attribute(
10556        self,
10557    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10558        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10559            Some((name, responder))
10560        } else {
10561            None
10562        }
10563    }
10564
10565    #[allow(irrefutable_let_patterns)]
10566    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10567        if let FileRequest::Read { count, responder } = self {
10568            Some((count, responder))
10569        } else {
10570            None
10571        }
10572    }
10573
10574    #[allow(irrefutable_let_patterns)]
10575    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10576        if let FileRequest::Write { data, responder } = self {
10577            Some((data, responder))
10578        } else {
10579            None
10580        }
10581    }
10582
10583    #[allow(irrefutable_let_patterns)]
10584    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10585        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10586    }
10587
10588    #[allow(irrefutable_let_patterns)]
10589    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10590        if let FileRequest::Seek { origin, offset, responder } = self {
10591            Some((origin, offset, responder))
10592        } else {
10593            None
10594        }
10595    }
10596
10597    #[allow(irrefutable_let_patterns)]
10598    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10599        if let FileRequest::ReadAt { count, offset, responder } = self {
10600            Some((count, offset, responder))
10601        } else {
10602            None
10603        }
10604    }
10605
10606    #[allow(irrefutable_let_patterns)]
10607    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10608        if let FileRequest::WriteAt { data, offset, responder } = self {
10609            Some((data, offset, responder))
10610        } else {
10611            None
10612        }
10613    }
10614
10615    #[allow(irrefutable_let_patterns)]
10616    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10617        if let FileRequest::Resize { length, responder } = self {
10618            Some((length, responder))
10619        } else {
10620            None
10621        }
10622    }
10623
10624    #[allow(irrefutable_let_patterns)]
10625    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10626        if let FileRequest::GetBackingMemory { flags, responder } = self {
10627            Some((flags, responder))
10628        } else {
10629            None
10630        }
10631    }
10632
10633    #[allow(irrefutable_let_patterns)]
10634    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10635        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10636            Some((offset, length, mode, responder))
10637        } else {
10638            None
10639        }
10640    }
10641
10642    #[allow(irrefutable_let_patterns)]
10643    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10644        if let FileRequest::EnableVerity { options, responder } = self {
10645            Some((options, responder))
10646        } else {
10647            None
10648        }
10649    }
10650
10651    /// Name of the method defined in FIDL
10652    pub fn method_name(&self) -> &'static str {
10653        match *self {
10654            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10655            FileRequest::LinkInto { .. } => "link_into",
10656            FileRequest::Clone { .. } => "clone",
10657            FileRequest::Close { .. } => "close",
10658            FileRequest::Query { .. } => "query",
10659            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10660            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10661            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10662            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10663            FileRequest::GetFlags { .. } => "get_flags",
10664            FileRequest::SetFlags { .. } => "set_flags",
10665            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10666            FileRequest::GetToken { .. } => "get_token",
10667            FileRequest::GetAttributes { .. } => "get_attributes",
10668            FileRequest::UpdateAttributes { .. } => "update_attributes",
10669            FileRequest::Sync { .. } => "sync",
10670            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10671            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10672            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10673            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10674            FileRequest::Read { .. } => "read",
10675            FileRequest::Write { .. } => "write",
10676            FileRequest::Describe { .. } => "describe",
10677            FileRequest::Seek { .. } => "seek",
10678            FileRequest::ReadAt { .. } => "read_at",
10679            FileRequest::WriteAt { .. } => "write_at",
10680            FileRequest::Resize { .. } => "resize",
10681            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10682            FileRequest::Allocate { .. } => "allocate",
10683            FileRequest::EnableVerity { .. } => "enable_verity",
10684            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10685                "unknown one-way method"
10686            }
10687            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10688                "unknown two-way method"
10689            }
10690        }
10691    }
10692}
10693
10694#[derive(Debug, Clone)]
10695pub struct FileControlHandle {
10696    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10697}
10698
10699impl FileControlHandle {
10700    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10701        self.inner.shutdown_with_epitaph(status.into())
10702    }
10703}
10704
10705impl fidl::endpoints::ControlHandle for FileControlHandle {
10706    fn shutdown(&self) {
10707        self.inner.shutdown()
10708    }
10709
10710    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10711        self.inner.shutdown_with_epitaph(status)
10712    }
10713
10714    fn is_closed(&self) -> bool {
10715        self.inner.channel().is_closed()
10716    }
10717    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10718        self.inner.channel().on_closed()
10719    }
10720
10721    #[cfg(target_os = "fuchsia")]
10722    fn signal_peer(
10723        &self,
10724        clear_mask: zx::Signals,
10725        set_mask: zx::Signals,
10726    ) -> Result<(), zx_status::Status> {
10727        use fidl::Peered;
10728        self.inner.channel().signal_peer(clear_mask, set_mask)
10729    }
10730}
10731
10732impl FileControlHandle {
10733    pub fn send_on_open_(
10734        &self,
10735        mut s: i32,
10736        mut info: Option<NodeInfoDeprecated>,
10737    ) -> Result<(), fidl::Error> {
10738        self.inner.send::<NodeOnOpenRequest>(
10739            (s, info.as_mut()),
10740            0,
10741            0x7fc7bbb1dbfd1972,
10742            fidl::encoding::DynamicFlags::FLEXIBLE,
10743        )
10744    }
10745
10746    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10747        self.inner.send::<Representation>(
10748            &mut payload,
10749            0,
10750            0x5cb40567d80a510c,
10751            fidl::encoding::DynamicFlags::empty(),
10752        )
10753    }
10754}
10755
10756#[must_use = "FIDL methods require a response to be sent"]
10757#[derive(Debug)]
10758pub struct FileAdvisoryLockResponder {
10759    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10760    tx_id: u32,
10761}
10762
10763/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10764/// if the responder is dropped without sending a response, so that the client
10765/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10766impl std::ops::Drop for FileAdvisoryLockResponder {
10767    fn drop(&mut self) {
10768        self.control_handle.shutdown();
10769        // Safety: drops once, never accessed again
10770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10771    }
10772}
10773
10774impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10775    type ControlHandle = FileControlHandle;
10776
10777    fn control_handle(&self) -> &FileControlHandle {
10778        &self.control_handle
10779    }
10780
10781    fn drop_without_shutdown(mut self) {
10782        // Safety: drops once, never accessed again due to mem::forget
10783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10784        // Prevent Drop from running (which would shut down the channel)
10785        std::mem::forget(self);
10786    }
10787}
10788
10789impl FileAdvisoryLockResponder {
10790    /// Sends a response to the FIDL transaction.
10791    ///
10792    /// Sets the channel to shutdown if an error occurs.
10793    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10794        let _result = self.send_raw(result);
10795        if _result.is_err() {
10796            self.control_handle.shutdown();
10797        }
10798        self.drop_without_shutdown();
10799        _result
10800    }
10801
10802    /// Similar to "send" but does not shutdown the channel if an error occurs.
10803    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10804        let _result = self.send_raw(result);
10805        self.drop_without_shutdown();
10806        _result
10807    }
10808
10809    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10810        self.control_handle
10811            .inner
10812            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10813                result,
10814                self.tx_id,
10815                0x6ee9c0ad53ec87aa,
10816                fidl::encoding::DynamicFlags::empty(),
10817            )
10818    }
10819}
10820
10821#[must_use = "FIDL methods require a response to be sent"]
10822#[derive(Debug)]
10823pub struct FileLinkIntoResponder {
10824    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10825    tx_id: u32,
10826}
10827
10828/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10829/// if the responder is dropped without sending a response, so that the client
10830/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10831impl std::ops::Drop for FileLinkIntoResponder {
10832    fn drop(&mut self) {
10833        self.control_handle.shutdown();
10834        // Safety: drops once, never accessed again
10835        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10836    }
10837}
10838
10839impl fidl::endpoints::Responder for FileLinkIntoResponder {
10840    type ControlHandle = FileControlHandle;
10841
10842    fn control_handle(&self) -> &FileControlHandle {
10843        &self.control_handle
10844    }
10845
10846    fn drop_without_shutdown(mut self) {
10847        // Safety: drops once, never accessed again due to mem::forget
10848        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10849        // Prevent Drop from running (which would shut down the channel)
10850        std::mem::forget(self);
10851    }
10852}
10853
10854impl FileLinkIntoResponder {
10855    /// Sends a response to the FIDL transaction.
10856    ///
10857    /// Sets the channel to shutdown if an error occurs.
10858    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10859        let _result = self.send_raw(result);
10860        if _result.is_err() {
10861            self.control_handle.shutdown();
10862        }
10863        self.drop_without_shutdown();
10864        _result
10865    }
10866
10867    /// Similar to "send" but does not shutdown the channel if an error occurs.
10868    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10869        let _result = self.send_raw(result);
10870        self.drop_without_shutdown();
10871        _result
10872    }
10873
10874    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10875        self.control_handle
10876            .inner
10877            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10878                result,
10879                self.tx_id,
10880                0x54f3949246a03e74,
10881                fidl::encoding::DynamicFlags::empty(),
10882            )
10883    }
10884}
10885
10886#[must_use = "FIDL methods require a response to be sent"]
10887#[derive(Debug)]
10888pub struct FileCloseResponder {
10889    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10890    tx_id: u32,
10891}
10892
10893/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10894/// if the responder is dropped without sending a response, so that the client
10895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10896impl std::ops::Drop for FileCloseResponder {
10897    fn drop(&mut self) {
10898        self.control_handle.shutdown();
10899        // Safety: drops once, never accessed again
10900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10901    }
10902}
10903
10904impl fidl::endpoints::Responder for FileCloseResponder {
10905    type ControlHandle = FileControlHandle;
10906
10907    fn control_handle(&self) -> &FileControlHandle {
10908        &self.control_handle
10909    }
10910
10911    fn drop_without_shutdown(mut self) {
10912        // Safety: drops once, never accessed again due to mem::forget
10913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10914        // Prevent Drop from running (which would shut down the channel)
10915        std::mem::forget(self);
10916    }
10917}
10918
10919impl FileCloseResponder {
10920    /// Sends a response to the FIDL transaction.
10921    ///
10922    /// Sets the channel to shutdown if an error occurs.
10923    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10924        let _result = self.send_raw(result);
10925        if _result.is_err() {
10926            self.control_handle.shutdown();
10927        }
10928        self.drop_without_shutdown();
10929        _result
10930    }
10931
10932    /// Similar to "send" but does not shutdown the channel if an error occurs.
10933    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10934        let _result = self.send_raw(result);
10935        self.drop_without_shutdown();
10936        _result
10937    }
10938
10939    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10940        self.control_handle
10941            .inner
10942            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10943                result,
10944                self.tx_id,
10945                0x5ac5d459ad7f657e,
10946                fidl::encoding::DynamicFlags::empty(),
10947            )
10948    }
10949}
10950
10951#[must_use = "FIDL methods require a response to be sent"]
10952#[derive(Debug)]
10953pub struct FileQueryResponder {
10954    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10955    tx_id: u32,
10956}
10957
10958/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10959/// if the responder is dropped without sending a response, so that the client
10960/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10961impl std::ops::Drop for FileQueryResponder {
10962    fn drop(&mut self) {
10963        self.control_handle.shutdown();
10964        // Safety: drops once, never accessed again
10965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10966    }
10967}
10968
10969impl fidl::endpoints::Responder for FileQueryResponder {
10970    type ControlHandle = FileControlHandle;
10971
10972    fn control_handle(&self) -> &FileControlHandle {
10973        &self.control_handle
10974    }
10975
10976    fn drop_without_shutdown(mut self) {
10977        // Safety: drops once, never accessed again due to mem::forget
10978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10979        // Prevent Drop from running (which would shut down the channel)
10980        std::mem::forget(self);
10981    }
10982}
10983
10984impl FileQueryResponder {
10985    /// Sends a response to the FIDL transaction.
10986    ///
10987    /// Sets the channel to shutdown if an error occurs.
10988    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10989        let _result = self.send_raw(protocol);
10990        if _result.is_err() {
10991            self.control_handle.shutdown();
10992        }
10993        self.drop_without_shutdown();
10994        _result
10995    }
10996
10997    /// Similar to "send" but does not shutdown the channel if an error occurs.
10998    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10999        let _result = self.send_raw(protocol);
11000        self.drop_without_shutdown();
11001        _result
11002    }
11003
11004    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
11005        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
11006            (protocol,),
11007            self.tx_id,
11008            0x2658edee9decfc06,
11009            fidl::encoding::DynamicFlags::empty(),
11010        )
11011    }
11012}
11013
11014#[must_use = "FIDL methods require a response to be sent"]
11015#[derive(Debug)]
11016pub struct FileDeprecatedGetAttrResponder {
11017    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11018    tx_id: u32,
11019}
11020
11021/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11022/// if the responder is dropped without sending a response, so that the client
11023/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11024impl std::ops::Drop for FileDeprecatedGetAttrResponder {
11025    fn drop(&mut self) {
11026        self.control_handle.shutdown();
11027        // Safety: drops once, never accessed again
11028        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11029    }
11030}
11031
11032impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
11033    type ControlHandle = FileControlHandle;
11034
11035    fn control_handle(&self) -> &FileControlHandle {
11036        &self.control_handle
11037    }
11038
11039    fn drop_without_shutdown(mut self) {
11040        // Safety: drops once, never accessed again due to mem::forget
11041        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11042        // Prevent Drop from running (which would shut down the channel)
11043        std::mem::forget(self);
11044    }
11045}
11046
11047impl FileDeprecatedGetAttrResponder {
11048    /// Sends a response to the FIDL transaction.
11049    ///
11050    /// Sets the channel to shutdown if an error occurs.
11051    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
11052        let _result = self.send_raw(s, attributes);
11053        if _result.is_err() {
11054            self.control_handle.shutdown();
11055        }
11056        self.drop_without_shutdown();
11057        _result
11058    }
11059
11060    /// Similar to "send" but does not shutdown the channel if an error occurs.
11061    pub fn send_no_shutdown_on_err(
11062        self,
11063        mut s: i32,
11064        mut attributes: &NodeAttributes,
11065    ) -> Result<(), fidl::Error> {
11066        let _result = self.send_raw(s, attributes);
11067        self.drop_without_shutdown();
11068        _result
11069    }
11070
11071    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
11072        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
11073            (s, attributes),
11074            self.tx_id,
11075            0x78985e216314dafd,
11076            fidl::encoding::DynamicFlags::empty(),
11077        )
11078    }
11079}
11080
11081#[must_use = "FIDL methods require a response to be sent"]
11082#[derive(Debug)]
11083pub struct FileDeprecatedSetAttrResponder {
11084    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11085    tx_id: u32,
11086}
11087
11088/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11089/// if the responder is dropped without sending a response, so that the client
11090/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11091impl std::ops::Drop for FileDeprecatedSetAttrResponder {
11092    fn drop(&mut self) {
11093        self.control_handle.shutdown();
11094        // Safety: drops once, never accessed again
11095        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11096    }
11097}
11098
11099impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
11100    type ControlHandle = FileControlHandle;
11101
11102    fn control_handle(&self) -> &FileControlHandle {
11103        &self.control_handle
11104    }
11105
11106    fn drop_without_shutdown(mut self) {
11107        // Safety: drops once, never accessed again due to mem::forget
11108        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11109        // Prevent Drop from running (which would shut down the channel)
11110        std::mem::forget(self);
11111    }
11112}
11113
11114impl FileDeprecatedSetAttrResponder {
11115    /// Sends a response to the FIDL transaction.
11116    ///
11117    /// Sets the channel to shutdown if an error occurs.
11118    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11119        let _result = self.send_raw(s);
11120        if _result.is_err() {
11121            self.control_handle.shutdown();
11122        }
11123        self.drop_without_shutdown();
11124        _result
11125    }
11126
11127    /// Similar to "send" but does not shutdown the channel if an error occurs.
11128    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11129        let _result = self.send_raw(s);
11130        self.drop_without_shutdown();
11131        _result
11132    }
11133
11134    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11135        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
11136            (s,),
11137            self.tx_id,
11138            0x4186c0f40d938f46,
11139            fidl::encoding::DynamicFlags::empty(),
11140        )
11141    }
11142}
11143
11144#[must_use = "FIDL methods require a response to be sent"]
11145#[derive(Debug)]
11146pub struct FileDeprecatedGetFlagsResponder {
11147    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11148    tx_id: u32,
11149}
11150
11151/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11152/// if the responder is dropped without sending a response, so that the client
11153/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11154impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
11155    fn drop(&mut self) {
11156        self.control_handle.shutdown();
11157        // Safety: drops once, never accessed again
11158        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11159    }
11160}
11161
11162impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
11163    type ControlHandle = FileControlHandle;
11164
11165    fn control_handle(&self) -> &FileControlHandle {
11166        &self.control_handle
11167    }
11168
11169    fn drop_without_shutdown(mut self) {
11170        // Safety: drops once, never accessed again due to mem::forget
11171        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11172        // Prevent Drop from running (which would shut down the channel)
11173        std::mem::forget(self);
11174    }
11175}
11176
11177impl FileDeprecatedGetFlagsResponder {
11178    /// Sends a response to the FIDL transaction.
11179    ///
11180    /// Sets the channel to shutdown if an error occurs.
11181    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11182        let _result = self.send_raw(s, flags);
11183        if _result.is_err() {
11184            self.control_handle.shutdown();
11185        }
11186        self.drop_without_shutdown();
11187        _result
11188    }
11189
11190    /// Similar to "send" but does not shutdown the channel if an error occurs.
11191    pub fn send_no_shutdown_on_err(
11192        self,
11193        mut s: i32,
11194        mut flags: OpenFlags,
11195    ) -> Result<(), fidl::Error> {
11196        let _result = self.send_raw(s, flags);
11197        self.drop_without_shutdown();
11198        _result
11199    }
11200
11201    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11202        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
11203            (s, flags),
11204            self.tx_id,
11205            0x5b88fffb8eda3aa1,
11206            fidl::encoding::DynamicFlags::empty(),
11207        )
11208    }
11209}
11210
11211#[must_use = "FIDL methods require a response to be sent"]
11212#[derive(Debug)]
11213pub struct FileDeprecatedSetFlagsResponder {
11214    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11215    tx_id: u32,
11216}
11217
11218/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11219/// if the responder is dropped without sending a response, so that the client
11220/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11221impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
11222    fn drop(&mut self) {
11223        self.control_handle.shutdown();
11224        // Safety: drops once, never accessed again
11225        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11226    }
11227}
11228
11229impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
11230    type ControlHandle = FileControlHandle;
11231
11232    fn control_handle(&self) -> &FileControlHandle {
11233        &self.control_handle
11234    }
11235
11236    fn drop_without_shutdown(mut self) {
11237        // Safety: drops once, never accessed again due to mem::forget
11238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11239        // Prevent Drop from running (which would shut down the channel)
11240        std::mem::forget(self);
11241    }
11242}
11243
11244impl FileDeprecatedSetFlagsResponder {
11245    /// Sends a response to the FIDL transaction.
11246    ///
11247    /// Sets the channel to shutdown if an error occurs.
11248    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11249        let _result = self.send_raw(s);
11250        if _result.is_err() {
11251            self.control_handle.shutdown();
11252        }
11253        self.drop_without_shutdown();
11254        _result
11255    }
11256
11257    /// Similar to "send" but does not shutdown the channel if an error occurs.
11258    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11259        let _result = self.send_raw(s);
11260        self.drop_without_shutdown();
11261        _result
11262    }
11263
11264    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11265        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11266            (s,),
11267            self.tx_id,
11268            0x5295b76c71fde733,
11269            fidl::encoding::DynamicFlags::empty(),
11270        )
11271    }
11272}
11273
11274#[must_use = "FIDL methods require a response to be sent"]
11275#[derive(Debug)]
11276pub struct FileGetFlagsResponder {
11277    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11278    tx_id: u32,
11279}
11280
11281/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11282/// if the responder is dropped without sending a response, so that the client
11283/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11284impl std::ops::Drop for FileGetFlagsResponder {
11285    fn drop(&mut self) {
11286        self.control_handle.shutdown();
11287        // Safety: drops once, never accessed again
11288        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11289    }
11290}
11291
11292impl fidl::endpoints::Responder for FileGetFlagsResponder {
11293    type ControlHandle = FileControlHandle;
11294
11295    fn control_handle(&self) -> &FileControlHandle {
11296        &self.control_handle
11297    }
11298
11299    fn drop_without_shutdown(mut self) {
11300        // Safety: drops once, never accessed again due to mem::forget
11301        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11302        // Prevent Drop from running (which would shut down the channel)
11303        std::mem::forget(self);
11304    }
11305}
11306
11307impl FileGetFlagsResponder {
11308    /// Sends a response to the FIDL transaction.
11309    ///
11310    /// Sets the channel to shutdown if an error occurs.
11311    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11312        let _result = self.send_raw(result);
11313        if _result.is_err() {
11314            self.control_handle.shutdown();
11315        }
11316        self.drop_without_shutdown();
11317        _result
11318    }
11319
11320    /// Similar to "send" but does not shutdown the channel if an error occurs.
11321    pub fn send_no_shutdown_on_err(
11322        self,
11323        mut result: Result<Flags, i32>,
11324    ) -> Result<(), fidl::Error> {
11325        let _result = self.send_raw(result);
11326        self.drop_without_shutdown();
11327        _result
11328    }
11329
11330    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11331        self.control_handle
11332            .inner
11333            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11334                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11335                self.tx_id,
11336                0x176eb318f64ec23,
11337                fidl::encoding::DynamicFlags::FLEXIBLE,
11338            )
11339    }
11340}
11341
11342#[must_use = "FIDL methods require a response to be sent"]
11343#[derive(Debug)]
11344pub struct FileSetFlagsResponder {
11345    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11346    tx_id: u32,
11347}
11348
11349/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11350/// if the responder is dropped without sending a response, so that the client
11351/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11352impl std::ops::Drop for FileSetFlagsResponder {
11353    fn drop(&mut self) {
11354        self.control_handle.shutdown();
11355        // Safety: drops once, never accessed again
11356        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11357    }
11358}
11359
11360impl fidl::endpoints::Responder for FileSetFlagsResponder {
11361    type ControlHandle = FileControlHandle;
11362
11363    fn control_handle(&self) -> &FileControlHandle {
11364        &self.control_handle
11365    }
11366
11367    fn drop_without_shutdown(mut self) {
11368        // Safety: drops once, never accessed again due to mem::forget
11369        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11370        // Prevent Drop from running (which would shut down the channel)
11371        std::mem::forget(self);
11372    }
11373}
11374
11375impl FileSetFlagsResponder {
11376    /// Sends a response to the FIDL transaction.
11377    ///
11378    /// Sets the channel to shutdown if an error occurs.
11379    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11380        let _result = self.send_raw(result);
11381        if _result.is_err() {
11382            self.control_handle.shutdown();
11383        }
11384        self.drop_without_shutdown();
11385        _result
11386    }
11387
11388    /// Similar to "send" but does not shutdown the channel if an error occurs.
11389    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11390        let _result = self.send_raw(result);
11391        self.drop_without_shutdown();
11392        _result
11393    }
11394
11395    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11396        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11397            fidl::encoding::EmptyStruct,
11398            i32,
11399        >>(
11400            fidl::encoding::FlexibleResult::new(result),
11401            self.tx_id,
11402            0x55a8028685791ea8,
11403            fidl::encoding::DynamicFlags::FLEXIBLE,
11404        )
11405    }
11406}
11407
11408#[must_use = "FIDL methods require a response to be sent"]
11409#[derive(Debug)]
11410pub struct FileQueryFilesystemResponder {
11411    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11412    tx_id: u32,
11413}
11414
11415/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11416/// if the responder is dropped without sending a response, so that the client
11417/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11418impl std::ops::Drop for FileQueryFilesystemResponder {
11419    fn drop(&mut self) {
11420        self.control_handle.shutdown();
11421        // Safety: drops once, never accessed again
11422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11423    }
11424}
11425
11426impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11427    type ControlHandle = FileControlHandle;
11428
11429    fn control_handle(&self) -> &FileControlHandle {
11430        &self.control_handle
11431    }
11432
11433    fn drop_without_shutdown(mut self) {
11434        // Safety: drops once, never accessed again due to mem::forget
11435        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11436        // Prevent Drop from running (which would shut down the channel)
11437        std::mem::forget(self);
11438    }
11439}
11440
11441impl FileQueryFilesystemResponder {
11442    /// Sends a response to the FIDL transaction.
11443    ///
11444    /// Sets the channel to shutdown if an error occurs.
11445    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11446        let _result = self.send_raw(s, info);
11447        if _result.is_err() {
11448            self.control_handle.shutdown();
11449        }
11450        self.drop_without_shutdown();
11451        _result
11452    }
11453
11454    /// Similar to "send" but does not shutdown the channel if an error occurs.
11455    pub fn send_no_shutdown_on_err(
11456        self,
11457        mut s: i32,
11458        mut info: Option<&FilesystemInfo>,
11459    ) -> Result<(), fidl::Error> {
11460        let _result = self.send_raw(s, info);
11461        self.drop_without_shutdown();
11462        _result
11463    }
11464
11465    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11466        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11467            (s, info),
11468            self.tx_id,
11469            0x6f344a1c6b0a0610,
11470            fidl::encoding::DynamicFlags::empty(),
11471        )
11472    }
11473}
11474
11475#[must_use = "FIDL methods require a response to be sent"]
11476#[derive(Debug)]
11477pub struct FileGetTokenResponder {
11478    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11479    tx_id: u32,
11480}
11481
11482/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11483/// if the responder is dropped without sending a response, so that the client
11484/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11485impl std::ops::Drop for FileGetTokenResponder {
11486    fn drop(&mut self) {
11487        self.control_handle.shutdown();
11488        // Safety: drops once, never accessed again
11489        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11490    }
11491}
11492
11493impl fidl::endpoints::Responder for FileGetTokenResponder {
11494    type ControlHandle = FileControlHandle;
11495
11496    fn control_handle(&self) -> &FileControlHandle {
11497        &self.control_handle
11498    }
11499
11500    fn drop_without_shutdown(mut self) {
11501        // Safety: drops once, never accessed again due to mem::forget
11502        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11503        // Prevent Drop from running (which would shut down the channel)
11504        std::mem::forget(self);
11505    }
11506}
11507
11508impl FileGetTokenResponder {
11509    /// Sends a response to the FIDL transaction.
11510    ///
11511    /// Sets the channel to shutdown if an error occurs.
11512    pub fn send(self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
11513        let _result = self.send_raw(result);
11514        if _result.is_err() {
11515            self.control_handle.shutdown();
11516        }
11517        self.drop_without_shutdown();
11518        _result
11519    }
11520
11521    /// Similar to "send" but does not shutdown the channel if an error occurs.
11522    pub fn send_no_shutdown_on_err(
11523        self,
11524        mut result: Result<fidl::Event, i32>,
11525    ) -> Result<(), fidl::Error> {
11526        let _result = self.send_raw(result);
11527        self.drop_without_shutdown();
11528        _result
11529    }
11530
11531    fn send_raw(&self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
11532        self.control_handle
11533            .inner
11534            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
11535                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
11536                self.tx_id,
11537                0x5054f0ade7076cec,
11538                fidl::encoding::DynamicFlags::FLEXIBLE,
11539            )
11540    }
11541}
11542
11543#[must_use = "FIDL methods require a response to be sent"]
11544#[derive(Debug)]
11545pub struct FileGetAttributesResponder {
11546    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11547    tx_id: u32,
11548}
11549
11550/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11551/// if the responder is dropped without sending a response, so that the client
11552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11553impl std::ops::Drop for FileGetAttributesResponder {
11554    fn drop(&mut self) {
11555        self.control_handle.shutdown();
11556        // Safety: drops once, never accessed again
11557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11558    }
11559}
11560
11561impl fidl::endpoints::Responder for FileGetAttributesResponder {
11562    type ControlHandle = FileControlHandle;
11563
11564    fn control_handle(&self) -> &FileControlHandle {
11565        &self.control_handle
11566    }
11567
11568    fn drop_without_shutdown(mut self) {
11569        // Safety: drops once, never accessed again due to mem::forget
11570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11571        // Prevent Drop from running (which would shut down the channel)
11572        std::mem::forget(self);
11573    }
11574}
11575
11576impl FileGetAttributesResponder {
11577    /// Sends a response to the FIDL transaction.
11578    ///
11579    /// Sets the channel to shutdown if an error occurs.
11580    pub fn send(
11581        self,
11582        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11583    ) -> Result<(), fidl::Error> {
11584        let _result = self.send_raw(result);
11585        if _result.is_err() {
11586            self.control_handle.shutdown();
11587        }
11588        self.drop_without_shutdown();
11589        _result
11590    }
11591
11592    /// Similar to "send" but does not shutdown the channel if an error occurs.
11593    pub fn send_no_shutdown_on_err(
11594        self,
11595        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11596    ) -> Result<(), fidl::Error> {
11597        let _result = self.send_raw(result);
11598        self.drop_without_shutdown();
11599        _result
11600    }
11601
11602    fn send_raw(
11603        &self,
11604        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11605    ) -> Result<(), fidl::Error> {
11606        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11607            result,
11608            self.tx_id,
11609            0x3d4396a638ea053b,
11610            fidl::encoding::DynamicFlags::empty(),
11611        )
11612    }
11613}
11614
11615#[must_use = "FIDL methods require a response to be sent"]
11616#[derive(Debug)]
11617pub struct FileUpdateAttributesResponder {
11618    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11619    tx_id: u32,
11620}
11621
11622/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11623/// if the responder is dropped without sending a response, so that the client
11624/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11625impl std::ops::Drop for FileUpdateAttributesResponder {
11626    fn drop(&mut self) {
11627        self.control_handle.shutdown();
11628        // Safety: drops once, never accessed again
11629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11630    }
11631}
11632
11633impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11634    type ControlHandle = FileControlHandle;
11635
11636    fn control_handle(&self) -> &FileControlHandle {
11637        &self.control_handle
11638    }
11639
11640    fn drop_without_shutdown(mut self) {
11641        // Safety: drops once, never accessed again due to mem::forget
11642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11643        // Prevent Drop from running (which would shut down the channel)
11644        std::mem::forget(self);
11645    }
11646}
11647
11648impl FileUpdateAttributesResponder {
11649    /// Sends a response to the FIDL transaction.
11650    ///
11651    /// Sets the channel to shutdown if an error occurs.
11652    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11653        let _result = self.send_raw(result);
11654        if _result.is_err() {
11655            self.control_handle.shutdown();
11656        }
11657        self.drop_without_shutdown();
11658        _result
11659    }
11660
11661    /// Similar to "send" but does not shutdown the channel if an error occurs.
11662    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11663        let _result = self.send_raw(result);
11664        self.drop_without_shutdown();
11665        _result
11666    }
11667
11668    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11669        self.control_handle
11670            .inner
11671            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11672                result,
11673                self.tx_id,
11674                0x3308c1da5a89bf08,
11675                fidl::encoding::DynamicFlags::empty(),
11676            )
11677    }
11678}
11679
11680#[must_use = "FIDL methods require a response to be sent"]
11681#[derive(Debug)]
11682pub struct FileSyncResponder {
11683    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11684    tx_id: u32,
11685}
11686
11687/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11688/// if the responder is dropped without sending a response, so that the client
11689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11690impl std::ops::Drop for FileSyncResponder {
11691    fn drop(&mut self) {
11692        self.control_handle.shutdown();
11693        // Safety: drops once, never accessed again
11694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11695    }
11696}
11697
11698impl fidl::endpoints::Responder for FileSyncResponder {
11699    type ControlHandle = FileControlHandle;
11700
11701    fn control_handle(&self) -> &FileControlHandle {
11702        &self.control_handle
11703    }
11704
11705    fn drop_without_shutdown(mut self) {
11706        // Safety: drops once, never accessed again due to mem::forget
11707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11708        // Prevent Drop from running (which would shut down the channel)
11709        std::mem::forget(self);
11710    }
11711}
11712
11713impl FileSyncResponder {
11714    /// Sends a response to the FIDL transaction.
11715    ///
11716    /// Sets the channel to shutdown if an error occurs.
11717    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11718        let _result = self.send_raw(result);
11719        if _result.is_err() {
11720            self.control_handle.shutdown();
11721        }
11722        self.drop_without_shutdown();
11723        _result
11724    }
11725
11726    /// Similar to "send" but does not shutdown the channel if an error occurs.
11727    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11728        let _result = self.send_raw(result);
11729        self.drop_without_shutdown();
11730        _result
11731    }
11732
11733    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11734        self.control_handle
11735            .inner
11736            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11737                result,
11738                self.tx_id,
11739                0x2c5c27ca0ab5dc49,
11740                fidl::encoding::DynamicFlags::empty(),
11741            )
11742    }
11743}
11744
11745#[must_use = "FIDL methods require a response to be sent"]
11746#[derive(Debug)]
11747pub struct FileGetExtendedAttributeResponder {
11748    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11749    tx_id: u32,
11750}
11751
11752/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11753/// if the responder is dropped without sending a response, so that the client
11754/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11755impl std::ops::Drop for FileGetExtendedAttributeResponder {
11756    fn drop(&mut self) {
11757        self.control_handle.shutdown();
11758        // Safety: drops once, never accessed again
11759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11760    }
11761}
11762
11763impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11764    type ControlHandle = FileControlHandle;
11765
11766    fn control_handle(&self) -> &FileControlHandle {
11767        &self.control_handle
11768    }
11769
11770    fn drop_without_shutdown(mut self) {
11771        // Safety: drops once, never accessed again due to mem::forget
11772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11773        // Prevent Drop from running (which would shut down the channel)
11774        std::mem::forget(self);
11775    }
11776}
11777
11778impl FileGetExtendedAttributeResponder {
11779    /// Sends a response to the FIDL transaction.
11780    ///
11781    /// Sets the channel to shutdown if an error occurs.
11782    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11783        let _result = self.send_raw(result);
11784        if _result.is_err() {
11785            self.control_handle.shutdown();
11786        }
11787        self.drop_without_shutdown();
11788        _result
11789    }
11790
11791    /// Similar to "send" but does not shutdown the channel if an error occurs.
11792    pub fn send_no_shutdown_on_err(
11793        self,
11794        mut result: Result<ExtendedAttributeValue, i32>,
11795    ) -> Result<(), fidl::Error> {
11796        let _result = self.send_raw(result);
11797        self.drop_without_shutdown();
11798        _result
11799    }
11800
11801    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11802        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11803            result.as_mut().map_err(|e| *e),
11804            self.tx_id,
11805            0x45ffa3ccfdeb76db,
11806            fidl::encoding::DynamicFlags::empty(),
11807        )
11808    }
11809}
11810
11811#[must_use = "FIDL methods require a response to be sent"]
11812#[derive(Debug)]
11813pub struct FileSetExtendedAttributeResponder {
11814    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11815    tx_id: u32,
11816}
11817
11818/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11819/// if the responder is dropped without sending a response, so that the client
11820/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11821impl std::ops::Drop for FileSetExtendedAttributeResponder {
11822    fn drop(&mut self) {
11823        self.control_handle.shutdown();
11824        // Safety: drops once, never accessed again
11825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11826    }
11827}
11828
11829impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11830    type ControlHandle = FileControlHandle;
11831
11832    fn control_handle(&self) -> &FileControlHandle {
11833        &self.control_handle
11834    }
11835
11836    fn drop_without_shutdown(mut self) {
11837        // Safety: drops once, never accessed again due to mem::forget
11838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11839        // Prevent Drop from running (which would shut down the channel)
11840        std::mem::forget(self);
11841    }
11842}
11843
11844impl FileSetExtendedAttributeResponder {
11845    /// Sends a response to the FIDL transaction.
11846    ///
11847    /// Sets the channel to shutdown if an error occurs.
11848    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11849        let _result = self.send_raw(result);
11850        if _result.is_err() {
11851            self.control_handle.shutdown();
11852        }
11853        self.drop_without_shutdown();
11854        _result
11855    }
11856
11857    /// Similar to "send" but does not shutdown the channel if an error occurs.
11858    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11859        let _result = self.send_raw(result);
11860        self.drop_without_shutdown();
11861        _result
11862    }
11863
11864    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11865        self.control_handle
11866            .inner
11867            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11868                result,
11869                self.tx_id,
11870                0x4a951362f681f23c,
11871                fidl::encoding::DynamicFlags::empty(),
11872            )
11873    }
11874}
11875
11876#[must_use = "FIDL methods require a response to be sent"]
11877#[derive(Debug)]
11878pub struct FileRemoveExtendedAttributeResponder {
11879    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11880    tx_id: u32,
11881}
11882
11883/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11884/// if the responder is dropped without sending a response, so that the client
11885/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11886impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11887    fn drop(&mut self) {
11888        self.control_handle.shutdown();
11889        // Safety: drops once, never accessed again
11890        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11891    }
11892}
11893
11894impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11895    type ControlHandle = FileControlHandle;
11896
11897    fn control_handle(&self) -> &FileControlHandle {
11898        &self.control_handle
11899    }
11900
11901    fn drop_without_shutdown(mut self) {
11902        // Safety: drops once, never accessed again due to mem::forget
11903        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11904        // Prevent Drop from running (which would shut down the channel)
11905        std::mem::forget(self);
11906    }
11907}
11908
11909impl FileRemoveExtendedAttributeResponder {
11910    /// Sends a response to the FIDL transaction.
11911    ///
11912    /// Sets the channel to shutdown if an error occurs.
11913    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11914        let _result = self.send_raw(result);
11915        if _result.is_err() {
11916            self.control_handle.shutdown();
11917        }
11918        self.drop_without_shutdown();
11919        _result
11920    }
11921
11922    /// Similar to "send" but does not shutdown the channel if an error occurs.
11923    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11924        let _result = self.send_raw(result);
11925        self.drop_without_shutdown();
11926        _result
11927    }
11928
11929    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11930        self.control_handle
11931            .inner
11932            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11933                result,
11934                self.tx_id,
11935                0x7a0b9f3a9bf9032d,
11936                fidl::encoding::DynamicFlags::empty(),
11937            )
11938    }
11939}
11940
11941#[must_use = "FIDL methods require a response to be sent"]
11942#[derive(Debug)]
11943pub struct FileReadResponder {
11944    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11945    tx_id: u32,
11946}
11947
11948/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11949/// if the responder is dropped without sending a response, so that the client
11950/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11951impl std::ops::Drop for FileReadResponder {
11952    fn drop(&mut self) {
11953        self.control_handle.shutdown();
11954        // Safety: drops once, never accessed again
11955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11956    }
11957}
11958
11959impl fidl::endpoints::Responder for FileReadResponder {
11960    type ControlHandle = FileControlHandle;
11961
11962    fn control_handle(&self) -> &FileControlHandle {
11963        &self.control_handle
11964    }
11965
11966    fn drop_without_shutdown(mut self) {
11967        // Safety: drops once, never accessed again due to mem::forget
11968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11969        // Prevent Drop from running (which would shut down the channel)
11970        std::mem::forget(self);
11971    }
11972}
11973
11974impl FileReadResponder {
11975    /// Sends a response to the FIDL transaction.
11976    ///
11977    /// Sets the channel to shutdown if an error occurs.
11978    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11979        let _result = self.send_raw(result);
11980        if _result.is_err() {
11981            self.control_handle.shutdown();
11982        }
11983        self.drop_without_shutdown();
11984        _result
11985    }
11986
11987    /// Similar to "send" but does not shutdown the channel if an error occurs.
11988    pub fn send_no_shutdown_on_err(
11989        self,
11990        mut result: Result<&[u8], i32>,
11991    ) -> Result<(), fidl::Error> {
11992        let _result = self.send_raw(result);
11993        self.drop_without_shutdown();
11994        _result
11995    }
11996
11997    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11998        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11999            result.map(|data| (data,)),
12000            self.tx_id,
12001            0x57e419a298c8ede,
12002            fidl::encoding::DynamicFlags::empty(),
12003        )
12004    }
12005}
12006
12007#[must_use = "FIDL methods require a response to be sent"]
12008#[derive(Debug)]
12009pub struct FileWriteResponder {
12010    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12011    tx_id: u32,
12012}
12013
12014/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12015/// if the responder is dropped without sending a response, so that the client
12016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12017impl std::ops::Drop for FileWriteResponder {
12018    fn drop(&mut self) {
12019        self.control_handle.shutdown();
12020        // Safety: drops once, never accessed again
12021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12022    }
12023}
12024
12025impl fidl::endpoints::Responder for FileWriteResponder {
12026    type ControlHandle = FileControlHandle;
12027
12028    fn control_handle(&self) -> &FileControlHandle {
12029        &self.control_handle
12030    }
12031
12032    fn drop_without_shutdown(mut self) {
12033        // Safety: drops once, never accessed again due to mem::forget
12034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12035        // Prevent Drop from running (which would shut down the channel)
12036        std::mem::forget(self);
12037    }
12038}
12039
12040impl FileWriteResponder {
12041    /// Sends a response to the FIDL transaction.
12042    ///
12043    /// Sets the channel to shutdown if an error occurs.
12044    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12045        let _result = self.send_raw(result);
12046        if _result.is_err() {
12047            self.control_handle.shutdown();
12048        }
12049        self.drop_without_shutdown();
12050        _result
12051    }
12052
12053    /// Similar to "send" but does not shutdown the channel if an error occurs.
12054    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12055        let _result = self.send_raw(result);
12056        self.drop_without_shutdown();
12057        _result
12058    }
12059
12060    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12061        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
12062            result.map(|actual_count| (actual_count,)),
12063            self.tx_id,
12064            0x6a31437832469f82,
12065            fidl::encoding::DynamicFlags::empty(),
12066        )
12067    }
12068}
12069
12070#[must_use = "FIDL methods require a response to be sent"]
12071#[derive(Debug)]
12072pub struct FileDescribeResponder {
12073    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12074    tx_id: u32,
12075}
12076
12077/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12078/// if the responder is dropped without sending a response, so that the client
12079/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12080impl std::ops::Drop for FileDescribeResponder {
12081    fn drop(&mut self) {
12082        self.control_handle.shutdown();
12083        // Safety: drops once, never accessed again
12084        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12085    }
12086}
12087
12088impl fidl::endpoints::Responder for FileDescribeResponder {
12089    type ControlHandle = FileControlHandle;
12090
12091    fn control_handle(&self) -> &FileControlHandle {
12092        &self.control_handle
12093    }
12094
12095    fn drop_without_shutdown(mut self) {
12096        // Safety: drops once, never accessed again due to mem::forget
12097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12098        // Prevent Drop from running (which would shut down the channel)
12099        std::mem::forget(self);
12100    }
12101}
12102
12103impl FileDescribeResponder {
12104    /// Sends a response to the FIDL transaction.
12105    ///
12106    /// Sets the channel to shutdown if an error occurs.
12107    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
12108        let _result = self.send_raw(payload);
12109        if _result.is_err() {
12110            self.control_handle.shutdown();
12111        }
12112        self.drop_without_shutdown();
12113        _result
12114    }
12115
12116    /// Similar to "send" but does not shutdown the channel if an error occurs.
12117    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
12118        let _result = self.send_raw(payload);
12119        self.drop_without_shutdown();
12120        _result
12121    }
12122
12123    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
12124        self.control_handle.inner.send::<FileInfo>(
12125            &mut payload,
12126            self.tx_id,
12127            0x68b5ac00c62906bc,
12128            fidl::encoding::DynamicFlags::empty(),
12129        )
12130    }
12131}
12132
12133#[must_use = "FIDL methods require a response to be sent"]
12134#[derive(Debug)]
12135pub struct FileSeekResponder {
12136    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12137    tx_id: u32,
12138}
12139
12140/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12141/// if the responder is dropped without sending a response, so that the client
12142/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12143impl std::ops::Drop for FileSeekResponder {
12144    fn drop(&mut self) {
12145        self.control_handle.shutdown();
12146        // Safety: drops once, never accessed again
12147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12148    }
12149}
12150
12151impl fidl::endpoints::Responder for FileSeekResponder {
12152    type ControlHandle = FileControlHandle;
12153
12154    fn control_handle(&self) -> &FileControlHandle {
12155        &self.control_handle
12156    }
12157
12158    fn drop_without_shutdown(mut self) {
12159        // Safety: drops once, never accessed again due to mem::forget
12160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12161        // Prevent Drop from running (which would shut down the channel)
12162        std::mem::forget(self);
12163    }
12164}
12165
12166impl FileSeekResponder {
12167    /// Sends a response to the FIDL transaction.
12168    ///
12169    /// Sets the channel to shutdown if an error occurs.
12170    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12171        let _result = self.send_raw(result);
12172        if _result.is_err() {
12173            self.control_handle.shutdown();
12174        }
12175        self.drop_without_shutdown();
12176        _result
12177    }
12178
12179    /// Similar to "send" but does not shutdown the channel if an error occurs.
12180    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12181        let _result = self.send_raw(result);
12182        self.drop_without_shutdown();
12183        _result
12184    }
12185
12186    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12187        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
12188            result.map(|offset_from_start| (offset_from_start,)),
12189            self.tx_id,
12190            0x78079168162c5207,
12191            fidl::encoding::DynamicFlags::empty(),
12192        )
12193    }
12194}
12195
12196#[must_use = "FIDL methods require a response to be sent"]
12197#[derive(Debug)]
12198pub struct FileReadAtResponder {
12199    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12200    tx_id: u32,
12201}
12202
12203/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12204/// if the responder is dropped without sending a response, so that the client
12205/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12206impl std::ops::Drop for FileReadAtResponder {
12207    fn drop(&mut self) {
12208        self.control_handle.shutdown();
12209        // Safety: drops once, never accessed again
12210        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12211    }
12212}
12213
12214impl fidl::endpoints::Responder for FileReadAtResponder {
12215    type ControlHandle = FileControlHandle;
12216
12217    fn control_handle(&self) -> &FileControlHandle {
12218        &self.control_handle
12219    }
12220
12221    fn drop_without_shutdown(mut self) {
12222        // Safety: drops once, never accessed again due to mem::forget
12223        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12224        // Prevent Drop from running (which would shut down the channel)
12225        std::mem::forget(self);
12226    }
12227}
12228
12229impl FileReadAtResponder {
12230    /// Sends a response to the FIDL transaction.
12231    ///
12232    /// Sets the channel to shutdown if an error occurs.
12233    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12234        let _result = self.send_raw(result);
12235        if _result.is_err() {
12236            self.control_handle.shutdown();
12237        }
12238        self.drop_without_shutdown();
12239        _result
12240    }
12241
12242    /// Similar to "send" but does not shutdown the channel if an error occurs.
12243    pub fn send_no_shutdown_on_err(
12244        self,
12245        mut result: Result<&[u8], i32>,
12246    ) -> Result<(), fidl::Error> {
12247        let _result = self.send_raw(result);
12248        self.drop_without_shutdown();
12249        _result
12250    }
12251
12252    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12253        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
12254            result.map(|data| (data,)),
12255            self.tx_id,
12256            0x1607a293a60d723e,
12257            fidl::encoding::DynamicFlags::empty(),
12258        )
12259    }
12260}
12261
12262#[must_use = "FIDL methods require a response to be sent"]
12263#[derive(Debug)]
12264pub struct FileWriteAtResponder {
12265    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12266    tx_id: u32,
12267}
12268
12269/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12270/// if the responder is dropped without sending a response, so that the client
12271/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12272impl std::ops::Drop for FileWriteAtResponder {
12273    fn drop(&mut self) {
12274        self.control_handle.shutdown();
12275        // Safety: drops once, never accessed again
12276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12277    }
12278}
12279
12280impl fidl::endpoints::Responder for FileWriteAtResponder {
12281    type ControlHandle = FileControlHandle;
12282
12283    fn control_handle(&self) -> &FileControlHandle {
12284        &self.control_handle
12285    }
12286
12287    fn drop_without_shutdown(mut self) {
12288        // Safety: drops once, never accessed again due to mem::forget
12289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12290        // Prevent Drop from running (which would shut down the channel)
12291        std::mem::forget(self);
12292    }
12293}
12294
12295impl FileWriteAtResponder {
12296    /// Sends a response to the FIDL transaction.
12297    ///
12298    /// Sets the channel to shutdown if an error occurs.
12299    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12300        let _result = self.send_raw(result);
12301        if _result.is_err() {
12302            self.control_handle.shutdown();
12303        }
12304        self.drop_without_shutdown();
12305        _result
12306    }
12307
12308    /// Similar to "send" but does not shutdown the channel if an error occurs.
12309    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12310        let _result = self.send_raw(result);
12311        self.drop_without_shutdown();
12312        _result
12313    }
12314
12315    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12316        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
12317            result.map(|actual_count| (actual_count,)),
12318            self.tx_id,
12319            0x793eefc0045e792b,
12320            fidl::encoding::DynamicFlags::empty(),
12321        )
12322    }
12323}
12324
12325#[must_use = "FIDL methods require a response to be sent"]
12326#[derive(Debug)]
12327pub struct FileResizeResponder {
12328    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12329    tx_id: u32,
12330}
12331
12332/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12333/// if the responder is dropped without sending a response, so that the client
12334/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12335impl std::ops::Drop for FileResizeResponder {
12336    fn drop(&mut self) {
12337        self.control_handle.shutdown();
12338        // Safety: drops once, never accessed again
12339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12340    }
12341}
12342
12343impl fidl::endpoints::Responder for FileResizeResponder {
12344    type ControlHandle = FileControlHandle;
12345
12346    fn control_handle(&self) -> &FileControlHandle {
12347        &self.control_handle
12348    }
12349
12350    fn drop_without_shutdown(mut self) {
12351        // Safety: drops once, never accessed again due to mem::forget
12352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12353        // Prevent Drop from running (which would shut down the channel)
12354        std::mem::forget(self);
12355    }
12356}
12357
12358impl FileResizeResponder {
12359    /// Sends a response to the FIDL transaction.
12360    ///
12361    /// Sets the channel to shutdown if an error occurs.
12362    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12363        let _result = self.send_raw(result);
12364        if _result.is_err() {
12365            self.control_handle.shutdown();
12366        }
12367        self.drop_without_shutdown();
12368        _result
12369    }
12370
12371    /// Similar to "send" but does not shutdown the channel if an error occurs.
12372    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12373        let _result = self.send_raw(result);
12374        self.drop_without_shutdown();
12375        _result
12376    }
12377
12378    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12379        self.control_handle
12380            .inner
12381            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12382                result,
12383                self.tx_id,
12384                0x2b80825f0535743a,
12385                fidl::encoding::DynamicFlags::empty(),
12386            )
12387    }
12388}
12389
12390#[must_use = "FIDL methods require a response to be sent"]
12391#[derive(Debug)]
12392pub struct FileGetBackingMemoryResponder {
12393    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12394    tx_id: u32,
12395}
12396
12397/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12398/// if the responder is dropped without sending a response, so that the client
12399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12400impl std::ops::Drop for FileGetBackingMemoryResponder {
12401    fn drop(&mut self) {
12402        self.control_handle.shutdown();
12403        // Safety: drops once, never accessed again
12404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12405    }
12406}
12407
12408impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12409    type ControlHandle = FileControlHandle;
12410
12411    fn control_handle(&self) -> &FileControlHandle {
12412        &self.control_handle
12413    }
12414
12415    fn drop_without_shutdown(mut self) {
12416        // Safety: drops once, never accessed again due to mem::forget
12417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12418        // Prevent Drop from running (which would shut down the channel)
12419        std::mem::forget(self);
12420    }
12421}
12422
12423impl FileGetBackingMemoryResponder {
12424    /// Sends a response to the FIDL transaction.
12425    ///
12426    /// Sets the channel to shutdown if an error occurs.
12427    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12428        let _result = self.send_raw(result);
12429        if _result.is_err() {
12430            self.control_handle.shutdown();
12431        }
12432        self.drop_without_shutdown();
12433        _result
12434    }
12435
12436    /// Similar to "send" but does not shutdown the channel if an error occurs.
12437    pub fn send_no_shutdown_on_err(
12438        self,
12439        mut result: Result<fidl::Vmo, i32>,
12440    ) -> Result<(), fidl::Error> {
12441        let _result = self.send_raw(result);
12442        self.drop_without_shutdown();
12443        _result
12444    }
12445
12446    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12447        self.control_handle
12448            .inner
12449            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12450                result.map(|vmo| (vmo,)),
12451                self.tx_id,
12452                0xa6a9e654cbf62b,
12453                fidl::encoding::DynamicFlags::empty(),
12454            )
12455    }
12456}
12457
12458#[must_use = "FIDL methods require a response to be sent"]
12459#[derive(Debug)]
12460pub struct FileAllocateResponder {
12461    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12462    tx_id: u32,
12463}
12464
12465/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12466/// if the responder is dropped without sending a response, so that the client
12467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12468impl std::ops::Drop for FileAllocateResponder {
12469    fn drop(&mut self) {
12470        self.control_handle.shutdown();
12471        // Safety: drops once, never accessed again
12472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12473    }
12474}
12475
12476impl fidl::endpoints::Responder for FileAllocateResponder {
12477    type ControlHandle = FileControlHandle;
12478
12479    fn control_handle(&self) -> &FileControlHandle {
12480        &self.control_handle
12481    }
12482
12483    fn drop_without_shutdown(mut self) {
12484        // Safety: drops once, never accessed again due to mem::forget
12485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12486        // Prevent Drop from running (which would shut down the channel)
12487        std::mem::forget(self);
12488    }
12489}
12490
12491impl FileAllocateResponder {
12492    /// Sends a response to the FIDL transaction.
12493    ///
12494    /// Sets the channel to shutdown if an error occurs.
12495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12496        let _result = self.send_raw(result);
12497        if _result.is_err() {
12498            self.control_handle.shutdown();
12499        }
12500        self.drop_without_shutdown();
12501        _result
12502    }
12503
12504    /// Similar to "send" but does not shutdown the channel if an error occurs.
12505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12506        let _result = self.send_raw(result);
12507        self.drop_without_shutdown();
12508        _result
12509    }
12510
12511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12512        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12513            fidl::encoding::EmptyStruct,
12514            i32,
12515        >>(
12516            fidl::encoding::FlexibleResult::new(result),
12517            self.tx_id,
12518            0x77fa0c330b57fd2e,
12519            fidl::encoding::DynamicFlags::FLEXIBLE,
12520        )
12521    }
12522}
12523
12524#[must_use = "FIDL methods require a response to be sent"]
12525#[derive(Debug)]
12526pub struct FileEnableVerityResponder {
12527    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12528    tx_id: u32,
12529}
12530
12531/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12532/// if the responder is dropped without sending a response, so that the client
12533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12534impl std::ops::Drop for FileEnableVerityResponder {
12535    fn drop(&mut self) {
12536        self.control_handle.shutdown();
12537        // Safety: drops once, never accessed again
12538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12539    }
12540}
12541
12542impl fidl::endpoints::Responder for FileEnableVerityResponder {
12543    type ControlHandle = FileControlHandle;
12544
12545    fn control_handle(&self) -> &FileControlHandle {
12546        &self.control_handle
12547    }
12548
12549    fn drop_without_shutdown(mut self) {
12550        // Safety: drops once, never accessed again due to mem::forget
12551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12552        // Prevent Drop from running (which would shut down the channel)
12553        std::mem::forget(self);
12554    }
12555}
12556
12557impl FileEnableVerityResponder {
12558    /// Sends a response to the FIDL transaction.
12559    ///
12560    /// Sets the channel to shutdown if an error occurs.
12561    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12562        let _result = self.send_raw(result);
12563        if _result.is_err() {
12564            self.control_handle.shutdown();
12565        }
12566        self.drop_without_shutdown();
12567        _result
12568    }
12569
12570    /// Similar to "send" but does not shutdown the channel if an error occurs.
12571    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12572        let _result = self.send_raw(result);
12573        self.drop_without_shutdown();
12574        _result
12575    }
12576
12577    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12578        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12579            fidl::encoding::EmptyStruct,
12580            i32,
12581        >>(
12582            fidl::encoding::FlexibleResult::new(result),
12583            self.tx_id,
12584            0x2c421ec3faaeb8bb,
12585            fidl::encoding::DynamicFlags::FLEXIBLE,
12586        )
12587    }
12588}
12589
12590#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12591pub struct LinkableMarker;
12592
12593impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12594    type Proxy = LinkableProxy;
12595    type RequestStream = LinkableRequestStream;
12596    #[cfg(target_os = "fuchsia")]
12597    type SynchronousProxy = LinkableSynchronousProxy;
12598
12599    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12600}
12601pub type LinkableLinkIntoResult = Result<(), i32>;
12602
12603pub trait LinkableProxyInterface: Send + Sync {
12604    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12605        + Send;
12606    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12607}
12608#[derive(Debug)]
12609#[cfg(target_os = "fuchsia")]
12610pub struct LinkableSynchronousProxy {
12611    client: fidl::client::sync::Client,
12612}
12613
12614#[cfg(target_os = "fuchsia")]
12615impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12616    type Proxy = LinkableProxy;
12617    type Protocol = LinkableMarker;
12618
12619    fn from_channel(inner: fidl::Channel) -> Self {
12620        Self::new(inner)
12621    }
12622
12623    fn into_channel(self) -> fidl::Channel {
12624        self.client.into_channel()
12625    }
12626
12627    fn as_channel(&self) -> &fidl::Channel {
12628        self.client.as_channel()
12629    }
12630}
12631
12632#[cfg(target_os = "fuchsia")]
12633impl LinkableSynchronousProxy {
12634    pub fn new(channel: fidl::Channel) -> Self {
12635        Self { client: fidl::client::sync::Client::new(channel) }
12636    }
12637
12638    pub fn into_channel(self) -> fidl::Channel {
12639        self.client.into_channel()
12640    }
12641
12642    /// Waits until an event arrives and returns it. It is safe for other
12643    /// threads to make concurrent requests while waiting for an event.
12644    pub fn wait_for_event(
12645        &self,
12646        deadline: zx::MonotonicInstant,
12647    ) -> Result<LinkableEvent, fidl::Error> {
12648        LinkableEvent::decode(self.client.wait_for_event::<LinkableMarker>(deadline)?)
12649    }
12650
12651    /// Creates a link to this this object with name `dst` in the directory represented by
12652    /// `dst_parent_token`.
12653    ///
12654    /// `dst` must be a resolved object name. Including "/" in the string will return
12655    /// `ZX_ERR_INVALID_ARGS`.
12656    ///
12657    /// This method requires the maximal set of rights supported by the filesystem for this object.
12658    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12659    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12660    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12661    /// `ZX_ERR_ACCESS_DENIED`.
12662    ///
12663    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12664    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12665    ///
12666    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12667    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12668    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12669    ///
12670    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12671    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12672    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12673    pub fn r#link_into(
12674        &self,
12675        mut dst_parent_token: fidl::Event,
12676        mut dst: &str,
12677        ___deadline: zx::MonotonicInstant,
12678    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12679        let _response = self.client.send_query::<
12680            LinkableLinkIntoRequest,
12681            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12682            LinkableMarker,
12683        >(
12684            (dst_parent_token, dst,),
12685            0x54f3949246a03e74,
12686            fidl::encoding::DynamicFlags::empty(),
12687            ___deadline,
12688        )?;
12689        Ok(_response.map(|x| x))
12690    }
12691}
12692
12693#[cfg(target_os = "fuchsia")]
12694impl From<LinkableSynchronousProxy> for zx::NullableHandle {
12695    fn from(value: LinkableSynchronousProxy) -> Self {
12696        value.into_channel().into()
12697    }
12698}
12699
12700#[cfg(target_os = "fuchsia")]
12701impl From<fidl::Channel> for LinkableSynchronousProxy {
12702    fn from(value: fidl::Channel) -> Self {
12703        Self::new(value)
12704    }
12705}
12706
12707#[cfg(target_os = "fuchsia")]
12708impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12709    type Protocol = LinkableMarker;
12710
12711    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12712        Self::new(value.into_channel())
12713    }
12714}
12715
12716#[derive(Debug, Clone)]
12717pub struct LinkableProxy {
12718    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12719}
12720
12721impl fidl::endpoints::Proxy for LinkableProxy {
12722    type Protocol = LinkableMarker;
12723
12724    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12725        Self::new(inner)
12726    }
12727
12728    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12729        self.client.into_channel().map_err(|client| Self { client })
12730    }
12731
12732    fn as_channel(&self) -> &::fidl::AsyncChannel {
12733        self.client.as_channel()
12734    }
12735}
12736
12737impl LinkableProxy {
12738    /// Create a new Proxy for fuchsia.io/Linkable.
12739    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12740        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12741        Self { client: fidl::client::Client::new(channel, protocol_name) }
12742    }
12743
12744    /// Get a Stream of events from the remote end of the protocol.
12745    ///
12746    /// # Panics
12747    ///
12748    /// Panics if the event stream was already taken.
12749    pub fn take_event_stream(&self) -> LinkableEventStream {
12750        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12751    }
12752
12753    /// Creates a link to this this object with name `dst` in the directory represented by
12754    /// `dst_parent_token`.
12755    ///
12756    /// `dst` must be a resolved object name. Including "/" in the string will return
12757    /// `ZX_ERR_INVALID_ARGS`.
12758    ///
12759    /// This method requires the maximal set of rights supported by the filesystem for this object.
12760    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12761    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12762    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12763    /// `ZX_ERR_ACCESS_DENIED`.
12764    ///
12765    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12766    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12767    ///
12768    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12769    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12770    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12771    ///
12772    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12773    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12774    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12775    pub fn r#link_into(
12776        &self,
12777        mut dst_parent_token: fidl::Event,
12778        mut dst: &str,
12779    ) -> fidl::client::QueryResponseFut<
12780        LinkableLinkIntoResult,
12781        fidl::encoding::DefaultFuchsiaResourceDialect,
12782    > {
12783        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12784    }
12785}
12786
12787impl LinkableProxyInterface for LinkableProxy {
12788    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12789        LinkableLinkIntoResult,
12790        fidl::encoding::DefaultFuchsiaResourceDialect,
12791    >;
12792    fn r#link_into(
12793        &self,
12794        mut dst_parent_token: fidl::Event,
12795        mut dst: &str,
12796    ) -> Self::LinkIntoResponseFut {
12797        fn _decode(
12798            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12799        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12800            let _response = fidl::client::decode_transaction_body::<
12801                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12802                fidl::encoding::DefaultFuchsiaResourceDialect,
12803                0x54f3949246a03e74,
12804            >(_buf?)?;
12805            Ok(_response.map(|x| x))
12806        }
12807        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12808            (dst_parent_token, dst),
12809            0x54f3949246a03e74,
12810            fidl::encoding::DynamicFlags::empty(),
12811            _decode,
12812        )
12813    }
12814}
12815
12816pub struct LinkableEventStream {
12817    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12818}
12819
12820impl std::marker::Unpin for LinkableEventStream {}
12821
12822impl futures::stream::FusedStream for LinkableEventStream {
12823    fn is_terminated(&self) -> bool {
12824        self.event_receiver.is_terminated()
12825    }
12826}
12827
12828impl futures::Stream for LinkableEventStream {
12829    type Item = Result<LinkableEvent, fidl::Error>;
12830
12831    fn poll_next(
12832        mut self: std::pin::Pin<&mut Self>,
12833        cx: &mut std::task::Context<'_>,
12834    ) -> std::task::Poll<Option<Self::Item>> {
12835        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12836            &mut self.event_receiver,
12837            cx
12838        )?) {
12839            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12840            None => std::task::Poll::Ready(None),
12841        }
12842    }
12843}
12844
12845#[derive(Debug)]
12846pub enum LinkableEvent {}
12847
12848impl LinkableEvent {
12849    /// Decodes a message buffer as a [`LinkableEvent`].
12850    fn decode(
12851        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12852    ) -> Result<LinkableEvent, fidl::Error> {
12853        let (bytes, _handles) = buf.split_mut();
12854        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12855        debug_assert_eq!(tx_header.tx_id, 0);
12856        match tx_header.ordinal {
12857            _ => Err(fidl::Error::UnknownOrdinal {
12858                ordinal: tx_header.ordinal,
12859                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12860            }),
12861        }
12862    }
12863}
12864
12865/// A Stream of incoming requests for fuchsia.io/Linkable.
12866pub struct LinkableRequestStream {
12867    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12868    is_terminated: bool,
12869}
12870
12871impl std::marker::Unpin for LinkableRequestStream {}
12872
12873impl futures::stream::FusedStream for LinkableRequestStream {
12874    fn is_terminated(&self) -> bool {
12875        self.is_terminated
12876    }
12877}
12878
12879impl fidl::endpoints::RequestStream for LinkableRequestStream {
12880    type Protocol = LinkableMarker;
12881    type ControlHandle = LinkableControlHandle;
12882
12883    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12884        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12885    }
12886
12887    fn control_handle(&self) -> Self::ControlHandle {
12888        LinkableControlHandle { inner: self.inner.clone() }
12889    }
12890
12891    fn into_inner(
12892        self,
12893    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12894    {
12895        (self.inner, self.is_terminated)
12896    }
12897
12898    fn from_inner(
12899        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12900        is_terminated: bool,
12901    ) -> Self {
12902        Self { inner, is_terminated }
12903    }
12904}
12905
12906impl futures::Stream for LinkableRequestStream {
12907    type Item = Result<LinkableRequest, fidl::Error>;
12908
12909    fn poll_next(
12910        mut self: std::pin::Pin<&mut Self>,
12911        cx: &mut std::task::Context<'_>,
12912    ) -> std::task::Poll<Option<Self::Item>> {
12913        let this = &mut *self;
12914        if this.inner.check_shutdown(cx) {
12915            this.is_terminated = true;
12916            return std::task::Poll::Ready(None);
12917        }
12918        if this.is_terminated {
12919            panic!("polled LinkableRequestStream after completion");
12920        }
12921        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12922            |bytes, handles| {
12923                match this.inner.channel().read_etc(cx, bytes, handles) {
12924                    std::task::Poll::Ready(Ok(())) => {}
12925                    std::task::Poll::Pending => return std::task::Poll::Pending,
12926                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12927                        this.is_terminated = true;
12928                        return std::task::Poll::Ready(None);
12929                    }
12930                    std::task::Poll::Ready(Err(e)) => {
12931                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12932                            e.into(),
12933                        ))));
12934                    }
12935                }
12936
12937                // A message has been received from the channel
12938                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12939
12940                std::task::Poll::Ready(Some(match header.ordinal {
12941                    0x54f3949246a03e74 => {
12942                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12943                        let mut req = fidl::new_empty!(
12944                            LinkableLinkIntoRequest,
12945                            fidl::encoding::DefaultFuchsiaResourceDialect
12946                        );
12947                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12948                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12949                        Ok(LinkableRequest::LinkInto {
12950                            dst_parent_token: req.dst_parent_token,
12951                            dst: req.dst,
12952
12953                            responder: LinkableLinkIntoResponder {
12954                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12955                                tx_id: header.tx_id,
12956                            },
12957                        })
12958                    }
12959                    _ => Err(fidl::Error::UnknownOrdinal {
12960                        ordinal: header.ordinal,
12961                        protocol_name:
12962                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12963                    }),
12964                }))
12965            },
12966        )
12967    }
12968}
12969
12970#[derive(Debug)]
12971pub enum LinkableRequest {
12972    /// Creates a link to this this object with name `dst` in the directory represented by
12973    /// `dst_parent_token`.
12974    ///
12975    /// `dst` must be a resolved object name. Including "/" in the string will return
12976    /// `ZX_ERR_INVALID_ARGS`.
12977    ///
12978    /// This method requires the maximal set of rights supported by the filesystem for this object.
12979    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12980    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12981    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12982    /// `ZX_ERR_ACCESS_DENIED`.
12983    ///
12984    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12985    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12986    ///
12987    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12988    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12989    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12990    ///
12991    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12992    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12993    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12994    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12995}
12996
12997impl LinkableRequest {
12998    #[allow(irrefutable_let_patterns)]
12999    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
13000        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
13001            Some((dst_parent_token, dst, responder))
13002        } else {
13003            None
13004        }
13005    }
13006
13007    /// Name of the method defined in FIDL
13008    pub fn method_name(&self) -> &'static str {
13009        match *self {
13010            LinkableRequest::LinkInto { .. } => "link_into",
13011        }
13012    }
13013}
13014
13015#[derive(Debug, Clone)]
13016pub struct LinkableControlHandle {
13017    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13018}
13019
13020impl LinkableControlHandle {
13021    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
13022        self.inner.shutdown_with_epitaph(status.into())
13023    }
13024}
13025
13026impl fidl::endpoints::ControlHandle for LinkableControlHandle {
13027    fn shutdown(&self) {
13028        self.inner.shutdown()
13029    }
13030
13031    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
13032        self.inner.shutdown_with_epitaph(status)
13033    }
13034
13035    fn is_closed(&self) -> bool {
13036        self.inner.channel().is_closed()
13037    }
13038    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
13039        self.inner.channel().on_closed()
13040    }
13041
13042    #[cfg(target_os = "fuchsia")]
13043    fn signal_peer(
13044        &self,
13045        clear_mask: zx::Signals,
13046        set_mask: zx::Signals,
13047    ) -> Result<(), zx_status::Status> {
13048        use fidl::Peered;
13049        self.inner.channel().signal_peer(clear_mask, set_mask)
13050    }
13051}
13052
13053impl LinkableControlHandle {}
13054
13055#[must_use = "FIDL methods require a response to be sent"]
13056#[derive(Debug)]
13057pub struct LinkableLinkIntoResponder {
13058    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
13059    tx_id: u32,
13060}
13061
13062/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
13063/// if the responder is dropped without sending a response, so that the client
13064/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13065impl std::ops::Drop for LinkableLinkIntoResponder {
13066    fn drop(&mut self) {
13067        self.control_handle.shutdown();
13068        // Safety: drops once, never accessed again
13069        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13070    }
13071}
13072
13073impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
13074    type ControlHandle = LinkableControlHandle;
13075
13076    fn control_handle(&self) -> &LinkableControlHandle {
13077        &self.control_handle
13078    }
13079
13080    fn drop_without_shutdown(mut self) {
13081        // Safety: drops once, never accessed again due to mem::forget
13082        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13083        // Prevent Drop from running (which would shut down the channel)
13084        std::mem::forget(self);
13085    }
13086}
13087
13088impl LinkableLinkIntoResponder {
13089    /// Sends a response to the FIDL transaction.
13090    ///
13091    /// Sets the channel to shutdown if an error occurs.
13092    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13093        let _result = self.send_raw(result);
13094        if _result.is_err() {
13095            self.control_handle.shutdown();
13096        }
13097        self.drop_without_shutdown();
13098        _result
13099    }
13100
13101    /// Similar to "send" but does not shutdown the channel if an error occurs.
13102    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13103        let _result = self.send_raw(result);
13104        self.drop_without_shutdown();
13105        _result
13106    }
13107
13108    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13109        self.control_handle
13110            .inner
13111            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13112                result,
13113                self.tx_id,
13114                0x54f3949246a03e74,
13115                fidl::encoding::DynamicFlags::empty(),
13116            )
13117    }
13118}
13119
13120#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13121pub struct NodeMarker;
13122
13123impl fidl::endpoints::ProtocolMarker for NodeMarker {
13124    type Proxy = NodeProxy;
13125    type RequestStream = NodeRequestStream;
13126    #[cfg(target_os = "fuchsia")]
13127    type SynchronousProxy = NodeSynchronousProxy;
13128
13129    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
13130}
13131impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
13132pub type NodeGetFlagsResult = Result<Flags, i32>;
13133pub type NodeSetFlagsResult = Result<(), i32>;
13134pub type NodeGetTokenResult = Result<fidl::Event, i32>;
13135pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
13136pub type NodeUpdateAttributesResult = Result<(), i32>;
13137pub type NodeSyncResult = Result<(), i32>;
13138pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
13139pub type NodeSetExtendedAttributeResult = Result<(), i32>;
13140pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
13141
13142pub trait NodeProxyInterface: Send + Sync {
13143    fn r#clone(
13144        &self,
13145        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13146    ) -> Result<(), fidl::Error>;
13147    type CloseResponseFut: std::future::Future<
13148            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
13149        > + Send;
13150    fn r#close(&self) -> Self::CloseResponseFut;
13151    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
13152    fn r#query(&self) -> Self::QueryResponseFut;
13153    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
13154        + Send;
13155    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
13156    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
13157    fn r#deprecated_set_attr(
13158        &self,
13159        flags: NodeAttributeFlags,
13160        attributes: &NodeAttributes,
13161    ) -> Self::DeprecatedSetAttrResponseFut;
13162    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
13163        + Send;
13164    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
13165    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
13166        + Send;
13167    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
13168    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
13169        + Send;
13170    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
13171    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
13172        + Send;
13173    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
13174    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
13175        + Send;
13176    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
13177    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
13178        + Send;
13179    fn r#get_token(&self) -> Self::GetTokenResponseFut;
13180    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
13181        + Send;
13182    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
13183    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
13184        + Send;
13185    fn r#update_attributes(
13186        &self,
13187        payload: &MutableNodeAttributes,
13188    ) -> Self::UpdateAttributesResponseFut;
13189    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
13190    fn r#sync(&self) -> Self::SyncResponseFut;
13191    fn r#list_extended_attributes(
13192        &self,
13193        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13194    ) -> Result<(), fidl::Error>;
13195    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
13196        + Send;
13197    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
13198    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
13199        + Send;
13200    fn r#set_extended_attribute(
13201        &self,
13202        name: &[u8],
13203        value: ExtendedAttributeValue,
13204        mode: SetExtendedAttributeMode,
13205    ) -> Self::SetExtendedAttributeResponseFut;
13206    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
13207        + Send;
13208    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
13209}
13210#[derive(Debug)]
13211#[cfg(target_os = "fuchsia")]
13212pub struct NodeSynchronousProxy {
13213    client: fidl::client::sync::Client,
13214}
13215
13216#[cfg(target_os = "fuchsia")]
13217impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
13218    type Proxy = NodeProxy;
13219    type Protocol = NodeMarker;
13220
13221    fn from_channel(inner: fidl::Channel) -> Self {
13222        Self::new(inner)
13223    }
13224
13225    fn into_channel(self) -> fidl::Channel {
13226        self.client.into_channel()
13227    }
13228
13229    fn as_channel(&self) -> &fidl::Channel {
13230        self.client.as_channel()
13231    }
13232}
13233
13234#[cfg(target_os = "fuchsia")]
13235impl NodeSynchronousProxy {
13236    pub fn new(channel: fidl::Channel) -> Self {
13237        Self { client: fidl::client::sync::Client::new(channel) }
13238    }
13239
13240    pub fn into_channel(self) -> fidl::Channel {
13241        self.client.into_channel()
13242    }
13243
13244    /// Waits until an event arrives and returns it. It is safe for other
13245    /// threads to make concurrent requests while waiting for an event.
13246    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
13247        NodeEvent::decode(self.client.wait_for_event::<NodeMarker>(deadline)?)
13248    }
13249
13250    pub fn r#clone(
13251        &self,
13252        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13253    ) -> Result<(), fidl::Error> {
13254        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13255            (request,),
13256            0x20d8a7aba2168a79,
13257            fidl::encoding::DynamicFlags::empty(),
13258        )
13259    }
13260
13261    /// Terminates the connection.
13262    ///
13263    /// After calling `Close`, the client must not send any other requests.
13264    ///
13265    /// Servers, after sending the status response, should close the connection
13266    /// regardless of status and without sending an epitaph.
13267    ///
13268    /// Closing the client end of the channel should be semantically equivalent
13269    /// to calling `Close` without knowing when the close has completed or its
13270    /// status.
13271    pub fn r#close(
13272        &self,
13273        ___deadline: zx::MonotonicInstant,
13274    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13275        let _response = self.client.send_query::<
13276            fidl::encoding::EmptyPayload,
13277            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13278            NodeMarker,
13279        >(
13280            (),
13281            0x5ac5d459ad7f657e,
13282            fidl::encoding::DynamicFlags::empty(),
13283            ___deadline,
13284        )?;
13285        Ok(_response.map(|x| x))
13286    }
13287
13288    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
13289        let _response = self.client.send_query::<
13290            fidl::encoding::EmptyPayload,
13291            fidl_fuchsia_unknown::QueryableQueryResponse,
13292            NodeMarker,
13293        >(
13294            (),
13295            0x2658edee9decfc06,
13296            fidl::encoding::DynamicFlags::empty(),
13297            ___deadline,
13298        )?;
13299        Ok(_response.protocol)
13300    }
13301
13302    /// DEPRECATED - Use `Node.GetAttributes` instead.
13303    ///
13304    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13305    pub fn r#deprecated_get_attr(
13306        &self,
13307        ___deadline: zx::MonotonicInstant,
13308    ) -> Result<(i32, NodeAttributes), fidl::Error> {
13309        let _response = self
13310            .client
13311            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, NodeMarker>(
13312                (),
13313                0x78985e216314dafd,
13314                fidl::encoding::DynamicFlags::empty(),
13315                ___deadline,
13316            )?;
13317        Ok((_response.s, _response.attributes))
13318    }
13319
13320    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13321    pub fn r#deprecated_set_attr(
13322        &self,
13323        mut flags: NodeAttributeFlags,
13324        mut attributes: &NodeAttributes,
13325        ___deadline: zx::MonotonicInstant,
13326    ) -> Result<i32, fidl::Error> {
13327        let _response = self
13328            .client
13329            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, NodeMarker>(
13330                (flags, attributes),
13331                0x4186c0f40d938f46,
13332                fidl::encoding::DynamicFlags::empty(),
13333                ___deadline,
13334            )?;
13335        Ok(_response.s)
13336    }
13337
13338    /// [DEPRECATED - Use new GetFlags method instead.]
13339    pub fn r#deprecated_get_flags(
13340        &self,
13341        ___deadline: zx::MonotonicInstant,
13342    ) -> Result<(i32, OpenFlags), fidl::Error> {
13343        let _response = self
13344            .client
13345            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, NodeMarker>(
13346                (),
13347                0x5b88fffb8eda3aa1,
13348                fidl::encoding::DynamicFlags::empty(),
13349                ___deadline,
13350            )?;
13351        Ok((_response.s, _response.flags))
13352    }
13353
13354    /// [DEPRECATED - Use new SetFlags method instead.]
13355    pub fn r#deprecated_set_flags(
13356        &self,
13357        mut flags: OpenFlags,
13358        ___deadline: zx::MonotonicInstant,
13359    ) -> Result<i32, fidl::Error> {
13360        let _response = self.client.send_query::<
13361            NodeDeprecatedSetFlagsRequest,
13362            NodeDeprecatedSetFlagsResponse,
13363            NodeMarker,
13364        >(
13365            (flags,),
13366            0x5295b76c71fde733,
13367            fidl::encoding::DynamicFlags::empty(),
13368            ___deadline,
13369        )?;
13370        Ok(_response.s)
13371    }
13372
13373    /// Queries the flags that apply to this node after it has been opened/created. This method does
13374    /// not require any rights.
13375    ///
13376    /// Note that the final set of flags that apply to the connection may differ from those
13377    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13378    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13379    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13380    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13381    pub fn r#get_flags(
13382        &self,
13383        ___deadline: zx::MonotonicInstant,
13384    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13385        let _response = self.client.send_query::<
13386            fidl::encoding::EmptyPayload,
13387            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13388            NodeMarker,
13389        >(
13390            (),
13391            0x176eb318f64ec23,
13392            fidl::encoding::DynamicFlags::FLEXIBLE,
13393            ___deadline,
13394        )?
13395        .into_result::<NodeMarker>("get_flags")?;
13396        Ok(_response.map(|x| x.flags))
13397    }
13398
13399    /// Sets the flags that apply to this node after it has been opened. This method does not
13400    /// require any rights.
13401    ///
13402    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13403    /// clear append mode.
13404    ///
13405    /// Errors:
13406    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13407    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13408    pub fn r#set_flags(
13409        &self,
13410        mut flags: Flags,
13411        ___deadline: zx::MonotonicInstant,
13412    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13413        let _response = self.client.send_query::<
13414            NodeSetFlagsRequest,
13415            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13416            NodeMarker,
13417        >(
13418            (flags,),
13419            0x55a8028685791ea8,
13420            fidl::encoding::DynamicFlags::FLEXIBLE,
13421            ___deadline,
13422        )?
13423        .into_result::<NodeMarker>("set_flags")?;
13424        Ok(_response.map(|x| x))
13425    }
13426
13427    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13428    /// volume has different settings or the storage is accounted seperately from the rest of the
13429    /// filesystem that may be reported instead of filesystem-wide details.
13430    pub fn r#query_filesystem(
13431        &self,
13432        ___deadline: zx::MonotonicInstant,
13433    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13434        let _response = self
13435            .client
13436            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, NodeMarker>(
13437                (),
13438                0x6f344a1c6b0a0610,
13439                fidl::encoding::DynamicFlags::empty(),
13440                ___deadline,
13441            )?;
13442        Ok((_response.s, _response.info))
13443    }
13444
13445    /// Acquires a token which can be used to identify this connection at a later point in
13446    /// time. The token will remain valid for as long as the connection requesting the token
13447    /// remains open.
13448    ///
13449    /// This method does not require any rights. Note that the token identifies
13450    /// the connection, hence carries the rights information on this connection.
13451    pub fn r#get_token(
13452        &self,
13453        ___deadline: zx::MonotonicInstant,
13454    ) -> Result<NodeGetTokenResult, fidl::Error> {
13455        let _response = self.client.send_query::<
13456            fidl::encoding::EmptyPayload,
13457            fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
13458            NodeMarker,
13459        >(
13460            (),
13461            0x5054f0ade7076cec,
13462            fidl::encoding::DynamicFlags::FLEXIBLE,
13463            ___deadline,
13464        )?
13465        .into_result::<NodeMarker>("get_token")?;
13466        Ok(_response.map(|x| x.token))
13467    }
13468
13469    /// Acquires information about the node.
13470    ///
13471    /// The attributes of a node should be stable, independent of the
13472    /// specific protocol used to access it.
13473    ///
13474    /// If a particular attribute is not applicable or not supported,
13475    /// filesystems should leave the corresponding field absent.
13476    ///
13477    /// + `query` a bit-mask specifying which attributes to fetch. The server
13478    ///   should not return more than necessary.
13479    /// - `attributes` the returned attributes.
13480    ///
13481    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13482    pub fn r#get_attributes(
13483        &self,
13484        mut query: NodeAttributesQuery,
13485        ___deadline: zx::MonotonicInstant,
13486    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13487        let _response = self.client.send_query::<
13488            NodeGetAttributesRequest,
13489            fidl::encoding::ResultType<NodeAttributes2, i32>,
13490            NodeMarker,
13491        >(
13492            (query,),
13493            0x3d4396a638ea053b,
13494            fidl::encoding::DynamicFlags::empty(),
13495            ___deadline,
13496        )?;
13497        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13498    }
13499
13500    /// Updates information about the node.
13501    ///
13502    /// + `attributes` the presence of a table field in `attributes` indicates
13503    /// the intent to update the corresponding attribute.
13504    ///
13505    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13506    ///
13507    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13508    pub fn r#update_attributes(
13509        &self,
13510        mut payload: &MutableNodeAttributes,
13511        ___deadline: zx::MonotonicInstant,
13512    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13513        let _response = self.client.send_query::<
13514            MutableNodeAttributes,
13515            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13516            NodeMarker,
13517        >(
13518            payload,
13519            0x3308c1da5a89bf08,
13520            fidl::encoding::DynamicFlags::empty(),
13521            ___deadline,
13522        )?;
13523        Ok(_response.map(|x| x))
13524    }
13525
13526    /// Synchronizes updates to the node to the underlying media, if it exists.
13527    ///
13528    /// This method will return when the filesystem server has flushed the
13529    /// relevant updates to the underlying media, but does not guarantee the
13530    /// underlying media has persisted the information, nor that any information
13531    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13532    /// between operations.
13533    ///
13534    /// This method does not require any rights.
13535    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13536        let _response = self.client.send_query::<
13537            fidl::encoding::EmptyPayload,
13538            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13539            NodeMarker,
13540        >(
13541            (),
13542            0x2c5c27ca0ab5dc49,
13543            fidl::encoding::DynamicFlags::empty(),
13544            ___deadline,
13545        )?;
13546        Ok(_response.map(|x| x))
13547    }
13548
13549    /// Creates an iterator over all the extended attribute names associated
13550    /// with this node. If an error occurs it is returned as an epitaph on the
13551    /// iterator request channel, and then the channel is closed.
13552    ///
13553    /// GetExtendedAttributes can be used with any of these names to retrieve
13554    /// the associated value.
13555    ///
13556    /// This method requires the [`Rights.READ_BYTES`] right.
13557    pub fn r#list_extended_attributes(
13558        &self,
13559        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13560    ) -> Result<(), fidl::Error> {
13561        self.client.send::<NodeListExtendedAttributesRequest>(
13562            (iterator,),
13563            0x4b61033de007fcd0,
13564            fidl::encoding::DynamicFlags::empty(),
13565        )
13566    }
13567
13568    /// Get the value associated with the given attribute `name` for this node.
13569    ///
13570    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13571    /// particular structure is imposed on them.
13572    ///
13573    /// This method requires the [`Rights.READ_BYTES`] right.
13574    pub fn r#get_extended_attribute(
13575        &self,
13576        mut name: &[u8],
13577        ___deadline: zx::MonotonicInstant,
13578    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13579        let _response = self.client.send_query::<
13580            NodeGetExtendedAttributeRequest,
13581            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13582            NodeMarker,
13583        >(
13584            (name,),
13585            0x45ffa3ccfdeb76db,
13586            fidl::encoding::DynamicFlags::empty(),
13587            ___deadline,
13588        )?;
13589        Ok(_response.map(|x| x))
13590    }
13591
13592    /// Set the value for the given attribute `name` to `value` for this node.
13593    ///
13594    /// The attribute name may exist, in which case the attribute is updated.
13595    /// If the attribute doesn't exist, it is created. The name should have no
13596    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13597    ///
13598    /// This method requires the [`Rights.WRITE_BYTES`] right.
13599    pub fn r#set_extended_attribute(
13600        &self,
13601        mut name: &[u8],
13602        mut value: ExtendedAttributeValue,
13603        mut mode: SetExtendedAttributeMode,
13604        ___deadline: zx::MonotonicInstant,
13605    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13606        let _response = self.client.send_query::<
13607            NodeSetExtendedAttributeRequest,
13608            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13609            NodeMarker,
13610        >(
13611            (name, &mut value, mode,),
13612            0x4a951362f681f23c,
13613            fidl::encoding::DynamicFlags::empty(),
13614            ___deadline,
13615        )?;
13616        Ok(_response.map(|x| x))
13617    }
13618
13619    /// Remove the specified extended attribute.
13620    ///
13621    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13622    ///
13623    /// This method requires the [`Rights.WRITE_BYTES`] right.
13624    pub fn r#remove_extended_attribute(
13625        &self,
13626        mut name: &[u8],
13627        ___deadline: zx::MonotonicInstant,
13628    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13629        let _response = self.client.send_query::<
13630            NodeRemoveExtendedAttributeRequest,
13631            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13632            NodeMarker,
13633        >(
13634            (name,),
13635            0x7a0b9f3a9bf9032d,
13636            fidl::encoding::DynamicFlags::empty(),
13637            ___deadline,
13638        )?;
13639        Ok(_response.map(|x| x))
13640    }
13641}
13642
13643#[cfg(target_os = "fuchsia")]
13644impl From<NodeSynchronousProxy> for zx::NullableHandle {
13645    fn from(value: NodeSynchronousProxy) -> Self {
13646        value.into_channel().into()
13647    }
13648}
13649
13650#[cfg(target_os = "fuchsia")]
13651impl From<fidl::Channel> for NodeSynchronousProxy {
13652    fn from(value: fidl::Channel) -> Self {
13653        Self::new(value)
13654    }
13655}
13656
13657#[cfg(target_os = "fuchsia")]
13658impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13659    type Protocol = NodeMarker;
13660
13661    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13662        Self::new(value.into_channel())
13663    }
13664}
13665
13666#[derive(Debug, Clone)]
13667pub struct NodeProxy {
13668    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13669}
13670
13671impl fidl::endpoints::Proxy for NodeProxy {
13672    type Protocol = NodeMarker;
13673
13674    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13675        Self::new(inner)
13676    }
13677
13678    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13679        self.client.into_channel().map_err(|client| Self { client })
13680    }
13681
13682    fn as_channel(&self) -> &::fidl::AsyncChannel {
13683        self.client.as_channel()
13684    }
13685}
13686
13687impl NodeProxy {
13688    /// Create a new Proxy for fuchsia.io/Node.
13689    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13690        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13691        Self { client: fidl::client::Client::new(channel, protocol_name) }
13692    }
13693
13694    /// Get a Stream of events from the remote end of the protocol.
13695    ///
13696    /// # Panics
13697    ///
13698    /// Panics if the event stream was already taken.
13699    pub fn take_event_stream(&self) -> NodeEventStream {
13700        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13701    }
13702
13703    pub fn r#clone(
13704        &self,
13705        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13706    ) -> Result<(), fidl::Error> {
13707        NodeProxyInterface::r#clone(self, request)
13708    }
13709
13710    /// Terminates the connection.
13711    ///
13712    /// After calling `Close`, the client must not send any other requests.
13713    ///
13714    /// Servers, after sending the status response, should close the connection
13715    /// regardless of status and without sending an epitaph.
13716    ///
13717    /// Closing the client end of the channel should be semantically equivalent
13718    /// to calling `Close` without knowing when the close has completed or its
13719    /// status.
13720    pub fn r#close(
13721        &self,
13722    ) -> fidl::client::QueryResponseFut<
13723        fidl_fuchsia_unknown::CloseableCloseResult,
13724        fidl::encoding::DefaultFuchsiaResourceDialect,
13725    > {
13726        NodeProxyInterface::r#close(self)
13727    }
13728
13729    pub fn r#query(
13730        &self,
13731    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13732    {
13733        NodeProxyInterface::r#query(self)
13734    }
13735
13736    /// DEPRECATED - Use `Node.GetAttributes` instead.
13737    ///
13738    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13739    pub fn r#deprecated_get_attr(
13740        &self,
13741    ) -> fidl::client::QueryResponseFut<
13742        (i32, NodeAttributes),
13743        fidl::encoding::DefaultFuchsiaResourceDialect,
13744    > {
13745        NodeProxyInterface::r#deprecated_get_attr(self)
13746    }
13747
13748    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13749    pub fn r#deprecated_set_attr(
13750        &self,
13751        mut flags: NodeAttributeFlags,
13752        mut attributes: &NodeAttributes,
13753    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13754        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13755    }
13756
13757    /// [DEPRECATED - Use new GetFlags method instead.]
13758    pub fn r#deprecated_get_flags(
13759        &self,
13760    ) -> fidl::client::QueryResponseFut<
13761        (i32, OpenFlags),
13762        fidl::encoding::DefaultFuchsiaResourceDialect,
13763    > {
13764        NodeProxyInterface::r#deprecated_get_flags(self)
13765    }
13766
13767    /// [DEPRECATED - Use new SetFlags method instead.]
13768    pub fn r#deprecated_set_flags(
13769        &self,
13770        mut flags: OpenFlags,
13771    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13772        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13773    }
13774
13775    /// Queries the flags that apply to this node after it has been opened/created. This method does
13776    /// not require any rights.
13777    ///
13778    /// Note that the final set of flags that apply to the connection may differ from those
13779    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13780    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13781    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13782    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13783    pub fn r#get_flags(
13784        &self,
13785    ) -> fidl::client::QueryResponseFut<
13786        NodeGetFlagsResult,
13787        fidl::encoding::DefaultFuchsiaResourceDialect,
13788    > {
13789        NodeProxyInterface::r#get_flags(self)
13790    }
13791
13792    /// Sets the flags that apply to this node after it has been opened. This method does not
13793    /// require any rights.
13794    ///
13795    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13796    /// clear append mode.
13797    ///
13798    /// Errors:
13799    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13800    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13801    pub fn r#set_flags(
13802        &self,
13803        mut flags: Flags,
13804    ) -> fidl::client::QueryResponseFut<
13805        NodeSetFlagsResult,
13806        fidl::encoding::DefaultFuchsiaResourceDialect,
13807    > {
13808        NodeProxyInterface::r#set_flags(self, flags)
13809    }
13810
13811    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13812    /// volume has different settings or the storage is accounted seperately from the rest of the
13813    /// filesystem that may be reported instead of filesystem-wide details.
13814    pub fn r#query_filesystem(
13815        &self,
13816    ) -> fidl::client::QueryResponseFut<
13817        (i32, Option<Box<FilesystemInfo>>),
13818        fidl::encoding::DefaultFuchsiaResourceDialect,
13819    > {
13820        NodeProxyInterface::r#query_filesystem(self)
13821    }
13822
13823    /// Acquires a token which can be used to identify this connection at a later point in
13824    /// time. The token will remain valid for as long as the connection requesting the token
13825    /// remains open.
13826    ///
13827    /// This method does not require any rights. Note that the token identifies
13828    /// the connection, hence carries the rights information on this connection.
13829    pub fn r#get_token(
13830        &self,
13831    ) -> fidl::client::QueryResponseFut<
13832        NodeGetTokenResult,
13833        fidl::encoding::DefaultFuchsiaResourceDialect,
13834    > {
13835        NodeProxyInterface::r#get_token(self)
13836    }
13837
13838    /// Acquires information about the node.
13839    ///
13840    /// The attributes of a node should be stable, independent of the
13841    /// specific protocol used to access it.
13842    ///
13843    /// If a particular attribute is not applicable or not supported,
13844    /// filesystems should leave the corresponding field absent.
13845    ///
13846    /// + `query` a bit-mask specifying which attributes to fetch. The server
13847    ///   should not return more than necessary.
13848    /// - `attributes` the returned attributes.
13849    ///
13850    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13851    pub fn r#get_attributes(
13852        &self,
13853        mut query: NodeAttributesQuery,
13854    ) -> fidl::client::QueryResponseFut<
13855        NodeGetAttributesResult,
13856        fidl::encoding::DefaultFuchsiaResourceDialect,
13857    > {
13858        NodeProxyInterface::r#get_attributes(self, query)
13859    }
13860
13861    /// Updates information about the node.
13862    ///
13863    /// + `attributes` the presence of a table field in `attributes` indicates
13864    /// the intent to update the corresponding attribute.
13865    ///
13866    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13867    ///
13868    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13869    pub fn r#update_attributes(
13870        &self,
13871        mut payload: &MutableNodeAttributes,
13872    ) -> fidl::client::QueryResponseFut<
13873        NodeUpdateAttributesResult,
13874        fidl::encoding::DefaultFuchsiaResourceDialect,
13875    > {
13876        NodeProxyInterface::r#update_attributes(self, payload)
13877    }
13878
13879    /// Synchronizes updates to the node to the underlying media, if it exists.
13880    ///
13881    /// This method will return when the filesystem server has flushed the
13882    /// relevant updates to the underlying media, but does not guarantee the
13883    /// underlying media has persisted the information, nor that any information
13884    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13885    /// between operations.
13886    ///
13887    /// This method does not require any rights.
13888    pub fn r#sync(
13889        &self,
13890    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13891    {
13892        NodeProxyInterface::r#sync(self)
13893    }
13894
13895    /// Creates an iterator over all the extended attribute names associated
13896    /// with this node. If an error occurs it is returned as an epitaph on the
13897    /// iterator request channel, and then the channel is closed.
13898    ///
13899    /// GetExtendedAttributes can be used with any of these names to retrieve
13900    /// the associated value.
13901    ///
13902    /// This method requires the [`Rights.READ_BYTES`] right.
13903    pub fn r#list_extended_attributes(
13904        &self,
13905        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13906    ) -> Result<(), fidl::Error> {
13907        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13908    }
13909
13910    /// Get the value associated with the given attribute `name` for this node.
13911    ///
13912    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13913    /// particular structure is imposed on them.
13914    ///
13915    /// This method requires the [`Rights.READ_BYTES`] right.
13916    pub fn r#get_extended_attribute(
13917        &self,
13918        mut name: &[u8],
13919    ) -> fidl::client::QueryResponseFut<
13920        NodeGetExtendedAttributeResult,
13921        fidl::encoding::DefaultFuchsiaResourceDialect,
13922    > {
13923        NodeProxyInterface::r#get_extended_attribute(self, name)
13924    }
13925
13926    /// Set the value for the given attribute `name` to `value` for this node.
13927    ///
13928    /// The attribute name may exist, in which case the attribute is updated.
13929    /// If the attribute doesn't exist, it is created. The name should have no
13930    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13931    ///
13932    /// This method requires the [`Rights.WRITE_BYTES`] right.
13933    pub fn r#set_extended_attribute(
13934        &self,
13935        mut name: &[u8],
13936        mut value: ExtendedAttributeValue,
13937        mut mode: SetExtendedAttributeMode,
13938    ) -> fidl::client::QueryResponseFut<
13939        NodeSetExtendedAttributeResult,
13940        fidl::encoding::DefaultFuchsiaResourceDialect,
13941    > {
13942        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13943    }
13944
13945    /// Remove the specified extended attribute.
13946    ///
13947    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13948    ///
13949    /// This method requires the [`Rights.WRITE_BYTES`] right.
13950    pub fn r#remove_extended_attribute(
13951        &self,
13952        mut name: &[u8],
13953    ) -> fidl::client::QueryResponseFut<
13954        NodeRemoveExtendedAttributeResult,
13955        fidl::encoding::DefaultFuchsiaResourceDialect,
13956    > {
13957        NodeProxyInterface::r#remove_extended_attribute(self, name)
13958    }
13959}
13960
13961impl NodeProxyInterface for NodeProxy {
13962    fn r#clone(
13963        &self,
13964        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13965    ) -> Result<(), fidl::Error> {
13966        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13967            (request,),
13968            0x20d8a7aba2168a79,
13969            fidl::encoding::DynamicFlags::empty(),
13970        )
13971    }
13972
13973    type CloseResponseFut = fidl::client::QueryResponseFut<
13974        fidl_fuchsia_unknown::CloseableCloseResult,
13975        fidl::encoding::DefaultFuchsiaResourceDialect,
13976    >;
13977    fn r#close(&self) -> Self::CloseResponseFut {
13978        fn _decode(
13979            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13980        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13981            let _response = fidl::client::decode_transaction_body::<
13982                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13983                fidl::encoding::DefaultFuchsiaResourceDialect,
13984                0x5ac5d459ad7f657e,
13985            >(_buf?)?;
13986            Ok(_response.map(|x| x))
13987        }
13988        self.client.send_query_and_decode::<
13989            fidl::encoding::EmptyPayload,
13990            fidl_fuchsia_unknown::CloseableCloseResult,
13991        >(
13992            (),
13993            0x5ac5d459ad7f657e,
13994            fidl::encoding::DynamicFlags::empty(),
13995            _decode,
13996        )
13997    }
13998
13999    type QueryResponseFut =
14000        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
14001    fn r#query(&self) -> Self::QueryResponseFut {
14002        fn _decode(
14003            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14004        ) -> Result<Vec<u8>, fidl::Error> {
14005            let _response = fidl::client::decode_transaction_body::<
14006                fidl_fuchsia_unknown::QueryableQueryResponse,
14007                fidl::encoding::DefaultFuchsiaResourceDialect,
14008                0x2658edee9decfc06,
14009            >(_buf?)?;
14010            Ok(_response.protocol)
14011        }
14012        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
14013            (),
14014            0x2658edee9decfc06,
14015            fidl::encoding::DynamicFlags::empty(),
14016            _decode,
14017        )
14018    }
14019
14020    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
14021        (i32, NodeAttributes),
14022        fidl::encoding::DefaultFuchsiaResourceDialect,
14023    >;
14024    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
14025        fn _decode(
14026            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14027        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14028            let _response = fidl::client::decode_transaction_body::<
14029                NodeDeprecatedGetAttrResponse,
14030                fidl::encoding::DefaultFuchsiaResourceDialect,
14031                0x78985e216314dafd,
14032            >(_buf?)?;
14033            Ok((_response.s, _response.attributes))
14034        }
14035        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14036            (),
14037            0x78985e216314dafd,
14038            fidl::encoding::DynamicFlags::empty(),
14039            _decode,
14040        )
14041    }
14042
14043    type DeprecatedSetAttrResponseFut =
14044        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
14045    fn r#deprecated_set_attr(
14046        &self,
14047        mut flags: NodeAttributeFlags,
14048        mut attributes: &NodeAttributes,
14049    ) -> Self::DeprecatedSetAttrResponseFut {
14050        fn _decode(
14051            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14052        ) -> Result<i32, fidl::Error> {
14053            let _response = fidl::client::decode_transaction_body::<
14054                NodeDeprecatedSetAttrResponse,
14055                fidl::encoding::DefaultFuchsiaResourceDialect,
14056                0x4186c0f40d938f46,
14057            >(_buf?)?;
14058            Ok(_response.s)
14059        }
14060        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
14061            (flags, attributes),
14062            0x4186c0f40d938f46,
14063            fidl::encoding::DynamicFlags::empty(),
14064            _decode,
14065        )
14066    }
14067
14068    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14069        (i32, OpenFlags),
14070        fidl::encoding::DefaultFuchsiaResourceDialect,
14071    >;
14072    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14073        fn _decode(
14074            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14075        ) -> Result<(i32, OpenFlags), fidl::Error> {
14076            let _response = fidl::client::decode_transaction_body::<
14077                NodeDeprecatedGetFlagsResponse,
14078                fidl::encoding::DefaultFuchsiaResourceDialect,
14079                0x5b88fffb8eda3aa1,
14080            >(_buf?)?;
14081            Ok((_response.s, _response.flags))
14082        }
14083        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14084            (),
14085            0x5b88fffb8eda3aa1,
14086            fidl::encoding::DynamicFlags::empty(),
14087            _decode,
14088        )
14089    }
14090
14091    type DeprecatedSetFlagsResponseFut =
14092        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
14093    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14094        fn _decode(
14095            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14096        ) -> Result<i32, fidl::Error> {
14097            let _response = fidl::client::decode_transaction_body::<
14098                NodeDeprecatedSetFlagsResponse,
14099                fidl::encoding::DefaultFuchsiaResourceDialect,
14100                0x5295b76c71fde733,
14101            >(_buf?)?;
14102            Ok(_response.s)
14103        }
14104        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14105            (flags,),
14106            0x5295b76c71fde733,
14107            fidl::encoding::DynamicFlags::empty(),
14108            _decode,
14109        )
14110    }
14111
14112    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14113        NodeGetFlagsResult,
14114        fidl::encoding::DefaultFuchsiaResourceDialect,
14115    >;
14116    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14117        fn _decode(
14118            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14119        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14120            let _response = fidl::client::decode_transaction_body::<
14121                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14122                fidl::encoding::DefaultFuchsiaResourceDialect,
14123                0x176eb318f64ec23,
14124            >(_buf?)?
14125            .into_result::<NodeMarker>("get_flags")?;
14126            Ok(_response.map(|x| x.flags))
14127        }
14128        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14129            (),
14130            0x176eb318f64ec23,
14131            fidl::encoding::DynamicFlags::FLEXIBLE,
14132            _decode,
14133        )
14134    }
14135
14136    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14137        NodeSetFlagsResult,
14138        fidl::encoding::DefaultFuchsiaResourceDialect,
14139    >;
14140    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14141        fn _decode(
14142            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14143        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14144            let _response = fidl::client::decode_transaction_body::<
14145                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14146                fidl::encoding::DefaultFuchsiaResourceDialect,
14147                0x55a8028685791ea8,
14148            >(_buf?)?
14149            .into_result::<NodeMarker>("set_flags")?;
14150            Ok(_response.map(|x| x))
14151        }
14152        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14153            (flags,),
14154            0x55a8028685791ea8,
14155            fidl::encoding::DynamicFlags::FLEXIBLE,
14156            _decode,
14157        )
14158    }
14159
14160    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14161        (i32, Option<Box<FilesystemInfo>>),
14162        fidl::encoding::DefaultFuchsiaResourceDialect,
14163    >;
14164    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14165        fn _decode(
14166            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14167        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14168            let _response = fidl::client::decode_transaction_body::<
14169                NodeQueryFilesystemResponse,
14170                fidl::encoding::DefaultFuchsiaResourceDialect,
14171                0x6f344a1c6b0a0610,
14172            >(_buf?)?;
14173            Ok((_response.s, _response.info))
14174        }
14175        self.client.send_query_and_decode::<
14176            fidl::encoding::EmptyPayload,
14177            (i32, Option<Box<FilesystemInfo>>),
14178        >(
14179            (),
14180            0x6f344a1c6b0a0610,
14181            fidl::encoding::DynamicFlags::empty(),
14182            _decode,
14183        )
14184    }
14185
14186    type GetTokenResponseFut = fidl::client::QueryResponseFut<
14187        NodeGetTokenResult,
14188        fidl::encoding::DefaultFuchsiaResourceDialect,
14189    >;
14190    fn r#get_token(&self) -> Self::GetTokenResponseFut {
14191        fn _decode(
14192            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14193        ) -> Result<NodeGetTokenResult, fidl::Error> {
14194            let _response = fidl::client::decode_transaction_body::<
14195                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
14196                fidl::encoding::DefaultFuchsiaResourceDialect,
14197                0x5054f0ade7076cec,
14198            >(_buf?)?
14199            .into_result::<NodeMarker>("get_token")?;
14200            Ok(_response.map(|x| x.token))
14201        }
14202        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
14203            (),
14204            0x5054f0ade7076cec,
14205            fidl::encoding::DynamicFlags::FLEXIBLE,
14206            _decode,
14207        )
14208    }
14209
14210    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
14211        NodeGetAttributesResult,
14212        fidl::encoding::DefaultFuchsiaResourceDialect,
14213    >;
14214    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
14215        fn _decode(
14216            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14217        ) -> Result<NodeGetAttributesResult, fidl::Error> {
14218            let _response = fidl::client::decode_transaction_body::<
14219                fidl::encoding::ResultType<NodeAttributes2, i32>,
14220                fidl::encoding::DefaultFuchsiaResourceDialect,
14221                0x3d4396a638ea053b,
14222            >(_buf?)?;
14223            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
14224        }
14225        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
14226            (query,),
14227            0x3d4396a638ea053b,
14228            fidl::encoding::DynamicFlags::empty(),
14229            _decode,
14230        )
14231    }
14232
14233    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
14234        NodeUpdateAttributesResult,
14235        fidl::encoding::DefaultFuchsiaResourceDialect,
14236    >;
14237    fn r#update_attributes(
14238        &self,
14239        mut payload: &MutableNodeAttributes,
14240    ) -> Self::UpdateAttributesResponseFut {
14241        fn _decode(
14242            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14243        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
14244            let _response = fidl::client::decode_transaction_body::<
14245                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14246                fidl::encoding::DefaultFuchsiaResourceDialect,
14247                0x3308c1da5a89bf08,
14248            >(_buf?)?;
14249            Ok(_response.map(|x| x))
14250        }
14251        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
14252            payload,
14253            0x3308c1da5a89bf08,
14254            fidl::encoding::DynamicFlags::empty(),
14255            _decode,
14256        )
14257    }
14258
14259    type SyncResponseFut = fidl::client::QueryResponseFut<
14260        NodeSyncResult,
14261        fidl::encoding::DefaultFuchsiaResourceDialect,
14262    >;
14263    fn r#sync(&self) -> Self::SyncResponseFut {
14264        fn _decode(
14265            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14266        ) -> Result<NodeSyncResult, fidl::Error> {
14267            let _response = fidl::client::decode_transaction_body::<
14268                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14269                fidl::encoding::DefaultFuchsiaResourceDialect,
14270                0x2c5c27ca0ab5dc49,
14271            >(_buf?)?;
14272            Ok(_response.map(|x| x))
14273        }
14274        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
14275            (),
14276            0x2c5c27ca0ab5dc49,
14277            fidl::encoding::DynamicFlags::empty(),
14278            _decode,
14279        )
14280    }
14281
14282    fn r#list_extended_attributes(
14283        &self,
14284        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14285    ) -> Result<(), fidl::Error> {
14286        self.client.send::<NodeListExtendedAttributesRequest>(
14287            (iterator,),
14288            0x4b61033de007fcd0,
14289            fidl::encoding::DynamicFlags::empty(),
14290        )
14291    }
14292
14293    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14294        NodeGetExtendedAttributeResult,
14295        fidl::encoding::DefaultFuchsiaResourceDialect,
14296    >;
14297    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14298        fn _decode(
14299            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14300        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14301            let _response = fidl::client::decode_transaction_body::<
14302                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14303                fidl::encoding::DefaultFuchsiaResourceDialect,
14304                0x45ffa3ccfdeb76db,
14305            >(_buf?)?;
14306            Ok(_response.map(|x| x))
14307        }
14308        self.client.send_query_and_decode::<
14309            NodeGetExtendedAttributeRequest,
14310            NodeGetExtendedAttributeResult,
14311        >(
14312            (name,),
14313            0x45ffa3ccfdeb76db,
14314            fidl::encoding::DynamicFlags::empty(),
14315            _decode,
14316        )
14317    }
14318
14319    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14320        NodeSetExtendedAttributeResult,
14321        fidl::encoding::DefaultFuchsiaResourceDialect,
14322    >;
14323    fn r#set_extended_attribute(
14324        &self,
14325        mut name: &[u8],
14326        mut value: ExtendedAttributeValue,
14327        mut mode: SetExtendedAttributeMode,
14328    ) -> Self::SetExtendedAttributeResponseFut {
14329        fn _decode(
14330            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14331        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14332            let _response = fidl::client::decode_transaction_body::<
14333                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14334                fidl::encoding::DefaultFuchsiaResourceDialect,
14335                0x4a951362f681f23c,
14336            >(_buf?)?;
14337            Ok(_response.map(|x| x))
14338        }
14339        self.client.send_query_and_decode::<
14340            NodeSetExtendedAttributeRequest,
14341            NodeSetExtendedAttributeResult,
14342        >(
14343            (name, &mut value, mode,),
14344            0x4a951362f681f23c,
14345            fidl::encoding::DynamicFlags::empty(),
14346            _decode,
14347        )
14348    }
14349
14350    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14351        NodeRemoveExtendedAttributeResult,
14352        fidl::encoding::DefaultFuchsiaResourceDialect,
14353    >;
14354    fn r#remove_extended_attribute(
14355        &self,
14356        mut name: &[u8],
14357    ) -> Self::RemoveExtendedAttributeResponseFut {
14358        fn _decode(
14359            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14360        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14361            let _response = fidl::client::decode_transaction_body::<
14362                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14363                fidl::encoding::DefaultFuchsiaResourceDialect,
14364                0x7a0b9f3a9bf9032d,
14365            >(_buf?)?;
14366            Ok(_response.map(|x| x))
14367        }
14368        self.client.send_query_and_decode::<
14369            NodeRemoveExtendedAttributeRequest,
14370            NodeRemoveExtendedAttributeResult,
14371        >(
14372            (name,),
14373            0x7a0b9f3a9bf9032d,
14374            fidl::encoding::DynamicFlags::empty(),
14375            _decode,
14376        )
14377    }
14378}
14379
14380pub struct NodeEventStream {
14381    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
14382}
14383
14384impl std::marker::Unpin for NodeEventStream {}
14385
14386impl futures::stream::FusedStream for NodeEventStream {
14387    fn is_terminated(&self) -> bool {
14388        self.event_receiver.is_terminated()
14389    }
14390}
14391
14392impl futures::Stream for NodeEventStream {
14393    type Item = Result<NodeEvent, fidl::Error>;
14394
14395    fn poll_next(
14396        mut self: std::pin::Pin<&mut Self>,
14397        cx: &mut std::task::Context<'_>,
14398    ) -> std::task::Poll<Option<Self::Item>> {
14399        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14400            &mut self.event_receiver,
14401            cx
14402        )?) {
14403            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14404            None => std::task::Poll::Ready(None),
14405        }
14406    }
14407}
14408
14409#[derive(Debug)]
14410pub enum NodeEvent {
14411    OnOpen_ {
14412        s: i32,
14413        info: Option<Box<NodeInfoDeprecated>>,
14414    },
14415    OnRepresentation {
14416        payload: Representation,
14417    },
14418    #[non_exhaustive]
14419    _UnknownEvent {
14420        /// Ordinal of the event that was sent.
14421        ordinal: u64,
14422    },
14423}
14424
14425impl NodeEvent {
14426    #[allow(irrefutable_let_patterns)]
14427    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14428        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14429    }
14430    #[allow(irrefutable_let_patterns)]
14431    pub fn into_on_representation(self) -> Option<Representation> {
14432        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14433    }
14434
14435    /// Decodes a message buffer as a [`NodeEvent`].
14436    fn decode(
14437        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14438    ) -> Result<NodeEvent, fidl::Error> {
14439        let (bytes, _handles) = buf.split_mut();
14440        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14441        debug_assert_eq!(tx_header.tx_id, 0);
14442        match tx_header.ordinal {
14443            0x7fc7bbb1dbfd1972 => {
14444                let mut out = fidl::new_empty!(
14445                    NodeOnOpenRequest,
14446                    fidl::encoding::DefaultFuchsiaResourceDialect
14447                );
14448                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14449                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14450            }
14451            0x5cb40567d80a510c => {
14452                let mut out =
14453                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14454                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14455                Ok((NodeEvent::OnRepresentation { payload: out }))
14456            }
14457            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14458                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14459            }
14460            _ => Err(fidl::Error::UnknownOrdinal {
14461                ordinal: tx_header.ordinal,
14462                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14463            }),
14464        }
14465    }
14466}
14467
14468/// A Stream of incoming requests for fuchsia.io/Node.
14469pub struct NodeRequestStream {
14470    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14471    is_terminated: bool,
14472}
14473
14474impl std::marker::Unpin for NodeRequestStream {}
14475
14476impl futures::stream::FusedStream for NodeRequestStream {
14477    fn is_terminated(&self) -> bool {
14478        self.is_terminated
14479    }
14480}
14481
14482impl fidl::endpoints::RequestStream for NodeRequestStream {
14483    type Protocol = NodeMarker;
14484    type ControlHandle = NodeControlHandle;
14485
14486    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14487        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14488    }
14489
14490    fn control_handle(&self) -> Self::ControlHandle {
14491        NodeControlHandle { inner: self.inner.clone() }
14492    }
14493
14494    fn into_inner(
14495        self,
14496    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14497    {
14498        (self.inner, self.is_terminated)
14499    }
14500
14501    fn from_inner(
14502        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14503        is_terminated: bool,
14504    ) -> Self {
14505        Self { inner, is_terminated }
14506    }
14507}
14508
14509impl futures::Stream for NodeRequestStream {
14510    type Item = Result<NodeRequest, fidl::Error>;
14511
14512    fn poll_next(
14513        mut self: std::pin::Pin<&mut Self>,
14514        cx: &mut std::task::Context<'_>,
14515    ) -> std::task::Poll<Option<Self::Item>> {
14516        let this = &mut *self;
14517        if this.inner.check_shutdown(cx) {
14518            this.is_terminated = true;
14519            return std::task::Poll::Ready(None);
14520        }
14521        if this.is_terminated {
14522            panic!("polled NodeRequestStream after completion");
14523        }
14524        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14525            |bytes, handles| {
14526                match this.inner.channel().read_etc(cx, bytes, handles) {
14527                    std::task::Poll::Ready(Ok(())) => {}
14528                    std::task::Poll::Pending => return std::task::Poll::Pending,
14529                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14530                        this.is_terminated = true;
14531                        return std::task::Poll::Ready(None);
14532                    }
14533                    std::task::Poll::Ready(Err(e)) => {
14534                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14535                            e.into(),
14536                        ))));
14537                    }
14538                }
14539
14540                // A message has been received from the channel
14541                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14542
14543                std::task::Poll::Ready(Some(match header.ordinal {
14544                    0x20d8a7aba2168a79 => {
14545                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14546                        let mut req = fidl::new_empty!(
14547                            fidl_fuchsia_unknown::CloneableCloneRequest,
14548                            fidl::encoding::DefaultFuchsiaResourceDialect
14549                        );
14550                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14551                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14552                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14553                    }
14554                    0x5ac5d459ad7f657e => {
14555                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14556                        let mut req = fidl::new_empty!(
14557                            fidl::encoding::EmptyPayload,
14558                            fidl::encoding::DefaultFuchsiaResourceDialect
14559                        );
14560                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14561                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14562                        Ok(NodeRequest::Close {
14563                            responder: NodeCloseResponder {
14564                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14565                                tx_id: header.tx_id,
14566                            },
14567                        })
14568                    }
14569                    0x2658edee9decfc06 => {
14570                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14571                        let mut req = fidl::new_empty!(
14572                            fidl::encoding::EmptyPayload,
14573                            fidl::encoding::DefaultFuchsiaResourceDialect
14574                        );
14575                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14576                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14577                        Ok(NodeRequest::Query {
14578                            responder: NodeQueryResponder {
14579                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14580                                tx_id: header.tx_id,
14581                            },
14582                        })
14583                    }
14584                    0x78985e216314dafd => {
14585                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14586                        let mut req = fidl::new_empty!(
14587                            fidl::encoding::EmptyPayload,
14588                            fidl::encoding::DefaultFuchsiaResourceDialect
14589                        );
14590                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14591                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14592                        Ok(NodeRequest::DeprecatedGetAttr {
14593                            responder: NodeDeprecatedGetAttrResponder {
14594                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14595                                tx_id: header.tx_id,
14596                            },
14597                        })
14598                    }
14599                    0x4186c0f40d938f46 => {
14600                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14601                        let mut req = fidl::new_empty!(
14602                            NodeDeprecatedSetAttrRequest,
14603                            fidl::encoding::DefaultFuchsiaResourceDialect
14604                        );
14605                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14606                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14607                        Ok(NodeRequest::DeprecatedSetAttr {
14608                            flags: req.flags,
14609                            attributes: req.attributes,
14610
14611                            responder: NodeDeprecatedSetAttrResponder {
14612                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14613                                tx_id: header.tx_id,
14614                            },
14615                        })
14616                    }
14617                    0x5b88fffb8eda3aa1 => {
14618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14619                        let mut req = fidl::new_empty!(
14620                            fidl::encoding::EmptyPayload,
14621                            fidl::encoding::DefaultFuchsiaResourceDialect
14622                        );
14623                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14624                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14625                        Ok(NodeRequest::DeprecatedGetFlags {
14626                            responder: NodeDeprecatedGetFlagsResponder {
14627                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14628                                tx_id: header.tx_id,
14629                            },
14630                        })
14631                    }
14632                    0x5295b76c71fde733 => {
14633                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14634                        let mut req = fidl::new_empty!(
14635                            NodeDeprecatedSetFlagsRequest,
14636                            fidl::encoding::DefaultFuchsiaResourceDialect
14637                        );
14638                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14639                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14640                        Ok(NodeRequest::DeprecatedSetFlags {
14641                            flags: req.flags,
14642
14643                            responder: NodeDeprecatedSetFlagsResponder {
14644                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14645                                tx_id: header.tx_id,
14646                            },
14647                        })
14648                    }
14649                    0x176eb318f64ec23 => {
14650                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14651                        let mut req = fidl::new_empty!(
14652                            fidl::encoding::EmptyPayload,
14653                            fidl::encoding::DefaultFuchsiaResourceDialect
14654                        );
14655                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14656                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14657                        Ok(NodeRequest::GetFlags {
14658                            responder: NodeGetFlagsResponder {
14659                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14660                                tx_id: header.tx_id,
14661                            },
14662                        })
14663                    }
14664                    0x55a8028685791ea8 => {
14665                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14666                        let mut req = fidl::new_empty!(
14667                            NodeSetFlagsRequest,
14668                            fidl::encoding::DefaultFuchsiaResourceDialect
14669                        );
14670                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14671                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14672                        Ok(NodeRequest::SetFlags {
14673                            flags: req.flags,
14674
14675                            responder: NodeSetFlagsResponder {
14676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14677                                tx_id: header.tx_id,
14678                            },
14679                        })
14680                    }
14681                    0x6f344a1c6b0a0610 => {
14682                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14683                        let mut req = fidl::new_empty!(
14684                            fidl::encoding::EmptyPayload,
14685                            fidl::encoding::DefaultFuchsiaResourceDialect
14686                        );
14687                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14688                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14689                        Ok(NodeRequest::QueryFilesystem {
14690                            responder: NodeQueryFilesystemResponder {
14691                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14692                                tx_id: header.tx_id,
14693                            },
14694                        })
14695                    }
14696                    0x5054f0ade7076cec => {
14697                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14698                        let mut req = fidl::new_empty!(
14699                            fidl::encoding::EmptyPayload,
14700                            fidl::encoding::DefaultFuchsiaResourceDialect
14701                        );
14702                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14703                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14704                        Ok(NodeRequest::GetToken {
14705                            responder: NodeGetTokenResponder {
14706                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14707                                tx_id: header.tx_id,
14708                            },
14709                        })
14710                    }
14711                    0x3d4396a638ea053b => {
14712                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14713                        let mut req = fidl::new_empty!(
14714                            NodeGetAttributesRequest,
14715                            fidl::encoding::DefaultFuchsiaResourceDialect
14716                        );
14717                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14718                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14719                        Ok(NodeRequest::GetAttributes {
14720                            query: req.query,
14721
14722                            responder: NodeGetAttributesResponder {
14723                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14724                                tx_id: header.tx_id,
14725                            },
14726                        })
14727                    }
14728                    0x3308c1da5a89bf08 => {
14729                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14730                        let mut req = fidl::new_empty!(
14731                            MutableNodeAttributes,
14732                            fidl::encoding::DefaultFuchsiaResourceDialect
14733                        );
14734                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14735                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14736                        Ok(NodeRequest::UpdateAttributes {
14737                            payload: req,
14738                            responder: NodeUpdateAttributesResponder {
14739                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14740                                tx_id: header.tx_id,
14741                            },
14742                        })
14743                    }
14744                    0x2c5c27ca0ab5dc49 => {
14745                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14746                        let mut req = fidl::new_empty!(
14747                            fidl::encoding::EmptyPayload,
14748                            fidl::encoding::DefaultFuchsiaResourceDialect
14749                        );
14750                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14751                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14752                        Ok(NodeRequest::Sync {
14753                            responder: NodeSyncResponder {
14754                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14755                                tx_id: header.tx_id,
14756                            },
14757                        })
14758                    }
14759                    0x4b61033de007fcd0 => {
14760                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14761                        let mut req = fidl::new_empty!(
14762                            NodeListExtendedAttributesRequest,
14763                            fidl::encoding::DefaultFuchsiaResourceDialect
14764                        );
14765                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14766                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14767                        Ok(NodeRequest::ListExtendedAttributes {
14768                            iterator: req.iterator,
14769
14770                            control_handle,
14771                        })
14772                    }
14773                    0x45ffa3ccfdeb76db => {
14774                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14775                        let mut req = fidl::new_empty!(
14776                            NodeGetExtendedAttributeRequest,
14777                            fidl::encoding::DefaultFuchsiaResourceDialect
14778                        );
14779                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14780                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14781                        Ok(NodeRequest::GetExtendedAttribute {
14782                            name: req.name,
14783
14784                            responder: NodeGetExtendedAttributeResponder {
14785                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14786                                tx_id: header.tx_id,
14787                            },
14788                        })
14789                    }
14790                    0x4a951362f681f23c => {
14791                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14792                        let mut req = fidl::new_empty!(
14793                            NodeSetExtendedAttributeRequest,
14794                            fidl::encoding::DefaultFuchsiaResourceDialect
14795                        );
14796                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14797                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14798                        Ok(NodeRequest::SetExtendedAttribute {
14799                            name: req.name,
14800                            value: req.value,
14801                            mode: req.mode,
14802
14803                            responder: NodeSetExtendedAttributeResponder {
14804                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14805                                tx_id: header.tx_id,
14806                            },
14807                        })
14808                    }
14809                    0x7a0b9f3a9bf9032d => {
14810                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14811                        let mut req = fidl::new_empty!(
14812                            NodeRemoveExtendedAttributeRequest,
14813                            fidl::encoding::DefaultFuchsiaResourceDialect
14814                        );
14815                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14816                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14817                        Ok(NodeRequest::RemoveExtendedAttribute {
14818                            name: req.name,
14819
14820                            responder: NodeRemoveExtendedAttributeResponder {
14821                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14822                                tx_id: header.tx_id,
14823                            },
14824                        })
14825                    }
14826                    _ if header.tx_id == 0
14827                        && header
14828                            .dynamic_flags()
14829                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14830                    {
14831                        Ok(NodeRequest::_UnknownMethod {
14832                            ordinal: header.ordinal,
14833                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14834                            method_type: fidl::MethodType::OneWay,
14835                        })
14836                    }
14837                    _ if header
14838                        .dynamic_flags()
14839                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14840                    {
14841                        this.inner.send_framework_err(
14842                            fidl::encoding::FrameworkErr::UnknownMethod,
14843                            header.tx_id,
14844                            header.ordinal,
14845                            header.dynamic_flags(),
14846                            (bytes, handles),
14847                        )?;
14848                        Ok(NodeRequest::_UnknownMethod {
14849                            ordinal: header.ordinal,
14850                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14851                            method_type: fidl::MethodType::TwoWay,
14852                        })
14853                    }
14854                    _ => Err(fidl::Error::UnknownOrdinal {
14855                        ordinal: header.ordinal,
14856                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14857                    }),
14858                }))
14859            },
14860        )
14861    }
14862}
14863
14864/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14865#[derive(Debug)]
14866pub enum NodeRequest {
14867    Clone {
14868        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14869        control_handle: NodeControlHandle,
14870    },
14871    /// Terminates the connection.
14872    ///
14873    /// After calling `Close`, the client must not send any other requests.
14874    ///
14875    /// Servers, after sending the status response, should close the connection
14876    /// regardless of status and without sending an epitaph.
14877    ///
14878    /// Closing the client end of the channel should be semantically equivalent
14879    /// to calling `Close` without knowing when the close has completed or its
14880    /// status.
14881    Close {
14882        responder: NodeCloseResponder,
14883    },
14884    Query {
14885        responder: NodeQueryResponder,
14886    },
14887    /// DEPRECATED - Use `Node.GetAttributes` instead.
14888    ///
14889    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14890    DeprecatedGetAttr {
14891        responder: NodeDeprecatedGetAttrResponder,
14892    },
14893    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14894    DeprecatedSetAttr {
14895        flags: NodeAttributeFlags,
14896        attributes: NodeAttributes,
14897        responder: NodeDeprecatedSetAttrResponder,
14898    },
14899    /// [DEPRECATED - Use new GetFlags method instead.]
14900    DeprecatedGetFlags {
14901        responder: NodeDeprecatedGetFlagsResponder,
14902    },
14903    /// [DEPRECATED - Use new SetFlags method instead.]
14904    DeprecatedSetFlags {
14905        flags: OpenFlags,
14906        responder: NodeDeprecatedSetFlagsResponder,
14907    },
14908    /// Queries the flags that apply to this node after it has been opened/created. This method does
14909    /// not require any rights.
14910    ///
14911    /// Note that the final set of flags that apply to the connection may differ from those
14912    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14913    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14914    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14915    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14916    GetFlags {
14917        responder: NodeGetFlagsResponder,
14918    },
14919    /// Sets the flags that apply to this node after it has been opened. This method does not
14920    /// require any rights.
14921    ///
14922    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14923    /// clear append mode.
14924    ///
14925    /// Errors:
14926    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14927    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14928    SetFlags {
14929        flags: Flags,
14930        responder: NodeSetFlagsResponder,
14931    },
14932    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14933    /// volume has different settings or the storage is accounted seperately from the rest of the
14934    /// filesystem that may be reported instead of filesystem-wide details.
14935    QueryFilesystem {
14936        responder: NodeQueryFilesystemResponder,
14937    },
14938    /// Acquires a token which can be used to identify this connection at a later point in
14939    /// time. The token will remain valid for as long as the connection requesting the token
14940    /// remains open.
14941    ///
14942    /// This method does not require any rights. Note that the token identifies
14943    /// the connection, hence carries the rights information on this connection.
14944    GetToken {
14945        responder: NodeGetTokenResponder,
14946    },
14947    /// Acquires information about the node.
14948    ///
14949    /// The attributes of a node should be stable, independent of the
14950    /// specific protocol used to access it.
14951    ///
14952    /// If a particular attribute is not applicable or not supported,
14953    /// filesystems should leave the corresponding field absent.
14954    ///
14955    /// + `query` a bit-mask specifying which attributes to fetch. The server
14956    ///   should not return more than necessary.
14957    /// - `attributes` the returned attributes.
14958    ///
14959    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14960    GetAttributes {
14961        query: NodeAttributesQuery,
14962        responder: NodeGetAttributesResponder,
14963    },
14964    /// Updates information about the node.
14965    ///
14966    /// + `attributes` the presence of a table field in `attributes` indicates
14967    /// the intent to update the corresponding attribute.
14968    ///
14969    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14970    ///
14971    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14972    UpdateAttributes {
14973        payload: MutableNodeAttributes,
14974        responder: NodeUpdateAttributesResponder,
14975    },
14976    /// Synchronizes updates to the node to the underlying media, if it exists.
14977    ///
14978    /// This method will return when the filesystem server has flushed the
14979    /// relevant updates to the underlying media, but does not guarantee the
14980    /// underlying media has persisted the information, nor that any information
14981    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14982    /// between operations.
14983    ///
14984    /// This method does not require any rights.
14985    Sync {
14986        responder: NodeSyncResponder,
14987    },
14988    /// Creates an iterator over all the extended attribute names associated
14989    /// with this node. If an error occurs it is returned as an epitaph on the
14990    /// iterator request channel, and then the channel is closed.
14991    ///
14992    /// GetExtendedAttributes can be used with any of these names to retrieve
14993    /// the associated value.
14994    ///
14995    /// This method requires the [`Rights.READ_BYTES`] right.
14996    ListExtendedAttributes {
14997        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14998        control_handle: NodeControlHandle,
14999    },
15000    /// Get the value associated with the given attribute `name` for this node.
15001    ///
15002    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15003    /// particular structure is imposed on them.
15004    ///
15005    /// This method requires the [`Rights.READ_BYTES`] right.
15006    GetExtendedAttribute {
15007        name: Vec<u8>,
15008        responder: NodeGetExtendedAttributeResponder,
15009    },
15010    /// Set the value for the given attribute `name` to `value` for this node.
15011    ///
15012    /// The attribute name may exist, in which case the attribute is updated.
15013    /// If the attribute doesn't exist, it is created. The name should have no
15014    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15015    ///
15016    /// This method requires the [`Rights.WRITE_BYTES`] right.
15017    SetExtendedAttribute {
15018        name: Vec<u8>,
15019        value: ExtendedAttributeValue,
15020        mode: SetExtendedAttributeMode,
15021        responder: NodeSetExtendedAttributeResponder,
15022    },
15023    /// Remove the specified extended attribute.
15024    ///
15025    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15026    ///
15027    /// This method requires the [`Rights.WRITE_BYTES`] right.
15028    RemoveExtendedAttribute {
15029        name: Vec<u8>,
15030        responder: NodeRemoveExtendedAttributeResponder,
15031    },
15032    /// An interaction was received which does not match any known method.
15033    #[non_exhaustive]
15034    _UnknownMethod {
15035        /// Ordinal of the method that was called.
15036        ordinal: u64,
15037        control_handle: NodeControlHandle,
15038        method_type: fidl::MethodType,
15039    },
15040}
15041
15042impl NodeRequest {
15043    #[allow(irrefutable_let_patterns)]
15044    pub fn into_clone(
15045        self,
15046    ) -> Option<(
15047        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
15048        NodeControlHandle,
15049    )> {
15050        if let NodeRequest::Clone { request, control_handle } = self {
15051            Some((request, control_handle))
15052        } else {
15053            None
15054        }
15055    }
15056
15057    #[allow(irrefutable_let_patterns)]
15058    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
15059        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
15060    }
15061
15062    #[allow(irrefutable_let_patterns)]
15063    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
15064        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
15065    }
15066
15067    #[allow(irrefutable_let_patterns)]
15068    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
15069        if let NodeRequest::DeprecatedGetAttr { responder } = self {
15070            Some((responder))
15071        } else {
15072            None
15073        }
15074    }
15075
15076    #[allow(irrefutable_let_patterns)]
15077    pub fn into_deprecated_set_attr(
15078        self,
15079    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
15080        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
15081            Some((flags, attributes, responder))
15082        } else {
15083            None
15084        }
15085    }
15086
15087    #[allow(irrefutable_let_patterns)]
15088    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
15089        if let NodeRequest::DeprecatedGetFlags { responder } = self {
15090            Some((responder))
15091        } else {
15092            None
15093        }
15094    }
15095
15096    #[allow(irrefutable_let_patterns)]
15097    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
15098        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
15099            Some((flags, responder))
15100        } else {
15101            None
15102        }
15103    }
15104
15105    #[allow(irrefutable_let_patterns)]
15106    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
15107        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
15108    }
15109
15110    #[allow(irrefutable_let_patterns)]
15111    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
15112        if let NodeRequest::SetFlags { flags, responder } = self {
15113            Some((flags, responder))
15114        } else {
15115            None
15116        }
15117    }
15118
15119    #[allow(irrefutable_let_patterns)]
15120    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
15121        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
15122    }
15123
15124    #[allow(irrefutable_let_patterns)]
15125    pub fn into_get_token(self) -> Option<(NodeGetTokenResponder)> {
15126        if let NodeRequest::GetToken { responder } = self { Some((responder)) } else { None }
15127    }
15128
15129    #[allow(irrefutable_let_patterns)]
15130    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
15131        if let NodeRequest::GetAttributes { query, responder } = self {
15132            Some((query, responder))
15133        } else {
15134            None
15135        }
15136    }
15137
15138    #[allow(irrefutable_let_patterns)]
15139    pub fn into_update_attributes(
15140        self,
15141    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
15142        if let NodeRequest::UpdateAttributes { payload, responder } = self {
15143            Some((payload, responder))
15144        } else {
15145            None
15146        }
15147    }
15148
15149    #[allow(irrefutable_let_patterns)]
15150    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
15151        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
15152    }
15153
15154    #[allow(irrefutable_let_patterns)]
15155    pub fn into_list_extended_attributes(
15156        self,
15157    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
15158    {
15159        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
15160            Some((iterator, control_handle))
15161        } else {
15162            None
15163        }
15164    }
15165
15166    #[allow(irrefutable_let_patterns)]
15167    pub fn into_get_extended_attribute(
15168        self,
15169    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
15170        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
15171            Some((name, responder))
15172        } else {
15173            None
15174        }
15175    }
15176
15177    #[allow(irrefutable_let_patterns)]
15178    pub fn into_set_extended_attribute(
15179        self,
15180    ) -> Option<(
15181        Vec<u8>,
15182        ExtendedAttributeValue,
15183        SetExtendedAttributeMode,
15184        NodeSetExtendedAttributeResponder,
15185    )> {
15186        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
15187            Some((name, value, mode, responder))
15188        } else {
15189            None
15190        }
15191    }
15192
15193    #[allow(irrefutable_let_patterns)]
15194    pub fn into_remove_extended_attribute(
15195        self,
15196    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
15197        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
15198            Some((name, responder))
15199        } else {
15200            None
15201        }
15202    }
15203
15204    /// Name of the method defined in FIDL
15205    pub fn method_name(&self) -> &'static str {
15206        match *self {
15207            NodeRequest::Clone { .. } => "clone",
15208            NodeRequest::Close { .. } => "close",
15209            NodeRequest::Query { .. } => "query",
15210            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
15211            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
15212            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
15213            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
15214            NodeRequest::GetFlags { .. } => "get_flags",
15215            NodeRequest::SetFlags { .. } => "set_flags",
15216            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
15217            NodeRequest::GetToken { .. } => "get_token",
15218            NodeRequest::GetAttributes { .. } => "get_attributes",
15219            NodeRequest::UpdateAttributes { .. } => "update_attributes",
15220            NodeRequest::Sync { .. } => "sync",
15221            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
15222            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
15223            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
15224            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
15225            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
15226                "unknown one-way method"
15227            }
15228            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
15229                "unknown two-way method"
15230            }
15231        }
15232    }
15233}
15234
15235#[derive(Debug, Clone)]
15236pub struct NodeControlHandle {
15237    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
15238}
15239
15240impl NodeControlHandle {
15241    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
15242        self.inner.shutdown_with_epitaph(status.into())
15243    }
15244}
15245
15246impl fidl::endpoints::ControlHandle for NodeControlHandle {
15247    fn shutdown(&self) {
15248        self.inner.shutdown()
15249    }
15250
15251    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
15252        self.inner.shutdown_with_epitaph(status)
15253    }
15254
15255    fn is_closed(&self) -> bool {
15256        self.inner.channel().is_closed()
15257    }
15258    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
15259        self.inner.channel().on_closed()
15260    }
15261
15262    #[cfg(target_os = "fuchsia")]
15263    fn signal_peer(
15264        &self,
15265        clear_mask: zx::Signals,
15266        set_mask: zx::Signals,
15267    ) -> Result<(), zx_status::Status> {
15268        use fidl::Peered;
15269        self.inner.channel().signal_peer(clear_mask, set_mask)
15270    }
15271}
15272
15273impl NodeControlHandle {
15274    pub fn send_on_open_(
15275        &self,
15276        mut s: i32,
15277        mut info: Option<NodeInfoDeprecated>,
15278    ) -> Result<(), fidl::Error> {
15279        self.inner.send::<NodeOnOpenRequest>(
15280            (s, info.as_mut()),
15281            0,
15282            0x7fc7bbb1dbfd1972,
15283            fidl::encoding::DynamicFlags::FLEXIBLE,
15284        )
15285    }
15286
15287    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
15288        self.inner.send::<Representation>(
15289            &mut payload,
15290            0,
15291            0x5cb40567d80a510c,
15292            fidl::encoding::DynamicFlags::empty(),
15293        )
15294    }
15295}
15296
15297#[must_use = "FIDL methods require a response to be sent"]
15298#[derive(Debug)]
15299pub struct NodeCloseResponder {
15300    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15301    tx_id: u32,
15302}
15303
15304/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15305/// if the responder is dropped without sending a response, so that the client
15306/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15307impl std::ops::Drop for NodeCloseResponder {
15308    fn drop(&mut self) {
15309        self.control_handle.shutdown();
15310        // Safety: drops once, never accessed again
15311        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15312    }
15313}
15314
15315impl fidl::endpoints::Responder for NodeCloseResponder {
15316    type ControlHandle = NodeControlHandle;
15317
15318    fn control_handle(&self) -> &NodeControlHandle {
15319        &self.control_handle
15320    }
15321
15322    fn drop_without_shutdown(mut self) {
15323        // Safety: drops once, never accessed again due to mem::forget
15324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15325        // Prevent Drop from running (which would shut down the channel)
15326        std::mem::forget(self);
15327    }
15328}
15329
15330impl NodeCloseResponder {
15331    /// Sends a response to the FIDL transaction.
15332    ///
15333    /// Sets the channel to shutdown if an error occurs.
15334    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15335        let _result = self.send_raw(result);
15336        if _result.is_err() {
15337            self.control_handle.shutdown();
15338        }
15339        self.drop_without_shutdown();
15340        _result
15341    }
15342
15343    /// Similar to "send" but does not shutdown the channel if an error occurs.
15344    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15345        let _result = self.send_raw(result);
15346        self.drop_without_shutdown();
15347        _result
15348    }
15349
15350    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15351        self.control_handle
15352            .inner
15353            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15354                result,
15355                self.tx_id,
15356                0x5ac5d459ad7f657e,
15357                fidl::encoding::DynamicFlags::empty(),
15358            )
15359    }
15360}
15361
15362#[must_use = "FIDL methods require a response to be sent"]
15363#[derive(Debug)]
15364pub struct NodeQueryResponder {
15365    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15366    tx_id: u32,
15367}
15368
15369/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15370/// if the responder is dropped without sending a response, so that the client
15371/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15372impl std::ops::Drop for NodeQueryResponder {
15373    fn drop(&mut self) {
15374        self.control_handle.shutdown();
15375        // Safety: drops once, never accessed again
15376        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15377    }
15378}
15379
15380impl fidl::endpoints::Responder for NodeQueryResponder {
15381    type ControlHandle = NodeControlHandle;
15382
15383    fn control_handle(&self) -> &NodeControlHandle {
15384        &self.control_handle
15385    }
15386
15387    fn drop_without_shutdown(mut self) {
15388        // Safety: drops once, never accessed again due to mem::forget
15389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15390        // Prevent Drop from running (which would shut down the channel)
15391        std::mem::forget(self);
15392    }
15393}
15394
15395impl NodeQueryResponder {
15396    /// Sends a response to the FIDL transaction.
15397    ///
15398    /// Sets the channel to shutdown if an error occurs.
15399    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15400        let _result = self.send_raw(protocol);
15401        if _result.is_err() {
15402            self.control_handle.shutdown();
15403        }
15404        self.drop_without_shutdown();
15405        _result
15406    }
15407
15408    /// Similar to "send" but does not shutdown the channel if an error occurs.
15409    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15410        let _result = self.send_raw(protocol);
15411        self.drop_without_shutdown();
15412        _result
15413    }
15414
15415    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15416        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15417            (protocol,),
15418            self.tx_id,
15419            0x2658edee9decfc06,
15420            fidl::encoding::DynamicFlags::empty(),
15421        )
15422    }
15423}
15424
15425#[must_use = "FIDL methods require a response to be sent"]
15426#[derive(Debug)]
15427pub struct NodeDeprecatedGetAttrResponder {
15428    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15429    tx_id: u32,
15430}
15431
15432/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15433/// if the responder is dropped without sending a response, so that the client
15434/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15435impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15436    fn drop(&mut self) {
15437        self.control_handle.shutdown();
15438        // Safety: drops once, never accessed again
15439        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15440    }
15441}
15442
15443impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15444    type ControlHandle = NodeControlHandle;
15445
15446    fn control_handle(&self) -> &NodeControlHandle {
15447        &self.control_handle
15448    }
15449
15450    fn drop_without_shutdown(mut self) {
15451        // Safety: drops once, never accessed again due to mem::forget
15452        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15453        // Prevent Drop from running (which would shut down the channel)
15454        std::mem::forget(self);
15455    }
15456}
15457
15458impl NodeDeprecatedGetAttrResponder {
15459    /// Sends a response to the FIDL transaction.
15460    ///
15461    /// Sets the channel to shutdown if an error occurs.
15462    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15463        let _result = self.send_raw(s, attributes);
15464        if _result.is_err() {
15465            self.control_handle.shutdown();
15466        }
15467        self.drop_without_shutdown();
15468        _result
15469    }
15470
15471    /// Similar to "send" but does not shutdown the channel if an error occurs.
15472    pub fn send_no_shutdown_on_err(
15473        self,
15474        mut s: i32,
15475        mut attributes: &NodeAttributes,
15476    ) -> Result<(), fidl::Error> {
15477        let _result = self.send_raw(s, attributes);
15478        self.drop_without_shutdown();
15479        _result
15480    }
15481
15482    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15483        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15484            (s, attributes),
15485            self.tx_id,
15486            0x78985e216314dafd,
15487            fidl::encoding::DynamicFlags::empty(),
15488        )
15489    }
15490}
15491
15492#[must_use = "FIDL methods require a response to be sent"]
15493#[derive(Debug)]
15494pub struct NodeDeprecatedSetAttrResponder {
15495    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15496    tx_id: u32,
15497}
15498
15499/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15500/// if the responder is dropped without sending a response, so that the client
15501/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15502impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15503    fn drop(&mut self) {
15504        self.control_handle.shutdown();
15505        // Safety: drops once, never accessed again
15506        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15507    }
15508}
15509
15510impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15511    type ControlHandle = NodeControlHandle;
15512
15513    fn control_handle(&self) -> &NodeControlHandle {
15514        &self.control_handle
15515    }
15516
15517    fn drop_without_shutdown(mut self) {
15518        // Safety: drops once, never accessed again due to mem::forget
15519        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15520        // Prevent Drop from running (which would shut down the channel)
15521        std::mem::forget(self);
15522    }
15523}
15524
15525impl NodeDeprecatedSetAttrResponder {
15526    /// Sends a response to the FIDL transaction.
15527    ///
15528    /// Sets the channel to shutdown if an error occurs.
15529    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15530        let _result = self.send_raw(s);
15531        if _result.is_err() {
15532            self.control_handle.shutdown();
15533        }
15534        self.drop_without_shutdown();
15535        _result
15536    }
15537
15538    /// Similar to "send" but does not shutdown the channel if an error occurs.
15539    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15540        let _result = self.send_raw(s);
15541        self.drop_without_shutdown();
15542        _result
15543    }
15544
15545    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15546        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15547            (s,),
15548            self.tx_id,
15549            0x4186c0f40d938f46,
15550            fidl::encoding::DynamicFlags::empty(),
15551        )
15552    }
15553}
15554
15555#[must_use = "FIDL methods require a response to be sent"]
15556#[derive(Debug)]
15557pub struct NodeDeprecatedGetFlagsResponder {
15558    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15559    tx_id: u32,
15560}
15561
15562/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15563/// if the responder is dropped without sending a response, so that the client
15564/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15565impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15566    fn drop(&mut self) {
15567        self.control_handle.shutdown();
15568        // Safety: drops once, never accessed again
15569        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15570    }
15571}
15572
15573impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15574    type ControlHandle = NodeControlHandle;
15575
15576    fn control_handle(&self) -> &NodeControlHandle {
15577        &self.control_handle
15578    }
15579
15580    fn drop_without_shutdown(mut self) {
15581        // Safety: drops once, never accessed again due to mem::forget
15582        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15583        // Prevent Drop from running (which would shut down the channel)
15584        std::mem::forget(self);
15585    }
15586}
15587
15588impl NodeDeprecatedGetFlagsResponder {
15589    /// Sends a response to the FIDL transaction.
15590    ///
15591    /// Sets the channel to shutdown if an error occurs.
15592    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15593        let _result = self.send_raw(s, flags);
15594        if _result.is_err() {
15595            self.control_handle.shutdown();
15596        }
15597        self.drop_without_shutdown();
15598        _result
15599    }
15600
15601    /// Similar to "send" but does not shutdown the channel if an error occurs.
15602    pub fn send_no_shutdown_on_err(
15603        self,
15604        mut s: i32,
15605        mut flags: OpenFlags,
15606    ) -> Result<(), fidl::Error> {
15607        let _result = self.send_raw(s, flags);
15608        self.drop_without_shutdown();
15609        _result
15610    }
15611
15612    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15613        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15614            (s, flags),
15615            self.tx_id,
15616            0x5b88fffb8eda3aa1,
15617            fidl::encoding::DynamicFlags::empty(),
15618        )
15619    }
15620}
15621
15622#[must_use = "FIDL methods require a response to be sent"]
15623#[derive(Debug)]
15624pub struct NodeDeprecatedSetFlagsResponder {
15625    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15626    tx_id: u32,
15627}
15628
15629/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15630/// if the responder is dropped without sending a response, so that the client
15631/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15632impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15633    fn drop(&mut self) {
15634        self.control_handle.shutdown();
15635        // Safety: drops once, never accessed again
15636        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15637    }
15638}
15639
15640impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15641    type ControlHandle = NodeControlHandle;
15642
15643    fn control_handle(&self) -> &NodeControlHandle {
15644        &self.control_handle
15645    }
15646
15647    fn drop_without_shutdown(mut self) {
15648        // Safety: drops once, never accessed again due to mem::forget
15649        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15650        // Prevent Drop from running (which would shut down the channel)
15651        std::mem::forget(self);
15652    }
15653}
15654
15655impl NodeDeprecatedSetFlagsResponder {
15656    /// Sends a response to the FIDL transaction.
15657    ///
15658    /// Sets the channel to shutdown if an error occurs.
15659    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15660        let _result = self.send_raw(s);
15661        if _result.is_err() {
15662            self.control_handle.shutdown();
15663        }
15664        self.drop_without_shutdown();
15665        _result
15666    }
15667
15668    /// Similar to "send" but does not shutdown the channel if an error occurs.
15669    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15670        let _result = self.send_raw(s);
15671        self.drop_without_shutdown();
15672        _result
15673    }
15674
15675    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15676        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15677            (s,),
15678            self.tx_id,
15679            0x5295b76c71fde733,
15680            fidl::encoding::DynamicFlags::empty(),
15681        )
15682    }
15683}
15684
15685#[must_use = "FIDL methods require a response to be sent"]
15686#[derive(Debug)]
15687pub struct NodeGetFlagsResponder {
15688    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15689    tx_id: u32,
15690}
15691
15692/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15693/// if the responder is dropped without sending a response, so that the client
15694/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15695impl std::ops::Drop for NodeGetFlagsResponder {
15696    fn drop(&mut self) {
15697        self.control_handle.shutdown();
15698        // Safety: drops once, never accessed again
15699        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15700    }
15701}
15702
15703impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15704    type ControlHandle = NodeControlHandle;
15705
15706    fn control_handle(&self) -> &NodeControlHandle {
15707        &self.control_handle
15708    }
15709
15710    fn drop_without_shutdown(mut self) {
15711        // Safety: drops once, never accessed again due to mem::forget
15712        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15713        // Prevent Drop from running (which would shut down the channel)
15714        std::mem::forget(self);
15715    }
15716}
15717
15718impl NodeGetFlagsResponder {
15719    /// Sends a response to the FIDL transaction.
15720    ///
15721    /// Sets the channel to shutdown if an error occurs.
15722    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15723        let _result = self.send_raw(result);
15724        if _result.is_err() {
15725            self.control_handle.shutdown();
15726        }
15727        self.drop_without_shutdown();
15728        _result
15729    }
15730
15731    /// Similar to "send" but does not shutdown the channel if an error occurs.
15732    pub fn send_no_shutdown_on_err(
15733        self,
15734        mut result: Result<Flags, i32>,
15735    ) -> Result<(), fidl::Error> {
15736        let _result = self.send_raw(result);
15737        self.drop_without_shutdown();
15738        _result
15739    }
15740
15741    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15742        self.control_handle
15743            .inner
15744            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15745                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15746                self.tx_id,
15747                0x176eb318f64ec23,
15748                fidl::encoding::DynamicFlags::FLEXIBLE,
15749            )
15750    }
15751}
15752
15753#[must_use = "FIDL methods require a response to be sent"]
15754#[derive(Debug)]
15755pub struct NodeSetFlagsResponder {
15756    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15757    tx_id: u32,
15758}
15759
15760/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15761/// if the responder is dropped without sending a response, so that the client
15762/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15763impl std::ops::Drop for NodeSetFlagsResponder {
15764    fn drop(&mut self) {
15765        self.control_handle.shutdown();
15766        // Safety: drops once, never accessed again
15767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15768    }
15769}
15770
15771impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15772    type ControlHandle = NodeControlHandle;
15773
15774    fn control_handle(&self) -> &NodeControlHandle {
15775        &self.control_handle
15776    }
15777
15778    fn drop_without_shutdown(mut self) {
15779        // Safety: drops once, never accessed again due to mem::forget
15780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15781        // Prevent Drop from running (which would shut down the channel)
15782        std::mem::forget(self);
15783    }
15784}
15785
15786impl NodeSetFlagsResponder {
15787    /// Sends a response to the FIDL transaction.
15788    ///
15789    /// Sets the channel to shutdown if an error occurs.
15790    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15791        let _result = self.send_raw(result);
15792        if _result.is_err() {
15793            self.control_handle.shutdown();
15794        }
15795        self.drop_without_shutdown();
15796        _result
15797    }
15798
15799    /// Similar to "send" but does not shutdown the channel if an error occurs.
15800    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15801        let _result = self.send_raw(result);
15802        self.drop_without_shutdown();
15803        _result
15804    }
15805
15806    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15807        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15808            fidl::encoding::EmptyStruct,
15809            i32,
15810        >>(
15811            fidl::encoding::FlexibleResult::new(result),
15812            self.tx_id,
15813            0x55a8028685791ea8,
15814            fidl::encoding::DynamicFlags::FLEXIBLE,
15815        )
15816    }
15817}
15818
15819#[must_use = "FIDL methods require a response to be sent"]
15820#[derive(Debug)]
15821pub struct NodeQueryFilesystemResponder {
15822    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15823    tx_id: u32,
15824}
15825
15826/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15827/// if the responder is dropped without sending a response, so that the client
15828/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15829impl std::ops::Drop for NodeQueryFilesystemResponder {
15830    fn drop(&mut self) {
15831        self.control_handle.shutdown();
15832        // Safety: drops once, never accessed again
15833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15834    }
15835}
15836
15837impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15838    type ControlHandle = NodeControlHandle;
15839
15840    fn control_handle(&self) -> &NodeControlHandle {
15841        &self.control_handle
15842    }
15843
15844    fn drop_without_shutdown(mut self) {
15845        // Safety: drops once, never accessed again due to mem::forget
15846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15847        // Prevent Drop from running (which would shut down the channel)
15848        std::mem::forget(self);
15849    }
15850}
15851
15852impl NodeQueryFilesystemResponder {
15853    /// Sends a response to the FIDL transaction.
15854    ///
15855    /// Sets the channel to shutdown if an error occurs.
15856    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15857        let _result = self.send_raw(s, info);
15858        if _result.is_err() {
15859            self.control_handle.shutdown();
15860        }
15861        self.drop_without_shutdown();
15862        _result
15863    }
15864
15865    /// Similar to "send" but does not shutdown the channel if an error occurs.
15866    pub fn send_no_shutdown_on_err(
15867        self,
15868        mut s: i32,
15869        mut info: Option<&FilesystemInfo>,
15870    ) -> Result<(), fidl::Error> {
15871        let _result = self.send_raw(s, info);
15872        self.drop_without_shutdown();
15873        _result
15874    }
15875
15876    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15877        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15878            (s, info),
15879            self.tx_id,
15880            0x6f344a1c6b0a0610,
15881            fidl::encoding::DynamicFlags::empty(),
15882        )
15883    }
15884}
15885
15886#[must_use = "FIDL methods require a response to be sent"]
15887#[derive(Debug)]
15888pub struct NodeGetTokenResponder {
15889    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15890    tx_id: u32,
15891}
15892
15893/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15894/// if the responder is dropped without sending a response, so that the client
15895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15896impl std::ops::Drop for NodeGetTokenResponder {
15897    fn drop(&mut self) {
15898        self.control_handle.shutdown();
15899        // Safety: drops once, never accessed again
15900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15901    }
15902}
15903
15904impl fidl::endpoints::Responder for NodeGetTokenResponder {
15905    type ControlHandle = NodeControlHandle;
15906
15907    fn control_handle(&self) -> &NodeControlHandle {
15908        &self.control_handle
15909    }
15910
15911    fn drop_without_shutdown(mut self) {
15912        // Safety: drops once, never accessed again due to mem::forget
15913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15914        // Prevent Drop from running (which would shut down the channel)
15915        std::mem::forget(self);
15916    }
15917}
15918
15919impl NodeGetTokenResponder {
15920    /// Sends a response to the FIDL transaction.
15921    ///
15922    /// Sets the channel to shutdown if an error occurs.
15923    pub fn send(self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
15924        let _result = self.send_raw(result);
15925        if _result.is_err() {
15926            self.control_handle.shutdown();
15927        }
15928        self.drop_without_shutdown();
15929        _result
15930    }
15931
15932    /// Similar to "send" but does not shutdown the channel if an error occurs.
15933    pub fn send_no_shutdown_on_err(
15934        self,
15935        mut result: Result<fidl::Event, i32>,
15936    ) -> Result<(), fidl::Error> {
15937        let _result = self.send_raw(result);
15938        self.drop_without_shutdown();
15939        _result
15940    }
15941
15942    fn send_raw(&self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
15943        self.control_handle
15944            .inner
15945            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
15946                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
15947                self.tx_id,
15948                0x5054f0ade7076cec,
15949                fidl::encoding::DynamicFlags::FLEXIBLE,
15950            )
15951    }
15952}
15953
15954#[must_use = "FIDL methods require a response to be sent"]
15955#[derive(Debug)]
15956pub struct NodeGetAttributesResponder {
15957    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15958    tx_id: u32,
15959}
15960
15961/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15962/// if the responder is dropped without sending a response, so that the client
15963/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15964impl std::ops::Drop for NodeGetAttributesResponder {
15965    fn drop(&mut self) {
15966        self.control_handle.shutdown();
15967        // Safety: drops once, never accessed again
15968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15969    }
15970}
15971
15972impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15973    type ControlHandle = NodeControlHandle;
15974
15975    fn control_handle(&self) -> &NodeControlHandle {
15976        &self.control_handle
15977    }
15978
15979    fn drop_without_shutdown(mut self) {
15980        // Safety: drops once, never accessed again due to mem::forget
15981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15982        // Prevent Drop from running (which would shut down the channel)
15983        std::mem::forget(self);
15984    }
15985}
15986
15987impl NodeGetAttributesResponder {
15988    /// Sends a response to the FIDL transaction.
15989    ///
15990    /// Sets the channel to shutdown if an error occurs.
15991    pub fn send(
15992        self,
15993        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15994    ) -> Result<(), fidl::Error> {
15995        let _result = self.send_raw(result);
15996        if _result.is_err() {
15997            self.control_handle.shutdown();
15998        }
15999        self.drop_without_shutdown();
16000        _result
16001    }
16002
16003    /// Similar to "send" but does not shutdown the channel if an error occurs.
16004    pub fn send_no_shutdown_on_err(
16005        self,
16006        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16007    ) -> Result<(), fidl::Error> {
16008        let _result = self.send_raw(result);
16009        self.drop_without_shutdown();
16010        _result
16011    }
16012
16013    fn send_raw(
16014        &self,
16015        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16016    ) -> Result<(), fidl::Error> {
16017        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16018            result,
16019            self.tx_id,
16020            0x3d4396a638ea053b,
16021            fidl::encoding::DynamicFlags::empty(),
16022        )
16023    }
16024}
16025
16026#[must_use = "FIDL methods require a response to be sent"]
16027#[derive(Debug)]
16028pub struct NodeUpdateAttributesResponder {
16029    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16030    tx_id: u32,
16031}
16032
16033/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16034/// if the responder is dropped without sending a response, so that the client
16035/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16036impl std::ops::Drop for NodeUpdateAttributesResponder {
16037    fn drop(&mut self) {
16038        self.control_handle.shutdown();
16039        // Safety: drops once, never accessed again
16040        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16041    }
16042}
16043
16044impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
16045    type ControlHandle = NodeControlHandle;
16046
16047    fn control_handle(&self) -> &NodeControlHandle {
16048        &self.control_handle
16049    }
16050
16051    fn drop_without_shutdown(mut self) {
16052        // Safety: drops once, never accessed again due to mem::forget
16053        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16054        // Prevent Drop from running (which would shut down the channel)
16055        std::mem::forget(self);
16056    }
16057}
16058
16059impl NodeUpdateAttributesResponder {
16060    /// Sends a response to the FIDL transaction.
16061    ///
16062    /// Sets the channel to shutdown if an error occurs.
16063    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16064        let _result = self.send_raw(result);
16065        if _result.is_err() {
16066            self.control_handle.shutdown();
16067        }
16068        self.drop_without_shutdown();
16069        _result
16070    }
16071
16072    /// Similar to "send" but does not shutdown the channel if an error occurs.
16073    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16074        let _result = self.send_raw(result);
16075        self.drop_without_shutdown();
16076        _result
16077    }
16078
16079    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16080        self.control_handle
16081            .inner
16082            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16083                result,
16084                self.tx_id,
16085                0x3308c1da5a89bf08,
16086                fidl::encoding::DynamicFlags::empty(),
16087            )
16088    }
16089}
16090
16091#[must_use = "FIDL methods require a response to be sent"]
16092#[derive(Debug)]
16093pub struct NodeSyncResponder {
16094    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16095    tx_id: u32,
16096}
16097
16098/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16099/// if the responder is dropped without sending a response, so that the client
16100/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16101impl std::ops::Drop for NodeSyncResponder {
16102    fn drop(&mut self) {
16103        self.control_handle.shutdown();
16104        // Safety: drops once, never accessed again
16105        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16106    }
16107}
16108
16109impl fidl::endpoints::Responder for NodeSyncResponder {
16110    type ControlHandle = NodeControlHandle;
16111
16112    fn control_handle(&self) -> &NodeControlHandle {
16113        &self.control_handle
16114    }
16115
16116    fn drop_without_shutdown(mut self) {
16117        // Safety: drops once, never accessed again due to mem::forget
16118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16119        // Prevent Drop from running (which would shut down the channel)
16120        std::mem::forget(self);
16121    }
16122}
16123
16124impl NodeSyncResponder {
16125    /// Sends a response to the FIDL transaction.
16126    ///
16127    /// Sets the channel to shutdown if an error occurs.
16128    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16129        let _result = self.send_raw(result);
16130        if _result.is_err() {
16131            self.control_handle.shutdown();
16132        }
16133        self.drop_without_shutdown();
16134        _result
16135    }
16136
16137    /// Similar to "send" but does not shutdown the channel if an error occurs.
16138    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16139        let _result = self.send_raw(result);
16140        self.drop_without_shutdown();
16141        _result
16142    }
16143
16144    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16145        self.control_handle
16146            .inner
16147            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16148                result,
16149                self.tx_id,
16150                0x2c5c27ca0ab5dc49,
16151                fidl::encoding::DynamicFlags::empty(),
16152            )
16153    }
16154}
16155
16156#[must_use = "FIDL methods require a response to be sent"]
16157#[derive(Debug)]
16158pub struct NodeGetExtendedAttributeResponder {
16159    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16160    tx_id: u32,
16161}
16162
16163/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16164/// if the responder is dropped without sending a response, so that the client
16165/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16166impl std::ops::Drop for NodeGetExtendedAttributeResponder {
16167    fn drop(&mut self) {
16168        self.control_handle.shutdown();
16169        // Safety: drops once, never accessed again
16170        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16171    }
16172}
16173
16174impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
16175    type ControlHandle = NodeControlHandle;
16176
16177    fn control_handle(&self) -> &NodeControlHandle {
16178        &self.control_handle
16179    }
16180
16181    fn drop_without_shutdown(mut self) {
16182        // Safety: drops once, never accessed again due to mem::forget
16183        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16184        // Prevent Drop from running (which would shut down the channel)
16185        std::mem::forget(self);
16186    }
16187}
16188
16189impl NodeGetExtendedAttributeResponder {
16190    /// Sends a response to the FIDL transaction.
16191    ///
16192    /// Sets the channel to shutdown if an error occurs.
16193    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16194        let _result = self.send_raw(result);
16195        if _result.is_err() {
16196            self.control_handle.shutdown();
16197        }
16198        self.drop_without_shutdown();
16199        _result
16200    }
16201
16202    /// Similar to "send" but does not shutdown the channel if an error occurs.
16203    pub fn send_no_shutdown_on_err(
16204        self,
16205        mut result: Result<ExtendedAttributeValue, i32>,
16206    ) -> Result<(), fidl::Error> {
16207        let _result = self.send_raw(result);
16208        self.drop_without_shutdown();
16209        _result
16210    }
16211
16212    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16213        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
16214            result.as_mut().map_err(|e| *e),
16215            self.tx_id,
16216            0x45ffa3ccfdeb76db,
16217            fidl::encoding::DynamicFlags::empty(),
16218        )
16219    }
16220}
16221
16222#[must_use = "FIDL methods require a response to be sent"]
16223#[derive(Debug)]
16224pub struct NodeSetExtendedAttributeResponder {
16225    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16226    tx_id: u32,
16227}
16228
16229/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16230/// if the responder is dropped without sending a response, so that the client
16231/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16232impl std::ops::Drop for NodeSetExtendedAttributeResponder {
16233    fn drop(&mut self) {
16234        self.control_handle.shutdown();
16235        // Safety: drops once, never accessed again
16236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16237    }
16238}
16239
16240impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
16241    type ControlHandle = NodeControlHandle;
16242
16243    fn control_handle(&self) -> &NodeControlHandle {
16244        &self.control_handle
16245    }
16246
16247    fn drop_without_shutdown(mut self) {
16248        // Safety: drops once, never accessed again due to mem::forget
16249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16250        // Prevent Drop from running (which would shut down the channel)
16251        std::mem::forget(self);
16252    }
16253}
16254
16255impl NodeSetExtendedAttributeResponder {
16256    /// Sends a response to the FIDL transaction.
16257    ///
16258    /// Sets the channel to shutdown if an error occurs.
16259    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16260        let _result = self.send_raw(result);
16261        if _result.is_err() {
16262            self.control_handle.shutdown();
16263        }
16264        self.drop_without_shutdown();
16265        _result
16266    }
16267
16268    /// Similar to "send" but does not shutdown the channel if an error occurs.
16269    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16270        let _result = self.send_raw(result);
16271        self.drop_without_shutdown();
16272        _result
16273    }
16274
16275    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16276        self.control_handle
16277            .inner
16278            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16279                result,
16280                self.tx_id,
16281                0x4a951362f681f23c,
16282                fidl::encoding::DynamicFlags::empty(),
16283            )
16284    }
16285}
16286
16287#[must_use = "FIDL methods require a response to be sent"]
16288#[derive(Debug)]
16289pub struct NodeRemoveExtendedAttributeResponder {
16290    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
16291    tx_id: u32,
16292}
16293
16294/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
16295/// if the responder is dropped without sending a response, so that the client
16296/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16297impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
16298    fn drop(&mut self) {
16299        self.control_handle.shutdown();
16300        // Safety: drops once, never accessed again
16301        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16302    }
16303}
16304
16305impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
16306    type ControlHandle = NodeControlHandle;
16307
16308    fn control_handle(&self) -> &NodeControlHandle {
16309        &self.control_handle
16310    }
16311
16312    fn drop_without_shutdown(mut self) {
16313        // Safety: drops once, never accessed again due to mem::forget
16314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16315        // Prevent Drop from running (which would shut down the channel)
16316        std::mem::forget(self);
16317    }
16318}
16319
16320impl NodeRemoveExtendedAttributeResponder {
16321    /// Sends a response to the FIDL transaction.
16322    ///
16323    /// Sets the channel to shutdown if an error occurs.
16324    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16325        let _result = self.send_raw(result);
16326        if _result.is_err() {
16327            self.control_handle.shutdown();
16328        }
16329        self.drop_without_shutdown();
16330        _result
16331    }
16332
16333    /// Similar to "send" but does not shutdown the channel if an error occurs.
16334    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16335        let _result = self.send_raw(result);
16336        self.drop_without_shutdown();
16337        _result
16338    }
16339
16340    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16341        self.control_handle
16342            .inner
16343            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16344                result,
16345                self.tx_id,
16346                0x7a0b9f3a9bf9032d,
16347                fidl::encoding::DynamicFlags::empty(),
16348            )
16349    }
16350}
16351
16352#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16353pub struct OpenableMarker;
16354
16355impl fidl::endpoints::ProtocolMarker for OpenableMarker {
16356    type Proxy = OpenableProxy;
16357    type RequestStream = OpenableRequestStream;
16358    #[cfg(target_os = "fuchsia")]
16359    type SynchronousProxy = OpenableSynchronousProxy;
16360
16361    const DEBUG_NAME: &'static str = "(anonymous) Openable";
16362}
16363
16364pub trait OpenableProxyInterface: Send + Sync {
16365    fn r#open(
16366        &self,
16367        path: &str,
16368        flags: Flags,
16369        options: &Options,
16370        object: fidl::Channel,
16371    ) -> Result<(), fidl::Error>;
16372}
16373#[derive(Debug)]
16374#[cfg(target_os = "fuchsia")]
16375pub struct OpenableSynchronousProxy {
16376    client: fidl::client::sync::Client,
16377}
16378
16379#[cfg(target_os = "fuchsia")]
16380impl fidl::endpoints::SynchronousProxy for OpenableSynchronousProxy {
16381    type Proxy = OpenableProxy;
16382    type Protocol = OpenableMarker;
16383
16384    fn from_channel(inner: fidl::Channel) -> Self {
16385        Self::new(inner)
16386    }
16387
16388    fn into_channel(self) -> fidl::Channel {
16389        self.client.into_channel()
16390    }
16391
16392    fn as_channel(&self) -> &fidl::Channel {
16393        self.client.as_channel()
16394    }
16395}
16396
16397#[cfg(target_os = "fuchsia")]
16398impl OpenableSynchronousProxy {
16399    pub fn new(channel: fidl::Channel) -> Self {
16400        Self { client: fidl::client::sync::Client::new(channel) }
16401    }
16402
16403    pub fn into_channel(self) -> fidl::Channel {
16404        self.client.into_channel()
16405    }
16406
16407    /// Waits until an event arrives and returns it. It is safe for other
16408    /// threads to make concurrent requests while waiting for an event.
16409    pub fn wait_for_event(
16410        &self,
16411        deadline: zx::MonotonicInstant,
16412    ) -> Result<OpenableEvent, fidl::Error> {
16413        OpenableEvent::decode(self.client.wait_for_event::<OpenableMarker>(deadline)?)
16414    }
16415
16416    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16417    /// epitaph sent on the `object` channel.
16418    ///
16419    /// Errors:
16420    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16421    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16422    pub fn r#open(
16423        &self,
16424        mut path: &str,
16425        mut flags: Flags,
16426        mut options: &Options,
16427        mut object: fidl::Channel,
16428    ) -> Result<(), fidl::Error> {
16429        self.client.send::<OpenableOpenRequest>(
16430            (path, flags, options, object),
16431            0x568ddcb9a9cbb6d9,
16432            fidl::encoding::DynamicFlags::FLEXIBLE,
16433        )
16434    }
16435}
16436
16437#[cfg(target_os = "fuchsia")]
16438impl From<OpenableSynchronousProxy> for zx::NullableHandle {
16439    fn from(value: OpenableSynchronousProxy) -> Self {
16440        value.into_channel().into()
16441    }
16442}
16443
16444#[cfg(target_os = "fuchsia")]
16445impl From<fidl::Channel> for OpenableSynchronousProxy {
16446    fn from(value: fidl::Channel) -> Self {
16447        Self::new(value)
16448    }
16449}
16450
16451#[cfg(target_os = "fuchsia")]
16452impl fidl::endpoints::FromClient for OpenableSynchronousProxy {
16453    type Protocol = OpenableMarker;
16454
16455    fn from_client(value: fidl::endpoints::ClientEnd<OpenableMarker>) -> Self {
16456        Self::new(value.into_channel())
16457    }
16458}
16459
16460#[derive(Debug, Clone)]
16461pub struct OpenableProxy {
16462    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16463}
16464
16465impl fidl::endpoints::Proxy for OpenableProxy {
16466    type Protocol = OpenableMarker;
16467
16468    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16469        Self::new(inner)
16470    }
16471
16472    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16473        self.client.into_channel().map_err(|client| Self { client })
16474    }
16475
16476    fn as_channel(&self) -> &::fidl::AsyncChannel {
16477        self.client.as_channel()
16478    }
16479}
16480
16481impl OpenableProxy {
16482    /// Create a new Proxy for fuchsia.io/Openable.
16483    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16484        let protocol_name = <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16485        Self { client: fidl::client::Client::new(channel, protocol_name) }
16486    }
16487
16488    /// Get a Stream of events from the remote end of the protocol.
16489    ///
16490    /// # Panics
16491    ///
16492    /// Panics if the event stream was already taken.
16493    pub fn take_event_stream(&self) -> OpenableEventStream {
16494        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
16495    }
16496
16497    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16498    /// epitaph sent on the `object` channel.
16499    ///
16500    /// Errors:
16501    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16502    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16503    pub fn r#open(
16504        &self,
16505        mut path: &str,
16506        mut flags: Flags,
16507        mut options: &Options,
16508        mut object: fidl::Channel,
16509    ) -> Result<(), fidl::Error> {
16510        OpenableProxyInterface::r#open(self, path, flags, options, object)
16511    }
16512}
16513
16514impl OpenableProxyInterface for OpenableProxy {
16515    fn r#open(
16516        &self,
16517        mut path: &str,
16518        mut flags: Flags,
16519        mut options: &Options,
16520        mut object: fidl::Channel,
16521    ) -> Result<(), fidl::Error> {
16522        self.client.send::<OpenableOpenRequest>(
16523            (path, flags, options, object),
16524            0x568ddcb9a9cbb6d9,
16525            fidl::encoding::DynamicFlags::FLEXIBLE,
16526        )
16527    }
16528}
16529
16530pub struct OpenableEventStream {
16531    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16532}
16533
16534impl std::marker::Unpin for OpenableEventStream {}
16535
16536impl futures::stream::FusedStream for OpenableEventStream {
16537    fn is_terminated(&self) -> bool {
16538        self.event_receiver.is_terminated()
16539    }
16540}
16541
16542impl futures::Stream for OpenableEventStream {
16543    type Item = Result<OpenableEvent, fidl::Error>;
16544
16545    fn poll_next(
16546        mut self: std::pin::Pin<&mut Self>,
16547        cx: &mut std::task::Context<'_>,
16548    ) -> std::task::Poll<Option<Self::Item>> {
16549        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16550            &mut self.event_receiver,
16551            cx
16552        )?) {
16553            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
16554            None => std::task::Poll::Ready(None),
16555        }
16556    }
16557}
16558
16559#[derive(Debug)]
16560pub enum OpenableEvent {
16561    #[non_exhaustive]
16562    _UnknownEvent {
16563        /// Ordinal of the event that was sent.
16564        ordinal: u64,
16565    },
16566}
16567
16568impl OpenableEvent {
16569    /// Decodes a message buffer as a [`OpenableEvent`].
16570    fn decode(
16571        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16572    ) -> Result<OpenableEvent, fidl::Error> {
16573        let (bytes, _handles) = buf.split_mut();
16574        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16575        debug_assert_eq!(tx_header.tx_id, 0);
16576        match tx_header.ordinal {
16577            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
16578                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
16579            }
16580            _ => Err(fidl::Error::UnknownOrdinal {
16581                ordinal: tx_header.ordinal,
16582                protocol_name: <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16583            }),
16584        }
16585    }
16586}
16587
16588/// A Stream of incoming requests for fuchsia.io/Openable.
16589pub struct OpenableRequestStream {
16590    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16591    is_terminated: bool,
16592}
16593
16594impl std::marker::Unpin for OpenableRequestStream {}
16595
16596impl futures::stream::FusedStream for OpenableRequestStream {
16597    fn is_terminated(&self) -> bool {
16598        self.is_terminated
16599    }
16600}
16601
16602impl fidl::endpoints::RequestStream for OpenableRequestStream {
16603    type Protocol = OpenableMarker;
16604    type ControlHandle = OpenableControlHandle;
16605
16606    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16607        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16608    }
16609
16610    fn control_handle(&self) -> Self::ControlHandle {
16611        OpenableControlHandle { inner: self.inner.clone() }
16612    }
16613
16614    fn into_inner(
16615        self,
16616    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16617    {
16618        (self.inner, self.is_terminated)
16619    }
16620
16621    fn from_inner(
16622        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16623        is_terminated: bool,
16624    ) -> Self {
16625        Self { inner, is_terminated }
16626    }
16627}
16628
16629impl futures::Stream for OpenableRequestStream {
16630    type Item = Result<OpenableRequest, fidl::Error>;
16631
16632    fn poll_next(
16633        mut self: std::pin::Pin<&mut Self>,
16634        cx: &mut std::task::Context<'_>,
16635    ) -> std::task::Poll<Option<Self::Item>> {
16636        let this = &mut *self;
16637        if this.inner.check_shutdown(cx) {
16638            this.is_terminated = true;
16639            return std::task::Poll::Ready(None);
16640        }
16641        if this.is_terminated {
16642            panic!("polled OpenableRequestStream after completion");
16643        }
16644        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16645            |bytes, handles| {
16646                match this.inner.channel().read_etc(cx, bytes, handles) {
16647                    std::task::Poll::Ready(Ok(())) => {}
16648                    std::task::Poll::Pending => return std::task::Poll::Pending,
16649                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16650                        this.is_terminated = true;
16651                        return std::task::Poll::Ready(None);
16652                    }
16653                    std::task::Poll::Ready(Err(e)) => {
16654                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16655                            e.into(),
16656                        ))));
16657                    }
16658                }
16659
16660                // A message has been received from the channel
16661                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16662
16663                std::task::Poll::Ready(Some(match header.ordinal {
16664                    0x568ddcb9a9cbb6d9 => {
16665                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
16666                        let mut req = fidl::new_empty!(
16667                            OpenableOpenRequest,
16668                            fidl::encoding::DefaultFuchsiaResourceDialect
16669                        );
16670                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
16671                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
16672                        Ok(OpenableRequest::Open {
16673                            path: req.path,
16674                            flags: req.flags,
16675                            options: req.options,
16676                            object: req.object,
16677
16678                            control_handle,
16679                        })
16680                    }
16681                    _ if header.tx_id == 0
16682                        && header
16683                            .dynamic_flags()
16684                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16685                    {
16686                        Ok(OpenableRequest::_UnknownMethod {
16687                            ordinal: header.ordinal,
16688                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16689                            method_type: fidl::MethodType::OneWay,
16690                        })
16691                    }
16692                    _ if header
16693                        .dynamic_flags()
16694                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16695                    {
16696                        this.inner.send_framework_err(
16697                            fidl::encoding::FrameworkErr::UnknownMethod,
16698                            header.tx_id,
16699                            header.ordinal,
16700                            header.dynamic_flags(),
16701                            (bytes, handles),
16702                        )?;
16703                        Ok(OpenableRequest::_UnknownMethod {
16704                            ordinal: header.ordinal,
16705                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16706                            method_type: fidl::MethodType::TwoWay,
16707                        })
16708                    }
16709                    _ => Err(fidl::Error::UnknownOrdinal {
16710                        ordinal: header.ordinal,
16711                        protocol_name:
16712                            <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16713                    }),
16714                }))
16715            },
16716        )
16717    }
16718}
16719
16720/// Openable defines a node which is capable of opening other objects.
16721#[derive(Debug)]
16722pub enum OpenableRequest {
16723    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16724    /// epitaph sent on the `object` channel.
16725    ///
16726    /// Errors:
16727    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16728    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16729    Open {
16730        path: String,
16731        flags: Flags,
16732        options: Options,
16733        object: fidl::Channel,
16734        control_handle: OpenableControlHandle,
16735    },
16736    /// An interaction was received which does not match any known method.
16737    #[non_exhaustive]
16738    _UnknownMethod {
16739        /// Ordinal of the method that was called.
16740        ordinal: u64,
16741        control_handle: OpenableControlHandle,
16742        method_type: fidl::MethodType,
16743    },
16744}
16745
16746impl OpenableRequest {
16747    #[allow(irrefutable_let_patterns)]
16748    pub fn into_open(
16749        self,
16750    ) -> Option<(String, Flags, Options, fidl::Channel, OpenableControlHandle)> {
16751        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
16752            Some((path, flags, options, object, control_handle))
16753        } else {
16754            None
16755        }
16756    }
16757
16758    /// Name of the method defined in FIDL
16759    pub fn method_name(&self) -> &'static str {
16760        match *self {
16761            OpenableRequest::Open { .. } => "open",
16762            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16763                "unknown one-way method"
16764            }
16765            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16766                "unknown two-way method"
16767            }
16768        }
16769    }
16770}
16771
16772#[derive(Debug, Clone)]
16773pub struct OpenableControlHandle {
16774    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16775}
16776
16777impl OpenableControlHandle {
16778    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16779        self.inner.shutdown_with_epitaph(status.into())
16780    }
16781}
16782
16783impl fidl::endpoints::ControlHandle for OpenableControlHandle {
16784    fn shutdown(&self) {
16785        self.inner.shutdown()
16786    }
16787
16788    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16789        self.inner.shutdown_with_epitaph(status)
16790    }
16791
16792    fn is_closed(&self) -> bool {
16793        self.inner.channel().is_closed()
16794    }
16795    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16796        self.inner.channel().on_closed()
16797    }
16798
16799    #[cfg(target_os = "fuchsia")]
16800    fn signal_peer(
16801        &self,
16802        clear_mask: zx::Signals,
16803        set_mask: zx::Signals,
16804    ) -> Result<(), zx_status::Status> {
16805        use fidl::Peered;
16806        self.inner.channel().signal_peer(clear_mask, set_mask)
16807    }
16808}
16809
16810impl OpenableControlHandle {}
16811
16812#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16813pub struct ReadableMarker;
16814
16815impl fidl::endpoints::ProtocolMarker for ReadableMarker {
16816    type Proxy = ReadableProxy;
16817    type RequestStream = ReadableRequestStream;
16818    #[cfg(target_os = "fuchsia")]
16819    type SynchronousProxy = ReadableSynchronousProxy;
16820
16821    const DEBUG_NAME: &'static str = "(anonymous) Readable";
16822}
16823pub type ReadableReadResult = Result<Vec<u8>, i32>;
16824
16825pub trait ReadableProxyInterface: Send + Sync {
16826    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
16827        + Send;
16828    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
16829}
16830#[derive(Debug)]
16831#[cfg(target_os = "fuchsia")]
16832pub struct ReadableSynchronousProxy {
16833    client: fidl::client::sync::Client,
16834}
16835
16836#[cfg(target_os = "fuchsia")]
16837impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
16838    type Proxy = ReadableProxy;
16839    type Protocol = ReadableMarker;
16840
16841    fn from_channel(inner: fidl::Channel) -> Self {
16842        Self::new(inner)
16843    }
16844
16845    fn into_channel(self) -> fidl::Channel {
16846        self.client.into_channel()
16847    }
16848
16849    fn as_channel(&self) -> &fidl::Channel {
16850        self.client.as_channel()
16851    }
16852}
16853
16854#[cfg(target_os = "fuchsia")]
16855impl ReadableSynchronousProxy {
16856    pub fn new(channel: fidl::Channel) -> Self {
16857        Self { client: fidl::client::sync::Client::new(channel) }
16858    }
16859
16860    pub fn into_channel(self) -> fidl::Channel {
16861        self.client.into_channel()
16862    }
16863
16864    /// Waits until an event arrives and returns it. It is safe for other
16865    /// threads to make concurrent requests while waiting for an event.
16866    pub fn wait_for_event(
16867        &self,
16868        deadline: zx::MonotonicInstant,
16869    ) -> Result<ReadableEvent, fidl::Error> {
16870        ReadableEvent::decode(self.client.wait_for_event::<ReadableMarker>(deadline)?)
16871    }
16872
16873    /// Reads up to 'count' bytes at the seek offset.
16874    /// The seek offset is moved forward by the number of bytes read.
16875    ///
16876    /// ## Invariants
16877    ///
16878    /// * The returned `data.length` will never be greater than `count`.
16879    /// * If `data.length` is less than `count`, it means that the seek offset
16880    ///   has reached the end of file as part of this operation.
16881    /// * If `data.length` is zero while `count` is not, it means that the
16882    ///   seek offset is already at or beyond the end of file, and no data could
16883    ///   be read.
16884    /// * If `count` is zero, the server should perform all the checks ensuring
16885    ///   read access without actually read anything, and return an empty
16886    ///   `data` vector.
16887    ///
16888    /// This method requires the [`Rights.READ_BYTES`] right.
16889    ///
16890    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16891    pub fn r#read(
16892        &self,
16893        mut count: u64,
16894        ___deadline: zx::MonotonicInstant,
16895    ) -> Result<ReadableReadResult, fidl::Error> {
16896        let _response = self.client.send_query::<
16897            ReadableReadRequest,
16898            fidl::encoding::ResultType<ReadableReadResponse, i32>,
16899            ReadableMarker,
16900        >(
16901            (count,),
16902            0x57e419a298c8ede,
16903            fidl::encoding::DynamicFlags::empty(),
16904            ___deadline,
16905        )?;
16906        Ok(_response.map(|x| x.data))
16907    }
16908}
16909
16910#[cfg(target_os = "fuchsia")]
16911impl From<ReadableSynchronousProxy> for zx::NullableHandle {
16912    fn from(value: ReadableSynchronousProxy) -> Self {
16913        value.into_channel().into()
16914    }
16915}
16916
16917#[cfg(target_os = "fuchsia")]
16918impl From<fidl::Channel> for ReadableSynchronousProxy {
16919    fn from(value: fidl::Channel) -> Self {
16920        Self::new(value)
16921    }
16922}
16923
16924#[cfg(target_os = "fuchsia")]
16925impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
16926    type Protocol = ReadableMarker;
16927
16928    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
16929        Self::new(value.into_channel())
16930    }
16931}
16932
16933#[derive(Debug, Clone)]
16934pub struct ReadableProxy {
16935    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16936}
16937
16938impl fidl::endpoints::Proxy for ReadableProxy {
16939    type Protocol = ReadableMarker;
16940
16941    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16942        Self::new(inner)
16943    }
16944
16945    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16946        self.client.into_channel().map_err(|client| Self { client })
16947    }
16948
16949    fn as_channel(&self) -> &::fidl::AsyncChannel {
16950        self.client.as_channel()
16951    }
16952}
16953
16954impl ReadableProxy {
16955    /// Create a new Proxy for fuchsia.io/Readable.
16956    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16957        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16958        Self { client: fidl::client::Client::new(channel, protocol_name) }
16959    }
16960
16961    /// Get a Stream of events from the remote end of the protocol.
16962    ///
16963    /// # Panics
16964    ///
16965    /// Panics if the event stream was already taken.
16966    pub fn take_event_stream(&self) -> ReadableEventStream {
16967        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16968    }
16969
16970    /// Reads up to 'count' bytes at the seek offset.
16971    /// The seek offset is moved forward by the number of bytes read.
16972    ///
16973    /// ## Invariants
16974    ///
16975    /// * The returned `data.length` will never be greater than `count`.
16976    /// * If `data.length` is less than `count`, it means that the seek offset
16977    ///   has reached the end of file as part of this operation.
16978    /// * If `data.length` is zero while `count` is not, it means that the
16979    ///   seek offset is already at or beyond the end of file, and no data could
16980    ///   be read.
16981    /// * If `count` is zero, the server should perform all the checks ensuring
16982    ///   read access without actually read anything, and return an empty
16983    ///   `data` vector.
16984    ///
16985    /// This method requires the [`Rights.READ_BYTES`] right.
16986    ///
16987    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16988    pub fn r#read(
16989        &self,
16990        mut count: u64,
16991    ) -> fidl::client::QueryResponseFut<
16992        ReadableReadResult,
16993        fidl::encoding::DefaultFuchsiaResourceDialect,
16994    > {
16995        ReadableProxyInterface::r#read(self, count)
16996    }
16997}
16998
16999impl ReadableProxyInterface for ReadableProxy {
17000    type ReadResponseFut = fidl::client::QueryResponseFut<
17001        ReadableReadResult,
17002        fidl::encoding::DefaultFuchsiaResourceDialect,
17003    >;
17004    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
17005        fn _decode(
17006            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17007        ) -> Result<ReadableReadResult, fidl::Error> {
17008            let _response = fidl::client::decode_transaction_body::<
17009                fidl::encoding::ResultType<ReadableReadResponse, i32>,
17010                fidl::encoding::DefaultFuchsiaResourceDialect,
17011                0x57e419a298c8ede,
17012            >(_buf?)?;
17013            Ok(_response.map(|x| x.data))
17014        }
17015        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
17016            (count,),
17017            0x57e419a298c8ede,
17018            fidl::encoding::DynamicFlags::empty(),
17019            _decode,
17020        )
17021    }
17022}
17023
17024pub struct ReadableEventStream {
17025    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
17026}
17027
17028impl std::marker::Unpin for ReadableEventStream {}
17029
17030impl futures::stream::FusedStream for ReadableEventStream {
17031    fn is_terminated(&self) -> bool {
17032        self.event_receiver.is_terminated()
17033    }
17034}
17035
17036impl futures::Stream for ReadableEventStream {
17037    type Item = Result<ReadableEvent, fidl::Error>;
17038
17039    fn poll_next(
17040        mut self: std::pin::Pin<&mut Self>,
17041        cx: &mut std::task::Context<'_>,
17042    ) -> std::task::Poll<Option<Self::Item>> {
17043        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17044            &mut self.event_receiver,
17045            cx
17046        )?) {
17047            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
17048            None => std::task::Poll::Ready(None),
17049        }
17050    }
17051}
17052
17053#[derive(Debug)]
17054pub enum ReadableEvent {}
17055
17056impl ReadableEvent {
17057    /// Decodes a message buffer as a [`ReadableEvent`].
17058    fn decode(
17059        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17060    ) -> Result<ReadableEvent, fidl::Error> {
17061        let (bytes, _handles) = buf.split_mut();
17062        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17063        debug_assert_eq!(tx_header.tx_id, 0);
17064        match tx_header.ordinal {
17065            _ => Err(fidl::Error::UnknownOrdinal {
17066                ordinal: tx_header.ordinal,
17067                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17068            }),
17069        }
17070    }
17071}
17072
17073/// A Stream of incoming requests for fuchsia.io/Readable.
17074pub struct ReadableRequestStream {
17075    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17076    is_terminated: bool,
17077}
17078
17079impl std::marker::Unpin for ReadableRequestStream {}
17080
17081impl futures::stream::FusedStream for ReadableRequestStream {
17082    fn is_terminated(&self) -> bool {
17083        self.is_terminated
17084    }
17085}
17086
17087impl fidl::endpoints::RequestStream for ReadableRequestStream {
17088    type Protocol = ReadableMarker;
17089    type ControlHandle = ReadableControlHandle;
17090
17091    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
17092        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17093    }
17094
17095    fn control_handle(&self) -> Self::ControlHandle {
17096        ReadableControlHandle { inner: self.inner.clone() }
17097    }
17098
17099    fn into_inner(
17100        self,
17101    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
17102    {
17103        (self.inner, self.is_terminated)
17104    }
17105
17106    fn from_inner(
17107        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17108        is_terminated: bool,
17109    ) -> Self {
17110        Self { inner, is_terminated }
17111    }
17112}
17113
17114impl futures::Stream for ReadableRequestStream {
17115    type Item = Result<ReadableRequest, fidl::Error>;
17116
17117    fn poll_next(
17118        mut self: std::pin::Pin<&mut Self>,
17119        cx: &mut std::task::Context<'_>,
17120    ) -> std::task::Poll<Option<Self::Item>> {
17121        let this = &mut *self;
17122        if this.inner.check_shutdown(cx) {
17123            this.is_terminated = true;
17124            return std::task::Poll::Ready(None);
17125        }
17126        if this.is_terminated {
17127            panic!("polled ReadableRequestStream after completion");
17128        }
17129        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
17130            |bytes, handles| {
17131                match this.inner.channel().read_etc(cx, bytes, handles) {
17132                    std::task::Poll::Ready(Ok(())) => {}
17133                    std::task::Poll::Pending => return std::task::Poll::Pending,
17134                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
17135                        this.is_terminated = true;
17136                        return std::task::Poll::Ready(None);
17137                    }
17138                    std::task::Poll::Ready(Err(e)) => {
17139                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17140                            e.into(),
17141                        ))));
17142                    }
17143                }
17144
17145                // A message has been received from the channel
17146                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17147
17148                std::task::Poll::Ready(Some(match header.ordinal {
17149                    0x57e419a298c8ede => {
17150                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17151                        let mut req = fidl::new_empty!(
17152                            ReadableReadRequest,
17153                            fidl::encoding::DefaultFuchsiaResourceDialect
17154                        );
17155                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
17156                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
17157                        Ok(ReadableRequest::Read {
17158                            count: req.count,
17159
17160                            responder: ReadableReadResponder {
17161                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17162                                tx_id: header.tx_id,
17163                            },
17164                        })
17165                    }
17166                    _ => Err(fidl::Error::UnknownOrdinal {
17167                        ordinal: header.ordinal,
17168                        protocol_name:
17169                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
17170                    }),
17171                }))
17172            },
17173        )
17174    }
17175}
17176
17177#[derive(Debug)]
17178pub enum ReadableRequest {
17179    /// Reads up to 'count' bytes at the seek offset.
17180    /// The seek offset is moved forward by the number of bytes read.
17181    ///
17182    /// ## Invariants
17183    ///
17184    /// * The returned `data.length` will never be greater than `count`.
17185    /// * If `data.length` is less than `count`, it means that the seek offset
17186    ///   has reached the end of file as part of this operation.
17187    /// * If `data.length` is zero while `count` is not, it means that the
17188    ///   seek offset is already at or beyond the end of file, and no data could
17189    ///   be read.
17190    /// * If `count` is zero, the server should perform all the checks ensuring
17191    ///   read access without actually read anything, and return an empty
17192    ///   `data` vector.
17193    ///
17194    /// This method requires the [`Rights.READ_BYTES`] right.
17195    ///
17196    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
17197    Read { count: u64, responder: ReadableReadResponder },
17198}
17199
17200impl ReadableRequest {
17201    #[allow(irrefutable_let_patterns)]
17202    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
17203        if let ReadableRequest::Read { count, responder } = self {
17204            Some((count, responder))
17205        } else {
17206            None
17207        }
17208    }
17209
17210    /// Name of the method defined in FIDL
17211    pub fn method_name(&self) -> &'static str {
17212        match *self {
17213            ReadableRequest::Read { .. } => "read",
17214        }
17215    }
17216}
17217
17218#[derive(Debug, Clone)]
17219pub struct ReadableControlHandle {
17220    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
17221}
17222
17223impl ReadableControlHandle {
17224    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
17225        self.inner.shutdown_with_epitaph(status.into())
17226    }
17227}
17228
17229impl fidl::endpoints::ControlHandle for ReadableControlHandle {
17230    fn shutdown(&self) {
17231        self.inner.shutdown()
17232    }
17233
17234    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
17235        self.inner.shutdown_with_epitaph(status)
17236    }
17237
17238    fn is_closed(&self) -> bool {
17239        self.inner.channel().is_closed()
17240    }
17241    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
17242        self.inner.channel().on_closed()
17243    }
17244
17245    #[cfg(target_os = "fuchsia")]
17246    fn signal_peer(
17247        &self,
17248        clear_mask: zx::Signals,
17249        set_mask: zx::Signals,
17250    ) -> Result<(), zx_status::Status> {
17251        use fidl::Peered;
17252        self.inner.channel().signal_peer(clear_mask, set_mask)
17253    }
17254}
17255
17256impl ReadableControlHandle {}
17257
17258#[must_use = "FIDL methods require a response to be sent"]
17259#[derive(Debug)]
17260pub struct ReadableReadResponder {
17261    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
17262    tx_id: u32,
17263}
17264
17265/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
17266/// if the responder is dropped without sending a response, so that the client
17267/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17268impl std::ops::Drop for ReadableReadResponder {
17269    fn drop(&mut self) {
17270        self.control_handle.shutdown();
17271        // Safety: drops once, never accessed again
17272        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17273    }
17274}
17275
17276impl fidl::endpoints::Responder for ReadableReadResponder {
17277    type ControlHandle = ReadableControlHandle;
17278
17279    fn control_handle(&self) -> &ReadableControlHandle {
17280        &self.control_handle
17281    }
17282
17283    fn drop_without_shutdown(mut self) {
17284        // Safety: drops once, never accessed again due to mem::forget
17285        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17286        // Prevent Drop from running (which would shut down the channel)
17287        std::mem::forget(self);
17288    }
17289}
17290
17291impl ReadableReadResponder {
17292    /// Sends a response to the FIDL transaction.
17293    ///
17294    /// Sets the channel to shutdown if an error occurs.
17295    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
17296        let _result = self.send_raw(result);
17297        if _result.is_err() {
17298            self.control_handle.shutdown();
17299        }
17300        self.drop_without_shutdown();
17301        _result
17302    }
17303
17304    /// Similar to "send" but does not shutdown the channel if an error occurs.
17305    pub fn send_no_shutdown_on_err(
17306        self,
17307        mut result: Result<&[u8], i32>,
17308    ) -> Result<(), fidl::Error> {
17309        let _result = self.send_raw(result);
17310        self.drop_without_shutdown();
17311        _result
17312    }
17313
17314    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
17315        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
17316            result.map(|data| (data,)),
17317            self.tx_id,
17318            0x57e419a298c8ede,
17319            fidl::encoding::DynamicFlags::empty(),
17320        )
17321    }
17322}
17323
17324#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17325pub struct SymlinkMarker;
17326
17327impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
17328    type Proxy = SymlinkProxy;
17329    type RequestStream = SymlinkRequestStream;
17330    #[cfg(target_os = "fuchsia")]
17331    type SynchronousProxy = SymlinkSynchronousProxy;
17332
17333    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
17334}
17335impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
17336
17337pub trait SymlinkProxyInterface: Send + Sync {
17338    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
17339        + Send;
17340    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
17341    fn r#clone(
17342        &self,
17343        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17344    ) -> Result<(), fidl::Error>;
17345    type CloseResponseFut: std::future::Future<
17346            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
17347        > + Send;
17348    fn r#close(&self) -> Self::CloseResponseFut;
17349    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
17350    fn r#query(&self) -> Self::QueryResponseFut;
17351    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
17352        + Send;
17353    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
17354    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
17355    fn r#deprecated_set_attr(
17356        &self,
17357        flags: NodeAttributeFlags,
17358        attributes: &NodeAttributes,
17359    ) -> Self::DeprecatedSetAttrResponseFut;
17360    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
17361        + Send;
17362    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
17363    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
17364        + Send;
17365    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
17366    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
17367        + Send;
17368    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
17369    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
17370        + Send;
17371    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
17372    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
17373        + Send;
17374    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
17375    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
17376        + Send;
17377    fn r#get_token(&self) -> Self::GetTokenResponseFut;
17378    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
17379        + Send;
17380    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
17381    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
17382        + Send;
17383    fn r#update_attributes(
17384        &self,
17385        payload: &MutableNodeAttributes,
17386    ) -> Self::UpdateAttributesResponseFut;
17387    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
17388    fn r#sync(&self) -> Self::SyncResponseFut;
17389    fn r#list_extended_attributes(
17390        &self,
17391        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17392    ) -> Result<(), fidl::Error>;
17393    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
17394        + Send;
17395    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
17396    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
17397        + Send;
17398    fn r#set_extended_attribute(
17399        &self,
17400        name: &[u8],
17401        value: ExtendedAttributeValue,
17402        mode: SetExtendedAttributeMode,
17403    ) -> Self::SetExtendedAttributeResponseFut;
17404    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
17405        + Send;
17406    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
17407    fn r#open(
17408        &self,
17409        path: &str,
17410        flags: Flags,
17411        options: &Options,
17412        object: fidl::Channel,
17413    ) -> Result<(), fidl::Error>;
17414    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
17415    fn r#describe(&self) -> Self::DescribeResponseFut;
17416}
17417#[derive(Debug)]
17418#[cfg(target_os = "fuchsia")]
17419pub struct SymlinkSynchronousProxy {
17420    client: fidl::client::sync::Client,
17421}
17422
17423#[cfg(target_os = "fuchsia")]
17424impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
17425    type Proxy = SymlinkProxy;
17426    type Protocol = SymlinkMarker;
17427
17428    fn from_channel(inner: fidl::Channel) -> Self {
17429        Self::new(inner)
17430    }
17431
17432    fn into_channel(self) -> fidl::Channel {
17433        self.client.into_channel()
17434    }
17435
17436    fn as_channel(&self) -> &fidl::Channel {
17437        self.client.as_channel()
17438    }
17439}
17440
17441#[cfg(target_os = "fuchsia")]
17442impl SymlinkSynchronousProxy {
17443    pub fn new(channel: fidl::Channel) -> Self {
17444        Self { client: fidl::client::sync::Client::new(channel) }
17445    }
17446
17447    pub fn into_channel(self) -> fidl::Channel {
17448        self.client.into_channel()
17449    }
17450
17451    /// Waits until an event arrives and returns it. It is safe for other
17452    /// threads to make concurrent requests while waiting for an event.
17453    pub fn wait_for_event(
17454        &self,
17455        deadline: zx::MonotonicInstant,
17456    ) -> Result<SymlinkEvent, fidl::Error> {
17457        SymlinkEvent::decode(self.client.wait_for_event::<SymlinkMarker>(deadline)?)
17458    }
17459
17460    /// Creates a link to this this object with name `dst` in the directory represented by
17461    /// `dst_parent_token`.
17462    ///
17463    /// `dst` must be a resolved object name. Including "/" in the string will return
17464    /// `ZX_ERR_INVALID_ARGS`.
17465    ///
17466    /// This method requires the maximal set of rights supported by the filesystem for this object.
17467    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17468    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17469    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17470    /// `ZX_ERR_ACCESS_DENIED`.
17471    ///
17472    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17473    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17474    ///
17475    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17476    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17477    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17478    ///
17479    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17480    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17481    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17482    pub fn r#link_into(
17483        &self,
17484        mut dst_parent_token: fidl::Event,
17485        mut dst: &str,
17486        ___deadline: zx::MonotonicInstant,
17487    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17488        let _response = self.client.send_query::<
17489            LinkableLinkIntoRequest,
17490            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17491            SymlinkMarker,
17492        >(
17493            (dst_parent_token, dst,),
17494            0x54f3949246a03e74,
17495            fidl::encoding::DynamicFlags::empty(),
17496            ___deadline,
17497        )?;
17498        Ok(_response.map(|x| x))
17499    }
17500
17501    pub fn r#clone(
17502        &self,
17503        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17504    ) -> Result<(), fidl::Error> {
17505        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17506            (request,),
17507            0x20d8a7aba2168a79,
17508            fidl::encoding::DynamicFlags::empty(),
17509        )
17510    }
17511
17512    /// Terminates the connection.
17513    ///
17514    /// After calling `Close`, the client must not send any other requests.
17515    ///
17516    /// Servers, after sending the status response, should close the connection
17517    /// regardless of status and without sending an epitaph.
17518    ///
17519    /// Closing the client end of the channel should be semantically equivalent
17520    /// to calling `Close` without knowing when the close has completed or its
17521    /// status.
17522    pub fn r#close(
17523        &self,
17524        ___deadline: zx::MonotonicInstant,
17525    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17526        let _response = self.client.send_query::<
17527            fidl::encoding::EmptyPayload,
17528            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17529            SymlinkMarker,
17530        >(
17531            (),
17532            0x5ac5d459ad7f657e,
17533            fidl::encoding::DynamicFlags::empty(),
17534            ___deadline,
17535        )?;
17536        Ok(_response.map(|x| x))
17537    }
17538
17539    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
17540        let _response = self.client.send_query::<
17541            fidl::encoding::EmptyPayload,
17542            fidl_fuchsia_unknown::QueryableQueryResponse,
17543            SymlinkMarker,
17544        >(
17545            (),
17546            0x2658edee9decfc06,
17547            fidl::encoding::DynamicFlags::empty(),
17548            ___deadline,
17549        )?;
17550        Ok(_response.protocol)
17551    }
17552
17553    /// DEPRECATED - Use `Node.GetAttributes` instead.
17554    ///
17555    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17556    pub fn r#deprecated_get_attr(
17557        &self,
17558        ___deadline: zx::MonotonicInstant,
17559    ) -> Result<(i32, NodeAttributes), fidl::Error> {
17560        let _response = self.client.send_query::<
17561            fidl::encoding::EmptyPayload,
17562            NodeDeprecatedGetAttrResponse,
17563            SymlinkMarker,
17564        >(
17565            (),
17566            0x78985e216314dafd,
17567            fidl::encoding::DynamicFlags::empty(),
17568            ___deadline,
17569        )?;
17570        Ok((_response.s, _response.attributes))
17571    }
17572
17573    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17574    pub fn r#deprecated_set_attr(
17575        &self,
17576        mut flags: NodeAttributeFlags,
17577        mut attributes: &NodeAttributes,
17578        ___deadline: zx::MonotonicInstant,
17579    ) -> Result<i32, fidl::Error> {
17580        let _response = self.client.send_query::<
17581            NodeDeprecatedSetAttrRequest,
17582            NodeDeprecatedSetAttrResponse,
17583            SymlinkMarker,
17584        >(
17585            (flags, attributes,),
17586            0x4186c0f40d938f46,
17587            fidl::encoding::DynamicFlags::empty(),
17588            ___deadline,
17589        )?;
17590        Ok(_response.s)
17591    }
17592
17593    /// [DEPRECATED - Use new GetFlags method instead.]
17594    pub fn r#deprecated_get_flags(
17595        &self,
17596        ___deadline: zx::MonotonicInstant,
17597    ) -> Result<(i32, OpenFlags), fidl::Error> {
17598        let _response = self.client.send_query::<
17599            fidl::encoding::EmptyPayload,
17600            NodeDeprecatedGetFlagsResponse,
17601            SymlinkMarker,
17602        >(
17603            (),
17604            0x5b88fffb8eda3aa1,
17605            fidl::encoding::DynamicFlags::empty(),
17606            ___deadline,
17607        )?;
17608        Ok((_response.s, _response.flags))
17609    }
17610
17611    /// [DEPRECATED - Use new SetFlags method instead.]
17612    pub fn r#deprecated_set_flags(
17613        &self,
17614        mut flags: OpenFlags,
17615        ___deadline: zx::MonotonicInstant,
17616    ) -> Result<i32, fidl::Error> {
17617        let _response = self.client.send_query::<
17618            NodeDeprecatedSetFlagsRequest,
17619            NodeDeprecatedSetFlagsResponse,
17620            SymlinkMarker,
17621        >(
17622            (flags,),
17623            0x5295b76c71fde733,
17624            fidl::encoding::DynamicFlags::empty(),
17625            ___deadline,
17626        )?;
17627        Ok(_response.s)
17628    }
17629
17630    /// Queries the flags that apply to this node after it has been opened/created. This method does
17631    /// not require any rights.
17632    ///
17633    /// Note that the final set of flags that apply to the connection may differ from those
17634    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17635    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17636    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17637    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17638    pub fn r#get_flags(
17639        &self,
17640        ___deadline: zx::MonotonicInstant,
17641    ) -> Result<NodeGetFlagsResult, fidl::Error> {
17642        let _response = self.client.send_query::<
17643            fidl::encoding::EmptyPayload,
17644            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17645            SymlinkMarker,
17646        >(
17647            (),
17648            0x176eb318f64ec23,
17649            fidl::encoding::DynamicFlags::FLEXIBLE,
17650            ___deadline,
17651        )?
17652        .into_result::<SymlinkMarker>("get_flags")?;
17653        Ok(_response.map(|x| x.flags))
17654    }
17655
17656    /// Sets the flags that apply to this node after it has been opened. This method does not
17657    /// require any rights.
17658    ///
17659    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17660    /// clear append mode.
17661    ///
17662    /// Errors:
17663    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17664    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17665    pub fn r#set_flags(
17666        &self,
17667        mut flags: Flags,
17668        ___deadline: zx::MonotonicInstant,
17669    ) -> Result<NodeSetFlagsResult, fidl::Error> {
17670        let _response = self.client.send_query::<
17671            NodeSetFlagsRequest,
17672            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17673            SymlinkMarker,
17674        >(
17675            (flags,),
17676            0x55a8028685791ea8,
17677            fidl::encoding::DynamicFlags::FLEXIBLE,
17678            ___deadline,
17679        )?
17680        .into_result::<SymlinkMarker>("set_flags")?;
17681        Ok(_response.map(|x| x))
17682    }
17683
17684    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17685    /// volume has different settings or the storage is accounted seperately from the rest of the
17686    /// filesystem that may be reported instead of filesystem-wide details.
17687    pub fn r#query_filesystem(
17688        &self,
17689        ___deadline: zx::MonotonicInstant,
17690    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17691        let _response = self
17692            .client
17693            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, SymlinkMarker>(
17694                (),
17695                0x6f344a1c6b0a0610,
17696                fidl::encoding::DynamicFlags::empty(),
17697                ___deadline,
17698            )?;
17699        Ok((_response.s, _response.info))
17700    }
17701
17702    /// Acquires a token which can be used to identify this connection at a later point in
17703    /// time. The token will remain valid for as long as the connection requesting the token
17704    /// remains open.
17705    ///
17706    /// This method does not require any rights. Note that the token identifies
17707    /// the connection, hence carries the rights information on this connection.
17708    pub fn r#get_token(
17709        &self,
17710        ___deadline: zx::MonotonicInstant,
17711    ) -> Result<NodeGetTokenResult, fidl::Error> {
17712        let _response = self.client.send_query::<
17713            fidl::encoding::EmptyPayload,
17714            fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
17715            SymlinkMarker,
17716        >(
17717            (),
17718            0x5054f0ade7076cec,
17719            fidl::encoding::DynamicFlags::FLEXIBLE,
17720            ___deadline,
17721        )?
17722        .into_result::<SymlinkMarker>("get_token")?;
17723        Ok(_response.map(|x| x.token))
17724    }
17725
17726    /// Acquires information about the node.
17727    ///
17728    /// The attributes of a node should be stable, independent of the
17729    /// specific protocol used to access it.
17730    ///
17731    /// If a particular attribute is not applicable or not supported,
17732    /// filesystems should leave the corresponding field absent.
17733    ///
17734    /// + `query` a bit-mask specifying which attributes to fetch. The server
17735    ///   should not return more than necessary.
17736    /// - `attributes` the returned attributes.
17737    ///
17738    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17739    pub fn r#get_attributes(
17740        &self,
17741        mut query: NodeAttributesQuery,
17742        ___deadline: zx::MonotonicInstant,
17743    ) -> Result<NodeGetAttributesResult, fidl::Error> {
17744        let _response = self.client.send_query::<
17745            NodeGetAttributesRequest,
17746            fidl::encoding::ResultType<NodeAttributes2, i32>,
17747            SymlinkMarker,
17748        >(
17749            (query,),
17750            0x3d4396a638ea053b,
17751            fidl::encoding::DynamicFlags::empty(),
17752            ___deadline,
17753        )?;
17754        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17755    }
17756
17757    /// Updates information about the node.
17758    ///
17759    /// + `attributes` the presence of a table field in `attributes` indicates
17760    /// the intent to update the corresponding attribute.
17761    ///
17762    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17763    ///
17764    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17765    pub fn r#update_attributes(
17766        &self,
17767        mut payload: &MutableNodeAttributes,
17768        ___deadline: zx::MonotonicInstant,
17769    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17770        let _response = self.client.send_query::<
17771            MutableNodeAttributes,
17772            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17773            SymlinkMarker,
17774        >(
17775            payload,
17776            0x3308c1da5a89bf08,
17777            fidl::encoding::DynamicFlags::empty(),
17778            ___deadline,
17779        )?;
17780        Ok(_response.map(|x| x))
17781    }
17782
17783    /// Synchronizes updates to the node to the underlying media, if it exists.
17784    ///
17785    /// This method will return when the filesystem server has flushed the
17786    /// relevant updates to the underlying media, but does not guarantee the
17787    /// underlying media has persisted the information, nor that any information
17788    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17789    /// between operations.
17790    ///
17791    /// This method does not require any rights.
17792    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
17793        let _response = self.client.send_query::<
17794            fidl::encoding::EmptyPayload,
17795            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17796            SymlinkMarker,
17797        >(
17798            (),
17799            0x2c5c27ca0ab5dc49,
17800            fidl::encoding::DynamicFlags::empty(),
17801            ___deadline,
17802        )?;
17803        Ok(_response.map(|x| x))
17804    }
17805
17806    /// Creates an iterator over all the extended attribute names associated
17807    /// with this node. If an error occurs it is returned as an epitaph on the
17808    /// iterator request channel, and then the channel is closed.
17809    ///
17810    /// GetExtendedAttributes can be used with any of these names to retrieve
17811    /// the associated value.
17812    ///
17813    /// This method requires the [`Rights.READ_BYTES`] right.
17814    pub fn r#list_extended_attributes(
17815        &self,
17816        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17817    ) -> Result<(), fidl::Error> {
17818        self.client.send::<NodeListExtendedAttributesRequest>(
17819            (iterator,),
17820            0x4b61033de007fcd0,
17821            fidl::encoding::DynamicFlags::empty(),
17822        )
17823    }
17824
17825    /// Get the value associated with the given attribute `name` for this node.
17826    ///
17827    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17828    /// particular structure is imposed on them.
17829    ///
17830    /// This method requires the [`Rights.READ_BYTES`] right.
17831    pub fn r#get_extended_attribute(
17832        &self,
17833        mut name: &[u8],
17834        ___deadline: zx::MonotonicInstant,
17835    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17836        let _response = self.client.send_query::<
17837            NodeGetExtendedAttributeRequest,
17838            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17839            SymlinkMarker,
17840        >(
17841            (name,),
17842            0x45ffa3ccfdeb76db,
17843            fidl::encoding::DynamicFlags::empty(),
17844            ___deadline,
17845        )?;
17846        Ok(_response.map(|x| x))
17847    }
17848
17849    /// Set the value for the given attribute `name` to `value` for this node.
17850    ///
17851    /// The attribute name may exist, in which case the attribute is updated.
17852    /// If the attribute doesn't exist, it is created. The name should have no
17853    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17854    ///
17855    /// This method requires the [`Rights.WRITE_BYTES`] right.
17856    pub fn r#set_extended_attribute(
17857        &self,
17858        mut name: &[u8],
17859        mut value: ExtendedAttributeValue,
17860        mut mode: SetExtendedAttributeMode,
17861        ___deadline: zx::MonotonicInstant,
17862    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17863        let _response = self.client.send_query::<
17864            NodeSetExtendedAttributeRequest,
17865            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17866            SymlinkMarker,
17867        >(
17868            (name, &mut value, mode,),
17869            0x4a951362f681f23c,
17870            fidl::encoding::DynamicFlags::empty(),
17871            ___deadline,
17872        )?;
17873        Ok(_response.map(|x| x))
17874    }
17875
17876    /// Remove the specified extended attribute.
17877    ///
17878    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17879    ///
17880    /// This method requires the [`Rights.WRITE_BYTES`] right.
17881    pub fn r#remove_extended_attribute(
17882        &self,
17883        mut name: &[u8],
17884        ___deadline: zx::MonotonicInstant,
17885    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17886        let _response = self.client.send_query::<
17887            NodeRemoveExtendedAttributeRequest,
17888            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17889            SymlinkMarker,
17890        >(
17891            (name,),
17892            0x7a0b9f3a9bf9032d,
17893            fidl::encoding::DynamicFlags::empty(),
17894            ___deadline,
17895        )?;
17896        Ok(_response.map(|x| x))
17897    }
17898
17899    /// Open (or create) a node relative to this directory. Any errors are communicated via an
17900    /// epitaph sent on the `object` channel.
17901    ///
17902    /// Errors:
17903    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
17904    /// * See [`Flags`] for other errors which may be communicated based on `flags`
17905    pub fn r#open(
17906        &self,
17907        mut path: &str,
17908        mut flags: Flags,
17909        mut options: &Options,
17910        mut object: fidl::Channel,
17911    ) -> Result<(), fidl::Error> {
17912        self.client.send::<OpenableOpenRequest>(
17913            (path, flags, options, object),
17914            0x568ddcb9a9cbb6d9,
17915            fidl::encoding::DynamicFlags::FLEXIBLE,
17916        )
17917    }
17918
17919    pub fn r#describe(
17920        &self,
17921        ___deadline: zx::MonotonicInstant,
17922    ) -> Result<SymlinkInfo, fidl::Error> {
17923        let _response = self.client.send_query::<
17924            fidl::encoding::EmptyPayload,
17925            fidl::encoding::FlexibleType<SymlinkInfo>,
17926            SymlinkMarker,
17927        >(
17928            (),
17929            0x742c2ea5e89831f3,
17930            fidl::encoding::DynamicFlags::FLEXIBLE,
17931            ___deadline,
17932        )?
17933        .into_result::<SymlinkMarker>("describe")?;
17934        Ok(_response)
17935    }
17936}
17937
17938#[cfg(target_os = "fuchsia")]
17939impl From<SymlinkSynchronousProxy> for zx::NullableHandle {
17940    fn from(value: SymlinkSynchronousProxy) -> Self {
17941        value.into_channel().into()
17942    }
17943}
17944
17945#[cfg(target_os = "fuchsia")]
17946impl From<fidl::Channel> for SymlinkSynchronousProxy {
17947    fn from(value: fidl::Channel) -> Self {
17948        Self::new(value)
17949    }
17950}
17951
17952#[cfg(target_os = "fuchsia")]
17953impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
17954    type Protocol = SymlinkMarker;
17955
17956    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
17957        Self::new(value.into_channel())
17958    }
17959}
17960
17961#[derive(Debug, Clone)]
17962pub struct SymlinkProxy {
17963    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
17964}
17965
17966impl fidl::endpoints::Proxy for SymlinkProxy {
17967    type Protocol = SymlinkMarker;
17968
17969    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
17970        Self::new(inner)
17971    }
17972
17973    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
17974        self.client.into_channel().map_err(|client| Self { client })
17975    }
17976
17977    fn as_channel(&self) -> &::fidl::AsyncChannel {
17978        self.client.as_channel()
17979    }
17980}
17981
17982impl SymlinkProxy {
17983    /// Create a new Proxy for fuchsia.io/Symlink.
17984    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17985        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17986        Self { client: fidl::client::Client::new(channel, protocol_name) }
17987    }
17988
17989    /// Get a Stream of events from the remote end of the protocol.
17990    ///
17991    /// # Panics
17992    ///
17993    /// Panics if the event stream was already taken.
17994    pub fn take_event_stream(&self) -> SymlinkEventStream {
17995        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17996    }
17997
17998    /// Creates a link to this this object with name `dst` in the directory represented by
17999    /// `dst_parent_token`.
18000    ///
18001    /// `dst` must be a resolved object name. Including "/" in the string will return
18002    /// `ZX_ERR_INVALID_ARGS`.
18003    ///
18004    /// This method requires the maximal set of rights supported by the filesystem for this object.
18005    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18006    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18007    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18008    /// `ZX_ERR_ACCESS_DENIED`.
18009    ///
18010    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18011    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18012    ///
18013    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18014    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18015    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18016    ///
18017    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18018    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18019    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18020    pub fn r#link_into(
18021        &self,
18022        mut dst_parent_token: fidl::Event,
18023        mut dst: &str,
18024    ) -> fidl::client::QueryResponseFut<
18025        LinkableLinkIntoResult,
18026        fidl::encoding::DefaultFuchsiaResourceDialect,
18027    > {
18028        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
18029    }
18030
18031    pub fn r#clone(
18032        &self,
18033        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18034    ) -> Result<(), fidl::Error> {
18035        SymlinkProxyInterface::r#clone(self, request)
18036    }
18037
18038    /// Terminates the connection.
18039    ///
18040    /// After calling `Close`, the client must not send any other requests.
18041    ///
18042    /// Servers, after sending the status response, should close the connection
18043    /// regardless of status and without sending an epitaph.
18044    ///
18045    /// Closing the client end of the channel should be semantically equivalent
18046    /// to calling `Close` without knowing when the close has completed or its
18047    /// status.
18048    pub fn r#close(
18049        &self,
18050    ) -> fidl::client::QueryResponseFut<
18051        fidl_fuchsia_unknown::CloseableCloseResult,
18052        fidl::encoding::DefaultFuchsiaResourceDialect,
18053    > {
18054        SymlinkProxyInterface::r#close(self)
18055    }
18056
18057    pub fn r#query(
18058        &self,
18059    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
18060    {
18061        SymlinkProxyInterface::r#query(self)
18062    }
18063
18064    /// DEPRECATED - Use `Node.GetAttributes` instead.
18065    ///
18066    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18067    pub fn r#deprecated_get_attr(
18068        &self,
18069    ) -> fidl::client::QueryResponseFut<
18070        (i32, NodeAttributes),
18071        fidl::encoding::DefaultFuchsiaResourceDialect,
18072    > {
18073        SymlinkProxyInterface::r#deprecated_get_attr(self)
18074    }
18075
18076    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18077    pub fn r#deprecated_set_attr(
18078        &self,
18079        mut flags: NodeAttributeFlags,
18080        mut attributes: &NodeAttributes,
18081    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
18082        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
18083    }
18084
18085    /// [DEPRECATED - Use new GetFlags method instead.]
18086    pub fn r#deprecated_get_flags(
18087        &self,
18088    ) -> fidl::client::QueryResponseFut<
18089        (i32, OpenFlags),
18090        fidl::encoding::DefaultFuchsiaResourceDialect,
18091    > {
18092        SymlinkProxyInterface::r#deprecated_get_flags(self)
18093    }
18094
18095    /// [DEPRECATED - Use new SetFlags method instead.]
18096    pub fn r#deprecated_set_flags(
18097        &self,
18098        mut flags: OpenFlags,
18099    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
18100        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
18101    }
18102
18103    /// Queries the flags that apply to this node after it has been opened/created. This method does
18104    /// not require any rights.
18105    ///
18106    /// Note that the final set of flags that apply to the connection may differ from those
18107    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
18108    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
18109    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
18110    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
18111    pub fn r#get_flags(
18112        &self,
18113    ) -> fidl::client::QueryResponseFut<
18114        NodeGetFlagsResult,
18115        fidl::encoding::DefaultFuchsiaResourceDialect,
18116    > {
18117        SymlinkProxyInterface::r#get_flags(self)
18118    }
18119
18120    /// Sets the flags that apply to this node after it has been opened. This method does not
18121    /// require any rights.
18122    ///
18123    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
18124    /// clear append mode.
18125    ///
18126    /// Errors:
18127    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
18128    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
18129    pub fn r#set_flags(
18130        &self,
18131        mut flags: Flags,
18132    ) -> fidl::client::QueryResponseFut<
18133        NodeSetFlagsResult,
18134        fidl::encoding::DefaultFuchsiaResourceDialect,
18135    > {
18136        SymlinkProxyInterface::r#set_flags(self, flags)
18137    }
18138
18139    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
18140    /// volume has different settings or the storage is accounted seperately from the rest of the
18141    /// filesystem that may be reported instead of filesystem-wide details.
18142    pub fn r#query_filesystem(
18143        &self,
18144    ) -> fidl::client::QueryResponseFut<
18145        (i32, Option<Box<FilesystemInfo>>),
18146        fidl::encoding::DefaultFuchsiaResourceDialect,
18147    > {
18148        SymlinkProxyInterface::r#query_filesystem(self)
18149    }
18150
18151    /// Acquires a token which can be used to identify this connection at a later point in
18152    /// time. The token will remain valid for as long as the connection requesting the token
18153    /// remains open.
18154    ///
18155    /// This method does not require any rights. Note that the token identifies
18156    /// the connection, hence carries the rights information on this connection.
18157    pub fn r#get_token(
18158        &self,
18159    ) -> fidl::client::QueryResponseFut<
18160        NodeGetTokenResult,
18161        fidl::encoding::DefaultFuchsiaResourceDialect,
18162    > {
18163        SymlinkProxyInterface::r#get_token(self)
18164    }
18165
18166    /// Acquires information about the node.
18167    ///
18168    /// The attributes of a node should be stable, independent of the
18169    /// specific protocol used to access it.
18170    ///
18171    /// If a particular attribute is not applicable or not supported,
18172    /// filesystems should leave the corresponding field absent.
18173    ///
18174    /// + `query` a bit-mask specifying which attributes to fetch. The server
18175    ///   should not return more than necessary.
18176    /// - `attributes` the returned attributes.
18177    ///
18178    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
18179    pub fn r#get_attributes(
18180        &self,
18181        mut query: NodeAttributesQuery,
18182    ) -> fidl::client::QueryResponseFut<
18183        NodeGetAttributesResult,
18184        fidl::encoding::DefaultFuchsiaResourceDialect,
18185    > {
18186        SymlinkProxyInterface::r#get_attributes(self, query)
18187    }
18188
18189    /// Updates information about the node.
18190    ///
18191    /// + `attributes` the presence of a table field in `attributes` indicates
18192    /// the intent to update the corresponding attribute.
18193    ///
18194    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
18195    ///
18196    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
18197    pub fn r#update_attributes(
18198        &self,
18199        mut payload: &MutableNodeAttributes,
18200    ) -> fidl::client::QueryResponseFut<
18201        NodeUpdateAttributesResult,
18202        fidl::encoding::DefaultFuchsiaResourceDialect,
18203    > {
18204        SymlinkProxyInterface::r#update_attributes(self, payload)
18205    }
18206
18207    /// Synchronizes updates to the node to the underlying media, if it exists.
18208    ///
18209    /// This method will return when the filesystem server has flushed the
18210    /// relevant updates to the underlying media, but does not guarantee the
18211    /// underlying media has persisted the information, nor that any information
18212    /// is committed to hardware. Clients may use `Sync` to ensure ordering
18213    /// between operations.
18214    ///
18215    /// This method does not require any rights.
18216    pub fn r#sync(
18217        &self,
18218    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
18219    {
18220        SymlinkProxyInterface::r#sync(self)
18221    }
18222
18223    /// Creates an iterator over all the extended attribute names associated
18224    /// with this node. If an error occurs it is returned as an epitaph on the
18225    /// iterator request channel, and then the channel is closed.
18226    ///
18227    /// GetExtendedAttributes can be used with any of these names to retrieve
18228    /// the associated value.
18229    ///
18230    /// This method requires the [`Rights.READ_BYTES`] right.
18231    pub fn r#list_extended_attributes(
18232        &self,
18233        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18234    ) -> Result<(), fidl::Error> {
18235        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
18236    }
18237
18238    /// Get the value associated with the given attribute `name` for this node.
18239    ///
18240    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
18241    /// particular structure is imposed on them.
18242    ///
18243    /// This method requires the [`Rights.READ_BYTES`] right.
18244    pub fn r#get_extended_attribute(
18245        &self,
18246        mut name: &[u8],
18247    ) -> fidl::client::QueryResponseFut<
18248        NodeGetExtendedAttributeResult,
18249        fidl::encoding::DefaultFuchsiaResourceDialect,
18250    > {
18251        SymlinkProxyInterface::r#get_extended_attribute(self, name)
18252    }
18253
18254    /// Set the value for the given attribute `name` to `value` for this node.
18255    ///
18256    /// The attribute name may exist, in which case the attribute is updated.
18257    /// If the attribute doesn't exist, it is created. The name should have no
18258    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
18259    ///
18260    /// This method requires the [`Rights.WRITE_BYTES`] right.
18261    pub fn r#set_extended_attribute(
18262        &self,
18263        mut name: &[u8],
18264        mut value: ExtendedAttributeValue,
18265        mut mode: SetExtendedAttributeMode,
18266    ) -> fidl::client::QueryResponseFut<
18267        NodeSetExtendedAttributeResult,
18268        fidl::encoding::DefaultFuchsiaResourceDialect,
18269    > {
18270        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
18271    }
18272
18273    /// Remove the specified extended attribute.
18274    ///
18275    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
18276    ///
18277    /// This method requires the [`Rights.WRITE_BYTES`] right.
18278    pub fn r#remove_extended_attribute(
18279        &self,
18280        mut name: &[u8],
18281    ) -> fidl::client::QueryResponseFut<
18282        NodeRemoveExtendedAttributeResult,
18283        fidl::encoding::DefaultFuchsiaResourceDialect,
18284    > {
18285        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
18286    }
18287
18288    /// Open (or create) a node relative to this directory. Any errors are communicated via an
18289    /// epitaph sent on the `object` channel.
18290    ///
18291    /// Errors:
18292    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
18293    /// * See [`Flags`] for other errors which may be communicated based on `flags`
18294    pub fn r#open(
18295        &self,
18296        mut path: &str,
18297        mut flags: Flags,
18298        mut options: &Options,
18299        mut object: fidl::Channel,
18300    ) -> Result<(), fidl::Error> {
18301        SymlinkProxyInterface::r#open(self, path, flags, options, object)
18302    }
18303
18304    pub fn r#describe(
18305        &self,
18306    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
18307    {
18308        SymlinkProxyInterface::r#describe(self)
18309    }
18310}
18311
18312impl SymlinkProxyInterface for SymlinkProxy {
18313    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
18314        LinkableLinkIntoResult,
18315        fidl::encoding::DefaultFuchsiaResourceDialect,
18316    >;
18317    fn r#link_into(
18318        &self,
18319        mut dst_parent_token: fidl::Event,
18320        mut dst: &str,
18321    ) -> Self::LinkIntoResponseFut {
18322        fn _decode(
18323            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18324        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
18325            let _response = fidl::client::decode_transaction_body::<
18326                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18327                fidl::encoding::DefaultFuchsiaResourceDialect,
18328                0x54f3949246a03e74,
18329            >(_buf?)?;
18330            Ok(_response.map(|x| x))
18331        }
18332        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
18333            (dst_parent_token, dst),
18334            0x54f3949246a03e74,
18335            fidl::encoding::DynamicFlags::empty(),
18336            _decode,
18337        )
18338    }
18339
18340    fn r#clone(
18341        &self,
18342        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18343    ) -> Result<(), fidl::Error> {
18344        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
18345            (request,),
18346            0x20d8a7aba2168a79,
18347            fidl::encoding::DynamicFlags::empty(),
18348        )
18349    }
18350
18351    type CloseResponseFut = fidl::client::QueryResponseFut<
18352        fidl_fuchsia_unknown::CloseableCloseResult,
18353        fidl::encoding::DefaultFuchsiaResourceDialect,
18354    >;
18355    fn r#close(&self) -> Self::CloseResponseFut {
18356        fn _decode(
18357            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18358        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
18359            let _response = fidl::client::decode_transaction_body::<
18360                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18361                fidl::encoding::DefaultFuchsiaResourceDialect,
18362                0x5ac5d459ad7f657e,
18363            >(_buf?)?;
18364            Ok(_response.map(|x| x))
18365        }
18366        self.client.send_query_and_decode::<
18367            fidl::encoding::EmptyPayload,
18368            fidl_fuchsia_unknown::CloseableCloseResult,
18369        >(
18370            (),
18371            0x5ac5d459ad7f657e,
18372            fidl::encoding::DynamicFlags::empty(),
18373            _decode,
18374        )
18375    }
18376
18377    type QueryResponseFut =
18378        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
18379    fn r#query(&self) -> Self::QueryResponseFut {
18380        fn _decode(
18381            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18382        ) -> Result<Vec<u8>, fidl::Error> {
18383            let _response = fidl::client::decode_transaction_body::<
18384                fidl_fuchsia_unknown::QueryableQueryResponse,
18385                fidl::encoding::DefaultFuchsiaResourceDialect,
18386                0x2658edee9decfc06,
18387            >(_buf?)?;
18388            Ok(_response.protocol)
18389        }
18390        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
18391            (),
18392            0x2658edee9decfc06,
18393            fidl::encoding::DynamicFlags::empty(),
18394            _decode,
18395        )
18396    }
18397
18398    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
18399        (i32, NodeAttributes),
18400        fidl::encoding::DefaultFuchsiaResourceDialect,
18401    >;
18402    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
18403        fn _decode(
18404            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18405        ) -> Result<(i32, NodeAttributes), fidl::Error> {
18406            let _response = fidl::client::decode_transaction_body::<
18407                NodeDeprecatedGetAttrResponse,
18408                fidl::encoding::DefaultFuchsiaResourceDialect,
18409                0x78985e216314dafd,
18410            >(_buf?)?;
18411            Ok((_response.s, _response.attributes))
18412        }
18413        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
18414            (),
18415            0x78985e216314dafd,
18416            fidl::encoding::DynamicFlags::empty(),
18417            _decode,
18418        )
18419    }
18420
18421    type DeprecatedSetAttrResponseFut =
18422        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18423    fn r#deprecated_set_attr(
18424        &self,
18425        mut flags: NodeAttributeFlags,
18426        mut attributes: &NodeAttributes,
18427    ) -> Self::DeprecatedSetAttrResponseFut {
18428        fn _decode(
18429            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18430        ) -> Result<i32, fidl::Error> {
18431            let _response = fidl::client::decode_transaction_body::<
18432                NodeDeprecatedSetAttrResponse,
18433                fidl::encoding::DefaultFuchsiaResourceDialect,
18434                0x4186c0f40d938f46,
18435            >(_buf?)?;
18436            Ok(_response.s)
18437        }
18438        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
18439            (flags, attributes),
18440            0x4186c0f40d938f46,
18441            fidl::encoding::DynamicFlags::empty(),
18442            _decode,
18443        )
18444    }
18445
18446    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
18447        (i32, OpenFlags),
18448        fidl::encoding::DefaultFuchsiaResourceDialect,
18449    >;
18450    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
18451        fn _decode(
18452            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18453        ) -> Result<(i32, OpenFlags), fidl::Error> {
18454            let _response = fidl::client::decode_transaction_body::<
18455                NodeDeprecatedGetFlagsResponse,
18456                fidl::encoding::DefaultFuchsiaResourceDialect,
18457                0x5b88fffb8eda3aa1,
18458            >(_buf?)?;
18459            Ok((_response.s, _response.flags))
18460        }
18461        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
18462            (),
18463            0x5b88fffb8eda3aa1,
18464            fidl::encoding::DynamicFlags::empty(),
18465            _decode,
18466        )
18467    }
18468
18469    type DeprecatedSetFlagsResponseFut =
18470        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18471    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
18472        fn _decode(
18473            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18474        ) -> Result<i32, fidl::Error> {
18475            let _response = fidl::client::decode_transaction_body::<
18476                NodeDeprecatedSetFlagsResponse,
18477                fidl::encoding::DefaultFuchsiaResourceDialect,
18478                0x5295b76c71fde733,
18479            >(_buf?)?;
18480            Ok(_response.s)
18481        }
18482        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
18483            (flags,),
18484            0x5295b76c71fde733,
18485            fidl::encoding::DynamicFlags::empty(),
18486            _decode,
18487        )
18488    }
18489
18490    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
18491        NodeGetFlagsResult,
18492        fidl::encoding::DefaultFuchsiaResourceDialect,
18493    >;
18494    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
18495        fn _decode(
18496            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18497        ) -> Result<NodeGetFlagsResult, fidl::Error> {
18498            let _response = fidl::client::decode_transaction_body::<
18499                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
18500                fidl::encoding::DefaultFuchsiaResourceDialect,
18501                0x176eb318f64ec23,
18502            >(_buf?)?
18503            .into_result::<SymlinkMarker>("get_flags")?;
18504            Ok(_response.map(|x| x.flags))
18505        }
18506        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
18507            (),
18508            0x176eb318f64ec23,
18509            fidl::encoding::DynamicFlags::FLEXIBLE,
18510            _decode,
18511        )
18512    }
18513
18514    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
18515        NodeSetFlagsResult,
18516        fidl::encoding::DefaultFuchsiaResourceDialect,
18517    >;
18518    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
18519        fn _decode(
18520            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18521        ) -> Result<NodeSetFlagsResult, fidl::Error> {
18522            let _response = fidl::client::decode_transaction_body::<
18523                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
18524                fidl::encoding::DefaultFuchsiaResourceDialect,
18525                0x55a8028685791ea8,
18526            >(_buf?)?
18527            .into_result::<SymlinkMarker>("set_flags")?;
18528            Ok(_response.map(|x| x))
18529        }
18530        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
18531            (flags,),
18532            0x55a8028685791ea8,
18533            fidl::encoding::DynamicFlags::FLEXIBLE,
18534            _decode,
18535        )
18536    }
18537
18538    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
18539        (i32, Option<Box<FilesystemInfo>>),
18540        fidl::encoding::DefaultFuchsiaResourceDialect,
18541    >;
18542    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
18543        fn _decode(
18544            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18545        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
18546            let _response = fidl::client::decode_transaction_body::<
18547                NodeQueryFilesystemResponse,
18548                fidl::encoding::DefaultFuchsiaResourceDialect,
18549                0x6f344a1c6b0a0610,
18550            >(_buf?)?;
18551            Ok((_response.s, _response.info))
18552        }
18553        self.client.send_query_and_decode::<
18554            fidl::encoding::EmptyPayload,
18555            (i32, Option<Box<FilesystemInfo>>),
18556        >(
18557            (),
18558            0x6f344a1c6b0a0610,
18559            fidl::encoding::DynamicFlags::empty(),
18560            _decode,
18561        )
18562    }
18563
18564    type GetTokenResponseFut = fidl::client::QueryResponseFut<
18565        NodeGetTokenResult,
18566        fidl::encoding::DefaultFuchsiaResourceDialect,
18567    >;
18568    fn r#get_token(&self) -> Self::GetTokenResponseFut {
18569        fn _decode(
18570            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18571        ) -> Result<NodeGetTokenResult, fidl::Error> {
18572            let _response = fidl::client::decode_transaction_body::<
18573                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
18574                fidl::encoding::DefaultFuchsiaResourceDialect,
18575                0x5054f0ade7076cec,
18576            >(_buf?)?
18577            .into_result::<SymlinkMarker>("get_token")?;
18578            Ok(_response.map(|x| x.token))
18579        }
18580        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
18581            (),
18582            0x5054f0ade7076cec,
18583            fidl::encoding::DynamicFlags::FLEXIBLE,
18584            _decode,
18585        )
18586    }
18587
18588    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
18589        NodeGetAttributesResult,
18590        fidl::encoding::DefaultFuchsiaResourceDialect,
18591    >;
18592    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
18593        fn _decode(
18594            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18595        ) -> Result<NodeGetAttributesResult, fidl::Error> {
18596            let _response = fidl::client::decode_transaction_body::<
18597                fidl::encoding::ResultType<NodeAttributes2, i32>,
18598                fidl::encoding::DefaultFuchsiaResourceDialect,
18599                0x3d4396a638ea053b,
18600            >(_buf?)?;
18601            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
18602        }
18603        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
18604            (query,),
18605            0x3d4396a638ea053b,
18606            fidl::encoding::DynamicFlags::empty(),
18607            _decode,
18608        )
18609    }
18610
18611    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
18612        NodeUpdateAttributesResult,
18613        fidl::encoding::DefaultFuchsiaResourceDialect,
18614    >;
18615    fn r#update_attributes(
18616        &self,
18617        mut payload: &MutableNodeAttributes,
18618    ) -> Self::UpdateAttributesResponseFut {
18619        fn _decode(
18620            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18621        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
18622            let _response = fidl::client::decode_transaction_body::<
18623                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18624                fidl::encoding::DefaultFuchsiaResourceDialect,
18625                0x3308c1da5a89bf08,
18626            >(_buf?)?;
18627            Ok(_response.map(|x| x))
18628        }
18629        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
18630            payload,
18631            0x3308c1da5a89bf08,
18632            fidl::encoding::DynamicFlags::empty(),
18633            _decode,
18634        )
18635    }
18636
18637    type SyncResponseFut = fidl::client::QueryResponseFut<
18638        NodeSyncResult,
18639        fidl::encoding::DefaultFuchsiaResourceDialect,
18640    >;
18641    fn r#sync(&self) -> Self::SyncResponseFut {
18642        fn _decode(
18643            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18644        ) -> Result<NodeSyncResult, fidl::Error> {
18645            let _response = fidl::client::decode_transaction_body::<
18646                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18647                fidl::encoding::DefaultFuchsiaResourceDialect,
18648                0x2c5c27ca0ab5dc49,
18649            >(_buf?)?;
18650            Ok(_response.map(|x| x))
18651        }
18652        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
18653            (),
18654            0x2c5c27ca0ab5dc49,
18655            fidl::encoding::DynamicFlags::empty(),
18656            _decode,
18657        )
18658    }
18659
18660    fn r#list_extended_attributes(
18661        &self,
18662        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18663    ) -> Result<(), fidl::Error> {
18664        self.client.send::<NodeListExtendedAttributesRequest>(
18665            (iterator,),
18666            0x4b61033de007fcd0,
18667            fidl::encoding::DynamicFlags::empty(),
18668        )
18669    }
18670
18671    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18672        NodeGetExtendedAttributeResult,
18673        fidl::encoding::DefaultFuchsiaResourceDialect,
18674    >;
18675    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
18676        fn _decode(
18677            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18678        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
18679            let _response = fidl::client::decode_transaction_body::<
18680                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
18681                fidl::encoding::DefaultFuchsiaResourceDialect,
18682                0x45ffa3ccfdeb76db,
18683            >(_buf?)?;
18684            Ok(_response.map(|x| x))
18685        }
18686        self.client.send_query_and_decode::<
18687            NodeGetExtendedAttributeRequest,
18688            NodeGetExtendedAttributeResult,
18689        >(
18690            (name,),
18691            0x45ffa3ccfdeb76db,
18692            fidl::encoding::DynamicFlags::empty(),
18693            _decode,
18694        )
18695    }
18696
18697    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18698        NodeSetExtendedAttributeResult,
18699        fidl::encoding::DefaultFuchsiaResourceDialect,
18700    >;
18701    fn r#set_extended_attribute(
18702        &self,
18703        mut name: &[u8],
18704        mut value: ExtendedAttributeValue,
18705        mut mode: SetExtendedAttributeMode,
18706    ) -> Self::SetExtendedAttributeResponseFut {
18707        fn _decode(
18708            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18709        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
18710            let _response = fidl::client::decode_transaction_body::<
18711                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18712                fidl::encoding::DefaultFuchsiaResourceDialect,
18713                0x4a951362f681f23c,
18714            >(_buf?)?;
18715            Ok(_response.map(|x| x))
18716        }
18717        self.client.send_query_and_decode::<
18718            NodeSetExtendedAttributeRequest,
18719            NodeSetExtendedAttributeResult,
18720        >(
18721            (name, &mut value, mode,),
18722            0x4a951362f681f23c,
18723            fidl::encoding::DynamicFlags::empty(),
18724            _decode,
18725        )
18726    }
18727
18728    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18729        NodeRemoveExtendedAttributeResult,
18730        fidl::encoding::DefaultFuchsiaResourceDialect,
18731    >;
18732    fn r#remove_extended_attribute(
18733        &self,
18734        mut name: &[u8],
18735    ) -> Self::RemoveExtendedAttributeResponseFut {
18736        fn _decode(
18737            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18738        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
18739            let _response = fidl::client::decode_transaction_body::<
18740                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18741                fidl::encoding::DefaultFuchsiaResourceDialect,
18742                0x7a0b9f3a9bf9032d,
18743            >(_buf?)?;
18744            Ok(_response.map(|x| x))
18745        }
18746        self.client.send_query_and_decode::<
18747            NodeRemoveExtendedAttributeRequest,
18748            NodeRemoveExtendedAttributeResult,
18749        >(
18750            (name,),
18751            0x7a0b9f3a9bf9032d,
18752            fidl::encoding::DynamicFlags::empty(),
18753            _decode,
18754        )
18755    }
18756
18757    fn r#open(
18758        &self,
18759        mut path: &str,
18760        mut flags: Flags,
18761        mut options: &Options,
18762        mut object: fidl::Channel,
18763    ) -> Result<(), fidl::Error> {
18764        self.client.send::<OpenableOpenRequest>(
18765            (path, flags, options, object),
18766            0x568ddcb9a9cbb6d9,
18767            fidl::encoding::DynamicFlags::FLEXIBLE,
18768        )
18769    }
18770
18771    type DescribeResponseFut =
18772        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
18773    fn r#describe(&self) -> Self::DescribeResponseFut {
18774        fn _decode(
18775            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18776        ) -> Result<SymlinkInfo, fidl::Error> {
18777            let _response = fidl::client::decode_transaction_body::<
18778                fidl::encoding::FlexibleType<SymlinkInfo>,
18779                fidl::encoding::DefaultFuchsiaResourceDialect,
18780                0x742c2ea5e89831f3,
18781            >(_buf?)?
18782            .into_result::<SymlinkMarker>("describe")?;
18783            Ok(_response)
18784        }
18785        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
18786            (),
18787            0x742c2ea5e89831f3,
18788            fidl::encoding::DynamicFlags::FLEXIBLE,
18789            _decode,
18790        )
18791    }
18792}
18793
18794pub struct SymlinkEventStream {
18795    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
18796}
18797
18798impl std::marker::Unpin for SymlinkEventStream {}
18799
18800impl futures::stream::FusedStream for SymlinkEventStream {
18801    fn is_terminated(&self) -> bool {
18802        self.event_receiver.is_terminated()
18803    }
18804}
18805
18806impl futures::Stream for SymlinkEventStream {
18807    type Item = Result<SymlinkEvent, fidl::Error>;
18808
18809    fn poll_next(
18810        mut self: std::pin::Pin<&mut Self>,
18811        cx: &mut std::task::Context<'_>,
18812    ) -> std::task::Poll<Option<Self::Item>> {
18813        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
18814            &mut self.event_receiver,
18815            cx
18816        )?) {
18817            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
18818            None => std::task::Poll::Ready(None),
18819        }
18820    }
18821}
18822
18823#[derive(Debug)]
18824pub enum SymlinkEvent {
18825    OnOpen_ {
18826        s: i32,
18827        info: Option<Box<NodeInfoDeprecated>>,
18828    },
18829    OnRepresentation {
18830        payload: Representation,
18831    },
18832    #[non_exhaustive]
18833    _UnknownEvent {
18834        /// Ordinal of the event that was sent.
18835        ordinal: u64,
18836    },
18837}
18838
18839impl SymlinkEvent {
18840    #[allow(irrefutable_let_patterns)]
18841    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
18842        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
18843    }
18844    #[allow(irrefutable_let_patterns)]
18845    pub fn into_on_representation(self) -> Option<Representation> {
18846        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
18847    }
18848
18849    /// Decodes a message buffer as a [`SymlinkEvent`].
18850    fn decode(
18851        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
18852    ) -> Result<SymlinkEvent, fidl::Error> {
18853        let (bytes, _handles) = buf.split_mut();
18854        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18855        debug_assert_eq!(tx_header.tx_id, 0);
18856        match tx_header.ordinal {
18857            0x7fc7bbb1dbfd1972 => {
18858                let mut out = fidl::new_empty!(
18859                    NodeOnOpenRequest,
18860                    fidl::encoding::DefaultFuchsiaResourceDialect
18861                );
18862                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
18863                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
18864            }
18865            0x5cb40567d80a510c => {
18866                let mut out =
18867                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
18868                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
18869                Ok((SymlinkEvent::OnRepresentation { payload: out }))
18870            }
18871            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
18872                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
18873            }
18874            _ => Err(fidl::Error::UnknownOrdinal {
18875                ordinal: tx_header.ordinal,
18876                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18877            }),
18878        }
18879    }
18880}
18881
18882/// A Stream of incoming requests for fuchsia.io/Symlink.
18883pub struct SymlinkRequestStream {
18884    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18885    is_terminated: bool,
18886}
18887
18888impl std::marker::Unpin for SymlinkRequestStream {}
18889
18890impl futures::stream::FusedStream for SymlinkRequestStream {
18891    fn is_terminated(&self) -> bool {
18892        self.is_terminated
18893    }
18894}
18895
18896impl fidl::endpoints::RequestStream for SymlinkRequestStream {
18897    type Protocol = SymlinkMarker;
18898    type ControlHandle = SymlinkControlHandle;
18899
18900    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
18901        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
18902    }
18903
18904    fn control_handle(&self) -> Self::ControlHandle {
18905        SymlinkControlHandle { inner: self.inner.clone() }
18906    }
18907
18908    fn into_inner(
18909        self,
18910    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
18911    {
18912        (self.inner, self.is_terminated)
18913    }
18914
18915    fn from_inner(
18916        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18917        is_terminated: bool,
18918    ) -> Self {
18919        Self { inner, is_terminated }
18920    }
18921}
18922
18923impl futures::Stream for SymlinkRequestStream {
18924    type Item = Result<SymlinkRequest, fidl::Error>;
18925
18926    fn poll_next(
18927        mut self: std::pin::Pin<&mut Self>,
18928        cx: &mut std::task::Context<'_>,
18929    ) -> std::task::Poll<Option<Self::Item>> {
18930        let this = &mut *self;
18931        if this.inner.check_shutdown(cx) {
18932            this.is_terminated = true;
18933            return std::task::Poll::Ready(None);
18934        }
18935        if this.is_terminated {
18936            panic!("polled SymlinkRequestStream after completion");
18937        }
18938        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
18939            |bytes, handles| {
18940                match this.inner.channel().read_etc(cx, bytes, handles) {
18941                    std::task::Poll::Ready(Ok(())) => {}
18942                    std::task::Poll::Pending => return std::task::Poll::Pending,
18943                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
18944                        this.is_terminated = true;
18945                        return std::task::Poll::Ready(None);
18946                    }
18947                    std::task::Poll::Ready(Err(e)) => {
18948                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
18949                            e.into(),
18950                        ))));
18951                    }
18952                }
18953
18954                // A message has been received from the channel
18955                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18956
18957                std::task::Poll::Ready(Some(match header.ordinal {
18958                    0x54f3949246a03e74 => {
18959                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18960                        let mut req = fidl::new_empty!(
18961                            LinkableLinkIntoRequest,
18962                            fidl::encoding::DefaultFuchsiaResourceDialect
18963                        );
18964                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
18965                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18966                        Ok(SymlinkRequest::LinkInto {
18967                            dst_parent_token: req.dst_parent_token,
18968                            dst: req.dst,
18969
18970                            responder: SymlinkLinkIntoResponder {
18971                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18972                                tx_id: header.tx_id,
18973                            },
18974                        })
18975                    }
18976                    0x20d8a7aba2168a79 => {
18977                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18978                        let mut req = fidl::new_empty!(
18979                            fidl_fuchsia_unknown::CloneableCloneRequest,
18980                            fidl::encoding::DefaultFuchsiaResourceDialect
18981                        );
18982                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18983                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18984                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
18985                    }
18986                    0x5ac5d459ad7f657e => {
18987                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18988                        let mut req = fidl::new_empty!(
18989                            fidl::encoding::EmptyPayload,
18990                            fidl::encoding::DefaultFuchsiaResourceDialect
18991                        );
18992                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18993                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18994                        Ok(SymlinkRequest::Close {
18995                            responder: SymlinkCloseResponder {
18996                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18997                                tx_id: header.tx_id,
18998                            },
18999                        })
19000                    }
19001                    0x2658edee9decfc06 => {
19002                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19003                        let mut req = fidl::new_empty!(
19004                            fidl::encoding::EmptyPayload,
19005                            fidl::encoding::DefaultFuchsiaResourceDialect
19006                        );
19007                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19008                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19009                        Ok(SymlinkRequest::Query {
19010                            responder: SymlinkQueryResponder {
19011                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19012                                tx_id: header.tx_id,
19013                            },
19014                        })
19015                    }
19016                    0x78985e216314dafd => {
19017                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19018                        let mut req = fidl::new_empty!(
19019                            fidl::encoding::EmptyPayload,
19020                            fidl::encoding::DefaultFuchsiaResourceDialect
19021                        );
19022                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19023                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19024                        Ok(SymlinkRequest::DeprecatedGetAttr {
19025                            responder: SymlinkDeprecatedGetAttrResponder {
19026                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19027                                tx_id: header.tx_id,
19028                            },
19029                        })
19030                    }
19031                    0x4186c0f40d938f46 => {
19032                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19033                        let mut req = fidl::new_empty!(
19034                            NodeDeprecatedSetAttrRequest,
19035                            fidl::encoding::DefaultFuchsiaResourceDialect
19036                        );
19037                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
19038                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19039                        Ok(SymlinkRequest::DeprecatedSetAttr {
19040                            flags: req.flags,
19041                            attributes: req.attributes,
19042
19043                            responder: SymlinkDeprecatedSetAttrResponder {
19044                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19045                                tx_id: header.tx_id,
19046                            },
19047                        })
19048                    }
19049                    0x5b88fffb8eda3aa1 => {
19050                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19051                        let mut req = fidl::new_empty!(
19052                            fidl::encoding::EmptyPayload,
19053                            fidl::encoding::DefaultFuchsiaResourceDialect
19054                        );
19055                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19056                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19057                        Ok(SymlinkRequest::DeprecatedGetFlags {
19058                            responder: SymlinkDeprecatedGetFlagsResponder {
19059                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19060                                tx_id: header.tx_id,
19061                            },
19062                        })
19063                    }
19064                    0x5295b76c71fde733 => {
19065                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19066                        let mut req = fidl::new_empty!(
19067                            NodeDeprecatedSetFlagsRequest,
19068                            fidl::encoding::DefaultFuchsiaResourceDialect
19069                        );
19070                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
19071                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19072                        Ok(SymlinkRequest::DeprecatedSetFlags {
19073                            flags: req.flags,
19074
19075                            responder: SymlinkDeprecatedSetFlagsResponder {
19076                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19077                                tx_id: header.tx_id,
19078                            },
19079                        })
19080                    }
19081                    0x176eb318f64ec23 => {
19082                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19083                        let mut req = fidl::new_empty!(
19084                            fidl::encoding::EmptyPayload,
19085                            fidl::encoding::DefaultFuchsiaResourceDialect
19086                        );
19087                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19088                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19089                        Ok(SymlinkRequest::GetFlags {
19090                            responder: SymlinkGetFlagsResponder {
19091                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19092                                tx_id: header.tx_id,
19093                            },
19094                        })
19095                    }
19096                    0x55a8028685791ea8 => {
19097                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19098                        let mut req = fidl::new_empty!(
19099                            NodeSetFlagsRequest,
19100                            fidl::encoding::DefaultFuchsiaResourceDialect
19101                        );
19102                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
19103                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19104                        Ok(SymlinkRequest::SetFlags {
19105                            flags: req.flags,
19106
19107                            responder: SymlinkSetFlagsResponder {
19108                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19109                                tx_id: header.tx_id,
19110                            },
19111                        })
19112                    }
19113                    0x6f344a1c6b0a0610 => {
19114                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19115                        let mut req = fidl::new_empty!(
19116                            fidl::encoding::EmptyPayload,
19117                            fidl::encoding::DefaultFuchsiaResourceDialect
19118                        );
19119                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19120                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19121                        Ok(SymlinkRequest::QueryFilesystem {
19122                            responder: SymlinkQueryFilesystemResponder {
19123                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19124                                tx_id: header.tx_id,
19125                            },
19126                        })
19127                    }
19128                    0x5054f0ade7076cec => {
19129                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19130                        let mut req = fidl::new_empty!(
19131                            fidl::encoding::EmptyPayload,
19132                            fidl::encoding::DefaultFuchsiaResourceDialect
19133                        );
19134                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19135                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19136                        Ok(SymlinkRequest::GetToken {
19137                            responder: SymlinkGetTokenResponder {
19138                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19139                                tx_id: header.tx_id,
19140                            },
19141                        })
19142                    }
19143                    0x3d4396a638ea053b => {
19144                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19145                        let mut req = fidl::new_empty!(
19146                            NodeGetAttributesRequest,
19147                            fidl::encoding::DefaultFuchsiaResourceDialect
19148                        );
19149                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
19150                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19151                        Ok(SymlinkRequest::GetAttributes {
19152                            query: req.query,
19153
19154                            responder: SymlinkGetAttributesResponder {
19155                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19156                                tx_id: header.tx_id,
19157                            },
19158                        })
19159                    }
19160                    0x3308c1da5a89bf08 => {
19161                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19162                        let mut req = fidl::new_empty!(
19163                            MutableNodeAttributes,
19164                            fidl::encoding::DefaultFuchsiaResourceDialect
19165                        );
19166                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
19167                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19168                        Ok(SymlinkRequest::UpdateAttributes {
19169                            payload: req,
19170                            responder: SymlinkUpdateAttributesResponder {
19171                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19172                                tx_id: header.tx_id,
19173                            },
19174                        })
19175                    }
19176                    0x2c5c27ca0ab5dc49 => {
19177                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19178                        let mut req = fidl::new_empty!(
19179                            fidl::encoding::EmptyPayload,
19180                            fidl::encoding::DefaultFuchsiaResourceDialect
19181                        );
19182                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19183                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19184                        Ok(SymlinkRequest::Sync {
19185                            responder: SymlinkSyncResponder {
19186                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19187                                tx_id: header.tx_id,
19188                            },
19189                        })
19190                    }
19191                    0x4b61033de007fcd0 => {
19192                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
19193                        let mut req = fidl::new_empty!(
19194                            NodeListExtendedAttributesRequest,
19195                            fidl::encoding::DefaultFuchsiaResourceDialect
19196                        );
19197                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
19198                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19199                        Ok(SymlinkRequest::ListExtendedAttributes {
19200                            iterator: req.iterator,
19201
19202                            control_handle,
19203                        })
19204                    }
19205                    0x45ffa3ccfdeb76db => {
19206                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19207                        let mut req = fidl::new_empty!(
19208                            NodeGetExtendedAttributeRequest,
19209                            fidl::encoding::DefaultFuchsiaResourceDialect
19210                        );
19211                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
19212                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19213                        Ok(SymlinkRequest::GetExtendedAttribute {
19214                            name: req.name,
19215
19216                            responder: SymlinkGetExtendedAttributeResponder {
19217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19218                                tx_id: header.tx_id,
19219                            },
19220                        })
19221                    }
19222                    0x4a951362f681f23c => {
19223                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19224                        let mut req = fidl::new_empty!(
19225                            NodeSetExtendedAttributeRequest,
19226                            fidl::encoding::DefaultFuchsiaResourceDialect
19227                        );
19228                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
19229                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19230                        Ok(SymlinkRequest::SetExtendedAttribute {
19231                            name: req.name,
19232                            value: req.value,
19233                            mode: req.mode,
19234
19235                            responder: SymlinkSetExtendedAttributeResponder {
19236                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19237                                tx_id: header.tx_id,
19238                            },
19239                        })
19240                    }
19241                    0x7a0b9f3a9bf9032d => {
19242                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19243                        let mut req = fidl::new_empty!(
19244                            NodeRemoveExtendedAttributeRequest,
19245                            fidl::encoding::DefaultFuchsiaResourceDialect
19246                        );
19247                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
19248                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19249                        Ok(SymlinkRequest::RemoveExtendedAttribute {
19250                            name: req.name,
19251
19252                            responder: SymlinkRemoveExtendedAttributeResponder {
19253                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19254                                tx_id: header.tx_id,
19255                            },
19256                        })
19257                    }
19258                    0x568ddcb9a9cbb6d9 => {
19259                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
19260                        let mut req = fidl::new_empty!(
19261                            OpenableOpenRequest,
19262                            fidl::encoding::DefaultFuchsiaResourceDialect
19263                        );
19264                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
19265                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19266                        Ok(SymlinkRequest::Open {
19267                            path: req.path,
19268                            flags: req.flags,
19269                            options: req.options,
19270                            object: req.object,
19271
19272                            control_handle,
19273                        })
19274                    }
19275                    0x742c2ea5e89831f3 => {
19276                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
19277                        let mut req = fidl::new_empty!(
19278                            fidl::encoding::EmptyPayload,
19279                            fidl::encoding::DefaultFuchsiaResourceDialect
19280                        );
19281                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
19282                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
19283                        Ok(SymlinkRequest::Describe {
19284                            responder: SymlinkDescribeResponder {
19285                                control_handle: std::mem::ManuallyDrop::new(control_handle),
19286                                tx_id: header.tx_id,
19287                            },
19288                        })
19289                    }
19290                    _ if header.tx_id == 0
19291                        && header
19292                            .dynamic_flags()
19293                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
19294                    {
19295                        Ok(SymlinkRequest::_UnknownMethod {
19296                            ordinal: header.ordinal,
19297                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
19298                            method_type: fidl::MethodType::OneWay,
19299                        })
19300                    }
19301                    _ if header
19302                        .dynamic_flags()
19303                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
19304                    {
19305                        this.inner.send_framework_err(
19306                            fidl::encoding::FrameworkErr::UnknownMethod,
19307                            header.tx_id,
19308                            header.ordinal,
19309                            header.dynamic_flags(),
19310                            (bytes, handles),
19311                        )?;
19312                        Ok(SymlinkRequest::_UnknownMethod {
19313                            ordinal: header.ordinal,
19314                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
19315                            method_type: fidl::MethodType::TwoWay,
19316                        })
19317                    }
19318                    _ => Err(fidl::Error::UnknownOrdinal {
19319                        ordinal: header.ordinal,
19320                        protocol_name:
19321                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
19322                    }),
19323                }))
19324            },
19325        )
19326    }
19327}
19328
19329/// A ['Node'] which contains a symbolic link.
19330#[derive(Debug)]
19331pub enum SymlinkRequest {
19332    /// Creates a link to this this object with name `dst` in the directory represented by
19333    /// `dst_parent_token`.
19334    ///
19335    /// `dst` must be a resolved object name. Including "/" in the string will return
19336    /// `ZX_ERR_INVALID_ARGS`.
19337    ///
19338    /// This method requires the maximal set of rights supported by the filesystem for this object.
19339    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
19340    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
19341    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
19342    /// `ZX_ERR_ACCESS_DENIED`.
19343    ///
19344    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
19345    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
19346    ///
19347    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
19348    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
19349    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
19350    ///
19351    /// This method does not have the same atomicity properties has the `Directory::Link` method,
19352    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
19353    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
19354    LinkInto {
19355        dst_parent_token: fidl::Event,
19356        dst: String,
19357        responder: SymlinkLinkIntoResponder,
19358    },
19359    Clone {
19360        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19361        control_handle: SymlinkControlHandle,
19362    },
19363    /// Terminates the connection.
19364    ///
19365    /// After calling `Close`, the client must not send any other requests.
19366    ///
19367    /// Servers, after sending the status response, should close the connection
19368    /// regardless of status and without sending an epitaph.
19369    ///
19370    /// Closing the client end of the channel should be semantically equivalent
19371    /// to calling `Close` without knowing when the close has completed or its
19372    /// status.
19373    Close {
19374        responder: SymlinkCloseResponder,
19375    },
19376    Query {
19377        responder: SymlinkQueryResponder,
19378    },
19379    /// DEPRECATED - Use `Node.GetAttributes` instead.
19380    ///
19381    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19382    DeprecatedGetAttr {
19383        responder: SymlinkDeprecatedGetAttrResponder,
19384    },
19385    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
19386    DeprecatedSetAttr {
19387        flags: NodeAttributeFlags,
19388        attributes: NodeAttributes,
19389        responder: SymlinkDeprecatedSetAttrResponder,
19390    },
19391    /// [DEPRECATED - Use new GetFlags method instead.]
19392    DeprecatedGetFlags {
19393        responder: SymlinkDeprecatedGetFlagsResponder,
19394    },
19395    /// [DEPRECATED - Use new SetFlags method instead.]
19396    DeprecatedSetFlags {
19397        flags: OpenFlags,
19398        responder: SymlinkDeprecatedSetFlagsResponder,
19399    },
19400    /// Queries the flags that apply to this node after it has been opened/created. This method does
19401    /// not require any rights.
19402    ///
19403    /// Note that the final set of flags that apply to the connection may differ from those
19404    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
19405    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
19406    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
19407    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
19408    GetFlags {
19409        responder: SymlinkGetFlagsResponder,
19410    },
19411    /// Sets the flags that apply to this node after it has been opened. This method does not
19412    /// require any rights.
19413    ///
19414    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
19415    /// clear append mode.
19416    ///
19417    /// Errors:
19418    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
19419    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
19420    SetFlags {
19421        flags: Flags,
19422        responder: SymlinkSetFlagsResponder,
19423    },
19424    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
19425    /// volume has different settings or the storage is accounted seperately from the rest of the
19426    /// filesystem that may be reported instead of filesystem-wide details.
19427    QueryFilesystem {
19428        responder: SymlinkQueryFilesystemResponder,
19429    },
19430    /// Acquires a token which can be used to identify this connection at a later point in
19431    /// time. The token will remain valid for as long as the connection requesting the token
19432    /// remains open.
19433    ///
19434    /// This method does not require any rights. Note that the token identifies
19435    /// the connection, hence carries the rights information on this connection.
19436    GetToken {
19437        responder: SymlinkGetTokenResponder,
19438    },
19439    /// Acquires information about the node.
19440    ///
19441    /// The attributes of a node should be stable, independent of the
19442    /// specific protocol used to access it.
19443    ///
19444    /// If a particular attribute is not applicable or not supported,
19445    /// filesystems should leave the corresponding field absent.
19446    ///
19447    /// + `query` a bit-mask specifying which attributes to fetch. The server
19448    ///   should not return more than necessary.
19449    /// - `attributes` the returned attributes.
19450    ///
19451    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19452    GetAttributes {
19453        query: NodeAttributesQuery,
19454        responder: SymlinkGetAttributesResponder,
19455    },
19456    /// Updates information about the node.
19457    ///
19458    /// + `attributes` the presence of a table field in `attributes` indicates
19459    /// the intent to update the corresponding attribute.
19460    ///
19461    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
19462    ///
19463    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19464    UpdateAttributes {
19465        payload: MutableNodeAttributes,
19466        responder: SymlinkUpdateAttributesResponder,
19467    },
19468    /// Synchronizes updates to the node to the underlying media, if it exists.
19469    ///
19470    /// This method will return when the filesystem server has flushed the
19471    /// relevant updates to the underlying media, but does not guarantee the
19472    /// underlying media has persisted the information, nor that any information
19473    /// is committed to hardware. Clients may use `Sync` to ensure ordering
19474    /// between operations.
19475    ///
19476    /// This method does not require any rights.
19477    Sync {
19478        responder: SymlinkSyncResponder,
19479    },
19480    /// Creates an iterator over all the extended attribute names associated
19481    /// with this node. If an error occurs it is returned as an epitaph on the
19482    /// iterator request channel, and then the channel is closed.
19483    ///
19484    /// GetExtendedAttributes can be used with any of these names to retrieve
19485    /// the associated value.
19486    ///
19487    /// This method requires the [`Rights.READ_BYTES`] right.
19488    ListExtendedAttributes {
19489        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
19490        control_handle: SymlinkControlHandle,
19491    },
19492    /// Get the value associated with the given attribute `name` for this node.
19493    ///
19494    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
19495    /// particular structure is imposed on them.
19496    ///
19497    /// This method requires the [`Rights.READ_BYTES`] right.
19498    GetExtendedAttribute {
19499        name: Vec<u8>,
19500        responder: SymlinkGetExtendedAttributeResponder,
19501    },
19502    /// Set the value for the given attribute `name` to `value` for this node.
19503    ///
19504    /// The attribute name may exist, in which case the attribute is updated.
19505    /// If the attribute doesn't exist, it is created. The name should have no
19506    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
19507    ///
19508    /// This method requires the [`Rights.WRITE_BYTES`] right.
19509    SetExtendedAttribute {
19510        name: Vec<u8>,
19511        value: ExtendedAttributeValue,
19512        mode: SetExtendedAttributeMode,
19513        responder: SymlinkSetExtendedAttributeResponder,
19514    },
19515    /// Remove the specified extended attribute.
19516    ///
19517    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
19518    ///
19519    /// This method requires the [`Rights.WRITE_BYTES`] right.
19520    RemoveExtendedAttribute {
19521        name: Vec<u8>,
19522        responder: SymlinkRemoveExtendedAttributeResponder,
19523    },
19524    /// Open (or create) a node relative to this directory. Any errors are communicated via an
19525    /// epitaph sent on the `object` channel.
19526    ///
19527    /// Errors:
19528    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
19529    /// * See [`Flags`] for other errors which may be communicated based on `flags`
19530    Open {
19531        path: String,
19532        flags: Flags,
19533        options: Options,
19534        object: fidl::Channel,
19535        control_handle: SymlinkControlHandle,
19536    },
19537    Describe {
19538        responder: SymlinkDescribeResponder,
19539    },
19540    /// An interaction was received which does not match any known method.
19541    #[non_exhaustive]
19542    _UnknownMethod {
19543        /// Ordinal of the method that was called.
19544        ordinal: u64,
19545        control_handle: SymlinkControlHandle,
19546        method_type: fidl::MethodType,
19547    },
19548}
19549
19550impl SymlinkRequest {
19551    #[allow(irrefutable_let_patterns)]
19552    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
19553        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
19554            Some((dst_parent_token, dst, responder))
19555        } else {
19556            None
19557        }
19558    }
19559
19560    #[allow(irrefutable_let_patterns)]
19561    pub fn into_clone(
19562        self,
19563    ) -> Option<(
19564        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19565        SymlinkControlHandle,
19566    )> {
19567        if let SymlinkRequest::Clone { request, control_handle } = self {
19568            Some((request, control_handle))
19569        } else {
19570            None
19571        }
19572    }
19573
19574    #[allow(irrefutable_let_patterns)]
19575    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
19576        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
19577    }
19578
19579    #[allow(irrefutable_let_patterns)]
19580    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
19581        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
19582    }
19583
19584    #[allow(irrefutable_let_patterns)]
19585    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
19586        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
19587            Some((responder))
19588        } else {
19589            None
19590        }
19591    }
19592
19593    #[allow(irrefutable_let_patterns)]
19594    pub fn into_deprecated_set_attr(
19595        self,
19596    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
19597        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
19598            Some((flags, attributes, responder))
19599        } else {
19600            None
19601        }
19602    }
19603
19604    #[allow(irrefutable_let_patterns)]
19605    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
19606        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
19607            Some((responder))
19608        } else {
19609            None
19610        }
19611    }
19612
19613    #[allow(irrefutable_let_patterns)]
19614    pub fn into_deprecated_set_flags(
19615        self,
19616    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
19617        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
19618            Some((flags, responder))
19619        } else {
19620            None
19621        }
19622    }
19623
19624    #[allow(irrefutable_let_patterns)]
19625    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
19626        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
19627    }
19628
19629    #[allow(irrefutable_let_patterns)]
19630    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
19631        if let SymlinkRequest::SetFlags { flags, responder } = self {
19632            Some((flags, responder))
19633        } else {
19634            None
19635        }
19636    }
19637
19638    #[allow(irrefutable_let_patterns)]
19639    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
19640        if let SymlinkRequest::QueryFilesystem { responder } = self {
19641            Some((responder))
19642        } else {
19643            None
19644        }
19645    }
19646
19647    #[allow(irrefutable_let_patterns)]
19648    pub fn into_get_token(self) -> Option<(SymlinkGetTokenResponder)> {
19649        if let SymlinkRequest::GetToken { responder } = self { Some((responder)) } else { None }
19650    }
19651
19652    #[allow(irrefutable_let_patterns)]
19653    pub fn into_get_attributes(
19654        self,
19655    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
19656        if let SymlinkRequest::GetAttributes { query, responder } = self {
19657            Some((query, responder))
19658        } else {
19659            None
19660        }
19661    }
19662
19663    #[allow(irrefutable_let_patterns)]
19664    pub fn into_update_attributes(
19665        self,
19666    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
19667        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
19668            Some((payload, responder))
19669        } else {
19670            None
19671        }
19672    }
19673
19674    #[allow(irrefutable_let_patterns)]
19675    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
19676        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
19677    }
19678
19679    #[allow(irrefutable_let_patterns)]
19680    pub fn into_list_extended_attributes(
19681        self,
19682    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
19683    {
19684        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
19685            Some((iterator, control_handle))
19686        } else {
19687            None
19688        }
19689    }
19690
19691    #[allow(irrefutable_let_patterns)]
19692    pub fn into_get_extended_attribute(
19693        self,
19694    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
19695        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
19696            Some((name, responder))
19697        } else {
19698            None
19699        }
19700    }
19701
19702    #[allow(irrefutable_let_patterns)]
19703    pub fn into_set_extended_attribute(
19704        self,
19705    ) -> Option<(
19706        Vec<u8>,
19707        ExtendedAttributeValue,
19708        SetExtendedAttributeMode,
19709        SymlinkSetExtendedAttributeResponder,
19710    )> {
19711        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
19712            Some((name, value, mode, responder))
19713        } else {
19714            None
19715        }
19716    }
19717
19718    #[allow(irrefutable_let_patterns)]
19719    pub fn into_remove_extended_attribute(
19720        self,
19721    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
19722        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
19723            Some((name, responder))
19724        } else {
19725            None
19726        }
19727    }
19728
19729    #[allow(irrefutable_let_patterns)]
19730    pub fn into_open(
19731        self,
19732    ) -> Option<(String, Flags, Options, fidl::Channel, SymlinkControlHandle)> {
19733        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
19734            Some((path, flags, options, object, control_handle))
19735        } else {
19736            None
19737        }
19738    }
19739
19740    #[allow(irrefutable_let_patterns)]
19741    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
19742        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
19743    }
19744
19745    /// Name of the method defined in FIDL
19746    pub fn method_name(&self) -> &'static str {
19747        match *self {
19748            SymlinkRequest::LinkInto { .. } => "link_into",
19749            SymlinkRequest::Clone { .. } => "clone",
19750            SymlinkRequest::Close { .. } => "close",
19751            SymlinkRequest::Query { .. } => "query",
19752            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
19753            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
19754            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
19755            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
19756            SymlinkRequest::GetFlags { .. } => "get_flags",
19757            SymlinkRequest::SetFlags { .. } => "set_flags",
19758            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
19759            SymlinkRequest::GetToken { .. } => "get_token",
19760            SymlinkRequest::GetAttributes { .. } => "get_attributes",
19761            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
19762            SymlinkRequest::Sync { .. } => "sync",
19763            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
19764            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
19765            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
19766            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
19767            SymlinkRequest::Open { .. } => "open",
19768            SymlinkRequest::Describe { .. } => "describe",
19769            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
19770                "unknown one-way method"
19771            }
19772            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
19773                "unknown two-way method"
19774            }
19775        }
19776    }
19777}
19778
19779#[derive(Debug, Clone)]
19780pub struct SymlinkControlHandle {
19781    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
19782}
19783
19784impl SymlinkControlHandle {
19785    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
19786        self.inner.shutdown_with_epitaph(status.into())
19787    }
19788}
19789
19790impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
19791    fn shutdown(&self) {
19792        self.inner.shutdown()
19793    }
19794
19795    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
19796        self.inner.shutdown_with_epitaph(status)
19797    }
19798
19799    fn is_closed(&self) -> bool {
19800        self.inner.channel().is_closed()
19801    }
19802    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
19803        self.inner.channel().on_closed()
19804    }
19805
19806    #[cfg(target_os = "fuchsia")]
19807    fn signal_peer(
19808        &self,
19809        clear_mask: zx::Signals,
19810        set_mask: zx::Signals,
19811    ) -> Result<(), zx_status::Status> {
19812        use fidl::Peered;
19813        self.inner.channel().signal_peer(clear_mask, set_mask)
19814    }
19815}
19816
19817impl SymlinkControlHandle {
19818    pub fn send_on_open_(
19819        &self,
19820        mut s: i32,
19821        mut info: Option<NodeInfoDeprecated>,
19822    ) -> Result<(), fidl::Error> {
19823        self.inner.send::<NodeOnOpenRequest>(
19824            (s, info.as_mut()),
19825            0,
19826            0x7fc7bbb1dbfd1972,
19827            fidl::encoding::DynamicFlags::FLEXIBLE,
19828        )
19829    }
19830
19831    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
19832        self.inner.send::<Representation>(
19833            &mut payload,
19834            0,
19835            0x5cb40567d80a510c,
19836            fidl::encoding::DynamicFlags::empty(),
19837        )
19838    }
19839}
19840
19841#[must_use = "FIDL methods require a response to be sent"]
19842#[derive(Debug)]
19843pub struct SymlinkLinkIntoResponder {
19844    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19845    tx_id: u32,
19846}
19847
19848/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19849/// if the responder is dropped without sending a response, so that the client
19850/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19851impl std::ops::Drop for SymlinkLinkIntoResponder {
19852    fn drop(&mut self) {
19853        self.control_handle.shutdown();
19854        // Safety: drops once, never accessed again
19855        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19856    }
19857}
19858
19859impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
19860    type ControlHandle = SymlinkControlHandle;
19861
19862    fn control_handle(&self) -> &SymlinkControlHandle {
19863        &self.control_handle
19864    }
19865
19866    fn drop_without_shutdown(mut self) {
19867        // Safety: drops once, never accessed again due to mem::forget
19868        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19869        // Prevent Drop from running (which would shut down the channel)
19870        std::mem::forget(self);
19871    }
19872}
19873
19874impl SymlinkLinkIntoResponder {
19875    /// Sends a response to the FIDL transaction.
19876    ///
19877    /// Sets the channel to shutdown if an error occurs.
19878    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19879        let _result = self.send_raw(result);
19880        if _result.is_err() {
19881            self.control_handle.shutdown();
19882        }
19883        self.drop_without_shutdown();
19884        _result
19885    }
19886
19887    /// Similar to "send" but does not shutdown the channel if an error occurs.
19888    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19889        let _result = self.send_raw(result);
19890        self.drop_without_shutdown();
19891        _result
19892    }
19893
19894    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19895        self.control_handle
19896            .inner
19897            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19898                result,
19899                self.tx_id,
19900                0x54f3949246a03e74,
19901                fidl::encoding::DynamicFlags::empty(),
19902            )
19903    }
19904}
19905
19906#[must_use = "FIDL methods require a response to be sent"]
19907#[derive(Debug)]
19908pub struct SymlinkCloseResponder {
19909    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19910    tx_id: u32,
19911}
19912
19913/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19914/// if the responder is dropped without sending a response, so that the client
19915/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19916impl std::ops::Drop for SymlinkCloseResponder {
19917    fn drop(&mut self) {
19918        self.control_handle.shutdown();
19919        // Safety: drops once, never accessed again
19920        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19921    }
19922}
19923
19924impl fidl::endpoints::Responder for SymlinkCloseResponder {
19925    type ControlHandle = SymlinkControlHandle;
19926
19927    fn control_handle(&self) -> &SymlinkControlHandle {
19928        &self.control_handle
19929    }
19930
19931    fn drop_without_shutdown(mut self) {
19932        // Safety: drops once, never accessed again due to mem::forget
19933        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19934        // Prevent Drop from running (which would shut down the channel)
19935        std::mem::forget(self);
19936    }
19937}
19938
19939impl SymlinkCloseResponder {
19940    /// Sends a response to the FIDL transaction.
19941    ///
19942    /// Sets the channel to shutdown if an error occurs.
19943    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19944        let _result = self.send_raw(result);
19945        if _result.is_err() {
19946            self.control_handle.shutdown();
19947        }
19948        self.drop_without_shutdown();
19949        _result
19950    }
19951
19952    /// Similar to "send" but does not shutdown the channel if an error occurs.
19953    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19954        let _result = self.send_raw(result);
19955        self.drop_without_shutdown();
19956        _result
19957    }
19958
19959    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19960        self.control_handle
19961            .inner
19962            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19963                result,
19964                self.tx_id,
19965                0x5ac5d459ad7f657e,
19966                fidl::encoding::DynamicFlags::empty(),
19967            )
19968    }
19969}
19970
19971#[must_use = "FIDL methods require a response to be sent"]
19972#[derive(Debug)]
19973pub struct SymlinkQueryResponder {
19974    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19975    tx_id: u32,
19976}
19977
19978/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19979/// if the responder is dropped without sending a response, so that the client
19980/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19981impl std::ops::Drop for SymlinkQueryResponder {
19982    fn drop(&mut self) {
19983        self.control_handle.shutdown();
19984        // Safety: drops once, never accessed again
19985        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19986    }
19987}
19988
19989impl fidl::endpoints::Responder for SymlinkQueryResponder {
19990    type ControlHandle = SymlinkControlHandle;
19991
19992    fn control_handle(&self) -> &SymlinkControlHandle {
19993        &self.control_handle
19994    }
19995
19996    fn drop_without_shutdown(mut self) {
19997        // Safety: drops once, never accessed again due to mem::forget
19998        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19999        // Prevent Drop from running (which would shut down the channel)
20000        std::mem::forget(self);
20001    }
20002}
20003
20004impl SymlinkQueryResponder {
20005    /// Sends a response to the FIDL transaction.
20006    ///
20007    /// Sets the channel to shutdown if an error occurs.
20008    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
20009        let _result = self.send_raw(protocol);
20010        if _result.is_err() {
20011            self.control_handle.shutdown();
20012        }
20013        self.drop_without_shutdown();
20014        _result
20015    }
20016
20017    /// Similar to "send" but does not shutdown the channel if an error occurs.
20018    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
20019        let _result = self.send_raw(protocol);
20020        self.drop_without_shutdown();
20021        _result
20022    }
20023
20024    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
20025        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
20026            (protocol,),
20027            self.tx_id,
20028            0x2658edee9decfc06,
20029            fidl::encoding::DynamicFlags::empty(),
20030        )
20031    }
20032}
20033
20034#[must_use = "FIDL methods require a response to be sent"]
20035#[derive(Debug)]
20036pub struct SymlinkDeprecatedGetAttrResponder {
20037    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20038    tx_id: u32,
20039}
20040
20041/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20042/// if the responder is dropped without sending a response, so that the client
20043/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20044impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
20045    fn drop(&mut self) {
20046        self.control_handle.shutdown();
20047        // Safety: drops once, never accessed again
20048        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20049    }
20050}
20051
20052impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
20053    type ControlHandle = SymlinkControlHandle;
20054
20055    fn control_handle(&self) -> &SymlinkControlHandle {
20056        &self.control_handle
20057    }
20058
20059    fn drop_without_shutdown(mut self) {
20060        // Safety: drops once, never accessed again due to mem::forget
20061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20062        // Prevent Drop from running (which would shut down the channel)
20063        std::mem::forget(self);
20064    }
20065}
20066
20067impl SymlinkDeprecatedGetAttrResponder {
20068    /// Sends a response to the FIDL transaction.
20069    ///
20070    /// Sets the channel to shutdown if an error occurs.
20071    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
20072        let _result = self.send_raw(s, attributes);
20073        if _result.is_err() {
20074            self.control_handle.shutdown();
20075        }
20076        self.drop_without_shutdown();
20077        _result
20078    }
20079
20080    /// Similar to "send" but does not shutdown the channel if an error occurs.
20081    pub fn send_no_shutdown_on_err(
20082        self,
20083        mut s: i32,
20084        mut attributes: &NodeAttributes,
20085    ) -> Result<(), fidl::Error> {
20086        let _result = self.send_raw(s, attributes);
20087        self.drop_without_shutdown();
20088        _result
20089    }
20090
20091    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
20092        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
20093            (s, attributes),
20094            self.tx_id,
20095            0x78985e216314dafd,
20096            fidl::encoding::DynamicFlags::empty(),
20097        )
20098    }
20099}
20100
20101#[must_use = "FIDL methods require a response to be sent"]
20102#[derive(Debug)]
20103pub struct SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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 SymlinkDeprecatedSetAttrResponder {
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) -> Result<(), fidl::Error> {
20139        let _result = self.send_raw(s);
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(self, mut s: i32) -> Result<(), fidl::Error> {
20149        let _result = self.send_raw(s);
20150        self.drop_without_shutdown();
20151        _result
20152    }
20153
20154    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
20155        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
20156            (s,),
20157            self.tx_id,
20158            0x4186c0f40d938f46,
20159            fidl::encoding::DynamicFlags::empty(),
20160        )
20161    }
20162}
20163
20164#[must_use = "FIDL methods require a response to be sent"]
20165#[derive(Debug)]
20166pub struct SymlinkDeprecatedGetFlagsResponder {
20167    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20168    tx_id: u32,
20169}
20170
20171/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20172/// if the responder is dropped without sending a response, so that the client
20173/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20174impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
20175    fn drop(&mut self) {
20176        self.control_handle.shutdown();
20177        // Safety: drops once, never accessed again
20178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20179    }
20180}
20181
20182impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
20183    type ControlHandle = SymlinkControlHandle;
20184
20185    fn control_handle(&self) -> &SymlinkControlHandle {
20186        &self.control_handle
20187    }
20188
20189    fn drop_without_shutdown(mut self) {
20190        // Safety: drops once, never accessed again due to mem::forget
20191        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20192        // Prevent Drop from running (which would shut down the channel)
20193        std::mem::forget(self);
20194    }
20195}
20196
20197impl SymlinkDeprecatedGetFlagsResponder {
20198    /// Sends a response to the FIDL transaction.
20199    ///
20200    /// Sets the channel to shutdown if an error occurs.
20201    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
20202        let _result = self.send_raw(s, flags);
20203        if _result.is_err() {
20204            self.control_handle.shutdown();
20205        }
20206        self.drop_without_shutdown();
20207        _result
20208    }
20209
20210    /// Similar to "send" but does not shutdown the channel if an error occurs.
20211    pub fn send_no_shutdown_on_err(
20212        self,
20213        mut s: i32,
20214        mut flags: OpenFlags,
20215    ) -> Result<(), fidl::Error> {
20216        let _result = self.send_raw(s, flags);
20217        self.drop_without_shutdown();
20218        _result
20219    }
20220
20221    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
20222        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
20223            (s, flags),
20224            self.tx_id,
20225            0x5b88fffb8eda3aa1,
20226            fidl::encoding::DynamicFlags::empty(),
20227        )
20228    }
20229}
20230
20231#[must_use = "FIDL methods require a response to be sent"]
20232#[derive(Debug)]
20233pub struct SymlinkDeprecatedSetFlagsResponder {
20234    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20235    tx_id: u32,
20236}
20237
20238/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20239/// if the responder is dropped without sending a response, so that the client
20240/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20241impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
20242    fn drop(&mut self) {
20243        self.control_handle.shutdown();
20244        // Safety: drops once, never accessed again
20245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20246    }
20247}
20248
20249impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
20250    type ControlHandle = SymlinkControlHandle;
20251
20252    fn control_handle(&self) -> &SymlinkControlHandle {
20253        &self.control_handle
20254    }
20255
20256    fn drop_without_shutdown(mut self) {
20257        // Safety: drops once, never accessed again due to mem::forget
20258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20259        // Prevent Drop from running (which would shut down the channel)
20260        std::mem::forget(self);
20261    }
20262}
20263
20264impl SymlinkDeprecatedSetFlagsResponder {
20265    /// Sends a response to the FIDL transaction.
20266    ///
20267    /// Sets the channel to shutdown if an error occurs.
20268    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
20269        let _result = self.send_raw(s);
20270        if _result.is_err() {
20271            self.control_handle.shutdown();
20272        }
20273        self.drop_without_shutdown();
20274        _result
20275    }
20276
20277    /// Similar to "send" but does not shutdown the channel if an error occurs.
20278    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
20279        let _result = self.send_raw(s);
20280        self.drop_without_shutdown();
20281        _result
20282    }
20283
20284    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
20285        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
20286            (s,),
20287            self.tx_id,
20288            0x5295b76c71fde733,
20289            fidl::encoding::DynamicFlags::empty(),
20290        )
20291    }
20292}
20293
20294#[must_use = "FIDL methods require a response to be sent"]
20295#[derive(Debug)]
20296pub struct SymlinkGetFlagsResponder {
20297    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20298    tx_id: u32,
20299}
20300
20301/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20302/// if the responder is dropped without sending a response, so that the client
20303/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20304impl std::ops::Drop for SymlinkGetFlagsResponder {
20305    fn drop(&mut self) {
20306        self.control_handle.shutdown();
20307        // Safety: drops once, never accessed again
20308        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20309    }
20310}
20311
20312impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
20313    type ControlHandle = SymlinkControlHandle;
20314
20315    fn control_handle(&self) -> &SymlinkControlHandle {
20316        &self.control_handle
20317    }
20318
20319    fn drop_without_shutdown(mut self) {
20320        // Safety: drops once, never accessed again due to mem::forget
20321        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20322        // Prevent Drop from running (which would shut down the channel)
20323        std::mem::forget(self);
20324    }
20325}
20326
20327impl SymlinkGetFlagsResponder {
20328    /// Sends a response to the FIDL transaction.
20329    ///
20330    /// Sets the channel to shutdown if an error occurs.
20331    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
20332        let _result = self.send_raw(result);
20333        if _result.is_err() {
20334            self.control_handle.shutdown();
20335        }
20336        self.drop_without_shutdown();
20337        _result
20338    }
20339
20340    /// Similar to "send" but does not shutdown the channel if an error occurs.
20341    pub fn send_no_shutdown_on_err(
20342        self,
20343        mut result: Result<Flags, i32>,
20344    ) -> Result<(), fidl::Error> {
20345        let _result = self.send_raw(result);
20346        self.drop_without_shutdown();
20347        _result
20348    }
20349
20350    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
20351        self.control_handle
20352            .inner
20353            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
20354                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
20355                self.tx_id,
20356                0x176eb318f64ec23,
20357                fidl::encoding::DynamicFlags::FLEXIBLE,
20358            )
20359    }
20360}
20361
20362#[must_use = "FIDL methods require a response to be sent"]
20363#[derive(Debug)]
20364pub struct SymlinkSetFlagsResponder {
20365    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20366    tx_id: u32,
20367}
20368
20369/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20370/// if the responder is dropped without sending a response, so that the client
20371/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20372impl std::ops::Drop for SymlinkSetFlagsResponder {
20373    fn drop(&mut self) {
20374        self.control_handle.shutdown();
20375        // Safety: drops once, never accessed again
20376        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20377    }
20378}
20379
20380impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
20381    type ControlHandle = SymlinkControlHandle;
20382
20383    fn control_handle(&self) -> &SymlinkControlHandle {
20384        &self.control_handle
20385    }
20386
20387    fn drop_without_shutdown(mut self) {
20388        // Safety: drops once, never accessed again due to mem::forget
20389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20390        // Prevent Drop from running (which would shut down the channel)
20391        std::mem::forget(self);
20392    }
20393}
20394
20395impl SymlinkSetFlagsResponder {
20396    /// Sends a response to the FIDL transaction.
20397    ///
20398    /// Sets the channel to shutdown if an error occurs.
20399    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20400        let _result = self.send_raw(result);
20401        if _result.is_err() {
20402            self.control_handle.shutdown();
20403        }
20404        self.drop_without_shutdown();
20405        _result
20406    }
20407
20408    /// Similar to "send" but does not shutdown the channel if an error occurs.
20409    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20410        let _result = self.send_raw(result);
20411        self.drop_without_shutdown();
20412        _result
20413    }
20414
20415    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20416        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
20417            fidl::encoding::EmptyStruct,
20418            i32,
20419        >>(
20420            fidl::encoding::FlexibleResult::new(result),
20421            self.tx_id,
20422            0x55a8028685791ea8,
20423            fidl::encoding::DynamicFlags::FLEXIBLE,
20424        )
20425    }
20426}
20427
20428#[must_use = "FIDL methods require a response to be sent"]
20429#[derive(Debug)]
20430pub struct SymlinkQueryFilesystemResponder {
20431    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20432    tx_id: u32,
20433}
20434
20435/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20436/// if the responder is dropped without sending a response, so that the client
20437/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20438impl std::ops::Drop for SymlinkQueryFilesystemResponder {
20439    fn drop(&mut self) {
20440        self.control_handle.shutdown();
20441        // Safety: drops once, never accessed again
20442        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20443    }
20444}
20445
20446impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
20447    type ControlHandle = SymlinkControlHandle;
20448
20449    fn control_handle(&self) -> &SymlinkControlHandle {
20450        &self.control_handle
20451    }
20452
20453    fn drop_without_shutdown(mut self) {
20454        // Safety: drops once, never accessed again due to mem::forget
20455        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20456        // Prevent Drop from running (which would shut down the channel)
20457        std::mem::forget(self);
20458    }
20459}
20460
20461impl SymlinkQueryFilesystemResponder {
20462    /// Sends a response to the FIDL transaction.
20463    ///
20464    /// Sets the channel to shutdown if an error occurs.
20465    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20466        let _result = self.send_raw(s, info);
20467        if _result.is_err() {
20468            self.control_handle.shutdown();
20469        }
20470        self.drop_without_shutdown();
20471        _result
20472    }
20473
20474    /// Similar to "send" but does not shutdown the channel if an error occurs.
20475    pub fn send_no_shutdown_on_err(
20476        self,
20477        mut s: i32,
20478        mut info: Option<&FilesystemInfo>,
20479    ) -> Result<(), fidl::Error> {
20480        let _result = self.send_raw(s, info);
20481        self.drop_without_shutdown();
20482        _result
20483    }
20484
20485    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20486        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
20487            (s, info),
20488            self.tx_id,
20489            0x6f344a1c6b0a0610,
20490            fidl::encoding::DynamicFlags::empty(),
20491        )
20492    }
20493}
20494
20495#[must_use = "FIDL methods require a response to be sent"]
20496#[derive(Debug)]
20497pub struct SymlinkGetTokenResponder {
20498    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20499    tx_id: u32,
20500}
20501
20502/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20503/// if the responder is dropped without sending a response, so that the client
20504/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20505impl std::ops::Drop for SymlinkGetTokenResponder {
20506    fn drop(&mut self) {
20507        self.control_handle.shutdown();
20508        // Safety: drops once, never accessed again
20509        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20510    }
20511}
20512
20513impl fidl::endpoints::Responder for SymlinkGetTokenResponder {
20514    type ControlHandle = SymlinkControlHandle;
20515
20516    fn control_handle(&self) -> &SymlinkControlHandle {
20517        &self.control_handle
20518    }
20519
20520    fn drop_without_shutdown(mut self) {
20521        // Safety: drops once, never accessed again due to mem::forget
20522        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20523        // Prevent Drop from running (which would shut down the channel)
20524        std::mem::forget(self);
20525    }
20526}
20527
20528impl SymlinkGetTokenResponder {
20529    /// Sends a response to the FIDL transaction.
20530    ///
20531    /// Sets the channel to shutdown if an error occurs.
20532    pub fn send(self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
20533        let _result = self.send_raw(result);
20534        if _result.is_err() {
20535            self.control_handle.shutdown();
20536        }
20537        self.drop_without_shutdown();
20538        _result
20539    }
20540
20541    /// Similar to "send" but does not shutdown the channel if an error occurs.
20542    pub fn send_no_shutdown_on_err(
20543        self,
20544        mut result: Result<fidl::Event, i32>,
20545    ) -> Result<(), fidl::Error> {
20546        let _result = self.send_raw(result);
20547        self.drop_without_shutdown();
20548        _result
20549    }
20550
20551    fn send_raw(&self, mut result: Result<fidl::Event, i32>) -> Result<(), fidl::Error> {
20552        self.control_handle
20553            .inner
20554            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
20555                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
20556                self.tx_id,
20557                0x5054f0ade7076cec,
20558                fidl::encoding::DynamicFlags::FLEXIBLE,
20559            )
20560    }
20561}
20562
20563#[must_use = "FIDL methods require a response to be sent"]
20564#[derive(Debug)]
20565pub struct SymlinkGetAttributesResponder {
20566    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20567    tx_id: u32,
20568}
20569
20570/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20571/// if the responder is dropped without sending a response, so that the client
20572/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20573impl std::ops::Drop for SymlinkGetAttributesResponder {
20574    fn drop(&mut self) {
20575        self.control_handle.shutdown();
20576        // Safety: drops once, never accessed again
20577        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20578    }
20579}
20580
20581impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
20582    type ControlHandle = SymlinkControlHandle;
20583
20584    fn control_handle(&self) -> &SymlinkControlHandle {
20585        &self.control_handle
20586    }
20587
20588    fn drop_without_shutdown(mut self) {
20589        // Safety: drops once, never accessed again due to mem::forget
20590        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20591        // Prevent Drop from running (which would shut down the channel)
20592        std::mem::forget(self);
20593    }
20594}
20595
20596impl SymlinkGetAttributesResponder {
20597    /// Sends a response to the FIDL transaction.
20598    ///
20599    /// Sets the channel to shutdown if an error occurs.
20600    pub fn send(
20601        self,
20602        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20603    ) -> Result<(), fidl::Error> {
20604        let _result = self.send_raw(result);
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(
20614        self,
20615        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20616    ) -> Result<(), fidl::Error> {
20617        let _result = self.send_raw(result);
20618        self.drop_without_shutdown();
20619        _result
20620    }
20621
20622    fn send_raw(
20623        &self,
20624        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20625    ) -> Result<(), fidl::Error> {
20626        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
20627            result,
20628            self.tx_id,
20629            0x3d4396a638ea053b,
20630            fidl::encoding::DynamicFlags::empty(),
20631        )
20632    }
20633}
20634
20635#[must_use = "FIDL methods require a response to be sent"]
20636#[derive(Debug)]
20637pub struct SymlinkUpdateAttributesResponder {
20638    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20639    tx_id: u32,
20640}
20641
20642/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20643/// if the responder is dropped without sending a response, so that the client
20644/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20645impl std::ops::Drop for SymlinkUpdateAttributesResponder {
20646    fn drop(&mut self) {
20647        self.control_handle.shutdown();
20648        // Safety: drops once, never accessed again
20649        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20650    }
20651}
20652
20653impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
20654    type ControlHandle = SymlinkControlHandle;
20655
20656    fn control_handle(&self) -> &SymlinkControlHandle {
20657        &self.control_handle
20658    }
20659
20660    fn drop_without_shutdown(mut self) {
20661        // Safety: drops once, never accessed again due to mem::forget
20662        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20663        // Prevent Drop from running (which would shut down the channel)
20664        std::mem::forget(self);
20665    }
20666}
20667
20668impl SymlinkUpdateAttributesResponder {
20669    /// Sends a response to the FIDL transaction.
20670    ///
20671    /// Sets the channel to shutdown if an error occurs.
20672    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20673        let _result = self.send_raw(result);
20674        if _result.is_err() {
20675            self.control_handle.shutdown();
20676        }
20677        self.drop_without_shutdown();
20678        _result
20679    }
20680
20681    /// Similar to "send" but does not shutdown the channel if an error occurs.
20682    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20683        let _result = self.send_raw(result);
20684        self.drop_without_shutdown();
20685        _result
20686    }
20687
20688    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20689        self.control_handle
20690            .inner
20691            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20692                result,
20693                self.tx_id,
20694                0x3308c1da5a89bf08,
20695                fidl::encoding::DynamicFlags::empty(),
20696            )
20697    }
20698}
20699
20700#[must_use = "FIDL methods require a response to be sent"]
20701#[derive(Debug)]
20702pub struct SymlinkSyncResponder {
20703    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20704    tx_id: u32,
20705}
20706
20707/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20708/// if the responder is dropped without sending a response, so that the client
20709/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20710impl std::ops::Drop for SymlinkSyncResponder {
20711    fn drop(&mut self) {
20712        self.control_handle.shutdown();
20713        // Safety: drops once, never accessed again
20714        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20715    }
20716}
20717
20718impl fidl::endpoints::Responder for SymlinkSyncResponder {
20719    type ControlHandle = SymlinkControlHandle;
20720
20721    fn control_handle(&self) -> &SymlinkControlHandle {
20722        &self.control_handle
20723    }
20724
20725    fn drop_without_shutdown(mut self) {
20726        // Safety: drops once, never accessed again due to mem::forget
20727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20728        // Prevent Drop from running (which would shut down the channel)
20729        std::mem::forget(self);
20730    }
20731}
20732
20733impl SymlinkSyncResponder {
20734    /// Sends a response to the FIDL transaction.
20735    ///
20736    /// Sets the channel to shutdown if an error occurs.
20737    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20738        let _result = self.send_raw(result);
20739        if _result.is_err() {
20740            self.control_handle.shutdown();
20741        }
20742        self.drop_without_shutdown();
20743        _result
20744    }
20745
20746    /// Similar to "send" but does not shutdown the channel if an error occurs.
20747    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20748        let _result = self.send_raw(result);
20749        self.drop_without_shutdown();
20750        _result
20751    }
20752
20753    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20754        self.control_handle
20755            .inner
20756            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20757                result,
20758                self.tx_id,
20759                0x2c5c27ca0ab5dc49,
20760                fidl::encoding::DynamicFlags::empty(),
20761            )
20762    }
20763}
20764
20765#[must_use = "FIDL methods require a response to be sent"]
20766#[derive(Debug)]
20767pub struct SymlinkGetExtendedAttributeResponder {
20768    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20769    tx_id: u32,
20770}
20771
20772/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20773/// if the responder is dropped without sending a response, so that the client
20774/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20775impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
20776    fn drop(&mut self) {
20777        self.control_handle.shutdown();
20778        // Safety: drops once, never accessed again
20779        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20780    }
20781}
20782
20783impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
20784    type ControlHandle = SymlinkControlHandle;
20785
20786    fn control_handle(&self) -> &SymlinkControlHandle {
20787        &self.control_handle
20788    }
20789
20790    fn drop_without_shutdown(mut self) {
20791        // Safety: drops once, never accessed again due to mem::forget
20792        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20793        // Prevent Drop from running (which would shut down the channel)
20794        std::mem::forget(self);
20795    }
20796}
20797
20798impl SymlinkGetExtendedAttributeResponder {
20799    /// Sends a response to the FIDL transaction.
20800    ///
20801    /// Sets the channel to shutdown if an error occurs.
20802    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20803        let _result = self.send_raw(result);
20804        if _result.is_err() {
20805            self.control_handle.shutdown();
20806        }
20807        self.drop_without_shutdown();
20808        _result
20809    }
20810
20811    /// Similar to "send" but does not shutdown the channel if an error occurs.
20812    pub fn send_no_shutdown_on_err(
20813        self,
20814        mut result: Result<ExtendedAttributeValue, i32>,
20815    ) -> Result<(), fidl::Error> {
20816        let _result = self.send_raw(result);
20817        self.drop_without_shutdown();
20818        _result
20819    }
20820
20821    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20822        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
20823            result.as_mut().map_err(|e| *e),
20824            self.tx_id,
20825            0x45ffa3ccfdeb76db,
20826            fidl::encoding::DynamicFlags::empty(),
20827        )
20828    }
20829}
20830
20831#[must_use = "FIDL methods require a response to be sent"]
20832#[derive(Debug)]
20833pub struct SymlinkSetExtendedAttributeResponder {
20834    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20835    tx_id: u32,
20836}
20837
20838/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20839/// if the responder is dropped without sending a response, so that the client
20840/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20841impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
20842    fn drop(&mut self) {
20843        self.control_handle.shutdown();
20844        // Safety: drops once, never accessed again
20845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20846    }
20847}
20848
20849impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
20850    type ControlHandle = SymlinkControlHandle;
20851
20852    fn control_handle(&self) -> &SymlinkControlHandle {
20853        &self.control_handle
20854    }
20855
20856    fn drop_without_shutdown(mut self) {
20857        // Safety: drops once, never accessed again due to mem::forget
20858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20859        // Prevent Drop from running (which would shut down the channel)
20860        std::mem::forget(self);
20861    }
20862}
20863
20864impl SymlinkSetExtendedAttributeResponder {
20865    /// Sends a response to the FIDL transaction.
20866    ///
20867    /// Sets the channel to shutdown if an error occurs.
20868    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20869        let _result = self.send_raw(result);
20870        if _result.is_err() {
20871            self.control_handle.shutdown();
20872        }
20873        self.drop_without_shutdown();
20874        _result
20875    }
20876
20877    /// Similar to "send" but does not shutdown the channel if an error occurs.
20878    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20879        let _result = self.send_raw(result);
20880        self.drop_without_shutdown();
20881        _result
20882    }
20883
20884    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20885        self.control_handle
20886            .inner
20887            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20888                result,
20889                self.tx_id,
20890                0x4a951362f681f23c,
20891                fidl::encoding::DynamicFlags::empty(),
20892            )
20893    }
20894}
20895
20896#[must_use = "FIDL methods require a response to be sent"]
20897#[derive(Debug)]
20898pub struct SymlinkRemoveExtendedAttributeResponder {
20899    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20900    tx_id: u32,
20901}
20902
20903/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20904/// if the responder is dropped without sending a response, so that the client
20905/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20906impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
20907    fn drop(&mut self) {
20908        self.control_handle.shutdown();
20909        // Safety: drops once, never accessed again
20910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20911    }
20912}
20913
20914impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
20915    type ControlHandle = SymlinkControlHandle;
20916
20917    fn control_handle(&self) -> &SymlinkControlHandle {
20918        &self.control_handle
20919    }
20920
20921    fn drop_without_shutdown(mut self) {
20922        // Safety: drops once, never accessed again due to mem::forget
20923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20924        // Prevent Drop from running (which would shut down the channel)
20925        std::mem::forget(self);
20926    }
20927}
20928
20929impl SymlinkRemoveExtendedAttributeResponder {
20930    /// Sends a response to the FIDL transaction.
20931    ///
20932    /// Sets the channel to shutdown if an error occurs.
20933    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20934        let _result = self.send_raw(result);
20935        if _result.is_err() {
20936            self.control_handle.shutdown();
20937        }
20938        self.drop_without_shutdown();
20939        _result
20940    }
20941
20942    /// Similar to "send" but does not shutdown the channel if an error occurs.
20943    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20944        let _result = self.send_raw(result);
20945        self.drop_without_shutdown();
20946        _result
20947    }
20948
20949    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20950        self.control_handle
20951            .inner
20952            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20953                result,
20954                self.tx_id,
20955                0x7a0b9f3a9bf9032d,
20956                fidl::encoding::DynamicFlags::empty(),
20957            )
20958    }
20959}
20960
20961#[must_use = "FIDL methods require a response to be sent"]
20962#[derive(Debug)]
20963pub struct SymlinkDescribeResponder {
20964    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20965    tx_id: u32,
20966}
20967
20968/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20969/// if the responder is dropped without sending a response, so that the client
20970/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20971impl std::ops::Drop for SymlinkDescribeResponder {
20972    fn drop(&mut self) {
20973        self.control_handle.shutdown();
20974        // Safety: drops once, never accessed again
20975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20976    }
20977}
20978
20979impl fidl::endpoints::Responder for SymlinkDescribeResponder {
20980    type ControlHandle = SymlinkControlHandle;
20981
20982    fn control_handle(&self) -> &SymlinkControlHandle {
20983        &self.control_handle
20984    }
20985
20986    fn drop_without_shutdown(mut self) {
20987        // Safety: drops once, never accessed again due to mem::forget
20988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20989        // Prevent Drop from running (which would shut down the channel)
20990        std::mem::forget(self);
20991    }
20992}
20993
20994impl SymlinkDescribeResponder {
20995    /// Sends a response to the FIDL transaction.
20996    ///
20997    /// Sets the channel to shutdown if an error occurs.
20998    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20999        let _result = self.send_raw(payload);
21000        if _result.is_err() {
21001            self.control_handle.shutdown();
21002        }
21003        self.drop_without_shutdown();
21004        _result
21005    }
21006
21007    /// Similar to "send" but does not shutdown the channel if an error occurs.
21008    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
21009        let _result = self.send_raw(payload);
21010        self.drop_without_shutdown();
21011        _result
21012    }
21013
21014    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
21015        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
21016            fidl::encoding::Flexible::new(payload),
21017            self.tx_id,
21018            0x742c2ea5e89831f3,
21019            fidl::encoding::DynamicFlags::FLEXIBLE,
21020        )
21021    }
21022}
21023
21024#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
21025pub struct WritableMarker;
21026
21027impl fidl::endpoints::ProtocolMarker for WritableMarker {
21028    type Proxy = WritableProxy;
21029    type RequestStream = WritableRequestStream;
21030    #[cfg(target_os = "fuchsia")]
21031    type SynchronousProxy = WritableSynchronousProxy;
21032
21033    const DEBUG_NAME: &'static str = "(anonymous) Writable";
21034}
21035pub type WritableWriteResult = Result<u64, i32>;
21036
21037pub trait WritableProxyInterface: Send + Sync {
21038    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
21039        + Send;
21040    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
21041}
21042#[derive(Debug)]
21043#[cfg(target_os = "fuchsia")]
21044pub struct WritableSynchronousProxy {
21045    client: fidl::client::sync::Client,
21046}
21047
21048#[cfg(target_os = "fuchsia")]
21049impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
21050    type Proxy = WritableProxy;
21051    type Protocol = WritableMarker;
21052
21053    fn from_channel(inner: fidl::Channel) -> Self {
21054        Self::new(inner)
21055    }
21056
21057    fn into_channel(self) -> fidl::Channel {
21058        self.client.into_channel()
21059    }
21060
21061    fn as_channel(&self) -> &fidl::Channel {
21062        self.client.as_channel()
21063    }
21064}
21065
21066#[cfg(target_os = "fuchsia")]
21067impl WritableSynchronousProxy {
21068    pub fn new(channel: fidl::Channel) -> Self {
21069        Self { client: fidl::client::sync::Client::new(channel) }
21070    }
21071
21072    pub fn into_channel(self) -> fidl::Channel {
21073        self.client.into_channel()
21074    }
21075
21076    /// Waits until an event arrives and returns it. It is safe for other
21077    /// threads to make concurrent requests while waiting for an event.
21078    pub fn wait_for_event(
21079        &self,
21080        deadline: zx::MonotonicInstant,
21081    ) -> Result<WritableEvent, fidl::Error> {
21082        WritableEvent::decode(self.client.wait_for_event::<WritableMarker>(deadline)?)
21083    }
21084
21085    /// Writes data at the seek offset.
21086    /// The seek offset is moved forward by the number of bytes written.
21087    /// If the file is in append mode, the seek offset is first set to the end
21088    /// of the file, followed by the write, in one atomic step.
21089    ///
21090    /// The file size may grow if the seek offset plus `data.length` is beyond
21091    /// the current end of file.
21092    ///
21093    /// + request `data` the byte buffer to write to the file.
21094    /// - response `actual_count` the number of bytes written.
21095    ///
21096    /// ## Invariants
21097    ///
21098    /// * The returned `actual_count` will never be greater than `data.length`.
21099    /// * If the server is unable to write all the data due to e.g. not enough
21100    ///   space, `actual_count` may be less than `data.length`.  If no bytes
21101    ///   could be written, an error is returned.
21102    /// * If `data.length` is zero, the server should perform all the checks
21103    ///   ensuring write access without mutating the file and return a
21104    ///   successful write of zero bytes.  The seek offset is still updated if
21105    ///   in append mode.
21106    ///
21107    /// This method requires the [`Rights.WRITE_BYTES`] right.
21108    pub fn r#write(
21109        &self,
21110        mut data: &[u8],
21111        ___deadline: zx::MonotonicInstant,
21112    ) -> Result<WritableWriteResult, fidl::Error> {
21113        let _response = self.client.send_query::<
21114            WritableWriteRequest,
21115            fidl::encoding::ResultType<WritableWriteResponse, i32>,
21116            WritableMarker,
21117        >(
21118            (data,),
21119            0x6a31437832469f82,
21120            fidl::encoding::DynamicFlags::empty(),
21121            ___deadline,
21122        )?;
21123        Ok(_response.map(|x| x.actual_count))
21124    }
21125}
21126
21127#[cfg(target_os = "fuchsia")]
21128impl From<WritableSynchronousProxy> for zx::NullableHandle {
21129    fn from(value: WritableSynchronousProxy) -> Self {
21130        value.into_channel().into()
21131    }
21132}
21133
21134#[cfg(target_os = "fuchsia")]
21135impl From<fidl::Channel> for WritableSynchronousProxy {
21136    fn from(value: fidl::Channel) -> Self {
21137        Self::new(value)
21138    }
21139}
21140
21141#[cfg(target_os = "fuchsia")]
21142impl fidl::endpoints::FromClient for WritableSynchronousProxy {
21143    type Protocol = WritableMarker;
21144
21145    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
21146        Self::new(value.into_channel())
21147    }
21148}
21149
21150#[derive(Debug, Clone)]
21151pub struct WritableProxy {
21152    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
21153}
21154
21155impl fidl::endpoints::Proxy for WritableProxy {
21156    type Protocol = WritableMarker;
21157
21158    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
21159        Self::new(inner)
21160    }
21161
21162    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
21163        self.client.into_channel().map_err(|client| Self { client })
21164    }
21165
21166    fn as_channel(&self) -> &::fidl::AsyncChannel {
21167        self.client.as_channel()
21168    }
21169}
21170
21171impl WritableProxy {
21172    /// Create a new Proxy for fuchsia.io/Writable.
21173    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
21174        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
21175        Self { client: fidl::client::Client::new(channel, protocol_name) }
21176    }
21177
21178    /// Get a Stream of events from the remote end of the protocol.
21179    ///
21180    /// # Panics
21181    ///
21182    /// Panics if the event stream was already taken.
21183    pub fn take_event_stream(&self) -> WritableEventStream {
21184        WritableEventStream { event_receiver: self.client.take_event_receiver() }
21185    }
21186
21187    /// Writes data at the seek offset.
21188    /// The seek offset is moved forward by the number of bytes written.
21189    /// If the file is in append mode, the seek offset is first set to the end
21190    /// of the file, followed by the write, in one atomic step.
21191    ///
21192    /// The file size may grow if the seek offset plus `data.length` is beyond
21193    /// the current end of file.
21194    ///
21195    /// + request `data` the byte buffer to write to the file.
21196    /// - response `actual_count` the number of bytes written.
21197    ///
21198    /// ## Invariants
21199    ///
21200    /// * The returned `actual_count` will never be greater than `data.length`.
21201    /// * If the server is unable to write all the data due to e.g. not enough
21202    ///   space, `actual_count` may be less than `data.length`.  If no bytes
21203    ///   could be written, an error is returned.
21204    /// * If `data.length` is zero, the server should perform all the checks
21205    ///   ensuring write access without mutating the file and return a
21206    ///   successful write of zero bytes.  The seek offset is still updated if
21207    ///   in append mode.
21208    ///
21209    /// This method requires the [`Rights.WRITE_BYTES`] right.
21210    pub fn r#write(
21211        &self,
21212        mut data: &[u8],
21213    ) -> fidl::client::QueryResponseFut<
21214        WritableWriteResult,
21215        fidl::encoding::DefaultFuchsiaResourceDialect,
21216    > {
21217        WritableProxyInterface::r#write(self, data)
21218    }
21219}
21220
21221impl WritableProxyInterface for WritableProxy {
21222    type WriteResponseFut = fidl::client::QueryResponseFut<
21223        WritableWriteResult,
21224        fidl::encoding::DefaultFuchsiaResourceDialect,
21225    >;
21226    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
21227        fn _decode(
21228            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
21229        ) -> Result<WritableWriteResult, fidl::Error> {
21230            let _response = fidl::client::decode_transaction_body::<
21231                fidl::encoding::ResultType<WritableWriteResponse, i32>,
21232                fidl::encoding::DefaultFuchsiaResourceDialect,
21233                0x6a31437832469f82,
21234            >(_buf?)?;
21235            Ok(_response.map(|x| x.actual_count))
21236        }
21237        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
21238            (data,),
21239            0x6a31437832469f82,
21240            fidl::encoding::DynamicFlags::empty(),
21241            _decode,
21242        )
21243    }
21244}
21245
21246pub struct WritableEventStream {
21247    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
21248}
21249
21250impl std::marker::Unpin for WritableEventStream {}
21251
21252impl futures::stream::FusedStream for WritableEventStream {
21253    fn is_terminated(&self) -> bool {
21254        self.event_receiver.is_terminated()
21255    }
21256}
21257
21258impl futures::Stream for WritableEventStream {
21259    type Item = Result<WritableEvent, fidl::Error>;
21260
21261    fn poll_next(
21262        mut self: std::pin::Pin<&mut Self>,
21263        cx: &mut std::task::Context<'_>,
21264    ) -> std::task::Poll<Option<Self::Item>> {
21265        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
21266            &mut self.event_receiver,
21267            cx
21268        )?) {
21269            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
21270            None => std::task::Poll::Ready(None),
21271        }
21272    }
21273}
21274
21275#[derive(Debug)]
21276pub enum WritableEvent {}
21277
21278impl WritableEvent {
21279    /// Decodes a message buffer as a [`WritableEvent`].
21280    fn decode(
21281        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
21282    ) -> Result<WritableEvent, fidl::Error> {
21283        let (bytes, _handles) = buf.split_mut();
21284        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
21285        debug_assert_eq!(tx_header.tx_id, 0);
21286        match tx_header.ordinal {
21287            _ => Err(fidl::Error::UnknownOrdinal {
21288                ordinal: tx_header.ordinal,
21289                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
21290            }),
21291        }
21292    }
21293}
21294
21295/// A Stream of incoming requests for fuchsia.io/Writable.
21296pub struct WritableRequestStream {
21297    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
21298    is_terminated: bool,
21299}
21300
21301impl std::marker::Unpin for WritableRequestStream {}
21302
21303impl futures::stream::FusedStream for WritableRequestStream {
21304    fn is_terminated(&self) -> bool {
21305        self.is_terminated
21306    }
21307}
21308
21309impl fidl::endpoints::RequestStream for WritableRequestStream {
21310    type Protocol = WritableMarker;
21311    type ControlHandle = WritableControlHandle;
21312
21313    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
21314        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
21315    }
21316
21317    fn control_handle(&self) -> Self::ControlHandle {
21318        WritableControlHandle { inner: self.inner.clone() }
21319    }
21320
21321    fn into_inner(
21322        self,
21323    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
21324    {
21325        (self.inner, self.is_terminated)
21326    }
21327
21328    fn from_inner(
21329        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
21330        is_terminated: bool,
21331    ) -> Self {
21332        Self { inner, is_terminated }
21333    }
21334}
21335
21336impl futures::Stream for WritableRequestStream {
21337    type Item = Result<WritableRequest, fidl::Error>;
21338
21339    fn poll_next(
21340        mut self: std::pin::Pin<&mut Self>,
21341        cx: &mut std::task::Context<'_>,
21342    ) -> std::task::Poll<Option<Self::Item>> {
21343        let this = &mut *self;
21344        if this.inner.check_shutdown(cx) {
21345            this.is_terminated = true;
21346            return std::task::Poll::Ready(None);
21347        }
21348        if this.is_terminated {
21349            panic!("polled WritableRequestStream after completion");
21350        }
21351        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
21352            |bytes, handles| {
21353                match this.inner.channel().read_etc(cx, bytes, handles) {
21354                    std::task::Poll::Ready(Ok(())) => {}
21355                    std::task::Poll::Pending => return std::task::Poll::Pending,
21356                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
21357                        this.is_terminated = true;
21358                        return std::task::Poll::Ready(None);
21359                    }
21360                    std::task::Poll::Ready(Err(e)) => {
21361                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
21362                            e.into(),
21363                        ))));
21364                    }
21365                }
21366
21367                // A message has been received from the channel
21368                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
21369
21370                std::task::Poll::Ready(Some(match header.ordinal {
21371                    0x6a31437832469f82 => {
21372                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
21373                        let mut req = fidl::new_empty!(
21374                            WritableWriteRequest,
21375                            fidl::encoding::DefaultFuchsiaResourceDialect
21376                        );
21377                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
21378                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
21379                        Ok(WritableRequest::Write {
21380                            data: req.data,
21381
21382                            responder: WritableWriteResponder {
21383                                control_handle: std::mem::ManuallyDrop::new(control_handle),
21384                                tx_id: header.tx_id,
21385                            },
21386                        })
21387                    }
21388                    _ => Err(fidl::Error::UnknownOrdinal {
21389                        ordinal: header.ordinal,
21390                        protocol_name:
21391                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
21392                    }),
21393                }))
21394            },
21395        )
21396    }
21397}
21398
21399#[derive(Debug)]
21400pub enum WritableRequest {
21401    /// Writes data at the seek offset.
21402    /// The seek offset is moved forward by the number of bytes written.
21403    /// If the file is in append mode, the seek offset is first set to the end
21404    /// of the file, followed by the write, in one atomic step.
21405    ///
21406    /// The file size may grow if the seek offset plus `data.length` is beyond
21407    /// the current end of file.
21408    ///
21409    /// + request `data` the byte buffer to write to the file.
21410    /// - response `actual_count` the number of bytes written.
21411    ///
21412    /// ## Invariants
21413    ///
21414    /// * The returned `actual_count` will never be greater than `data.length`.
21415    /// * If the server is unable to write all the data due to e.g. not enough
21416    ///   space, `actual_count` may be less than `data.length`.  If no bytes
21417    ///   could be written, an error is returned.
21418    /// * If `data.length` is zero, the server should perform all the checks
21419    ///   ensuring write access without mutating the file and return a
21420    ///   successful write of zero bytes.  The seek offset is still updated if
21421    ///   in append mode.
21422    ///
21423    /// This method requires the [`Rights.WRITE_BYTES`] right.
21424    Write { data: Vec<u8>, responder: WritableWriteResponder },
21425}
21426
21427impl WritableRequest {
21428    #[allow(irrefutable_let_patterns)]
21429    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
21430        if let WritableRequest::Write { data, responder } = self {
21431            Some((data, responder))
21432        } else {
21433            None
21434        }
21435    }
21436
21437    /// Name of the method defined in FIDL
21438    pub fn method_name(&self) -> &'static str {
21439        match *self {
21440            WritableRequest::Write { .. } => "write",
21441        }
21442    }
21443}
21444
21445#[derive(Debug, Clone)]
21446pub struct WritableControlHandle {
21447    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
21448}
21449
21450impl WritableControlHandle {
21451    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
21452        self.inner.shutdown_with_epitaph(status.into())
21453    }
21454}
21455
21456impl fidl::endpoints::ControlHandle for WritableControlHandle {
21457    fn shutdown(&self) {
21458        self.inner.shutdown()
21459    }
21460
21461    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
21462        self.inner.shutdown_with_epitaph(status)
21463    }
21464
21465    fn is_closed(&self) -> bool {
21466        self.inner.channel().is_closed()
21467    }
21468    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
21469        self.inner.channel().on_closed()
21470    }
21471
21472    #[cfg(target_os = "fuchsia")]
21473    fn signal_peer(
21474        &self,
21475        clear_mask: zx::Signals,
21476        set_mask: zx::Signals,
21477    ) -> Result<(), zx_status::Status> {
21478        use fidl::Peered;
21479        self.inner.channel().signal_peer(clear_mask, set_mask)
21480    }
21481}
21482
21483impl WritableControlHandle {}
21484
21485#[must_use = "FIDL methods require a response to be sent"]
21486#[derive(Debug)]
21487pub struct WritableWriteResponder {
21488    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
21489    tx_id: u32,
21490}
21491
21492/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
21493/// if the responder is dropped without sending a response, so that the client
21494/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
21495impl std::ops::Drop for WritableWriteResponder {
21496    fn drop(&mut self) {
21497        self.control_handle.shutdown();
21498        // Safety: drops once, never accessed again
21499        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21500    }
21501}
21502
21503impl fidl::endpoints::Responder for WritableWriteResponder {
21504    type ControlHandle = WritableControlHandle;
21505
21506    fn control_handle(&self) -> &WritableControlHandle {
21507        &self.control_handle
21508    }
21509
21510    fn drop_without_shutdown(mut self) {
21511        // Safety: drops once, never accessed again due to mem::forget
21512        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21513        // Prevent Drop from running (which would shut down the channel)
21514        std::mem::forget(self);
21515    }
21516}
21517
21518impl WritableWriteResponder {
21519    /// Sends a response to the FIDL transaction.
21520    ///
21521    /// Sets the channel to shutdown if an error occurs.
21522    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21523        let _result = self.send_raw(result);
21524        if _result.is_err() {
21525            self.control_handle.shutdown();
21526        }
21527        self.drop_without_shutdown();
21528        _result
21529    }
21530
21531    /// Similar to "send" but does not shutdown the channel if an error occurs.
21532    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21533        let _result = self.send_raw(result);
21534        self.drop_without_shutdown();
21535        _result
21536    }
21537
21538    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21539        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
21540            result.map(|actual_count| (actual_count,)),
21541            self.tx_id,
21542            0x6a31437832469f82,
21543            fidl::encoding::DynamicFlags::empty(),
21544        )
21545    }
21546}
21547
21548mod internal {
21549    use super::*;
21550
21551    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
21552        type Borrowed<'a> = &'a mut Self;
21553        fn take_or_borrow<'a>(
21554            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21555        ) -> Self::Borrowed<'a> {
21556            value
21557        }
21558    }
21559
21560    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
21561        type Owned = Self;
21562
21563        #[inline(always)]
21564        fn inline_align(_context: fidl::encoding::Context) -> usize {
21565            8
21566        }
21567
21568        #[inline(always)]
21569        fn inline_size(_context: fidl::encoding::Context) -> usize {
21570            40
21571        }
21572    }
21573
21574    unsafe impl
21575        fidl::encoding::Encode<
21576            DirectoryCreateSymlinkRequest,
21577            fidl::encoding::DefaultFuchsiaResourceDialect,
21578        > for &mut DirectoryCreateSymlinkRequest
21579    {
21580        #[inline]
21581        unsafe fn encode(
21582            self,
21583            encoder: &mut fidl::encoding::Encoder<
21584                '_,
21585                fidl::encoding::DefaultFuchsiaResourceDialect,
21586            >,
21587            offset: usize,
21588            _depth: fidl::encoding::Depth,
21589        ) -> fidl::Result<()> {
21590            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21591            // Delegate to tuple encoding.
21592            fidl::encoding::Encode::<
21593                DirectoryCreateSymlinkRequest,
21594                fidl::encoding::DefaultFuchsiaResourceDialect,
21595            >::encode(
21596                (
21597                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21598                        &self.name,
21599                    ),
21600                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
21601                        &self.target,
21602                    ),
21603                    <fidl::encoding::Optional<
21604                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21605                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21606                        &mut self.connection
21607                    ),
21608                ),
21609                encoder,
21610                offset,
21611                _depth,
21612            )
21613        }
21614    }
21615    unsafe impl<
21616        T0: fidl::encoding::Encode<
21617                fidl::encoding::BoundedString<255>,
21618                fidl::encoding::DefaultFuchsiaResourceDialect,
21619            >,
21620        T1: fidl::encoding::Encode<
21621                fidl::encoding::Vector<u8, 4095>,
21622                fidl::encoding::DefaultFuchsiaResourceDialect,
21623            >,
21624        T2: fidl::encoding::Encode<
21625                fidl::encoding::Optional<
21626                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21627                >,
21628                fidl::encoding::DefaultFuchsiaResourceDialect,
21629            >,
21630    >
21631        fidl::encoding::Encode<
21632            DirectoryCreateSymlinkRequest,
21633            fidl::encoding::DefaultFuchsiaResourceDialect,
21634        > for (T0, T1, T2)
21635    {
21636        #[inline]
21637        unsafe fn encode(
21638            self,
21639            encoder: &mut fidl::encoding::Encoder<
21640                '_,
21641                fidl::encoding::DefaultFuchsiaResourceDialect,
21642            >,
21643            offset: usize,
21644            depth: fidl::encoding::Depth,
21645        ) -> fidl::Result<()> {
21646            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21647            // Zero out padding regions. There's no need to apply masks
21648            // because the unmasked parts will be overwritten by fields.
21649            unsafe {
21650                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
21651                (ptr as *mut u64).write_unaligned(0);
21652            }
21653            // Write the fields.
21654            self.0.encode(encoder, offset + 0, depth)?;
21655            self.1.encode(encoder, offset + 16, depth)?;
21656            self.2.encode(encoder, offset + 32, depth)?;
21657            Ok(())
21658        }
21659    }
21660
21661    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21662        for DirectoryCreateSymlinkRequest
21663    {
21664        #[inline(always)]
21665        fn new_empty() -> Self {
21666            Self {
21667                name: fidl::new_empty!(
21668                    fidl::encoding::BoundedString<255>,
21669                    fidl::encoding::DefaultFuchsiaResourceDialect
21670                ),
21671                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
21672                connection: fidl::new_empty!(
21673                    fidl::encoding::Optional<
21674                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21675                    >,
21676                    fidl::encoding::DefaultFuchsiaResourceDialect
21677                ),
21678            }
21679        }
21680
21681        #[inline]
21682        unsafe fn decode(
21683            &mut self,
21684            decoder: &mut fidl::encoding::Decoder<
21685                '_,
21686                fidl::encoding::DefaultFuchsiaResourceDialect,
21687            >,
21688            offset: usize,
21689            _depth: fidl::encoding::Depth,
21690        ) -> fidl::Result<()> {
21691            decoder.debug_check_bounds::<Self>(offset);
21692            // Verify that padding bytes are zero.
21693            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
21694            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21695            let mask = 0xffffffff00000000u64;
21696            let maskedval = padval & mask;
21697            if maskedval != 0 {
21698                return Err(fidl::Error::NonZeroPadding {
21699                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
21700                });
21701            }
21702            fidl::decode!(
21703                fidl::encoding::BoundedString<255>,
21704                fidl::encoding::DefaultFuchsiaResourceDialect,
21705                &mut self.name,
21706                decoder,
21707                offset + 0,
21708                _depth
21709            )?;
21710            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
21711            fidl::decode!(
21712                fidl::encoding::Optional<
21713                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21714                >,
21715                fidl::encoding::DefaultFuchsiaResourceDialect,
21716                &mut self.connection,
21717                decoder,
21718                offset + 32,
21719                _depth
21720            )?;
21721            Ok(())
21722        }
21723    }
21724
21725    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedGetTokenResponse {
21726        type Borrowed<'a> = &'a mut Self;
21727        fn take_or_borrow<'a>(
21728            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21729        ) -> Self::Borrowed<'a> {
21730            value
21731        }
21732    }
21733
21734    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedGetTokenResponse {
21735        type Owned = Self;
21736
21737        #[inline(always)]
21738        fn inline_align(_context: fidl::encoding::Context) -> usize {
21739            4
21740        }
21741
21742        #[inline(always)]
21743        fn inline_size(_context: fidl::encoding::Context) -> usize {
21744            8
21745        }
21746    }
21747
21748    unsafe impl
21749        fidl::encoding::Encode<
21750            DirectoryDeprecatedGetTokenResponse,
21751            fidl::encoding::DefaultFuchsiaResourceDialect,
21752        > for &mut DirectoryDeprecatedGetTokenResponse
21753    {
21754        #[inline]
21755        unsafe fn encode(
21756            self,
21757            encoder: &mut fidl::encoding::Encoder<
21758                '_,
21759                fidl::encoding::DefaultFuchsiaResourceDialect,
21760            >,
21761            offset: usize,
21762            _depth: fidl::encoding::Depth,
21763        ) -> fidl::Result<()> {
21764            encoder.debug_check_bounds::<DirectoryDeprecatedGetTokenResponse>(offset);
21765            // Delegate to tuple encoding.
21766            fidl::encoding::Encode::<
21767                DirectoryDeprecatedGetTokenResponse,
21768                fidl::encoding::DefaultFuchsiaResourceDialect,
21769            >::encode(
21770                (
21771                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
21772                    <fidl::encoding::Optional<
21773                        fidl::encoding::HandleType<
21774                            fidl::NullableHandle,
21775                            { fidl::ObjectType::NONE.into_raw() },
21776                            2147483648,
21777                        >,
21778                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21779                        &mut self.token
21780                    ),
21781                ),
21782                encoder,
21783                offset,
21784                _depth,
21785            )
21786        }
21787    }
21788    unsafe impl<
21789        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21790        T1: fidl::encoding::Encode<
21791                fidl::encoding::Optional<
21792                    fidl::encoding::HandleType<
21793                        fidl::NullableHandle,
21794                        { fidl::ObjectType::NONE.into_raw() },
21795                        2147483648,
21796                    >,
21797                >,
21798                fidl::encoding::DefaultFuchsiaResourceDialect,
21799            >,
21800    >
21801        fidl::encoding::Encode<
21802            DirectoryDeprecatedGetTokenResponse,
21803            fidl::encoding::DefaultFuchsiaResourceDialect,
21804        > for (T0, T1)
21805    {
21806        #[inline]
21807        unsafe fn encode(
21808            self,
21809            encoder: &mut fidl::encoding::Encoder<
21810                '_,
21811                fidl::encoding::DefaultFuchsiaResourceDialect,
21812            >,
21813            offset: usize,
21814            depth: fidl::encoding::Depth,
21815        ) -> fidl::Result<()> {
21816            encoder.debug_check_bounds::<DirectoryDeprecatedGetTokenResponse>(offset);
21817            // Zero out padding regions. There's no need to apply masks
21818            // because the unmasked parts will be overwritten by fields.
21819            // Write the fields.
21820            self.0.encode(encoder, offset + 0, depth)?;
21821            self.1.encode(encoder, offset + 4, depth)?;
21822            Ok(())
21823        }
21824    }
21825
21826    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21827        for DirectoryDeprecatedGetTokenResponse
21828    {
21829        #[inline(always)]
21830        fn new_empty() -> Self {
21831            Self {
21832                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
21833                token: fidl::new_empty!(
21834                    fidl::encoding::Optional<
21835                        fidl::encoding::HandleType<
21836                            fidl::NullableHandle,
21837                            { fidl::ObjectType::NONE.into_raw() },
21838                            2147483648,
21839                        >,
21840                    >,
21841                    fidl::encoding::DefaultFuchsiaResourceDialect
21842                ),
21843            }
21844        }
21845
21846        #[inline]
21847        unsafe fn decode(
21848            &mut self,
21849            decoder: &mut fidl::encoding::Decoder<
21850                '_,
21851                fidl::encoding::DefaultFuchsiaResourceDialect,
21852            >,
21853            offset: usize,
21854            _depth: fidl::encoding::Depth,
21855        ) -> fidl::Result<()> {
21856            decoder.debug_check_bounds::<Self>(offset);
21857            // Verify that padding bytes are zero.
21858            fidl::decode!(
21859                i32,
21860                fidl::encoding::DefaultFuchsiaResourceDialect,
21861                &mut self.s,
21862                decoder,
21863                offset + 0,
21864                _depth
21865            )?;
21866            fidl::decode!(
21867                fidl::encoding::Optional<
21868                    fidl::encoding::HandleType<
21869                        fidl::NullableHandle,
21870                        { fidl::ObjectType::NONE.into_raw() },
21871                        2147483648,
21872                    >,
21873                >,
21874                fidl::encoding::DefaultFuchsiaResourceDialect,
21875                &mut self.token,
21876                decoder,
21877                offset + 4,
21878                _depth
21879            )?;
21880            Ok(())
21881        }
21882    }
21883
21884    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
21885        type Borrowed<'a> = &'a mut Self;
21886        fn take_or_borrow<'a>(
21887            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21888        ) -> Self::Borrowed<'a> {
21889            value
21890        }
21891    }
21892
21893    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
21894        type Owned = Self;
21895
21896        #[inline(always)]
21897        fn inline_align(_context: fidl::encoding::Context) -> usize {
21898            8
21899        }
21900
21901        #[inline(always)]
21902        fn inline_size(_context: fidl::encoding::Context) -> usize {
21903            32
21904        }
21905    }
21906
21907    unsafe impl
21908        fidl::encoding::Encode<
21909            DirectoryDeprecatedOpenRequest,
21910            fidl::encoding::DefaultFuchsiaResourceDialect,
21911        > for &mut DirectoryDeprecatedOpenRequest
21912    {
21913        #[inline]
21914        unsafe fn encode(
21915            self,
21916            encoder: &mut fidl::encoding::Encoder<
21917                '_,
21918                fidl::encoding::DefaultFuchsiaResourceDialect,
21919            >,
21920            offset: usize,
21921            _depth: fidl::encoding::Depth,
21922        ) -> fidl::Result<()> {
21923            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21924            // Delegate to tuple encoding.
21925            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21926                (
21927                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21928                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21929                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21930                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21931                ),
21932                encoder, offset, _depth
21933            )
21934        }
21935    }
21936    unsafe impl<
21937        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21938        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
21939        T2: fidl::encoding::Encode<
21940                fidl::encoding::BoundedString<4095>,
21941                fidl::encoding::DefaultFuchsiaResourceDialect,
21942            >,
21943        T3: fidl::encoding::Encode<
21944                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21945                fidl::encoding::DefaultFuchsiaResourceDialect,
21946            >,
21947    >
21948        fidl::encoding::Encode<
21949            DirectoryDeprecatedOpenRequest,
21950            fidl::encoding::DefaultFuchsiaResourceDialect,
21951        > for (T0, T1, T2, T3)
21952    {
21953        #[inline]
21954        unsafe fn encode(
21955            self,
21956            encoder: &mut fidl::encoding::Encoder<
21957                '_,
21958                fidl::encoding::DefaultFuchsiaResourceDialect,
21959            >,
21960            offset: usize,
21961            depth: fidl::encoding::Depth,
21962        ) -> fidl::Result<()> {
21963            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21964            // Zero out padding regions. There's no need to apply masks
21965            // because the unmasked parts will be overwritten by fields.
21966            unsafe {
21967                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
21968                (ptr as *mut u64).write_unaligned(0);
21969            }
21970            // Write the fields.
21971            self.0.encode(encoder, offset + 0, depth)?;
21972            self.1.encode(encoder, offset + 4, depth)?;
21973            self.2.encode(encoder, offset + 8, depth)?;
21974            self.3.encode(encoder, offset + 24, depth)?;
21975            Ok(())
21976        }
21977    }
21978
21979    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21980        for DirectoryDeprecatedOpenRequest
21981    {
21982        #[inline(always)]
21983        fn new_empty() -> Self {
21984            Self {
21985                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
21986                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
21987                path: fidl::new_empty!(
21988                    fidl::encoding::BoundedString<4095>,
21989                    fidl::encoding::DefaultFuchsiaResourceDialect
21990                ),
21991                object: fidl::new_empty!(
21992                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21993                    fidl::encoding::DefaultFuchsiaResourceDialect
21994                ),
21995            }
21996        }
21997
21998        #[inline]
21999        unsafe fn decode(
22000            &mut self,
22001            decoder: &mut fidl::encoding::Decoder<
22002                '_,
22003                fidl::encoding::DefaultFuchsiaResourceDialect,
22004            >,
22005            offset: usize,
22006            _depth: fidl::encoding::Depth,
22007        ) -> fidl::Result<()> {
22008            decoder.debug_check_bounds::<Self>(offset);
22009            // Verify that padding bytes are zero.
22010            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
22011            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22012            let mask = 0xffffffff00000000u64;
22013            let maskedval = padval & mask;
22014            if maskedval != 0 {
22015                return Err(fidl::Error::NonZeroPadding {
22016                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
22017                });
22018            }
22019            fidl::decode!(
22020                OpenFlags,
22021                fidl::encoding::DefaultFuchsiaResourceDialect,
22022                &mut self.flags,
22023                decoder,
22024                offset + 0,
22025                _depth
22026            )?;
22027            fidl::decode!(
22028                ModeType,
22029                fidl::encoding::DefaultFuchsiaResourceDialect,
22030                &mut self.mode,
22031                decoder,
22032                offset + 4,
22033                _depth
22034            )?;
22035            fidl::decode!(
22036                fidl::encoding::BoundedString<4095>,
22037                fidl::encoding::DefaultFuchsiaResourceDialect,
22038                &mut self.path,
22039                decoder,
22040                offset + 8,
22041                _depth
22042            )?;
22043            fidl::decode!(
22044                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22045                fidl::encoding::DefaultFuchsiaResourceDialect,
22046                &mut self.object,
22047                decoder,
22048                offset + 24,
22049                _depth
22050            )?;
22051            Ok(())
22052        }
22053    }
22054
22055    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
22056        type Borrowed<'a> = &'a mut Self;
22057        fn take_or_borrow<'a>(
22058            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22059        ) -> Self::Borrowed<'a> {
22060            value
22061        }
22062    }
22063
22064    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
22065        type Owned = Self;
22066
22067        #[inline(always)]
22068        fn inline_align(_context: fidl::encoding::Context) -> usize {
22069            8
22070        }
22071
22072        #[inline(always)]
22073        fn inline_size(_context: fidl::encoding::Context) -> usize {
22074            40
22075        }
22076    }
22077
22078    unsafe impl
22079        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22080        for &mut DirectoryLinkRequest
22081    {
22082        #[inline]
22083        unsafe fn encode(
22084            self,
22085            encoder: &mut fidl::encoding::Encoder<
22086                '_,
22087                fidl::encoding::DefaultFuchsiaResourceDialect,
22088            >,
22089            offset: usize,
22090            _depth: fidl::encoding::Depth,
22091        ) -> fidl::Result<()> {
22092            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
22093            // Delegate to tuple encoding.
22094            fidl::encoding::Encode::<
22095                DirectoryLinkRequest,
22096                fidl::encoding::DefaultFuchsiaResourceDialect,
22097            >::encode(
22098                (
22099                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22100                        &self.src,
22101                    ),
22102                    <fidl::encoding::HandleType<
22103                        fidl::NullableHandle,
22104                        { fidl::ObjectType::NONE.into_raw() },
22105                        2147483648,
22106                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22107                        &mut self.dst_parent_token,
22108                    ),
22109                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22110                        &self.dst,
22111                    ),
22112                ),
22113                encoder,
22114                offset,
22115                _depth,
22116            )
22117        }
22118    }
22119    unsafe impl<
22120        T0: fidl::encoding::Encode<
22121                fidl::encoding::BoundedString<255>,
22122                fidl::encoding::DefaultFuchsiaResourceDialect,
22123            >,
22124        T1: fidl::encoding::Encode<
22125                fidl::encoding::HandleType<
22126                    fidl::NullableHandle,
22127                    { fidl::ObjectType::NONE.into_raw() },
22128                    2147483648,
22129                >,
22130                fidl::encoding::DefaultFuchsiaResourceDialect,
22131            >,
22132        T2: fidl::encoding::Encode<
22133                fidl::encoding::BoundedString<255>,
22134                fidl::encoding::DefaultFuchsiaResourceDialect,
22135            >,
22136    >
22137        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22138        for (T0, T1, T2)
22139    {
22140        #[inline]
22141        unsafe fn encode(
22142            self,
22143            encoder: &mut fidl::encoding::Encoder<
22144                '_,
22145                fidl::encoding::DefaultFuchsiaResourceDialect,
22146            >,
22147            offset: usize,
22148            depth: fidl::encoding::Depth,
22149        ) -> fidl::Result<()> {
22150            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
22151            // Zero out padding regions. There's no need to apply masks
22152            // because the unmasked parts will be overwritten by fields.
22153            unsafe {
22154                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22155                (ptr as *mut u64).write_unaligned(0);
22156            }
22157            // Write the fields.
22158            self.0.encode(encoder, offset + 0, depth)?;
22159            self.1.encode(encoder, offset + 16, depth)?;
22160            self.2.encode(encoder, offset + 24, depth)?;
22161            Ok(())
22162        }
22163    }
22164
22165    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22166        for DirectoryLinkRequest
22167    {
22168        #[inline(always)]
22169        fn new_empty() -> Self {
22170            Self {
22171                src: fidl::new_empty!(
22172                    fidl::encoding::BoundedString<255>,
22173                    fidl::encoding::DefaultFuchsiaResourceDialect
22174                ),
22175                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22176                dst: fidl::new_empty!(
22177                    fidl::encoding::BoundedString<255>,
22178                    fidl::encoding::DefaultFuchsiaResourceDialect
22179                ),
22180            }
22181        }
22182
22183        #[inline]
22184        unsafe fn decode(
22185            &mut self,
22186            decoder: &mut fidl::encoding::Decoder<
22187                '_,
22188                fidl::encoding::DefaultFuchsiaResourceDialect,
22189            >,
22190            offset: usize,
22191            _depth: fidl::encoding::Depth,
22192        ) -> fidl::Result<()> {
22193            decoder.debug_check_bounds::<Self>(offset);
22194            // Verify that padding bytes are zero.
22195            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22196            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22197            let mask = 0xffffffff00000000u64;
22198            let maskedval = padval & mask;
22199            if maskedval != 0 {
22200                return Err(fidl::Error::NonZeroPadding {
22201                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22202                });
22203            }
22204            fidl::decode!(
22205                fidl::encoding::BoundedString<255>,
22206                fidl::encoding::DefaultFuchsiaResourceDialect,
22207                &mut self.src,
22208                decoder,
22209                offset + 0,
22210                _depth
22211            )?;
22212            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)?;
22213            fidl::decode!(
22214                fidl::encoding::BoundedString<255>,
22215                fidl::encoding::DefaultFuchsiaResourceDialect,
22216                &mut self.dst,
22217                decoder,
22218                offset + 24,
22219                _depth
22220            )?;
22221            Ok(())
22222        }
22223    }
22224
22225    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
22226        type Borrowed<'a> = &'a mut Self;
22227        fn take_or_borrow<'a>(
22228            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22229        ) -> Self::Borrowed<'a> {
22230            value
22231        }
22232    }
22233
22234    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
22235        type Owned = Self;
22236
22237        #[inline(always)]
22238        fn inline_align(_context: fidl::encoding::Context) -> usize {
22239            8
22240        }
22241
22242        #[inline(always)]
22243        fn inline_size(_context: fidl::encoding::Context) -> usize {
22244            40
22245        }
22246    }
22247
22248    unsafe impl
22249        fidl::encoding::Encode<
22250            DirectoryRenameRequest,
22251            fidl::encoding::DefaultFuchsiaResourceDialect,
22252        > for &mut DirectoryRenameRequest
22253    {
22254        #[inline]
22255        unsafe fn encode(
22256            self,
22257            encoder: &mut fidl::encoding::Encoder<
22258                '_,
22259                fidl::encoding::DefaultFuchsiaResourceDialect,
22260            >,
22261            offset: usize,
22262            _depth: fidl::encoding::Depth,
22263        ) -> fidl::Result<()> {
22264            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
22265            // Delegate to tuple encoding.
22266            fidl::encoding::Encode::<
22267                DirectoryRenameRequest,
22268                fidl::encoding::DefaultFuchsiaResourceDialect,
22269            >::encode(
22270                (
22271                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22272                        &self.src,
22273                    ),
22274                    <fidl::encoding::HandleType<
22275                        fidl::Event,
22276                        { fidl::ObjectType::EVENT.into_raw() },
22277                        2147483648,
22278                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22279                        &mut self.dst_parent_token,
22280                    ),
22281                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22282                        &self.dst,
22283                    ),
22284                ),
22285                encoder,
22286                offset,
22287                _depth,
22288            )
22289        }
22290    }
22291    unsafe impl<
22292        T0: fidl::encoding::Encode<
22293                fidl::encoding::BoundedString<255>,
22294                fidl::encoding::DefaultFuchsiaResourceDialect,
22295            >,
22296        T1: fidl::encoding::Encode<
22297                fidl::encoding::HandleType<
22298                    fidl::Event,
22299                    { fidl::ObjectType::EVENT.into_raw() },
22300                    2147483648,
22301                >,
22302                fidl::encoding::DefaultFuchsiaResourceDialect,
22303            >,
22304        T2: fidl::encoding::Encode<
22305                fidl::encoding::BoundedString<255>,
22306                fidl::encoding::DefaultFuchsiaResourceDialect,
22307            >,
22308    >
22309        fidl::encoding::Encode<
22310            DirectoryRenameRequest,
22311            fidl::encoding::DefaultFuchsiaResourceDialect,
22312        > for (T0, T1, T2)
22313    {
22314        #[inline]
22315        unsafe fn encode(
22316            self,
22317            encoder: &mut fidl::encoding::Encoder<
22318                '_,
22319                fidl::encoding::DefaultFuchsiaResourceDialect,
22320            >,
22321            offset: usize,
22322            depth: fidl::encoding::Depth,
22323        ) -> fidl::Result<()> {
22324            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
22325            // Zero out padding regions. There's no need to apply masks
22326            // because the unmasked parts will be overwritten by fields.
22327            unsafe {
22328                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22329                (ptr as *mut u64).write_unaligned(0);
22330            }
22331            // Write the fields.
22332            self.0.encode(encoder, offset + 0, depth)?;
22333            self.1.encode(encoder, offset + 16, depth)?;
22334            self.2.encode(encoder, offset + 24, depth)?;
22335            Ok(())
22336        }
22337    }
22338
22339    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22340        for DirectoryRenameRequest
22341    {
22342        #[inline(always)]
22343        fn new_empty() -> Self {
22344            Self {
22345                src: fidl::new_empty!(
22346                    fidl::encoding::BoundedString<255>,
22347                    fidl::encoding::DefaultFuchsiaResourceDialect
22348                ),
22349                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22350                dst: fidl::new_empty!(
22351                    fidl::encoding::BoundedString<255>,
22352                    fidl::encoding::DefaultFuchsiaResourceDialect
22353                ),
22354            }
22355        }
22356
22357        #[inline]
22358        unsafe fn decode(
22359            &mut self,
22360            decoder: &mut fidl::encoding::Decoder<
22361                '_,
22362                fidl::encoding::DefaultFuchsiaResourceDialect,
22363            >,
22364            offset: usize,
22365            _depth: fidl::encoding::Depth,
22366        ) -> fidl::Result<()> {
22367            decoder.debug_check_bounds::<Self>(offset);
22368            // Verify that padding bytes are zero.
22369            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22370            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22371            let mask = 0xffffffff00000000u64;
22372            let maskedval = padval & mask;
22373            if maskedval != 0 {
22374                return Err(fidl::Error::NonZeroPadding {
22375                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22376                });
22377            }
22378            fidl::decode!(
22379                fidl::encoding::BoundedString<255>,
22380                fidl::encoding::DefaultFuchsiaResourceDialect,
22381                &mut self.src,
22382                decoder,
22383                offset + 0,
22384                _depth
22385            )?;
22386            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)?;
22387            fidl::decode!(
22388                fidl::encoding::BoundedString<255>,
22389                fidl::encoding::DefaultFuchsiaResourceDialect,
22390                &mut self.dst,
22391                decoder,
22392                offset + 24,
22393                _depth
22394            )?;
22395            Ok(())
22396        }
22397    }
22398
22399    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
22400        type Borrowed<'a> = &'a mut Self;
22401        fn take_or_borrow<'a>(
22402            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22403        ) -> Self::Borrowed<'a> {
22404            value
22405        }
22406    }
22407
22408    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
22409        type Owned = Self;
22410
22411        #[inline(always)]
22412        fn inline_align(_context: fidl::encoding::Context) -> usize {
22413            4
22414        }
22415
22416        #[inline(always)]
22417        fn inline_size(_context: fidl::encoding::Context) -> usize {
22418            12
22419        }
22420    }
22421
22422    unsafe impl
22423        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22424        for &mut DirectoryWatchRequest
22425    {
22426        #[inline]
22427        unsafe fn encode(
22428            self,
22429            encoder: &mut fidl::encoding::Encoder<
22430                '_,
22431                fidl::encoding::DefaultFuchsiaResourceDialect,
22432            >,
22433            offset: usize,
22434            _depth: fidl::encoding::Depth,
22435        ) -> fidl::Result<()> {
22436            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22437            // Delegate to tuple encoding.
22438            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22439                (
22440                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
22441                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
22442                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
22443                ),
22444                encoder, offset, _depth
22445            )
22446        }
22447    }
22448    unsafe impl<
22449        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
22450        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
22451        T2: fidl::encoding::Encode<
22452                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22453                fidl::encoding::DefaultFuchsiaResourceDialect,
22454            >,
22455    >
22456        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22457        for (T0, T1, T2)
22458    {
22459        #[inline]
22460        unsafe fn encode(
22461            self,
22462            encoder: &mut fidl::encoding::Encoder<
22463                '_,
22464                fidl::encoding::DefaultFuchsiaResourceDialect,
22465            >,
22466            offset: usize,
22467            depth: fidl::encoding::Depth,
22468        ) -> fidl::Result<()> {
22469            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
22470            // Zero out padding regions. There's no need to apply masks
22471            // because the unmasked parts will be overwritten by fields.
22472            // Write the fields.
22473            self.0.encode(encoder, offset + 0, depth)?;
22474            self.1.encode(encoder, offset + 4, depth)?;
22475            self.2.encode(encoder, offset + 8, depth)?;
22476            Ok(())
22477        }
22478    }
22479
22480    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22481        for DirectoryWatchRequest
22482    {
22483        #[inline(always)]
22484        fn new_empty() -> Self {
22485            Self {
22486                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
22487                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
22488                watcher: fidl::new_empty!(
22489                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22490                    fidl::encoding::DefaultFuchsiaResourceDialect
22491                ),
22492            }
22493        }
22494
22495        #[inline]
22496        unsafe fn decode(
22497            &mut self,
22498            decoder: &mut fidl::encoding::Decoder<
22499                '_,
22500                fidl::encoding::DefaultFuchsiaResourceDialect,
22501            >,
22502            offset: usize,
22503            _depth: fidl::encoding::Depth,
22504        ) -> fidl::Result<()> {
22505            decoder.debug_check_bounds::<Self>(offset);
22506            // Verify that padding bytes are zero.
22507            fidl::decode!(
22508                WatchMask,
22509                fidl::encoding::DefaultFuchsiaResourceDialect,
22510                &mut self.mask,
22511                decoder,
22512                offset + 0,
22513                _depth
22514            )?;
22515            fidl::decode!(
22516                u32,
22517                fidl::encoding::DefaultFuchsiaResourceDialect,
22518                &mut self.options,
22519                decoder,
22520                offset + 4,
22521                _depth
22522            )?;
22523            fidl::decode!(
22524                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22525                fidl::encoding::DefaultFuchsiaResourceDialect,
22526                &mut self.watcher,
22527                decoder,
22528                offset + 8,
22529                _depth
22530            )?;
22531            Ok(())
22532        }
22533    }
22534
22535    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
22536        type Borrowed<'a> = &'a mut Self;
22537        fn take_or_borrow<'a>(
22538            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22539        ) -> Self::Borrowed<'a> {
22540            value
22541        }
22542    }
22543
22544    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
22545        type Owned = Self;
22546
22547        #[inline(always)]
22548        fn inline_align(_context: fidl::encoding::Context) -> usize {
22549            8
22550        }
22551
22552        #[inline(always)]
22553        fn inline_size(_context: fidl::encoding::Context) -> usize {
22554            24
22555        }
22556    }
22557
22558    unsafe impl
22559        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22560        for &mut FileAllocateRequest
22561    {
22562        #[inline]
22563        unsafe fn encode(
22564            self,
22565            encoder: &mut fidl::encoding::Encoder<
22566                '_,
22567                fidl::encoding::DefaultFuchsiaResourceDialect,
22568            >,
22569            offset: usize,
22570            _depth: fidl::encoding::Depth,
22571        ) -> fidl::Result<()> {
22572            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22573            // Delegate to tuple encoding.
22574            fidl::encoding::Encode::<
22575                FileAllocateRequest,
22576                fidl::encoding::DefaultFuchsiaResourceDialect,
22577            >::encode(
22578                (
22579                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
22580                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
22581                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
22582                ),
22583                encoder,
22584                offset,
22585                _depth,
22586            )
22587        }
22588    }
22589    unsafe impl<
22590        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22591        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22592        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
22593    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22594        for (T0, T1, T2)
22595    {
22596        #[inline]
22597        unsafe fn encode(
22598            self,
22599            encoder: &mut fidl::encoding::Encoder<
22600                '_,
22601                fidl::encoding::DefaultFuchsiaResourceDialect,
22602            >,
22603            offset: usize,
22604            depth: fidl::encoding::Depth,
22605        ) -> fidl::Result<()> {
22606            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22607            // Zero out padding regions. There's no need to apply masks
22608            // because the unmasked parts will be overwritten by fields.
22609            unsafe {
22610                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22611                (ptr as *mut u64).write_unaligned(0);
22612            }
22613            // Write the fields.
22614            self.0.encode(encoder, offset + 0, depth)?;
22615            self.1.encode(encoder, offset + 8, depth)?;
22616            self.2.encode(encoder, offset + 16, depth)?;
22617            Ok(())
22618        }
22619    }
22620
22621    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22622        for FileAllocateRequest
22623    {
22624        #[inline(always)]
22625        fn new_empty() -> Self {
22626            Self {
22627                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22628                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22629                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
22630            }
22631        }
22632
22633        #[inline]
22634        unsafe fn decode(
22635            &mut self,
22636            decoder: &mut fidl::encoding::Decoder<
22637                '_,
22638                fidl::encoding::DefaultFuchsiaResourceDialect,
22639            >,
22640            offset: usize,
22641            _depth: fidl::encoding::Depth,
22642        ) -> fidl::Result<()> {
22643            decoder.debug_check_bounds::<Self>(offset);
22644            // Verify that padding bytes are zero.
22645            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22646            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22647            let mask = 0xffffffff00000000u64;
22648            let maskedval = padval & mask;
22649            if maskedval != 0 {
22650                return Err(fidl::Error::NonZeroPadding {
22651                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22652                });
22653            }
22654            fidl::decode!(
22655                u64,
22656                fidl::encoding::DefaultFuchsiaResourceDialect,
22657                &mut self.offset,
22658                decoder,
22659                offset + 0,
22660                _depth
22661            )?;
22662            fidl::decode!(
22663                u64,
22664                fidl::encoding::DefaultFuchsiaResourceDialect,
22665                &mut self.length,
22666                decoder,
22667                offset + 8,
22668                _depth
22669            )?;
22670            fidl::decode!(
22671                AllocateMode,
22672                fidl::encoding::DefaultFuchsiaResourceDialect,
22673                &mut self.mode,
22674                decoder,
22675                offset + 16,
22676                _depth
22677            )?;
22678            Ok(())
22679        }
22680    }
22681
22682    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
22683        type Borrowed<'a> = &'a mut Self;
22684        fn take_or_borrow<'a>(
22685            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22686        ) -> Self::Borrowed<'a> {
22687            value
22688        }
22689    }
22690
22691    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
22692        type Owned = Self;
22693
22694        #[inline(always)]
22695        fn inline_align(_context: fidl::encoding::Context) -> usize {
22696            8
22697        }
22698
22699        #[inline(always)]
22700        fn inline_size(_context: fidl::encoding::Context) -> usize {
22701            16
22702        }
22703    }
22704
22705    unsafe impl
22706        fidl::encoding::Encode<
22707            FileEnableVerityRequest,
22708            fidl::encoding::DefaultFuchsiaResourceDialect,
22709        > for &mut FileEnableVerityRequest
22710    {
22711        #[inline]
22712        unsafe fn encode(
22713            self,
22714            encoder: &mut fidl::encoding::Encoder<
22715                '_,
22716                fidl::encoding::DefaultFuchsiaResourceDialect,
22717            >,
22718            offset: usize,
22719            _depth: fidl::encoding::Depth,
22720        ) -> fidl::Result<()> {
22721            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22722            // Delegate to tuple encoding.
22723            fidl::encoding::Encode::<
22724                FileEnableVerityRequest,
22725                fidl::encoding::DefaultFuchsiaResourceDialect,
22726            >::encode(
22727                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
22728                encoder,
22729                offset,
22730                _depth,
22731            )
22732        }
22733    }
22734    unsafe impl<
22735        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
22736    >
22737        fidl::encoding::Encode<
22738            FileEnableVerityRequest,
22739            fidl::encoding::DefaultFuchsiaResourceDialect,
22740        > for (T0,)
22741    {
22742        #[inline]
22743        unsafe fn encode(
22744            self,
22745            encoder: &mut fidl::encoding::Encoder<
22746                '_,
22747                fidl::encoding::DefaultFuchsiaResourceDialect,
22748            >,
22749            offset: usize,
22750            depth: fidl::encoding::Depth,
22751        ) -> fidl::Result<()> {
22752            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22753            // Zero out padding regions. There's no need to apply masks
22754            // because the unmasked parts will be overwritten by fields.
22755            // Write the fields.
22756            self.0.encode(encoder, offset + 0, depth)?;
22757            Ok(())
22758        }
22759    }
22760
22761    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22762        for FileEnableVerityRequest
22763    {
22764        #[inline(always)]
22765        fn new_empty() -> Self {
22766            Self {
22767                options: fidl::new_empty!(
22768                    VerificationOptions,
22769                    fidl::encoding::DefaultFuchsiaResourceDialect
22770                ),
22771            }
22772        }
22773
22774        #[inline]
22775        unsafe fn decode(
22776            &mut self,
22777            decoder: &mut fidl::encoding::Decoder<
22778                '_,
22779                fidl::encoding::DefaultFuchsiaResourceDialect,
22780            >,
22781            offset: usize,
22782            _depth: fidl::encoding::Depth,
22783        ) -> fidl::Result<()> {
22784            decoder.debug_check_bounds::<Self>(offset);
22785            // Verify that padding bytes are zero.
22786            fidl::decode!(
22787                VerificationOptions,
22788                fidl::encoding::DefaultFuchsiaResourceDialect,
22789                &mut self.options,
22790                decoder,
22791                offset + 0,
22792                _depth
22793            )?;
22794            Ok(())
22795        }
22796    }
22797
22798    impl fidl::encoding::ResourceTypeMarker for FileObject {
22799        type Borrowed<'a> = &'a mut Self;
22800        fn take_or_borrow<'a>(
22801            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22802        ) -> Self::Borrowed<'a> {
22803            value
22804        }
22805    }
22806
22807    unsafe impl fidl::encoding::TypeMarker for FileObject {
22808        type Owned = Self;
22809
22810        #[inline(always)]
22811        fn inline_align(_context: fidl::encoding::Context) -> usize {
22812            4
22813        }
22814
22815        #[inline(always)]
22816        fn inline_size(_context: fidl::encoding::Context) -> usize {
22817            8
22818        }
22819    }
22820
22821    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22822        for &mut FileObject
22823    {
22824        #[inline]
22825        unsafe fn encode(
22826            self,
22827            encoder: &mut fidl::encoding::Encoder<
22828                '_,
22829                fidl::encoding::DefaultFuchsiaResourceDialect,
22830            >,
22831            offset: usize,
22832            _depth: fidl::encoding::Depth,
22833        ) -> fidl::Result<()> {
22834            encoder.debug_check_bounds::<FileObject>(offset);
22835            // Delegate to tuple encoding.
22836            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22837                (
22838                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
22839                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
22840                ),
22841                encoder, offset, _depth
22842            )
22843        }
22844    }
22845    unsafe impl<
22846        T0: fidl::encoding::Encode<
22847                fidl::encoding::Optional<
22848                    fidl::encoding::HandleType<
22849                        fidl::Event,
22850                        { fidl::ObjectType::EVENT.into_raw() },
22851                        2147483648,
22852                    >,
22853                >,
22854                fidl::encoding::DefaultFuchsiaResourceDialect,
22855            >,
22856        T1: fidl::encoding::Encode<
22857                fidl::encoding::Optional<
22858                    fidl::encoding::HandleType<
22859                        fidl::Stream,
22860                        { fidl::ObjectType::STREAM.into_raw() },
22861                        2147483648,
22862                    >,
22863                >,
22864                fidl::encoding::DefaultFuchsiaResourceDialect,
22865            >,
22866    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22867        for (T0, T1)
22868    {
22869        #[inline]
22870        unsafe fn encode(
22871            self,
22872            encoder: &mut fidl::encoding::Encoder<
22873                '_,
22874                fidl::encoding::DefaultFuchsiaResourceDialect,
22875            >,
22876            offset: usize,
22877            depth: fidl::encoding::Depth,
22878        ) -> fidl::Result<()> {
22879            encoder.debug_check_bounds::<FileObject>(offset);
22880            // Zero out padding regions. There's no need to apply masks
22881            // because the unmasked parts will be overwritten by fields.
22882            // Write the fields.
22883            self.0.encode(encoder, offset + 0, depth)?;
22884            self.1.encode(encoder, offset + 4, depth)?;
22885            Ok(())
22886        }
22887    }
22888
22889    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
22890        #[inline(always)]
22891        fn new_empty() -> Self {
22892            Self {
22893                event: fidl::new_empty!(
22894                    fidl::encoding::Optional<
22895                        fidl::encoding::HandleType<
22896                            fidl::Event,
22897                            { fidl::ObjectType::EVENT.into_raw() },
22898                            2147483648,
22899                        >,
22900                    >,
22901                    fidl::encoding::DefaultFuchsiaResourceDialect
22902                ),
22903                stream: fidl::new_empty!(
22904                    fidl::encoding::Optional<
22905                        fidl::encoding::HandleType<
22906                            fidl::Stream,
22907                            { fidl::ObjectType::STREAM.into_raw() },
22908                            2147483648,
22909                        >,
22910                    >,
22911                    fidl::encoding::DefaultFuchsiaResourceDialect
22912                ),
22913            }
22914        }
22915
22916        #[inline]
22917        unsafe fn decode(
22918            &mut self,
22919            decoder: &mut fidl::encoding::Decoder<
22920                '_,
22921                fidl::encoding::DefaultFuchsiaResourceDialect,
22922            >,
22923            offset: usize,
22924            _depth: fidl::encoding::Depth,
22925        ) -> fidl::Result<()> {
22926            decoder.debug_check_bounds::<Self>(offset);
22927            // Verify that padding bytes are zero.
22928            fidl::decode!(
22929                fidl::encoding::Optional<
22930                    fidl::encoding::HandleType<
22931                        fidl::Event,
22932                        { fidl::ObjectType::EVENT.into_raw() },
22933                        2147483648,
22934                    >,
22935                >,
22936                fidl::encoding::DefaultFuchsiaResourceDialect,
22937                &mut self.event,
22938                decoder,
22939                offset + 0,
22940                _depth
22941            )?;
22942            fidl::decode!(
22943                fidl::encoding::Optional<
22944                    fidl::encoding::HandleType<
22945                        fidl::Stream,
22946                        { fidl::ObjectType::STREAM.into_raw() },
22947                        2147483648,
22948                    >,
22949                >,
22950                fidl::encoding::DefaultFuchsiaResourceDialect,
22951                &mut self.stream,
22952                decoder,
22953                offset + 4,
22954                _depth
22955            )?;
22956            Ok(())
22957        }
22958    }
22959
22960    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
22961        type Borrowed<'a> = &'a mut Self;
22962        fn take_or_borrow<'a>(
22963            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22964        ) -> Self::Borrowed<'a> {
22965            value
22966        }
22967    }
22968
22969    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
22970        type Owned = Self;
22971
22972        #[inline(always)]
22973        fn inline_align(_context: fidl::encoding::Context) -> usize {
22974            4
22975        }
22976
22977        #[inline(always)]
22978        fn inline_size(_context: fidl::encoding::Context) -> usize {
22979            4
22980        }
22981    }
22982
22983    unsafe impl
22984        fidl::encoding::Encode<
22985            FileGetBackingMemoryResponse,
22986            fidl::encoding::DefaultFuchsiaResourceDialect,
22987        > for &mut FileGetBackingMemoryResponse
22988    {
22989        #[inline]
22990        unsafe fn encode(
22991            self,
22992            encoder: &mut fidl::encoding::Encoder<
22993                '_,
22994                fidl::encoding::DefaultFuchsiaResourceDialect,
22995            >,
22996            offset: usize,
22997            _depth: fidl::encoding::Depth,
22998        ) -> fidl::Result<()> {
22999            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
23000            // Delegate to tuple encoding.
23001            fidl::encoding::Encode::<
23002                FileGetBackingMemoryResponse,
23003                fidl::encoding::DefaultFuchsiaResourceDialect,
23004            >::encode(
23005                (<fidl::encoding::HandleType<
23006                    fidl::Vmo,
23007                    { fidl::ObjectType::VMO.into_raw() },
23008                    2147483648,
23009                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23010                    &mut self.vmo
23011                ),),
23012                encoder,
23013                offset,
23014                _depth,
23015            )
23016        }
23017    }
23018    unsafe impl<
23019        T0: fidl::encoding::Encode<
23020                fidl::encoding::HandleType<
23021                    fidl::Vmo,
23022                    { fidl::ObjectType::VMO.into_raw() },
23023                    2147483648,
23024                >,
23025                fidl::encoding::DefaultFuchsiaResourceDialect,
23026            >,
23027    >
23028        fidl::encoding::Encode<
23029            FileGetBackingMemoryResponse,
23030            fidl::encoding::DefaultFuchsiaResourceDialect,
23031        > for (T0,)
23032    {
23033        #[inline]
23034        unsafe fn encode(
23035            self,
23036            encoder: &mut fidl::encoding::Encoder<
23037                '_,
23038                fidl::encoding::DefaultFuchsiaResourceDialect,
23039            >,
23040            offset: usize,
23041            depth: fidl::encoding::Depth,
23042        ) -> fidl::Result<()> {
23043            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
23044            // Zero out padding regions. There's no need to apply masks
23045            // because the unmasked parts will be overwritten by fields.
23046            // Write the fields.
23047            self.0.encode(encoder, offset + 0, depth)?;
23048            Ok(())
23049        }
23050    }
23051
23052    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23053        for FileGetBackingMemoryResponse
23054    {
23055        #[inline(always)]
23056        fn new_empty() -> Self {
23057            Self {
23058                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23059            }
23060        }
23061
23062        #[inline]
23063        unsafe fn decode(
23064            &mut self,
23065            decoder: &mut fidl::encoding::Decoder<
23066                '_,
23067                fidl::encoding::DefaultFuchsiaResourceDialect,
23068            >,
23069            offset: usize,
23070            _depth: fidl::encoding::Depth,
23071        ) -> fidl::Result<()> {
23072            decoder.debug_check_bounds::<Self>(offset);
23073            // Verify that padding bytes are zero.
23074            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
23075            Ok(())
23076        }
23077    }
23078
23079    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
23080        type Borrowed<'a> = &'a mut Self;
23081        fn take_or_borrow<'a>(
23082            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23083        ) -> Self::Borrowed<'a> {
23084            value
23085        }
23086    }
23087
23088    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
23089        type Owned = Self;
23090
23091        #[inline(always)]
23092        fn inline_align(_context: fidl::encoding::Context) -> usize {
23093            8
23094        }
23095
23096        #[inline(always)]
23097        fn inline_size(_context: fidl::encoding::Context) -> usize {
23098            24
23099        }
23100    }
23101
23102    unsafe impl
23103        fidl::encoding::Encode<
23104            LinkableLinkIntoRequest,
23105            fidl::encoding::DefaultFuchsiaResourceDialect,
23106        > for &mut LinkableLinkIntoRequest
23107    {
23108        #[inline]
23109        unsafe fn encode(
23110            self,
23111            encoder: &mut fidl::encoding::Encoder<
23112                '_,
23113                fidl::encoding::DefaultFuchsiaResourceDialect,
23114            >,
23115            offset: usize,
23116            _depth: fidl::encoding::Depth,
23117        ) -> fidl::Result<()> {
23118            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
23119            // Delegate to tuple encoding.
23120            fidl::encoding::Encode::<
23121                LinkableLinkIntoRequest,
23122                fidl::encoding::DefaultFuchsiaResourceDialect,
23123            >::encode(
23124                (
23125                    <fidl::encoding::HandleType<
23126                        fidl::Event,
23127                        { fidl::ObjectType::EVENT.into_raw() },
23128                        2147483648,
23129                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23130                        &mut self.dst_parent_token,
23131                    ),
23132                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
23133                        &self.dst,
23134                    ),
23135                ),
23136                encoder,
23137                offset,
23138                _depth,
23139            )
23140        }
23141    }
23142    unsafe impl<
23143        T0: fidl::encoding::Encode<
23144                fidl::encoding::HandleType<
23145                    fidl::Event,
23146                    { fidl::ObjectType::EVENT.into_raw() },
23147                    2147483648,
23148                >,
23149                fidl::encoding::DefaultFuchsiaResourceDialect,
23150            >,
23151        T1: fidl::encoding::Encode<
23152                fidl::encoding::BoundedString<255>,
23153                fidl::encoding::DefaultFuchsiaResourceDialect,
23154            >,
23155    >
23156        fidl::encoding::Encode<
23157            LinkableLinkIntoRequest,
23158            fidl::encoding::DefaultFuchsiaResourceDialect,
23159        > for (T0, T1)
23160    {
23161        #[inline]
23162        unsafe fn encode(
23163            self,
23164            encoder: &mut fidl::encoding::Encoder<
23165                '_,
23166                fidl::encoding::DefaultFuchsiaResourceDialect,
23167            >,
23168            offset: usize,
23169            depth: fidl::encoding::Depth,
23170        ) -> fidl::Result<()> {
23171            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
23172            // Zero out padding regions. There's no need to apply masks
23173            // because the unmasked parts will be overwritten by fields.
23174            unsafe {
23175                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
23176                (ptr as *mut u64).write_unaligned(0);
23177            }
23178            // Write the fields.
23179            self.0.encode(encoder, offset + 0, depth)?;
23180            self.1.encode(encoder, offset + 8, depth)?;
23181            Ok(())
23182        }
23183    }
23184
23185    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23186        for LinkableLinkIntoRequest
23187    {
23188        #[inline(always)]
23189        fn new_empty() -> Self {
23190            Self {
23191                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23192                dst: fidl::new_empty!(
23193                    fidl::encoding::BoundedString<255>,
23194                    fidl::encoding::DefaultFuchsiaResourceDialect
23195                ),
23196            }
23197        }
23198
23199        #[inline]
23200        unsafe fn decode(
23201            &mut self,
23202            decoder: &mut fidl::encoding::Decoder<
23203                '_,
23204                fidl::encoding::DefaultFuchsiaResourceDialect,
23205            >,
23206            offset: usize,
23207            _depth: fidl::encoding::Depth,
23208        ) -> fidl::Result<()> {
23209            decoder.debug_check_bounds::<Self>(offset);
23210            // Verify that padding bytes are zero.
23211            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
23212            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23213            let mask = 0xffffffff00000000u64;
23214            let maskedval = padval & mask;
23215            if maskedval != 0 {
23216                return Err(fidl::Error::NonZeroPadding {
23217                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
23218                });
23219            }
23220            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)?;
23221            fidl::decode!(
23222                fidl::encoding::BoundedString<255>,
23223                fidl::encoding::DefaultFuchsiaResourceDialect,
23224                &mut self.dst,
23225                decoder,
23226                offset + 8,
23227                _depth
23228            )?;
23229            Ok(())
23230        }
23231    }
23232
23233    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
23234        type Borrowed<'a> = &'a mut Self;
23235        fn take_or_borrow<'a>(
23236            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23237        ) -> Self::Borrowed<'a> {
23238            value
23239        }
23240    }
23241
23242    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
23243        type Owned = Self;
23244
23245        #[inline(always)]
23246        fn inline_align(_context: fidl::encoding::Context) -> usize {
23247            4
23248        }
23249
23250        #[inline(always)]
23251        fn inline_size(_context: fidl::encoding::Context) -> usize {
23252            4
23253        }
23254    }
23255
23256    unsafe impl
23257        fidl::encoding::Encode<
23258            NodeListExtendedAttributesRequest,
23259            fidl::encoding::DefaultFuchsiaResourceDialect,
23260        > for &mut NodeListExtendedAttributesRequest
23261    {
23262        #[inline]
23263        unsafe fn encode(
23264            self,
23265            encoder: &mut fidl::encoding::Encoder<
23266                '_,
23267                fidl::encoding::DefaultFuchsiaResourceDialect,
23268            >,
23269            offset: usize,
23270            _depth: fidl::encoding::Depth,
23271        ) -> fidl::Result<()> {
23272            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23273            // Delegate to tuple encoding.
23274            fidl::encoding::Encode::<
23275                NodeListExtendedAttributesRequest,
23276                fidl::encoding::DefaultFuchsiaResourceDialect,
23277            >::encode(
23278                (<fidl::encoding::Endpoint<
23279                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23280                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23281                    &mut self.iterator
23282                ),),
23283                encoder,
23284                offset,
23285                _depth,
23286            )
23287        }
23288    }
23289    unsafe impl<
23290        T0: fidl::encoding::Encode<
23291                fidl::encoding::Endpoint<
23292                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23293                >,
23294                fidl::encoding::DefaultFuchsiaResourceDialect,
23295            >,
23296    >
23297        fidl::encoding::Encode<
23298            NodeListExtendedAttributesRequest,
23299            fidl::encoding::DefaultFuchsiaResourceDialect,
23300        > for (T0,)
23301    {
23302        #[inline]
23303        unsafe fn encode(
23304            self,
23305            encoder: &mut fidl::encoding::Encoder<
23306                '_,
23307                fidl::encoding::DefaultFuchsiaResourceDialect,
23308            >,
23309            offset: usize,
23310            depth: fidl::encoding::Depth,
23311        ) -> fidl::Result<()> {
23312            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
23313            // Zero out padding regions. There's no need to apply masks
23314            // because the unmasked parts will be overwritten by fields.
23315            // Write the fields.
23316            self.0.encode(encoder, offset + 0, depth)?;
23317            Ok(())
23318        }
23319    }
23320
23321    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23322        for NodeListExtendedAttributesRequest
23323    {
23324        #[inline(always)]
23325        fn new_empty() -> Self {
23326            Self {
23327                iterator: fidl::new_empty!(
23328                    fidl::encoding::Endpoint<
23329                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23330                    >,
23331                    fidl::encoding::DefaultFuchsiaResourceDialect
23332                ),
23333            }
23334        }
23335
23336        #[inline]
23337        unsafe fn decode(
23338            &mut self,
23339            decoder: &mut fidl::encoding::Decoder<
23340                '_,
23341                fidl::encoding::DefaultFuchsiaResourceDialect,
23342            >,
23343            offset: usize,
23344            _depth: fidl::encoding::Depth,
23345        ) -> fidl::Result<()> {
23346            decoder.debug_check_bounds::<Self>(offset);
23347            // Verify that padding bytes are zero.
23348            fidl::decode!(
23349                fidl::encoding::Endpoint<
23350                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
23351                >,
23352                fidl::encoding::DefaultFuchsiaResourceDialect,
23353                &mut self.iterator,
23354                decoder,
23355                offset + 0,
23356                _depth
23357            )?;
23358            Ok(())
23359        }
23360    }
23361
23362    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
23363        type Borrowed<'a> = &'a mut Self;
23364        fn take_or_borrow<'a>(
23365            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23366        ) -> Self::Borrowed<'a> {
23367            value
23368        }
23369    }
23370
23371    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
23372        type Owned = Self;
23373
23374        #[inline(always)]
23375        fn inline_align(_context: fidl::encoding::Context) -> usize {
23376            8
23377        }
23378
23379        #[inline(always)]
23380        fn inline_size(_context: fidl::encoding::Context) -> usize {
23381            24
23382        }
23383    }
23384
23385    unsafe impl
23386        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23387        for &mut NodeOnOpenRequest
23388    {
23389        #[inline]
23390        unsafe fn encode(
23391            self,
23392            encoder: &mut fidl::encoding::Encoder<
23393                '_,
23394                fidl::encoding::DefaultFuchsiaResourceDialect,
23395            >,
23396            offset: usize,
23397            _depth: fidl::encoding::Depth,
23398        ) -> fidl::Result<()> {
23399            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23400            // Delegate to tuple encoding.
23401            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23402                (
23403                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
23404                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
23405                ),
23406                encoder, offset, _depth
23407            )
23408        }
23409    }
23410    unsafe impl<
23411        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
23412        T1: fidl::encoding::Encode<
23413                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23414                fidl::encoding::DefaultFuchsiaResourceDialect,
23415            >,
23416    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23417        for (T0, T1)
23418    {
23419        #[inline]
23420        unsafe fn encode(
23421            self,
23422            encoder: &mut fidl::encoding::Encoder<
23423                '_,
23424                fidl::encoding::DefaultFuchsiaResourceDialect,
23425            >,
23426            offset: usize,
23427            depth: fidl::encoding::Depth,
23428        ) -> fidl::Result<()> {
23429            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23430            // Zero out padding regions. There's no need to apply masks
23431            // because the unmasked parts will be overwritten by fields.
23432            unsafe {
23433                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
23434                (ptr as *mut u64).write_unaligned(0);
23435            }
23436            // Write the fields.
23437            self.0.encode(encoder, offset + 0, depth)?;
23438            self.1.encode(encoder, offset + 8, depth)?;
23439            Ok(())
23440        }
23441    }
23442
23443    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23444        for NodeOnOpenRequest
23445    {
23446        #[inline(always)]
23447        fn new_empty() -> Self {
23448            Self {
23449                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
23450                info: fidl::new_empty!(
23451                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23452                    fidl::encoding::DefaultFuchsiaResourceDialect
23453                ),
23454            }
23455        }
23456
23457        #[inline]
23458        unsafe fn decode(
23459            &mut self,
23460            decoder: &mut fidl::encoding::Decoder<
23461                '_,
23462                fidl::encoding::DefaultFuchsiaResourceDialect,
23463            >,
23464            offset: usize,
23465            _depth: fidl::encoding::Depth,
23466        ) -> fidl::Result<()> {
23467            decoder.debug_check_bounds::<Self>(offset);
23468            // Verify that padding bytes are zero.
23469            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
23470            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23471            let mask = 0xffffffff00000000u64;
23472            let maskedval = padval & mask;
23473            if maskedval != 0 {
23474                return Err(fidl::Error::NonZeroPadding {
23475                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
23476                });
23477            }
23478            fidl::decode!(
23479                i32,
23480                fidl::encoding::DefaultFuchsiaResourceDialect,
23481                &mut self.s,
23482                decoder,
23483                offset + 0,
23484                _depth
23485            )?;
23486            fidl::decode!(
23487                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23488                fidl::encoding::DefaultFuchsiaResourceDialect,
23489                &mut self.info,
23490                decoder,
23491                offset + 8,
23492                _depth
23493            )?;
23494            Ok(())
23495        }
23496    }
23497
23498    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
23499        type Borrowed<'a> = &'a mut Self;
23500        fn take_or_borrow<'a>(
23501            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23502        ) -> Self::Borrowed<'a> {
23503            value
23504        }
23505    }
23506
23507    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
23508        type Owned = Self;
23509
23510        #[inline(always)]
23511        fn inline_align(_context: fidl::encoding::Context) -> usize {
23512            8
23513        }
23514
23515        #[inline(always)]
23516        fn inline_size(_context: fidl::encoding::Context) -> usize {
23517            40
23518        }
23519    }
23520
23521    unsafe impl
23522        fidl::encoding::Encode<
23523            NodeSetExtendedAttributeRequest,
23524            fidl::encoding::DefaultFuchsiaResourceDialect,
23525        > for &mut NodeSetExtendedAttributeRequest
23526    {
23527        #[inline]
23528        unsafe fn encode(
23529            self,
23530            encoder: &mut fidl::encoding::Encoder<
23531                '_,
23532                fidl::encoding::DefaultFuchsiaResourceDialect,
23533            >,
23534            offset: usize,
23535            _depth: fidl::encoding::Depth,
23536        ) -> fidl::Result<()> {
23537            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23538            // Delegate to tuple encoding.
23539            fidl::encoding::Encode::<
23540                NodeSetExtendedAttributeRequest,
23541                fidl::encoding::DefaultFuchsiaResourceDialect,
23542            >::encode(
23543                (
23544                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
23545                        &self.name,
23546                    ),
23547                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23548                        &mut self.value,
23549                    ),
23550                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
23551                        &self.mode,
23552                    ),
23553                ),
23554                encoder,
23555                offset,
23556                _depth,
23557            )
23558        }
23559    }
23560    unsafe impl<
23561        T0: fidl::encoding::Encode<
23562                fidl::encoding::Vector<u8, 255>,
23563                fidl::encoding::DefaultFuchsiaResourceDialect,
23564            >,
23565        T1: fidl::encoding::Encode<
23566                ExtendedAttributeValue,
23567                fidl::encoding::DefaultFuchsiaResourceDialect,
23568            >,
23569        T2: fidl::encoding::Encode<
23570                SetExtendedAttributeMode,
23571                fidl::encoding::DefaultFuchsiaResourceDialect,
23572            >,
23573    >
23574        fidl::encoding::Encode<
23575            NodeSetExtendedAttributeRequest,
23576            fidl::encoding::DefaultFuchsiaResourceDialect,
23577        > for (T0, T1, T2)
23578    {
23579        #[inline]
23580        unsafe fn encode(
23581            self,
23582            encoder: &mut fidl::encoding::Encoder<
23583                '_,
23584                fidl::encoding::DefaultFuchsiaResourceDialect,
23585            >,
23586            offset: usize,
23587            depth: fidl::encoding::Depth,
23588        ) -> fidl::Result<()> {
23589            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23590            // Zero out padding regions. There's no need to apply masks
23591            // because the unmasked parts will be overwritten by fields.
23592            unsafe {
23593                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
23594                (ptr as *mut u64).write_unaligned(0);
23595            }
23596            // Write the fields.
23597            self.0.encode(encoder, offset + 0, depth)?;
23598            self.1.encode(encoder, offset + 16, depth)?;
23599            self.2.encode(encoder, offset + 32, depth)?;
23600            Ok(())
23601        }
23602    }
23603
23604    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23605        for NodeSetExtendedAttributeRequest
23606    {
23607        #[inline(always)]
23608        fn new_empty() -> Self {
23609            Self {
23610                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
23611                value: fidl::new_empty!(
23612                    ExtendedAttributeValue,
23613                    fidl::encoding::DefaultFuchsiaResourceDialect
23614                ),
23615                mode: fidl::new_empty!(
23616                    SetExtendedAttributeMode,
23617                    fidl::encoding::DefaultFuchsiaResourceDialect
23618                ),
23619            }
23620        }
23621
23622        #[inline]
23623        unsafe fn decode(
23624            &mut self,
23625            decoder: &mut fidl::encoding::Decoder<
23626                '_,
23627                fidl::encoding::DefaultFuchsiaResourceDialect,
23628            >,
23629            offset: usize,
23630            _depth: fidl::encoding::Depth,
23631        ) -> fidl::Result<()> {
23632            decoder.debug_check_bounds::<Self>(offset);
23633            // Verify that padding bytes are zero.
23634            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
23635            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23636            let mask = 0xffffffff00000000u64;
23637            let maskedval = padval & mask;
23638            if maskedval != 0 {
23639                return Err(fidl::Error::NonZeroPadding {
23640                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
23641                });
23642            }
23643            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
23644            fidl::decode!(
23645                ExtendedAttributeValue,
23646                fidl::encoding::DefaultFuchsiaResourceDialect,
23647                &mut self.value,
23648                decoder,
23649                offset + 16,
23650                _depth
23651            )?;
23652            fidl::decode!(
23653                SetExtendedAttributeMode,
23654                fidl::encoding::DefaultFuchsiaResourceDialect,
23655                &mut self.mode,
23656                decoder,
23657                offset + 32,
23658                _depth
23659            )?;
23660            Ok(())
23661        }
23662    }
23663
23664    impl fidl::encoding::ResourceTypeMarker for NodeGetTokenResponse {
23665        type Borrowed<'a> = &'a mut Self;
23666        fn take_or_borrow<'a>(
23667            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23668        ) -> Self::Borrowed<'a> {
23669            value
23670        }
23671    }
23672
23673    unsafe impl fidl::encoding::TypeMarker for NodeGetTokenResponse {
23674        type Owned = Self;
23675
23676        #[inline(always)]
23677        fn inline_align(_context: fidl::encoding::Context) -> usize {
23678            4
23679        }
23680
23681        #[inline(always)]
23682        fn inline_size(_context: fidl::encoding::Context) -> usize {
23683            4
23684        }
23685    }
23686
23687    unsafe impl
23688        fidl::encoding::Encode<NodeGetTokenResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
23689        for &mut NodeGetTokenResponse
23690    {
23691        #[inline]
23692        unsafe fn encode(
23693            self,
23694            encoder: &mut fidl::encoding::Encoder<
23695                '_,
23696                fidl::encoding::DefaultFuchsiaResourceDialect,
23697            >,
23698            offset: usize,
23699            _depth: fidl::encoding::Depth,
23700        ) -> fidl::Result<()> {
23701            encoder.debug_check_bounds::<NodeGetTokenResponse>(offset);
23702            // Delegate to tuple encoding.
23703            fidl::encoding::Encode::<
23704                NodeGetTokenResponse,
23705                fidl::encoding::DefaultFuchsiaResourceDialect,
23706            >::encode(
23707                (<fidl::encoding::HandleType<
23708                    fidl::Event,
23709                    { fidl::ObjectType::EVENT.into_raw() },
23710                    2147483648,
23711                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23712                    &mut self.token
23713                ),),
23714                encoder,
23715                offset,
23716                _depth,
23717            )
23718        }
23719    }
23720    unsafe impl<
23721        T0: fidl::encoding::Encode<
23722                fidl::encoding::HandleType<
23723                    fidl::Event,
23724                    { fidl::ObjectType::EVENT.into_raw() },
23725                    2147483648,
23726                >,
23727                fidl::encoding::DefaultFuchsiaResourceDialect,
23728            >,
23729    >
23730        fidl::encoding::Encode<NodeGetTokenResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
23731        for (T0,)
23732    {
23733        #[inline]
23734        unsafe fn encode(
23735            self,
23736            encoder: &mut fidl::encoding::Encoder<
23737                '_,
23738                fidl::encoding::DefaultFuchsiaResourceDialect,
23739            >,
23740            offset: usize,
23741            depth: fidl::encoding::Depth,
23742        ) -> fidl::Result<()> {
23743            encoder.debug_check_bounds::<NodeGetTokenResponse>(offset);
23744            // Zero out padding regions. There's no need to apply masks
23745            // because the unmasked parts will be overwritten by fields.
23746            // Write the fields.
23747            self.0.encode(encoder, offset + 0, depth)?;
23748            Ok(())
23749        }
23750    }
23751
23752    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23753        for NodeGetTokenResponse
23754    {
23755        #[inline(always)]
23756        fn new_empty() -> Self {
23757            Self {
23758                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23759            }
23760        }
23761
23762        #[inline]
23763        unsafe fn decode(
23764            &mut self,
23765            decoder: &mut fidl::encoding::Decoder<
23766                '_,
23767                fidl::encoding::DefaultFuchsiaResourceDialect,
23768            >,
23769            offset: usize,
23770            _depth: fidl::encoding::Depth,
23771        ) -> fidl::Result<()> {
23772            decoder.debug_check_bounds::<Self>(offset);
23773            // Verify that padding bytes are zero.
23774            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
23775            Ok(())
23776        }
23777    }
23778
23779    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
23780        type Borrowed<'a> = &'a mut Self;
23781        fn take_or_borrow<'a>(
23782            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23783        ) -> Self::Borrowed<'a> {
23784            value
23785        }
23786    }
23787
23788    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
23789        type Owned = Self;
23790
23791        #[inline(always)]
23792        fn inline_align(_context: fidl::encoding::Context) -> usize {
23793            8
23794        }
23795
23796        #[inline(always)]
23797        fn inline_size(_context: fidl::encoding::Context) -> usize {
23798            48
23799        }
23800    }
23801
23802    unsafe impl
23803        fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23804        for &mut OpenableOpenRequest
23805    {
23806        #[inline]
23807        unsafe fn encode(
23808            self,
23809            encoder: &mut fidl::encoding::Encoder<
23810                '_,
23811                fidl::encoding::DefaultFuchsiaResourceDialect,
23812            >,
23813            offset: usize,
23814            _depth: fidl::encoding::Depth,
23815        ) -> fidl::Result<()> {
23816            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23817            // Delegate to tuple encoding.
23818            fidl::encoding::Encode::<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23819                (
23820                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
23821                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
23822                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
23823                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
23824                ),
23825                encoder, offset, _depth
23826            )
23827        }
23828    }
23829    unsafe impl<
23830        T0: fidl::encoding::Encode<
23831                fidl::encoding::BoundedString<4095>,
23832                fidl::encoding::DefaultFuchsiaResourceDialect,
23833            >,
23834        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
23835        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
23836        T3: fidl::encoding::Encode<
23837                fidl::encoding::HandleType<
23838                    fidl::Channel,
23839                    { fidl::ObjectType::CHANNEL.into_raw() },
23840                    2147483648,
23841                >,
23842                fidl::encoding::DefaultFuchsiaResourceDialect,
23843            >,
23844    > fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23845        for (T0, T1, T2, T3)
23846    {
23847        #[inline]
23848        unsafe fn encode(
23849            self,
23850            encoder: &mut fidl::encoding::Encoder<
23851                '_,
23852                fidl::encoding::DefaultFuchsiaResourceDialect,
23853            >,
23854            offset: usize,
23855            depth: fidl::encoding::Depth,
23856        ) -> fidl::Result<()> {
23857            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23858            // Zero out padding regions. There's no need to apply masks
23859            // because the unmasked parts will be overwritten by fields.
23860            unsafe {
23861                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
23862                (ptr as *mut u64).write_unaligned(0);
23863            }
23864            // Write the fields.
23865            self.0.encode(encoder, offset + 0, depth)?;
23866            self.1.encode(encoder, offset + 16, depth)?;
23867            self.2.encode(encoder, offset + 24, depth)?;
23868            self.3.encode(encoder, offset + 40, depth)?;
23869            Ok(())
23870        }
23871    }
23872
23873    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23874        for OpenableOpenRequest
23875    {
23876        #[inline(always)]
23877        fn new_empty() -> Self {
23878            Self {
23879                path: fidl::new_empty!(
23880                    fidl::encoding::BoundedString<4095>,
23881                    fidl::encoding::DefaultFuchsiaResourceDialect
23882                ),
23883                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
23884                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
23885                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23886            }
23887        }
23888
23889        #[inline]
23890        unsafe fn decode(
23891            &mut self,
23892            decoder: &mut fidl::encoding::Decoder<
23893                '_,
23894                fidl::encoding::DefaultFuchsiaResourceDialect,
23895            >,
23896            offset: usize,
23897            _depth: fidl::encoding::Depth,
23898        ) -> fidl::Result<()> {
23899            decoder.debug_check_bounds::<Self>(offset);
23900            // Verify that padding bytes are zero.
23901            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
23902            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23903            let mask = 0xffffffff00000000u64;
23904            let maskedval = padval & mask;
23905            if maskedval != 0 {
23906                return Err(fidl::Error::NonZeroPadding {
23907                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
23908                });
23909            }
23910            fidl::decode!(
23911                fidl::encoding::BoundedString<4095>,
23912                fidl::encoding::DefaultFuchsiaResourceDialect,
23913                &mut self.path,
23914                decoder,
23915                offset + 0,
23916                _depth
23917            )?;
23918            fidl::decode!(
23919                Flags,
23920                fidl::encoding::DefaultFuchsiaResourceDialect,
23921                &mut self.flags,
23922                decoder,
23923                offset + 16,
23924                _depth
23925            )?;
23926            fidl::decode!(
23927                Options,
23928                fidl::encoding::DefaultFuchsiaResourceDialect,
23929                &mut self.options,
23930                decoder,
23931                offset + 24,
23932                _depth
23933            )?;
23934            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
23935            Ok(())
23936        }
23937    }
23938
23939    impl ConnectionInfo {
23940        #[inline(always)]
23941        fn max_ordinal_present(&self) -> u64 {
23942            if let Some(_) = self.rights {
23943                return 1;
23944            }
23945            0
23946        }
23947    }
23948
23949    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
23950        type Borrowed<'a> = &'a mut Self;
23951        fn take_or_borrow<'a>(
23952            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23953        ) -> Self::Borrowed<'a> {
23954            value
23955        }
23956    }
23957
23958    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
23959        type Owned = Self;
23960
23961        #[inline(always)]
23962        fn inline_align(_context: fidl::encoding::Context) -> usize {
23963            8
23964        }
23965
23966        #[inline(always)]
23967        fn inline_size(_context: fidl::encoding::Context) -> usize {
23968            16
23969        }
23970    }
23971
23972    unsafe impl
23973        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23974        for &mut ConnectionInfo
23975    {
23976        unsafe fn encode(
23977            self,
23978            encoder: &mut fidl::encoding::Encoder<
23979                '_,
23980                fidl::encoding::DefaultFuchsiaResourceDialect,
23981            >,
23982            offset: usize,
23983            mut depth: fidl::encoding::Depth,
23984        ) -> fidl::Result<()> {
23985            encoder.debug_check_bounds::<ConnectionInfo>(offset);
23986            // Vector header
23987            let max_ordinal: u64 = self.max_ordinal_present();
23988            encoder.write_num(max_ordinal, offset);
23989            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23990            // Calling encoder.out_of_line_offset(0) is not allowed.
23991            if max_ordinal == 0 {
23992                return Ok(());
23993            }
23994            depth.increment()?;
23995            let envelope_size = 8;
23996            let bytes_len = max_ordinal as usize * envelope_size;
23997            #[allow(unused_variables)]
23998            let offset = encoder.out_of_line_offset(bytes_len);
23999            let mut _prev_end_offset: usize = 0;
24000            if 1 > max_ordinal {
24001                return Ok(());
24002            }
24003
24004            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
24005            // are envelope_size bytes.
24006            let cur_offset: usize = (1 - 1) * envelope_size;
24007
24008            // Zero reserved fields.
24009            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24010
24011            // Safety:
24012            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
24013            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
24014            //   envelope_size bytes, there is always sufficient room.
24015            fidl::encoding::encode_in_envelope_optional::<
24016                Operations,
24017                fidl::encoding::DefaultFuchsiaResourceDialect,
24018            >(
24019                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
24020                encoder,
24021                offset + cur_offset,
24022                depth,
24023            )?;
24024
24025            _prev_end_offset = cur_offset + envelope_size;
24026
24027            Ok(())
24028        }
24029    }
24030
24031    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24032        for ConnectionInfo
24033    {
24034        #[inline(always)]
24035        fn new_empty() -> Self {
24036            Self::default()
24037        }
24038
24039        unsafe fn decode(
24040            &mut self,
24041            decoder: &mut fidl::encoding::Decoder<
24042                '_,
24043                fidl::encoding::DefaultFuchsiaResourceDialect,
24044            >,
24045            offset: usize,
24046            mut depth: fidl::encoding::Depth,
24047        ) -> fidl::Result<()> {
24048            decoder.debug_check_bounds::<Self>(offset);
24049            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
24050                None => return Err(fidl::Error::NotNullable),
24051                Some(len) => len,
24052            };
24053            // Calling decoder.out_of_line_offset(0) is not allowed.
24054            if len == 0 {
24055                return Ok(());
24056            };
24057            depth.increment()?;
24058            let envelope_size = 8;
24059            let bytes_len = len * envelope_size;
24060            let offset = decoder.out_of_line_offset(bytes_len)?;
24061            // Decode the envelope for each type.
24062            let mut _next_ordinal_to_read = 0;
24063            let mut next_offset = offset;
24064            let end_offset = offset + bytes_len;
24065            _next_ordinal_to_read += 1;
24066            if next_offset >= end_offset {
24067                return Ok(());
24068            }
24069
24070            // Decode unknown envelopes for gaps in ordinals.
24071            while _next_ordinal_to_read < 1 {
24072                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24073                _next_ordinal_to_read += 1;
24074                next_offset += envelope_size;
24075            }
24076
24077            let next_out_of_line = decoder.next_out_of_line();
24078            let handles_before = decoder.remaining_handles();
24079            if let Some((inlined, num_bytes, num_handles)) =
24080                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24081            {
24082                let member_inline_size =
24083                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24084                if inlined != (member_inline_size <= 4) {
24085                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24086                }
24087                let inner_offset;
24088                let mut inner_depth = depth.clone();
24089                if inlined {
24090                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24091                    inner_offset = next_offset;
24092                } else {
24093                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24094                    inner_depth.increment()?;
24095                }
24096                let val_ref = self.rights.get_or_insert_with(|| {
24097                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
24098                });
24099                fidl::decode!(
24100                    Operations,
24101                    fidl::encoding::DefaultFuchsiaResourceDialect,
24102                    val_ref,
24103                    decoder,
24104                    inner_offset,
24105                    inner_depth
24106                )?;
24107                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24108                {
24109                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24110                }
24111                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24112                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24113                }
24114            }
24115
24116            next_offset += envelope_size;
24117
24118            // Decode the remaining unknown envelopes.
24119            while next_offset < end_offset {
24120                _next_ordinal_to_read += 1;
24121                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24122                next_offset += envelope_size;
24123            }
24124
24125            Ok(())
24126        }
24127    }
24128
24129    impl FileInfo {
24130        #[inline(always)]
24131        fn max_ordinal_present(&self) -> u64 {
24132            if let Some(_) = self.attributes {
24133                return 4;
24134            }
24135            if let Some(_) = self.stream {
24136                return 3;
24137            }
24138            if let Some(_) = self.observer {
24139                return 2;
24140            }
24141            if let Some(_) = self.is_append {
24142                return 1;
24143            }
24144            0
24145        }
24146    }
24147
24148    impl fidl::encoding::ResourceTypeMarker for FileInfo {
24149        type Borrowed<'a> = &'a mut Self;
24150        fn take_or_borrow<'a>(
24151            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24152        ) -> Self::Borrowed<'a> {
24153            value
24154        }
24155    }
24156
24157    unsafe impl fidl::encoding::TypeMarker for FileInfo {
24158        type Owned = Self;
24159
24160        #[inline(always)]
24161        fn inline_align(_context: fidl::encoding::Context) -> usize {
24162            8
24163        }
24164
24165        #[inline(always)]
24166        fn inline_size(_context: fidl::encoding::Context) -> usize {
24167            16
24168        }
24169    }
24170
24171    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
24172        for &mut FileInfo
24173    {
24174        unsafe fn encode(
24175            self,
24176            encoder: &mut fidl::encoding::Encoder<
24177                '_,
24178                fidl::encoding::DefaultFuchsiaResourceDialect,
24179            >,
24180            offset: usize,
24181            mut depth: fidl::encoding::Depth,
24182        ) -> fidl::Result<()> {
24183            encoder.debug_check_bounds::<FileInfo>(offset);
24184            // Vector header
24185            let max_ordinal: u64 = self.max_ordinal_present();
24186            encoder.write_num(max_ordinal, offset);
24187            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
24188            // Calling encoder.out_of_line_offset(0) is not allowed.
24189            if max_ordinal == 0 {
24190                return Ok(());
24191            }
24192            depth.increment()?;
24193            let envelope_size = 8;
24194            let bytes_len = max_ordinal as usize * envelope_size;
24195            #[allow(unused_variables)]
24196            let offset = encoder.out_of_line_offset(bytes_len);
24197            let mut _prev_end_offset: usize = 0;
24198            if 1 > max_ordinal {
24199                return Ok(());
24200            }
24201
24202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
24203            // are envelope_size bytes.
24204            let cur_offset: usize = (1 - 1) * envelope_size;
24205
24206            // Zero reserved fields.
24207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24208
24209            // Safety:
24210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
24211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
24212            //   envelope_size bytes, there is always sufficient room.
24213            fidl::encoding::encode_in_envelope_optional::<
24214                bool,
24215                fidl::encoding::DefaultFuchsiaResourceDialect,
24216            >(
24217                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
24218                encoder,
24219                offset + cur_offset,
24220                depth,
24221            )?;
24222
24223            _prev_end_offset = cur_offset + envelope_size;
24224            if 2 > max_ordinal {
24225                return Ok(());
24226            }
24227
24228            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
24229            // are envelope_size bytes.
24230            let cur_offset: usize = (2 - 1) * envelope_size;
24231
24232            // Zero reserved fields.
24233            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24234
24235            // Safety:
24236            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
24237            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
24238            //   envelope_size bytes, there is always sufficient room.
24239            fidl::encoding::encode_in_envelope_optional::<
24240                fidl::encoding::HandleType<
24241                    fidl::Event,
24242                    { fidl::ObjectType::EVENT.into_raw() },
24243                    2147483648,
24244                >,
24245                fidl::encoding::DefaultFuchsiaResourceDialect,
24246            >(
24247                self.observer.as_mut().map(
24248                    <fidl::encoding::HandleType<
24249                        fidl::Event,
24250                        { fidl::ObjectType::EVENT.into_raw() },
24251                        2147483648,
24252                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
24253                ),
24254                encoder,
24255                offset + cur_offset,
24256                depth,
24257            )?;
24258
24259            _prev_end_offset = cur_offset + envelope_size;
24260            if 3 > max_ordinal {
24261                return Ok(());
24262            }
24263
24264            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
24265            // are envelope_size bytes.
24266            let cur_offset: usize = (3 - 1) * envelope_size;
24267
24268            // Zero reserved fields.
24269            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24270
24271            // Safety:
24272            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
24273            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
24274            //   envelope_size bytes, there is always sufficient room.
24275            fidl::encoding::encode_in_envelope_optional::<
24276                fidl::encoding::HandleType<
24277                    fidl::Stream,
24278                    { fidl::ObjectType::STREAM.into_raw() },
24279                    2147483648,
24280                >,
24281                fidl::encoding::DefaultFuchsiaResourceDialect,
24282            >(
24283                self.stream.as_mut().map(
24284                    <fidl::encoding::HandleType<
24285                        fidl::Stream,
24286                        { fidl::ObjectType::STREAM.into_raw() },
24287                        2147483648,
24288                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
24289                ),
24290                encoder,
24291                offset + cur_offset,
24292                depth,
24293            )?;
24294
24295            _prev_end_offset = cur_offset + envelope_size;
24296            if 4 > max_ordinal {
24297                return Ok(());
24298            }
24299
24300            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
24301            // are envelope_size bytes.
24302            let cur_offset: usize = (4 - 1) * envelope_size;
24303
24304            // Zero reserved fields.
24305            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24306
24307            // Safety:
24308            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
24309            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
24310            //   envelope_size bytes, there is always sufficient room.
24311            fidl::encoding::encode_in_envelope_optional::<
24312                NodeAttributes2,
24313                fidl::encoding::DefaultFuchsiaResourceDialect,
24314            >(
24315                self.attributes
24316                    .as_ref()
24317                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
24318                encoder,
24319                offset + cur_offset,
24320                depth,
24321            )?;
24322
24323            _prev_end_offset = cur_offset + envelope_size;
24324
24325            Ok(())
24326        }
24327    }
24328
24329    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
24330        #[inline(always)]
24331        fn new_empty() -> Self {
24332            Self::default()
24333        }
24334
24335        unsafe fn decode(
24336            &mut self,
24337            decoder: &mut fidl::encoding::Decoder<
24338                '_,
24339                fidl::encoding::DefaultFuchsiaResourceDialect,
24340            >,
24341            offset: usize,
24342            mut depth: fidl::encoding::Depth,
24343        ) -> fidl::Result<()> {
24344            decoder.debug_check_bounds::<Self>(offset);
24345            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
24346                None => return Err(fidl::Error::NotNullable),
24347                Some(len) => len,
24348            };
24349            // Calling decoder.out_of_line_offset(0) is not allowed.
24350            if len == 0 {
24351                return Ok(());
24352            };
24353            depth.increment()?;
24354            let envelope_size = 8;
24355            let bytes_len = len * envelope_size;
24356            let offset = decoder.out_of_line_offset(bytes_len)?;
24357            // Decode the envelope for each type.
24358            let mut _next_ordinal_to_read = 0;
24359            let mut next_offset = offset;
24360            let end_offset = offset + bytes_len;
24361            _next_ordinal_to_read += 1;
24362            if next_offset >= end_offset {
24363                return Ok(());
24364            }
24365
24366            // Decode unknown envelopes for gaps in ordinals.
24367            while _next_ordinal_to_read < 1 {
24368                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24369                _next_ordinal_to_read += 1;
24370                next_offset += envelope_size;
24371            }
24372
24373            let next_out_of_line = decoder.next_out_of_line();
24374            let handles_before = decoder.remaining_handles();
24375            if let Some((inlined, num_bytes, num_handles)) =
24376                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24377            {
24378                let member_inline_size =
24379                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24380                if inlined != (member_inline_size <= 4) {
24381                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24382                }
24383                let inner_offset;
24384                let mut inner_depth = depth.clone();
24385                if inlined {
24386                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24387                    inner_offset = next_offset;
24388                } else {
24389                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24390                    inner_depth.increment()?;
24391                }
24392                let val_ref = self.is_append.get_or_insert_with(|| {
24393                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
24394                });
24395                fidl::decode!(
24396                    bool,
24397                    fidl::encoding::DefaultFuchsiaResourceDialect,
24398                    val_ref,
24399                    decoder,
24400                    inner_offset,
24401                    inner_depth
24402                )?;
24403                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24404                {
24405                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24406                }
24407                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24408                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24409                }
24410            }
24411
24412            next_offset += envelope_size;
24413            _next_ordinal_to_read += 1;
24414            if next_offset >= end_offset {
24415                return Ok(());
24416            }
24417
24418            // Decode unknown envelopes for gaps in ordinals.
24419            while _next_ordinal_to_read < 2 {
24420                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24421                _next_ordinal_to_read += 1;
24422                next_offset += envelope_size;
24423            }
24424
24425            let next_out_of_line = decoder.next_out_of_line();
24426            let handles_before = decoder.remaining_handles();
24427            if let Some((inlined, num_bytes, num_handles)) =
24428                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24429            {
24430                let member_inline_size = <fidl::encoding::HandleType<
24431                    fidl::Event,
24432                    { fidl::ObjectType::EVENT.into_raw() },
24433                    2147483648,
24434                > as fidl::encoding::TypeMarker>::inline_size(
24435                    decoder.context
24436                );
24437                if inlined != (member_inline_size <= 4) {
24438                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24439                }
24440                let inner_offset;
24441                let mut inner_depth = depth.clone();
24442                if inlined {
24443                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24444                    inner_offset = next_offset;
24445                } else {
24446                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24447                    inner_depth.increment()?;
24448                }
24449                let val_ref =
24450                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24451                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24452                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24453                {
24454                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24455                }
24456                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24457                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24458                }
24459            }
24460
24461            next_offset += envelope_size;
24462            _next_ordinal_to_read += 1;
24463            if next_offset >= end_offset {
24464                return Ok(());
24465            }
24466
24467            // Decode unknown envelopes for gaps in ordinals.
24468            while _next_ordinal_to_read < 3 {
24469                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24470                _next_ordinal_to_read += 1;
24471                next_offset += envelope_size;
24472            }
24473
24474            let next_out_of_line = decoder.next_out_of_line();
24475            let handles_before = decoder.remaining_handles();
24476            if let Some((inlined, num_bytes, num_handles)) =
24477                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24478            {
24479                let member_inline_size = <fidl::encoding::HandleType<
24480                    fidl::Stream,
24481                    { fidl::ObjectType::STREAM.into_raw() },
24482                    2147483648,
24483                > as fidl::encoding::TypeMarker>::inline_size(
24484                    decoder.context
24485                );
24486                if inlined != (member_inline_size <= 4) {
24487                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24488                }
24489                let inner_offset;
24490                let mut inner_depth = depth.clone();
24491                if inlined {
24492                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24493                    inner_offset = next_offset;
24494                } else {
24495                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24496                    inner_depth.increment()?;
24497                }
24498                let val_ref =
24499                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24500                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24501                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24502                {
24503                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24504                }
24505                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24506                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24507                }
24508            }
24509
24510            next_offset += envelope_size;
24511            _next_ordinal_to_read += 1;
24512            if next_offset >= end_offset {
24513                return Ok(());
24514            }
24515
24516            // Decode unknown envelopes for gaps in ordinals.
24517            while _next_ordinal_to_read < 4 {
24518                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24519                _next_ordinal_to_read += 1;
24520                next_offset += envelope_size;
24521            }
24522
24523            let next_out_of_line = decoder.next_out_of_line();
24524            let handles_before = decoder.remaining_handles();
24525            if let Some((inlined, num_bytes, num_handles)) =
24526                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24527            {
24528                let member_inline_size =
24529                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24530                if inlined != (member_inline_size <= 4) {
24531                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24532                }
24533                let inner_offset;
24534                let mut inner_depth = depth.clone();
24535                if inlined {
24536                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24537                    inner_offset = next_offset;
24538                } else {
24539                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24540                    inner_depth.increment()?;
24541                }
24542                let val_ref = self.attributes.get_or_insert_with(|| {
24543                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
24544                });
24545                fidl::decode!(
24546                    NodeAttributes2,
24547                    fidl::encoding::DefaultFuchsiaResourceDialect,
24548                    val_ref,
24549                    decoder,
24550                    inner_offset,
24551                    inner_depth
24552                )?;
24553                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24554                {
24555                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24556                }
24557                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24558                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24559                }
24560            }
24561
24562            next_offset += envelope_size;
24563
24564            // Decode the remaining unknown envelopes.
24565            while next_offset < end_offset {
24566                _next_ordinal_to_read += 1;
24567                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24568                next_offset += envelope_size;
24569            }
24570
24571            Ok(())
24572        }
24573    }
24574
24575    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
24576        type Borrowed<'a> = &'a mut Self;
24577        fn take_or_borrow<'a>(
24578            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24579        ) -> Self::Borrowed<'a> {
24580            value
24581        }
24582    }
24583
24584    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
24585        type Owned = Self;
24586
24587        #[inline(always)]
24588        fn inline_align(_context: fidl::encoding::Context) -> usize {
24589            8
24590        }
24591
24592        #[inline(always)]
24593        fn inline_size(_context: fidl::encoding::Context) -> usize {
24594            16
24595        }
24596    }
24597
24598    unsafe impl
24599        fidl::encoding::Encode<
24600            ExtendedAttributeValue,
24601            fidl::encoding::DefaultFuchsiaResourceDialect,
24602        > for &mut ExtendedAttributeValue
24603    {
24604        #[inline]
24605        unsafe fn encode(
24606            self,
24607            encoder: &mut fidl::encoding::Encoder<
24608                '_,
24609                fidl::encoding::DefaultFuchsiaResourceDialect,
24610            >,
24611            offset: usize,
24612            _depth: fidl::encoding::Depth,
24613        ) -> fidl::Result<()> {
24614            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
24615            encoder.write_num::<u64>(self.ordinal(), offset);
24616            match self {
24617                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
24618                    fidl::encoding::Vector<u8, 32768>,
24619                    fidl::encoding::DefaultFuchsiaResourceDialect,
24620                >(
24621                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
24622                        val,
24623                    ),
24624                    encoder,
24625                    offset + 8,
24626                    _depth,
24627                ),
24628                ExtendedAttributeValue::Buffer(ref mut val) => {
24629                    fidl::encoding::encode_in_envelope::<
24630                        fidl::encoding::HandleType<
24631                            fidl::Vmo,
24632                            { fidl::ObjectType::VMO.into_raw() },
24633                            2147483648,
24634                        >,
24635                        fidl::encoding::DefaultFuchsiaResourceDialect,
24636                    >(
24637                        <fidl::encoding::HandleType<
24638                            fidl::Vmo,
24639                            { fidl::ObjectType::VMO.into_raw() },
24640                            2147483648,
24641                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
24642                            val
24643                        ),
24644                        encoder,
24645                        offset + 8,
24646                        _depth,
24647                    )
24648                }
24649                ExtendedAttributeValue::__SourceBreaking { .. } => {
24650                    Err(fidl::Error::UnknownUnionTag)
24651                }
24652            }
24653        }
24654    }
24655
24656    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24657        for ExtendedAttributeValue
24658    {
24659        #[inline(always)]
24660        fn new_empty() -> Self {
24661            Self::__SourceBreaking { unknown_ordinal: 0 }
24662        }
24663
24664        #[inline]
24665        unsafe fn decode(
24666            &mut self,
24667            decoder: &mut fidl::encoding::Decoder<
24668                '_,
24669                fidl::encoding::DefaultFuchsiaResourceDialect,
24670            >,
24671            offset: usize,
24672            mut depth: fidl::encoding::Depth,
24673        ) -> fidl::Result<()> {
24674            decoder.debug_check_bounds::<Self>(offset);
24675            #[allow(unused_variables)]
24676            let next_out_of_line = decoder.next_out_of_line();
24677            let handles_before = decoder.remaining_handles();
24678            let (ordinal, inlined, num_bytes, num_handles) =
24679                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24680
24681            let member_inline_size = match ordinal {
24682                1 => {
24683                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
24684                        decoder.context,
24685                    )
24686                }
24687                2 => <fidl::encoding::HandleType<
24688                    fidl::Vmo,
24689                    { fidl::ObjectType::VMO.into_raw() },
24690                    2147483648,
24691                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24692                0 => return Err(fidl::Error::UnknownUnionTag),
24693                _ => num_bytes as usize,
24694            };
24695
24696            if inlined != (member_inline_size <= 4) {
24697                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24698            }
24699            let _inner_offset;
24700            if inlined {
24701                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24702                _inner_offset = offset + 8;
24703            } else {
24704                depth.increment()?;
24705                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24706            }
24707            match ordinal {
24708                1 => {
24709                    #[allow(irrefutable_let_patterns)]
24710                    if let ExtendedAttributeValue::Bytes(_) = self {
24711                        // Do nothing, read the value into the object
24712                    } else {
24713                        // Initialize `self` to the right variant
24714                        *self = ExtendedAttributeValue::Bytes(
24715                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
24716                        );
24717                    }
24718                    #[allow(irrefutable_let_patterns)]
24719                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
24720                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24721                    } else {
24722                        unreachable!()
24723                    }
24724                }
24725                2 => {
24726                    #[allow(irrefutable_let_patterns)]
24727                    if let ExtendedAttributeValue::Buffer(_) = self {
24728                        // Do nothing, read the value into the object
24729                    } else {
24730                        // Initialize `self` to the right variant
24731                        *self = ExtendedAttributeValue::Buffer(
24732                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
24733                        );
24734                    }
24735                    #[allow(irrefutable_let_patterns)]
24736                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
24737                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24738                    } else {
24739                        unreachable!()
24740                    }
24741                }
24742                #[allow(deprecated)]
24743                ordinal => {
24744                    for _ in 0..num_handles {
24745                        decoder.drop_next_handle()?;
24746                    }
24747                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
24748                }
24749            }
24750            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24751                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24752            }
24753            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24754                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24755            }
24756            Ok(())
24757        }
24758    }
24759
24760    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
24761        type Borrowed<'a> = &'a mut Self;
24762        fn take_or_borrow<'a>(
24763            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24764        ) -> Self::Borrowed<'a> {
24765            value
24766        }
24767    }
24768
24769    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
24770        type Owned = Self;
24771
24772        #[inline(always)]
24773        fn inline_align(_context: fidl::encoding::Context) -> usize {
24774            8
24775        }
24776
24777        #[inline(always)]
24778        fn inline_size(_context: fidl::encoding::Context) -> usize {
24779            16
24780        }
24781    }
24782
24783    unsafe impl
24784        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
24785        for &mut NodeInfoDeprecated
24786    {
24787        #[inline]
24788        unsafe fn encode(
24789            self,
24790            encoder: &mut fidl::encoding::Encoder<
24791                '_,
24792                fidl::encoding::DefaultFuchsiaResourceDialect,
24793            >,
24794            offset: usize,
24795            _depth: fidl::encoding::Depth,
24796        ) -> fidl::Result<()> {
24797            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
24798            encoder.write_num::<u64>(self.ordinal(), offset);
24799            match self {
24800                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
24801                    Service,
24802                    fidl::encoding::DefaultFuchsiaResourceDialect,
24803                >(
24804                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
24805                    encoder,
24806                    offset + 8,
24807                    _depth,
24808                ),
24809                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24810                    FileObject,
24811                    fidl::encoding::DefaultFuchsiaResourceDialect,
24812                >(
24813                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24814                    encoder,
24815                    offset + 8,
24816                    _depth,
24817                ),
24818                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24819                    DirectoryObject,
24820                    fidl::encoding::DefaultFuchsiaResourceDialect,
24821                >(
24822                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24823                    encoder,
24824                    offset + 8,
24825                    _depth,
24826                ),
24827                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24828                    SymlinkObject,
24829                    fidl::encoding::DefaultFuchsiaResourceDialect,
24830                >(
24831                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24832                    encoder,
24833                    offset + 8,
24834                    _depth,
24835                ),
24836            }
24837        }
24838    }
24839
24840    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24841        for NodeInfoDeprecated
24842    {
24843        #[inline(always)]
24844        fn new_empty() -> Self {
24845            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
24846        }
24847
24848        #[inline]
24849        unsafe fn decode(
24850            &mut self,
24851            decoder: &mut fidl::encoding::Decoder<
24852                '_,
24853                fidl::encoding::DefaultFuchsiaResourceDialect,
24854            >,
24855            offset: usize,
24856            mut depth: fidl::encoding::Depth,
24857        ) -> fidl::Result<()> {
24858            decoder.debug_check_bounds::<Self>(offset);
24859            #[allow(unused_variables)]
24860            let next_out_of_line = decoder.next_out_of_line();
24861            let handles_before = decoder.remaining_handles();
24862            let (ordinal, inlined, num_bytes, num_handles) =
24863                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24864
24865            let member_inline_size = match ordinal {
24866                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24867                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24868                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24869                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24870                _ => return Err(fidl::Error::UnknownUnionTag),
24871            };
24872
24873            if inlined != (member_inline_size <= 4) {
24874                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24875            }
24876            let _inner_offset;
24877            if inlined {
24878                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24879                _inner_offset = offset + 8;
24880            } else {
24881                depth.increment()?;
24882                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24883            }
24884            match ordinal {
24885                1 => {
24886                    #[allow(irrefutable_let_patterns)]
24887                    if let NodeInfoDeprecated::Service(_) = self {
24888                        // Do nothing, read the value into the object
24889                    } else {
24890                        // Initialize `self` to the right variant
24891                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
24892                            Service,
24893                            fidl::encoding::DefaultFuchsiaResourceDialect
24894                        ));
24895                    }
24896                    #[allow(irrefutable_let_patterns)]
24897                    if let NodeInfoDeprecated::Service(ref mut val) = self {
24898                        fidl::decode!(
24899                            Service,
24900                            fidl::encoding::DefaultFuchsiaResourceDialect,
24901                            val,
24902                            decoder,
24903                            _inner_offset,
24904                            depth
24905                        )?;
24906                    } else {
24907                        unreachable!()
24908                    }
24909                }
24910                2 => {
24911                    #[allow(irrefutable_let_patterns)]
24912                    if let NodeInfoDeprecated::File(_) = self {
24913                        // Do nothing, read the value into the object
24914                    } else {
24915                        // Initialize `self` to the right variant
24916                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
24917                            FileObject,
24918                            fidl::encoding::DefaultFuchsiaResourceDialect
24919                        ));
24920                    }
24921                    #[allow(irrefutable_let_patterns)]
24922                    if let NodeInfoDeprecated::File(ref mut val) = self {
24923                        fidl::decode!(
24924                            FileObject,
24925                            fidl::encoding::DefaultFuchsiaResourceDialect,
24926                            val,
24927                            decoder,
24928                            _inner_offset,
24929                            depth
24930                        )?;
24931                    } else {
24932                        unreachable!()
24933                    }
24934                }
24935                3 => {
24936                    #[allow(irrefutable_let_patterns)]
24937                    if let NodeInfoDeprecated::Directory(_) = self {
24938                        // Do nothing, read the value into the object
24939                    } else {
24940                        // Initialize `self` to the right variant
24941                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
24942                            DirectoryObject,
24943                            fidl::encoding::DefaultFuchsiaResourceDialect
24944                        ));
24945                    }
24946                    #[allow(irrefutable_let_patterns)]
24947                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
24948                        fidl::decode!(
24949                            DirectoryObject,
24950                            fidl::encoding::DefaultFuchsiaResourceDialect,
24951                            val,
24952                            decoder,
24953                            _inner_offset,
24954                            depth
24955                        )?;
24956                    } else {
24957                        unreachable!()
24958                    }
24959                }
24960                4 => {
24961                    #[allow(irrefutable_let_patterns)]
24962                    if let NodeInfoDeprecated::Symlink(_) = self {
24963                        // Do nothing, read the value into the object
24964                    } else {
24965                        // Initialize `self` to the right variant
24966                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
24967                            SymlinkObject,
24968                            fidl::encoding::DefaultFuchsiaResourceDialect
24969                        ));
24970                    }
24971                    #[allow(irrefutable_let_patterns)]
24972                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
24973                        fidl::decode!(
24974                            SymlinkObject,
24975                            fidl::encoding::DefaultFuchsiaResourceDialect,
24976                            val,
24977                            decoder,
24978                            _inner_offset,
24979                            depth
24980                        )?;
24981                    } else {
24982                        unreachable!()
24983                    }
24984                }
24985                ordinal => panic!("unexpected ordinal {:?}", ordinal),
24986            }
24987            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24988                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24989            }
24990            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24991                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24992            }
24993            Ok(())
24994        }
24995    }
24996
24997    impl fidl::encoding::ResourceTypeMarker for Representation {
24998        type Borrowed<'a> = &'a mut Self;
24999        fn take_or_borrow<'a>(
25000            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
25001        ) -> Self::Borrowed<'a> {
25002            value
25003        }
25004    }
25005
25006    unsafe impl fidl::encoding::TypeMarker for Representation {
25007        type Owned = Self;
25008
25009        #[inline(always)]
25010        fn inline_align(_context: fidl::encoding::Context) -> usize {
25011            8
25012        }
25013
25014        #[inline(always)]
25015        fn inline_size(_context: fidl::encoding::Context) -> usize {
25016            16
25017        }
25018    }
25019
25020    unsafe impl
25021        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
25022        for &mut Representation
25023    {
25024        #[inline]
25025        unsafe fn encode(
25026            self,
25027            encoder: &mut fidl::encoding::Encoder<
25028                '_,
25029                fidl::encoding::DefaultFuchsiaResourceDialect,
25030            >,
25031            offset: usize,
25032            _depth: fidl::encoding::Depth,
25033        ) -> fidl::Result<()> {
25034            encoder.debug_check_bounds::<Representation>(offset);
25035            encoder.write_num::<u64>(self.ordinal(), offset);
25036            match self {
25037                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
25038                    NodeInfo,
25039                    fidl::encoding::DefaultFuchsiaResourceDialect,
25040                >(
25041                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
25042                    encoder,
25043                    offset + 8,
25044                    _depth,
25045                ),
25046                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
25047                    DirectoryInfo,
25048                    fidl::encoding::DefaultFuchsiaResourceDialect,
25049                >(
25050                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
25051                    encoder,
25052                    offset + 8,
25053                    _depth,
25054                ),
25055                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
25056                    FileInfo,
25057                    fidl::encoding::DefaultFuchsiaResourceDialect,
25058                >(
25059                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
25060                    encoder,
25061                    offset + 8,
25062                    _depth,
25063                ),
25064                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
25065                    SymlinkInfo,
25066                    fidl::encoding::DefaultFuchsiaResourceDialect,
25067                >(
25068                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
25069                    encoder,
25070                    offset + 8,
25071                    _depth,
25072                ),
25073                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25074            }
25075        }
25076    }
25077
25078    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
25079        for Representation
25080    {
25081        #[inline(always)]
25082        fn new_empty() -> Self {
25083            Self::__SourceBreaking { unknown_ordinal: 0 }
25084        }
25085
25086        #[inline]
25087        unsafe fn decode(
25088            &mut self,
25089            decoder: &mut fidl::encoding::Decoder<
25090                '_,
25091                fidl::encoding::DefaultFuchsiaResourceDialect,
25092            >,
25093            offset: usize,
25094            mut depth: fidl::encoding::Depth,
25095        ) -> fidl::Result<()> {
25096            decoder.debug_check_bounds::<Self>(offset);
25097            #[allow(unused_variables)]
25098            let next_out_of_line = decoder.next_out_of_line();
25099            let handles_before = decoder.remaining_handles();
25100            let (ordinal, inlined, num_bytes, num_handles) =
25101                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25102
25103            let member_inline_size = match ordinal {
25104                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25105                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25106                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25107                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25108                0 => return Err(fidl::Error::UnknownUnionTag),
25109                _ => num_bytes as usize,
25110            };
25111
25112            if inlined != (member_inline_size <= 4) {
25113                return Err(fidl::Error::InvalidInlineBitInEnvelope);
25114            }
25115            let _inner_offset;
25116            if inlined {
25117                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25118                _inner_offset = offset + 8;
25119            } else {
25120                depth.increment()?;
25121                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25122            }
25123            match ordinal {
25124                1 => {
25125                    #[allow(irrefutable_let_patterns)]
25126                    if let Representation::Node(_) = self {
25127                        // Do nothing, read the value into the object
25128                    } else {
25129                        // Initialize `self` to the right variant
25130                        *self = Representation::Node(fidl::new_empty!(
25131                            NodeInfo,
25132                            fidl::encoding::DefaultFuchsiaResourceDialect
25133                        ));
25134                    }
25135                    #[allow(irrefutable_let_patterns)]
25136                    if let Representation::Node(ref mut val) = self {
25137                        fidl::decode!(
25138                            NodeInfo,
25139                            fidl::encoding::DefaultFuchsiaResourceDialect,
25140                            val,
25141                            decoder,
25142                            _inner_offset,
25143                            depth
25144                        )?;
25145                    } else {
25146                        unreachable!()
25147                    }
25148                }
25149                2 => {
25150                    #[allow(irrefutable_let_patterns)]
25151                    if let Representation::Directory(_) = self {
25152                        // Do nothing, read the value into the object
25153                    } else {
25154                        // Initialize `self` to the right variant
25155                        *self = Representation::Directory(fidl::new_empty!(
25156                            DirectoryInfo,
25157                            fidl::encoding::DefaultFuchsiaResourceDialect
25158                        ));
25159                    }
25160                    #[allow(irrefutable_let_patterns)]
25161                    if let Representation::Directory(ref mut val) = self {
25162                        fidl::decode!(
25163                            DirectoryInfo,
25164                            fidl::encoding::DefaultFuchsiaResourceDialect,
25165                            val,
25166                            decoder,
25167                            _inner_offset,
25168                            depth
25169                        )?;
25170                    } else {
25171                        unreachable!()
25172                    }
25173                }
25174                3 => {
25175                    #[allow(irrefutable_let_patterns)]
25176                    if let Representation::File(_) = self {
25177                        // Do nothing, read the value into the object
25178                    } else {
25179                        // Initialize `self` to the right variant
25180                        *self = Representation::File(fidl::new_empty!(
25181                            FileInfo,
25182                            fidl::encoding::DefaultFuchsiaResourceDialect
25183                        ));
25184                    }
25185                    #[allow(irrefutable_let_patterns)]
25186                    if let Representation::File(ref mut val) = self {
25187                        fidl::decode!(
25188                            FileInfo,
25189                            fidl::encoding::DefaultFuchsiaResourceDialect,
25190                            val,
25191                            decoder,
25192                            _inner_offset,
25193                            depth
25194                        )?;
25195                    } else {
25196                        unreachable!()
25197                    }
25198                }
25199                4 => {
25200                    #[allow(irrefutable_let_patterns)]
25201                    if let Representation::Symlink(_) = self {
25202                        // Do nothing, read the value into the object
25203                    } else {
25204                        // Initialize `self` to the right variant
25205                        *self = Representation::Symlink(fidl::new_empty!(
25206                            SymlinkInfo,
25207                            fidl::encoding::DefaultFuchsiaResourceDialect
25208                        ));
25209                    }
25210                    #[allow(irrefutable_let_patterns)]
25211                    if let Representation::Symlink(ref mut val) = self {
25212                        fidl::decode!(
25213                            SymlinkInfo,
25214                            fidl::encoding::DefaultFuchsiaResourceDialect,
25215                            val,
25216                            decoder,
25217                            _inner_offset,
25218                            depth
25219                        )?;
25220                    } else {
25221                        unreachable!()
25222                    }
25223                }
25224                #[allow(deprecated)]
25225                ordinal => {
25226                    for _ in 0..num_handles {
25227                        decoder.drop_next_handle()?;
25228                    }
25229                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
25230                }
25231            }
25232            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25233                return Err(fidl::Error::InvalidNumBytesInEnvelope);
25234            }
25235            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25236                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25237            }
25238            Ok(())
25239        }
25240    }
25241}