Skip to main content

fdomain_fuchsia_io/
fdomain_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 fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_io_common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13/// The type to identify a connection to a node.
14/// It represents a capability: a reference to a node with associated rights.
15pub type Token = fdomain_client::Event;
16
17#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18pub struct DirectoryCreateSymlinkRequest {
19    pub name: String,
20    pub target: Vec<u8>,
21    pub connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
22}
23
24impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
25    for DirectoryCreateSymlinkRequest
26{
27}
28
29#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30pub struct DirectoryDeprecatedGetTokenResponse {
31    pub s: i32,
32    pub token: Option<fdomain_client::NullableHandle>,
33}
34
35impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
36    for DirectoryDeprecatedGetTokenResponse
37{
38}
39
40#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41pub struct DirectoryDeprecatedOpenRequest {
42    pub flags: OpenFlags,
43    pub mode: ModeType,
44    pub path: String,
45    pub object: fdomain_client::fidl::ServerEnd<NodeMarker>,
46}
47
48impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
49    for DirectoryDeprecatedOpenRequest
50{
51}
52
53#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
54pub struct DirectoryLinkRequest {
55    pub src: String,
56    pub dst_parent_token: fdomain_client::NullableHandle,
57    pub dst: String,
58}
59
60impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryLinkRequest {}
61
62#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63pub struct DirectoryRenameRequest {
64    pub src: String,
65    pub dst_parent_token: fdomain_client::Event,
66    pub dst: String,
67}
68
69impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryRenameRequest {}
70
71#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
72pub struct DirectoryWatchRequest {
73    pub mask: WatchMask,
74    pub options: u32,
75    pub watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
76}
77
78impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryWatchRequest {}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81pub struct FileAllocateRequest {
82    pub offset: u64,
83    pub length: u64,
84    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
85    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
86    /// support a particular provided mode bit, or combination of mode bits, an error is
87    /// returned.
88    pub mode: AllocateMode,
89}
90
91impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileAllocateRequest {}
92
93#[derive(Debug, PartialEq)]
94pub struct FileEnableVerityRequest {
95    pub options: VerificationOptions,
96}
97
98impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileEnableVerityRequest {}
99
100#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
101pub struct FileObject {
102    /// An optional event which transmits information about an object's readability
103    /// or writability. This event relays information about the underlying object, not
104    /// the capability granted to client: this event may be signalled "readable" on a
105    /// connection that does not have the capability to read.
106    ///
107    /// The "`FILE_SIGNAL_`" values may be observed on this event.
108    pub event: Option<fdomain_client::Event>,
109    /// A placeholder for future stream support.
110    ///
111    /// Currently, servers are required not to send a handle in this field.
112    pub stream: Option<fdomain_client::Stream>,
113}
114
115impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileObject {}
116
117#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
118pub struct FileGetBackingMemoryResponse {
119    pub vmo: fdomain_client::Vmo,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
123    for FileGetBackingMemoryResponse
124{
125}
126
127#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct LinkableLinkIntoRequest {
129    pub dst_parent_token: fdomain_client::Event,
130    pub dst: String,
131}
132
133impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for LinkableLinkIntoRequest {}
134
135#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
136pub struct NodeListExtendedAttributesRequest {
137    pub iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
138}
139
140impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
141    for NodeListExtendedAttributesRequest
142{
143}
144
145#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct NodeOnOpenRequest {
147    pub s: i32,
148    pub info: Option<Box<NodeInfoDeprecated>>,
149}
150
151impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeOnOpenRequest {}
152
153#[derive(Debug, PartialEq)]
154pub struct NodeSetExtendedAttributeRequest {
155    pub name: Vec<u8>,
156    pub value: ExtendedAttributeValue,
157    /// Specifies the behavior based on the current state of the attribute.
158    pub mode: SetExtendedAttributeMode,
159}
160
161impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
162    for NodeSetExtendedAttributeRequest
163{
164}
165
166#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
167pub struct NodeGetTokenResponse {
168    pub token: fdomain_client::Event,
169}
170
171impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeGetTokenResponse {}
172
173#[derive(Debug, PartialEq)]
174pub struct OpenableOpenRequest {
175    pub path: String,
176    pub flags: Flags,
177    pub options: Options,
178    pub object: fdomain_client::Channel,
179}
180
181impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for OpenableOpenRequest {}
182
183#[derive(Debug, Default, PartialEq)]
184pub struct ConnectionInfo {
185    /// The rights possessed by the current connection. Note: `rights` limits
186    /// the set of operations allowed on the connection, but does not guarantee
187    /// their availability. For example, one may have the [`Rights.EXECUTE`]
188    /// right on a file connection, but the file itself does not have the
189    /// `EXECUTE` ability, and hence cannot be executed. See
190    /// [`ConnectionOptions.rights`].
191    pub rights: Option<Operations>,
192    #[doc(hidden)]
193    pub __source_breaking: fidl::marker::SourceBreaking,
194}
195
196impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {}
197
198/// Auxiliary data for the file representation of a node.
199#[derive(Debug, Default, PartialEq)]
200pub struct FileInfo {
201    /// True if the file is opened in append mode.
202    /// In append mode, the seek offset is moved to the end before every
203    /// write, the two steps performed in an atomic manner.
204    pub is_append: Option<bool>,
205    /// An optional event which transmits information about an object's
206    /// readability or writability. This event relays information about the
207    /// underlying object, not the capability granted to client: this event
208    /// may be signalled "readable" on a connection that does not have
209    /// the capability to read.
210    ///
211    /// This event will be present if the following conditions are met:
212    ///
213    /// - The `available_operations` on the file connection is not empty.
214    /// - The filesystem supports signalling readability/writability events.
215    ///
216    /// The [`FileSignal`] values may be observed on this event.
217    pub observer: Option<fdomain_client::Event>,
218    /// An optional stream object, which can be used to read to and write from
219    /// the file more quickly than with fidl.
220    ///
221    /// The channel for the file *must* be held open while the stream is in use.
222    /// Using a stream object that has outlived the channel it came from may
223    /// result in failures or unexpected results.
224    pub stream: Option<fdomain_client::Stream>,
225    /// Requested attributes for the file. This is only populated if requested.
226    pub attributes: Option<NodeAttributes2>,
227    #[doc(hidden)]
228    pub __source_breaking: fidl::marker::SourceBreaking,
229}
230
231impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileInfo {}
232
233/// The value type for an extended attribute. If the value is less than 32768
234/// bytes, then it is included inline. Values larger than this size are written
235/// into a vmo buffer.
236#[derive(Debug)]
237pub enum ExtendedAttributeValue {
238    Bytes(Vec<u8>),
239    Buffer(fdomain_client::Vmo),
240    #[doc(hidden)]
241    __SourceBreaking {
242        unknown_ordinal: u64,
243    },
244}
245
246/// Pattern that matches an unknown `ExtendedAttributeValue` member.
247#[macro_export]
248macro_rules! ExtendedAttributeValueUnknown {
249    () => {
250        _
251    };
252}
253
254// Custom PartialEq so that unknown variants are not equal to themselves.
255impl PartialEq for ExtendedAttributeValue {
256    fn eq(&self, other: &Self) -> bool {
257        match (self, other) {
258            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
259            (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
260            _ => false,
261        }
262    }
263}
264
265impl ExtendedAttributeValue {
266    #[inline]
267    pub fn ordinal(&self) -> u64 {
268        match *self {
269            Self::Bytes(_) => 1,
270            Self::Buffer(_) => 2,
271            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
272        }
273    }
274
275    #[inline]
276    pub fn unknown_variant_for_testing() -> Self {
277        Self::__SourceBreaking { unknown_ordinal: 0 }
278    }
279
280    #[inline]
281    pub fn is_unknown(&self) -> bool {
282        match self {
283            Self::__SourceBreaking { .. } => true,
284            _ => false,
285        }
286    }
287}
288
289impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ExtendedAttributeValue {}
290
291#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
292pub enum NodeInfoDeprecated {
293    /// No protocol information was supplied by the connection.
294    Service(Service),
295    /// The connection composes [`File`].
296    File(FileObject),
297    /// The connection composes [`Directory`].
298    Directory(DirectoryObject),
299    /// The connection composes ['Symlink'].
300    Symlink(SymlinkObject),
301}
302
303impl NodeInfoDeprecated {
304    #[inline]
305    pub fn ordinal(&self) -> u64 {
306        match *self {
307            Self::Service(_) => 1,
308            Self::File(_) => 2,
309            Self::Directory(_) => 3,
310            Self::Symlink(_) => 4,
311        }
312    }
313}
314
315impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeInfoDeprecated {}
316
317#[derive(Debug)]
318pub enum Representation {
319    /// The [`Node`] protocol was negotiated for this connection.
320    Node(NodeInfo),
321    /// The [`File`] protocol was negotiated for this connection.
322    Directory(DirectoryInfo),
323    /// The [`File`] protocol was negotiated for this connection.
324    File(FileInfo),
325    /// The [`Symlink`] protocol was negotiated for this connection.
326    Symlink(SymlinkInfo),
327    #[doc(hidden)]
328    __SourceBreaking { unknown_ordinal: u64 },
329}
330
331/// Pattern that matches an unknown `Representation` member.
332#[macro_export]
333macro_rules! RepresentationUnknown {
334    () => {
335        _
336    };
337}
338
339// Custom PartialEq so that unknown variants are not equal to themselves.
340impl PartialEq for Representation {
341    fn eq(&self, other: &Self) -> bool {
342        match (self, other) {
343            (Self::Node(x), Self::Node(y)) => *x == *y,
344            (Self::Directory(x), Self::Directory(y)) => *x == *y,
345            (Self::File(x), Self::File(y)) => *x == *y,
346            (Self::Symlink(x), Self::Symlink(y)) => *x == *y,
347            _ => false,
348        }
349    }
350}
351
352impl Representation {
353    #[inline]
354    pub fn ordinal(&self) -> u64 {
355        match *self {
356            Self::Node(_) => 1,
357            Self::Directory(_) => 2,
358            Self::File(_) => 3,
359            Self::Symlink(_) => 4,
360            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
361        }
362    }
363
364    #[inline]
365    pub fn unknown_variant_for_testing() -> Self {
366        Self::__SourceBreaking { unknown_ordinal: 0 }
367    }
368
369    #[inline]
370    pub fn is_unknown(&self) -> bool {
371        match self {
372            Self::__SourceBreaking { .. } => true,
373            _ => false,
374        }
375    }
376}
377
378impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Representation {}
379
380#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
381pub struct AdvisoryLockingMarker;
382
383impl fdomain_client::fidl::ProtocolMarker for AdvisoryLockingMarker {
384    type Proxy = AdvisoryLockingProxy;
385    type RequestStream = AdvisoryLockingRequestStream;
386
387    const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
388}
389pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
390
391pub trait AdvisoryLockingProxyInterface: Send + Sync {
392    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
393        + Send;
394    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
395}
396
397#[derive(Debug, Clone)]
398pub struct AdvisoryLockingProxy {
399    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
400}
401
402impl fdomain_client::fidl::Proxy for AdvisoryLockingProxy {
403    type Protocol = AdvisoryLockingMarker;
404
405    fn from_channel(inner: fdomain_client::Channel) -> Self {
406        Self::new(inner)
407    }
408
409    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
410        self.client.into_channel().map_err(|client| Self { client })
411    }
412
413    fn as_channel(&self) -> &fdomain_client::Channel {
414        self.client.as_channel()
415    }
416}
417
418impl AdvisoryLockingProxy {
419    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
420    pub fn new(channel: fdomain_client::Channel) -> Self {
421        let protocol_name =
422            <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
423        Self { client: fidl::client::Client::new(channel, protocol_name) }
424    }
425
426    /// Get a Stream of events from the remote end of the protocol.
427    ///
428    /// # Panics
429    ///
430    /// Panics if the event stream was already taken.
431    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
432        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
433    }
434
435    /// Acquires an advisory lock on the underlying file.
436    ///
437    /// The lock lasts until either this connection is closed or
438    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
439    /// explicitly.
440    ///
441    /// Advisory locks are purely advisory. They do not prevent actual read or
442    /// write operations from occurring on the file, either through this
443    /// connection or through other connections.
444    ///
445    /// This method requires the following rights:
446    ///
447    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
448    /// * [`Rights.WRITE_BYTES`] if `request.type` is
449    ///   [`AdvisoryLockType.WRITE`].
450    ///
451    /// # Errors
452    ///
453    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
454    ///   example, another connection might hold a conflicting lock type.
455    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
456    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
457    ///   to acquire the given type of lock.
458    pub fn r#advisory_lock(
459        &self,
460        mut request: &AdvisoryLockRequest,
461    ) -> fidl::client::QueryResponseFut<
462        AdvisoryLockingAdvisoryLockResult,
463        fdomain_client::fidl::FDomainResourceDialect,
464    > {
465        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
466    }
467}
468
469impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
470    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
471        AdvisoryLockingAdvisoryLockResult,
472        fdomain_client::fidl::FDomainResourceDialect,
473    >;
474    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
475        fn _decode(
476            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
477        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
478            let _response = fidl::client::decode_transaction_body::<
479                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
480                fdomain_client::fidl::FDomainResourceDialect,
481                0x6ee9c0ad53ec87aa,
482            >(_buf?)?;
483            Ok(_response.map(|x| x))
484        }
485        self.client.send_query_and_decode::<
486            AdvisoryLockingAdvisoryLockRequest,
487            AdvisoryLockingAdvisoryLockResult,
488        >(
489            (request,),
490            0x6ee9c0ad53ec87aa,
491            fidl::encoding::DynamicFlags::empty(),
492            _decode,
493        )
494    }
495}
496
497pub struct AdvisoryLockingEventStream {
498    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
499}
500
501impl std::marker::Unpin for AdvisoryLockingEventStream {}
502
503impl futures::stream::FusedStream for AdvisoryLockingEventStream {
504    fn is_terminated(&self) -> bool {
505        self.event_receiver.is_terminated()
506    }
507}
508
509impl futures::Stream for AdvisoryLockingEventStream {
510    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
511
512    fn poll_next(
513        mut self: std::pin::Pin<&mut Self>,
514        cx: &mut std::task::Context<'_>,
515    ) -> std::task::Poll<Option<Self::Item>> {
516        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
517            &mut self.event_receiver,
518            cx
519        )?) {
520            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
521            None => std::task::Poll::Ready(None),
522        }
523    }
524}
525
526#[derive(Debug)]
527pub enum AdvisoryLockingEvent {}
528
529impl AdvisoryLockingEvent {
530    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
531    fn decode(
532        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
533    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
534        let (bytes, _handles) = buf.split_mut();
535        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
536        debug_assert_eq!(tx_header.tx_id, 0);
537        match tx_header.ordinal {
538            _ => Err(fidl::Error::UnknownOrdinal {
539                ordinal: tx_header.ordinal,
540                protocol_name:
541                    <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
542            }),
543        }
544    }
545}
546
547/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
548pub struct AdvisoryLockingRequestStream {
549    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
550    is_terminated: bool,
551}
552
553impl std::marker::Unpin for AdvisoryLockingRequestStream {}
554
555impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
556    fn is_terminated(&self) -> bool {
557        self.is_terminated
558    }
559}
560
561impl fdomain_client::fidl::RequestStream for AdvisoryLockingRequestStream {
562    type Protocol = AdvisoryLockingMarker;
563    type ControlHandle = AdvisoryLockingControlHandle;
564
565    fn from_channel(channel: fdomain_client::Channel) -> Self {
566        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
567    }
568
569    fn control_handle(&self) -> Self::ControlHandle {
570        AdvisoryLockingControlHandle { inner: self.inner.clone() }
571    }
572
573    fn into_inner(
574        self,
575    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
576    {
577        (self.inner, self.is_terminated)
578    }
579
580    fn from_inner(
581        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
582        is_terminated: bool,
583    ) -> Self {
584        Self { inner, is_terminated }
585    }
586}
587
588impl futures::Stream for AdvisoryLockingRequestStream {
589    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
590
591    fn poll_next(
592        mut self: std::pin::Pin<&mut Self>,
593        cx: &mut std::task::Context<'_>,
594    ) -> std::task::Poll<Option<Self::Item>> {
595        let this = &mut *self;
596        if this.inner.check_shutdown(cx) {
597            this.is_terminated = true;
598            return std::task::Poll::Ready(None);
599        }
600        if this.is_terminated {
601            panic!("polled AdvisoryLockingRequestStream after completion");
602        }
603        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
604            |bytes, handles| {
605                match this.inner.channel().read_etc(cx, bytes, handles) {
606                    std::task::Poll::Ready(Ok(())) => {}
607                    std::task::Poll::Pending => return std::task::Poll::Pending,
608                    std::task::Poll::Ready(Err(None)) => {
609                        this.is_terminated = true;
610                        return std::task::Poll::Ready(None);
611                    }
612                    std::task::Poll::Ready(Err(Some(e))) => {
613                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
614                            e.into(),
615                        ))));
616                    }
617                }
618
619                // A message has been received from the channel
620                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
621
622                std::task::Poll::Ready(Some(match header.ordinal {
623                0x6ee9c0ad53ec87aa => {
624                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
625                    let mut req = fidl::new_empty!(AdvisoryLockingAdvisoryLockRequest, fdomain_client::fidl::FDomainResourceDialect);
626                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
627                    let control_handle = AdvisoryLockingControlHandle {
628                        inner: this.inner.clone(),
629                    };
630                    Ok(AdvisoryLockingRequest::AdvisoryLock {request: req.request,
631
632                        responder: AdvisoryLockingAdvisoryLockResponder {
633                            control_handle: std::mem::ManuallyDrop::new(control_handle),
634                            tx_id: header.tx_id,
635                        },
636                    })
637                }
638                _ => Err(fidl::Error::UnknownOrdinal {
639                    ordinal: header.ordinal,
640                    protocol_name: <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
641                }),
642            }))
643            },
644        )
645    }
646}
647
648/// Advisory locking protocol.
649///
650/// This protocol is intended to be composed into the |File| protocol to
651/// provide support for advisory locking.
652///
653/// Advisory locks are purely advisory. They do not prevent actual read or
654/// write operations from occurring on the file, either through this
655/// connection or through other connections.
656///
657/// These primitives are designed to support the flock() and fcntl(),
658/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
659/// running on Fuchsia expects from other operating systems.
660#[derive(Debug)]
661pub enum AdvisoryLockingRequest {
662    /// Acquires an advisory lock on the underlying file.
663    ///
664    /// The lock lasts until either this connection is closed or
665    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
666    /// explicitly.
667    ///
668    /// Advisory locks are purely advisory. They do not prevent actual read or
669    /// write operations from occurring on the file, either through this
670    /// connection or through other connections.
671    ///
672    /// This method requires the following rights:
673    ///
674    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
675    /// * [`Rights.WRITE_BYTES`] if `request.type` is
676    ///   [`AdvisoryLockType.WRITE`].
677    ///
678    /// # Errors
679    ///
680    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
681    ///   example, another connection might hold a conflicting lock type.
682    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
683    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
684    ///   to acquire the given type of lock.
685    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
686}
687
688impl AdvisoryLockingRequest {
689    #[allow(irrefutable_let_patterns)]
690    pub fn into_advisory_lock(
691        self,
692    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
693        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
694            Some((request, responder))
695        } else {
696            None
697        }
698    }
699
700    /// Name of the method defined in FIDL
701    pub fn method_name(&self) -> &'static str {
702        match *self {
703            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
704        }
705    }
706}
707
708#[derive(Debug, Clone)]
709pub struct AdvisoryLockingControlHandle {
710    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
711}
712
713impl AdvisoryLockingControlHandle {
714    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
715        self.inner.shutdown_with_epitaph(status.into())
716    }
717}
718
719impl fdomain_client::fidl::ControlHandle for AdvisoryLockingControlHandle {
720    fn shutdown(&self) {
721        self.inner.shutdown()
722    }
723
724    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
725        self.inner.shutdown_with_epitaph(status)
726    }
727
728    fn is_closed(&self) -> bool {
729        self.inner.channel().is_closed()
730    }
731    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
732        self.inner.channel().on_closed()
733    }
734}
735
736impl AdvisoryLockingControlHandle {}
737
738#[must_use = "FIDL methods require a response to be sent"]
739#[derive(Debug)]
740pub struct AdvisoryLockingAdvisoryLockResponder {
741    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
742    tx_id: u32,
743}
744
745/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
746/// if the responder is dropped without sending a response, so that the client
747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
748impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
749    fn drop(&mut self) {
750        self.control_handle.shutdown();
751        // Safety: drops once, never accessed again
752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
753    }
754}
755
756impl fdomain_client::fidl::Responder for AdvisoryLockingAdvisoryLockResponder {
757    type ControlHandle = AdvisoryLockingControlHandle;
758
759    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
760        &self.control_handle
761    }
762
763    fn drop_without_shutdown(mut self) {
764        // Safety: drops once, never accessed again due to mem::forget
765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
766        // Prevent Drop from running (which would shut down the channel)
767        std::mem::forget(self);
768    }
769}
770
771impl AdvisoryLockingAdvisoryLockResponder {
772    /// Sends a response to the FIDL transaction.
773    ///
774    /// Sets the channel to shutdown if an error occurs.
775    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
776        let _result = self.send_raw(result);
777        if _result.is_err() {
778            self.control_handle.shutdown();
779        }
780        self.drop_without_shutdown();
781        _result
782    }
783
784    /// Similar to "send" but does not shutdown the channel if an error occurs.
785    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
786        let _result = self.send_raw(result);
787        self.drop_without_shutdown();
788        _result
789    }
790
791    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
792        self.control_handle
793            .inner
794            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
795                result,
796                self.tx_id,
797                0x6ee9c0ad53ec87aa,
798                fidl::encoding::DynamicFlags::empty(),
799            )
800    }
801}
802
803#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
804pub struct DirectoryMarker;
805
806impl fdomain_client::fidl::ProtocolMarker for DirectoryMarker {
807    type Proxy = DirectoryProxy;
808    type RequestStream = DirectoryRequestStream;
809
810    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
811}
812impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryMarker {}
813pub type DirectoryUnlinkResult = Result<(), i32>;
814pub type DirectoryRenameResult = Result<(), i32>;
815pub type DirectoryCreateSymlinkResult = Result<(), i32>;
816
817pub trait DirectoryProxyInterface: Send + Sync {
818    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
819        + Send;
820    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
821    fn r#clone(
822        &self,
823        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
824    ) -> Result<(), fidl::Error>;
825    type CloseResponseFut: std::future::Future<
826            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
827        > + Send;
828    fn r#close(&self) -> Self::CloseResponseFut;
829    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
830    fn r#query(&self) -> Self::QueryResponseFut;
831    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
832        + Send;
833    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
834    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
835    fn r#deprecated_set_attr(
836        &self,
837        flags: NodeAttributeFlags,
838        attributes: &NodeAttributes,
839    ) -> Self::DeprecatedSetAttrResponseFut;
840    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
841        + Send;
842    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
843    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
844        + Send;
845    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
846    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
847        + Send;
848    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
849    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
850        + Send;
851    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
852    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
853        + Send;
854    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
855    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
856        + Send;
857    fn r#get_token(&self) -> Self::GetTokenResponseFut;
858    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
859        + Send;
860    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
861    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
862        + Send;
863    fn r#update_attributes(
864        &self,
865        payload: &MutableNodeAttributes,
866    ) -> Self::UpdateAttributesResponseFut;
867    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
868    fn r#sync(&self) -> Self::SyncResponseFut;
869    fn r#list_extended_attributes(
870        &self,
871        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
872    ) -> Result<(), fidl::Error>;
873    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
874        + Send;
875    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
876    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
877        + Send;
878    fn r#set_extended_attribute(
879        &self,
880        name: &[u8],
881        value: ExtendedAttributeValue,
882        mode: SetExtendedAttributeMode,
883    ) -> Self::SetExtendedAttributeResponseFut;
884    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
885        + Send;
886    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
887    fn r#open(
888        &self,
889        path: &str,
890        flags: Flags,
891        options: &Options,
892        object: fdomain_client::Channel,
893    ) -> Result<(), fidl::Error>;
894    fn r#deprecated_open(
895        &self,
896        flags: OpenFlags,
897        mode: ModeType,
898        path: &str,
899        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
900    ) -> Result<(), fidl::Error>;
901    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
902        + Send;
903    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
904    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
905    fn r#rewind(&self) -> Self::RewindResponseFut;
906    type DeprecatedGetTokenResponseFut: std::future::Future<
907            Output = Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error>,
908        > + Send;
909    fn r#deprecated_get_token(&self) -> Self::DeprecatedGetTokenResponseFut;
910    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
911    fn r#link(
912        &self,
913        src: &str,
914        dst_parent_token: fdomain_client::NullableHandle,
915        dst: &str,
916    ) -> Self::LinkResponseFut;
917    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
918        + Send;
919    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
920    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
921        + Send;
922    fn r#rename(
923        &self,
924        src: &str,
925        dst_parent_token: fdomain_client::Event,
926        dst: &str,
927    ) -> Self::RenameResponseFut;
928    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
929        + Send;
930    fn r#create_symlink(
931        &self,
932        name: &str,
933        target: &[u8],
934        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
935    ) -> Self::CreateSymlinkResponseFut;
936    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
937    fn r#watch(
938        &self,
939        mask: WatchMask,
940        options: u32,
941        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
942    ) -> Self::WatchResponseFut;
943}
944
945#[derive(Debug, Clone)]
946pub struct DirectoryProxy {
947    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
948}
949
950impl fdomain_client::fidl::Proxy for DirectoryProxy {
951    type Protocol = DirectoryMarker;
952
953    fn from_channel(inner: fdomain_client::Channel) -> Self {
954        Self::new(inner)
955    }
956
957    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
958        self.client.into_channel().map_err(|client| Self { client })
959    }
960
961    fn as_channel(&self) -> &fdomain_client::Channel {
962        self.client.as_channel()
963    }
964}
965
966impl DirectoryProxy {
967    /// Create a new Proxy for fuchsia.io/Directory.
968    pub fn new(channel: fdomain_client::Channel) -> Self {
969        let protocol_name = <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
970        Self { client: fidl::client::Client::new(channel, protocol_name) }
971    }
972
973    /// Get a Stream of events from the remote end of the protocol.
974    ///
975    /// # Panics
976    ///
977    /// Panics if the event stream was already taken.
978    pub fn take_event_stream(&self) -> DirectoryEventStream {
979        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
980    }
981
982    /// Acquires an advisory lock on the underlying file.
983    ///
984    /// The lock lasts until either this connection is closed or
985    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
986    /// explicitly.
987    ///
988    /// Advisory locks are purely advisory. They do not prevent actual read or
989    /// write operations from occurring on the file, either through this
990    /// connection or through other connections.
991    ///
992    /// This method requires the following rights:
993    ///
994    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
995    /// * [`Rights.WRITE_BYTES`] if `request.type` is
996    ///   [`AdvisoryLockType.WRITE`].
997    ///
998    /// # Errors
999    ///
1000    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1001    ///   example, another connection might hold a conflicting lock type.
1002    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1003    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1004    ///   to acquire the given type of lock.
1005    pub fn r#advisory_lock(
1006        &self,
1007        mut request: &AdvisoryLockRequest,
1008    ) -> fidl::client::QueryResponseFut<
1009        AdvisoryLockingAdvisoryLockResult,
1010        fdomain_client::fidl::FDomainResourceDialect,
1011    > {
1012        DirectoryProxyInterface::r#advisory_lock(self, request)
1013    }
1014
1015    pub fn r#clone(
1016        &self,
1017        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1018    ) -> Result<(), fidl::Error> {
1019        DirectoryProxyInterface::r#clone(self, request)
1020    }
1021
1022    /// Terminates the connection.
1023    ///
1024    /// After calling `Close`, the client must not send any other requests.
1025    ///
1026    /// Servers, after sending the status response, should close the connection
1027    /// regardless of status and without sending an epitaph.
1028    ///
1029    /// Closing the client end of the channel should be semantically equivalent
1030    /// to calling `Close` without knowing when the close has completed or its
1031    /// status.
1032    pub fn r#close(
1033        &self,
1034    ) -> fidl::client::QueryResponseFut<
1035        fdomain_fuchsia_unknown::CloseableCloseResult,
1036        fdomain_client::fidl::FDomainResourceDialect,
1037    > {
1038        DirectoryProxyInterface::r#close(self)
1039    }
1040
1041    pub fn r#query(
1042        &self,
1043    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
1044        DirectoryProxyInterface::r#query(self)
1045    }
1046
1047    /// DEPRECATED - Use `Node.GetAttributes` instead.
1048    ///
1049    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1050    pub fn r#deprecated_get_attr(
1051        &self,
1052    ) -> fidl::client::QueryResponseFut<
1053        (i32, NodeAttributes),
1054        fdomain_client::fidl::FDomainResourceDialect,
1055    > {
1056        DirectoryProxyInterface::r#deprecated_get_attr(self)
1057    }
1058
1059    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1060    pub fn r#deprecated_set_attr(
1061        &self,
1062        mut flags: NodeAttributeFlags,
1063        mut attributes: &NodeAttributes,
1064    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1065        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1066    }
1067
1068    /// [DEPRECATED - Use new GetFlags method instead.]
1069    pub fn r#deprecated_get_flags(
1070        &self,
1071    ) -> fidl::client::QueryResponseFut<
1072        (i32, OpenFlags),
1073        fdomain_client::fidl::FDomainResourceDialect,
1074    > {
1075        DirectoryProxyInterface::r#deprecated_get_flags(self)
1076    }
1077
1078    /// [DEPRECATED - Use new SetFlags method instead.]
1079    pub fn r#deprecated_set_flags(
1080        &self,
1081        mut flags: OpenFlags,
1082    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1083        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1084    }
1085
1086    /// Queries the flags that apply to this node after it has been opened/created. This method does
1087    /// not require any rights.
1088    ///
1089    /// Note that the final set of flags that apply to the connection may differ from those
1090    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1091    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1092    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1093    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1094    pub fn r#get_flags(
1095        &self,
1096    ) -> fidl::client::QueryResponseFut<
1097        NodeGetFlagsResult,
1098        fdomain_client::fidl::FDomainResourceDialect,
1099    > {
1100        DirectoryProxyInterface::r#get_flags(self)
1101    }
1102
1103    /// Sets the flags that apply to this node after it has been opened. This method does not
1104    /// require any rights.
1105    ///
1106    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1107    /// clear append mode.
1108    ///
1109    /// Errors:
1110    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1111    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1112    pub fn r#set_flags(
1113        &self,
1114        mut flags: Flags,
1115    ) -> fidl::client::QueryResponseFut<
1116        NodeSetFlagsResult,
1117        fdomain_client::fidl::FDomainResourceDialect,
1118    > {
1119        DirectoryProxyInterface::r#set_flags(self, flags)
1120    }
1121
1122    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1123    /// volume has different settings or the storage is accounted seperately from the rest of the
1124    /// filesystem that may be reported instead of filesystem-wide details.
1125    pub fn r#query_filesystem(
1126        &self,
1127    ) -> fidl::client::QueryResponseFut<
1128        (i32, Option<Box<FilesystemInfo>>),
1129        fdomain_client::fidl::FDomainResourceDialect,
1130    > {
1131        DirectoryProxyInterface::r#query_filesystem(self)
1132    }
1133
1134    /// Acquires a token which can be used to identify this connection at a later point in
1135    /// time. The token will remain valid for as long as the connection requesting the token
1136    /// remains open.
1137    ///
1138    /// This method does not require any rights. Note that the token identifies
1139    /// the connection, hence carries the rights information on this connection.
1140    pub fn r#get_token(
1141        &self,
1142    ) -> fidl::client::QueryResponseFut<
1143        NodeGetTokenResult,
1144        fdomain_client::fidl::FDomainResourceDialect,
1145    > {
1146        DirectoryProxyInterface::r#get_token(self)
1147    }
1148
1149    /// Acquires information about the node.
1150    ///
1151    /// The attributes of a node should be stable, independent of the
1152    /// specific protocol used to access it.
1153    ///
1154    /// If a particular attribute is not applicable or not supported,
1155    /// filesystems should leave the corresponding field absent.
1156    ///
1157    /// + `query` a bit-mask specifying which attributes to fetch. The server
1158    ///   should not return more than necessary.
1159    /// - `attributes` the returned attributes.
1160    ///
1161    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1162    pub fn r#get_attributes(
1163        &self,
1164        mut query: NodeAttributesQuery,
1165    ) -> fidl::client::QueryResponseFut<
1166        NodeGetAttributesResult,
1167        fdomain_client::fidl::FDomainResourceDialect,
1168    > {
1169        DirectoryProxyInterface::r#get_attributes(self, query)
1170    }
1171
1172    /// Updates information about the node.
1173    ///
1174    /// + `attributes` the presence of a table field in `attributes` indicates
1175    /// the intent to update the corresponding attribute.
1176    ///
1177    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1178    ///
1179    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1180    pub fn r#update_attributes(
1181        &self,
1182        mut payload: &MutableNodeAttributes,
1183    ) -> fidl::client::QueryResponseFut<
1184        NodeUpdateAttributesResult,
1185        fdomain_client::fidl::FDomainResourceDialect,
1186    > {
1187        DirectoryProxyInterface::r#update_attributes(self, payload)
1188    }
1189
1190    /// Synchronizes updates to the node to the underlying media, if it exists.
1191    ///
1192    /// This method will return when the filesystem server has flushed the
1193    /// relevant updates to the underlying media, but does not guarantee the
1194    /// underlying media has persisted the information, nor that any information
1195    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1196    /// between operations.
1197    ///
1198    /// This method does not require any rights.
1199    pub fn r#sync(
1200        &self,
1201    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
1202    {
1203        DirectoryProxyInterface::r#sync(self)
1204    }
1205
1206    /// Creates an iterator over all the extended attribute names associated
1207    /// with this node. If an error occurs it is returned as an epitaph on the
1208    /// iterator request channel, and then the channel is closed.
1209    ///
1210    /// GetExtendedAttributes can be used with any of these names to retrieve
1211    /// the associated value.
1212    ///
1213    /// This method requires the [`Rights.READ_BYTES`] right.
1214    pub fn r#list_extended_attributes(
1215        &self,
1216        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1217    ) -> Result<(), fidl::Error> {
1218        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
1219    }
1220
1221    /// Get the value associated with the given attribute `name` for this node.
1222    ///
1223    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1224    /// particular structure is imposed on them.
1225    ///
1226    /// This method requires the [`Rights.READ_BYTES`] right.
1227    pub fn r#get_extended_attribute(
1228        &self,
1229        mut name: &[u8],
1230    ) -> fidl::client::QueryResponseFut<
1231        NodeGetExtendedAttributeResult,
1232        fdomain_client::fidl::FDomainResourceDialect,
1233    > {
1234        DirectoryProxyInterface::r#get_extended_attribute(self, name)
1235    }
1236
1237    /// Set the value for the given attribute `name` to `value` for this node.
1238    ///
1239    /// The attribute name may exist, in which case the attribute is updated.
1240    /// If the attribute doesn't exist, it is created. The name should have no
1241    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1242    ///
1243    /// This method requires the [`Rights.WRITE_BYTES`] right.
1244    pub fn r#set_extended_attribute(
1245        &self,
1246        mut name: &[u8],
1247        mut value: ExtendedAttributeValue,
1248        mut mode: SetExtendedAttributeMode,
1249    ) -> fidl::client::QueryResponseFut<
1250        NodeSetExtendedAttributeResult,
1251        fdomain_client::fidl::FDomainResourceDialect,
1252    > {
1253        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
1254    }
1255
1256    /// Remove the specified extended attribute.
1257    ///
1258    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1259    ///
1260    /// This method requires the [`Rights.WRITE_BYTES`] right.
1261    pub fn r#remove_extended_attribute(
1262        &self,
1263        mut name: &[u8],
1264    ) -> fidl::client::QueryResponseFut<
1265        NodeRemoveExtendedAttributeResult,
1266        fdomain_client::fidl::FDomainResourceDialect,
1267    > {
1268        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
1269    }
1270
1271    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1272    /// epitaph sent on the `object` channel.
1273    ///
1274    /// Errors:
1275    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1276    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1277    pub fn r#open(
1278        &self,
1279        mut path: &str,
1280        mut flags: Flags,
1281        mut options: &Options,
1282        mut object: fdomain_client::Channel,
1283    ) -> Result<(), fidl::Error> {
1284        DirectoryProxyInterface::r#open(self, path, flags, options, object)
1285    }
1286
1287    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1288    pub fn r#deprecated_open(
1289        &self,
1290        mut flags: OpenFlags,
1291        mut mode: ModeType,
1292        mut path: &str,
1293        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1294    ) -> Result<(), fidl::Error> {
1295        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
1296    }
1297
1298    /// Reads a collection of variably sized dirents into a buffer.
1299    /// The number of dirents in a directory may be very large: akin to
1300    /// calling read multiple times on a file, directories have a seek
1301    /// offset which is updated on subsequent calls to ReadDirents.
1302    /// Each call to ReadDirents will only return whole dirent structures,
1303    /// they will not get split across ReadDirent calls. When the seek
1304    /// offset reaches the end, `dirents` will be empty.
1305    ///
1306    /// These dirents are of the form:
1307    /// ```
1308    /// struct dirent {
1309    ///   // Describes the inode of the entry.
1310    ///   uint64 ino;
1311    ///   // Describes the length of the dirent name in bytes.
1312    ///   uint8 size;
1313    ///   // Describes the type of the entry. Aligned with the
1314    ///   // POSIX d_type values. Use `DirentType` constants.
1315    ///   uint8 type;
1316    ///   // Unterminated name of entry.
1317    ///   char name[0];
1318    /// }
1319    /// ```
1320    ///
1321    /// This method requires the following rights:
1322    ///
1323    /// * [`Rights.ENUMERATE`]
1324    pub fn r#read_dirents(
1325        &self,
1326        mut max_bytes: u64,
1327    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fdomain_client::fidl::FDomainResourceDialect>
1328    {
1329        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
1330    }
1331
1332    /// Resets the directory seek offset.
1333    ///
1334    /// This method requires the following rights:
1335    ///
1336    /// * [`Rights.ENUMERATE`]
1337    pub fn r#rewind(
1338        &self,
1339    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1340        DirectoryProxyInterface::r#rewind(self)
1341    }
1342
1343    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1344    /// in time. The token will remain valid for as long as the connection requesting the token
1345    /// remains open.
1346    ///
1347    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1348    /// `ZX_ERR_BAD_HANDLE`.
1349    ///
1350    /// This method is deprecated: use `fuchsia.io/Node.GetToken` instead (once it is added).
1351    pub fn r#deprecated_get_token(
1352        &self,
1353    ) -> fidl::client::QueryResponseFut<
1354        (i32, Option<fdomain_client::NullableHandle>),
1355        fdomain_client::fidl::FDomainResourceDialect,
1356    > {
1357        DirectoryProxyInterface::r#deprecated_get_token(self)
1358    }
1359
1360    /// Creates a link to an object named src by the name dst, within a directory represented by
1361    /// token.
1362    ///
1363    /// `src` must be a resolved object name. Including "/" in the string will
1364    /// return `ZX_ERR_INVALID_ARGS`.
1365    ///
1366    /// `dst` must be a resolved object name. Including "/" in the string will
1367    /// return `ZX_ERR_INVALID_ARGS`.
1368    ///
1369    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1370    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1371    ///
1372    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1373    /// there are two actors operating concurrently, and one actor performs a rename that affects
1374    /// the source within this directory, and the other does a link, each will appear to occur
1375    /// atomically in an unspecified order.
1376    pub fn r#link(
1377        &self,
1378        mut src: &str,
1379        mut dst_parent_token: fdomain_client::NullableHandle,
1380        mut dst: &str,
1381    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1382        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
1383    }
1384
1385    /// Removes a child node from the this directory's list of entries.
1386    ///
1387    /// Note: this does not guarantee that the underlying object is destroyed.
1388    /// Although the link will be removed from the containing directory,
1389    /// objects with multiple references (such as files which are still open)
1390    /// will not actually be destroyed until all references are closed.
1391    ///
1392    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1393    ///   [`Rights.WRITE_BYTES`].
1394    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1395    ///   support writing.
1396    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1397    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1398    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1399    ///   containing a remote channel.
1400    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1401    ///     something other than a directory was found.
1402    ///
1403    /// Other errors may be returned for filesystem-specific reasons.
1404    ///
1405    /// This method requires the following rights:
1406    ///
1407    /// * [`Rights.ENUMERATE`]
1408    /// * [`Rights.MODIFY_DIRECTORY`]
1409    pub fn r#unlink(
1410        &self,
1411        mut name: &str,
1412        mut options: &UnlinkOptions,
1413    ) -> fidl::client::QueryResponseFut<
1414        DirectoryUnlinkResult,
1415        fdomain_client::fidl::FDomainResourceDialect,
1416    > {
1417        DirectoryProxyInterface::r#unlink(self, name, options)
1418    }
1419
1420    /// Renames a node named `src` to the name `dst`, in a directory represented
1421    /// by `dst_parent_token`.
1422    ///
1423    /// `src` and `dst` must be valid node names.
1424    /// See [`Name`] for what constitutes a valid name.
1425    ///
1426    /// This method requires the following rights on both the current connection, and the connection
1427    /// identified by `dst_parent_token`:
1428    ///
1429    /// * [`Rights.ENUMERATE`]
1430    /// * [`Rights.MODIFY_DIRECTORY`]
1431    ///
1432    /// The following requirements are necessary to avoid rights escalations.
1433    ///
1434    /// If the source and destination directory differ, the source directory must also have the
1435    /// maximal set of abilities supported for files, which would typically be
1436    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1437    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1438    /// right.
1439    ///
1440    /// If `src` refers to a directory, and differs from the destination directory, then the source
1441    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1442    ///
1443    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1444    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1445    pub fn r#rename(
1446        &self,
1447        mut src: &str,
1448        mut dst_parent_token: fdomain_client::Event,
1449        mut dst: &str,
1450    ) -> fidl::client::QueryResponseFut<
1451        DirectoryRenameResult,
1452        fdomain_client::fidl::FDomainResourceDialect,
1453    > {
1454        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
1455    }
1456
1457    /// Creates a symbolic link.
1458    ///
1459    /// `name` is the name to be given to the created symbolic link.
1460    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1461    /// will perform no validation of `target` except for a server chosen maximum length.
1462    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1463    /// on the successfully created node.
1464    ///
1465    /// * [`Rights.MODIFY_DIRECTORY`]
1466    ///
1467    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1468    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1469    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1470    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1471    pub fn r#create_symlink(
1472        &self,
1473        mut name: &str,
1474        mut target: &[u8],
1475        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
1476    ) -> fidl::client::QueryResponseFut<
1477        DirectoryCreateSymlinkResult,
1478        fdomain_client::fidl::FDomainResourceDialect,
1479    > {
1480        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
1481    }
1482
1483    /// Watches a directory, receiving events of added messages on the
1484    /// watcher request channel.
1485    ///
1486    /// Options must be zero; it is reserved.
1487    ///
1488    /// This method requires the following rights:
1489    ///
1490    /// * [`Rights.ENUMERATE`]
1491    pub fn r#watch(
1492        &self,
1493        mut mask: WatchMask,
1494        mut options: u32,
1495        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
1496    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1497        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
1498    }
1499}
1500
1501impl DirectoryProxyInterface for DirectoryProxy {
1502    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
1503        AdvisoryLockingAdvisoryLockResult,
1504        fdomain_client::fidl::FDomainResourceDialect,
1505    >;
1506    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
1507        fn _decode(
1508            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1509        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1510            let _response = fidl::client::decode_transaction_body::<
1511                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1512                fdomain_client::fidl::FDomainResourceDialect,
1513                0x6ee9c0ad53ec87aa,
1514            >(_buf?)?;
1515            Ok(_response.map(|x| x))
1516        }
1517        self.client.send_query_and_decode::<
1518            AdvisoryLockingAdvisoryLockRequest,
1519            AdvisoryLockingAdvisoryLockResult,
1520        >(
1521            (request,),
1522            0x6ee9c0ad53ec87aa,
1523            fidl::encoding::DynamicFlags::empty(),
1524            _decode,
1525        )
1526    }
1527
1528    fn r#clone(
1529        &self,
1530        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1531    ) -> Result<(), fidl::Error> {
1532        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
1533            (request,),
1534            0x20d8a7aba2168a79,
1535            fidl::encoding::DynamicFlags::empty(),
1536        )
1537    }
1538
1539    type CloseResponseFut = fidl::client::QueryResponseFut<
1540        fdomain_fuchsia_unknown::CloseableCloseResult,
1541        fdomain_client::fidl::FDomainResourceDialect,
1542    >;
1543    fn r#close(&self) -> Self::CloseResponseFut {
1544        fn _decode(
1545            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1546        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1547            let _response = fidl::client::decode_transaction_body::<
1548                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1549                fdomain_client::fidl::FDomainResourceDialect,
1550                0x5ac5d459ad7f657e,
1551            >(_buf?)?;
1552            Ok(_response.map(|x| x))
1553        }
1554        self.client.send_query_and_decode::<
1555            fidl::encoding::EmptyPayload,
1556            fdomain_fuchsia_unknown::CloseableCloseResult,
1557        >(
1558            (),
1559            0x5ac5d459ad7f657e,
1560            fidl::encoding::DynamicFlags::empty(),
1561            _decode,
1562        )
1563    }
1564
1565    type QueryResponseFut =
1566        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
1567    fn r#query(&self) -> Self::QueryResponseFut {
1568        fn _decode(
1569            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1570        ) -> Result<Vec<u8>, fidl::Error> {
1571            let _response = fidl::client::decode_transaction_body::<
1572                fdomain_fuchsia_unknown::QueryableQueryResponse,
1573                fdomain_client::fidl::FDomainResourceDialect,
1574                0x2658edee9decfc06,
1575            >(_buf?)?;
1576            Ok(_response.protocol)
1577        }
1578        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
1579            (),
1580            0x2658edee9decfc06,
1581            fidl::encoding::DynamicFlags::empty(),
1582            _decode,
1583        )
1584    }
1585
1586    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
1587        (i32, NodeAttributes),
1588        fdomain_client::fidl::FDomainResourceDialect,
1589    >;
1590    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
1591        fn _decode(
1592            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1593        ) -> Result<(i32, NodeAttributes), fidl::Error> {
1594            let _response = fidl::client::decode_transaction_body::<
1595                NodeDeprecatedGetAttrResponse,
1596                fdomain_client::fidl::FDomainResourceDialect,
1597                0x78985e216314dafd,
1598            >(_buf?)?;
1599            Ok((_response.s, _response.attributes))
1600        }
1601        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
1602            (),
1603            0x78985e216314dafd,
1604            fidl::encoding::DynamicFlags::empty(),
1605            _decode,
1606        )
1607    }
1608
1609    type DeprecatedSetAttrResponseFut =
1610        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1611    fn r#deprecated_set_attr(
1612        &self,
1613        mut flags: NodeAttributeFlags,
1614        mut attributes: &NodeAttributes,
1615    ) -> Self::DeprecatedSetAttrResponseFut {
1616        fn _decode(
1617            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1618        ) -> Result<i32, fidl::Error> {
1619            let _response = fidl::client::decode_transaction_body::<
1620                NodeDeprecatedSetAttrResponse,
1621                fdomain_client::fidl::FDomainResourceDialect,
1622                0x4186c0f40d938f46,
1623            >(_buf?)?;
1624            Ok(_response.s)
1625        }
1626        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
1627            (flags, attributes),
1628            0x4186c0f40d938f46,
1629            fidl::encoding::DynamicFlags::empty(),
1630            _decode,
1631        )
1632    }
1633
1634    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
1635        (i32, OpenFlags),
1636        fdomain_client::fidl::FDomainResourceDialect,
1637    >;
1638    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
1639        fn _decode(
1640            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1641        ) -> Result<(i32, OpenFlags), fidl::Error> {
1642            let _response = fidl::client::decode_transaction_body::<
1643                NodeDeprecatedGetFlagsResponse,
1644                fdomain_client::fidl::FDomainResourceDialect,
1645                0x5b88fffb8eda3aa1,
1646            >(_buf?)?;
1647            Ok((_response.s, _response.flags))
1648        }
1649        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
1650            (),
1651            0x5b88fffb8eda3aa1,
1652            fidl::encoding::DynamicFlags::empty(),
1653            _decode,
1654        )
1655    }
1656
1657    type DeprecatedSetFlagsResponseFut =
1658        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1659    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
1660        fn _decode(
1661            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1662        ) -> Result<i32, fidl::Error> {
1663            let _response = fidl::client::decode_transaction_body::<
1664                NodeDeprecatedSetFlagsResponse,
1665                fdomain_client::fidl::FDomainResourceDialect,
1666                0x5295b76c71fde733,
1667            >(_buf?)?;
1668            Ok(_response.s)
1669        }
1670        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
1671            (flags,),
1672            0x5295b76c71fde733,
1673            fidl::encoding::DynamicFlags::empty(),
1674            _decode,
1675        )
1676    }
1677
1678    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
1679        NodeGetFlagsResult,
1680        fdomain_client::fidl::FDomainResourceDialect,
1681    >;
1682    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
1683        fn _decode(
1684            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1685        ) -> Result<NodeGetFlagsResult, fidl::Error> {
1686            let _response = fidl::client::decode_transaction_body::<
1687                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1688                fdomain_client::fidl::FDomainResourceDialect,
1689                0x176eb318f64ec23,
1690            >(_buf?)?
1691            .into_result_fdomain::<DirectoryMarker>("get_flags")?;
1692            Ok(_response.map(|x| x.flags))
1693        }
1694        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
1695            (),
1696            0x176eb318f64ec23,
1697            fidl::encoding::DynamicFlags::FLEXIBLE,
1698            _decode,
1699        )
1700    }
1701
1702    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
1703        NodeSetFlagsResult,
1704        fdomain_client::fidl::FDomainResourceDialect,
1705    >;
1706    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
1707        fn _decode(
1708            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1709        ) -> Result<NodeSetFlagsResult, fidl::Error> {
1710            let _response = fidl::client::decode_transaction_body::<
1711                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1712                fdomain_client::fidl::FDomainResourceDialect,
1713                0x55a8028685791ea8,
1714            >(_buf?)?
1715            .into_result_fdomain::<DirectoryMarker>("set_flags")?;
1716            Ok(_response.map(|x| x))
1717        }
1718        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
1719            (flags,),
1720            0x55a8028685791ea8,
1721            fidl::encoding::DynamicFlags::FLEXIBLE,
1722            _decode,
1723        )
1724    }
1725
1726    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
1727        (i32, Option<Box<FilesystemInfo>>),
1728        fdomain_client::fidl::FDomainResourceDialect,
1729    >;
1730    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
1731        fn _decode(
1732            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1733        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1734            let _response = fidl::client::decode_transaction_body::<
1735                NodeQueryFilesystemResponse,
1736                fdomain_client::fidl::FDomainResourceDialect,
1737                0x6f344a1c6b0a0610,
1738            >(_buf?)?;
1739            Ok((_response.s, _response.info))
1740        }
1741        self.client.send_query_and_decode::<
1742            fidl::encoding::EmptyPayload,
1743            (i32, Option<Box<FilesystemInfo>>),
1744        >(
1745            (),
1746            0x6f344a1c6b0a0610,
1747            fidl::encoding::DynamicFlags::empty(),
1748            _decode,
1749        )
1750    }
1751
1752    type GetTokenResponseFut = fidl::client::QueryResponseFut<
1753        NodeGetTokenResult,
1754        fdomain_client::fidl::FDomainResourceDialect,
1755    >;
1756    fn r#get_token(&self) -> Self::GetTokenResponseFut {
1757        fn _decode(
1758            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1759        ) -> Result<NodeGetTokenResult, fidl::Error> {
1760            let _response = fidl::client::decode_transaction_body::<
1761                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
1762                fdomain_client::fidl::FDomainResourceDialect,
1763                0x5054f0ade7076cec,
1764            >(_buf?)?
1765            .into_result_fdomain::<DirectoryMarker>("get_token")?;
1766            Ok(_response.map(|x| x.token))
1767        }
1768        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
1769            (),
1770            0x5054f0ade7076cec,
1771            fidl::encoding::DynamicFlags::FLEXIBLE,
1772            _decode,
1773        )
1774    }
1775
1776    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
1777        NodeGetAttributesResult,
1778        fdomain_client::fidl::FDomainResourceDialect,
1779    >;
1780    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
1781        fn _decode(
1782            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1783        ) -> Result<NodeGetAttributesResult, fidl::Error> {
1784            let _response = fidl::client::decode_transaction_body::<
1785                fidl::encoding::ResultType<NodeAttributes2, i32>,
1786                fdomain_client::fidl::FDomainResourceDialect,
1787                0x3d4396a638ea053b,
1788            >(_buf?)?;
1789            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1790        }
1791        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
1792            (query,),
1793            0x3d4396a638ea053b,
1794            fidl::encoding::DynamicFlags::empty(),
1795            _decode,
1796        )
1797    }
1798
1799    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
1800        NodeUpdateAttributesResult,
1801        fdomain_client::fidl::FDomainResourceDialect,
1802    >;
1803    fn r#update_attributes(
1804        &self,
1805        mut payload: &MutableNodeAttributes,
1806    ) -> Self::UpdateAttributesResponseFut {
1807        fn _decode(
1808            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1809        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1810            let _response = fidl::client::decode_transaction_body::<
1811                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1812                fdomain_client::fidl::FDomainResourceDialect,
1813                0x3308c1da5a89bf08,
1814            >(_buf?)?;
1815            Ok(_response.map(|x| x))
1816        }
1817        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
1818            payload,
1819            0x3308c1da5a89bf08,
1820            fidl::encoding::DynamicFlags::empty(),
1821            _decode,
1822        )
1823    }
1824
1825    type SyncResponseFut = fidl::client::QueryResponseFut<
1826        NodeSyncResult,
1827        fdomain_client::fidl::FDomainResourceDialect,
1828    >;
1829    fn r#sync(&self) -> Self::SyncResponseFut {
1830        fn _decode(
1831            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1832        ) -> Result<NodeSyncResult, fidl::Error> {
1833            let _response = fidl::client::decode_transaction_body::<
1834                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1835                fdomain_client::fidl::FDomainResourceDialect,
1836                0x2c5c27ca0ab5dc49,
1837            >(_buf?)?;
1838            Ok(_response.map(|x| x))
1839        }
1840        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
1841            (),
1842            0x2c5c27ca0ab5dc49,
1843            fidl::encoding::DynamicFlags::empty(),
1844            _decode,
1845        )
1846    }
1847
1848    fn r#list_extended_attributes(
1849        &self,
1850        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1851    ) -> Result<(), fidl::Error> {
1852        self.client.send::<NodeListExtendedAttributesRequest>(
1853            (iterator,),
1854            0x4b61033de007fcd0,
1855            fidl::encoding::DynamicFlags::empty(),
1856        )
1857    }
1858
1859    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1860        NodeGetExtendedAttributeResult,
1861        fdomain_client::fidl::FDomainResourceDialect,
1862    >;
1863    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
1864        fn _decode(
1865            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1866        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1867            let _response = fidl::client::decode_transaction_body::<
1868                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1869                fdomain_client::fidl::FDomainResourceDialect,
1870                0x45ffa3ccfdeb76db,
1871            >(_buf?)?;
1872            Ok(_response.map(|x| x))
1873        }
1874        self.client.send_query_and_decode::<
1875            NodeGetExtendedAttributeRequest,
1876            NodeGetExtendedAttributeResult,
1877        >(
1878            (name,),
1879            0x45ffa3ccfdeb76db,
1880            fidl::encoding::DynamicFlags::empty(),
1881            _decode,
1882        )
1883    }
1884
1885    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1886        NodeSetExtendedAttributeResult,
1887        fdomain_client::fidl::FDomainResourceDialect,
1888    >;
1889    fn r#set_extended_attribute(
1890        &self,
1891        mut name: &[u8],
1892        mut value: ExtendedAttributeValue,
1893        mut mode: SetExtendedAttributeMode,
1894    ) -> Self::SetExtendedAttributeResponseFut {
1895        fn _decode(
1896            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1897        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1898            let _response = fidl::client::decode_transaction_body::<
1899                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1900                fdomain_client::fidl::FDomainResourceDialect,
1901                0x4a951362f681f23c,
1902            >(_buf?)?;
1903            Ok(_response.map(|x| x))
1904        }
1905        self.client.send_query_and_decode::<
1906            NodeSetExtendedAttributeRequest,
1907            NodeSetExtendedAttributeResult,
1908        >(
1909            (name, &mut value, mode,),
1910            0x4a951362f681f23c,
1911            fidl::encoding::DynamicFlags::empty(),
1912            _decode,
1913        )
1914    }
1915
1916    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1917        NodeRemoveExtendedAttributeResult,
1918        fdomain_client::fidl::FDomainResourceDialect,
1919    >;
1920    fn r#remove_extended_attribute(
1921        &self,
1922        mut name: &[u8],
1923    ) -> Self::RemoveExtendedAttributeResponseFut {
1924        fn _decode(
1925            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1926        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1927            let _response = fidl::client::decode_transaction_body::<
1928                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1929                fdomain_client::fidl::FDomainResourceDialect,
1930                0x7a0b9f3a9bf9032d,
1931            >(_buf?)?;
1932            Ok(_response.map(|x| x))
1933        }
1934        self.client.send_query_and_decode::<
1935            NodeRemoveExtendedAttributeRequest,
1936            NodeRemoveExtendedAttributeResult,
1937        >(
1938            (name,),
1939            0x7a0b9f3a9bf9032d,
1940            fidl::encoding::DynamicFlags::empty(),
1941            _decode,
1942        )
1943    }
1944
1945    fn r#open(
1946        &self,
1947        mut path: &str,
1948        mut flags: Flags,
1949        mut options: &Options,
1950        mut object: fdomain_client::Channel,
1951    ) -> Result<(), fidl::Error> {
1952        self.client.send::<OpenableOpenRequest>(
1953            (path, flags, options, object),
1954            0x568ddcb9a9cbb6d9,
1955            fidl::encoding::DynamicFlags::FLEXIBLE,
1956        )
1957    }
1958
1959    fn r#deprecated_open(
1960        &self,
1961        mut flags: OpenFlags,
1962        mut mode: ModeType,
1963        mut path: &str,
1964        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1965    ) -> Result<(), fidl::Error> {
1966        self.client.send::<DirectoryDeprecatedOpenRequest>(
1967            (flags, mode, path, object),
1968            0x2c5044561d685ec0,
1969            fidl::encoding::DynamicFlags::FLEXIBLE,
1970        )
1971    }
1972
1973    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
1974        (i32, Vec<u8>),
1975        fdomain_client::fidl::FDomainResourceDialect,
1976    >;
1977    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
1978        fn _decode(
1979            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1980        ) -> Result<(i32, Vec<u8>), fidl::Error> {
1981            let _response = fidl::client::decode_transaction_body::<
1982                DirectoryReadDirentsResponse,
1983                fdomain_client::fidl::FDomainResourceDialect,
1984                0x3582806bf27faa0a,
1985            >(_buf?)?;
1986            Ok((_response.s, _response.dirents))
1987        }
1988        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
1989            (max_bytes,),
1990            0x3582806bf27faa0a,
1991            fidl::encoding::DynamicFlags::empty(),
1992            _decode,
1993        )
1994    }
1995
1996    type RewindResponseFut =
1997        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1998    fn r#rewind(&self) -> Self::RewindResponseFut {
1999        fn _decode(
2000            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2001        ) -> Result<i32, fidl::Error> {
2002            let _response = fidl::client::decode_transaction_body::<
2003                DirectoryRewindResponse,
2004                fdomain_client::fidl::FDomainResourceDialect,
2005                0x16b1202af0f34c71,
2006            >(_buf?)?;
2007            Ok(_response.s)
2008        }
2009        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2010            (),
2011            0x16b1202af0f34c71,
2012            fidl::encoding::DynamicFlags::empty(),
2013            _decode,
2014        )
2015    }
2016
2017    type DeprecatedGetTokenResponseFut = fidl::client::QueryResponseFut<
2018        (i32, Option<fdomain_client::NullableHandle>),
2019        fdomain_client::fidl::FDomainResourceDialect,
2020    >;
2021    fn r#deprecated_get_token(&self) -> Self::DeprecatedGetTokenResponseFut {
2022        fn _decode(
2023            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2024        ) -> Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error> {
2025            let _response = fidl::client::decode_transaction_body::<
2026                DirectoryDeprecatedGetTokenResponse,
2027                fdomain_client::fidl::FDomainResourceDialect,
2028                0x26ae9d18763c8655,
2029            >(_buf?)?;
2030            Ok((_response.s, _response.token))
2031        }
2032        self.client.send_query_and_decode::<
2033            fidl::encoding::EmptyPayload,
2034            (i32, Option<fdomain_client::NullableHandle>),
2035        >(
2036            (),
2037            0x26ae9d18763c8655,
2038            fidl::encoding::DynamicFlags::empty(),
2039            _decode,
2040        )
2041    }
2042
2043    type LinkResponseFut =
2044        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2045    fn r#link(
2046        &self,
2047        mut src: &str,
2048        mut dst_parent_token: fdomain_client::NullableHandle,
2049        mut dst: &str,
2050    ) -> Self::LinkResponseFut {
2051        fn _decode(
2052            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2053        ) -> Result<i32, fidl::Error> {
2054            let _response = fidl::client::decode_transaction_body::<
2055                DirectoryLinkResponse,
2056                fdomain_client::fidl::FDomainResourceDialect,
2057                0x740604c0c7c930e7,
2058            >(_buf?)?;
2059            Ok(_response.s)
2060        }
2061        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2062            (src, dst_parent_token, dst),
2063            0x740604c0c7c930e7,
2064            fidl::encoding::DynamicFlags::empty(),
2065            _decode,
2066        )
2067    }
2068
2069    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2070        DirectoryUnlinkResult,
2071        fdomain_client::fidl::FDomainResourceDialect,
2072    >;
2073    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2074        fn _decode(
2075            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2076        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2077            let _response = fidl::client::decode_transaction_body::<
2078                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2079                fdomain_client::fidl::FDomainResourceDialect,
2080                0x750a0326a78d7bed,
2081            >(_buf?)?;
2082            Ok(_response.map(|x| x))
2083        }
2084        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2085            (name, options),
2086            0x750a0326a78d7bed,
2087            fidl::encoding::DynamicFlags::empty(),
2088            _decode,
2089        )
2090    }
2091
2092    type RenameResponseFut = fidl::client::QueryResponseFut<
2093        DirectoryRenameResult,
2094        fdomain_client::fidl::FDomainResourceDialect,
2095    >;
2096    fn r#rename(
2097        &self,
2098        mut src: &str,
2099        mut dst_parent_token: fdomain_client::Event,
2100        mut dst: &str,
2101    ) -> Self::RenameResponseFut {
2102        fn _decode(
2103            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2104        ) -> Result<DirectoryRenameResult, fidl::Error> {
2105            let _response = fidl::client::decode_transaction_body::<
2106                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2107                fdomain_client::fidl::FDomainResourceDialect,
2108                0x7060e7723b9928de,
2109            >(_buf?)?;
2110            Ok(_response.map(|x| x))
2111        }
2112        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2113            (src, dst_parent_token, dst),
2114            0x7060e7723b9928de,
2115            fidl::encoding::DynamicFlags::empty(),
2116            _decode,
2117        )
2118    }
2119
2120    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2121        DirectoryCreateSymlinkResult,
2122        fdomain_client::fidl::FDomainResourceDialect,
2123    >;
2124    fn r#create_symlink(
2125        &self,
2126        mut name: &str,
2127        mut target: &[u8],
2128        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
2129    ) -> Self::CreateSymlinkResponseFut {
2130        fn _decode(
2131            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2132        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2133            let _response = fidl::client::decode_transaction_body::<
2134                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2135                fdomain_client::fidl::FDomainResourceDialect,
2136                0x21ce0f19ec043889,
2137            >(_buf?)?;
2138            Ok(_response.map(|x| x))
2139        }
2140        self.client
2141            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2142                (name, target, connection),
2143                0x21ce0f19ec043889,
2144                fidl::encoding::DynamicFlags::empty(),
2145                _decode,
2146            )
2147    }
2148
2149    type WatchResponseFut =
2150        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2151    fn r#watch(
2152        &self,
2153        mut mask: WatchMask,
2154        mut options: u32,
2155        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
2156    ) -> Self::WatchResponseFut {
2157        fn _decode(
2158            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2159        ) -> Result<i32, fidl::Error> {
2160            let _response = fidl::client::decode_transaction_body::<
2161                DirectoryWatchResponse,
2162                fdomain_client::fidl::FDomainResourceDialect,
2163                0x5717193a59d66d91,
2164            >(_buf?)?;
2165            Ok(_response.s)
2166        }
2167        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2168            (mask, options, watcher),
2169            0x5717193a59d66d91,
2170            fidl::encoding::DynamicFlags::empty(),
2171            _decode,
2172        )
2173    }
2174}
2175
2176pub struct DirectoryEventStream {
2177    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2178}
2179
2180impl std::marker::Unpin for DirectoryEventStream {}
2181
2182impl futures::stream::FusedStream for DirectoryEventStream {
2183    fn is_terminated(&self) -> bool {
2184        self.event_receiver.is_terminated()
2185    }
2186}
2187
2188impl futures::Stream for DirectoryEventStream {
2189    type Item = Result<DirectoryEvent, fidl::Error>;
2190
2191    fn poll_next(
2192        mut self: std::pin::Pin<&mut Self>,
2193        cx: &mut std::task::Context<'_>,
2194    ) -> std::task::Poll<Option<Self::Item>> {
2195        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2196            &mut self.event_receiver,
2197            cx
2198        )?) {
2199            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
2200            None => std::task::Poll::Ready(None),
2201        }
2202    }
2203}
2204
2205#[derive(Debug)]
2206pub enum DirectoryEvent {
2207    OnOpen_ {
2208        s: i32,
2209        info: Option<Box<NodeInfoDeprecated>>,
2210    },
2211    OnRepresentation {
2212        payload: Representation,
2213    },
2214    #[non_exhaustive]
2215    _UnknownEvent {
2216        /// Ordinal of the event that was sent.
2217        ordinal: u64,
2218    },
2219}
2220
2221impl DirectoryEvent {
2222    #[allow(irrefutable_let_patterns)]
2223    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
2224        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
2225    }
2226    #[allow(irrefutable_let_patterns)]
2227    pub fn into_on_representation(self) -> Option<Representation> {
2228        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
2229    }
2230
2231    /// Decodes a message buffer as a [`DirectoryEvent`].
2232    fn decode(
2233        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2234    ) -> Result<DirectoryEvent, fidl::Error> {
2235        let (bytes, _handles) = buf.split_mut();
2236        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2237        debug_assert_eq!(tx_header.tx_id, 0);
2238        match tx_header.ordinal {
2239            0x7fc7bbb1dbfd1972 => {
2240                let mut out = fidl::new_empty!(
2241                    NodeOnOpenRequest,
2242                    fdomain_client::fidl::FDomainResourceDialect
2243                );
2244                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2245                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
2246            }
2247            0x5cb40567d80a510c => {
2248                let mut out =
2249                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
2250                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
2251                Ok((DirectoryEvent::OnRepresentation { payload: out }))
2252            }
2253            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2254                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2255            }
2256            _ => Err(fidl::Error::UnknownOrdinal {
2257                ordinal: tx_header.ordinal,
2258                protocol_name:
2259                    <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2260            }),
2261        }
2262    }
2263}
2264
2265/// A Stream of incoming requests for fuchsia.io/Directory.
2266pub struct DirectoryRequestStream {
2267    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2268    is_terminated: bool,
2269}
2270
2271impl std::marker::Unpin for DirectoryRequestStream {}
2272
2273impl futures::stream::FusedStream for DirectoryRequestStream {
2274    fn is_terminated(&self) -> bool {
2275        self.is_terminated
2276    }
2277}
2278
2279impl fdomain_client::fidl::RequestStream for DirectoryRequestStream {
2280    type Protocol = DirectoryMarker;
2281    type ControlHandle = DirectoryControlHandle;
2282
2283    fn from_channel(channel: fdomain_client::Channel) -> Self {
2284        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2285    }
2286
2287    fn control_handle(&self) -> Self::ControlHandle {
2288        DirectoryControlHandle { inner: self.inner.clone() }
2289    }
2290
2291    fn into_inner(
2292        self,
2293    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2294    {
2295        (self.inner, self.is_terminated)
2296    }
2297
2298    fn from_inner(
2299        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2300        is_terminated: bool,
2301    ) -> Self {
2302        Self { inner, is_terminated }
2303    }
2304}
2305
2306impl futures::Stream for DirectoryRequestStream {
2307    type Item = Result<DirectoryRequest, fidl::Error>;
2308
2309    fn poll_next(
2310        mut self: std::pin::Pin<&mut Self>,
2311        cx: &mut std::task::Context<'_>,
2312    ) -> std::task::Poll<Option<Self::Item>> {
2313        let this = &mut *self;
2314        if this.inner.check_shutdown(cx) {
2315            this.is_terminated = true;
2316            return std::task::Poll::Ready(None);
2317        }
2318        if this.is_terminated {
2319            panic!("polled DirectoryRequestStream after completion");
2320        }
2321        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2322            |bytes, handles| {
2323                match this.inner.channel().read_etc(cx, bytes, handles) {
2324                    std::task::Poll::Ready(Ok(())) => {}
2325                    std::task::Poll::Pending => return std::task::Poll::Pending,
2326                    std::task::Poll::Ready(Err(None)) => {
2327                        this.is_terminated = true;
2328                        return std::task::Poll::Ready(None);
2329                    }
2330                    std::task::Poll::Ready(Err(Some(e))) => {
2331                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2332                            e.into(),
2333                        ))));
2334                    }
2335                }
2336
2337                // A message has been received from the channel
2338                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2339
2340                std::task::Poll::Ready(Some(match header.ordinal {
2341                    0x6ee9c0ad53ec87aa => {
2342                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2343                        let mut req = fidl::new_empty!(
2344                            AdvisoryLockingAdvisoryLockRequest,
2345                            fdomain_client::fidl::FDomainResourceDialect
2346                        );
2347                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
2348                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2349                        Ok(DirectoryRequest::AdvisoryLock {
2350                            request: req.request,
2351
2352                            responder: DirectoryAdvisoryLockResponder {
2353                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2354                                tx_id: header.tx_id,
2355                            },
2356                        })
2357                    }
2358                    0x20d8a7aba2168a79 => {
2359                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2360                        let mut req = fidl::new_empty!(
2361                            fdomain_fuchsia_unknown::CloneableCloneRequest,
2362                            fdomain_client::fidl::FDomainResourceDialect
2363                        );
2364                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2365                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2366                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
2367                    }
2368                    0x5ac5d459ad7f657e => {
2369                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2370                        let mut req = fidl::new_empty!(
2371                            fidl::encoding::EmptyPayload,
2372                            fdomain_client::fidl::FDomainResourceDialect
2373                        );
2374                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2375                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2376                        Ok(DirectoryRequest::Close {
2377                            responder: DirectoryCloseResponder {
2378                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2379                                tx_id: header.tx_id,
2380                            },
2381                        })
2382                    }
2383                    0x2658edee9decfc06 => {
2384                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2385                        let mut req = fidl::new_empty!(
2386                            fidl::encoding::EmptyPayload,
2387                            fdomain_client::fidl::FDomainResourceDialect
2388                        );
2389                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2390                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2391                        Ok(DirectoryRequest::Query {
2392                            responder: DirectoryQueryResponder {
2393                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2394                                tx_id: header.tx_id,
2395                            },
2396                        })
2397                    }
2398                    0x78985e216314dafd => {
2399                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2400                        let mut req = fidl::new_empty!(
2401                            fidl::encoding::EmptyPayload,
2402                            fdomain_client::fidl::FDomainResourceDialect
2403                        );
2404                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2405                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2406                        Ok(DirectoryRequest::DeprecatedGetAttr {
2407                            responder: DirectoryDeprecatedGetAttrResponder {
2408                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2409                                tx_id: header.tx_id,
2410                            },
2411                        })
2412                    }
2413                    0x4186c0f40d938f46 => {
2414                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2415                        let mut req = fidl::new_empty!(
2416                            NodeDeprecatedSetAttrRequest,
2417                            fdomain_client::fidl::FDomainResourceDialect
2418                        );
2419                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
2420                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2421                        Ok(DirectoryRequest::DeprecatedSetAttr {
2422                            flags: req.flags,
2423                            attributes: req.attributes,
2424
2425                            responder: DirectoryDeprecatedSetAttrResponder {
2426                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2427                                tx_id: header.tx_id,
2428                            },
2429                        })
2430                    }
2431                    0x5b88fffb8eda3aa1 => {
2432                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2433                        let mut req = fidl::new_empty!(
2434                            fidl::encoding::EmptyPayload,
2435                            fdomain_client::fidl::FDomainResourceDialect
2436                        );
2437                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2438                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2439                        Ok(DirectoryRequest::DeprecatedGetFlags {
2440                            responder: DirectoryDeprecatedGetFlagsResponder {
2441                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2442                                tx_id: header.tx_id,
2443                            },
2444                        })
2445                    }
2446                    0x5295b76c71fde733 => {
2447                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2448                        let mut req = fidl::new_empty!(
2449                            NodeDeprecatedSetFlagsRequest,
2450                            fdomain_client::fidl::FDomainResourceDialect
2451                        );
2452                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2453                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2454                        Ok(DirectoryRequest::DeprecatedSetFlags {
2455                            flags: req.flags,
2456
2457                            responder: DirectoryDeprecatedSetFlagsResponder {
2458                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2459                                tx_id: header.tx_id,
2460                            },
2461                        })
2462                    }
2463                    0x176eb318f64ec23 => {
2464                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2465                        let mut req = fidl::new_empty!(
2466                            fidl::encoding::EmptyPayload,
2467                            fdomain_client::fidl::FDomainResourceDialect
2468                        );
2469                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2470                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2471                        Ok(DirectoryRequest::GetFlags {
2472                            responder: DirectoryGetFlagsResponder {
2473                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2474                                tx_id: header.tx_id,
2475                            },
2476                        })
2477                    }
2478                    0x55a8028685791ea8 => {
2479                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2480                        let mut req = fidl::new_empty!(
2481                            NodeSetFlagsRequest,
2482                            fdomain_client::fidl::FDomainResourceDialect
2483                        );
2484                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2485                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2486                        Ok(DirectoryRequest::SetFlags {
2487                            flags: req.flags,
2488
2489                            responder: DirectorySetFlagsResponder {
2490                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2491                                tx_id: header.tx_id,
2492                            },
2493                        })
2494                    }
2495                    0x6f344a1c6b0a0610 => {
2496                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2497                        let mut req = fidl::new_empty!(
2498                            fidl::encoding::EmptyPayload,
2499                            fdomain_client::fidl::FDomainResourceDialect
2500                        );
2501                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2502                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2503                        Ok(DirectoryRequest::QueryFilesystem {
2504                            responder: DirectoryQueryFilesystemResponder {
2505                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2506                                tx_id: header.tx_id,
2507                            },
2508                        })
2509                    }
2510                    0x5054f0ade7076cec => {
2511                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2512                        let mut req = fidl::new_empty!(
2513                            fidl::encoding::EmptyPayload,
2514                            fdomain_client::fidl::FDomainResourceDialect
2515                        );
2516                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2517                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2518                        Ok(DirectoryRequest::GetToken {
2519                            responder: DirectoryGetTokenResponder {
2520                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2521                                tx_id: header.tx_id,
2522                            },
2523                        })
2524                    }
2525                    0x3d4396a638ea053b => {
2526                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2527                        let mut req = fidl::new_empty!(
2528                            NodeGetAttributesRequest,
2529                            fdomain_client::fidl::FDomainResourceDialect
2530                        );
2531                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2532                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2533                        Ok(DirectoryRequest::GetAttributes {
2534                            query: req.query,
2535
2536                            responder: DirectoryGetAttributesResponder {
2537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2538                                tx_id: header.tx_id,
2539                            },
2540                        })
2541                    }
2542                    0x3308c1da5a89bf08 => {
2543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2544                        let mut req = fidl::new_empty!(
2545                            MutableNodeAttributes,
2546                            fdomain_client::fidl::FDomainResourceDialect
2547                        );
2548                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
2549                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2550                        Ok(DirectoryRequest::UpdateAttributes {
2551                            payload: req,
2552                            responder: DirectoryUpdateAttributesResponder {
2553                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2554                                tx_id: header.tx_id,
2555                            },
2556                        })
2557                    }
2558                    0x2c5c27ca0ab5dc49 => {
2559                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2560                        let mut req = fidl::new_empty!(
2561                            fidl::encoding::EmptyPayload,
2562                            fdomain_client::fidl::FDomainResourceDialect
2563                        );
2564                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2565                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2566                        Ok(DirectoryRequest::Sync {
2567                            responder: DirectorySyncResponder {
2568                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2569                                tx_id: header.tx_id,
2570                            },
2571                        })
2572                    }
2573                    0x4b61033de007fcd0 => {
2574                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2575                        let mut req = fidl::new_empty!(
2576                            NodeListExtendedAttributesRequest,
2577                            fdomain_client::fidl::FDomainResourceDialect
2578                        );
2579                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2580                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2581                        Ok(DirectoryRequest::ListExtendedAttributes {
2582                            iterator: req.iterator,
2583
2584                            control_handle,
2585                        })
2586                    }
2587                    0x45ffa3ccfdeb76db => {
2588                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2589                        let mut req = fidl::new_empty!(
2590                            NodeGetExtendedAttributeRequest,
2591                            fdomain_client::fidl::FDomainResourceDialect
2592                        );
2593                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2594                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2595                        Ok(DirectoryRequest::GetExtendedAttribute {
2596                            name: req.name,
2597
2598                            responder: DirectoryGetExtendedAttributeResponder {
2599                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2600                                tx_id: header.tx_id,
2601                            },
2602                        })
2603                    }
2604                    0x4a951362f681f23c => {
2605                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2606                        let mut req = fidl::new_empty!(
2607                            NodeSetExtendedAttributeRequest,
2608                            fdomain_client::fidl::FDomainResourceDialect
2609                        );
2610                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2611                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2612                        Ok(DirectoryRequest::SetExtendedAttribute {
2613                            name: req.name,
2614                            value: req.value,
2615                            mode: req.mode,
2616
2617                            responder: DirectorySetExtendedAttributeResponder {
2618                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2619                                tx_id: header.tx_id,
2620                            },
2621                        })
2622                    }
2623                    0x7a0b9f3a9bf9032d => {
2624                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2625                        let mut req = fidl::new_empty!(
2626                            NodeRemoveExtendedAttributeRequest,
2627                            fdomain_client::fidl::FDomainResourceDialect
2628                        );
2629                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2630                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2631                        Ok(DirectoryRequest::RemoveExtendedAttribute {
2632                            name: req.name,
2633
2634                            responder: DirectoryRemoveExtendedAttributeResponder {
2635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2636                                tx_id: header.tx_id,
2637                            },
2638                        })
2639                    }
2640                    0x568ddcb9a9cbb6d9 => {
2641                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2642                        let mut req = fidl::new_empty!(
2643                            OpenableOpenRequest,
2644                            fdomain_client::fidl::FDomainResourceDialect
2645                        );
2646                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2647                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2648                        Ok(DirectoryRequest::Open {
2649                            path: req.path,
2650                            flags: req.flags,
2651                            options: req.options,
2652                            object: req.object,
2653
2654                            control_handle,
2655                        })
2656                    }
2657                    0x2c5044561d685ec0 => {
2658                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2659                        let mut req = fidl::new_empty!(
2660                            DirectoryDeprecatedOpenRequest,
2661                            fdomain_client::fidl::FDomainResourceDialect
2662                        );
2663                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2664                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2665                        Ok(DirectoryRequest::DeprecatedOpen {
2666                            flags: req.flags,
2667                            mode: req.mode,
2668                            path: req.path,
2669                            object: req.object,
2670
2671                            control_handle,
2672                        })
2673                    }
2674                    0x3582806bf27faa0a => {
2675                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2676                        let mut req = fidl::new_empty!(
2677                            DirectoryReadDirentsRequest,
2678                            fdomain_client::fidl::FDomainResourceDialect
2679                        );
2680                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
2681                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2682                        Ok(DirectoryRequest::ReadDirents {
2683                            max_bytes: req.max_bytes,
2684
2685                            responder: DirectoryReadDirentsResponder {
2686                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2687                                tx_id: header.tx_id,
2688                            },
2689                        })
2690                    }
2691                    0x16b1202af0f34c71 => {
2692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2693                        let mut req = fidl::new_empty!(
2694                            fidl::encoding::EmptyPayload,
2695                            fdomain_client::fidl::FDomainResourceDialect
2696                        );
2697                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2698                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2699                        Ok(DirectoryRequest::Rewind {
2700                            responder: DirectoryRewindResponder {
2701                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2702                                tx_id: header.tx_id,
2703                            },
2704                        })
2705                    }
2706                    0x26ae9d18763c8655 => {
2707                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2708                        let mut req = fidl::new_empty!(
2709                            fidl::encoding::EmptyPayload,
2710                            fdomain_client::fidl::FDomainResourceDialect
2711                        );
2712                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2713                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2714                        Ok(DirectoryRequest::DeprecatedGetToken {
2715                            responder: DirectoryDeprecatedGetTokenResponder {
2716                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2717                                tx_id: header.tx_id,
2718                            },
2719                        })
2720                    }
2721                    0x740604c0c7c930e7 => {
2722                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2723                        let mut req = fidl::new_empty!(
2724                            DirectoryLinkRequest,
2725                            fdomain_client::fidl::FDomainResourceDialect
2726                        );
2727                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
2728                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2729                        Ok(DirectoryRequest::Link {
2730                            src: req.src,
2731                            dst_parent_token: req.dst_parent_token,
2732                            dst: req.dst,
2733
2734                            responder: DirectoryLinkResponder {
2735                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2736                                tx_id: header.tx_id,
2737                            },
2738                        })
2739                    }
2740                    0x750a0326a78d7bed => {
2741                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2742                        let mut req = fidl::new_empty!(
2743                            DirectoryUnlinkRequest,
2744                            fdomain_client::fidl::FDomainResourceDialect
2745                        );
2746                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2747                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2748                        Ok(DirectoryRequest::Unlink {
2749                            name: req.name,
2750                            options: req.options,
2751
2752                            responder: DirectoryUnlinkResponder {
2753                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2754                                tx_id: header.tx_id,
2755                            },
2756                        })
2757                    }
2758                    0x7060e7723b9928de => {
2759                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2760                        let mut req = fidl::new_empty!(
2761                            DirectoryRenameRequest,
2762                            fdomain_client::fidl::FDomainResourceDialect
2763                        );
2764                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
2765                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2766                        Ok(DirectoryRequest::Rename {
2767                            src: req.src,
2768                            dst_parent_token: req.dst_parent_token,
2769                            dst: req.dst,
2770
2771                            responder: DirectoryRenameResponder {
2772                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2773                                tx_id: header.tx_id,
2774                            },
2775                        })
2776                    }
2777                    0x21ce0f19ec043889 => {
2778                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2779                        let mut req = fidl::new_empty!(
2780                            DirectoryCreateSymlinkRequest,
2781                            fdomain_client::fidl::FDomainResourceDialect
2782                        );
2783                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2784                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2785                        Ok(DirectoryRequest::CreateSymlink {
2786                            name: req.name,
2787                            target: req.target,
2788                            connection: req.connection,
2789
2790                            responder: DirectoryCreateSymlinkResponder {
2791                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2792                                tx_id: header.tx_id,
2793                            },
2794                        })
2795                    }
2796                    0x5717193a59d66d91 => {
2797                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2798                        let mut req = fidl::new_empty!(
2799                            DirectoryWatchRequest,
2800                            fdomain_client::fidl::FDomainResourceDialect
2801                        );
2802                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2803                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2804                        Ok(DirectoryRequest::Watch {
2805                            mask: req.mask,
2806                            options: req.options,
2807                            watcher: req.watcher,
2808
2809                            responder: DirectoryWatchResponder {
2810                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2811                                tx_id: header.tx_id,
2812                            },
2813                        })
2814                    }
2815                    _ if header.tx_id == 0
2816                        && header
2817                            .dynamic_flags()
2818                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2819                    {
2820                        Ok(DirectoryRequest::_UnknownMethod {
2821                            ordinal: header.ordinal,
2822                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2823                            method_type: fidl::MethodType::OneWay,
2824                        })
2825                    }
2826                    _ if header
2827                        .dynamic_flags()
2828                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2829                    {
2830                        this.inner.send_framework_err(
2831                            fidl::encoding::FrameworkErr::UnknownMethod,
2832                            header.tx_id,
2833                            header.ordinal,
2834                            header.dynamic_flags(),
2835                            (bytes, handles),
2836                        )?;
2837                        Ok(DirectoryRequest::_UnknownMethod {
2838                            ordinal: header.ordinal,
2839                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2840                            method_type: fidl::MethodType::TwoWay,
2841                        })
2842                    }
2843                    _ => Err(fidl::Error::UnknownOrdinal {
2844                        ordinal: header.ordinal,
2845                        protocol_name:
2846                            <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2847                    }),
2848                }))
2849            },
2850        )
2851    }
2852}
2853
2854/// Directory defines a node which is capable of containing other Objects.
2855#[derive(Debug)]
2856pub enum DirectoryRequest {
2857    /// Acquires an advisory lock on the underlying file.
2858    ///
2859    /// The lock lasts until either this connection is closed or
2860    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
2861    /// explicitly.
2862    ///
2863    /// Advisory locks are purely advisory. They do not prevent actual read or
2864    /// write operations from occurring on the file, either through this
2865    /// connection or through other connections.
2866    ///
2867    /// This method requires the following rights:
2868    ///
2869    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
2870    /// * [`Rights.WRITE_BYTES`] if `request.type` is
2871    ///   [`AdvisoryLockType.WRITE`].
2872    ///
2873    /// # Errors
2874    ///
2875    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
2876    ///   example, another connection might hold a conflicting lock type.
2877    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
2878    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
2879    ///   to acquire the given type of lock.
2880    AdvisoryLock {
2881        request: AdvisoryLockRequest,
2882        responder: DirectoryAdvisoryLockResponder,
2883    },
2884    Clone {
2885        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
2886        control_handle: DirectoryControlHandle,
2887    },
2888    /// Terminates the connection.
2889    ///
2890    /// After calling `Close`, the client must not send any other requests.
2891    ///
2892    /// Servers, after sending the status response, should close the connection
2893    /// regardless of status and without sending an epitaph.
2894    ///
2895    /// Closing the client end of the channel should be semantically equivalent
2896    /// to calling `Close` without knowing when the close has completed or its
2897    /// status.
2898    Close {
2899        responder: DirectoryCloseResponder,
2900    },
2901    Query {
2902        responder: DirectoryQueryResponder,
2903    },
2904    /// DEPRECATED - Use `Node.GetAttributes` instead.
2905    ///
2906    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2907    DeprecatedGetAttr {
2908        responder: DirectoryDeprecatedGetAttrResponder,
2909    },
2910    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
2911    DeprecatedSetAttr {
2912        flags: NodeAttributeFlags,
2913        attributes: NodeAttributes,
2914        responder: DirectoryDeprecatedSetAttrResponder,
2915    },
2916    /// [DEPRECATED - Use new GetFlags method instead.]
2917    DeprecatedGetFlags {
2918        responder: DirectoryDeprecatedGetFlagsResponder,
2919    },
2920    /// [DEPRECATED - Use new SetFlags method instead.]
2921    DeprecatedSetFlags {
2922        flags: OpenFlags,
2923        responder: DirectoryDeprecatedSetFlagsResponder,
2924    },
2925    /// Queries the flags that apply to this node after it has been opened/created. This method does
2926    /// not require any rights.
2927    ///
2928    /// Note that the final set of flags that apply to the connection may differ from those
2929    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2930    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2931    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2932    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2933    GetFlags {
2934        responder: DirectoryGetFlagsResponder,
2935    },
2936    /// Sets the flags that apply to this node after it has been opened. This method does not
2937    /// require any rights.
2938    ///
2939    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2940    /// clear append mode.
2941    ///
2942    /// Errors:
2943    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2944    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2945    SetFlags {
2946        flags: Flags,
2947        responder: DirectorySetFlagsResponder,
2948    },
2949    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2950    /// volume has different settings or the storage is accounted seperately from the rest of the
2951    /// filesystem that may be reported instead of filesystem-wide details.
2952    QueryFilesystem {
2953        responder: DirectoryQueryFilesystemResponder,
2954    },
2955    /// Acquires a token which can be used to identify this connection at a later point in
2956    /// time. The token will remain valid for as long as the connection requesting the token
2957    /// remains open.
2958    ///
2959    /// This method does not require any rights. Note that the token identifies
2960    /// the connection, hence carries the rights information on this connection.
2961    GetToken {
2962        responder: DirectoryGetTokenResponder,
2963    },
2964    /// Acquires information about the node.
2965    ///
2966    /// The attributes of a node should be stable, independent of the
2967    /// specific protocol used to access it.
2968    ///
2969    /// If a particular attribute is not applicable or not supported,
2970    /// filesystems should leave the corresponding field absent.
2971    ///
2972    /// + `query` a bit-mask specifying which attributes to fetch. The server
2973    ///   should not return more than necessary.
2974    /// - `attributes` the returned attributes.
2975    ///
2976    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2977    GetAttributes {
2978        query: NodeAttributesQuery,
2979        responder: DirectoryGetAttributesResponder,
2980    },
2981    /// Updates information about the node.
2982    ///
2983    /// + `attributes` the presence of a table field in `attributes` indicates
2984    /// the intent to update the corresponding attribute.
2985    ///
2986    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2987    ///
2988    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2989    UpdateAttributes {
2990        payload: MutableNodeAttributes,
2991        responder: DirectoryUpdateAttributesResponder,
2992    },
2993    /// Synchronizes updates to the node to the underlying media, if it exists.
2994    ///
2995    /// This method will return when the filesystem server has flushed the
2996    /// relevant updates to the underlying media, but does not guarantee the
2997    /// underlying media has persisted the information, nor that any information
2998    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2999    /// between operations.
3000    ///
3001    /// This method does not require any rights.
3002    Sync {
3003        responder: DirectorySyncResponder,
3004    },
3005    /// Creates an iterator over all the extended attribute names associated
3006    /// with this node. If an error occurs it is returned as an epitaph on the
3007    /// iterator request channel, and then the channel is closed.
3008    ///
3009    /// GetExtendedAttributes can be used with any of these names to retrieve
3010    /// the associated value.
3011    ///
3012    /// This method requires the [`Rights.READ_BYTES`] right.
3013    ListExtendedAttributes {
3014        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3015        control_handle: DirectoryControlHandle,
3016    },
3017    /// Get the value associated with the given attribute `name` for this node.
3018    ///
3019    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3020    /// particular structure is imposed on them.
3021    ///
3022    /// This method requires the [`Rights.READ_BYTES`] right.
3023    GetExtendedAttribute {
3024        name: Vec<u8>,
3025        responder: DirectoryGetExtendedAttributeResponder,
3026    },
3027    /// Set the value for the given attribute `name` to `value` for this node.
3028    ///
3029    /// The attribute name may exist, in which case the attribute is updated.
3030    /// If the attribute doesn't exist, it is created. The name should have no
3031    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3032    ///
3033    /// This method requires the [`Rights.WRITE_BYTES`] right.
3034    SetExtendedAttribute {
3035        name: Vec<u8>,
3036        value: ExtendedAttributeValue,
3037        mode: SetExtendedAttributeMode,
3038        responder: DirectorySetExtendedAttributeResponder,
3039    },
3040    /// Remove the specified extended attribute.
3041    ///
3042    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3043    ///
3044    /// This method requires the [`Rights.WRITE_BYTES`] right.
3045    RemoveExtendedAttribute {
3046        name: Vec<u8>,
3047        responder: DirectoryRemoveExtendedAttributeResponder,
3048    },
3049    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3050    /// epitaph sent on the `object` channel.
3051    ///
3052    /// Errors:
3053    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3054    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3055    Open {
3056        path: String,
3057        flags: Flags,
3058        options: Options,
3059        object: fdomain_client::Channel,
3060        control_handle: DirectoryControlHandle,
3061    },
3062    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3063    DeprecatedOpen {
3064        flags: OpenFlags,
3065        mode: ModeType,
3066        path: String,
3067        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
3068        control_handle: DirectoryControlHandle,
3069    },
3070    /// Reads a collection of variably sized dirents into a buffer.
3071    /// The number of dirents in a directory may be very large: akin to
3072    /// calling read multiple times on a file, directories have a seek
3073    /// offset which is updated on subsequent calls to ReadDirents.
3074    /// Each call to ReadDirents will only return whole dirent structures,
3075    /// they will not get split across ReadDirent calls. When the seek
3076    /// offset reaches the end, `dirents` will be empty.
3077    ///
3078    /// These dirents are of the form:
3079    /// ```
3080    /// struct dirent {
3081    ///   // Describes the inode of the entry.
3082    ///   uint64 ino;
3083    ///   // Describes the length of the dirent name in bytes.
3084    ///   uint8 size;
3085    ///   // Describes the type of the entry. Aligned with the
3086    ///   // POSIX d_type values. Use `DirentType` constants.
3087    ///   uint8 type;
3088    ///   // Unterminated name of entry.
3089    ///   char name[0];
3090    /// }
3091    /// ```
3092    ///
3093    /// This method requires the following rights:
3094    ///
3095    /// * [`Rights.ENUMERATE`]
3096    ReadDirents {
3097        max_bytes: u64,
3098        responder: DirectoryReadDirentsResponder,
3099    },
3100    /// Resets the directory seek offset.
3101    ///
3102    /// This method requires the following rights:
3103    ///
3104    /// * [`Rights.ENUMERATE`]
3105    Rewind {
3106        responder: DirectoryRewindResponder,
3107    },
3108    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3109    /// in time. The token will remain valid for as long as the connection requesting the token
3110    /// remains open.
3111    ///
3112    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3113    /// `ZX_ERR_BAD_HANDLE`.
3114    ///
3115    /// This method is deprecated: use `fuchsia.io/Node.GetToken` instead (once it is added).
3116    DeprecatedGetToken {
3117        responder: DirectoryDeprecatedGetTokenResponder,
3118    },
3119    /// Creates a link to an object named src by the name dst, within a directory represented by
3120    /// token.
3121    ///
3122    /// `src` must be a resolved object name. Including "/" in the string will
3123    /// return `ZX_ERR_INVALID_ARGS`.
3124    ///
3125    /// `dst` must be a resolved object name. Including "/" in the string will
3126    /// return `ZX_ERR_INVALID_ARGS`.
3127    ///
3128    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3129    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3130    ///
3131    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3132    /// there are two actors operating concurrently, and one actor performs a rename that affects
3133    /// the source within this directory, and the other does a link, each will appear to occur
3134    /// atomically in an unspecified order.
3135    Link {
3136        src: String,
3137        dst_parent_token: fdomain_client::NullableHandle,
3138        dst: String,
3139        responder: DirectoryLinkResponder,
3140    },
3141    /// Removes a child node from the this directory's list of entries.
3142    ///
3143    /// Note: this does not guarantee that the underlying object is destroyed.
3144    /// Although the link will be removed from the containing directory,
3145    /// objects with multiple references (such as files which are still open)
3146    /// will not actually be destroyed until all references are closed.
3147    ///
3148    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3149    ///   [`Rights.WRITE_BYTES`].
3150    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3151    ///   support writing.
3152    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3153    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3154    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3155    ///   containing a remote channel.
3156    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3157    ///     something other than a directory was found.
3158    ///
3159    /// Other errors may be returned for filesystem-specific reasons.
3160    ///
3161    /// This method requires the following rights:
3162    ///
3163    /// * [`Rights.ENUMERATE`]
3164    /// * [`Rights.MODIFY_DIRECTORY`]
3165    Unlink {
3166        name: String,
3167        options: UnlinkOptions,
3168        responder: DirectoryUnlinkResponder,
3169    },
3170    /// Renames a node named `src` to the name `dst`, in a directory represented
3171    /// by `dst_parent_token`.
3172    ///
3173    /// `src` and `dst` must be valid node names.
3174    /// See [`Name`] for what constitutes a valid name.
3175    ///
3176    /// This method requires the following rights on both the current connection, and the connection
3177    /// identified by `dst_parent_token`:
3178    ///
3179    /// * [`Rights.ENUMERATE`]
3180    /// * [`Rights.MODIFY_DIRECTORY`]
3181    ///
3182    /// The following requirements are necessary to avoid rights escalations.
3183    ///
3184    /// If the source and destination directory differ, the source directory must also have the
3185    /// maximal set of abilities supported for files, which would typically be
3186    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
3187    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
3188    /// right.
3189    ///
3190    /// If `src` refers to a directory, and differs from the destination directory, then the source
3191    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
3192    ///
3193    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
3194    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
3195    Rename {
3196        src: String,
3197        dst_parent_token: fdomain_client::Event,
3198        dst: String,
3199        responder: DirectoryRenameResponder,
3200    },
3201    /// Creates a symbolic link.
3202    ///
3203    /// `name` is the name to be given to the created symbolic link.
3204    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
3205    /// will perform no validation of `target` except for a server chosen maximum length.
3206    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
3207    /// on the successfully created node.
3208    ///
3209    /// * [`Rights.MODIFY_DIRECTORY`]
3210    ///
3211    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
3212    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
3213    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
3214    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
3215    CreateSymlink {
3216        name: String,
3217        target: Vec<u8>,
3218        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3219        responder: DirectoryCreateSymlinkResponder,
3220    },
3221    /// Watches a directory, receiving events of added messages on the
3222    /// watcher request channel.
3223    ///
3224    /// Options must be zero; it is reserved.
3225    ///
3226    /// This method requires the following rights:
3227    ///
3228    /// * [`Rights.ENUMERATE`]
3229    Watch {
3230        mask: WatchMask,
3231        options: u32,
3232        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3233        responder: DirectoryWatchResponder,
3234    },
3235    /// An interaction was received which does not match any known method.
3236    #[non_exhaustive]
3237    _UnknownMethod {
3238        /// Ordinal of the method that was called.
3239        ordinal: u64,
3240        control_handle: DirectoryControlHandle,
3241        method_type: fidl::MethodType,
3242    },
3243}
3244
3245impl DirectoryRequest {
3246    #[allow(irrefutable_let_patterns)]
3247    pub fn into_advisory_lock(
3248        self,
3249    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
3250        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
3251            Some((request, responder))
3252        } else {
3253            None
3254        }
3255    }
3256
3257    #[allow(irrefutable_let_patterns)]
3258    pub fn into_clone(
3259        self,
3260    ) -> Option<(
3261        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
3262        DirectoryControlHandle,
3263    )> {
3264        if let DirectoryRequest::Clone { request, control_handle } = self {
3265            Some((request, control_handle))
3266        } else {
3267            None
3268        }
3269    }
3270
3271    #[allow(irrefutable_let_patterns)]
3272    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
3273        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
3274    }
3275
3276    #[allow(irrefutable_let_patterns)]
3277    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
3278        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
3279    }
3280
3281    #[allow(irrefutable_let_patterns)]
3282    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
3283        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
3284            Some((responder))
3285        } else {
3286            None
3287        }
3288    }
3289
3290    #[allow(irrefutable_let_patterns)]
3291    pub fn into_deprecated_set_attr(
3292        self,
3293    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
3294        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
3295            Some((flags, attributes, responder))
3296        } else {
3297            None
3298        }
3299    }
3300
3301    #[allow(irrefutable_let_patterns)]
3302    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
3303        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
3304            Some((responder))
3305        } else {
3306            None
3307        }
3308    }
3309
3310    #[allow(irrefutable_let_patterns)]
3311    pub fn into_deprecated_set_flags(
3312        self,
3313    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
3314        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
3315            Some((flags, responder))
3316        } else {
3317            None
3318        }
3319    }
3320
3321    #[allow(irrefutable_let_patterns)]
3322    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
3323        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
3324    }
3325
3326    #[allow(irrefutable_let_patterns)]
3327    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
3328        if let DirectoryRequest::SetFlags { flags, responder } = self {
3329            Some((flags, responder))
3330        } else {
3331            None
3332        }
3333    }
3334
3335    #[allow(irrefutable_let_patterns)]
3336    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
3337        if let DirectoryRequest::QueryFilesystem { responder } = self {
3338            Some((responder))
3339        } else {
3340            None
3341        }
3342    }
3343
3344    #[allow(irrefutable_let_patterns)]
3345    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
3346        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
3347    }
3348
3349    #[allow(irrefutable_let_patterns)]
3350    pub fn into_get_attributes(
3351        self,
3352    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
3353        if let DirectoryRequest::GetAttributes { query, responder } = self {
3354            Some((query, responder))
3355        } else {
3356            None
3357        }
3358    }
3359
3360    #[allow(irrefutable_let_patterns)]
3361    pub fn into_update_attributes(
3362        self,
3363    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
3364        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
3365            Some((payload, responder))
3366        } else {
3367            None
3368        }
3369    }
3370
3371    #[allow(irrefutable_let_patterns)]
3372    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
3373        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
3374    }
3375
3376    #[allow(irrefutable_let_patterns)]
3377    pub fn into_list_extended_attributes(
3378        self,
3379    ) -> Option<(
3380        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3381        DirectoryControlHandle,
3382    )> {
3383        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
3384            Some((iterator, control_handle))
3385        } else {
3386            None
3387        }
3388    }
3389
3390    #[allow(irrefutable_let_patterns)]
3391    pub fn into_get_extended_attribute(
3392        self,
3393    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
3394        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
3395            Some((name, responder))
3396        } else {
3397            None
3398        }
3399    }
3400
3401    #[allow(irrefutable_let_patterns)]
3402    pub fn into_set_extended_attribute(
3403        self,
3404    ) -> Option<(
3405        Vec<u8>,
3406        ExtendedAttributeValue,
3407        SetExtendedAttributeMode,
3408        DirectorySetExtendedAttributeResponder,
3409    )> {
3410        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
3411            Some((name, value, mode, responder))
3412        } else {
3413            None
3414        }
3415    }
3416
3417    #[allow(irrefutable_let_patterns)]
3418    pub fn into_remove_extended_attribute(
3419        self,
3420    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
3421        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
3422            Some((name, responder))
3423        } else {
3424            None
3425        }
3426    }
3427
3428    #[allow(irrefutable_let_patterns)]
3429    pub fn into_open(
3430        self,
3431    ) -> Option<(String, Flags, Options, fdomain_client::Channel, DirectoryControlHandle)> {
3432        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
3433            Some((path, flags, options, object, control_handle))
3434        } else {
3435            None
3436        }
3437    }
3438
3439    #[allow(irrefutable_let_patterns)]
3440    pub fn into_deprecated_open(
3441        self,
3442    ) -> Option<(
3443        OpenFlags,
3444        ModeType,
3445        String,
3446        fdomain_client::fidl::ServerEnd<NodeMarker>,
3447        DirectoryControlHandle,
3448    )> {
3449        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
3450        {
3451            Some((flags, mode, path, object, control_handle))
3452        } else {
3453            None
3454        }
3455    }
3456
3457    #[allow(irrefutable_let_patterns)]
3458    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
3459        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
3460            Some((max_bytes, responder))
3461        } else {
3462            None
3463        }
3464    }
3465
3466    #[allow(irrefutable_let_patterns)]
3467    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
3468        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
3469    }
3470
3471    #[allow(irrefutable_let_patterns)]
3472    pub fn into_deprecated_get_token(self) -> Option<(DirectoryDeprecatedGetTokenResponder)> {
3473        if let DirectoryRequest::DeprecatedGetToken { responder } = self {
3474            Some((responder))
3475        } else {
3476            None
3477        }
3478    }
3479
3480    #[allow(irrefutable_let_patterns)]
3481    pub fn into_link(
3482        self,
3483    ) -> Option<(String, fdomain_client::NullableHandle, String, DirectoryLinkResponder)> {
3484        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
3485            Some((src, dst_parent_token, dst, responder))
3486        } else {
3487            None
3488        }
3489    }
3490
3491    #[allow(irrefutable_let_patterns)]
3492    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
3493        if let DirectoryRequest::Unlink { name, options, responder } = self {
3494            Some((name, options, responder))
3495        } else {
3496            None
3497        }
3498    }
3499
3500    #[allow(irrefutable_let_patterns)]
3501    pub fn into_rename(
3502        self,
3503    ) -> Option<(String, fdomain_client::Event, String, DirectoryRenameResponder)> {
3504        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
3505            Some((src, dst_parent_token, dst, responder))
3506        } else {
3507            None
3508        }
3509    }
3510
3511    #[allow(irrefutable_let_patterns)]
3512    pub fn into_create_symlink(
3513        self,
3514    ) -> Option<(
3515        String,
3516        Vec<u8>,
3517        Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3518        DirectoryCreateSymlinkResponder,
3519    )> {
3520        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
3521            Some((name, target, connection, responder))
3522        } else {
3523            None
3524        }
3525    }
3526
3527    #[allow(irrefutable_let_patterns)]
3528    pub fn into_watch(
3529        self,
3530    ) -> Option<(
3531        WatchMask,
3532        u32,
3533        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3534        DirectoryWatchResponder,
3535    )> {
3536        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
3537            Some((mask, options, watcher, responder))
3538        } else {
3539            None
3540        }
3541    }
3542
3543    /// Name of the method defined in FIDL
3544    pub fn method_name(&self) -> &'static str {
3545        match *self {
3546            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
3547            DirectoryRequest::Clone { .. } => "clone",
3548            DirectoryRequest::Close { .. } => "close",
3549            DirectoryRequest::Query { .. } => "query",
3550            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
3551            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
3552            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
3553            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
3554            DirectoryRequest::GetFlags { .. } => "get_flags",
3555            DirectoryRequest::SetFlags { .. } => "set_flags",
3556            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
3557            DirectoryRequest::GetToken { .. } => "get_token",
3558            DirectoryRequest::GetAttributes { .. } => "get_attributes",
3559            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
3560            DirectoryRequest::Sync { .. } => "sync",
3561            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
3562            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
3563            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
3564            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
3565            DirectoryRequest::Open { .. } => "open",
3566            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
3567            DirectoryRequest::ReadDirents { .. } => "read_dirents",
3568            DirectoryRequest::Rewind { .. } => "rewind",
3569            DirectoryRequest::DeprecatedGetToken { .. } => "deprecated_get_token",
3570            DirectoryRequest::Link { .. } => "link",
3571            DirectoryRequest::Unlink { .. } => "unlink",
3572            DirectoryRequest::Rename { .. } => "rename",
3573            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
3574            DirectoryRequest::Watch { .. } => "watch",
3575            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3576                "unknown one-way method"
3577            }
3578            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3579                "unknown two-way method"
3580            }
3581        }
3582    }
3583}
3584
3585#[derive(Debug, Clone)]
3586pub struct DirectoryControlHandle {
3587    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3588}
3589
3590impl DirectoryControlHandle {
3591    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3592        self.inner.shutdown_with_epitaph(status.into())
3593    }
3594}
3595
3596impl fdomain_client::fidl::ControlHandle for DirectoryControlHandle {
3597    fn shutdown(&self) {
3598        self.inner.shutdown()
3599    }
3600
3601    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3602        self.inner.shutdown_with_epitaph(status)
3603    }
3604
3605    fn is_closed(&self) -> bool {
3606        self.inner.channel().is_closed()
3607    }
3608    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3609        self.inner.channel().on_closed()
3610    }
3611}
3612
3613impl DirectoryControlHandle {
3614    pub fn send_on_open_(
3615        &self,
3616        mut s: i32,
3617        mut info: Option<NodeInfoDeprecated>,
3618    ) -> Result<(), fidl::Error> {
3619        self.inner.send::<NodeOnOpenRequest>(
3620            (s, info.as_mut()),
3621            0,
3622            0x7fc7bbb1dbfd1972,
3623            fidl::encoding::DynamicFlags::FLEXIBLE,
3624        )
3625    }
3626
3627    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
3628        self.inner.send::<Representation>(
3629            &mut payload,
3630            0,
3631            0x5cb40567d80a510c,
3632            fidl::encoding::DynamicFlags::empty(),
3633        )
3634    }
3635}
3636
3637#[must_use = "FIDL methods require a response to be sent"]
3638#[derive(Debug)]
3639pub struct DirectoryAdvisoryLockResponder {
3640    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3641    tx_id: u32,
3642}
3643
3644/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3645/// if the responder is dropped without sending a response, so that the client
3646/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3647impl std::ops::Drop for DirectoryAdvisoryLockResponder {
3648    fn drop(&mut self) {
3649        self.control_handle.shutdown();
3650        // Safety: drops once, never accessed again
3651        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3652    }
3653}
3654
3655impl fdomain_client::fidl::Responder for DirectoryAdvisoryLockResponder {
3656    type ControlHandle = DirectoryControlHandle;
3657
3658    fn control_handle(&self) -> &DirectoryControlHandle {
3659        &self.control_handle
3660    }
3661
3662    fn drop_without_shutdown(mut self) {
3663        // Safety: drops once, never accessed again due to mem::forget
3664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3665        // Prevent Drop from running (which would shut down the channel)
3666        std::mem::forget(self);
3667    }
3668}
3669
3670impl DirectoryAdvisoryLockResponder {
3671    /// Sends a response to the FIDL transaction.
3672    ///
3673    /// Sets the channel to shutdown if an error occurs.
3674    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3675        let _result = self.send_raw(result);
3676        if _result.is_err() {
3677            self.control_handle.shutdown();
3678        }
3679        self.drop_without_shutdown();
3680        _result
3681    }
3682
3683    /// Similar to "send" but does not shutdown the channel if an error occurs.
3684    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3685        let _result = self.send_raw(result);
3686        self.drop_without_shutdown();
3687        _result
3688    }
3689
3690    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3691        self.control_handle
3692            .inner
3693            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3694                result,
3695                self.tx_id,
3696                0x6ee9c0ad53ec87aa,
3697                fidl::encoding::DynamicFlags::empty(),
3698            )
3699    }
3700}
3701
3702#[must_use = "FIDL methods require a response to be sent"]
3703#[derive(Debug)]
3704pub struct DirectoryCloseResponder {
3705    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3706    tx_id: u32,
3707}
3708
3709/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3710/// if the responder is dropped without sending a response, so that the client
3711/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3712impl std::ops::Drop for DirectoryCloseResponder {
3713    fn drop(&mut self) {
3714        self.control_handle.shutdown();
3715        // Safety: drops once, never accessed again
3716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3717    }
3718}
3719
3720impl fdomain_client::fidl::Responder for DirectoryCloseResponder {
3721    type ControlHandle = DirectoryControlHandle;
3722
3723    fn control_handle(&self) -> &DirectoryControlHandle {
3724        &self.control_handle
3725    }
3726
3727    fn drop_without_shutdown(mut self) {
3728        // Safety: drops once, never accessed again due to mem::forget
3729        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3730        // Prevent Drop from running (which would shut down the channel)
3731        std::mem::forget(self);
3732    }
3733}
3734
3735impl DirectoryCloseResponder {
3736    /// Sends a response to the FIDL transaction.
3737    ///
3738    /// Sets the channel to shutdown if an error occurs.
3739    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3740        let _result = self.send_raw(result);
3741        if _result.is_err() {
3742            self.control_handle.shutdown();
3743        }
3744        self.drop_without_shutdown();
3745        _result
3746    }
3747
3748    /// Similar to "send" but does not shutdown the channel if an error occurs.
3749    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3750        let _result = self.send_raw(result);
3751        self.drop_without_shutdown();
3752        _result
3753    }
3754
3755    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3756        self.control_handle
3757            .inner
3758            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3759                result,
3760                self.tx_id,
3761                0x5ac5d459ad7f657e,
3762                fidl::encoding::DynamicFlags::empty(),
3763            )
3764    }
3765}
3766
3767#[must_use = "FIDL methods require a response to be sent"]
3768#[derive(Debug)]
3769pub struct DirectoryQueryResponder {
3770    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3771    tx_id: u32,
3772}
3773
3774/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3775/// if the responder is dropped without sending a response, so that the client
3776/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3777impl std::ops::Drop for DirectoryQueryResponder {
3778    fn drop(&mut self) {
3779        self.control_handle.shutdown();
3780        // Safety: drops once, never accessed again
3781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3782    }
3783}
3784
3785impl fdomain_client::fidl::Responder for DirectoryQueryResponder {
3786    type ControlHandle = DirectoryControlHandle;
3787
3788    fn control_handle(&self) -> &DirectoryControlHandle {
3789        &self.control_handle
3790    }
3791
3792    fn drop_without_shutdown(mut self) {
3793        // Safety: drops once, never accessed again due to mem::forget
3794        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3795        // Prevent Drop from running (which would shut down the channel)
3796        std::mem::forget(self);
3797    }
3798}
3799
3800impl DirectoryQueryResponder {
3801    /// Sends a response to the FIDL transaction.
3802    ///
3803    /// Sets the channel to shutdown if an error occurs.
3804    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3805        let _result = self.send_raw(protocol);
3806        if _result.is_err() {
3807            self.control_handle.shutdown();
3808        }
3809        self.drop_without_shutdown();
3810        _result
3811    }
3812
3813    /// Similar to "send" but does not shutdown the channel if an error occurs.
3814    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3815        let _result = self.send_raw(protocol);
3816        self.drop_without_shutdown();
3817        _result
3818    }
3819
3820    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3821        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
3822            (protocol,),
3823            self.tx_id,
3824            0x2658edee9decfc06,
3825            fidl::encoding::DynamicFlags::empty(),
3826        )
3827    }
3828}
3829
3830#[must_use = "FIDL methods require a response to be sent"]
3831#[derive(Debug)]
3832pub struct DirectoryDeprecatedGetAttrResponder {
3833    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3834    tx_id: u32,
3835}
3836
3837/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3838/// if the responder is dropped without sending a response, so that the client
3839/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3840impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
3841    fn drop(&mut self) {
3842        self.control_handle.shutdown();
3843        // Safety: drops once, never accessed again
3844        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3845    }
3846}
3847
3848impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetAttrResponder {
3849    type ControlHandle = DirectoryControlHandle;
3850
3851    fn control_handle(&self) -> &DirectoryControlHandle {
3852        &self.control_handle
3853    }
3854
3855    fn drop_without_shutdown(mut self) {
3856        // Safety: drops once, never accessed again due to mem::forget
3857        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3858        // Prevent Drop from running (which would shut down the channel)
3859        std::mem::forget(self);
3860    }
3861}
3862
3863impl DirectoryDeprecatedGetAttrResponder {
3864    /// Sends a response to the FIDL transaction.
3865    ///
3866    /// Sets the channel to shutdown if an error occurs.
3867    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3868        let _result = self.send_raw(s, attributes);
3869        if _result.is_err() {
3870            self.control_handle.shutdown();
3871        }
3872        self.drop_without_shutdown();
3873        _result
3874    }
3875
3876    /// Similar to "send" but does not shutdown the channel if an error occurs.
3877    pub fn send_no_shutdown_on_err(
3878        self,
3879        mut s: i32,
3880        mut attributes: &NodeAttributes,
3881    ) -> Result<(), fidl::Error> {
3882        let _result = self.send_raw(s, attributes);
3883        self.drop_without_shutdown();
3884        _result
3885    }
3886
3887    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3888        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
3889            (s, attributes),
3890            self.tx_id,
3891            0x78985e216314dafd,
3892            fidl::encoding::DynamicFlags::empty(),
3893        )
3894    }
3895}
3896
3897#[must_use = "FIDL methods require a response to be sent"]
3898#[derive(Debug)]
3899pub struct DirectoryDeprecatedSetAttrResponder {
3900    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3901    tx_id: u32,
3902}
3903
3904/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3905/// if the responder is dropped without sending a response, so that the client
3906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3907impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
3908    fn drop(&mut self) {
3909        self.control_handle.shutdown();
3910        // Safety: drops once, never accessed again
3911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3912    }
3913}
3914
3915impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetAttrResponder {
3916    type ControlHandle = DirectoryControlHandle;
3917
3918    fn control_handle(&self) -> &DirectoryControlHandle {
3919        &self.control_handle
3920    }
3921
3922    fn drop_without_shutdown(mut self) {
3923        // Safety: drops once, never accessed again due to mem::forget
3924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3925        // Prevent Drop from running (which would shut down the channel)
3926        std::mem::forget(self);
3927    }
3928}
3929
3930impl DirectoryDeprecatedSetAttrResponder {
3931    /// Sends a response to the FIDL transaction.
3932    ///
3933    /// Sets the channel to shutdown if an error occurs.
3934    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
3935        let _result = self.send_raw(s);
3936        if _result.is_err() {
3937            self.control_handle.shutdown();
3938        }
3939        self.drop_without_shutdown();
3940        _result
3941    }
3942
3943    /// Similar to "send" but does not shutdown the channel if an error occurs.
3944    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
3945        let _result = self.send_raw(s);
3946        self.drop_without_shutdown();
3947        _result
3948    }
3949
3950    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
3951        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
3952            (s,),
3953            self.tx_id,
3954            0x4186c0f40d938f46,
3955            fidl::encoding::DynamicFlags::empty(),
3956        )
3957    }
3958}
3959
3960#[must_use = "FIDL methods require a response to be sent"]
3961#[derive(Debug)]
3962pub struct DirectoryDeprecatedGetFlagsResponder {
3963    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3964    tx_id: u32,
3965}
3966
3967/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3968/// if the responder is dropped without sending a response, so that the client
3969/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3970impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
3971    fn drop(&mut self) {
3972        self.control_handle.shutdown();
3973        // Safety: drops once, never accessed again
3974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3975    }
3976}
3977
3978impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetFlagsResponder {
3979    type ControlHandle = DirectoryControlHandle;
3980
3981    fn control_handle(&self) -> &DirectoryControlHandle {
3982        &self.control_handle
3983    }
3984
3985    fn drop_without_shutdown(mut self) {
3986        // Safety: drops once, never accessed again due to mem::forget
3987        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3988        // Prevent Drop from running (which would shut down the channel)
3989        std::mem::forget(self);
3990    }
3991}
3992
3993impl DirectoryDeprecatedGetFlagsResponder {
3994    /// Sends a response to the FIDL transaction.
3995    ///
3996    /// Sets the channel to shutdown if an error occurs.
3997    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3998        let _result = self.send_raw(s, flags);
3999        if _result.is_err() {
4000            self.control_handle.shutdown();
4001        }
4002        self.drop_without_shutdown();
4003        _result
4004    }
4005
4006    /// Similar to "send" but does not shutdown the channel if an error occurs.
4007    pub fn send_no_shutdown_on_err(
4008        self,
4009        mut s: i32,
4010        mut flags: OpenFlags,
4011    ) -> Result<(), fidl::Error> {
4012        let _result = self.send_raw(s, flags);
4013        self.drop_without_shutdown();
4014        _result
4015    }
4016
4017    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4018        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4019            (s, flags),
4020            self.tx_id,
4021            0x5b88fffb8eda3aa1,
4022            fidl::encoding::DynamicFlags::empty(),
4023        )
4024    }
4025}
4026
4027#[must_use = "FIDL methods require a response to be sent"]
4028#[derive(Debug)]
4029pub struct DirectoryDeprecatedSetFlagsResponder {
4030    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4031    tx_id: u32,
4032}
4033
4034/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4035/// if the responder is dropped without sending a response, so that the client
4036/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4037impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4038    fn drop(&mut self) {
4039        self.control_handle.shutdown();
4040        // Safety: drops once, never accessed again
4041        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4042    }
4043}
4044
4045impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetFlagsResponder {
4046    type ControlHandle = DirectoryControlHandle;
4047
4048    fn control_handle(&self) -> &DirectoryControlHandle {
4049        &self.control_handle
4050    }
4051
4052    fn drop_without_shutdown(mut self) {
4053        // Safety: drops once, never accessed again due to mem::forget
4054        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4055        // Prevent Drop from running (which would shut down the channel)
4056        std::mem::forget(self);
4057    }
4058}
4059
4060impl DirectoryDeprecatedSetFlagsResponder {
4061    /// Sends a response to the FIDL transaction.
4062    ///
4063    /// Sets the channel to shutdown if an error occurs.
4064    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4065        let _result = self.send_raw(s);
4066        if _result.is_err() {
4067            self.control_handle.shutdown();
4068        }
4069        self.drop_without_shutdown();
4070        _result
4071    }
4072
4073    /// Similar to "send" but does not shutdown the channel if an error occurs.
4074    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4075        let _result = self.send_raw(s);
4076        self.drop_without_shutdown();
4077        _result
4078    }
4079
4080    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4081        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4082            (s,),
4083            self.tx_id,
4084            0x5295b76c71fde733,
4085            fidl::encoding::DynamicFlags::empty(),
4086        )
4087    }
4088}
4089
4090#[must_use = "FIDL methods require a response to be sent"]
4091#[derive(Debug)]
4092pub struct DirectoryGetFlagsResponder {
4093    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4094    tx_id: u32,
4095}
4096
4097/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4098/// if the responder is dropped without sending a response, so that the client
4099/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4100impl std::ops::Drop for DirectoryGetFlagsResponder {
4101    fn drop(&mut self) {
4102        self.control_handle.shutdown();
4103        // Safety: drops once, never accessed again
4104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4105    }
4106}
4107
4108impl fdomain_client::fidl::Responder for DirectoryGetFlagsResponder {
4109    type ControlHandle = DirectoryControlHandle;
4110
4111    fn control_handle(&self) -> &DirectoryControlHandle {
4112        &self.control_handle
4113    }
4114
4115    fn drop_without_shutdown(mut self) {
4116        // Safety: drops once, never accessed again due to mem::forget
4117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4118        // Prevent Drop from running (which would shut down the channel)
4119        std::mem::forget(self);
4120    }
4121}
4122
4123impl DirectoryGetFlagsResponder {
4124    /// Sends a response to the FIDL transaction.
4125    ///
4126    /// Sets the channel to shutdown if an error occurs.
4127    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4128        let _result = self.send_raw(result);
4129        if _result.is_err() {
4130            self.control_handle.shutdown();
4131        }
4132        self.drop_without_shutdown();
4133        _result
4134    }
4135
4136    /// Similar to "send" but does not shutdown the channel if an error occurs.
4137    pub fn send_no_shutdown_on_err(
4138        self,
4139        mut result: Result<Flags, i32>,
4140    ) -> Result<(), fidl::Error> {
4141        let _result = self.send_raw(result);
4142        self.drop_without_shutdown();
4143        _result
4144    }
4145
4146    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4147        self.control_handle
4148            .inner
4149            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4150                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4151                self.tx_id,
4152                0x176eb318f64ec23,
4153                fidl::encoding::DynamicFlags::FLEXIBLE,
4154            )
4155    }
4156}
4157
4158#[must_use = "FIDL methods require a response to be sent"]
4159#[derive(Debug)]
4160pub struct DirectorySetFlagsResponder {
4161    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4162    tx_id: u32,
4163}
4164
4165/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4166/// if the responder is dropped without sending a response, so that the client
4167/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4168impl std::ops::Drop for DirectorySetFlagsResponder {
4169    fn drop(&mut self) {
4170        self.control_handle.shutdown();
4171        // Safety: drops once, never accessed again
4172        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4173    }
4174}
4175
4176impl fdomain_client::fidl::Responder for DirectorySetFlagsResponder {
4177    type ControlHandle = DirectoryControlHandle;
4178
4179    fn control_handle(&self) -> &DirectoryControlHandle {
4180        &self.control_handle
4181    }
4182
4183    fn drop_without_shutdown(mut self) {
4184        // Safety: drops once, never accessed again due to mem::forget
4185        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4186        // Prevent Drop from running (which would shut down the channel)
4187        std::mem::forget(self);
4188    }
4189}
4190
4191impl DirectorySetFlagsResponder {
4192    /// Sends a response to the FIDL transaction.
4193    ///
4194    /// Sets the channel to shutdown if an error occurs.
4195    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4196        let _result = self.send_raw(result);
4197        if _result.is_err() {
4198            self.control_handle.shutdown();
4199        }
4200        self.drop_without_shutdown();
4201        _result
4202    }
4203
4204    /// Similar to "send" but does not shutdown the channel if an error occurs.
4205    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4206        let _result = self.send_raw(result);
4207        self.drop_without_shutdown();
4208        _result
4209    }
4210
4211    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4212        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4213            fidl::encoding::EmptyStruct,
4214            i32,
4215        >>(
4216            fidl::encoding::FlexibleResult::new(result),
4217            self.tx_id,
4218            0x55a8028685791ea8,
4219            fidl::encoding::DynamicFlags::FLEXIBLE,
4220        )
4221    }
4222}
4223
4224#[must_use = "FIDL methods require a response to be sent"]
4225#[derive(Debug)]
4226pub struct DirectoryQueryFilesystemResponder {
4227    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4228    tx_id: u32,
4229}
4230
4231/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4232/// if the responder is dropped without sending a response, so that the client
4233/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4234impl std::ops::Drop for DirectoryQueryFilesystemResponder {
4235    fn drop(&mut self) {
4236        self.control_handle.shutdown();
4237        // Safety: drops once, never accessed again
4238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4239    }
4240}
4241
4242impl fdomain_client::fidl::Responder for DirectoryQueryFilesystemResponder {
4243    type ControlHandle = DirectoryControlHandle;
4244
4245    fn control_handle(&self) -> &DirectoryControlHandle {
4246        &self.control_handle
4247    }
4248
4249    fn drop_without_shutdown(mut self) {
4250        // Safety: drops once, never accessed again due to mem::forget
4251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4252        // Prevent Drop from running (which would shut down the channel)
4253        std::mem::forget(self);
4254    }
4255}
4256
4257impl DirectoryQueryFilesystemResponder {
4258    /// Sends a response to the FIDL transaction.
4259    ///
4260    /// Sets the channel to shutdown if an error occurs.
4261    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4262        let _result = self.send_raw(s, info);
4263        if _result.is_err() {
4264            self.control_handle.shutdown();
4265        }
4266        self.drop_without_shutdown();
4267        _result
4268    }
4269
4270    /// Similar to "send" but does not shutdown the channel if an error occurs.
4271    pub fn send_no_shutdown_on_err(
4272        self,
4273        mut s: i32,
4274        mut info: Option<&FilesystemInfo>,
4275    ) -> Result<(), fidl::Error> {
4276        let _result = self.send_raw(s, info);
4277        self.drop_without_shutdown();
4278        _result
4279    }
4280
4281    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4282        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
4283            (s, info),
4284            self.tx_id,
4285            0x6f344a1c6b0a0610,
4286            fidl::encoding::DynamicFlags::empty(),
4287        )
4288    }
4289}
4290
4291#[must_use = "FIDL methods require a response to be sent"]
4292#[derive(Debug)]
4293pub struct DirectoryGetTokenResponder {
4294    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4295    tx_id: u32,
4296}
4297
4298/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4299/// if the responder is dropped without sending a response, so that the client
4300/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4301impl std::ops::Drop for DirectoryGetTokenResponder {
4302    fn drop(&mut self) {
4303        self.control_handle.shutdown();
4304        // Safety: drops once, never accessed again
4305        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4306    }
4307}
4308
4309impl fdomain_client::fidl::Responder for DirectoryGetTokenResponder {
4310    type ControlHandle = DirectoryControlHandle;
4311
4312    fn control_handle(&self) -> &DirectoryControlHandle {
4313        &self.control_handle
4314    }
4315
4316    fn drop_without_shutdown(mut self) {
4317        // Safety: drops once, never accessed again due to mem::forget
4318        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4319        // Prevent Drop from running (which would shut down the channel)
4320        std::mem::forget(self);
4321    }
4322}
4323
4324impl DirectoryGetTokenResponder {
4325    /// Sends a response to the FIDL transaction.
4326    ///
4327    /// Sets the channel to shutdown if an error occurs.
4328    pub fn send(self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
4329        let _result = self.send_raw(result);
4330        if _result.is_err() {
4331            self.control_handle.shutdown();
4332        }
4333        self.drop_without_shutdown();
4334        _result
4335    }
4336
4337    /// Similar to "send" but does not shutdown the channel if an error occurs.
4338    pub fn send_no_shutdown_on_err(
4339        self,
4340        mut result: Result<fdomain_client::Event, i32>,
4341    ) -> Result<(), fidl::Error> {
4342        let _result = self.send_raw(result);
4343        self.drop_without_shutdown();
4344        _result
4345    }
4346
4347    fn send_raw(&self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
4348        self.control_handle
4349            .inner
4350            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
4351                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
4352                self.tx_id,
4353                0x5054f0ade7076cec,
4354                fidl::encoding::DynamicFlags::FLEXIBLE,
4355            )
4356    }
4357}
4358
4359#[must_use = "FIDL methods require a response to be sent"]
4360#[derive(Debug)]
4361pub struct DirectoryGetAttributesResponder {
4362    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4363    tx_id: u32,
4364}
4365
4366/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4367/// if the responder is dropped without sending a response, so that the client
4368/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4369impl std::ops::Drop for DirectoryGetAttributesResponder {
4370    fn drop(&mut self) {
4371        self.control_handle.shutdown();
4372        // Safety: drops once, never accessed again
4373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4374    }
4375}
4376
4377impl fdomain_client::fidl::Responder for DirectoryGetAttributesResponder {
4378    type ControlHandle = DirectoryControlHandle;
4379
4380    fn control_handle(&self) -> &DirectoryControlHandle {
4381        &self.control_handle
4382    }
4383
4384    fn drop_without_shutdown(mut self) {
4385        // Safety: drops once, never accessed again due to mem::forget
4386        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4387        // Prevent Drop from running (which would shut down the channel)
4388        std::mem::forget(self);
4389    }
4390}
4391
4392impl DirectoryGetAttributesResponder {
4393    /// Sends a response to the FIDL transaction.
4394    ///
4395    /// Sets the channel to shutdown if an error occurs.
4396    pub fn send(
4397        self,
4398        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4399    ) -> Result<(), fidl::Error> {
4400        let _result = self.send_raw(result);
4401        if _result.is_err() {
4402            self.control_handle.shutdown();
4403        }
4404        self.drop_without_shutdown();
4405        _result
4406    }
4407
4408    /// Similar to "send" but does not shutdown the channel if an error occurs.
4409    pub fn send_no_shutdown_on_err(
4410        self,
4411        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4412    ) -> Result<(), fidl::Error> {
4413        let _result = self.send_raw(result);
4414        self.drop_without_shutdown();
4415        _result
4416    }
4417
4418    fn send_raw(
4419        &self,
4420        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4421    ) -> Result<(), fidl::Error> {
4422        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
4423            result,
4424            self.tx_id,
4425            0x3d4396a638ea053b,
4426            fidl::encoding::DynamicFlags::empty(),
4427        )
4428    }
4429}
4430
4431#[must_use = "FIDL methods require a response to be sent"]
4432#[derive(Debug)]
4433pub struct DirectoryUpdateAttributesResponder {
4434    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4435    tx_id: u32,
4436}
4437
4438/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4439/// if the responder is dropped without sending a response, so that the client
4440/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4441impl std::ops::Drop for DirectoryUpdateAttributesResponder {
4442    fn drop(&mut self) {
4443        self.control_handle.shutdown();
4444        // Safety: drops once, never accessed again
4445        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4446    }
4447}
4448
4449impl fdomain_client::fidl::Responder for DirectoryUpdateAttributesResponder {
4450    type ControlHandle = DirectoryControlHandle;
4451
4452    fn control_handle(&self) -> &DirectoryControlHandle {
4453        &self.control_handle
4454    }
4455
4456    fn drop_without_shutdown(mut self) {
4457        // Safety: drops once, never accessed again due to mem::forget
4458        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4459        // Prevent Drop from running (which would shut down the channel)
4460        std::mem::forget(self);
4461    }
4462}
4463
4464impl DirectoryUpdateAttributesResponder {
4465    /// Sends a response to the FIDL transaction.
4466    ///
4467    /// Sets the channel to shutdown if an error occurs.
4468    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4469        let _result = self.send_raw(result);
4470        if _result.is_err() {
4471            self.control_handle.shutdown();
4472        }
4473        self.drop_without_shutdown();
4474        _result
4475    }
4476
4477    /// Similar to "send" but does not shutdown the channel if an error occurs.
4478    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4479        let _result = self.send_raw(result);
4480        self.drop_without_shutdown();
4481        _result
4482    }
4483
4484    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4485        self.control_handle
4486            .inner
4487            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4488                result,
4489                self.tx_id,
4490                0x3308c1da5a89bf08,
4491                fidl::encoding::DynamicFlags::empty(),
4492            )
4493    }
4494}
4495
4496#[must_use = "FIDL methods require a response to be sent"]
4497#[derive(Debug)]
4498pub struct DirectorySyncResponder {
4499    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4500    tx_id: u32,
4501}
4502
4503/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4504/// if the responder is dropped without sending a response, so that the client
4505/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4506impl std::ops::Drop for DirectorySyncResponder {
4507    fn drop(&mut self) {
4508        self.control_handle.shutdown();
4509        // Safety: drops once, never accessed again
4510        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4511    }
4512}
4513
4514impl fdomain_client::fidl::Responder for DirectorySyncResponder {
4515    type ControlHandle = DirectoryControlHandle;
4516
4517    fn control_handle(&self) -> &DirectoryControlHandle {
4518        &self.control_handle
4519    }
4520
4521    fn drop_without_shutdown(mut self) {
4522        // Safety: drops once, never accessed again due to mem::forget
4523        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4524        // Prevent Drop from running (which would shut down the channel)
4525        std::mem::forget(self);
4526    }
4527}
4528
4529impl DirectorySyncResponder {
4530    /// Sends a response to the FIDL transaction.
4531    ///
4532    /// Sets the channel to shutdown if an error occurs.
4533    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4534        let _result = self.send_raw(result);
4535        if _result.is_err() {
4536            self.control_handle.shutdown();
4537        }
4538        self.drop_without_shutdown();
4539        _result
4540    }
4541
4542    /// Similar to "send" but does not shutdown the channel if an error occurs.
4543    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4544        let _result = self.send_raw(result);
4545        self.drop_without_shutdown();
4546        _result
4547    }
4548
4549    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4550        self.control_handle
4551            .inner
4552            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4553                result,
4554                self.tx_id,
4555                0x2c5c27ca0ab5dc49,
4556                fidl::encoding::DynamicFlags::empty(),
4557            )
4558    }
4559}
4560
4561#[must_use = "FIDL methods require a response to be sent"]
4562#[derive(Debug)]
4563pub struct DirectoryGetExtendedAttributeResponder {
4564    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4565    tx_id: u32,
4566}
4567
4568/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4569/// if the responder is dropped without sending a response, so that the client
4570/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4571impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
4572    fn drop(&mut self) {
4573        self.control_handle.shutdown();
4574        // Safety: drops once, never accessed again
4575        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4576    }
4577}
4578
4579impl fdomain_client::fidl::Responder for DirectoryGetExtendedAttributeResponder {
4580    type ControlHandle = DirectoryControlHandle;
4581
4582    fn control_handle(&self) -> &DirectoryControlHandle {
4583        &self.control_handle
4584    }
4585
4586    fn drop_without_shutdown(mut self) {
4587        // Safety: drops once, never accessed again due to mem::forget
4588        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4589        // Prevent Drop from running (which would shut down the channel)
4590        std::mem::forget(self);
4591    }
4592}
4593
4594impl DirectoryGetExtendedAttributeResponder {
4595    /// Sends a response to the FIDL transaction.
4596    ///
4597    /// Sets the channel to shutdown if an error occurs.
4598    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4599        let _result = self.send_raw(result);
4600        if _result.is_err() {
4601            self.control_handle.shutdown();
4602        }
4603        self.drop_without_shutdown();
4604        _result
4605    }
4606
4607    /// Similar to "send" but does not shutdown the channel if an error occurs.
4608    pub fn send_no_shutdown_on_err(
4609        self,
4610        mut result: Result<ExtendedAttributeValue, i32>,
4611    ) -> Result<(), fidl::Error> {
4612        let _result = self.send_raw(result);
4613        self.drop_without_shutdown();
4614        _result
4615    }
4616
4617    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4618        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
4619            result.as_mut().map_err(|e| *e),
4620            self.tx_id,
4621            0x45ffa3ccfdeb76db,
4622            fidl::encoding::DynamicFlags::empty(),
4623        )
4624    }
4625}
4626
4627#[must_use = "FIDL methods require a response to be sent"]
4628#[derive(Debug)]
4629pub struct DirectorySetExtendedAttributeResponder {
4630    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4631    tx_id: u32,
4632}
4633
4634/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4635/// if the responder is dropped without sending a response, so that the client
4636/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4637impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
4638    fn drop(&mut self) {
4639        self.control_handle.shutdown();
4640        // Safety: drops once, never accessed again
4641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4642    }
4643}
4644
4645impl fdomain_client::fidl::Responder for DirectorySetExtendedAttributeResponder {
4646    type ControlHandle = DirectoryControlHandle;
4647
4648    fn control_handle(&self) -> &DirectoryControlHandle {
4649        &self.control_handle
4650    }
4651
4652    fn drop_without_shutdown(mut self) {
4653        // Safety: drops once, never accessed again due to mem::forget
4654        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4655        // Prevent Drop from running (which would shut down the channel)
4656        std::mem::forget(self);
4657    }
4658}
4659
4660impl DirectorySetExtendedAttributeResponder {
4661    /// Sends a response to the FIDL transaction.
4662    ///
4663    /// Sets the channel to shutdown if an error occurs.
4664    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4665        let _result = self.send_raw(result);
4666        if _result.is_err() {
4667            self.control_handle.shutdown();
4668        }
4669        self.drop_without_shutdown();
4670        _result
4671    }
4672
4673    /// Similar to "send" but does not shutdown the channel if an error occurs.
4674    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4675        let _result = self.send_raw(result);
4676        self.drop_without_shutdown();
4677        _result
4678    }
4679
4680    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4681        self.control_handle
4682            .inner
4683            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4684                result,
4685                self.tx_id,
4686                0x4a951362f681f23c,
4687                fidl::encoding::DynamicFlags::empty(),
4688            )
4689    }
4690}
4691
4692#[must_use = "FIDL methods require a response to be sent"]
4693#[derive(Debug)]
4694pub struct DirectoryRemoveExtendedAttributeResponder {
4695    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4696    tx_id: u32,
4697}
4698
4699/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4700/// if the responder is dropped without sending a response, so that the client
4701/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4702impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
4703    fn drop(&mut self) {
4704        self.control_handle.shutdown();
4705        // Safety: drops once, never accessed again
4706        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4707    }
4708}
4709
4710impl fdomain_client::fidl::Responder for DirectoryRemoveExtendedAttributeResponder {
4711    type ControlHandle = DirectoryControlHandle;
4712
4713    fn control_handle(&self) -> &DirectoryControlHandle {
4714        &self.control_handle
4715    }
4716
4717    fn drop_without_shutdown(mut self) {
4718        // Safety: drops once, never accessed again due to mem::forget
4719        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4720        // Prevent Drop from running (which would shut down the channel)
4721        std::mem::forget(self);
4722    }
4723}
4724
4725impl DirectoryRemoveExtendedAttributeResponder {
4726    /// Sends a response to the FIDL transaction.
4727    ///
4728    /// Sets the channel to shutdown if an error occurs.
4729    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4730        let _result = self.send_raw(result);
4731        if _result.is_err() {
4732            self.control_handle.shutdown();
4733        }
4734        self.drop_without_shutdown();
4735        _result
4736    }
4737
4738    /// Similar to "send" but does not shutdown the channel if an error occurs.
4739    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4740        let _result = self.send_raw(result);
4741        self.drop_without_shutdown();
4742        _result
4743    }
4744
4745    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4746        self.control_handle
4747            .inner
4748            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4749                result,
4750                self.tx_id,
4751                0x7a0b9f3a9bf9032d,
4752                fidl::encoding::DynamicFlags::empty(),
4753            )
4754    }
4755}
4756
4757#[must_use = "FIDL methods require a response to be sent"]
4758#[derive(Debug)]
4759pub struct DirectoryReadDirentsResponder {
4760    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4761    tx_id: u32,
4762}
4763
4764/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4765/// if the responder is dropped without sending a response, so that the client
4766/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4767impl std::ops::Drop for DirectoryReadDirentsResponder {
4768    fn drop(&mut self) {
4769        self.control_handle.shutdown();
4770        // Safety: drops once, never accessed again
4771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4772    }
4773}
4774
4775impl fdomain_client::fidl::Responder for DirectoryReadDirentsResponder {
4776    type ControlHandle = DirectoryControlHandle;
4777
4778    fn control_handle(&self) -> &DirectoryControlHandle {
4779        &self.control_handle
4780    }
4781
4782    fn drop_without_shutdown(mut self) {
4783        // Safety: drops once, never accessed again due to mem::forget
4784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4785        // Prevent Drop from running (which would shut down the channel)
4786        std::mem::forget(self);
4787    }
4788}
4789
4790impl DirectoryReadDirentsResponder {
4791    /// Sends a response to the FIDL transaction.
4792    ///
4793    /// Sets the channel to shutdown if an error occurs.
4794    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4795        let _result = self.send_raw(s, dirents);
4796        if _result.is_err() {
4797            self.control_handle.shutdown();
4798        }
4799        self.drop_without_shutdown();
4800        _result
4801    }
4802
4803    /// Similar to "send" but does not shutdown the channel if an error occurs.
4804    pub fn send_no_shutdown_on_err(
4805        self,
4806        mut s: i32,
4807        mut dirents: &[u8],
4808    ) -> Result<(), fidl::Error> {
4809        let _result = self.send_raw(s, dirents);
4810        self.drop_without_shutdown();
4811        _result
4812    }
4813
4814    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4815        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
4816            (s, dirents),
4817            self.tx_id,
4818            0x3582806bf27faa0a,
4819            fidl::encoding::DynamicFlags::empty(),
4820        )
4821    }
4822}
4823
4824#[must_use = "FIDL methods require a response to be sent"]
4825#[derive(Debug)]
4826pub struct DirectoryRewindResponder {
4827    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4828    tx_id: u32,
4829}
4830
4831/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4832/// if the responder is dropped without sending a response, so that the client
4833/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4834impl std::ops::Drop for DirectoryRewindResponder {
4835    fn drop(&mut self) {
4836        self.control_handle.shutdown();
4837        // Safety: drops once, never accessed again
4838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4839    }
4840}
4841
4842impl fdomain_client::fidl::Responder for DirectoryRewindResponder {
4843    type ControlHandle = DirectoryControlHandle;
4844
4845    fn control_handle(&self) -> &DirectoryControlHandle {
4846        &self.control_handle
4847    }
4848
4849    fn drop_without_shutdown(mut self) {
4850        // Safety: drops once, never accessed again due to mem::forget
4851        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4852        // Prevent Drop from running (which would shut down the channel)
4853        std::mem::forget(self);
4854    }
4855}
4856
4857impl DirectoryRewindResponder {
4858    /// Sends a response to the FIDL transaction.
4859    ///
4860    /// Sets the channel to shutdown if an error occurs.
4861    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4862        let _result = self.send_raw(s);
4863        if _result.is_err() {
4864            self.control_handle.shutdown();
4865        }
4866        self.drop_without_shutdown();
4867        _result
4868    }
4869
4870    /// Similar to "send" but does not shutdown the channel if an error occurs.
4871    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4872        let _result = self.send_raw(s);
4873        self.drop_without_shutdown();
4874        _result
4875    }
4876
4877    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4878        self.control_handle.inner.send::<DirectoryRewindResponse>(
4879            (s,),
4880            self.tx_id,
4881            0x16b1202af0f34c71,
4882            fidl::encoding::DynamicFlags::empty(),
4883        )
4884    }
4885}
4886
4887#[must_use = "FIDL methods require a response to be sent"]
4888#[derive(Debug)]
4889pub struct DirectoryDeprecatedGetTokenResponder {
4890    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4891    tx_id: u32,
4892}
4893
4894/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4895/// if the responder is dropped without sending a response, so that the client
4896/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4897impl std::ops::Drop for DirectoryDeprecatedGetTokenResponder {
4898    fn drop(&mut self) {
4899        self.control_handle.shutdown();
4900        // Safety: drops once, never accessed again
4901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4902    }
4903}
4904
4905impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetTokenResponder {
4906    type ControlHandle = DirectoryControlHandle;
4907
4908    fn control_handle(&self) -> &DirectoryControlHandle {
4909        &self.control_handle
4910    }
4911
4912    fn drop_without_shutdown(mut self) {
4913        // Safety: drops once, never accessed again due to mem::forget
4914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4915        // Prevent Drop from running (which would shut down the channel)
4916        std::mem::forget(self);
4917    }
4918}
4919
4920impl DirectoryDeprecatedGetTokenResponder {
4921    /// Sends a response to the FIDL transaction.
4922    ///
4923    /// Sets the channel to shutdown if an error occurs.
4924    pub fn send(
4925        self,
4926        mut s: i32,
4927        mut token: Option<fdomain_client::NullableHandle>,
4928    ) -> Result<(), fidl::Error> {
4929        let _result = self.send_raw(s, token);
4930        if _result.is_err() {
4931            self.control_handle.shutdown();
4932        }
4933        self.drop_without_shutdown();
4934        _result
4935    }
4936
4937    /// Similar to "send" but does not shutdown the channel if an error occurs.
4938    pub fn send_no_shutdown_on_err(
4939        self,
4940        mut s: i32,
4941        mut token: Option<fdomain_client::NullableHandle>,
4942    ) -> Result<(), fidl::Error> {
4943        let _result = self.send_raw(s, token);
4944        self.drop_without_shutdown();
4945        _result
4946    }
4947
4948    fn send_raw(
4949        &self,
4950        mut s: i32,
4951        mut token: Option<fdomain_client::NullableHandle>,
4952    ) -> Result<(), fidl::Error> {
4953        self.control_handle.inner.send::<DirectoryDeprecatedGetTokenResponse>(
4954            (s, token),
4955            self.tx_id,
4956            0x26ae9d18763c8655,
4957            fidl::encoding::DynamicFlags::empty(),
4958        )
4959    }
4960}
4961
4962#[must_use = "FIDL methods require a response to be sent"]
4963#[derive(Debug)]
4964pub struct DirectoryLinkResponder {
4965    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4966    tx_id: u32,
4967}
4968
4969/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4970/// if the responder is dropped without sending a response, so that the client
4971/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4972impl std::ops::Drop for DirectoryLinkResponder {
4973    fn drop(&mut self) {
4974        self.control_handle.shutdown();
4975        // Safety: drops once, never accessed again
4976        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4977    }
4978}
4979
4980impl fdomain_client::fidl::Responder for DirectoryLinkResponder {
4981    type ControlHandle = DirectoryControlHandle;
4982
4983    fn control_handle(&self) -> &DirectoryControlHandle {
4984        &self.control_handle
4985    }
4986
4987    fn drop_without_shutdown(mut self) {
4988        // Safety: drops once, never accessed again due to mem::forget
4989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4990        // Prevent Drop from running (which would shut down the channel)
4991        std::mem::forget(self);
4992    }
4993}
4994
4995impl DirectoryLinkResponder {
4996    /// Sends a response to the FIDL transaction.
4997    ///
4998    /// Sets the channel to shutdown if an error occurs.
4999    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5000        let _result = self.send_raw(s);
5001        if _result.is_err() {
5002            self.control_handle.shutdown();
5003        }
5004        self.drop_without_shutdown();
5005        _result
5006    }
5007
5008    /// Similar to "send" but does not shutdown the channel if an error occurs.
5009    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5010        let _result = self.send_raw(s);
5011        self.drop_without_shutdown();
5012        _result
5013    }
5014
5015    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5016        self.control_handle.inner.send::<DirectoryLinkResponse>(
5017            (s,),
5018            self.tx_id,
5019            0x740604c0c7c930e7,
5020            fidl::encoding::DynamicFlags::empty(),
5021        )
5022    }
5023}
5024
5025#[must_use = "FIDL methods require a response to be sent"]
5026#[derive(Debug)]
5027pub struct DirectoryUnlinkResponder {
5028    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5029    tx_id: u32,
5030}
5031
5032/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5033/// if the responder is dropped without sending a response, so that the client
5034/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5035impl std::ops::Drop for DirectoryUnlinkResponder {
5036    fn drop(&mut self) {
5037        self.control_handle.shutdown();
5038        // Safety: drops once, never accessed again
5039        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5040    }
5041}
5042
5043impl fdomain_client::fidl::Responder for DirectoryUnlinkResponder {
5044    type ControlHandle = DirectoryControlHandle;
5045
5046    fn control_handle(&self) -> &DirectoryControlHandle {
5047        &self.control_handle
5048    }
5049
5050    fn drop_without_shutdown(mut self) {
5051        // Safety: drops once, never accessed again due to mem::forget
5052        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5053        // Prevent Drop from running (which would shut down the channel)
5054        std::mem::forget(self);
5055    }
5056}
5057
5058impl DirectoryUnlinkResponder {
5059    /// Sends a response to the FIDL transaction.
5060    ///
5061    /// Sets the channel to shutdown if an error occurs.
5062    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5063        let _result = self.send_raw(result);
5064        if _result.is_err() {
5065            self.control_handle.shutdown();
5066        }
5067        self.drop_without_shutdown();
5068        _result
5069    }
5070
5071    /// Similar to "send" but does not shutdown the channel if an error occurs.
5072    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5073        let _result = self.send_raw(result);
5074        self.drop_without_shutdown();
5075        _result
5076    }
5077
5078    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5079        self.control_handle
5080            .inner
5081            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5082                result,
5083                self.tx_id,
5084                0x750a0326a78d7bed,
5085                fidl::encoding::DynamicFlags::empty(),
5086            )
5087    }
5088}
5089
5090#[must_use = "FIDL methods require a response to be sent"]
5091#[derive(Debug)]
5092pub struct DirectoryRenameResponder {
5093    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5094    tx_id: u32,
5095}
5096
5097/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5098/// if the responder is dropped without sending a response, so that the client
5099/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5100impl std::ops::Drop for DirectoryRenameResponder {
5101    fn drop(&mut self) {
5102        self.control_handle.shutdown();
5103        // Safety: drops once, never accessed again
5104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5105    }
5106}
5107
5108impl fdomain_client::fidl::Responder for DirectoryRenameResponder {
5109    type ControlHandle = DirectoryControlHandle;
5110
5111    fn control_handle(&self) -> &DirectoryControlHandle {
5112        &self.control_handle
5113    }
5114
5115    fn drop_without_shutdown(mut self) {
5116        // Safety: drops once, never accessed again due to mem::forget
5117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5118        // Prevent Drop from running (which would shut down the channel)
5119        std::mem::forget(self);
5120    }
5121}
5122
5123impl DirectoryRenameResponder {
5124    /// Sends a response to the FIDL transaction.
5125    ///
5126    /// Sets the channel to shutdown if an error occurs.
5127    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5128        let _result = self.send_raw(result);
5129        if _result.is_err() {
5130            self.control_handle.shutdown();
5131        }
5132        self.drop_without_shutdown();
5133        _result
5134    }
5135
5136    /// Similar to "send" but does not shutdown the channel if an error occurs.
5137    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5138        let _result = self.send_raw(result);
5139        self.drop_without_shutdown();
5140        _result
5141    }
5142
5143    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5144        self.control_handle
5145            .inner
5146            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5147                result,
5148                self.tx_id,
5149                0x7060e7723b9928de,
5150                fidl::encoding::DynamicFlags::empty(),
5151            )
5152    }
5153}
5154
5155#[must_use = "FIDL methods require a response to be sent"]
5156#[derive(Debug)]
5157pub struct DirectoryCreateSymlinkResponder {
5158    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5159    tx_id: u32,
5160}
5161
5162/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5163/// if the responder is dropped without sending a response, so that the client
5164/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5165impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5166    fn drop(&mut self) {
5167        self.control_handle.shutdown();
5168        // Safety: drops once, never accessed again
5169        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5170    }
5171}
5172
5173impl fdomain_client::fidl::Responder for DirectoryCreateSymlinkResponder {
5174    type ControlHandle = DirectoryControlHandle;
5175
5176    fn control_handle(&self) -> &DirectoryControlHandle {
5177        &self.control_handle
5178    }
5179
5180    fn drop_without_shutdown(mut self) {
5181        // Safety: drops once, never accessed again due to mem::forget
5182        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5183        // Prevent Drop from running (which would shut down the channel)
5184        std::mem::forget(self);
5185    }
5186}
5187
5188impl DirectoryCreateSymlinkResponder {
5189    /// Sends a response to the FIDL transaction.
5190    ///
5191    /// Sets the channel to shutdown if an error occurs.
5192    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5193        let _result = self.send_raw(result);
5194        if _result.is_err() {
5195            self.control_handle.shutdown();
5196        }
5197        self.drop_without_shutdown();
5198        _result
5199    }
5200
5201    /// Similar to "send" but does not shutdown the channel if an error occurs.
5202    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5203        let _result = self.send_raw(result);
5204        self.drop_without_shutdown();
5205        _result
5206    }
5207
5208    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5209        self.control_handle
5210            .inner
5211            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5212                result,
5213                self.tx_id,
5214                0x21ce0f19ec043889,
5215                fidl::encoding::DynamicFlags::empty(),
5216            )
5217    }
5218}
5219
5220#[must_use = "FIDL methods require a response to be sent"]
5221#[derive(Debug)]
5222pub struct DirectoryWatchResponder {
5223    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5224    tx_id: u32,
5225}
5226
5227/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5228/// if the responder is dropped without sending a response, so that the client
5229/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5230impl std::ops::Drop for DirectoryWatchResponder {
5231    fn drop(&mut self) {
5232        self.control_handle.shutdown();
5233        // Safety: drops once, never accessed again
5234        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5235    }
5236}
5237
5238impl fdomain_client::fidl::Responder for DirectoryWatchResponder {
5239    type ControlHandle = DirectoryControlHandle;
5240
5241    fn control_handle(&self) -> &DirectoryControlHandle {
5242        &self.control_handle
5243    }
5244
5245    fn drop_without_shutdown(mut self) {
5246        // Safety: drops once, never accessed again due to mem::forget
5247        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5248        // Prevent Drop from running (which would shut down the channel)
5249        std::mem::forget(self);
5250    }
5251}
5252
5253impl DirectoryWatchResponder {
5254    /// Sends a response to the FIDL transaction.
5255    ///
5256    /// Sets the channel to shutdown if an error occurs.
5257    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5258        let _result = self.send_raw(s);
5259        if _result.is_err() {
5260            self.control_handle.shutdown();
5261        }
5262        self.drop_without_shutdown();
5263        _result
5264    }
5265
5266    /// Similar to "send" but does not shutdown the channel if an error occurs.
5267    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5268        let _result = self.send_raw(s);
5269        self.drop_without_shutdown();
5270        _result
5271    }
5272
5273    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5274        self.control_handle.inner.send::<DirectoryWatchResponse>(
5275            (s,),
5276            self.tx_id,
5277            0x5717193a59d66d91,
5278            fidl::encoding::DynamicFlags::empty(),
5279        )
5280    }
5281}
5282
5283#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5284pub struct DirectoryWatcherMarker;
5285
5286impl fdomain_client::fidl::ProtocolMarker for DirectoryWatcherMarker {
5287    type Proxy = DirectoryWatcherProxy;
5288    type RequestStream = DirectoryWatcherRequestStream;
5289
5290    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
5291}
5292
5293pub trait DirectoryWatcherProxyInterface: Send + Sync {}
5294
5295#[derive(Debug, Clone)]
5296pub struct DirectoryWatcherProxy {
5297    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5298}
5299
5300impl fdomain_client::fidl::Proxy for DirectoryWatcherProxy {
5301    type Protocol = DirectoryWatcherMarker;
5302
5303    fn from_channel(inner: fdomain_client::Channel) -> Self {
5304        Self::new(inner)
5305    }
5306
5307    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5308        self.client.into_channel().map_err(|client| Self { client })
5309    }
5310
5311    fn as_channel(&self) -> &fdomain_client::Channel {
5312        self.client.as_channel()
5313    }
5314}
5315
5316impl DirectoryWatcherProxy {
5317    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
5318    pub fn new(channel: fdomain_client::Channel) -> Self {
5319        let protocol_name =
5320            <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5321        Self { client: fidl::client::Client::new(channel, protocol_name) }
5322    }
5323
5324    /// Get a Stream of events from the remote end of the protocol.
5325    ///
5326    /// # Panics
5327    ///
5328    /// Panics if the event stream was already taken.
5329    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
5330        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
5331    }
5332}
5333
5334impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
5335
5336pub struct DirectoryWatcherEventStream {
5337    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5338}
5339
5340impl std::marker::Unpin for DirectoryWatcherEventStream {}
5341
5342impl futures::stream::FusedStream for DirectoryWatcherEventStream {
5343    fn is_terminated(&self) -> bool {
5344        self.event_receiver.is_terminated()
5345    }
5346}
5347
5348impl futures::Stream for DirectoryWatcherEventStream {
5349    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
5350
5351    fn poll_next(
5352        mut self: std::pin::Pin<&mut Self>,
5353        cx: &mut std::task::Context<'_>,
5354    ) -> std::task::Poll<Option<Self::Item>> {
5355        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5356            &mut self.event_receiver,
5357            cx
5358        )?) {
5359            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
5360            None => std::task::Poll::Ready(None),
5361        }
5362    }
5363}
5364
5365#[derive(Debug)]
5366pub enum DirectoryWatcherEvent {}
5367
5368impl DirectoryWatcherEvent {
5369    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
5370    fn decode(
5371        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5372    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
5373        let (bytes, _handles) = buf.split_mut();
5374        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5375        debug_assert_eq!(tx_header.tx_id, 0);
5376        match tx_header.ordinal {
5377            _ => Err(fidl::Error::UnknownOrdinal {
5378                ordinal: tx_header.ordinal,
5379                protocol_name:
5380                    <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5381            }),
5382        }
5383    }
5384}
5385
5386/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
5387pub struct DirectoryWatcherRequestStream {
5388    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5389    is_terminated: bool,
5390}
5391
5392impl std::marker::Unpin for DirectoryWatcherRequestStream {}
5393
5394impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
5395    fn is_terminated(&self) -> bool {
5396        self.is_terminated
5397    }
5398}
5399
5400impl fdomain_client::fidl::RequestStream for DirectoryWatcherRequestStream {
5401    type Protocol = DirectoryWatcherMarker;
5402    type ControlHandle = DirectoryWatcherControlHandle;
5403
5404    fn from_channel(channel: fdomain_client::Channel) -> Self {
5405        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5406    }
5407
5408    fn control_handle(&self) -> Self::ControlHandle {
5409        DirectoryWatcherControlHandle { inner: self.inner.clone() }
5410    }
5411
5412    fn into_inner(
5413        self,
5414    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5415    {
5416        (self.inner, self.is_terminated)
5417    }
5418
5419    fn from_inner(
5420        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5421        is_terminated: bool,
5422    ) -> Self {
5423        Self { inner, is_terminated }
5424    }
5425}
5426
5427impl futures::Stream for DirectoryWatcherRequestStream {
5428    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
5429
5430    fn poll_next(
5431        mut self: std::pin::Pin<&mut Self>,
5432        cx: &mut std::task::Context<'_>,
5433    ) -> std::task::Poll<Option<Self::Item>> {
5434        let this = &mut *self;
5435        if this.inner.check_shutdown(cx) {
5436            this.is_terminated = true;
5437            return std::task::Poll::Ready(None);
5438        }
5439        if this.is_terminated {
5440            panic!("polled DirectoryWatcherRequestStream after completion");
5441        }
5442        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5443            |bytes, handles| {
5444                match this.inner.channel().read_etc(cx, bytes, handles) {
5445                    std::task::Poll::Ready(Ok(())) => {}
5446                    std::task::Poll::Pending => return std::task::Poll::Pending,
5447                    std::task::Poll::Ready(Err(None)) => {
5448                        this.is_terminated = true;
5449                        return std::task::Poll::Ready(None);
5450                    }
5451                    std::task::Poll::Ready(Err(Some(e))) => {
5452                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5453                            e.into(),
5454                        ))));
5455                    }
5456                }
5457
5458                // A message has been received from the channel
5459                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5460
5461                std::task::Poll::Ready(Some(match header.ordinal {
5462                _ => Err(fidl::Error::UnknownOrdinal {
5463                    ordinal: header.ordinal,
5464                    protocol_name: <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5465                }),
5466            }))
5467            },
5468        )
5469    }
5470}
5471
5472/// DirectoryWatcher transmits messages from a filesystem server
5473/// about events happening in the filesystem. Clients can register
5474/// new watchers using the `Directory.Watch` method, where they can
5475/// filter which events they want to receive notifications for.
5476///
5477/// The DirectoryWatcher will send messages of the form:
5478/// ```
5479/// struct {
5480///   uint8 event;
5481///   uint8 len;
5482///   char name[];
5483/// };
5484/// ```
5485/// Where names are NOT null-terminated. The name is the relative
5486/// path to the entry the event is refering to. It will be empty if
5487/// the event isn't referencing a particular entry (e.g. for the
5488/// `IDLE` event).
5489#[derive(Debug)]
5490pub enum DirectoryWatcherRequest {}
5491
5492impl DirectoryWatcherRequest {
5493    /// Name of the method defined in FIDL
5494    pub fn method_name(&self) -> &'static str {
5495        match *self {}
5496    }
5497}
5498
5499#[derive(Debug, Clone)]
5500pub struct DirectoryWatcherControlHandle {
5501    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5502}
5503
5504impl DirectoryWatcherControlHandle {
5505    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5506        self.inner.shutdown_with_epitaph(status.into())
5507    }
5508}
5509
5510impl fdomain_client::fidl::ControlHandle for DirectoryWatcherControlHandle {
5511    fn shutdown(&self) {
5512        self.inner.shutdown()
5513    }
5514
5515    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5516        self.inner.shutdown_with_epitaph(status)
5517    }
5518
5519    fn is_closed(&self) -> bool {
5520        self.inner.channel().is_closed()
5521    }
5522    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5523        self.inner.channel().on_closed()
5524    }
5525}
5526
5527impl DirectoryWatcherControlHandle {}
5528
5529#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5530pub struct ExtendedAttributeIteratorMarker;
5531
5532impl fdomain_client::fidl::ProtocolMarker for ExtendedAttributeIteratorMarker {
5533    type Proxy = ExtendedAttributeIteratorProxy;
5534    type RequestStream = ExtendedAttributeIteratorRequestStream;
5535
5536    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
5537}
5538pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
5539
5540pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
5541    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
5542        + Send;
5543    fn r#get_next(&self) -> Self::GetNextResponseFut;
5544}
5545
5546#[derive(Debug, Clone)]
5547pub struct ExtendedAttributeIteratorProxy {
5548    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5549}
5550
5551impl fdomain_client::fidl::Proxy for ExtendedAttributeIteratorProxy {
5552    type Protocol = ExtendedAttributeIteratorMarker;
5553
5554    fn from_channel(inner: fdomain_client::Channel) -> Self {
5555        Self::new(inner)
5556    }
5557
5558    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5559        self.client.into_channel().map_err(|client| Self { client })
5560    }
5561
5562    fn as_channel(&self) -> &fdomain_client::Channel {
5563        self.client.as_channel()
5564    }
5565}
5566
5567impl ExtendedAttributeIteratorProxy {
5568    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
5569    pub fn new(channel: fdomain_client::Channel) -> Self {
5570        let protocol_name =
5571            <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5572        Self { client: fidl::client::Client::new(channel, protocol_name) }
5573    }
5574
5575    /// Get a Stream of events from the remote end of the protocol.
5576    ///
5577    /// # Panics
5578    ///
5579    /// Panics if the event stream was already taken.
5580    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
5581        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5582    }
5583
5584    /// Get the next chunk of extended attribute names. If this is the last
5585    /// chunk, last will be true, and the channel will be closed after the
5586    /// call.
5587    pub fn r#get_next(
5588        &self,
5589    ) -> fidl::client::QueryResponseFut<
5590        ExtendedAttributeIteratorGetNextResult,
5591        fdomain_client::fidl::FDomainResourceDialect,
5592    > {
5593        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
5594    }
5595}
5596
5597impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
5598    type GetNextResponseFut = fidl::client::QueryResponseFut<
5599        ExtendedAttributeIteratorGetNextResult,
5600        fdomain_client::fidl::FDomainResourceDialect,
5601    >;
5602    fn r#get_next(&self) -> Self::GetNextResponseFut {
5603        fn _decode(
5604            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5605        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
5606            let _response = fidl::client::decode_transaction_body::<
5607                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
5608                fdomain_client::fidl::FDomainResourceDialect,
5609                0x3ba664a1c2e45a7,
5610            >(_buf?)?;
5611            Ok(_response.map(|x| (x.attributes, x.last)))
5612        }
5613        self.client.send_query_and_decode::<
5614            fidl::encoding::EmptyPayload,
5615            ExtendedAttributeIteratorGetNextResult,
5616        >(
5617            (),
5618            0x3ba664a1c2e45a7,
5619            fidl::encoding::DynamicFlags::empty(),
5620            _decode,
5621        )
5622    }
5623}
5624
5625pub struct ExtendedAttributeIteratorEventStream {
5626    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5627}
5628
5629impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
5630
5631impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
5632    fn is_terminated(&self) -> bool {
5633        self.event_receiver.is_terminated()
5634    }
5635}
5636
5637impl futures::Stream for ExtendedAttributeIteratorEventStream {
5638    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
5639
5640    fn poll_next(
5641        mut self: std::pin::Pin<&mut Self>,
5642        cx: &mut std::task::Context<'_>,
5643    ) -> std::task::Poll<Option<Self::Item>> {
5644        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5645            &mut self.event_receiver,
5646            cx
5647        )?) {
5648            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
5649            None => std::task::Poll::Ready(None),
5650        }
5651    }
5652}
5653
5654#[derive(Debug)]
5655pub enum ExtendedAttributeIteratorEvent {}
5656
5657impl ExtendedAttributeIteratorEvent {
5658    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
5659    fn decode(
5660        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5661    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
5662        let (bytes, _handles) = buf.split_mut();
5663        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5664        debug_assert_eq!(tx_header.tx_id, 0);
5665        match tx_header.ordinal {
5666            _ => Err(fidl::Error::UnknownOrdinal {
5667                ordinal: tx_header.ordinal,
5668                protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5669            })
5670        }
5671    }
5672}
5673
5674/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
5675pub struct ExtendedAttributeIteratorRequestStream {
5676    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5677    is_terminated: bool,
5678}
5679
5680impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
5681
5682impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
5683    fn is_terminated(&self) -> bool {
5684        self.is_terminated
5685    }
5686}
5687
5688impl fdomain_client::fidl::RequestStream for ExtendedAttributeIteratorRequestStream {
5689    type Protocol = ExtendedAttributeIteratorMarker;
5690    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5691
5692    fn from_channel(channel: fdomain_client::Channel) -> Self {
5693        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5694    }
5695
5696    fn control_handle(&self) -> Self::ControlHandle {
5697        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
5698    }
5699
5700    fn into_inner(
5701        self,
5702    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5703    {
5704        (self.inner, self.is_terminated)
5705    }
5706
5707    fn from_inner(
5708        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5709        is_terminated: bool,
5710    ) -> Self {
5711        Self { inner, is_terminated }
5712    }
5713}
5714
5715impl futures::Stream for ExtendedAttributeIteratorRequestStream {
5716    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
5717
5718    fn poll_next(
5719        mut self: std::pin::Pin<&mut Self>,
5720        cx: &mut std::task::Context<'_>,
5721    ) -> std::task::Poll<Option<Self::Item>> {
5722        let this = &mut *self;
5723        if this.inner.check_shutdown(cx) {
5724            this.is_terminated = true;
5725            return std::task::Poll::Ready(None);
5726        }
5727        if this.is_terminated {
5728            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
5729        }
5730        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5731            |bytes, handles| {
5732                match this.inner.channel().read_etc(cx, bytes, handles) {
5733                    std::task::Poll::Ready(Ok(())) => {}
5734                    std::task::Poll::Pending => return std::task::Poll::Pending,
5735                    std::task::Poll::Ready(Err(None)) => {
5736                        this.is_terminated = true;
5737                        return std::task::Poll::Ready(None);
5738                    }
5739                    std::task::Poll::Ready(Err(Some(e))) => {
5740                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5741                            e.into(),
5742                        ))));
5743                    }
5744                }
5745
5746                // A message has been received from the channel
5747                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5748
5749                std::task::Poll::Ready(Some(match header.ordinal {
5750                0x3ba664a1c2e45a7 => {
5751                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5752                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
5753                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5754                    let control_handle = ExtendedAttributeIteratorControlHandle {
5755                        inner: this.inner.clone(),
5756                    };
5757                    Ok(ExtendedAttributeIteratorRequest::GetNext {
5758                        responder: ExtendedAttributeIteratorGetNextResponder {
5759                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5760                            tx_id: header.tx_id,
5761                        },
5762                    })
5763                }
5764                _ => Err(fidl::Error::UnknownOrdinal {
5765                    ordinal: header.ordinal,
5766                    protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5767                }),
5768            }))
5769            },
5770        )
5771    }
5772}
5773
5774#[derive(Debug)]
5775pub enum ExtendedAttributeIteratorRequest {
5776    /// Get the next chunk of extended attribute names. If this is the last
5777    /// chunk, last will be true, and the channel will be closed after the
5778    /// call.
5779    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
5780}
5781
5782impl ExtendedAttributeIteratorRequest {
5783    #[allow(irrefutable_let_patterns)]
5784    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
5785        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
5786            Some((responder))
5787        } else {
5788            None
5789        }
5790    }
5791
5792    /// Name of the method defined in FIDL
5793    pub fn method_name(&self) -> &'static str {
5794        match *self {
5795            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
5796        }
5797    }
5798}
5799
5800#[derive(Debug, Clone)]
5801pub struct ExtendedAttributeIteratorControlHandle {
5802    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5803}
5804
5805impl ExtendedAttributeIteratorControlHandle {
5806    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5807        self.inner.shutdown_with_epitaph(status.into())
5808    }
5809}
5810
5811impl fdomain_client::fidl::ControlHandle for ExtendedAttributeIteratorControlHandle {
5812    fn shutdown(&self) {
5813        self.inner.shutdown()
5814    }
5815
5816    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5817        self.inner.shutdown_with_epitaph(status)
5818    }
5819
5820    fn is_closed(&self) -> bool {
5821        self.inner.channel().is_closed()
5822    }
5823    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5824        self.inner.channel().on_closed()
5825    }
5826}
5827
5828impl ExtendedAttributeIteratorControlHandle {}
5829
5830#[must_use = "FIDL methods require a response to be sent"]
5831#[derive(Debug)]
5832pub struct ExtendedAttributeIteratorGetNextResponder {
5833    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
5834    tx_id: u32,
5835}
5836
5837/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
5838/// if the responder is dropped without sending a response, so that the client
5839/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5840impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
5841    fn drop(&mut self) {
5842        self.control_handle.shutdown();
5843        // Safety: drops once, never accessed again
5844        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5845    }
5846}
5847
5848impl fdomain_client::fidl::Responder for ExtendedAttributeIteratorGetNextResponder {
5849    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5850
5851    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
5852        &self.control_handle
5853    }
5854
5855    fn drop_without_shutdown(mut self) {
5856        // Safety: drops once, never accessed again due to mem::forget
5857        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5858        // Prevent Drop from running (which would shut down the channel)
5859        std::mem::forget(self);
5860    }
5861}
5862
5863impl ExtendedAttributeIteratorGetNextResponder {
5864    /// Sends a response to the FIDL transaction.
5865    ///
5866    /// Sets the channel to shutdown if an error occurs.
5867    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5868        let _result = self.send_raw(result);
5869        if _result.is_err() {
5870            self.control_handle.shutdown();
5871        }
5872        self.drop_without_shutdown();
5873        _result
5874    }
5875
5876    /// Similar to "send" but does not shutdown the channel if an error occurs.
5877    pub fn send_no_shutdown_on_err(
5878        self,
5879        mut result: Result<(&[Vec<u8>], bool), i32>,
5880    ) -> Result<(), fidl::Error> {
5881        let _result = self.send_raw(result);
5882        self.drop_without_shutdown();
5883        _result
5884    }
5885
5886    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5887        self.control_handle.inner.send::<fidl::encoding::ResultType<
5888            ExtendedAttributeIteratorGetNextResponse,
5889            i32,
5890        >>(
5891            result,
5892            self.tx_id,
5893            0x3ba664a1c2e45a7,
5894            fidl::encoding::DynamicFlags::empty(),
5895        )
5896    }
5897}
5898
5899#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5900pub struct FileMarker;
5901
5902impl fdomain_client::fidl::ProtocolMarker for FileMarker {
5903    type Proxy = FileProxy;
5904    type RequestStream = FileRequestStream;
5905
5906    const DEBUG_NAME: &'static str = "fuchsia.io.File";
5907}
5908impl fdomain_client::fidl::DiscoverableProtocolMarker for FileMarker {}
5909pub type FileSeekResult = Result<u64, i32>;
5910pub type FileReadAtResult = Result<Vec<u8>, i32>;
5911pub type FileWriteAtResult = Result<u64, i32>;
5912pub type FileResizeResult = Result<(), i32>;
5913pub type FileGetBackingMemoryResult = Result<fdomain_client::Vmo, i32>;
5914pub type FileAllocateResult = Result<(), i32>;
5915pub type FileEnableVerityResult = Result<(), i32>;
5916
5917pub trait FileProxyInterface: Send + Sync {
5918    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
5919        + Send;
5920    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
5921    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
5922        + Send;
5923    fn r#link_into(
5924        &self,
5925        dst_parent_token: fdomain_client::Event,
5926        dst: &str,
5927    ) -> Self::LinkIntoResponseFut;
5928    fn r#clone(
5929        &self,
5930        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5931    ) -> Result<(), fidl::Error>;
5932    type CloseResponseFut: std::future::Future<
5933            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
5934        > + Send;
5935    fn r#close(&self) -> Self::CloseResponseFut;
5936    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
5937    fn r#query(&self) -> Self::QueryResponseFut;
5938    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
5939        + Send;
5940    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
5941    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
5942    fn r#deprecated_set_attr(
5943        &self,
5944        flags: NodeAttributeFlags,
5945        attributes: &NodeAttributes,
5946    ) -> Self::DeprecatedSetAttrResponseFut;
5947    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
5948        + Send;
5949    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
5950    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
5951        + Send;
5952    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
5953    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
5954        + Send;
5955    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
5956    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
5957        + Send;
5958    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
5959    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
5960        + Send;
5961    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
5962    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
5963        + Send;
5964    fn r#get_token(&self) -> Self::GetTokenResponseFut;
5965    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
5966        + Send;
5967    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
5968    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
5969        + Send;
5970    fn r#update_attributes(
5971        &self,
5972        payload: &MutableNodeAttributes,
5973    ) -> Self::UpdateAttributesResponseFut;
5974    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
5975    fn r#sync(&self) -> Self::SyncResponseFut;
5976    fn r#list_extended_attributes(
5977        &self,
5978        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
5979    ) -> Result<(), fidl::Error>;
5980    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
5981        + Send;
5982    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
5983    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
5984        + Send;
5985    fn r#set_extended_attribute(
5986        &self,
5987        name: &[u8],
5988        value: ExtendedAttributeValue,
5989        mode: SetExtendedAttributeMode,
5990    ) -> Self::SetExtendedAttributeResponseFut;
5991    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
5992        + Send;
5993    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
5994    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
5995        + Send;
5996    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
5997    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
5998        + Send;
5999    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6000    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6001    fn r#describe(&self) -> Self::DescribeResponseFut;
6002    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6003    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6004    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6005        + Send;
6006    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6007    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6008        + Send;
6009    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6010    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6011        + Send;
6012    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6013    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6014        + Send;
6015    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6016    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6017        + Send;
6018    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6019    -> Self::AllocateResponseFut;
6020    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6021        + Send;
6022    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6023}
6024
6025#[derive(Debug, Clone)]
6026pub struct FileProxy {
6027    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6028}
6029
6030impl fdomain_client::fidl::Proxy for FileProxy {
6031    type Protocol = FileMarker;
6032
6033    fn from_channel(inner: fdomain_client::Channel) -> Self {
6034        Self::new(inner)
6035    }
6036
6037    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6038        self.client.into_channel().map_err(|client| Self { client })
6039    }
6040
6041    fn as_channel(&self) -> &fdomain_client::Channel {
6042        self.client.as_channel()
6043    }
6044}
6045
6046impl FileProxy {
6047    /// Create a new Proxy for fuchsia.io/File.
6048    pub fn new(channel: fdomain_client::Channel) -> Self {
6049        let protocol_name = <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6050        Self { client: fidl::client::Client::new(channel, protocol_name) }
6051    }
6052
6053    /// Get a Stream of events from the remote end of the protocol.
6054    ///
6055    /// # Panics
6056    ///
6057    /// Panics if the event stream was already taken.
6058    pub fn take_event_stream(&self) -> FileEventStream {
6059        FileEventStream { event_receiver: self.client.take_event_receiver() }
6060    }
6061
6062    /// Acquires an advisory lock on the underlying file.
6063    ///
6064    /// The lock lasts until either this connection is closed or
6065    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
6066    /// explicitly.
6067    ///
6068    /// Advisory locks are purely advisory. They do not prevent actual read or
6069    /// write operations from occurring on the file, either through this
6070    /// connection or through other connections.
6071    ///
6072    /// This method requires the following rights:
6073    ///
6074    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
6075    /// * [`Rights.WRITE_BYTES`] if `request.type` is
6076    ///   [`AdvisoryLockType.WRITE`].
6077    ///
6078    /// # Errors
6079    ///
6080    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
6081    ///   example, another connection might hold a conflicting lock type.
6082    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
6083    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
6084    ///   to acquire the given type of lock.
6085    pub fn r#advisory_lock(
6086        &self,
6087        mut request: &AdvisoryLockRequest,
6088    ) -> fidl::client::QueryResponseFut<
6089        AdvisoryLockingAdvisoryLockResult,
6090        fdomain_client::fidl::FDomainResourceDialect,
6091    > {
6092        FileProxyInterface::r#advisory_lock(self, request)
6093    }
6094
6095    /// Creates a link to this this object with name `dst` in the directory represented by
6096    /// `dst_parent_token`.
6097    ///
6098    /// `dst` must be a resolved object name. Including "/" in the string will return
6099    /// `ZX_ERR_INVALID_ARGS`.
6100    ///
6101    /// This method requires the maximal set of rights supported by the filesystem for this object.
6102    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
6103    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
6104    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
6105    /// `ZX_ERR_ACCESS_DENIED`.
6106    ///
6107    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
6108    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
6109    ///
6110    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
6111    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
6112    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
6113    ///
6114    /// This method does not have the same atomicity properties has the `Directory::Link` method,
6115    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
6116    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
6117    pub fn r#link_into(
6118        &self,
6119        mut dst_parent_token: fdomain_client::Event,
6120        mut dst: &str,
6121    ) -> fidl::client::QueryResponseFut<
6122        LinkableLinkIntoResult,
6123        fdomain_client::fidl::FDomainResourceDialect,
6124    > {
6125        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
6126    }
6127
6128    pub fn r#clone(
6129        &self,
6130        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6131    ) -> Result<(), fidl::Error> {
6132        FileProxyInterface::r#clone(self, request)
6133    }
6134
6135    /// Terminates the connection.
6136    ///
6137    /// After calling `Close`, the client must not send any other requests.
6138    ///
6139    /// Servers, after sending the status response, should close the connection
6140    /// regardless of status and without sending an epitaph.
6141    ///
6142    /// Closing the client end of the channel should be semantically equivalent
6143    /// to calling `Close` without knowing when the close has completed or its
6144    /// status.
6145    pub fn r#close(
6146        &self,
6147    ) -> fidl::client::QueryResponseFut<
6148        fdomain_fuchsia_unknown::CloseableCloseResult,
6149        fdomain_client::fidl::FDomainResourceDialect,
6150    > {
6151        FileProxyInterface::r#close(self)
6152    }
6153
6154    pub fn r#query(
6155        &self,
6156    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
6157        FileProxyInterface::r#query(self)
6158    }
6159
6160    /// DEPRECATED - Use `Node.GetAttributes` instead.
6161    ///
6162    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6163    pub fn r#deprecated_get_attr(
6164        &self,
6165    ) -> fidl::client::QueryResponseFut<
6166        (i32, NodeAttributes),
6167        fdomain_client::fidl::FDomainResourceDialect,
6168    > {
6169        FileProxyInterface::r#deprecated_get_attr(self)
6170    }
6171
6172    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
6173    pub fn r#deprecated_set_attr(
6174        &self,
6175        mut flags: NodeAttributeFlags,
6176        mut attributes: &NodeAttributes,
6177    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6178        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
6179    }
6180
6181    /// [DEPRECATED - Use new GetFlags method instead.]
6182    pub fn r#deprecated_get_flags(
6183        &self,
6184    ) -> fidl::client::QueryResponseFut<
6185        (i32, OpenFlags),
6186        fdomain_client::fidl::FDomainResourceDialect,
6187    > {
6188        FileProxyInterface::r#deprecated_get_flags(self)
6189    }
6190
6191    /// [DEPRECATED - Use new SetFlags method instead.]
6192    pub fn r#deprecated_set_flags(
6193        &self,
6194        mut flags: OpenFlags,
6195    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6196        FileProxyInterface::r#deprecated_set_flags(self, flags)
6197    }
6198
6199    /// Queries the flags that apply to this node after it has been opened/created. This method does
6200    /// not require any rights.
6201    ///
6202    /// Note that the final set of flags that apply to the connection may differ from those
6203    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
6204    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
6205    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
6206    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
6207    pub fn r#get_flags(
6208        &self,
6209    ) -> fidl::client::QueryResponseFut<
6210        NodeGetFlagsResult,
6211        fdomain_client::fidl::FDomainResourceDialect,
6212    > {
6213        FileProxyInterface::r#get_flags(self)
6214    }
6215
6216    /// Sets the flags that apply to this node after it has been opened. This method does not
6217    /// require any rights.
6218    ///
6219    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
6220    /// clear append mode.
6221    ///
6222    /// Errors:
6223    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
6224    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
6225    pub fn r#set_flags(
6226        &self,
6227        mut flags: Flags,
6228    ) -> fidl::client::QueryResponseFut<
6229        NodeSetFlagsResult,
6230        fdomain_client::fidl::FDomainResourceDialect,
6231    > {
6232        FileProxyInterface::r#set_flags(self, flags)
6233    }
6234
6235    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
6236    /// volume has different settings or the storage is accounted seperately from the rest of the
6237    /// filesystem that may be reported instead of filesystem-wide details.
6238    pub fn r#query_filesystem(
6239        &self,
6240    ) -> fidl::client::QueryResponseFut<
6241        (i32, Option<Box<FilesystemInfo>>),
6242        fdomain_client::fidl::FDomainResourceDialect,
6243    > {
6244        FileProxyInterface::r#query_filesystem(self)
6245    }
6246
6247    /// Acquires a token which can be used to identify this connection at a later point in
6248    /// time. The token will remain valid for as long as the connection requesting the token
6249    /// remains open.
6250    ///
6251    /// This method does not require any rights. Note that the token identifies
6252    /// the connection, hence carries the rights information on this connection.
6253    pub fn r#get_token(
6254        &self,
6255    ) -> fidl::client::QueryResponseFut<
6256        NodeGetTokenResult,
6257        fdomain_client::fidl::FDomainResourceDialect,
6258    > {
6259        FileProxyInterface::r#get_token(self)
6260    }
6261
6262    /// Acquires information about the node.
6263    ///
6264    /// The attributes of a node should be stable, independent of the
6265    /// specific protocol used to access it.
6266    ///
6267    /// If a particular attribute is not applicable or not supported,
6268    /// filesystems should leave the corresponding field absent.
6269    ///
6270    /// + `query` a bit-mask specifying which attributes to fetch. The server
6271    ///   should not return more than necessary.
6272    /// - `attributes` the returned attributes.
6273    ///
6274    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6275    pub fn r#get_attributes(
6276        &self,
6277        mut query: NodeAttributesQuery,
6278    ) -> fidl::client::QueryResponseFut<
6279        NodeGetAttributesResult,
6280        fdomain_client::fidl::FDomainResourceDialect,
6281    > {
6282        FileProxyInterface::r#get_attributes(self, query)
6283    }
6284
6285    /// Updates information about the node.
6286    ///
6287    /// + `attributes` the presence of a table field in `attributes` indicates
6288    /// the intent to update the corresponding attribute.
6289    ///
6290    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
6291    ///
6292    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6293    pub fn r#update_attributes(
6294        &self,
6295        mut payload: &MutableNodeAttributes,
6296    ) -> fidl::client::QueryResponseFut<
6297        NodeUpdateAttributesResult,
6298        fdomain_client::fidl::FDomainResourceDialect,
6299    > {
6300        FileProxyInterface::r#update_attributes(self, payload)
6301    }
6302
6303    /// Synchronizes updates to the node to the underlying media, if it exists.
6304    ///
6305    /// This method will return when the filesystem server has flushed the
6306    /// relevant updates to the underlying media, but does not guarantee the
6307    /// underlying media has persisted the information, nor that any information
6308    /// is committed to hardware. Clients may use `Sync` to ensure ordering
6309    /// between operations.
6310    ///
6311    /// This method does not require any rights.
6312    pub fn r#sync(
6313        &self,
6314    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
6315    {
6316        FileProxyInterface::r#sync(self)
6317    }
6318
6319    /// Creates an iterator over all the extended attribute names associated
6320    /// with this node. If an error occurs it is returned as an epitaph on the
6321    /// iterator request channel, and then the channel is closed.
6322    ///
6323    /// GetExtendedAttributes can be used with any of these names to retrieve
6324    /// the associated value.
6325    ///
6326    /// This method requires the [`Rights.READ_BYTES`] right.
6327    pub fn r#list_extended_attributes(
6328        &self,
6329        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6330    ) -> Result<(), fidl::Error> {
6331        FileProxyInterface::r#list_extended_attributes(self, iterator)
6332    }
6333
6334    /// Get the value associated with the given attribute `name` for this node.
6335    ///
6336    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
6337    /// particular structure is imposed on them.
6338    ///
6339    /// This method requires the [`Rights.READ_BYTES`] right.
6340    pub fn r#get_extended_attribute(
6341        &self,
6342        mut name: &[u8],
6343    ) -> fidl::client::QueryResponseFut<
6344        NodeGetExtendedAttributeResult,
6345        fdomain_client::fidl::FDomainResourceDialect,
6346    > {
6347        FileProxyInterface::r#get_extended_attribute(self, name)
6348    }
6349
6350    /// Set the value for the given attribute `name` to `value` for this node.
6351    ///
6352    /// The attribute name may exist, in which case the attribute is updated.
6353    /// If the attribute doesn't exist, it is created. The name should have no
6354    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
6355    ///
6356    /// This method requires the [`Rights.WRITE_BYTES`] right.
6357    pub fn r#set_extended_attribute(
6358        &self,
6359        mut name: &[u8],
6360        mut value: ExtendedAttributeValue,
6361        mut mode: SetExtendedAttributeMode,
6362    ) -> fidl::client::QueryResponseFut<
6363        NodeSetExtendedAttributeResult,
6364        fdomain_client::fidl::FDomainResourceDialect,
6365    > {
6366        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
6367    }
6368
6369    /// Remove the specified extended attribute.
6370    ///
6371    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
6372    ///
6373    /// This method requires the [`Rights.WRITE_BYTES`] right.
6374    pub fn r#remove_extended_attribute(
6375        &self,
6376        mut name: &[u8],
6377    ) -> fidl::client::QueryResponseFut<
6378        NodeRemoveExtendedAttributeResult,
6379        fdomain_client::fidl::FDomainResourceDialect,
6380    > {
6381        FileProxyInterface::r#remove_extended_attribute(self, name)
6382    }
6383
6384    /// Reads up to 'count' bytes at the seek offset.
6385    /// The seek offset is moved forward by the number of bytes read.
6386    ///
6387    /// ## Invariants
6388    ///
6389    /// * The returned `data.length` will never be greater than `count`.
6390    /// * If `data.length` is less than `count`, it means that the seek offset
6391    ///   has reached the end of file as part of this operation.
6392    /// * If `data.length` is zero while `count` is not, it means that the
6393    ///   seek offset is already at or beyond the end of file, and no data could
6394    ///   be read.
6395    /// * If `count` is zero, the server should perform all the checks ensuring
6396    ///   read access without actually read anything, and return an empty
6397    ///   `data` vector.
6398    ///
6399    /// This method requires the [`Rights.READ_BYTES`] right.
6400    ///
6401    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6402    pub fn r#read(
6403        &self,
6404        mut count: u64,
6405    ) -> fidl::client::QueryResponseFut<
6406        ReadableReadResult,
6407        fdomain_client::fidl::FDomainResourceDialect,
6408    > {
6409        FileProxyInterface::r#read(self, count)
6410    }
6411
6412    /// Writes data at the seek offset.
6413    /// The seek offset is moved forward by the number of bytes written.
6414    /// If the file is in append mode, the seek offset is first set to the end
6415    /// of the file, followed by the write, in one atomic step.
6416    ///
6417    /// The file size may grow if the seek offset plus `data.length` is beyond
6418    /// the current end of file.
6419    ///
6420    /// + request `data` the byte buffer to write to the file.
6421    /// - response `actual_count` the number of bytes written.
6422    ///
6423    /// ## Invariants
6424    ///
6425    /// * The returned `actual_count` will never be greater than `data.length`.
6426    /// * If the server is unable to write all the data due to e.g. not enough
6427    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6428    ///   could be written, an error is returned.
6429    /// * If `data.length` is zero, the server should perform all the checks
6430    ///   ensuring write access without mutating the file and return a
6431    ///   successful write of zero bytes.  The seek offset is still updated if
6432    ///   in append mode.
6433    ///
6434    /// This method requires the [`Rights.WRITE_BYTES`] right.
6435    pub fn r#write(
6436        &self,
6437        mut data: &[u8],
6438    ) -> fidl::client::QueryResponseFut<
6439        WritableWriteResult,
6440        fdomain_client::fidl::FDomainResourceDialect,
6441    > {
6442        FileProxyInterface::r#write(self, data)
6443    }
6444
6445    pub fn r#describe(
6446        &self,
6447    ) -> fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
6448    {
6449        FileProxyInterface::r#describe(self)
6450    }
6451
6452    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
6453    /// will occur. The seek offset is specific to each file connection.
6454    ///
6455    /// + request `origin` the reference point where `offset` will be based on.
6456    /// + request `offset` the number of bytes to seek.
6457    /// - response `offset_from_start` the adjusted seek offset, from the start
6458    ///   of the file.
6459    ///
6460    /// This method does not require any rights.
6461    pub fn r#seek(
6462        &self,
6463        mut origin: SeekOrigin,
6464        mut offset: i64,
6465    ) -> fidl::client::QueryResponseFut<FileSeekResult, fdomain_client::fidl::FDomainResourceDialect>
6466    {
6467        FileProxyInterface::r#seek(self, origin, offset)
6468    }
6469
6470    /// Reads up to 'count' bytes at the provided offset.
6471    /// Does not affect the seek offset.
6472    ///
6473    /// ## Invariants
6474    ///
6475    /// * The returned `data.length` will never be greater than `count`.
6476    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
6477    ///   the end of file as part of this operation.
6478    /// * If `data.length` is zero while `count` is not, it means that `offset`
6479    ///   is at or past the end of file, and no data can be read.
6480    /// * If `count` is zero, the server should perform all the checks ensuring
6481    ///   read access without actually reading anything, and return an empty
6482    ///   `data` vector.
6483    ///
6484    /// This method requires the [`Rights.READ_BYTES`] right.
6485    ///
6486    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6487    pub fn r#read_at(
6488        &self,
6489        mut count: u64,
6490        mut offset: u64,
6491    ) -> fidl::client::QueryResponseFut<
6492        FileReadAtResult,
6493        fdomain_client::fidl::FDomainResourceDialect,
6494    > {
6495        FileProxyInterface::r#read_at(self, count, offset)
6496    }
6497
6498    /// Writes data at the provided offset.
6499    /// Does not affect the seek offset.
6500    ///
6501    /// The file size may grow if `offset` plus `data.length` is past the
6502    /// current end of file.
6503    ///
6504    /// + request `data` the byte buffer to write to the file.
6505    /// + request `offset` the offset from start of the file to begin writing.
6506    /// - response `actual_count` the number of bytes written.
6507    ///
6508    /// ## Invariants
6509    ///
6510    /// * The returned `actual_count` will never be greater than `data.length`.
6511    /// * If the server is unable to write all the data due to e.g. not enough
6512    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6513    ///   could be written, an error is returned.
6514    /// * If `data.length` is zero, the server should perform all the checks
6515    ///   ensuring write access without mutating the file, and will return a
6516    ///   successful write of zero bytes.
6517    ///
6518    /// This method requires the [`Rights.WRITE_BYTES`] right.
6519    pub fn r#write_at(
6520        &self,
6521        mut data: &[u8],
6522        mut offset: u64,
6523    ) -> fidl::client::QueryResponseFut<
6524        FileWriteAtResult,
6525        fdomain_client::fidl::FDomainResourceDialect,
6526    > {
6527        FileProxyInterface::r#write_at(self, data, offset)
6528    }
6529
6530    /// Shrinks or grows the file size to 'length' bytes.
6531    ///
6532    /// If file size is reduced by this operation, the extra trailing data'
6533    /// is discarded.
6534    /// If file size is increased by this operation, the extended area appears
6535    /// as if it was zeroed.
6536    ///
6537    /// This method requires the [`Rights.WRITE_BYTES`] right.
6538    pub fn r#resize(
6539        &self,
6540        mut length: u64,
6541    ) -> fidl::client::QueryResponseFut<
6542        FileResizeResult,
6543        fdomain_client::fidl::FDomainResourceDialect,
6544    > {
6545        FileProxyInterface::r#resize(self, length)
6546    }
6547
6548    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
6549    /// with the requested access rights.
6550    ///
6551    /// Implementations are not required to implement files backed by VMOs so
6552    /// this request may fail. Additionally, implementations may only support
6553    /// a certain subset of the flags. Clients should be prepared with fallback
6554    /// behavior if this request fails.
6555    ///
6556    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
6557    /// implementation is free to choose the semantics of the returned VMO.
6558    ///
6559    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
6560    /// - response `vmo` the requested [`zx.Handle:VMO`].
6561    /// * error a [`zx.Status`] value indicating the failure.
6562    ///
6563    /// This method requires the following rights:
6564    ///
6565    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
6566    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
6567    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
6568    pub fn r#get_backing_memory(
6569        &self,
6570        mut flags: VmoFlags,
6571    ) -> fidl::client::QueryResponseFut<
6572        FileGetBackingMemoryResult,
6573        fdomain_client::fidl::FDomainResourceDialect,
6574    > {
6575        FileProxyInterface::r#get_backing_memory(self, flags)
6576    }
6577
6578    /// Pre-allocate on-disk space for this file.
6579    pub fn r#allocate(
6580        &self,
6581        mut offset: u64,
6582        mut length: u64,
6583        mut mode: AllocateMode,
6584    ) -> fidl::client::QueryResponseFut<
6585        FileAllocateResult,
6586        fdomain_client::fidl::FDomainResourceDialect,
6587    > {
6588        FileProxyInterface::r#allocate(self, offset, length, mode)
6589    }
6590
6591    /// Enables verification for the file (permanently) which involves computing a merkle tree for
6592    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
6593    /// captured. Future reads will be verified against the computed merkle tree and writes will be
6594    /// rejected. This method can take some time to complete as it depends on the size of the file.
6595    /// This method can be aborted by closing the connection that this method was issued on.
6596    ///
6597    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6598    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
6599    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
6600    /// Also returns any error that might arise from reading the file, or from flushing the file,
6601    /// such as `ZX_ERR_IO`.
6602    pub fn r#enable_verity(
6603        &self,
6604        mut options: &VerificationOptions,
6605    ) -> fidl::client::QueryResponseFut<
6606        FileEnableVerityResult,
6607        fdomain_client::fidl::FDomainResourceDialect,
6608    > {
6609        FileProxyInterface::r#enable_verity(self, options)
6610    }
6611}
6612
6613impl FileProxyInterface for FileProxy {
6614    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
6615        AdvisoryLockingAdvisoryLockResult,
6616        fdomain_client::fidl::FDomainResourceDialect,
6617    >;
6618    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
6619        fn _decode(
6620            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6621        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
6622            let _response = fidl::client::decode_transaction_body::<
6623                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6624                fdomain_client::fidl::FDomainResourceDialect,
6625                0x6ee9c0ad53ec87aa,
6626            >(_buf?)?;
6627            Ok(_response.map(|x| x))
6628        }
6629        self.client.send_query_and_decode::<
6630            AdvisoryLockingAdvisoryLockRequest,
6631            AdvisoryLockingAdvisoryLockResult,
6632        >(
6633            (request,),
6634            0x6ee9c0ad53ec87aa,
6635            fidl::encoding::DynamicFlags::empty(),
6636            _decode,
6637        )
6638    }
6639
6640    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
6641        LinkableLinkIntoResult,
6642        fdomain_client::fidl::FDomainResourceDialect,
6643    >;
6644    fn r#link_into(
6645        &self,
6646        mut dst_parent_token: fdomain_client::Event,
6647        mut dst: &str,
6648    ) -> Self::LinkIntoResponseFut {
6649        fn _decode(
6650            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6651        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
6652            let _response = fidl::client::decode_transaction_body::<
6653                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6654                fdomain_client::fidl::FDomainResourceDialect,
6655                0x54f3949246a03e74,
6656            >(_buf?)?;
6657            Ok(_response.map(|x| x))
6658        }
6659        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
6660            (dst_parent_token, dst),
6661            0x54f3949246a03e74,
6662            fidl::encoding::DynamicFlags::empty(),
6663            _decode,
6664        )
6665    }
6666
6667    fn r#clone(
6668        &self,
6669        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6670    ) -> Result<(), fidl::Error> {
6671        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
6672            (request,),
6673            0x20d8a7aba2168a79,
6674            fidl::encoding::DynamicFlags::empty(),
6675        )
6676    }
6677
6678    type CloseResponseFut = fidl::client::QueryResponseFut<
6679        fdomain_fuchsia_unknown::CloseableCloseResult,
6680        fdomain_client::fidl::FDomainResourceDialect,
6681    >;
6682    fn r#close(&self) -> Self::CloseResponseFut {
6683        fn _decode(
6684            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6685        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
6686            let _response = fidl::client::decode_transaction_body::<
6687                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6688                fdomain_client::fidl::FDomainResourceDialect,
6689                0x5ac5d459ad7f657e,
6690            >(_buf?)?;
6691            Ok(_response.map(|x| x))
6692        }
6693        self.client.send_query_and_decode::<
6694            fidl::encoding::EmptyPayload,
6695            fdomain_fuchsia_unknown::CloseableCloseResult,
6696        >(
6697            (),
6698            0x5ac5d459ad7f657e,
6699            fidl::encoding::DynamicFlags::empty(),
6700            _decode,
6701        )
6702    }
6703
6704    type QueryResponseFut =
6705        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
6706    fn r#query(&self) -> Self::QueryResponseFut {
6707        fn _decode(
6708            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6709        ) -> Result<Vec<u8>, fidl::Error> {
6710            let _response = fidl::client::decode_transaction_body::<
6711                fdomain_fuchsia_unknown::QueryableQueryResponse,
6712                fdomain_client::fidl::FDomainResourceDialect,
6713                0x2658edee9decfc06,
6714            >(_buf?)?;
6715            Ok(_response.protocol)
6716        }
6717        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
6718            (),
6719            0x2658edee9decfc06,
6720            fidl::encoding::DynamicFlags::empty(),
6721            _decode,
6722        )
6723    }
6724
6725    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
6726        (i32, NodeAttributes),
6727        fdomain_client::fidl::FDomainResourceDialect,
6728    >;
6729    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
6730        fn _decode(
6731            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6732        ) -> Result<(i32, NodeAttributes), fidl::Error> {
6733            let _response = fidl::client::decode_transaction_body::<
6734                NodeDeprecatedGetAttrResponse,
6735                fdomain_client::fidl::FDomainResourceDialect,
6736                0x78985e216314dafd,
6737            >(_buf?)?;
6738            Ok((_response.s, _response.attributes))
6739        }
6740        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
6741            (),
6742            0x78985e216314dafd,
6743            fidl::encoding::DynamicFlags::empty(),
6744            _decode,
6745        )
6746    }
6747
6748    type DeprecatedSetAttrResponseFut =
6749        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6750    fn r#deprecated_set_attr(
6751        &self,
6752        mut flags: NodeAttributeFlags,
6753        mut attributes: &NodeAttributes,
6754    ) -> Self::DeprecatedSetAttrResponseFut {
6755        fn _decode(
6756            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6757        ) -> Result<i32, fidl::Error> {
6758            let _response = fidl::client::decode_transaction_body::<
6759                NodeDeprecatedSetAttrResponse,
6760                fdomain_client::fidl::FDomainResourceDialect,
6761                0x4186c0f40d938f46,
6762            >(_buf?)?;
6763            Ok(_response.s)
6764        }
6765        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
6766            (flags, attributes),
6767            0x4186c0f40d938f46,
6768            fidl::encoding::DynamicFlags::empty(),
6769            _decode,
6770        )
6771    }
6772
6773    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
6774        (i32, OpenFlags),
6775        fdomain_client::fidl::FDomainResourceDialect,
6776    >;
6777    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
6778        fn _decode(
6779            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6780        ) -> Result<(i32, OpenFlags), fidl::Error> {
6781            let _response = fidl::client::decode_transaction_body::<
6782                NodeDeprecatedGetFlagsResponse,
6783                fdomain_client::fidl::FDomainResourceDialect,
6784                0x5b88fffb8eda3aa1,
6785            >(_buf?)?;
6786            Ok((_response.s, _response.flags))
6787        }
6788        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
6789            (),
6790            0x5b88fffb8eda3aa1,
6791            fidl::encoding::DynamicFlags::empty(),
6792            _decode,
6793        )
6794    }
6795
6796    type DeprecatedSetFlagsResponseFut =
6797        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6798    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
6799        fn _decode(
6800            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6801        ) -> Result<i32, fidl::Error> {
6802            let _response = fidl::client::decode_transaction_body::<
6803                NodeDeprecatedSetFlagsResponse,
6804                fdomain_client::fidl::FDomainResourceDialect,
6805                0x5295b76c71fde733,
6806            >(_buf?)?;
6807            Ok(_response.s)
6808        }
6809        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
6810            (flags,),
6811            0x5295b76c71fde733,
6812            fidl::encoding::DynamicFlags::empty(),
6813            _decode,
6814        )
6815    }
6816
6817    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
6818        NodeGetFlagsResult,
6819        fdomain_client::fidl::FDomainResourceDialect,
6820    >;
6821    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
6822        fn _decode(
6823            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6824        ) -> Result<NodeGetFlagsResult, fidl::Error> {
6825            let _response = fidl::client::decode_transaction_body::<
6826                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
6827                fdomain_client::fidl::FDomainResourceDialect,
6828                0x176eb318f64ec23,
6829            >(_buf?)?
6830            .into_result_fdomain::<FileMarker>("get_flags")?;
6831            Ok(_response.map(|x| x.flags))
6832        }
6833        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
6834            (),
6835            0x176eb318f64ec23,
6836            fidl::encoding::DynamicFlags::FLEXIBLE,
6837            _decode,
6838        )
6839    }
6840
6841    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
6842        NodeSetFlagsResult,
6843        fdomain_client::fidl::FDomainResourceDialect,
6844    >;
6845    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
6846        fn _decode(
6847            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6848        ) -> Result<NodeSetFlagsResult, fidl::Error> {
6849            let _response = fidl::client::decode_transaction_body::<
6850                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6851                fdomain_client::fidl::FDomainResourceDialect,
6852                0x55a8028685791ea8,
6853            >(_buf?)?
6854            .into_result_fdomain::<FileMarker>("set_flags")?;
6855            Ok(_response.map(|x| x))
6856        }
6857        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
6858            (flags,),
6859            0x55a8028685791ea8,
6860            fidl::encoding::DynamicFlags::FLEXIBLE,
6861            _decode,
6862        )
6863    }
6864
6865    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
6866        (i32, Option<Box<FilesystemInfo>>),
6867        fdomain_client::fidl::FDomainResourceDialect,
6868    >;
6869    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
6870        fn _decode(
6871            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6872        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
6873            let _response = fidl::client::decode_transaction_body::<
6874                NodeQueryFilesystemResponse,
6875                fdomain_client::fidl::FDomainResourceDialect,
6876                0x6f344a1c6b0a0610,
6877            >(_buf?)?;
6878            Ok((_response.s, _response.info))
6879        }
6880        self.client.send_query_and_decode::<
6881            fidl::encoding::EmptyPayload,
6882            (i32, Option<Box<FilesystemInfo>>),
6883        >(
6884            (),
6885            0x6f344a1c6b0a0610,
6886            fidl::encoding::DynamicFlags::empty(),
6887            _decode,
6888        )
6889    }
6890
6891    type GetTokenResponseFut = fidl::client::QueryResponseFut<
6892        NodeGetTokenResult,
6893        fdomain_client::fidl::FDomainResourceDialect,
6894    >;
6895    fn r#get_token(&self) -> Self::GetTokenResponseFut {
6896        fn _decode(
6897            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6898        ) -> Result<NodeGetTokenResult, fidl::Error> {
6899            let _response = fidl::client::decode_transaction_body::<
6900                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
6901                fdomain_client::fidl::FDomainResourceDialect,
6902                0x5054f0ade7076cec,
6903            >(_buf?)?
6904            .into_result_fdomain::<FileMarker>("get_token")?;
6905            Ok(_response.map(|x| x.token))
6906        }
6907        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
6908            (),
6909            0x5054f0ade7076cec,
6910            fidl::encoding::DynamicFlags::FLEXIBLE,
6911            _decode,
6912        )
6913    }
6914
6915    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
6916        NodeGetAttributesResult,
6917        fdomain_client::fidl::FDomainResourceDialect,
6918    >;
6919    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
6920        fn _decode(
6921            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6922        ) -> Result<NodeGetAttributesResult, fidl::Error> {
6923            let _response = fidl::client::decode_transaction_body::<
6924                fidl::encoding::ResultType<NodeAttributes2, i32>,
6925                fdomain_client::fidl::FDomainResourceDialect,
6926                0x3d4396a638ea053b,
6927            >(_buf?)?;
6928            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
6929        }
6930        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
6931            (query,),
6932            0x3d4396a638ea053b,
6933            fidl::encoding::DynamicFlags::empty(),
6934            _decode,
6935        )
6936    }
6937
6938    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
6939        NodeUpdateAttributesResult,
6940        fdomain_client::fidl::FDomainResourceDialect,
6941    >;
6942    fn r#update_attributes(
6943        &self,
6944        mut payload: &MutableNodeAttributes,
6945    ) -> Self::UpdateAttributesResponseFut {
6946        fn _decode(
6947            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6948        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
6949            let _response = fidl::client::decode_transaction_body::<
6950                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6951                fdomain_client::fidl::FDomainResourceDialect,
6952                0x3308c1da5a89bf08,
6953            >(_buf?)?;
6954            Ok(_response.map(|x| x))
6955        }
6956        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
6957            payload,
6958            0x3308c1da5a89bf08,
6959            fidl::encoding::DynamicFlags::empty(),
6960            _decode,
6961        )
6962    }
6963
6964    type SyncResponseFut = fidl::client::QueryResponseFut<
6965        NodeSyncResult,
6966        fdomain_client::fidl::FDomainResourceDialect,
6967    >;
6968    fn r#sync(&self) -> Self::SyncResponseFut {
6969        fn _decode(
6970            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6971        ) -> Result<NodeSyncResult, fidl::Error> {
6972            let _response = fidl::client::decode_transaction_body::<
6973                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6974                fdomain_client::fidl::FDomainResourceDialect,
6975                0x2c5c27ca0ab5dc49,
6976            >(_buf?)?;
6977            Ok(_response.map(|x| x))
6978        }
6979        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
6980            (),
6981            0x2c5c27ca0ab5dc49,
6982            fidl::encoding::DynamicFlags::empty(),
6983            _decode,
6984        )
6985    }
6986
6987    fn r#list_extended_attributes(
6988        &self,
6989        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6990    ) -> Result<(), fidl::Error> {
6991        self.client.send::<NodeListExtendedAttributesRequest>(
6992            (iterator,),
6993            0x4b61033de007fcd0,
6994            fidl::encoding::DynamicFlags::empty(),
6995        )
6996    }
6997
6998    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6999        NodeGetExtendedAttributeResult,
7000        fdomain_client::fidl::FDomainResourceDialect,
7001    >;
7002    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
7003        fn _decode(
7004            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7005        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7006            let _response = fidl::client::decode_transaction_body::<
7007                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7008                fdomain_client::fidl::FDomainResourceDialect,
7009                0x45ffa3ccfdeb76db,
7010            >(_buf?)?;
7011            Ok(_response.map(|x| x))
7012        }
7013        self.client.send_query_and_decode::<
7014            NodeGetExtendedAttributeRequest,
7015            NodeGetExtendedAttributeResult,
7016        >(
7017            (name,),
7018            0x45ffa3ccfdeb76db,
7019            fidl::encoding::DynamicFlags::empty(),
7020            _decode,
7021        )
7022    }
7023
7024    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
7025        NodeSetExtendedAttributeResult,
7026        fdomain_client::fidl::FDomainResourceDialect,
7027    >;
7028    fn r#set_extended_attribute(
7029        &self,
7030        mut name: &[u8],
7031        mut value: ExtendedAttributeValue,
7032        mut mode: SetExtendedAttributeMode,
7033    ) -> Self::SetExtendedAttributeResponseFut {
7034        fn _decode(
7035            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7036        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7037            let _response = fidl::client::decode_transaction_body::<
7038                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7039                fdomain_client::fidl::FDomainResourceDialect,
7040                0x4a951362f681f23c,
7041            >(_buf?)?;
7042            Ok(_response.map(|x| x))
7043        }
7044        self.client.send_query_and_decode::<
7045            NodeSetExtendedAttributeRequest,
7046            NodeSetExtendedAttributeResult,
7047        >(
7048            (name, &mut value, mode,),
7049            0x4a951362f681f23c,
7050            fidl::encoding::DynamicFlags::empty(),
7051            _decode,
7052        )
7053    }
7054
7055    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
7056        NodeRemoveExtendedAttributeResult,
7057        fdomain_client::fidl::FDomainResourceDialect,
7058    >;
7059    fn r#remove_extended_attribute(
7060        &self,
7061        mut name: &[u8],
7062    ) -> Self::RemoveExtendedAttributeResponseFut {
7063        fn _decode(
7064            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7065        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7066            let _response = fidl::client::decode_transaction_body::<
7067                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7068                fdomain_client::fidl::FDomainResourceDialect,
7069                0x7a0b9f3a9bf9032d,
7070            >(_buf?)?;
7071            Ok(_response.map(|x| x))
7072        }
7073        self.client.send_query_and_decode::<
7074            NodeRemoveExtendedAttributeRequest,
7075            NodeRemoveExtendedAttributeResult,
7076        >(
7077            (name,),
7078            0x7a0b9f3a9bf9032d,
7079            fidl::encoding::DynamicFlags::empty(),
7080            _decode,
7081        )
7082    }
7083
7084    type ReadResponseFut = fidl::client::QueryResponseFut<
7085        ReadableReadResult,
7086        fdomain_client::fidl::FDomainResourceDialect,
7087    >;
7088    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
7089        fn _decode(
7090            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7091        ) -> Result<ReadableReadResult, fidl::Error> {
7092            let _response = fidl::client::decode_transaction_body::<
7093                fidl::encoding::ResultType<ReadableReadResponse, i32>,
7094                fdomain_client::fidl::FDomainResourceDialect,
7095                0x57e419a298c8ede,
7096            >(_buf?)?;
7097            Ok(_response.map(|x| x.data))
7098        }
7099        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
7100            (count,),
7101            0x57e419a298c8ede,
7102            fidl::encoding::DynamicFlags::empty(),
7103            _decode,
7104        )
7105    }
7106
7107    type WriteResponseFut = fidl::client::QueryResponseFut<
7108        WritableWriteResult,
7109        fdomain_client::fidl::FDomainResourceDialect,
7110    >;
7111    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
7112        fn _decode(
7113            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7114        ) -> Result<WritableWriteResult, fidl::Error> {
7115            let _response = fidl::client::decode_transaction_body::<
7116                fidl::encoding::ResultType<WritableWriteResponse, i32>,
7117                fdomain_client::fidl::FDomainResourceDialect,
7118                0x6a31437832469f82,
7119            >(_buf?)?;
7120            Ok(_response.map(|x| x.actual_count))
7121        }
7122        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
7123            (data,),
7124            0x6a31437832469f82,
7125            fidl::encoding::DynamicFlags::empty(),
7126            _decode,
7127        )
7128    }
7129
7130    type DescribeResponseFut =
7131        fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>;
7132    fn r#describe(&self) -> Self::DescribeResponseFut {
7133        fn _decode(
7134            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7135        ) -> Result<FileInfo, fidl::Error> {
7136            let _response = fidl::client::decode_transaction_body::<
7137                FileInfo,
7138                fdomain_client::fidl::FDomainResourceDialect,
7139                0x68b5ac00c62906bc,
7140            >(_buf?)?;
7141            Ok(_response)
7142        }
7143        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
7144            (),
7145            0x68b5ac00c62906bc,
7146            fidl::encoding::DynamicFlags::empty(),
7147            _decode,
7148        )
7149    }
7150
7151    type SeekResponseFut = fidl::client::QueryResponseFut<
7152        FileSeekResult,
7153        fdomain_client::fidl::FDomainResourceDialect,
7154    >;
7155    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
7156        fn _decode(
7157            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7158        ) -> Result<FileSeekResult, fidl::Error> {
7159            let _response = fidl::client::decode_transaction_body::<
7160                fidl::encoding::ResultType<FileSeekResponse, i32>,
7161                fdomain_client::fidl::FDomainResourceDialect,
7162                0x78079168162c5207,
7163            >(_buf?)?;
7164            Ok(_response.map(|x| x.offset_from_start))
7165        }
7166        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
7167            (origin, offset),
7168            0x78079168162c5207,
7169            fidl::encoding::DynamicFlags::empty(),
7170            _decode,
7171        )
7172    }
7173
7174    type ReadAtResponseFut = fidl::client::QueryResponseFut<
7175        FileReadAtResult,
7176        fdomain_client::fidl::FDomainResourceDialect,
7177    >;
7178    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
7179        fn _decode(
7180            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7181        ) -> Result<FileReadAtResult, fidl::Error> {
7182            let _response = fidl::client::decode_transaction_body::<
7183                fidl::encoding::ResultType<FileReadAtResponse, i32>,
7184                fdomain_client::fidl::FDomainResourceDialect,
7185                0x1607a293a60d723e,
7186            >(_buf?)?;
7187            Ok(_response.map(|x| x.data))
7188        }
7189        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
7190            (count, offset),
7191            0x1607a293a60d723e,
7192            fidl::encoding::DynamicFlags::empty(),
7193            _decode,
7194        )
7195    }
7196
7197    type WriteAtResponseFut = fidl::client::QueryResponseFut<
7198        FileWriteAtResult,
7199        fdomain_client::fidl::FDomainResourceDialect,
7200    >;
7201    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
7202        fn _decode(
7203            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7204        ) -> Result<FileWriteAtResult, fidl::Error> {
7205            let _response = fidl::client::decode_transaction_body::<
7206                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7207                fdomain_client::fidl::FDomainResourceDialect,
7208                0x793eefc0045e792b,
7209            >(_buf?)?;
7210            Ok(_response.map(|x| x.actual_count))
7211        }
7212        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
7213            (data, offset),
7214            0x793eefc0045e792b,
7215            fidl::encoding::DynamicFlags::empty(),
7216            _decode,
7217        )
7218    }
7219
7220    type ResizeResponseFut = fidl::client::QueryResponseFut<
7221        FileResizeResult,
7222        fdomain_client::fidl::FDomainResourceDialect,
7223    >;
7224    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
7225        fn _decode(
7226            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7227        ) -> Result<FileResizeResult, fidl::Error> {
7228            let _response = fidl::client::decode_transaction_body::<
7229                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7230                fdomain_client::fidl::FDomainResourceDialect,
7231                0x2b80825f0535743a,
7232            >(_buf?)?;
7233            Ok(_response.map(|x| x))
7234        }
7235        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
7236            (length,),
7237            0x2b80825f0535743a,
7238            fidl::encoding::DynamicFlags::empty(),
7239            _decode,
7240        )
7241    }
7242
7243    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
7244        FileGetBackingMemoryResult,
7245        fdomain_client::fidl::FDomainResourceDialect,
7246    >;
7247    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
7248        fn _decode(
7249            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7250        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7251            let _response = fidl::client::decode_transaction_body::<
7252                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7253                fdomain_client::fidl::FDomainResourceDialect,
7254                0xa6a9e654cbf62b,
7255            >(_buf?)?;
7256            Ok(_response.map(|x| x.vmo))
7257        }
7258        self.client
7259            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
7260                (flags,),
7261                0xa6a9e654cbf62b,
7262                fidl::encoding::DynamicFlags::empty(),
7263                _decode,
7264            )
7265    }
7266
7267    type AllocateResponseFut = fidl::client::QueryResponseFut<
7268        FileAllocateResult,
7269        fdomain_client::fidl::FDomainResourceDialect,
7270    >;
7271    fn r#allocate(
7272        &self,
7273        mut offset: u64,
7274        mut length: u64,
7275        mut mode: AllocateMode,
7276    ) -> Self::AllocateResponseFut {
7277        fn _decode(
7278            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7279        ) -> Result<FileAllocateResult, fidl::Error> {
7280            let _response = fidl::client::decode_transaction_body::<
7281                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7282                fdomain_client::fidl::FDomainResourceDialect,
7283                0x77fa0c330b57fd2e,
7284            >(_buf?)?
7285            .into_result_fdomain::<FileMarker>("allocate")?;
7286            Ok(_response.map(|x| x))
7287        }
7288        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
7289            (offset, length, mode),
7290            0x77fa0c330b57fd2e,
7291            fidl::encoding::DynamicFlags::FLEXIBLE,
7292            _decode,
7293        )
7294    }
7295
7296    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
7297        FileEnableVerityResult,
7298        fdomain_client::fidl::FDomainResourceDialect,
7299    >;
7300    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
7301        fn _decode(
7302            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7303        ) -> Result<FileEnableVerityResult, fidl::Error> {
7304            let _response = fidl::client::decode_transaction_body::<
7305                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7306                fdomain_client::fidl::FDomainResourceDialect,
7307                0x2c421ec3faaeb8bb,
7308            >(_buf?)?
7309            .into_result_fdomain::<FileMarker>("enable_verity")?;
7310            Ok(_response.map(|x| x))
7311        }
7312        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
7313            (options,),
7314            0x2c421ec3faaeb8bb,
7315            fidl::encoding::DynamicFlags::FLEXIBLE,
7316            _decode,
7317        )
7318    }
7319}
7320
7321pub struct FileEventStream {
7322    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7323}
7324
7325impl std::marker::Unpin for FileEventStream {}
7326
7327impl futures::stream::FusedStream for FileEventStream {
7328    fn is_terminated(&self) -> bool {
7329        self.event_receiver.is_terminated()
7330    }
7331}
7332
7333impl futures::Stream for FileEventStream {
7334    type Item = Result<FileEvent, fidl::Error>;
7335
7336    fn poll_next(
7337        mut self: std::pin::Pin<&mut Self>,
7338        cx: &mut std::task::Context<'_>,
7339    ) -> std::task::Poll<Option<Self::Item>> {
7340        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7341            &mut self.event_receiver,
7342            cx
7343        )?) {
7344            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
7345            None => std::task::Poll::Ready(None),
7346        }
7347    }
7348}
7349
7350#[derive(Debug)]
7351pub enum FileEvent {
7352    OnOpen_ {
7353        s: i32,
7354        info: Option<Box<NodeInfoDeprecated>>,
7355    },
7356    OnRepresentation {
7357        payload: Representation,
7358    },
7359    #[non_exhaustive]
7360    _UnknownEvent {
7361        /// Ordinal of the event that was sent.
7362        ordinal: u64,
7363    },
7364}
7365
7366impl FileEvent {
7367    #[allow(irrefutable_let_patterns)]
7368    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
7369        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
7370    }
7371    #[allow(irrefutable_let_patterns)]
7372    pub fn into_on_representation(self) -> Option<Representation> {
7373        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
7374    }
7375
7376    /// Decodes a message buffer as a [`FileEvent`].
7377    fn decode(
7378        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7379    ) -> Result<FileEvent, fidl::Error> {
7380        let (bytes, _handles) = buf.split_mut();
7381        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7382        debug_assert_eq!(tx_header.tx_id, 0);
7383        match tx_header.ordinal {
7384            0x7fc7bbb1dbfd1972 => {
7385                let mut out = fidl::new_empty!(
7386                    NodeOnOpenRequest,
7387                    fdomain_client::fidl::FDomainResourceDialect
7388                );
7389                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
7390                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
7391            }
7392            0x5cb40567d80a510c => {
7393                let mut out =
7394                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
7395                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
7396                Ok((FileEvent::OnRepresentation { payload: out }))
7397            }
7398            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7399                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7400            }
7401            _ => Err(fidl::Error::UnknownOrdinal {
7402                ordinal: tx_header.ordinal,
7403                protocol_name: <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7404            }),
7405        }
7406    }
7407}
7408
7409/// A Stream of incoming requests for fuchsia.io/File.
7410pub struct FileRequestStream {
7411    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7412    is_terminated: bool,
7413}
7414
7415impl std::marker::Unpin for FileRequestStream {}
7416
7417impl futures::stream::FusedStream for FileRequestStream {
7418    fn is_terminated(&self) -> bool {
7419        self.is_terminated
7420    }
7421}
7422
7423impl fdomain_client::fidl::RequestStream for FileRequestStream {
7424    type Protocol = FileMarker;
7425    type ControlHandle = FileControlHandle;
7426
7427    fn from_channel(channel: fdomain_client::Channel) -> Self {
7428        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7429    }
7430
7431    fn control_handle(&self) -> Self::ControlHandle {
7432        FileControlHandle { inner: self.inner.clone() }
7433    }
7434
7435    fn into_inner(
7436        self,
7437    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7438    {
7439        (self.inner, self.is_terminated)
7440    }
7441
7442    fn from_inner(
7443        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7444        is_terminated: bool,
7445    ) -> Self {
7446        Self { inner, is_terminated }
7447    }
7448}
7449
7450impl futures::Stream for FileRequestStream {
7451    type Item = Result<FileRequest, fidl::Error>;
7452
7453    fn poll_next(
7454        mut self: std::pin::Pin<&mut Self>,
7455        cx: &mut std::task::Context<'_>,
7456    ) -> std::task::Poll<Option<Self::Item>> {
7457        let this = &mut *self;
7458        if this.inner.check_shutdown(cx) {
7459            this.is_terminated = true;
7460            return std::task::Poll::Ready(None);
7461        }
7462        if this.is_terminated {
7463            panic!("polled FileRequestStream after completion");
7464        }
7465        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7466            |bytes, handles| {
7467                match this.inner.channel().read_etc(cx, bytes, handles) {
7468                    std::task::Poll::Ready(Ok(())) => {}
7469                    std::task::Poll::Pending => return std::task::Poll::Pending,
7470                    std::task::Poll::Ready(Err(None)) => {
7471                        this.is_terminated = true;
7472                        return std::task::Poll::Ready(None);
7473                    }
7474                    std::task::Poll::Ready(Err(Some(e))) => {
7475                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7476                            e.into(),
7477                        ))));
7478                    }
7479                }
7480
7481                // A message has been received from the channel
7482                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7483
7484                std::task::Poll::Ready(Some(match header.ordinal {
7485                    0x6ee9c0ad53ec87aa => {
7486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7487                        let mut req = fidl::new_empty!(
7488                            AdvisoryLockingAdvisoryLockRequest,
7489                            fdomain_client::fidl::FDomainResourceDialect
7490                        );
7491                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
7492                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7493                        Ok(FileRequest::AdvisoryLock {
7494                            request: req.request,
7495
7496                            responder: FileAdvisoryLockResponder {
7497                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7498                                tx_id: header.tx_id,
7499                            },
7500                        })
7501                    }
7502                    0x54f3949246a03e74 => {
7503                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7504                        let mut req = fidl::new_empty!(
7505                            LinkableLinkIntoRequest,
7506                            fdomain_client::fidl::FDomainResourceDialect
7507                        );
7508                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
7509                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7510                        Ok(FileRequest::LinkInto {
7511                            dst_parent_token: req.dst_parent_token,
7512                            dst: req.dst,
7513
7514                            responder: FileLinkIntoResponder {
7515                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7516                                tx_id: header.tx_id,
7517                            },
7518                        })
7519                    }
7520                    0x20d8a7aba2168a79 => {
7521                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7522                        let mut req = fidl::new_empty!(
7523                            fdomain_fuchsia_unknown::CloneableCloneRequest,
7524                            fdomain_client::fidl::FDomainResourceDialect
7525                        );
7526                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7527                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7528                        Ok(FileRequest::Clone { request: req.request, control_handle })
7529                    }
7530                    0x5ac5d459ad7f657e => {
7531                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7532                        let mut req = fidl::new_empty!(
7533                            fidl::encoding::EmptyPayload,
7534                            fdomain_client::fidl::FDomainResourceDialect
7535                        );
7536                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7537                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7538                        Ok(FileRequest::Close {
7539                            responder: FileCloseResponder {
7540                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7541                                tx_id: header.tx_id,
7542                            },
7543                        })
7544                    }
7545                    0x2658edee9decfc06 => {
7546                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7547                        let mut req = fidl::new_empty!(
7548                            fidl::encoding::EmptyPayload,
7549                            fdomain_client::fidl::FDomainResourceDialect
7550                        );
7551                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7552                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7553                        Ok(FileRequest::Query {
7554                            responder: FileQueryResponder {
7555                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7556                                tx_id: header.tx_id,
7557                            },
7558                        })
7559                    }
7560                    0x78985e216314dafd => {
7561                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7562                        let mut req = fidl::new_empty!(
7563                            fidl::encoding::EmptyPayload,
7564                            fdomain_client::fidl::FDomainResourceDialect
7565                        );
7566                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7567                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7568                        Ok(FileRequest::DeprecatedGetAttr {
7569                            responder: FileDeprecatedGetAttrResponder {
7570                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7571                                tx_id: header.tx_id,
7572                            },
7573                        })
7574                    }
7575                    0x4186c0f40d938f46 => {
7576                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7577                        let mut req = fidl::new_empty!(
7578                            NodeDeprecatedSetAttrRequest,
7579                            fdomain_client::fidl::FDomainResourceDialect
7580                        );
7581                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
7582                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7583                        Ok(FileRequest::DeprecatedSetAttr {
7584                            flags: req.flags,
7585                            attributes: req.attributes,
7586
7587                            responder: FileDeprecatedSetAttrResponder {
7588                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7589                                tx_id: header.tx_id,
7590                            },
7591                        })
7592                    }
7593                    0x5b88fffb8eda3aa1 => {
7594                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7595                        let mut req = fidl::new_empty!(
7596                            fidl::encoding::EmptyPayload,
7597                            fdomain_client::fidl::FDomainResourceDialect
7598                        );
7599                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7600                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7601                        Ok(FileRequest::DeprecatedGetFlags {
7602                            responder: FileDeprecatedGetFlagsResponder {
7603                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7604                                tx_id: header.tx_id,
7605                            },
7606                        })
7607                    }
7608                    0x5295b76c71fde733 => {
7609                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7610                        let mut req = fidl::new_empty!(
7611                            NodeDeprecatedSetFlagsRequest,
7612                            fdomain_client::fidl::FDomainResourceDialect
7613                        );
7614                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7615                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7616                        Ok(FileRequest::DeprecatedSetFlags {
7617                            flags: req.flags,
7618
7619                            responder: FileDeprecatedSetFlagsResponder {
7620                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7621                                tx_id: header.tx_id,
7622                            },
7623                        })
7624                    }
7625                    0x176eb318f64ec23 => {
7626                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7627                        let mut req = fidl::new_empty!(
7628                            fidl::encoding::EmptyPayload,
7629                            fdomain_client::fidl::FDomainResourceDialect
7630                        );
7631                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7632                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7633                        Ok(FileRequest::GetFlags {
7634                            responder: FileGetFlagsResponder {
7635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7636                                tx_id: header.tx_id,
7637                            },
7638                        })
7639                    }
7640                    0x55a8028685791ea8 => {
7641                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7642                        let mut req = fidl::new_empty!(
7643                            NodeSetFlagsRequest,
7644                            fdomain_client::fidl::FDomainResourceDialect
7645                        );
7646                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7647                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7648                        Ok(FileRequest::SetFlags {
7649                            flags: req.flags,
7650
7651                            responder: FileSetFlagsResponder {
7652                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7653                                tx_id: header.tx_id,
7654                            },
7655                        })
7656                    }
7657                    0x6f344a1c6b0a0610 => {
7658                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7659                        let mut req = fidl::new_empty!(
7660                            fidl::encoding::EmptyPayload,
7661                            fdomain_client::fidl::FDomainResourceDialect
7662                        );
7663                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7664                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7665                        Ok(FileRequest::QueryFilesystem {
7666                            responder: FileQueryFilesystemResponder {
7667                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7668                                tx_id: header.tx_id,
7669                            },
7670                        })
7671                    }
7672                    0x5054f0ade7076cec => {
7673                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7674                        let mut req = fidl::new_empty!(
7675                            fidl::encoding::EmptyPayload,
7676                            fdomain_client::fidl::FDomainResourceDialect
7677                        );
7678                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7679                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7680                        Ok(FileRequest::GetToken {
7681                            responder: FileGetTokenResponder {
7682                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7683                                tx_id: header.tx_id,
7684                            },
7685                        })
7686                    }
7687                    0x3d4396a638ea053b => {
7688                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7689                        let mut req = fidl::new_empty!(
7690                            NodeGetAttributesRequest,
7691                            fdomain_client::fidl::FDomainResourceDialect
7692                        );
7693                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7694                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7695                        Ok(FileRequest::GetAttributes {
7696                            query: req.query,
7697
7698                            responder: FileGetAttributesResponder {
7699                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7700                                tx_id: header.tx_id,
7701                            },
7702                        })
7703                    }
7704                    0x3308c1da5a89bf08 => {
7705                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7706                        let mut req = fidl::new_empty!(
7707                            MutableNodeAttributes,
7708                            fdomain_client::fidl::FDomainResourceDialect
7709                        );
7710                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
7711                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7712                        Ok(FileRequest::UpdateAttributes {
7713                            payload: req,
7714                            responder: FileUpdateAttributesResponder {
7715                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7716                                tx_id: header.tx_id,
7717                            },
7718                        })
7719                    }
7720                    0x2c5c27ca0ab5dc49 => {
7721                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7722                        let mut req = fidl::new_empty!(
7723                            fidl::encoding::EmptyPayload,
7724                            fdomain_client::fidl::FDomainResourceDialect
7725                        );
7726                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7727                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7728                        Ok(FileRequest::Sync {
7729                            responder: FileSyncResponder {
7730                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7731                                tx_id: header.tx_id,
7732                            },
7733                        })
7734                    }
7735                    0x4b61033de007fcd0 => {
7736                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7737                        let mut req = fidl::new_empty!(
7738                            NodeListExtendedAttributesRequest,
7739                            fdomain_client::fidl::FDomainResourceDialect
7740                        );
7741                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7742                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7743                        Ok(FileRequest::ListExtendedAttributes {
7744                            iterator: req.iterator,
7745
7746                            control_handle,
7747                        })
7748                    }
7749                    0x45ffa3ccfdeb76db => {
7750                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7751                        let mut req = fidl::new_empty!(
7752                            NodeGetExtendedAttributeRequest,
7753                            fdomain_client::fidl::FDomainResourceDialect
7754                        );
7755                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7756                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7757                        Ok(FileRequest::GetExtendedAttribute {
7758                            name: req.name,
7759
7760                            responder: FileGetExtendedAttributeResponder {
7761                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7762                                tx_id: header.tx_id,
7763                            },
7764                        })
7765                    }
7766                    0x4a951362f681f23c => {
7767                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7768                        let mut req = fidl::new_empty!(
7769                            NodeSetExtendedAttributeRequest,
7770                            fdomain_client::fidl::FDomainResourceDialect
7771                        );
7772                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7773                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7774                        Ok(FileRequest::SetExtendedAttribute {
7775                            name: req.name,
7776                            value: req.value,
7777                            mode: req.mode,
7778
7779                            responder: FileSetExtendedAttributeResponder {
7780                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7781                                tx_id: header.tx_id,
7782                            },
7783                        })
7784                    }
7785                    0x7a0b9f3a9bf9032d => {
7786                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7787                        let mut req = fidl::new_empty!(
7788                            NodeRemoveExtendedAttributeRequest,
7789                            fdomain_client::fidl::FDomainResourceDialect
7790                        );
7791                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7792                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7793                        Ok(FileRequest::RemoveExtendedAttribute {
7794                            name: req.name,
7795
7796                            responder: FileRemoveExtendedAttributeResponder {
7797                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7798                                tx_id: header.tx_id,
7799                            },
7800                        })
7801                    }
7802                    0x57e419a298c8ede => {
7803                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7804                        let mut req = fidl::new_empty!(
7805                            ReadableReadRequest,
7806                            fdomain_client::fidl::FDomainResourceDialect
7807                        );
7808                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
7809                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7810                        Ok(FileRequest::Read {
7811                            count: req.count,
7812
7813                            responder: FileReadResponder {
7814                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7815                                tx_id: header.tx_id,
7816                            },
7817                        })
7818                    }
7819                    0x6a31437832469f82 => {
7820                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7821                        let mut req = fidl::new_empty!(
7822                            WritableWriteRequest,
7823                            fdomain_client::fidl::FDomainResourceDialect
7824                        );
7825                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
7826                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7827                        Ok(FileRequest::Write {
7828                            data: req.data,
7829
7830                            responder: FileWriteResponder {
7831                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7832                                tx_id: header.tx_id,
7833                            },
7834                        })
7835                    }
7836                    0x68b5ac00c62906bc => {
7837                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7838                        let mut req = fidl::new_empty!(
7839                            fidl::encoding::EmptyPayload,
7840                            fdomain_client::fidl::FDomainResourceDialect
7841                        );
7842                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7843                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7844                        Ok(FileRequest::Describe {
7845                            responder: FileDescribeResponder {
7846                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7847                                tx_id: header.tx_id,
7848                            },
7849                        })
7850                    }
7851                    0x78079168162c5207 => {
7852                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7853                        let mut req = fidl::new_empty!(
7854                            FileSeekRequest,
7855                            fdomain_client::fidl::FDomainResourceDialect
7856                        );
7857                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
7858                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7859                        Ok(FileRequest::Seek {
7860                            origin: req.origin,
7861                            offset: req.offset,
7862
7863                            responder: FileSeekResponder {
7864                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7865                                tx_id: header.tx_id,
7866                            },
7867                        })
7868                    }
7869                    0x1607a293a60d723e => {
7870                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7871                        let mut req = fidl::new_empty!(
7872                            FileReadAtRequest,
7873                            fdomain_client::fidl::FDomainResourceDialect
7874                        );
7875                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
7876                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7877                        Ok(FileRequest::ReadAt {
7878                            count: req.count,
7879                            offset: req.offset,
7880
7881                            responder: FileReadAtResponder {
7882                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7883                                tx_id: header.tx_id,
7884                            },
7885                        })
7886                    }
7887                    0x793eefc0045e792b => {
7888                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7889                        let mut req = fidl::new_empty!(
7890                            FileWriteAtRequest,
7891                            fdomain_client::fidl::FDomainResourceDialect
7892                        );
7893                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
7894                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7895                        Ok(FileRequest::WriteAt {
7896                            data: req.data,
7897                            offset: req.offset,
7898
7899                            responder: FileWriteAtResponder {
7900                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7901                                tx_id: header.tx_id,
7902                            },
7903                        })
7904                    }
7905                    0x2b80825f0535743a => {
7906                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7907                        let mut req = fidl::new_empty!(
7908                            FileResizeRequest,
7909                            fdomain_client::fidl::FDomainResourceDialect
7910                        );
7911                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
7912                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7913                        Ok(FileRequest::Resize {
7914                            length: req.length,
7915
7916                            responder: FileResizeResponder {
7917                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7918                                tx_id: header.tx_id,
7919                            },
7920                        })
7921                    }
7922                    0xa6a9e654cbf62b => {
7923                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7924                        let mut req = fidl::new_empty!(
7925                            FileGetBackingMemoryRequest,
7926                            fdomain_client::fidl::FDomainResourceDialect
7927                        );
7928                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
7929                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7930                        Ok(FileRequest::GetBackingMemory {
7931                            flags: req.flags,
7932
7933                            responder: FileGetBackingMemoryResponder {
7934                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7935                                tx_id: header.tx_id,
7936                            },
7937                        })
7938                    }
7939                    0x77fa0c330b57fd2e => {
7940                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7941                        let mut req = fidl::new_empty!(
7942                            FileAllocateRequest,
7943                            fdomain_client::fidl::FDomainResourceDialect
7944                        );
7945                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
7946                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7947                        Ok(FileRequest::Allocate {
7948                            offset: req.offset,
7949                            length: req.length,
7950                            mode: req.mode,
7951
7952                            responder: FileAllocateResponder {
7953                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7954                                tx_id: header.tx_id,
7955                            },
7956                        })
7957                    }
7958                    0x2c421ec3faaeb8bb => {
7959                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7960                        let mut req = fidl::new_empty!(
7961                            FileEnableVerityRequest,
7962                            fdomain_client::fidl::FDomainResourceDialect
7963                        );
7964                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
7965                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7966                        Ok(FileRequest::EnableVerity {
7967                            options: req.options,
7968
7969                            responder: FileEnableVerityResponder {
7970                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7971                                tx_id: header.tx_id,
7972                            },
7973                        })
7974                    }
7975                    _ if header.tx_id == 0
7976                        && header
7977                            .dynamic_flags()
7978                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7979                    {
7980                        Ok(FileRequest::_UnknownMethod {
7981                            ordinal: header.ordinal,
7982                            control_handle: FileControlHandle { inner: this.inner.clone() },
7983                            method_type: fidl::MethodType::OneWay,
7984                        })
7985                    }
7986                    _ if header
7987                        .dynamic_flags()
7988                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7989                    {
7990                        this.inner.send_framework_err(
7991                            fidl::encoding::FrameworkErr::UnknownMethod,
7992                            header.tx_id,
7993                            header.ordinal,
7994                            header.dynamic_flags(),
7995                            (bytes, handles),
7996                        )?;
7997                        Ok(FileRequest::_UnknownMethod {
7998                            ordinal: header.ordinal,
7999                            control_handle: FileControlHandle { inner: this.inner.clone() },
8000                            method_type: fidl::MethodType::TwoWay,
8001                        })
8002                    }
8003                    _ => Err(fidl::Error::UnknownOrdinal {
8004                        ordinal: header.ordinal,
8005                        protocol_name:
8006                            <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8007                    }),
8008                }))
8009            },
8010        )
8011    }
8012}
8013
8014/// A [`Node`] which contains a sequence of bytes of definite length.
8015///
8016/// NOTE: cloned connections do not share their seek offset with their source
8017/// connection.
8018#[derive(Debug)]
8019pub enum FileRequest {
8020    /// Acquires an advisory lock on the underlying file.
8021    ///
8022    /// The lock lasts until either this connection is closed or
8023    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
8024    /// explicitly.
8025    ///
8026    /// Advisory locks are purely advisory. They do not prevent actual read or
8027    /// write operations from occurring on the file, either through this
8028    /// connection or through other connections.
8029    ///
8030    /// This method requires the following rights:
8031    ///
8032    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
8033    /// * [`Rights.WRITE_BYTES`] if `request.type` is
8034    ///   [`AdvisoryLockType.WRITE`].
8035    ///
8036    /// # Errors
8037    ///
8038    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
8039    ///   example, another connection might hold a conflicting lock type.
8040    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
8041    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
8042    ///   to acquire the given type of lock.
8043    AdvisoryLock {
8044        request: AdvisoryLockRequest,
8045        responder: FileAdvisoryLockResponder,
8046    },
8047    /// Creates a link to this this object with name `dst` in the directory represented by
8048    /// `dst_parent_token`.
8049    ///
8050    /// `dst` must be a resolved object name. Including "/" in the string will return
8051    /// `ZX_ERR_INVALID_ARGS`.
8052    ///
8053    /// This method requires the maximal set of rights supported by the filesystem for this object.
8054    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
8055    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
8056    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
8057    /// `ZX_ERR_ACCESS_DENIED`.
8058    ///
8059    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
8060    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
8061    ///
8062    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
8063    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
8064    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
8065    ///
8066    /// This method does not have the same atomicity properties has the `Directory::Link` method,
8067    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
8068    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
8069    LinkInto {
8070        dst_parent_token: fdomain_client::Event,
8071        dst: String,
8072        responder: FileLinkIntoResponder,
8073    },
8074    Clone {
8075        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8076        control_handle: FileControlHandle,
8077    },
8078    /// Terminates the connection.
8079    ///
8080    /// After calling `Close`, the client must not send any other requests.
8081    ///
8082    /// Servers, after sending the status response, should close the connection
8083    /// regardless of status and without sending an epitaph.
8084    ///
8085    /// Closing the client end of the channel should be semantically equivalent
8086    /// to calling `Close` without knowing when the close has completed or its
8087    /// status.
8088    Close {
8089        responder: FileCloseResponder,
8090    },
8091    Query {
8092        responder: FileQueryResponder,
8093    },
8094    /// DEPRECATED - Use `Node.GetAttributes` instead.
8095    ///
8096    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8097    DeprecatedGetAttr {
8098        responder: FileDeprecatedGetAttrResponder,
8099    },
8100    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
8101    DeprecatedSetAttr {
8102        flags: NodeAttributeFlags,
8103        attributes: NodeAttributes,
8104        responder: FileDeprecatedSetAttrResponder,
8105    },
8106    /// [DEPRECATED - Use new GetFlags method instead.]
8107    DeprecatedGetFlags {
8108        responder: FileDeprecatedGetFlagsResponder,
8109    },
8110    /// [DEPRECATED - Use new SetFlags method instead.]
8111    DeprecatedSetFlags {
8112        flags: OpenFlags,
8113        responder: FileDeprecatedSetFlagsResponder,
8114    },
8115    /// Queries the flags that apply to this node after it has been opened/created. This method does
8116    /// not require any rights.
8117    ///
8118    /// Note that the final set of flags that apply to the connection may differ from those
8119    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8120    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8121    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8122    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8123    GetFlags {
8124        responder: FileGetFlagsResponder,
8125    },
8126    /// Sets the flags that apply to this node after it has been opened. This method does not
8127    /// require any rights.
8128    ///
8129    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8130    /// clear append mode.
8131    ///
8132    /// Errors:
8133    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8134    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8135    SetFlags {
8136        flags: Flags,
8137        responder: FileSetFlagsResponder,
8138    },
8139    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8140    /// volume has different settings or the storage is accounted seperately from the rest of the
8141    /// filesystem that may be reported instead of filesystem-wide details.
8142    QueryFilesystem {
8143        responder: FileQueryFilesystemResponder,
8144    },
8145    /// Acquires a token which can be used to identify this connection at a later point in
8146    /// time. The token will remain valid for as long as the connection requesting the token
8147    /// remains open.
8148    ///
8149    /// This method does not require any rights. Note that the token identifies
8150    /// the connection, hence carries the rights information on this connection.
8151    GetToken {
8152        responder: FileGetTokenResponder,
8153    },
8154    /// Acquires information about the node.
8155    ///
8156    /// The attributes of a node should be stable, independent of the
8157    /// specific protocol used to access it.
8158    ///
8159    /// If a particular attribute is not applicable or not supported,
8160    /// filesystems should leave the corresponding field absent.
8161    ///
8162    /// + `query` a bit-mask specifying which attributes to fetch. The server
8163    ///   should not return more than necessary.
8164    /// - `attributes` the returned attributes.
8165    ///
8166    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8167    GetAttributes {
8168        query: NodeAttributesQuery,
8169        responder: FileGetAttributesResponder,
8170    },
8171    /// Updates information about the node.
8172    ///
8173    /// + `attributes` the presence of a table field in `attributes` indicates
8174    /// the intent to update the corresponding attribute.
8175    ///
8176    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8177    ///
8178    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8179    UpdateAttributes {
8180        payload: MutableNodeAttributes,
8181        responder: FileUpdateAttributesResponder,
8182    },
8183    /// Synchronizes updates to the node to the underlying media, if it exists.
8184    ///
8185    /// This method will return when the filesystem server has flushed the
8186    /// relevant updates to the underlying media, but does not guarantee the
8187    /// underlying media has persisted the information, nor that any information
8188    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8189    /// between operations.
8190    ///
8191    /// This method does not require any rights.
8192    Sync {
8193        responder: FileSyncResponder,
8194    },
8195    /// Creates an iterator over all the extended attribute names associated
8196    /// with this node. If an error occurs it is returned as an epitaph on the
8197    /// iterator request channel, and then the channel is closed.
8198    ///
8199    /// GetExtendedAttributes can be used with any of these names to retrieve
8200    /// the associated value.
8201    ///
8202    /// This method requires the [`Rights.READ_BYTES`] right.
8203    ListExtendedAttributes {
8204        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
8205        control_handle: FileControlHandle,
8206    },
8207    /// Get the value associated with the given attribute `name` for this node.
8208    ///
8209    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8210    /// particular structure is imposed on them.
8211    ///
8212    /// This method requires the [`Rights.READ_BYTES`] right.
8213    GetExtendedAttribute {
8214        name: Vec<u8>,
8215        responder: FileGetExtendedAttributeResponder,
8216    },
8217    /// Set the value for the given attribute `name` to `value` for this node.
8218    ///
8219    /// The attribute name may exist, in which case the attribute is updated.
8220    /// If the attribute doesn't exist, it is created. The name should have no
8221    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8222    ///
8223    /// This method requires the [`Rights.WRITE_BYTES`] right.
8224    SetExtendedAttribute {
8225        name: Vec<u8>,
8226        value: ExtendedAttributeValue,
8227        mode: SetExtendedAttributeMode,
8228        responder: FileSetExtendedAttributeResponder,
8229    },
8230    /// Remove the specified extended attribute.
8231    ///
8232    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8233    ///
8234    /// This method requires the [`Rights.WRITE_BYTES`] right.
8235    RemoveExtendedAttribute {
8236        name: Vec<u8>,
8237        responder: FileRemoveExtendedAttributeResponder,
8238    },
8239    /// Reads up to 'count' bytes at the seek offset.
8240    /// The seek offset is moved forward by the number of bytes read.
8241    ///
8242    /// ## Invariants
8243    ///
8244    /// * The returned `data.length` will never be greater than `count`.
8245    /// * If `data.length` is less than `count`, it means that the seek offset
8246    ///   has reached the end of file as part of this operation.
8247    /// * If `data.length` is zero while `count` is not, it means that the
8248    ///   seek offset is already at or beyond the end of file, and no data could
8249    ///   be read.
8250    /// * If `count` is zero, the server should perform all the checks ensuring
8251    ///   read access without actually read anything, and return an empty
8252    ///   `data` vector.
8253    ///
8254    /// This method requires the [`Rights.READ_BYTES`] right.
8255    ///
8256    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8257    Read {
8258        count: u64,
8259        responder: FileReadResponder,
8260    },
8261    /// Writes data at the seek offset.
8262    /// The seek offset is moved forward by the number of bytes written.
8263    /// If the file is in append mode, the seek offset is first set to the end
8264    /// of the file, followed by the write, in one atomic step.
8265    ///
8266    /// The file size may grow if the seek offset plus `data.length` is beyond
8267    /// the current end of file.
8268    ///
8269    /// + request `data` the byte buffer to write to the file.
8270    /// - response `actual_count` the number of bytes written.
8271    ///
8272    /// ## Invariants
8273    ///
8274    /// * The returned `actual_count` will never be greater than `data.length`.
8275    /// * If the server is unable to write all the data due to e.g. not enough
8276    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8277    ///   could be written, an error is returned.
8278    /// * If `data.length` is zero, the server should perform all the checks
8279    ///   ensuring write access without mutating the file and return a
8280    ///   successful write of zero bytes.  The seek offset is still updated if
8281    ///   in append mode.
8282    ///
8283    /// This method requires the [`Rights.WRITE_BYTES`] right.
8284    Write {
8285        data: Vec<u8>,
8286        responder: FileWriteResponder,
8287    },
8288    Describe {
8289        responder: FileDescribeResponder,
8290    },
8291    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8292    /// will occur. The seek offset is specific to each file connection.
8293    ///
8294    /// + request `origin` the reference point where `offset` will be based on.
8295    /// + request `offset` the number of bytes to seek.
8296    /// - response `offset_from_start` the adjusted seek offset, from the start
8297    ///   of the file.
8298    ///
8299    /// This method does not require any rights.
8300    Seek {
8301        origin: SeekOrigin,
8302        offset: i64,
8303        responder: FileSeekResponder,
8304    },
8305    /// Reads up to 'count' bytes at the provided offset.
8306    /// Does not affect the seek offset.
8307    ///
8308    /// ## Invariants
8309    ///
8310    /// * The returned `data.length` will never be greater than `count`.
8311    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8312    ///   the end of file as part of this operation.
8313    /// * If `data.length` is zero while `count` is not, it means that `offset`
8314    ///   is at or past the end of file, and no data can be read.
8315    /// * If `count` is zero, the server should perform all the checks ensuring
8316    ///   read access without actually reading anything, and return an empty
8317    ///   `data` vector.
8318    ///
8319    /// This method requires the [`Rights.READ_BYTES`] right.
8320    ///
8321    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8322    ReadAt {
8323        count: u64,
8324        offset: u64,
8325        responder: FileReadAtResponder,
8326    },
8327    /// Writes data at the provided offset.
8328    /// Does not affect the seek offset.
8329    ///
8330    /// The file size may grow if `offset` plus `data.length` is past the
8331    /// current end of file.
8332    ///
8333    /// + request `data` the byte buffer to write to the file.
8334    /// + request `offset` the offset from start of the file to begin writing.
8335    /// - response `actual_count` the number of bytes written.
8336    ///
8337    /// ## Invariants
8338    ///
8339    /// * The returned `actual_count` will never be greater than `data.length`.
8340    /// * If the server is unable to write all the data due to e.g. not enough
8341    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8342    ///   could be written, an error is returned.
8343    /// * If `data.length` is zero, the server should perform all the checks
8344    ///   ensuring write access without mutating the file, and will return a
8345    ///   successful write of zero bytes.
8346    ///
8347    /// This method requires the [`Rights.WRITE_BYTES`] right.
8348    WriteAt {
8349        data: Vec<u8>,
8350        offset: u64,
8351        responder: FileWriteAtResponder,
8352    },
8353    /// Shrinks or grows the file size to 'length' bytes.
8354    ///
8355    /// If file size is reduced by this operation, the extra trailing data'
8356    /// is discarded.
8357    /// If file size is increased by this operation, the extended area appears
8358    /// as if it was zeroed.
8359    ///
8360    /// This method requires the [`Rights.WRITE_BYTES`] right.
8361    Resize {
8362        length: u64,
8363        responder: FileResizeResponder,
8364    },
8365    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8366    /// with the requested access rights.
8367    ///
8368    /// Implementations are not required to implement files backed by VMOs so
8369    /// this request may fail. Additionally, implementations may only support
8370    /// a certain subset of the flags. Clients should be prepared with fallback
8371    /// behavior if this request fails.
8372    ///
8373    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8374    /// implementation is free to choose the semantics of the returned VMO.
8375    ///
8376    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8377    /// - response `vmo` the requested [`zx.Handle:VMO`].
8378    /// * error a [`zx.Status`] value indicating the failure.
8379    ///
8380    /// This method requires the following rights:
8381    ///
8382    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8383    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8384    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8385    GetBackingMemory {
8386        flags: VmoFlags,
8387        responder: FileGetBackingMemoryResponder,
8388    },
8389    /// Pre-allocate on-disk space for this file.
8390    Allocate {
8391        offset: u64,
8392        length: u64,
8393        mode: AllocateMode,
8394        responder: FileAllocateResponder,
8395    },
8396    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8397    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8398    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8399    /// rejected. This method can take some time to complete as it depends on the size of the file.
8400    /// This method can be aborted by closing the connection that this method was issued on.
8401    ///
8402    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8403    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8404    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8405    /// Also returns any error that might arise from reading the file, or from flushing the file,
8406    /// such as `ZX_ERR_IO`.
8407    EnableVerity {
8408        options: VerificationOptions,
8409        responder: FileEnableVerityResponder,
8410    },
8411    /// An interaction was received which does not match any known method.
8412    #[non_exhaustive]
8413    _UnknownMethod {
8414        /// Ordinal of the method that was called.
8415        ordinal: u64,
8416        control_handle: FileControlHandle,
8417        method_type: fidl::MethodType,
8418    },
8419}
8420
8421impl FileRequest {
8422    #[allow(irrefutable_let_patterns)]
8423    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
8424        if let FileRequest::AdvisoryLock { request, responder } = self {
8425            Some((request, responder))
8426        } else {
8427            None
8428        }
8429    }
8430
8431    #[allow(irrefutable_let_patterns)]
8432    pub fn into_link_into(self) -> Option<(fdomain_client::Event, String, FileLinkIntoResponder)> {
8433        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
8434            Some((dst_parent_token, dst, responder))
8435        } else {
8436            None
8437        }
8438    }
8439
8440    #[allow(irrefutable_let_patterns)]
8441    pub fn into_clone(
8442        self,
8443    ) -> Option<(
8444        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8445        FileControlHandle,
8446    )> {
8447        if let FileRequest::Clone { request, control_handle } = self {
8448            Some((request, control_handle))
8449        } else {
8450            None
8451        }
8452    }
8453
8454    #[allow(irrefutable_let_patterns)]
8455    pub fn into_close(self) -> Option<(FileCloseResponder)> {
8456        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
8457    }
8458
8459    #[allow(irrefutable_let_patterns)]
8460    pub fn into_query(self) -> Option<(FileQueryResponder)> {
8461        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
8462    }
8463
8464    #[allow(irrefutable_let_patterns)]
8465    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
8466        if let FileRequest::DeprecatedGetAttr { responder } = self {
8467            Some((responder))
8468        } else {
8469            None
8470        }
8471    }
8472
8473    #[allow(irrefutable_let_patterns)]
8474    pub fn into_deprecated_set_attr(
8475        self,
8476    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
8477        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
8478            Some((flags, attributes, responder))
8479        } else {
8480            None
8481        }
8482    }
8483
8484    #[allow(irrefutable_let_patterns)]
8485    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
8486        if let FileRequest::DeprecatedGetFlags { responder } = self {
8487            Some((responder))
8488        } else {
8489            None
8490        }
8491    }
8492
8493    #[allow(irrefutable_let_patterns)]
8494    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
8495        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
8496            Some((flags, responder))
8497        } else {
8498            None
8499        }
8500    }
8501
8502    #[allow(irrefutable_let_patterns)]
8503    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
8504        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
8505    }
8506
8507    #[allow(irrefutable_let_patterns)]
8508    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
8509        if let FileRequest::SetFlags { flags, responder } = self {
8510            Some((flags, responder))
8511        } else {
8512            None
8513        }
8514    }
8515
8516    #[allow(irrefutable_let_patterns)]
8517    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
8518        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
8519    }
8520
8521    #[allow(irrefutable_let_patterns)]
8522    pub fn into_get_token(self) -> Option<(FileGetTokenResponder)> {
8523        if let FileRequest::GetToken { responder } = self { Some((responder)) } else { None }
8524    }
8525
8526    #[allow(irrefutable_let_patterns)]
8527    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
8528        if let FileRequest::GetAttributes { query, responder } = self {
8529            Some((query, responder))
8530        } else {
8531            None
8532        }
8533    }
8534
8535    #[allow(irrefutable_let_patterns)]
8536    pub fn into_update_attributes(
8537        self,
8538    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
8539        if let FileRequest::UpdateAttributes { payload, responder } = self {
8540            Some((payload, responder))
8541        } else {
8542            None
8543        }
8544    }
8545
8546    #[allow(irrefutable_let_patterns)]
8547    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
8548        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
8549    }
8550
8551    #[allow(irrefutable_let_patterns)]
8552    pub fn into_list_extended_attributes(
8553        self,
8554    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
8555    {
8556        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
8557            Some((iterator, control_handle))
8558        } else {
8559            None
8560        }
8561    }
8562
8563    #[allow(irrefutable_let_patterns)]
8564    pub fn into_get_extended_attribute(
8565        self,
8566    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
8567        if let FileRequest::GetExtendedAttribute { name, responder } = self {
8568            Some((name, responder))
8569        } else {
8570            None
8571        }
8572    }
8573
8574    #[allow(irrefutable_let_patterns)]
8575    pub fn into_set_extended_attribute(
8576        self,
8577    ) -> Option<(
8578        Vec<u8>,
8579        ExtendedAttributeValue,
8580        SetExtendedAttributeMode,
8581        FileSetExtendedAttributeResponder,
8582    )> {
8583        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
8584            Some((name, value, mode, responder))
8585        } else {
8586            None
8587        }
8588    }
8589
8590    #[allow(irrefutable_let_patterns)]
8591    pub fn into_remove_extended_attribute(
8592        self,
8593    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
8594        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
8595            Some((name, responder))
8596        } else {
8597            None
8598        }
8599    }
8600
8601    #[allow(irrefutable_let_patterns)]
8602    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
8603        if let FileRequest::Read { count, responder } = self {
8604            Some((count, responder))
8605        } else {
8606            None
8607        }
8608    }
8609
8610    #[allow(irrefutable_let_patterns)]
8611    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
8612        if let FileRequest::Write { data, responder } = self {
8613            Some((data, responder))
8614        } else {
8615            None
8616        }
8617    }
8618
8619    #[allow(irrefutable_let_patterns)]
8620    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
8621        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
8622    }
8623
8624    #[allow(irrefutable_let_patterns)]
8625    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
8626        if let FileRequest::Seek { origin, offset, responder } = self {
8627            Some((origin, offset, responder))
8628        } else {
8629            None
8630        }
8631    }
8632
8633    #[allow(irrefutable_let_patterns)]
8634    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
8635        if let FileRequest::ReadAt { count, offset, responder } = self {
8636            Some((count, offset, responder))
8637        } else {
8638            None
8639        }
8640    }
8641
8642    #[allow(irrefutable_let_patterns)]
8643    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
8644        if let FileRequest::WriteAt { data, offset, responder } = self {
8645            Some((data, offset, responder))
8646        } else {
8647            None
8648        }
8649    }
8650
8651    #[allow(irrefutable_let_patterns)]
8652    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
8653        if let FileRequest::Resize { length, responder } = self {
8654            Some((length, responder))
8655        } else {
8656            None
8657        }
8658    }
8659
8660    #[allow(irrefutable_let_patterns)]
8661    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
8662        if let FileRequest::GetBackingMemory { flags, responder } = self {
8663            Some((flags, responder))
8664        } else {
8665            None
8666        }
8667    }
8668
8669    #[allow(irrefutable_let_patterns)]
8670    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
8671        if let FileRequest::Allocate { offset, length, mode, responder } = self {
8672            Some((offset, length, mode, responder))
8673        } else {
8674            None
8675        }
8676    }
8677
8678    #[allow(irrefutable_let_patterns)]
8679    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
8680        if let FileRequest::EnableVerity { options, responder } = self {
8681            Some((options, responder))
8682        } else {
8683            None
8684        }
8685    }
8686
8687    /// Name of the method defined in FIDL
8688    pub fn method_name(&self) -> &'static str {
8689        match *self {
8690            FileRequest::AdvisoryLock { .. } => "advisory_lock",
8691            FileRequest::LinkInto { .. } => "link_into",
8692            FileRequest::Clone { .. } => "clone",
8693            FileRequest::Close { .. } => "close",
8694            FileRequest::Query { .. } => "query",
8695            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
8696            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
8697            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
8698            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
8699            FileRequest::GetFlags { .. } => "get_flags",
8700            FileRequest::SetFlags { .. } => "set_flags",
8701            FileRequest::QueryFilesystem { .. } => "query_filesystem",
8702            FileRequest::GetToken { .. } => "get_token",
8703            FileRequest::GetAttributes { .. } => "get_attributes",
8704            FileRequest::UpdateAttributes { .. } => "update_attributes",
8705            FileRequest::Sync { .. } => "sync",
8706            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
8707            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
8708            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
8709            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
8710            FileRequest::Read { .. } => "read",
8711            FileRequest::Write { .. } => "write",
8712            FileRequest::Describe { .. } => "describe",
8713            FileRequest::Seek { .. } => "seek",
8714            FileRequest::ReadAt { .. } => "read_at",
8715            FileRequest::WriteAt { .. } => "write_at",
8716            FileRequest::Resize { .. } => "resize",
8717            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
8718            FileRequest::Allocate { .. } => "allocate",
8719            FileRequest::EnableVerity { .. } => "enable_verity",
8720            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8721                "unknown one-way method"
8722            }
8723            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8724                "unknown two-way method"
8725            }
8726        }
8727    }
8728}
8729
8730#[derive(Debug, Clone)]
8731pub struct FileControlHandle {
8732    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8733}
8734
8735impl FileControlHandle {
8736    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8737        self.inner.shutdown_with_epitaph(status.into())
8738    }
8739}
8740
8741impl fdomain_client::fidl::ControlHandle for FileControlHandle {
8742    fn shutdown(&self) {
8743        self.inner.shutdown()
8744    }
8745
8746    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8747        self.inner.shutdown_with_epitaph(status)
8748    }
8749
8750    fn is_closed(&self) -> bool {
8751        self.inner.channel().is_closed()
8752    }
8753    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8754        self.inner.channel().on_closed()
8755    }
8756}
8757
8758impl FileControlHandle {
8759    pub fn send_on_open_(
8760        &self,
8761        mut s: i32,
8762        mut info: Option<NodeInfoDeprecated>,
8763    ) -> Result<(), fidl::Error> {
8764        self.inner.send::<NodeOnOpenRequest>(
8765            (s, info.as_mut()),
8766            0,
8767            0x7fc7bbb1dbfd1972,
8768            fidl::encoding::DynamicFlags::FLEXIBLE,
8769        )
8770    }
8771
8772    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
8773        self.inner.send::<Representation>(
8774            &mut payload,
8775            0,
8776            0x5cb40567d80a510c,
8777            fidl::encoding::DynamicFlags::empty(),
8778        )
8779    }
8780}
8781
8782#[must_use = "FIDL methods require a response to be sent"]
8783#[derive(Debug)]
8784pub struct FileAdvisoryLockResponder {
8785    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8786    tx_id: u32,
8787}
8788
8789/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8790/// if the responder is dropped without sending a response, so that the client
8791/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8792impl std::ops::Drop for FileAdvisoryLockResponder {
8793    fn drop(&mut self) {
8794        self.control_handle.shutdown();
8795        // Safety: drops once, never accessed again
8796        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8797    }
8798}
8799
8800impl fdomain_client::fidl::Responder for FileAdvisoryLockResponder {
8801    type ControlHandle = FileControlHandle;
8802
8803    fn control_handle(&self) -> &FileControlHandle {
8804        &self.control_handle
8805    }
8806
8807    fn drop_without_shutdown(mut self) {
8808        // Safety: drops once, never accessed again due to mem::forget
8809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8810        // Prevent Drop from running (which would shut down the channel)
8811        std::mem::forget(self);
8812    }
8813}
8814
8815impl FileAdvisoryLockResponder {
8816    /// Sends a response to the FIDL transaction.
8817    ///
8818    /// Sets the channel to shutdown if an error occurs.
8819    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8820        let _result = self.send_raw(result);
8821        if _result.is_err() {
8822            self.control_handle.shutdown();
8823        }
8824        self.drop_without_shutdown();
8825        _result
8826    }
8827
8828    /// Similar to "send" but does not shutdown the channel if an error occurs.
8829    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8830        let _result = self.send_raw(result);
8831        self.drop_without_shutdown();
8832        _result
8833    }
8834
8835    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8836        self.control_handle
8837            .inner
8838            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8839                result,
8840                self.tx_id,
8841                0x6ee9c0ad53ec87aa,
8842                fidl::encoding::DynamicFlags::empty(),
8843            )
8844    }
8845}
8846
8847#[must_use = "FIDL methods require a response to be sent"]
8848#[derive(Debug)]
8849pub struct FileLinkIntoResponder {
8850    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8851    tx_id: u32,
8852}
8853
8854/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8855/// if the responder is dropped without sending a response, so that the client
8856/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8857impl std::ops::Drop for FileLinkIntoResponder {
8858    fn drop(&mut self) {
8859        self.control_handle.shutdown();
8860        // Safety: drops once, never accessed again
8861        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8862    }
8863}
8864
8865impl fdomain_client::fidl::Responder for FileLinkIntoResponder {
8866    type ControlHandle = FileControlHandle;
8867
8868    fn control_handle(&self) -> &FileControlHandle {
8869        &self.control_handle
8870    }
8871
8872    fn drop_without_shutdown(mut self) {
8873        // Safety: drops once, never accessed again due to mem::forget
8874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8875        // Prevent Drop from running (which would shut down the channel)
8876        std::mem::forget(self);
8877    }
8878}
8879
8880impl FileLinkIntoResponder {
8881    /// Sends a response to the FIDL transaction.
8882    ///
8883    /// Sets the channel to shutdown if an error occurs.
8884    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8885        let _result = self.send_raw(result);
8886        if _result.is_err() {
8887            self.control_handle.shutdown();
8888        }
8889        self.drop_without_shutdown();
8890        _result
8891    }
8892
8893    /// Similar to "send" but does not shutdown the channel if an error occurs.
8894    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8895        let _result = self.send_raw(result);
8896        self.drop_without_shutdown();
8897        _result
8898    }
8899
8900    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8901        self.control_handle
8902            .inner
8903            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8904                result,
8905                self.tx_id,
8906                0x54f3949246a03e74,
8907                fidl::encoding::DynamicFlags::empty(),
8908            )
8909    }
8910}
8911
8912#[must_use = "FIDL methods require a response to be sent"]
8913#[derive(Debug)]
8914pub struct FileCloseResponder {
8915    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8916    tx_id: u32,
8917}
8918
8919/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8920/// if the responder is dropped without sending a response, so that the client
8921/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8922impl std::ops::Drop for FileCloseResponder {
8923    fn drop(&mut self) {
8924        self.control_handle.shutdown();
8925        // Safety: drops once, never accessed again
8926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8927    }
8928}
8929
8930impl fdomain_client::fidl::Responder for FileCloseResponder {
8931    type ControlHandle = FileControlHandle;
8932
8933    fn control_handle(&self) -> &FileControlHandle {
8934        &self.control_handle
8935    }
8936
8937    fn drop_without_shutdown(mut self) {
8938        // Safety: drops once, never accessed again due to mem::forget
8939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8940        // Prevent Drop from running (which would shut down the channel)
8941        std::mem::forget(self);
8942    }
8943}
8944
8945impl FileCloseResponder {
8946    /// Sends a response to the FIDL transaction.
8947    ///
8948    /// Sets the channel to shutdown if an error occurs.
8949    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8950        let _result = self.send_raw(result);
8951        if _result.is_err() {
8952            self.control_handle.shutdown();
8953        }
8954        self.drop_without_shutdown();
8955        _result
8956    }
8957
8958    /// Similar to "send" but does not shutdown the channel if an error occurs.
8959    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8960        let _result = self.send_raw(result);
8961        self.drop_without_shutdown();
8962        _result
8963    }
8964
8965    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8966        self.control_handle
8967            .inner
8968            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8969                result,
8970                self.tx_id,
8971                0x5ac5d459ad7f657e,
8972                fidl::encoding::DynamicFlags::empty(),
8973            )
8974    }
8975}
8976
8977#[must_use = "FIDL methods require a response to be sent"]
8978#[derive(Debug)]
8979pub struct FileQueryResponder {
8980    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8981    tx_id: u32,
8982}
8983
8984/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8985/// if the responder is dropped without sending a response, so that the client
8986/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8987impl std::ops::Drop for FileQueryResponder {
8988    fn drop(&mut self) {
8989        self.control_handle.shutdown();
8990        // Safety: drops once, never accessed again
8991        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8992    }
8993}
8994
8995impl fdomain_client::fidl::Responder for FileQueryResponder {
8996    type ControlHandle = FileControlHandle;
8997
8998    fn control_handle(&self) -> &FileControlHandle {
8999        &self.control_handle
9000    }
9001
9002    fn drop_without_shutdown(mut self) {
9003        // Safety: drops once, never accessed again due to mem::forget
9004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9005        // Prevent Drop from running (which would shut down the channel)
9006        std::mem::forget(self);
9007    }
9008}
9009
9010impl FileQueryResponder {
9011    /// Sends a response to the FIDL transaction.
9012    ///
9013    /// Sets the channel to shutdown if an error occurs.
9014    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
9015        let _result = self.send_raw(protocol);
9016        if _result.is_err() {
9017            self.control_handle.shutdown();
9018        }
9019        self.drop_without_shutdown();
9020        _result
9021    }
9022
9023    /// Similar to "send" but does not shutdown the channel if an error occurs.
9024    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
9025        let _result = self.send_raw(protocol);
9026        self.drop_without_shutdown();
9027        _result
9028    }
9029
9030    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
9031        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
9032            (protocol,),
9033            self.tx_id,
9034            0x2658edee9decfc06,
9035            fidl::encoding::DynamicFlags::empty(),
9036        )
9037    }
9038}
9039
9040#[must_use = "FIDL methods require a response to be sent"]
9041#[derive(Debug)]
9042pub struct FileDeprecatedGetAttrResponder {
9043    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9044    tx_id: u32,
9045}
9046
9047/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9048/// if the responder is dropped without sending a response, so that the client
9049/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9050impl std::ops::Drop for FileDeprecatedGetAttrResponder {
9051    fn drop(&mut self) {
9052        self.control_handle.shutdown();
9053        // Safety: drops once, never accessed again
9054        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9055    }
9056}
9057
9058impl fdomain_client::fidl::Responder for FileDeprecatedGetAttrResponder {
9059    type ControlHandle = FileControlHandle;
9060
9061    fn control_handle(&self) -> &FileControlHandle {
9062        &self.control_handle
9063    }
9064
9065    fn drop_without_shutdown(mut self) {
9066        // Safety: drops once, never accessed again due to mem::forget
9067        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9068        // Prevent Drop from running (which would shut down the channel)
9069        std::mem::forget(self);
9070    }
9071}
9072
9073impl FileDeprecatedGetAttrResponder {
9074    /// Sends a response to the FIDL transaction.
9075    ///
9076    /// Sets the channel to shutdown if an error occurs.
9077    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
9078        let _result = self.send_raw(s, attributes);
9079        if _result.is_err() {
9080            self.control_handle.shutdown();
9081        }
9082        self.drop_without_shutdown();
9083        _result
9084    }
9085
9086    /// Similar to "send" but does not shutdown the channel if an error occurs.
9087    pub fn send_no_shutdown_on_err(
9088        self,
9089        mut s: i32,
9090        mut attributes: &NodeAttributes,
9091    ) -> Result<(), fidl::Error> {
9092        let _result = self.send_raw(s, attributes);
9093        self.drop_without_shutdown();
9094        _result
9095    }
9096
9097    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
9098        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
9099            (s, attributes),
9100            self.tx_id,
9101            0x78985e216314dafd,
9102            fidl::encoding::DynamicFlags::empty(),
9103        )
9104    }
9105}
9106
9107#[must_use = "FIDL methods require a response to be sent"]
9108#[derive(Debug)]
9109pub struct FileDeprecatedSetAttrResponder {
9110    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9111    tx_id: u32,
9112}
9113
9114/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9115/// if the responder is dropped without sending a response, so that the client
9116/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9117impl std::ops::Drop for FileDeprecatedSetAttrResponder {
9118    fn drop(&mut self) {
9119        self.control_handle.shutdown();
9120        // Safety: drops once, never accessed again
9121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9122    }
9123}
9124
9125impl fdomain_client::fidl::Responder for FileDeprecatedSetAttrResponder {
9126    type ControlHandle = FileControlHandle;
9127
9128    fn control_handle(&self) -> &FileControlHandle {
9129        &self.control_handle
9130    }
9131
9132    fn drop_without_shutdown(mut self) {
9133        // Safety: drops once, never accessed again due to mem::forget
9134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9135        // Prevent Drop from running (which would shut down the channel)
9136        std::mem::forget(self);
9137    }
9138}
9139
9140impl FileDeprecatedSetAttrResponder {
9141    /// Sends a response to the FIDL transaction.
9142    ///
9143    /// Sets the channel to shutdown if an error occurs.
9144    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9145        let _result = self.send_raw(s);
9146        if _result.is_err() {
9147            self.control_handle.shutdown();
9148        }
9149        self.drop_without_shutdown();
9150        _result
9151    }
9152
9153    /// Similar to "send" but does not shutdown the channel if an error occurs.
9154    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9155        let _result = self.send_raw(s);
9156        self.drop_without_shutdown();
9157        _result
9158    }
9159
9160    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9161        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
9162            (s,),
9163            self.tx_id,
9164            0x4186c0f40d938f46,
9165            fidl::encoding::DynamicFlags::empty(),
9166        )
9167    }
9168}
9169
9170#[must_use = "FIDL methods require a response to be sent"]
9171#[derive(Debug)]
9172pub struct FileDeprecatedGetFlagsResponder {
9173    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9174    tx_id: u32,
9175}
9176
9177/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9178/// if the responder is dropped without sending a response, so that the client
9179/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9180impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
9181    fn drop(&mut self) {
9182        self.control_handle.shutdown();
9183        // Safety: drops once, never accessed again
9184        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9185    }
9186}
9187
9188impl fdomain_client::fidl::Responder for FileDeprecatedGetFlagsResponder {
9189    type ControlHandle = FileControlHandle;
9190
9191    fn control_handle(&self) -> &FileControlHandle {
9192        &self.control_handle
9193    }
9194
9195    fn drop_without_shutdown(mut self) {
9196        // Safety: drops once, never accessed again due to mem::forget
9197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9198        // Prevent Drop from running (which would shut down the channel)
9199        std::mem::forget(self);
9200    }
9201}
9202
9203impl FileDeprecatedGetFlagsResponder {
9204    /// Sends a response to the FIDL transaction.
9205    ///
9206    /// Sets the channel to shutdown if an error occurs.
9207    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9208        let _result = self.send_raw(s, flags);
9209        if _result.is_err() {
9210            self.control_handle.shutdown();
9211        }
9212        self.drop_without_shutdown();
9213        _result
9214    }
9215
9216    /// Similar to "send" but does not shutdown the channel if an error occurs.
9217    pub fn send_no_shutdown_on_err(
9218        self,
9219        mut s: i32,
9220        mut flags: OpenFlags,
9221    ) -> Result<(), fidl::Error> {
9222        let _result = self.send_raw(s, flags);
9223        self.drop_without_shutdown();
9224        _result
9225    }
9226
9227    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9228        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
9229            (s, flags),
9230            self.tx_id,
9231            0x5b88fffb8eda3aa1,
9232            fidl::encoding::DynamicFlags::empty(),
9233        )
9234    }
9235}
9236
9237#[must_use = "FIDL methods require a response to be sent"]
9238#[derive(Debug)]
9239pub struct FileDeprecatedSetFlagsResponder {
9240    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9241    tx_id: u32,
9242}
9243
9244/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9245/// if the responder is dropped without sending a response, so that the client
9246/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9247impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
9248    fn drop(&mut self) {
9249        self.control_handle.shutdown();
9250        // Safety: drops once, never accessed again
9251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9252    }
9253}
9254
9255impl fdomain_client::fidl::Responder for FileDeprecatedSetFlagsResponder {
9256    type ControlHandle = FileControlHandle;
9257
9258    fn control_handle(&self) -> &FileControlHandle {
9259        &self.control_handle
9260    }
9261
9262    fn drop_without_shutdown(mut self) {
9263        // Safety: drops once, never accessed again due to mem::forget
9264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9265        // Prevent Drop from running (which would shut down the channel)
9266        std::mem::forget(self);
9267    }
9268}
9269
9270impl FileDeprecatedSetFlagsResponder {
9271    /// Sends a response to the FIDL transaction.
9272    ///
9273    /// Sets the channel to shutdown if an error occurs.
9274    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9275        let _result = self.send_raw(s);
9276        if _result.is_err() {
9277            self.control_handle.shutdown();
9278        }
9279        self.drop_without_shutdown();
9280        _result
9281    }
9282
9283    /// Similar to "send" but does not shutdown the channel if an error occurs.
9284    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9285        let _result = self.send_raw(s);
9286        self.drop_without_shutdown();
9287        _result
9288    }
9289
9290    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9291        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
9292            (s,),
9293            self.tx_id,
9294            0x5295b76c71fde733,
9295            fidl::encoding::DynamicFlags::empty(),
9296        )
9297    }
9298}
9299
9300#[must_use = "FIDL methods require a response to be sent"]
9301#[derive(Debug)]
9302pub struct FileGetFlagsResponder {
9303    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9304    tx_id: u32,
9305}
9306
9307/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9308/// if the responder is dropped without sending a response, so that the client
9309/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9310impl std::ops::Drop for FileGetFlagsResponder {
9311    fn drop(&mut self) {
9312        self.control_handle.shutdown();
9313        // Safety: drops once, never accessed again
9314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9315    }
9316}
9317
9318impl fdomain_client::fidl::Responder for FileGetFlagsResponder {
9319    type ControlHandle = FileControlHandle;
9320
9321    fn control_handle(&self) -> &FileControlHandle {
9322        &self.control_handle
9323    }
9324
9325    fn drop_without_shutdown(mut self) {
9326        // Safety: drops once, never accessed again due to mem::forget
9327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9328        // Prevent Drop from running (which would shut down the channel)
9329        std::mem::forget(self);
9330    }
9331}
9332
9333impl FileGetFlagsResponder {
9334    /// Sends a response to the FIDL transaction.
9335    ///
9336    /// Sets the channel to shutdown if an error occurs.
9337    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9338        let _result = self.send_raw(result);
9339        if _result.is_err() {
9340            self.control_handle.shutdown();
9341        }
9342        self.drop_without_shutdown();
9343        _result
9344    }
9345
9346    /// Similar to "send" but does not shutdown the channel if an error occurs.
9347    pub fn send_no_shutdown_on_err(
9348        self,
9349        mut result: Result<Flags, i32>,
9350    ) -> Result<(), fidl::Error> {
9351        let _result = self.send_raw(result);
9352        self.drop_without_shutdown();
9353        _result
9354    }
9355
9356    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9357        self.control_handle
9358            .inner
9359            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
9360                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
9361                self.tx_id,
9362                0x176eb318f64ec23,
9363                fidl::encoding::DynamicFlags::FLEXIBLE,
9364            )
9365    }
9366}
9367
9368#[must_use = "FIDL methods require a response to be sent"]
9369#[derive(Debug)]
9370pub struct FileSetFlagsResponder {
9371    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9372    tx_id: u32,
9373}
9374
9375/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9376/// if the responder is dropped without sending a response, so that the client
9377/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9378impl std::ops::Drop for FileSetFlagsResponder {
9379    fn drop(&mut self) {
9380        self.control_handle.shutdown();
9381        // Safety: drops once, never accessed again
9382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9383    }
9384}
9385
9386impl fdomain_client::fidl::Responder for FileSetFlagsResponder {
9387    type ControlHandle = FileControlHandle;
9388
9389    fn control_handle(&self) -> &FileControlHandle {
9390        &self.control_handle
9391    }
9392
9393    fn drop_without_shutdown(mut self) {
9394        // Safety: drops once, never accessed again due to mem::forget
9395        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9396        // Prevent Drop from running (which would shut down the channel)
9397        std::mem::forget(self);
9398    }
9399}
9400
9401impl FileSetFlagsResponder {
9402    /// Sends a response to the FIDL transaction.
9403    ///
9404    /// Sets the channel to shutdown if an error occurs.
9405    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9406        let _result = self.send_raw(result);
9407        if _result.is_err() {
9408            self.control_handle.shutdown();
9409        }
9410        self.drop_without_shutdown();
9411        _result
9412    }
9413
9414    /// Similar to "send" but does not shutdown the channel if an error occurs.
9415    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9416        let _result = self.send_raw(result);
9417        self.drop_without_shutdown();
9418        _result
9419    }
9420
9421    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9422        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9423            fidl::encoding::EmptyStruct,
9424            i32,
9425        >>(
9426            fidl::encoding::FlexibleResult::new(result),
9427            self.tx_id,
9428            0x55a8028685791ea8,
9429            fidl::encoding::DynamicFlags::FLEXIBLE,
9430        )
9431    }
9432}
9433
9434#[must_use = "FIDL methods require a response to be sent"]
9435#[derive(Debug)]
9436pub struct FileQueryFilesystemResponder {
9437    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9438    tx_id: u32,
9439}
9440
9441/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9442/// if the responder is dropped without sending a response, so that the client
9443/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9444impl std::ops::Drop for FileQueryFilesystemResponder {
9445    fn drop(&mut self) {
9446        self.control_handle.shutdown();
9447        // Safety: drops once, never accessed again
9448        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9449    }
9450}
9451
9452impl fdomain_client::fidl::Responder for FileQueryFilesystemResponder {
9453    type ControlHandle = FileControlHandle;
9454
9455    fn control_handle(&self) -> &FileControlHandle {
9456        &self.control_handle
9457    }
9458
9459    fn drop_without_shutdown(mut self) {
9460        // Safety: drops once, never accessed again due to mem::forget
9461        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9462        // Prevent Drop from running (which would shut down the channel)
9463        std::mem::forget(self);
9464    }
9465}
9466
9467impl FileQueryFilesystemResponder {
9468    /// Sends a response to the FIDL transaction.
9469    ///
9470    /// Sets the channel to shutdown if an error occurs.
9471    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9472        let _result = self.send_raw(s, info);
9473        if _result.is_err() {
9474            self.control_handle.shutdown();
9475        }
9476        self.drop_without_shutdown();
9477        _result
9478    }
9479
9480    /// Similar to "send" but does not shutdown the channel if an error occurs.
9481    pub fn send_no_shutdown_on_err(
9482        self,
9483        mut s: i32,
9484        mut info: Option<&FilesystemInfo>,
9485    ) -> Result<(), fidl::Error> {
9486        let _result = self.send_raw(s, info);
9487        self.drop_without_shutdown();
9488        _result
9489    }
9490
9491    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9492        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
9493            (s, info),
9494            self.tx_id,
9495            0x6f344a1c6b0a0610,
9496            fidl::encoding::DynamicFlags::empty(),
9497        )
9498    }
9499}
9500
9501#[must_use = "FIDL methods require a response to be sent"]
9502#[derive(Debug)]
9503pub struct FileGetTokenResponder {
9504    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9505    tx_id: u32,
9506}
9507
9508/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9509/// if the responder is dropped without sending a response, so that the client
9510/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9511impl std::ops::Drop for FileGetTokenResponder {
9512    fn drop(&mut self) {
9513        self.control_handle.shutdown();
9514        // Safety: drops once, never accessed again
9515        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9516    }
9517}
9518
9519impl fdomain_client::fidl::Responder for FileGetTokenResponder {
9520    type ControlHandle = FileControlHandle;
9521
9522    fn control_handle(&self) -> &FileControlHandle {
9523        &self.control_handle
9524    }
9525
9526    fn drop_without_shutdown(mut self) {
9527        // Safety: drops once, never accessed again due to mem::forget
9528        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9529        // Prevent Drop from running (which would shut down the channel)
9530        std::mem::forget(self);
9531    }
9532}
9533
9534impl FileGetTokenResponder {
9535    /// Sends a response to the FIDL transaction.
9536    ///
9537    /// Sets the channel to shutdown if an error occurs.
9538    pub fn send(self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
9539        let _result = self.send_raw(result);
9540        if _result.is_err() {
9541            self.control_handle.shutdown();
9542        }
9543        self.drop_without_shutdown();
9544        _result
9545    }
9546
9547    /// Similar to "send" but does not shutdown the channel if an error occurs.
9548    pub fn send_no_shutdown_on_err(
9549        self,
9550        mut result: Result<fdomain_client::Event, i32>,
9551    ) -> Result<(), fidl::Error> {
9552        let _result = self.send_raw(result);
9553        self.drop_without_shutdown();
9554        _result
9555    }
9556
9557    fn send_raw(&self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
9558        self.control_handle
9559            .inner
9560            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
9561                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
9562                self.tx_id,
9563                0x5054f0ade7076cec,
9564                fidl::encoding::DynamicFlags::FLEXIBLE,
9565            )
9566    }
9567}
9568
9569#[must_use = "FIDL methods require a response to be sent"]
9570#[derive(Debug)]
9571pub struct FileGetAttributesResponder {
9572    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9573    tx_id: u32,
9574}
9575
9576/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9577/// if the responder is dropped without sending a response, so that the client
9578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9579impl std::ops::Drop for FileGetAttributesResponder {
9580    fn drop(&mut self) {
9581        self.control_handle.shutdown();
9582        // Safety: drops once, never accessed again
9583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9584    }
9585}
9586
9587impl fdomain_client::fidl::Responder for FileGetAttributesResponder {
9588    type ControlHandle = FileControlHandle;
9589
9590    fn control_handle(&self) -> &FileControlHandle {
9591        &self.control_handle
9592    }
9593
9594    fn drop_without_shutdown(mut self) {
9595        // Safety: drops once, never accessed again due to mem::forget
9596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9597        // Prevent Drop from running (which would shut down the channel)
9598        std::mem::forget(self);
9599    }
9600}
9601
9602impl FileGetAttributesResponder {
9603    /// Sends a response to the FIDL transaction.
9604    ///
9605    /// Sets the channel to shutdown if an error occurs.
9606    pub fn send(
9607        self,
9608        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9609    ) -> Result<(), fidl::Error> {
9610        let _result = self.send_raw(result);
9611        if _result.is_err() {
9612            self.control_handle.shutdown();
9613        }
9614        self.drop_without_shutdown();
9615        _result
9616    }
9617
9618    /// Similar to "send" but does not shutdown the channel if an error occurs.
9619    pub fn send_no_shutdown_on_err(
9620        self,
9621        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9622    ) -> Result<(), fidl::Error> {
9623        let _result = self.send_raw(result);
9624        self.drop_without_shutdown();
9625        _result
9626    }
9627
9628    fn send_raw(
9629        &self,
9630        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9631    ) -> Result<(), fidl::Error> {
9632        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
9633            result,
9634            self.tx_id,
9635            0x3d4396a638ea053b,
9636            fidl::encoding::DynamicFlags::empty(),
9637        )
9638    }
9639}
9640
9641#[must_use = "FIDL methods require a response to be sent"]
9642#[derive(Debug)]
9643pub struct FileUpdateAttributesResponder {
9644    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9645    tx_id: u32,
9646}
9647
9648/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9649/// if the responder is dropped without sending a response, so that the client
9650/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9651impl std::ops::Drop for FileUpdateAttributesResponder {
9652    fn drop(&mut self) {
9653        self.control_handle.shutdown();
9654        // Safety: drops once, never accessed again
9655        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9656    }
9657}
9658
9659impl fdomain_client::fidl::Responder for FileUpdateAttributesResponder {
9660    type ControlHandle = FileControlHandle;
9661
9662    fn control_handle(&self) -> &FileControlHandle {
9663        &self.control_handle
9664    }
9665
9666    fn drop_without_shutdown(mut self) {
9667        // Safety: drops once, never accessed again due to mem::forget
9668        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9669        // Prevent Drop from running (which would shut down the channel)
9670        std::mem::forget(self);
9671    }
9672}
9673
9674impl FileUpdateAttributesResponder {
9675    /// Sends a response to the FIDL transaction.
9676    ///
9677    /// Sets the channel to shutdown if an error occurs.
9678    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9679        let _result = self.send_raw(result);
9680        if _result.is_err() {
9681            self.control_handle.shutdown();
9682        }
9683        self.drop_without_shutdown();
9684        _result
9685    }
9686
9687    /// Similar to "send" but does not shutdown the channel if an error occurs.
9688    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9689        let _result = self.send_raw(result);
9690        self.drop_without_shutdown();
9691        _result
9692    }
9693
9694    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9695        self.control_handle
9696            .inner
9697            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9698                result,
9699                self.tx_id,
9700                0x3308c1da5a89bf08,
9701                fidl::encoding::DynamicFlags::empty(),
9702            )
9703    }
9704}
9705
9706#[must_use = "FIDL methods require a response to be sent"]
9707#[derive(Debug)]
9708pub struct FileSyncResponder {
9709    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9710    tx_id: u32,
9711}
9712
9713/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9714/// if the responder is dropped without sending a response, so that the client
9715/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9716impl std::ops::Drop for FileSyncResponder {
9717    fn drop(&mut self) {
9718        self.control_handle.shutdown();
9719        // Safety: drops once, never accessed again
9720        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9721    }
9722}
9723
9724impl fdomain_client::fidl::Responder for FileSyncResponder {
9725    type ControlHandle = FileControlHandle;
9726
9727    fn control_handle(&self) -> &FileControlHandle {
9728        &self.control_handle
9729    }
9730
9731    fn drop_without_shutdown(mut self) {
9732        // Safety: drops once, never accessed again due to mem::forget
9733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9734        // Prevent Drop from running (which would shut down the channel)
9735        std::mem::forget(self);
9736    }
9737}
9738
9739impl FileSyncResponder {
9740    /// Sends a response to the FIDL transaction.
9741    ///
9742    /// Sets the channel to shutdown if an error occurs.
9743    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9744        let _result = self.send_raw(result);
9745        if _result.is_err() {
9746            self.control_handle.shutdown();
9747        }
9748        self.drop_without_shutdown();
9749        _result
9750    }
9751
9752    /// Similar to "send" but does not shutdown the channel if an error occurs.
9753    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9754        let _result = self.send_raw(result);
9755        self.drop_without_shutdown();
9756        _result
9757    }
9758
9759    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9760        self.control_handle
9761            .inner
9762            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9763                result,
9764                self.tx_id,
9765                0x2c5c27ca0ab5dc49,
9766                fidl::encoding::DynamicFlags::empty(),
9767            )
9768    }
9769}
9770
9771#[must_use = "FIDL methods require a response to be sent"]
9772#[derive(Debug)]
9773pub struct FileGetExtendedAttributeResponder {
9774    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9775    tx_id: u32,
9776}
9777
9778/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9779/// if the responder is dropped without sending a response, so that the client
9780/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9781impl std::ops::Drop for FileGetExtendedAttributeResponder {
9782    fn drop(&mut self) {
9783        self.control_handle.shutdown();
9784        // Safety: drops once, never accessed again
9785        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9786    }
9787}
9788
9789impl fdomain_client::fidl::Responder for FileGetExtendedAttributeResponder {
9790    type ControlHandle = FileControlHandle;
9791
9792    fn control_handle(&self) -> &FileControlHandle {
9793        &self.control_handle
9794    }
9795
9796    fn drop_without_shutdown(mut self) {
9797        // Safety: drops once, never accessed again due to mem::forget
9798        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9799        // Prevent Drop from running (which would shut down the channel)
9800        std::mem::forget(self);
9801    }
9802}
9803
9804impl FileGetExtendedAttributeResponder {
9805    /// Sends a response to the FIDL transaction.
9806    ///
9807    /// Sets the channel to shutdown if an error occurs.
9808    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9809        let _result = self.send_raw(result);
9810        if _result.is_err() {
9811            self.control_handle.shutdown();
9812        }
9813        self.drop_without_shutdown();
9814        _result
9815    }
9816
9817    /// Similar to "send" but does not shutdown the channel if an error occurs.
9818    pub fn send_no_shutdown_on_err(
9819        self,
9820        mut result: Result<ExtendedAttributeValue, i32>,
9821    ) -> Result<(), fidl::Error> {
9822        let _result = self.send_raw(result);
9823        self.drop_without_shutdown();
9824        _result
9825    }
9826
9827    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9828        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
9829            result.as_mut().map_err(|e| *e),
9830            self.tx_id,
9831            0x45ffa3ccfdeb76db,
9832            fidl::encoding::DynamicFlags::empty(),
9833        )
9834    }
9835}
9836
9837#[must_use = "FIDL methods require a response to be sent"]
9838#[derive(Debug)]
9839pub struct FileSetExtendedAttributeResponder {
9840    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9841    tx_id: u32,
9842}
9843
9844/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9845/// if the responder is dropped without sending a response, so that the client
9846/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9847impl std::ops::Drop for FileSetExtendedAttributeResponder {
9848    fn drop(&mut self) {
9849        self.control_handle.shutdown();
9850        // Safety: drops once, never accessed again
9851        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9852    }
9853}
9854
9855impl fdomain_client::fidl::Responder for FileSetExtendedAttributeResponder {
9856    type ControlHandle = FileControlHandle;
9857
9858    fn control_handle(&self) -> &FileControlHandle {
9859        &self.control_handle
9860    }
9861
9862    fn drop_without_shutdown(mut self) {
9863        // Safety: drops once, never accessed again due to mem::forget
9864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9865        // Prevent Drop from running (which would shut down the channel)
9866        std::mem::forget(self);
9867    }
9868}
9869
9870impl FileSetExtendedAttributeResponder {
9871    /// Sends a response to the FIDL transaction.
9872    ///
9873    /// Sets the channel to shutdown if an error occurs.
9874    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9875        let _result = self.send_raw(result);
9876        if _result.is_err() {
9877            self.control_handle.shutdown();
9878        }
9879        self.drop_without_shutdown();
9880        _result
9881    }
9882
9883    /// Similar to "send" but does not shutdown the channel if an error occurs.
9884    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9885        let _result = self.send_raw(result);
9886        self.drop_without_shutdown();
9887        _result
9888    }
9889
9890    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9891        self.control_handle
9892            .inner
9893            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9894                result,
9895                self.tx_id,
9896                0x4a951362f681f23c,
9897                fidl::encoding::DynamicFlags::empty(),
9898            )
9899    }
9900}
9901
9902#[must_use = "FIDL methods require a response to be sent"]
9903#[derive(Debug)]
9904pub struct FileRemoveExtendedAttributeResponder {
9905    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9906    tx_id: u32,
9907}
9908
9909/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9910/// if the responder is dropped without sending a response, so that the client
9911/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9912impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
9913    fn drop(&mut self) {
9914        self.control_handle.shutdown();
9915        // Safety: drops once, never accessed again
9916        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9917    }
9918}
9919
9920impl fdomain_client::fidl::Responder for FileRemoveExtendedAttributeResponder {
9921    type ControlHandle = FileControlHandle;
9922
9923    fn control_handle(&self) -> &FileControlHandle {
9924        &self.control_handle
9925    }
9926
9927    fn drop_without_shutdown(mut self) {
9928        // Safety: drops once, never accessed again due to mem::forget
9929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9930        // Prevent Drop from running (which would shut down the channel)
9931        std::mem::forget(self);
9932    }
9933}
9934
9935impl FileRemoveExtendedAttributeResponder {
9936    /// Sends a response to the FIDL transaction.
9937    ///
9938    /// Sets the channel to shutdown if an error occurs.
9939    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9940        let _result = self.send_raw(result);
9941        if _result.is_err() {
9942            self.control_handle.shutdown();
9943        }
9944        self.drop_without_shutdown();
9945        _result
9946    }
9947
9948    /// Similar to "send" but does not shutdown the channel if an error occurs.
9949    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9950        let _result = self.send_raw(result);
9951        self.drop_without_shutdown();
9952        _result
9953    }
9954
9955    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9956        self.control_handle
9957            .inner
9958            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9959                result,
9960                self.tx_id,
9961                0x7a0b9f3a9bf9032d,
9962                fidl::encoding::DynamicFlags::empty(),
9963            )
9964    }
9965}
9966
9967#[must_use = "FIDL methods require a response to be sent"]
9968#[derive(Debug)]
9969pub struct FileReadResponder {
9970    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9971    tx_id: u32,
9972}
9973
9974/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9975/// if the responder is dropped without sending a response, so that the client
9976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9977impl std::ops::Drop for FileReadResponder {
9978    fn drop(&mut self) {
9979        self.control_handle.shutdown();
9980        // Safety: drops once, never accessed again
9981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9982    }
9983}
9984
9985impl fdomain_client::fidl::Responder for FileReadResponder {
9986    type ControlHandle = FileControlHandle;
9987
9988    fn control_handle(&self) -> &FileControlHandle {
9989        &self.control_handle
9990    }
9991
9992    fn drop_without_shutdown(mut self) {
9993        // Safety: drops once, never accessed again due to mem::forget
9994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9995        // Prevent Drop from running (which would shut down the channel)
9996        std::mem::forget(self);
9997    }
9998}
9999
10000impl FileReadResponder {
10001    /// Sends a response to the FIDL transaction.
10002    ///
10003    /// Sets the channel to shutdown if an error occurs.
10004    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10005        let _result = self.send_raw(result);
10006        if _result.is_err() {
10007            self.control_handle.shutdown();
10008        }
10009        self.drop_without_shutdown();
10010        _result
10011    }
10012
10013    /// Similar to "send" but does not shutdown the channel if an error occurs.
10014    pub fn send_no_shutdown_on_err(
10015        self,
10016        mut result: Result<&[u8], i32>,
10017    ) -> Result<(), fidl::Error> {
10018        let _result = self.send_raw(result);
10019        self.drop_without_shutdown();
10020        _result
10021    }
10022
10023    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10024        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
10025            result.map(|data| (data,)),
10026            self.tx_id,
10027            0x57e419a298c8ede,
10028            fidl::encoding::DynamicFlags::empty(),
10029        )
10030    }
10031}
10032
10033#[must_use = "FIDL methods require a response to be sent"]
10034#[derive(Debug)]
10035pub struct FileWriteResponder {
10036    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10037    tx_id: u32,
10038}
10039
10040/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10041/// if the responder is dropped without sending a response, so that the client
10042/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10043impl std::ops::Drop for FileWriteResponder {
10044    fn drop(&mut self) {
10045        self.control_handle.shutdown();
10046        // Safety: drops once, never accessed again
10047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10048    }
10049}
10050
10051impl fdomain_client::fidl::Responder for FileWriteResponder {
10052    type ControlHandle = FileControlHandle;
10053
10054    fn control_handle(&self) -> &FileControlHandle {
10055        &self.control_handle
10056    }
10057
10058    fn drop_without_shutdown(mut self) {
10059        // Safety: drops once, never accessed again due to mem::forget
10060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10061        // Prevent Drop from running (which would shut down the channel)
10062        std::mem::forget(self);
10063    }
10064}
10065
10066impl FileWriteResponder {
10067    /// Sends a response to the FIDL transaction.
10068    ///
10069    /// Sets the channel to shutdown if an error occurs.
10070    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10071        let _result = self.send_raw(result);
10072        if _result.is_err() {
10073            self.control_handle.shutdown();
10074        }
10075        self.drop_without_shutdown();
10076        _result
10077    }
10078
10079    /// Similar to "send" but does not shutdown the channel if an error occurs.
10080    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10081        let _result = self.send_raw(result);
10082        self.drop_without_shutdown();
10083        _result
10084    }
10085
10086    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10087        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
10088            result.map(|actual_count| (actual_count,)),
10089            self.tx_id,
10090            0x6a31437832469f82,
10091            fidl::encoding::DynamicFlags::empty(),
10092        )
10093    }
10094}
10095
10096#[must_use = "FIDL methods require a response to be sent"]
10097#[derive(Debug)]
10098pub struct FileDescribeResponder {
10099    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10100    tx_id: u32,
10101}
10102
10103/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10104/// if the responder is dropped without sending a response, so that the client
10105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10106impl std::ops::Drop for FileDescribeResponder {
10107    fn drop(&mut self) {
10108        self.control_handle.shutdown();
10109        // Safety: drops once, never accessed again
10110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10111    }
10112}
10113
10114impl fdomain_client::fidl::Responder for FileDescribeResponder {
10115    type ControlHandle = FileControlHandle;
10116
10117    fn control_handle(&self) -> &FileControlHandle {
10118        &self.control_handle
10119    }
10120
10121    fn drop_without_shutdown(mut self) {
10122        // Safety: drops once, never accessed again due to mem::forget
10123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10124        // Prevent Drop from running (which would shut down the channel)
10125        std::mem::forget(self);
10126    }
10127}
10128
10129impl FileDescribeResponder {
10130    /// Sends a response to the FIDL transaction.
10131    ///
10132    /// Sets the channel to shutdown if an error occurs.
10133    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
10134        let _result = self.send_raw(payload);
10135        if _result.is_err() {
10136            self.control_handle.shutdown();
10137        }
10138        self.drop_without_shutdown();
10139        _result
10140    }
10141
10142    /// Similar to "send" but does not shutdown the channel if an error occurs.
10143    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
10144        let _result = self.send_raw(payload);
10145        self.drop_without_shutdown();
10146        _result
10147    }
10148
10149    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
10150        self.control_handle.inner.send::<FileInfo>(
10151            &mut payload,
10152            self.tx_id,
10153            0x68b5ac00c62906bc,
10154            fidl::encoding::DynamicFlags::empty(),
10155        )
10156    }
10157}
10158
10159#[must_use = "FIDL methods require a response to be sent"]
10160#[derive(Debug)]
10161pub struct FileSeekResponder {
10162    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10163    tx_id: u32,
10164}
10165
10166/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10167/// if the responder is dropped without sending a response, so that the client
10168/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10169impl std::ops::Drop for FileSeekResponder {
10170    fn drop(&mut self) {
10171        self.control_handle.shutdown();
10172        // Safety: drops once, never accessed again
10173        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10174    }
10175}
10176
10177impl fdomain_client::fidl::Responder for FileSeekResponder {
10178    type ControlHandle = FileControlHandle;
10179
10180    fn control_handle(&self) -> &FileControlHandle {
10181        &self.control_handle
10182    }
10183
10184    fn drop_without_shutdown(mut self) {
10185        // Safety: drops once, never accessed again due to mem::forget
10186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10187        // Prevent Drop from running (which would shut down the channel)
10188        std::mem::forget(self);
10189    }
10190}
10191
10192impl FileSeekResponder {
10193    /// Sends a response to the FIDL transaction.
10194    ///
10195    /// Sets the channel to shutdown if an error occurs.
10196    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10197        let _result = self.send_raw(result);
10198        if _result.is_err() {
10199            self.control_handle.shutdown();
10200        }
10201        self.drop_without_shutdown();
10202        _result
10203    }
10204
10205    /// Similar to "send" but does not shutdown the channel if an error occurs.
10206    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10207        let _result = self.send_raw(result);
10208        self.drop_without_shutdown();
10209        _result
10210    }
10211
10212    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10213        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
10214            result.map(|offset_from_start| (offset_from_start,)),
10215            self.tx_id,
10216            0x78079168162c5207,
10217            fidl::encoding::DynamicFlags::empty(),
10218        )
10219    }
10220}
10221
10222#[must_use = "FIDL methods require a response to be sent"]
10223#[derive(Debug)]
10224pub struct FileReadAtResponder {
10225    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10226    tx_id: u32,
10227}
10228
10229/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10230/// if the responder is dropped without sending a response, so that the client
10231/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10232impl std::ops::Drop for FileReadAtResponder {
10233    fn drop(&mut self) {
10234        self.control_handle.shutdown();
10235        // Safety: drops once, never accessed again
10236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10237    }
10238}
10239
10240impl fdomain_client::fidl::Responder for FileReadAtResponder {
10241    type ControlHandle = FileControlHandle;
10242
10243    fn control_handle(&self) -> &FileControlHandle {
10244        &self.control_handle
10245    }
10246
10247    fn drop_without_shutdown(mut self) {
10248        // Safety: drops once, never accessed again due to mem::forget
10249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10250        // Prevent Drop from running (which would shut down the channel)
10251        std::mem::forget(self);
10252    }
10253}
10254
10255impl FileReadAtResponder {
10256    /// Sends a response to the FIDL transaction.
10257    ///
10258    /// Sets the channel to shutdown if an error occurs.
10259    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10260        let _result = self.send_raw(result);
10261        if _result.is_err() {
10262            self.control_handle.shutdown();
10263        }
10264        self.drop_without_shutdown();
10265        _result
10266    }
10267
10268    /// Similar to "send" but does not shutdown the channel if an error occurs.
10269    pub fn send_no_shutdown_on_err(
10270        self,
10271        mut result: Result<&[u8], i32>,
10272    ) -> Result<(), fidl::Error> {
10273        let _result = self.send_raw(result);
10274        self.drop_without_shutdown();
10275        _result
10276    }
10277
10278    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10279        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
10280            result.map(|data| (data,)),
10281            self.tx_id,
10282            0x1607a293a60d723e,
10283            fidl::encoding::DynamicFlags::empty(),
10284        )
10285    }
10286}
10287
10288#[must_use = "FIDL methods require a response to be sent"]
10289#[derive(Debug)]
10290pub struct FileWriteAtResponder {
10291    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10292    tx_id: u32,
10293}
10294
10295/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10296/// if the responder is dropped without sending a response, so that the client
10297/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10298impl std::ops::Drop for FileWriteAtResponder {
10299    fn drop(&mut self) {
10300        self.control_handle.shutdown();
10301        // Safety: drops once, never accessed again
10302        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10303    }
10304}
10305
10306impl fdomain_client::fidl::Responder for FileWriteAtResponder {
10307    type ControlHandle = FileControlHandle;
10308
10309    fn control_handle(&self) -> &FileControlHandle {
10310        &self.control_handle
10311    }
10312
10313    fn drop_without_shutdown(mut self) {
10314        // Safety: drops once, never accessed again due to mem::forget
10315        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10316        // Prevent Drop from running (which would shut down the channel)
10317        std::mem::forget(self);
10318    }
10319}
10320
10321impl FileWriteAtResponder {
10322    /// Sends a response to the FIDL transaction.
10323    ///
10324    /// Sets the channel to shutdown if an error occurs.
10325    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10326        let _result = self.send_raw(result);
10327        if _result.is_err() {
10328            self.control_handle.shutdown();
10329        }
10330        self.drop_without_shutdown();
10331        _result
10332    }
10333
10334    /// Similar to "send" but does not shutdown the channel if an error occurs.
10335    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10336        let _result = self.send_raw(result);
10337        self.drop_without_shutdown();
10338        _result
10339    }
10340
10341    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10342        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
10343            result.map(|actual_count| (actual_count,)),
10344            self.tx_id,
10345            0x793eefc0045e792b,
10346            fidl::encoding::DynamicFlags::empty(),
10347        )
10348    }
10349}
10350
10351#[must_use = "FIDL methods require a response to be sent"]
10352#[derive(Debug)]
10353pub struct FileResizeResponder {
10354    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10355    tx_id: u32,
10356}
10357
10358/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10359/// if the responder is dropped without sending a response, so that the client
10360/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10361impl std::ops::Drop for FileResizeResponder {
10362    fn drop(&mut self) {
10363        self.control_handle.shutdown();
10364        // Safety: drops once, never accessed again
10365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10366    }
10367}
10368
10369impl fdomain_client::fidl::Responder for FileResizeResponder {
10370    type ControlHandle = FileControlHandle;
10371
10372    fn control_handle(&self) -> &FileControlHandle {
10373        &self.control_handle
10374    }
10375
10376    fn drop_without_shutdown(mut self) {
10377        // Safety: drops once, never accessed again due to mem::forget
10378        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10379        // Prevent Drop from running (which would shut down the channel)
10380        std::mem::forget(self);
10381    }
10382}
10383
10384impl FileResizeResponder {
10385    /// Sends a response to the FIDL transaction.
10386    ///
10387    /// Sets the channel to shutdown if an error occurs.
10388    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10389        let _result = self.send_raw(result);
10390        if _result.is_err() {
10391            self.control_handle.shutdown();
10392        }
10393        self.drop_without_shutdown();
10394        _result
10395    }
10396
10397    /// Similar to "send" but does not shutdown the channel if an error occurs.
10398    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10399        let _result = self.send_raw(result);
10400        self.drop_without_shutdown();
10401        _result
10402    }
10403
10404    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10405        self.control_handle
10406            .inner
10407            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10408                result,
10409                self.tx_id,
10410                0x2b80825f0535743a,
10411                fidl::encoding::DynamicFlags::empty(),
10412            )
10413    }
10414}
10415
10416#[must_use = "FIDL methods require a response to be sent"]
10417#[derive(Debug)]
10418pub struct FileGetBackingMemoryResponder {
10419    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10420    tx_id: u32,
10421}
10422
10423/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10424/// if the responder is dropped without sending a response, so that the client
10425/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10426impl std::ops::Drop for FileGetBackingMemoryResponder {
10427    fn drop(&mut self) {
10428        self.control_handle.shutdown();
10429        // Safety: drops once, never accessed again
10430        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10431    }
10432}
10433
10434impl fdomain_client::fidl::Responder for FileGetBackingMemoryResponder {
10435    type ControlHandle = FileControlHandle;
10436
10437    fn control_handle(&self) -> &FileControlHandle {
10438        &self.control_handle
10439    }
10440
10441    fn drop_without_shutdown(mut self) {
10442        // Safety: drops once, never accessed again due to mem::forget
10443        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10444        // Prevent Drop from running (which would shut down the channel)
10445        std::mem::forget(self);
10446    }
10447}
10448
10449impl FileGetBackingMemoryResponder {
10450    /// Sends a response to the FIDL transaction.
10451    ///
10452    /// Sets the channel to shutdown if an error occurs.
10453    pub fn send(self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10454        let _result = self.send_raw(result);
10455        if _result.is_err() {
10456            self.control_handle.shutdown();
10457        }
10458        self.drop_without_shutdown();
10459        _result
10460    }
10461
10462    /// Similar to "send" but does not shutdown the channel if an error occurs.
10463    pub fn send_no_shutdown_on_err(
10464        self,
10465        mut result: Result<fdomain_client::Vmo, i32>,
10466    ) -> Result<(), fidl::Error> {
10467        let _result = self.send_raw(result);
10468        self.drop_without_shutdown();
10469        _result
10470    }
10471
10472    fn send_raw(&self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10473        self.control_handle
10474            .inner
10475            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
10476                result.map(|vmo| (vmo,)),
10477                self.tx_id,
10478                0xa6a9e654cbf62b,
10479                fidl::encoding::DynamicFlags::empty(),
10480            )
10481    }
10482}
10483
10484#[must_use = "FIDL methods require a response to be sent"]
10485#[derive(Debug)]
10486pub struct FileAllocateResponder {
10487    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10488    tx_id: u32,
10489}
10490
10491/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10492/// if the responder is dropped without sending a response, so that the client
10493/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10494impl std::ops::Drop for FileAllocateResponder {
10495    fn drop(&mut self) {
10496        self.control_handle.shutdown();
10497        // Safety: drops once, never accessed again
10498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10499    }
10500}
10501
10502impl fdomain_client::fidl::Responder for FileAllocateResponder {
10503    type ControlHandle = FileControlHandle;
10504
10505    fn control_handle(&self) -> &FileControlHandle {
10506        &self.control_handle
10507    }
10508
10509    fn drop_without_shutdown(mut self) {
10510        // Safety: drops once, never accessed again due to mem::forget
10511        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10512        // Prevent Drop from running (which would shut down the channel)
10513        std::mem::forget(self);
10514    }
10515}
10516
10517impl FileAllocateResponder {
10518    /// Sends a response to the FIDL transaction.
10519    ///
10520    /// Sets the channel to shutdown if an error occurs.
10521    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10522        let _result = self.send_raw(result);
10523        if _result.is_err() {
10524            self.control_handle.shutdown();
10525        }
10526        self.drop_without_shutdown();
10527        _result
10528    }
10529
10530    /// Similar to "send" but does not shutdown the channel if an error occurs.
10531    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10532        let _result = self.send_raw(result);
10533        self.drop_without_shutdown();
10534        _result
10535    }
10536
10537    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10538        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10539            fidl::encoding::EmptyStruct,
10540            i32,
10541        >>(
10542            fidl::encoding::FlexibleResult::new(result),
10543            self.tx_id,
10544            0x77fa0c330b57fd2e,
10545            fidl::encoding::DynamicFlags::FLEXIBLE,
10546        )
10547    }
10548}
10549
10550#[must_use = "FIDL methods require a response to be sent"]
10551#[derive(Debug)]
10552pub struct FileEnableVerityResponder {
10553    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10554    tx_id: u32,
10555}
10556
10557/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10558/// if the responder is dropped without sending a response, so that the client
10559/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10560impl std::ops::Drop for FileEnableVerityResponder {
10561    fn drop(&mut self) {
10562        self.control_handle.shutdown();
10563        // Safety: drops once, never accessed again
10564        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10565    }
10566}
10567
10568impl fdomain_client::fidl::Responder for FileEnableVerityResponder {
10569    type ControlHandle = FileControlHandle;
10570
10571    fn control_handle(&self) -> &FileControlHandle {
10572        &self.control_handle
10573    }
10574
10575    fn drop_without_shutdown(mut self) {
10576        // Safety: drops once, never accessed again due to mem::forget
10577        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10578        // Prevent Drop from running (which would shut down the channel)
10579        std::mem::forget(self);
10580    }
10581}
10582
10583impl FileEnableVerityResponder {
10584    /// Sends a response to the FIDL transaction.
10585    ///
10586    /// Sets the channel to shutdown if an error occurs.
10587    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10588        let _result = self.send_raw(result);
10589        if _result.is_err() {
10590            self.control_handle.shutdown();
10591        }
10592        self.drop_without_shutdown();
10593        _result
10594    }
10595
10596    /// Similar to "send" but does not shutdown the channel if an error occurs.
10597    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10598        let _result = self.send_raw(result);
10599        self.drop_without_shutdown();
10600        _result
10601    }
10602
10603    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10604        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10605            fidl::encoding::EmptyStruct,
10606            i32,
10607        >>(
10608            fidl::encoding::FlexibleResult::new(result),
10609            self.tx_id,
10610            0x2c421ec3faaeb8bb,
10611            fidl::encoding::DynamicFlags::FLEXIBLE,
10612        )
10613    }
10614}
10615
10616#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10617pub struct LinkableMarker;
10618
10619impl fdomain_client::fidl::ProtocolMarker for LinkableMarker {
10620    type Proxy = LinkableProxy;
10621    type RequestStream = LinkableRequestStream;
10622
10623    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
10624}
10625pub type LinkableLinkIntoResult = Result<(), i32>;
10626
10627pub trait LinkableProxyInterface: Send + Sync {
10628    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
10629        + Send;
10630    fn r#link_into(
10631        &self,
10632        dst_parent_token: fdomain_client::Event,
10633        dst: &str,
10634    ) -> Self::LinkIntoResponseFut;
10635}
10636
10637#[derive(Debug, Clone)]
10638pub struct LinkableProxy {
10639    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10640}
10641
10642impl fdomain_client::fidl::Proxy for LinkableProxy {
10643    type Protocol = LinkableMarker;
10644
10645    fn from_channel(inner: fdomain_client::Channel) -> Self {
10646        Self::new(inner)
10647    }
10648
10649    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10650        self.client.into_channel().map_err(|client| Self { client })
10651    }
10652
10653    fn as_channel(&self) -> &fdomain_client::Channel {
10654        self.client.as_channel()
10655    }
10656}
10657
10658impl LinkableProxy {
10659    /// Create a new Proxy for fuchsia.io/Linkable.
10660    pub fn new(channel: fdomain_client::Channel) -> Self {
10661        let protocol_name = <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10662        Self { client: fidl::client::Client::new(channel, protocol_name) }
10663    }
10664
10665    /// Get a Stream of events from the remote end of the protocol.
10666    ///
10667    /// # Panics
10668    ///
10669    /// Panics if the event stream was already taken.
10670    pub fn take_event_stream(&self) -> LinkableEventStream {
10671        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
10672    }
10673
10674    /// Creates a link to this this object with name `dst` in the directory represented by
10675    /// `dst_parent_token`.
10676    ///
10677    /// `dst` must be a resolved object name. Including "/" in the string will return
10678    /// `ZX_ERR_INVALID_ARGS`.
10679    ///
10680    /// This method requires the maximal set of rights supported by the filesystem for this object.
10681    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10682    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10683    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10684    /// `ZX_ERR_ACCESS_DENIED`.
10685    ///
10686    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10687    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10688    ///
10689    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10690    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10691    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10692    ///
10693    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10694    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10695    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10696    pub fn r#link_into(
10697        &self,
10698        mut dst_parent_token: fdomain_client::Event,
10699        mut dst: &str,
10700    ) -> fidl::client::QueryResponseFut<
10701        LinkableLinkIntoResult,
10702        fdomain_client::fidl::FDomainResourceDialect,
10703    > {
10704        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
10705    }
10706}
10707
10708impl LinkableProxyInterface for LinkableProxy {
10709    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
10710        LinkableLinkIntoResult,
10711        fdomain_client::fidl::FDomainResourceDialect,
10712    >;
10713    fn r#link_into(
10714        &self,
10715        mut dst_parent_token: fdomain_client::Event,
10716        mut dst: &str,
10717    ) -> Self::LinkIntoResponseFut {
10718        fn _decode(
10719            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10720        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
10721            let _response = fidl::client::decode_transaction_body::<
10722                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10723                fdomain_client::fidl::FDomainResourceDialect,
10724                0x54f3949246a03e74,
10725            >(_buf?)?;
10726            Ok(_response.map(|x| x))
10727        }
10728        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
10729            (dst_parent_token, dst),
10730            0x54f3949246a03e74,
10731            fidl::encoding::DynamicFlags::empty(),
10732            _decode,
10733        )
10734    }
10735}
10736
10737pub struct LinkableEventStream {
10738    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
10739}
10740
10741impl std::marker::Unpin for LinkableEventStream {}
10742
10743impl futures::stream::FusedStream for LinkableEventStream {
10744    fn is_terminated(&self) -> bool {
10745        self.event_receiver.is_terminated()
10746    }
10747}
10748
10749impl futures::Stream for LinkableEventStream {
10750    type Item = Result<LinkableEvent, fidl::Error>;
10751
10752    fn poll_next(
10753        mut self: std::pin::Pin<&mut Self>,
10754        cx: &mut std::task::Context<'_>,
10755    ) -> std::task::Poll<Option<Self::Item>> {
10756        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10757            &mut self.event_receiver,
10758            cx
10759        )?) {
10760            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
10761            None => std::task::Poll::Ready(None),
10762        }
10763    }
10764}
10765
10766#[derive(Debug)]
10767pub enum LinkableEvent {}
10768
10769impl LinkableEvent {
10770    /// Decodes a message buffer as a [`LinkableEvent`].
10771    fn decode(
10772        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10773    ) -> Result<LinkableEvent, fidl::Error> {
10774        let (bytes, _handles) = buf.split_mut();
10775        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10776        debug_assert_eq!(tx_header.tx_id, 0);
10777        match tx_header.ordinal {
10778            _ => Err(fidl::Error::UnknownOrdinal {
10779                ordinal: tx_header.ordinal,
10780                protocol_name: <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10781            }),
10782        }
10783    }
10784}
10785
10786/// A Stream of incoming requests for fuchsia.io/Linkable.
10787pub struct LinkableRequestStream {
10788    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10789    is_terminated: bool,
10790}
10791
10792impl std::marker::Unpin for LinkableRequestStream {}
10793
10794impl futures::stream::FusedStream for LinkableRequestStream {
10795    fn is_terminated(&self) -> bool {
10796        self.is_terminated
10797    }
10798}
10799
10800impl fdomain_client::fidl::RequestStream for LinkableRequestStream {
10801    type Protocol = LinkableMarker;
10802    type ControlHandle = LinkableControlHandle;
10803
10804    fn from_channel(channel: fdomain_client::Channel) -> Self {
10805        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10806    }
10807
10808    fn control_handle(&self) -> Self::ControlHandle {
10809        LinkableControlHandle { inner: self.inner.clone() }
10810    }
10811
10812    fn into_inner(
10813        self,
10814    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
10815    {
10816        (self.inner, self.is_terminated)
10817    }
10818
10819    fn from_inner(
10820        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10821        is_terminated: bool,
10822    ) -> Self {
10823        Self { inner, is_terminated }
10824    }
10825}
10826
10827impl futures::Stream for LinkableRequestStream {
10828    type Item = Result<LinkableRequest, fidl::Error>;
10829
10830    fn poll_next(
10831        mut self: std::pin::Pin<&mut Self>,
10832        cx: &mut std::task::Context<'_>,
10833    ) -> std::task::Poll<Option<Self::Item>> {
10834        let this = &mut *self;
10835        if this.inner.check_shutdown(cx) {
10836            this.is_terminated = true;
10837            return std::task::Poll::Ready(None);
10838        }
10839        if this.is_terminated {
10840            panic!("polled LinkableRequestStream after completion");
10841        }
10842        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
10843            |bytes, handles| {
10844                match this.inner.channel().read_etc(cx, bytes, handles) {
10845                    std::task::Poll::Ready(Ok(())) => {}
10846                    std::task::Poll::Pending => return std::task::Poll::Pending,
10847                    std::task::Poll::Ready(Err(None)) => {
10848                        this.is_terminated = true;
10849                        return std::task::Poll::Ready(None);
10850                    }
10851                    std::task::Poll::Ready(Err(Some(e))) => {
10852                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10853                            e.into(),
10854                        ))));
10855                    }
10856                }
10857
10858                // A message has been received from the channel
10859                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10860
10861                std::task::Poll::Ready(Some(match header.ordinal {
10862                    0x54f3949246a03e74 => {
10863                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10864                        let mut req = fidl::new_empty!(
10865                            LinkableLinkIntoRequest,
10866                            fdomain_client::fidl::FDomainResourceDialect
10867                        );
10868                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
10869                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
10870                        Ok(LinkableRequest::LinkInto {
10871                            dst_parent_token: req.dst_parent_token,
10872                            dst: req.dst,
10873
10874                            responder: LinkableLinkIntoResponder {
10875                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10876                                tx_id: header.tx_id,
10877                            },
10878                        })
10879                    }
10880                    _ => Err(fidl::Error::UnknownOrdinal {
10881                        ordinal: header.ordinal,
10882                        protocol_name:
10883                            <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10884                    }),
10885                }))
10886            },
10887        )
10888    }
10889}
10890
10891#[derive(Debug)]
10892pub enum LinkableRequest {
10893    /// Creates a link to this this object with name `dst` in the directory represented by
10894    /// `dst_parent_token`.
10895    ///
10896    /// `dst` must be a resolved object name. Including "/" in the string will return
10897    /// `ZX_ERR_INVALID_ARGS`.
10898    ///
10899    /// This method requires the maximal set of rights supported by the filesystem for this object.
10900    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10901    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10902    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10903    /// `ZX_ERR_ACCESS_DENIED`.
10904    ///
10905    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10906    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10907    ///
10908    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10909    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10910    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10911    ///
10912    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10913    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10914    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10915    LinkInto {
10916        dst_parent_token: fdomain_client::Event,
10917        dst: String,
10918        responder: LinkableLinkIntoResponder,
10919    },
10920}
10921
10922impl LinkableRequest {
10923    #[allow(irrefutable_let_patterns)]
10924    pub fn into_link_into(
10925        self,
10926    ) -> Option<(fdomain_client::Event, String, LinkableLinkIntoResponder)> {
10927        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
10928            Some((dst_parent_token, dst, responder))
10929        } else {
10930            None
10931        }
10932    }
10933
10934    /// Name of the method defined in FIDL
10935    pub fn method_name(&self) -> &'static str {
10936        match *self {
10937            LinkableRequest::LinkInto { .. } => "link_into",
10938        }
10939    }
10940}
10941
10942#[derive(Debug, Clone)]
10943pub struct LinkableControlHandle {
10944    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10945}
10946
10947impl LinkableControlHandle {
10948    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10949        self.inner.shutdown_with_epitaph(status.into())
10950    }
10951}
10952
10953impl fdomain_client::fidl::ControlHandle for LinkableControlHandle {
10954    fn shutdown(&self) {
10955        self.inner.shutdown()
10956    }
10957
10958    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10959        self.inner.shutdown_with_epitaph(status)
10960    }
10961
10962    fn is_closed(&self) -> bool {
10963        self.inner.channel().is_closed()
10964    }
10965    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
10966        self.inner.channel().on_closed()
10967    }
10968}
10969
10970impl LinkableControlHandle {}
10971
10972#[must_use = "FIDL methods require a response to be sent"]
10973#[derive(Debug)]
10974pub struct LinkableLinkIntoResponder {
10975    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
10976    tx_id: u32,
10977}
10978
10979/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
10980/// if the responder is dropped without sending a response, so that the client
10981/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10982impl std::ops::Drop for LinkableLinkIntoResponder {
10983    fn drop(&mut self) {
10984        self.control_handle.shutdown();
10985        // Safety: drops once, never accessed again
10986        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10987    }
10988}
10989
10990impl fdomain_client::fidl::Responder for LinkableLinkIntoResponder {
10991    type ControlHandle = LinkableControlHandle;
10992
10993    fn control_handle(&self) -> &LinkableControlHandle {
10994        &self.control_handle
10995    }
10996
10997    fn drop_without_shutdown(mut self) {
10998        // Safety: drops once, never accessed again due to mem::forget
10999        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11000        // Prevent Drop from running (which would shut down the channel)
11001        std::mem::forget(self);
11002    }
11003}
11004
11005impl LinkableLinkIntoResponder {
11006    /// Sends a response to the FIDL transaction.
11007    ///
11008    /// Sets the channel to shutdown if an error occurs.
11009    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11010        let _result = self.send_raw(result);
11011        if _result.is_err() {
11012            self.control_handle.shutdown();
11013        }
11014        self.drop_without_shutdown();
11015        _result
11016    }
11017
11018    /// Similar to "send" but does not shutdown the channel if an error occurs.
11019    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11020        let _result = self.send_raw(result);
11021        self.drop_without_shutdown();
11022        _result
11023    }
11024
11025    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11026        self.control_handle
11027            .inner
11028            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11029                result,
11030                self.tx_id,
11031                0x54f3949246a03e74,
11032                fidl::encoding::DynamicFlags::empty(),
11033            )
11034    }
11035}
11036
11037#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11038pub struct NodeMarker;
11039
11040impl fdomain_client::fidl::ProtocolMarker for NodeMarker {
11041    type Proxy = NodeProxy;
11042    type RequestStream = NodeRequestStream;
11043
11044    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
11045}
11046impl fdomain_client::fidl::DiscoverableProtocolMarker for NodeMarker {}
11047pub type NodeGetFlagsResult = Result<Flags, i32>;
11048pub type NodeSetFlagsResult = Result<(), i32>;
11049pub type NodeGetTokenResult = Result<fdomain_client::Event, i32>;
11050pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
11051pub type NodeUpdateAttributesResult = Result<(), i32>;
11052pub type NodeSyncResult = Result<(), i32>;
11053pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
11054pub type NodeSetExtendedAttributeResult = Result<(), i32>;
11055pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
11056
11057pub trait NodeProxyInterface: Send + Sync {
11058    fn r#clone(
11059        &self,
11060        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11061    ) -> Result<(), fidl::Error>;
11062    type CloseResponseFut: std::future::Future<
11063            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
11064        > + Send;
11065    fn r#close(&self) -> Self::CloseResponseFut;
11066    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
11067    fn r#query(&self) -> Self::QueryResponseFut;
11068    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
11069        + Send;
11070    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
11071    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
11072    fn r#deprecated_set_attr(
11073        &self,
11074        flags: NodeAttributeFlags,
11075        attributes: &NodeAttributes,
11076    ) -> Self::DeprecatedSetAttrResponseFut;
11077    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
11078        + Send;
11079    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
11080    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
11081        + Send;
11082    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
11083    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
11084        + Send;
11085    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
11086    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
11087        + Send;
11088    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
11089    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
11090        + Send;
11091    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
11092    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
11093        + Send;
11094    fn r#get_token(&self) -> Self::GetTokenResponseFut;
11095    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
11096        + Send;
11097    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
11098    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
11099        + Send;
11100    fn r#update_attributes(
11101        &self,
11102        payload: &MutableNodeAttributes,
11103    ) -> Self::UpdateAttributesResponseFut;
11104    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
11105    fn r#sync(&self) -> Self::SyncResponseFut;
11106    fn r#list_extended_attributes(
11107        &self,
11108        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11109    ) -> Result<(), fidl::Error>;
11110    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
11111        + Send;
11112    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
11113    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
11114        + Send;
11115    fn r#set_extended_attribute(
11116        &self,
11117        name: &[u8],
11118        value: ExtendedAttributeValue,
11119        mode: SetExtendedAttributeMode,
11120    ) -> Self::SetExtendedAttributeResponseFut;
11121    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
11122        + Send;
11123    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
11124}
11125
11126#[derive(Debug, Clone)]
11127pub struct NodeProxy {
11128    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
11129}
11130
11131impl fdomain_client::fidl::Proxy for NodeProxy {
11132    type Protocol = NodeMarker;
11133
11134    fn from_channel(inner: fdomain_client::Channel) -> Self {
11135        Self::new(inner)
11136    }
11137
11138    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
11139        self.client.into_channel().map_err(|client| Self { client })
11140    }
11141
11142    fn as_channel(&self) -> &fdomain_client::Channel {
11143        self.client.as_channel()
11144    }
11145}
11146
11147impl NodeProxy {
11148    /// Create a new Proxy for fuchsia.io/Node.
11149    pub fn new(channel: fdomain_client::Channel) -> Self {
11150        let protocol_name = <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
11151        Self { client: fidl::client::Client::new(channel, protocol_name) }
11152    }
11153
11154    /// Get a Stream of events from the remote end of the protocol.
11155    ///
11156    /// # Panics
11157    ///
11158    /// Panics if the event stream was already taken.
11159    pub fn take_event_stream(&self) -> NodeEventStream {
11160        NodeEventStream { event_receiver: self.client.take_event_receiver() }
11161    }
11162
11163    pub fn r#clone(
11164        &self,
11165        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11166    ) -> Result<(), fidl::Error> {
11167        NodeProxyInterface::r#clone(self, request)
11168    }
11169
11170    /// Terminates the connection.
11171    ///
11172    /// After calling `Close`, the client must not send any other requests.
11173    ///
11174    /// Servers, after sending the status response, should close the connection
11175    /// regardless of status and without sending an epitaph.
11176    ///
11177    /// Closing the client end of the channel should be semantically equivalent
11178    /// to calling `Close` without knowing when the close has completed or its
11179    /// status.
11180    pub fn r#close(
11181        &self,
11182    ) -> fidl::client::QueryResponseFut<
11183        fdomain_fuchsia_unknown::CloseableCloseResult,
11184        fdomain_client::fidl::FDomainResourceDialect,
11185    > {
11186        NodeProxyInterface::r#close(self)
11187    }
11188
11189    pub fn r#query(
11190        &self,
11191    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
11192        NodeProxyInterface::r#query(self)
11193    }
11194
11195    /// DEPRECATED - Use `Node.GetAttributes` instead.
11196    ///
11197    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11198    pub fn r#deprecated_get_attr(
11199        &self,
11200    ) -> fidl::client::QueryResponseFut<
11201        (i32, NodeAttributes),
11202        fdomain_client::fidl::FDomainResourceDialect,
11203    > {
11204        NodeProxyInterface::r#deprecated_get_attr(self)
11205    }
11206
11207    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
11208    pub fn r#deprecated_set_attr(
11209        &self,
11210        mut flags: NodeAttributeFlags,
11211        mut attributes: &NodeAttributes,
11212    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11213        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
11214    }
11215
11216    /// [DEPRECATED - Use new GetFlags method instead.]
11217    pub fn r#deprecated_get_flags(
11218        &self,
11219    ) -> fidl::client::QueryResponseFut<
11220        (i32, OpenFlags),
11221        fdomain_client::fidl::FDomainResourceDialect,
11222    > {
11223        NodeProxyInterface::r#deprecated_get_flags(self)
11224    }
11225
11226    /// [DEPRECATED - Use new SetFlags method instead.]
11227    pub fn r#deprecated_set_flags(
11228        &self,
11229        mut flags: OpenFlags,
11230    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11231        NodeProxyInterface::r#deprecated_set_flags(self, flags)
11232    }
11233
11234    /// Queries the flags that apply to this node after it has been opened/created. This method does
11235    /// not require any rights.
11236    ///
11237    /// Note that the final set of flags that apply to the connection may differ from those
11238    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
11239    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
11240    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
11241    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
11242    pub fn r#get_flags(
11243        &self,
11244    ) -> fidl::client::QueryResponseFut<
11245        NodeGetFlagsResult,
11246        fdomain_client::fidl::FDomainResourceDialect,
11247    > {
11248        NodeProxyInterface::r#get_flags(self)
11249    }
11250
11251    /// Sets the flags that apply to this node after it has been opened. This method does not
11252    /// require any rights.
11253    ///
11254    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
11255    /// clear append mode.
11256    ///
11257    /// Errors:
11258    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
11259    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
11260    pub fn r#set_flags(
11261        &self,
11262        mut flags: Flags,
11263    ) -> fidl::client::QueryResponseFut<
11264        NodeSetFlagsResult,
11265        fdomain_client::fidl::FDomainResourceDialect,
11266    > {
11267        NodeProxyInterface::r#set_flags(self, flags)
11268    }
11269
11270    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
11271    /// volume has different settings or the storage is accounted seperately from the rest of the
11272    /// filesystem that may be reported instead of filesystem-wide details.
11273    pub fn r#query_filesystem(
11274        &self,
11275    ) -> fidl::client::QueryResponseFut<
11276        (i32, Option<Box<FilesystemInfo>>),
11277        fdomain_client::fidl::FDomainResourceDialect,
11278    > {
11279        NodeProxyInterface::r#query_filesystem(self)
11280    }
11281
11282    /// Acquires a token which can be used to identify this connection at a later point in
11283    /// time. The token will remain valid for as long as the connection requesting the token
11284    /// remains open.
11285    ///
11286    /// This method does not require any rights. Note that the token identifies
11287    /// the connection, hence carries the rights information on this connection.
11288    pub fn r#get_token(
11289        &self,
11290    ) -> fidl::client::QueryResponseFut<
11291        NodeGetTokenResult,
11292        fdomain_client::fidl::FDomainResourceDialect,
11293    > {
11294        NodeProxyInterface::r#get_token(self)
11295    }
11296
11297    /// Acquires information about the node.
11298    ///
11299    /// The attributes of a node should be stable, independent of the
11300    /// specific protocol used to access it.
11301    ///
11302    /// If a particular attribute is not applicable or not supported,
11303    /// filesystems should leave the corresponding field absent.
11304    ///
11305    /// + `query` a bit-mask specifying which attributes to fetch. The server
11306    ///   should not return more than necessary.
11307    /// - `attributes` the returned attributes.
11308    ///
11309    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11310    pub fn r#get_attributes(
11311        &self,
11312        mut query: NodeAttributesQuery,
11313    ) -> fidl::client::QueryResponseFut<
11314        NodeGetAttributesResult,
11315        fdomain_client::fidl::FDomainResourceDialect,
11316    > {
11317        NodeProxyInterface::r#get_attributes(self, query)
11318    }
11319
11320    /// Updates information about the node.
11321    ///
11322    /// + `attributes` the presence of a table field in `attributes` indicates
11323    /// the intent to update the corresponding attribute.
11324    ///
11325    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
11326    ///
11327    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11328    pub fn r#update_attributes(
11329        &self,
11330        mut payload: &MutableNodeAttributes,
11331    ) -> fidl::client::QueryResponseFut<
11332        NodeUpdateAttributesResult,
11333        fdomain_client::fidl::FDomainResourceDialect,
11334    > {
11335        NodeProxyInterface::r#update_attributes(self, payload)
11336    }
11337
11338    /// Synchronizes updates to the node to the underlying media, if it exists.
11339    ///
11340    /// This method will return when the filesystem server has flushed the
11341    /// relevant updates to the underlying media, but does not guarantee the
11342    /// underlying media has persisted the information, nor that any information
11343    /// is committed to hardware. Clients may use `Sync` to ensure ordering
11344    /// between operations.
11345    ///
11346    /// This method does not require any rights.
11347    pub fn r#sync(
11348        &self,
11349    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
11350    {
11351        NodeProxyInterface::r#sync(self)
11352    }
11353
11354    /// Creates an iterator over all the extended attribute names associated
11355    /// with this node. If an error occurs it is returned as an epitaph on the
11356    /// iterator request channel, and then the channel is closed.
11357    ///
11358    /// GetExtendedAttributes can be used with any of these names to retrieve
11359    /// the associated value.
11360    ///
11361    /// This method requires the [`Rights.READ_BYTES`] right.
11362    pub fn r#list_extended_attributes(
11363        &self,
11364        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11365    ) -> Result<(), fidl::Error> {
11366        NodeProxyInterface::r#list_extended_attributes(self, iterator)
11367    }
11368
11369    /// Get the value associated with the given attribute `name` for this node.
11370    ///
11371    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
11372    /// particular structure is imposed on them.
11373    ///
11374    /// This method requires the [`Rights.READ_BYTES`] right.
11375    pub fn r#get_extended_attribute(
11376        &self,
11377        mut name: &[u8],
11378    ) -> fidl::client::QueryResponseFut<
11379        NodeGetExtendedAttributeResult,
11380        fdomain_client::fidl::FDomainResourceDialect,
11381    > {
11382        NodeProxyInterface::r#get_extended_attribute(self, name)
11383    }
11384
11385    /// Set the value for the given attribute `name` to `value` for this node.
11386    ///
11387    /// The attribute name may exist, in which case the attribute is updated.
11388    /// If the attribute doesn't exist, it is created. The name should have no
11389    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
11390    ///
11391    /// This method requires the [`Rights.WRITE_BYTES`] right.
11392    pub fn r#set_extended_attribute(
11393        &self,
11394        mut name: &[u8],
11395        mut value: ExtendedAttributeValue,
11396        mut mode: SetExtendedAttributeMode,
11397    ) -> fidl::client::QueryResponseFut<
11398        NodeSetExtendedAttributeResult,
11399        fdomain_client::fidl::FDomainResourceDialect,
11400    > {
11401        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
11402    }
11403
11404    /// Remove the specified extended attribute.
11405    ///
11406    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
11407    ///
11408    /// This method requires the [`Rights.WRITE_BYTES`] right.
11409    pub fn r#remove_extended_attribute(
11410        &self,
11411        mut name: &[u8],
11412    ) -> fidl::client::QueryResponseFut<
11413        NodeRemoveExtendedAttributeResult,
11414        fdomain_client::fidl::FDomainResourceDialect,
11415    > {
11416        NodeProxyInterface::r#remove_extended_attribute(self, name)
11417    }
11418}
11419
11420impl NodeProxyInterface for NodeProxy {
11421    fn r#clone(
11422        &self,
11423        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11424    ) -> Result<(), fidl::Error> {
11425        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
11426            (request,),
11427            0x20d8a7aba2168a79,
11428            fidl::encoding::DynamicFlags::empty(),
11429        )
11430    }
11431
11432    type CloseResponseFut = fidl::client::QueryResponseFut<
11433        fdomain_fuchsia_unknown::CloseableCloseResult,
11434        fdomain_client::fidl::FDomainResourceDialect,
11435    >;
11436    fn r#close(&self) -> Self::CloseResponseFut {
11437        fn _decode(
11438            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11439        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
11440            let _response = fidl::client::decode_transaction_body::<
11441                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11442                fdomain_client::fidl::FDomainResourceDialect,
11443                0x5ac5d459ad7f657e,
11444            >(_buf?)?;
11445            Ok(_response.map(|x| x))
11446        }
11447        self.client.send_query_and_decode::<
11448            fidl::encoding::EmptyPayload,
11449            fdomain_fuchsia_unknown::CloseableCloseResult,
11450        >(
11451            (),
11452            0x5ac5d459ad7f657e,
11453            fidl::encoding::DynamicFlags::empty(),
11454            _decode,
11455        )
11456    }
11457
11458    type QueryResponseFut =
11459        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
11460    fn r#query(&self) -> Self::QueryResponseFut {
11461        fn _decode(
11462            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11463        ) -> Result<Vec<u8>, fidl::Error> {
11464            let _response = fidl::client::decode_transaction_body::<
11465                fdomain_fuchsia_unknown::QueryableQueryResponse,
11466                fdomain_client::fidl::FDomainResourceDialect,
11467                0x2658edee9decfc06,
11468            >(_buf?)?;
11469            Ok(_response.protocol)
11470        }
11471        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
11472            (),
11473            0x2658edee9decfc06,
11474            fidl::encoding::DynamicFlags::empty(),
11475            _decode,
11476        )
11477    }
11478
11479    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
11480        (i32, NodeAttributes),
11481        fdomain_client::fidl::FDomainResourceDialect,
11482    >;
11483    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
11484        fn _decode(
11485            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11486        ) -> Result<(i32, NodeAttributes), fidl::Error> {
11487            let _response = fidl::client::decode_transaction_body::<
11488                NodeDeprecatedGetAttrResponse,
11489                fdomain_client::fidl::FDomainResourceDialect,
11490                0x78985e216314dafd,
11491            >(_buf?)?;
11492            Ok((_response.s, _response.attributes))
11493        }
11494        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
11495            (),
11496            0x78985e216314dafd,
11497            fidl::encoding::DynamicFlags::empty(),
11498            _decode,
11499        )
11500    }
11501
11502    type DeprecatedSetAttrResponseFut =
11503        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11504    fn r#deprecated_set_attr(
11505        &self,
11506        mut flags: NodeAttributeFlags,
11507        mut attributes: &NodeAttributes,
11508    ) -> Self::DeprecatedSetAttrResponseFut {
11509        fn _decode(
11510            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11511        ) -> Result<i32, fidl::Error> {
11512            let _response = fidl::client::decode_transaction_body::<
11513                NodeDeprecatedSetAttrResponse,
11514                fdomain_client::fidl::FDomainResourceDialect,
11515                0x4186c0f40d938f46,
11516            >(_buf?)?;
11517            Ok(_response.s)
11518        }
11519        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
11520            (flags, attributes),
11521            0x4186c0f40d938f46,
11522            fidl::encoding::DynamicFlags::empty(),
11523            _decode,
11524        )
11525    }
11526
11527    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
11528        (i32, OpenFlags),
11529        fdomain_client::fidl::FDomainResourceDialect,
11530    >;
11531    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
11532        fn _decode(
11533            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11534        ) -> Result<(i32, OpenFlags), fidl::Error> {
11535            let _response = fidl::client::decode_transaction_body::<
11536                NodeDeprecatedGetFlagsResponse,
11537                fdomain_client::fidl::FDomainResourceDialect,
11538                0x5b88fffb8eda3aa1,
11539            >(_buf?)?;
11540            Ok((_response.s, _response.flags))
11541        }
11542        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
11543            (),
11544            0x5b88fffb8eda3aa1,
11545            fidl::encoding::DynamicFlags::empty(),
11546            _decode,
11547        )
11548    }
11549
11550    type DeprecatedSetFlagsResponseFut =
11551        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11552    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
11553        fn _decode(
11554            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11555        ) -> Result<i32, fidl::Error> {
11556            let _response = fidl::client::decode_transaction_body::<
11557                NodeDeprecatedSetFlagsResponse,
11558                fdomain_client::fidl::FDomainResourceDialect,
11559                0x5295b76c71fde733,
11560            >(_buf?)?;
11561            Ok(_response.s)
11562        }
11563        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
11564            (flags,),
11565            0x5295b76c71fde733,
11566            fidl::encoding::DynamicFlags::empty(),
11567            _decode,
11568        )
11569    }
11570
11571    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
11572        NodeGetFlagsResult,
11573        fdomain_client::fidl::FDomainResourceDialect,
11574    >;
11575    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
11576        fn _decode(
11577            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11578        ) -> Result<NodeGetFlagsResult, fidl::Error> {
11579            let _response = fidl::client::decode_transaction_body::<
11580                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
11581                fdomain_client::fidl::FDomainResourceDialect,
11582                0x176eb318f64ec23,
11583            >(_buf?)?
11584            .into_result_fdomain::<NodeMarker>("get_flags")?;
11585            Ok(_response.map(|x| x.flags))
11586        }
11587        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
11588            (),
11589            0x176eb318f64ec23,
11590            fidl::encoding::DynamicFlags::FLEXIBLE,
11591            _decode,
11592        )
11593    }
11594
11595    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
11596        NodeSetFlagsResult,
11597        fdomain_client::fidl::FDomainResourceDialect,
11598    >;
11599    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
11600        fn _decode(
11601            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11602        ) -> Result<NodeSetFlagsResult, fidl::Error> {
11603            let _response = fidl::client::decode_transaction_body::<
11604                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
11605                fdomain_client::fidl::FDomainResourceDialect,
11606                0x55a8028685791ea8,
11607            >(_buf?)?
11608            .into_result_fdomain::<NodeMarker>("set_flags")?;
11609            Ok(_response.map(|x| x))
11610        }
11611        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
11612            (flags,),
11613            0x55a8028685791ea8,
11614            fidl::encoding::DynamicFlags::FLEXIBLE,
11615            _decode,
11616        )
11617    }
11618
11619    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
11620        (i32, Option<Box<FilesystemInfo>>),
11621        fdomain_client::fidl::FDomainResourceDialect,
11622    >;
11623    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
11624        fn _decode(
11625            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11626        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
11627            let _response = fidl::client::decode_transaction_body::<
11628                NodeQueryFilesystemResponse,
11629                fdomain_client::fidl::FDomainResourceDialect,
11630                0x6f344a1c6b0a0610,
11631            >(_buf?)?;
11632            Ok((_response.s, _response.info))
11633        }
11634        self.client.send_query_and_decode::<
11635            fidl::encoding::EmptyPayload,
11636            (i32, Option<Box<FilesystemInfo>>),
11637        >(
11638            (),
11639            0x6f344a1c6b0a0610,
11640            fidl::encoding::DynamicFlags::empty(),
11641            _decode,
11642        )
11643    }
11644
11645    type GetTokenResponseFut = fidl::client::QueryResponseFut<
11646        NodeGetTokenResult,
11647        fdomain_client::fidl::FDomainResourceDialect,
11648    >;
11649    fn r#get_token(&self) -> Self::GetTokenResponseFut {
11650        fn _decode(
11651            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11652        ) -> Result<NodeGetTokenResult, fidl::Error> {
11653            let _response = fidl::client::decode_transaction_body::<
11654                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
11655                fdomain_client::fidl::FDomainResourceDialect,
11656                0x5054f0ade7076cec,
11657            >(_buf?)?
11658            .into_result_fdomain::<NodeMarker>("get_token")?;
11659            Ok(_response.map(|x| x.token))
11660        }
11661        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
11662            (),
11663            0x5054f0ade7076cec,
11664            fidl::encoding::DynamicFlags::FLEXIBLE,
11665            _decode,
11666        )
11667    }
11668
11669    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
11670        NodeGetAttributesResult,
11671        fdomain_client::fidl::FDomainResourceDialect,
11672    >;
11673    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
11674        fn _decode(
11675            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11676        ) -> Result<NodeGetAttributesResult, fidl::Error> {
11677            let _response = fidl::client::decode_transaction_body::<
11678                fidl::encoding::ResultType<NodeAttributes2, i32>,
11679                fdomain_client::fidl::FDomainResourceDialect,
11680                0x3d4396a638ea053b,
11681            >(_buf?)?;
11682            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
11683        }
11684        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
11685            (query,),
11686            0x3d4396a638ea053b,
11687            fidl::encoding::DynamicFlags::empty(),
11688            _decode,
11689        )
11690    }
11691
11692    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
11693        NodeUpdateAttributesResult,
11694        fdomain_client::fidl::FDomainResourceDialect,
11695    >;
11696    fn r#update_attributes(
11697        &self,
11698        mut payload: &MutableNodeAttributes,
11699    ) -> Self::UpdateAttributesResponseFut {
11700        fn _decode(
11701            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11702        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
11703            let _response = fidl::client::decode_transaction_body::<
11704                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11705                fdomain_client::fidl::FDomainResourceDialect,
11706                0x3308c1da5a89bf08,
11707            >(_buf?)?;
11708            Ok(_response.map(|x| x))
11709        }
11710        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
11711            payload,
11712            0x3308c1da5a89bf08,
11713            fidl::encoding::DynamicFlags::empty(),
11714            _decode,
11715        )
11716    }
11717
11718    type SyncResponseFut = fidl::client::QueryResponseFut<
11719        NodeSyncResult,
11720        fdomain_client::fidl::FDomainResourceDialect,
11721    >;
11722    fn r#sync(&self) -> Self::SyncResponseFut {
11723        fn _decode(
11724            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11725        ) -> Result<NodeSyncResult, fidl::Error> {
11726            let _response = fidl::client::decode_transaction_body::<
11727                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11728                fdomain_client::fidl::FDomainResourceDialect,
11729                0x2c5c27ca0ab5dc49,
11730            >(_buf?)?;
11731            Ok(_response.map(|x| x))
11732        }
11733        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
11734            (),
11735            0x2c5c27ca0ab5dc49,
11736            fidl::encoding::DynamicFlags::empty(),
11737            _decode,
11738        )
11739    }
11740
11741    fn r#list_extended_attributes(
11742        &self,
11743        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11744    ) -> Result<(), fidl::Error> {
11745        self.client.send::<NodeListExtendedAttributesRequest>(
11746            (iterator,),
11747            0x4b61033de007fcd0,
11748            fidl::encoding::DynamicFlags::empty(),
11749        )
11750    }
11751
11752    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11753        NodeGetExtendedAttributeResult,
11754        fdomain_client::fidl::FDomainResourceDialect,
11755    >;
11756    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
11757        fn _decode(
11758            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11759        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
11760            let _response = fidl::client::decode_transaction_body::<
11761                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
11762                fdomain_client::fidl::FDomainResourceDialect,
11763                0x45ffa3ccfdeb76db,
11764            >(_buf?)?;
11765            Ok(_response.map(|x| x))
11766        }
11767        self.client.send_query_and_decode::<
11768            NodeGetExtendedAttributeRequest,
11769            NodeGetExtendedAttributeResult,
11770        >(
11771            (name,),
11772            0x45ffa3ccfdeb76db,
11773            fidl::encoding::DynamicFlags::empty(),
11774            _decode,
11775        )
11776    }
11777
11778    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11779        NodeSetExtendedAttributeResult,
11780        fdomain_client::fidl::FDomainResourceDialect,
11781    >;
11782    fn r#set_extended_attribute(
11783        &self,
11784        mut name: &[u8],
11785        mut value: ExtendedAttributeValue,
11786        mut mode: SetExtendedAttributeMode,
11787    ) -> Self::SetExtendedAttributeResponseFut {
11788        fn _decode(
11789            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11790        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
11791            let _response = fidl::client::decode_transaction_body::<
11792                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11793                fdomain_client::fidl::FDomainResourceDialect,
11794                0x4a951362f681f23c,
11795            >(_buf?)?;
11796            Ok(_response.map(|x| x))
11797        }
11798        self.client.send_query_and_decode::<
11799            NodeSetExtendedAttributeRequest,
11800            NodeSetExtendedAttributeResult,
11801        >(
11802            (name, &mut value, mode,),
11803            0x4a951362f681f23c,
11804            fidl::encoding::DynamicFlags::empty(),
11805            _decode,
11806        )
11807    }
11808
11809    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11810        NodeRemoveExtendedAttributeResult,
11811        fdomain_client::fidl::FDomainResourceDialect,
11812    >;
11813    fn r#remove_extended_attribute(
11814        &self,
11815        mut name: &[u8],
11816    ) -> Self::RemoveExtendedAttributeResponseFut {
11817        fn _decode(
11818            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11819        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
11820            let _response = fidl::client::decode_transaction_body::<
11821                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11822                fdomain_client::fidl::FDomainResourceDialect,
11823                0x7a0b9f3a9bf9032d,
11824            >(_buf?)?;
11825            Ok(_response.map(|x| x))
11826        }
11827        self.client.send_query_and_decode::<
11828            NodeRemoveExtendedAttributeRequest,
11829            NodeRemoveExtendedAttributeResult,
11830        >(
11831            (name,),
11832            0x7a0b9f3a9bf9032d,
11833            fidl::encoding::DynamicFlags::empty(),
11834            _decode,
11835        )
11836    }
11837}
11838
11839pub struct NodeEventStream {
11840    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
11841}
11842
11843impl std::marker::Unpin for NodeEventStream {}
11844
11845impl futures::stream::FusedStream for NodeEventStream {
11846    fn is_terminated(&self) -> bool {
11847        self.event_receiver.is_terminated()
11848    }
11849}
11850
11851impl futures::Stream for NodeEventStream {
11852    type Item = Result<NodeEvent, fidl::Error>;
11853
11854    fn poll_next(
11855        mut self: std::pin::Pin<&mut Self>,
11856        cx: &mut std::task::Context<'_>,
11857    ) -> std::task::Poll<Option<Self::Item>> {
11858        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11859            &mut self.event_receiver,
11860            cx
11861        )?) {
11862            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
11863            None => std::task::Poll::Ready(None),
11864        }
11865    }
11866}
11867
11868#[derive(Debug)]
11869pub enum NodeEvent {
11870    OnOpen_ {
11871        s: i32,
11872        info: Option<Box<NodeInfoDeprecated>>,
11873    },
11874    OnRepresentation {
11875        payload: Representation,
11876    },
11877    #[non_exhaustive]
11878    _UnknownEvent {
11879        /// Ordinal of the event that was sent.
11880        ordinal: u64,
11881    },
11882}
11883
11884impl NodeEvent {
11885    #[allow(irrefutable_let_patterns)]
11886    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
11887        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
11888    }
11889    #[allow(irrefutable_let_patterns)]
11890    pub fn into_on_representation(self) -> Option<Representation> {
11891        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
11892    }
11893
11894    /// Decodes a message buffer as a [`NodeEvent`].
11895    fn decode(
11896        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11897    ) -> Result<NodeEvent, fidl::Error> {
11898        let (bytes, _handles) = buf.split_mut();
11899        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11900        debug_assert_eq!(tx_header.tx_id, 0);
11901        match tx_header.ordinal {
11902            0x7fc7bbb1dbfd1972 => {
11903                let mut out = fidl::new_empty!(
11904                    NodeOnOpenRequest,
11905                    fdomain_client::fidl::FDomainResourceDialect
11906                );
11907                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
11908                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
11909            }
11910            0x5cb40567d80a510c => {
11911                let mut out =
11912                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
11913                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
11914                Ok((NodeEvent::OnRepresentation { payload: out }))
11915            }
11916            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11917                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11918            }
11919            _ => Err(fidl::Error::UnknownOrdinal {
11920                ordinal: tx_header.ordinal,
11921                protocol_name: <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
11922            }),
11923        }
11924    }
11925}
11926
11927/// A Stream of incoming requests for fuchsia.io/Node.
11928pub struct NodeRequestStream {
11929    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11930    is_terminated: bool,
11931}
11932
11933impl std::marker::Unpin for NodeRequestStream {}
11934
11935impl futures::stream::FusedStream for NodeRequestStream {
11936    fn is_terminated(&self) -> bool {
11937        self.is_terminated
11938    }
11939}
11940
11941impl fdomain_client::fidl::RequestStream for NodeRequestStream {
11942    type Protocol = NodeMarker;
11943    type ControlHandle = NodeControlHandle;
11944
11945    fn from_channel(channel: fdomain_client::Channel) -> Self {
11946        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11947    }
11948
11949    fn control_handle(&self) -> Self::ControlHandle {
11950        NodeControlHandle { inner: self.inner.clone() }
11951    }
11952
11953    fn into_inner(
11954        self,
11955    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
11956    {
11957        (self.inner, self.is_terminated)
11958    }
11959
11960    fn from_inner(
11961        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11962        is_terminated: bool,
11963    ) -> Self {
11964        Self { inner, is_terminated }
11965    }
11966}
11967
11968impl futures::Stream for NodeRequestStream {
11969    type Item = Result<NodeRequest, fidl::Error>;
11970
11971    fn poll_next(
11972        mut self: std::pin::Pin<&mut Self>,
11973        cx: &mut std::task::Context<'_>,
11974    ) -> std::task::Poll<Option<Self::Item>> {
11975        let this = &mut *self;
11976        if this.inner.check_shutdown(cx) {
11977            this.is_terminated = true;
11978            return std::task::Poll::Ready(None);
11979        }
11980        if this.is_terminated {
11981            panic!("polled NodeRequestStream after completion");
11982        }
11983        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
11984            |bytes, handles| {
11985                match this.inner.channel().read_etc(cx, bytes, handles) {
11986                    std::task::Poll::Ready(Ok(())) => {}
11987                    std::task::Poll::Pending => return std::task::Poll::Pending,
11988                    std::task::Poll::Ready(Err(None)) => {
11989                        this.is_terminated = true;
11990                        return std::task::Poll::Ready(None);
11991                    }
11992                    std::task::Poll::Ready(Err(Some(e))) => {
11993                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11994                            e.into(),
11995                        ))));
11996                    }
11997                }
11998
11999                // A message has been received from the channel
12000                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12001
12002                std::task::Poll::Ready(Some(match header.ordinal {
12003                    0x20d8a7aba2168a79 => {
12004                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12005                        let mut req = fidl::new_empty!(
12006                            fdomain_fuchsia_unknown::CloneableCloneRequest,
12007                            fdomain_client::fidl::FDomainResourceDialect
12008                        );
12009                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
12010                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12011                        Ok(NodeRequest::Clone { request: req.request, control_handle })
12012                    }
12013                    0x5ac5d459ad7f657e => {
12014                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12015                        let mut req = fidl::new_empty!(
12016                            fidl::encoding::EmptyPayload,
12017                            fdomain_client::fidl::FDomainResourceDialect
12018                        );
12019                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12020                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12021                        Ok(NodeRequest::Close {
12022                            responder: NodeCloseResponder {
12023                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12024                                tx_id: header.tx_id,
12025                            },
12026                        })
12027                    }
12028                    0x2658edee9decfc06 => {
12029                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12030                        let mut req = fidl::new_empty!(
12031                            fidl::encoding::EmptyPayload,
12032                            fdomain_client::fidl::FDomainResourceDialect
12033                        );
12034                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12035                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12036                        Ok(NodeRequest::Query {
12037                            responder: NodeQueryResponder {
12038                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12039                                tx_id: header.tx_id,
12040                            },
12041                        })
12042                    }
12043                    0x78985e216314dafd => {
12044                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12045                        let mut req = fidl::new_empty!(
12046                            fidl::encoding::EmptyPayload,
12047                            fdomain_client::fidl::FDomainResourceDialect
12048                        );
12049                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12050                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12051                        Ok(NodeRequest::DeprecatedGetAttr {
12052                            responder: NodeDeprecatedGetAttrResponder {
12053                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12054                                tx_id: header.tx_id,
12055                            },
12056                        })
12057                    }
12058                    0x4186c0f40d938f46 => {
12059                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12060                        let mut req = fidl::new_empty!(
12061                            NodeDeprecatedSetAttrRequest,
12062                            fdomain_client::fidl::FDomainResourceDialect
12063                        );
12064                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
12065                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12066                        Ok(NodeRequest::DeprecatedSetAttr {
12067                            flags: req.flags,
12068                            attributes: req.attributes,
12069
12070                            responder: NodeDeprecatedSetAttrResponder {
12071                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12072                                tx_id: header.tx_id,
12073                            },
12074                        })
12075                    }
12076                    0x5b88fffb8eda3aa1 => {
12077                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12078                        let mut req = fidl::new_empty!(
12079                            fidl::encoding::EmptyPayload,
12080                            fdomain_client::fidl::FDomainResourceDialect
12081                        );
12082                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12083                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12084                        Ok(NodeRequest::DeprecatedGetFlags {
12085                            responder: NodeDeprecatedGetFlagsResponder {
12086                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12087                                tx_id: header.tx_id,
12088                            },
12089                        })
12090                    }
12091                    0x5295b76c71fde733 => {
12092                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12093                        let mut req = fidl::new_empty!(
12094                            NodeDeprecatedSetFlagsRequest,
12095                            fdomain_client::fidl::FDomainResourceDialect
12096                        );
12097                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
12098                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12099                        Ok(NodeRequest::DeprecatedSetFlags {
12100                            flags: req.flags,
12101
12102                            responder: NodeDeprecatedSetFlagsResponder {
12103                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12104                                tx_id: header.tx_id,
12105                            },
12106                        })
12107                    }
12108                    0x176eb318f64ec23 => {
12109                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12110                        let mut req = fidl::new_empty!(
12111                            fidl::encoding::EmptyPayload,
12112                            fdomain_client::fidl::FDomainResourceDialect
12113                        );
12114                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12115                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12116                        Ok(NodeRequest::GetFlags {
12117                            responder: NodeGetFlagsResponder {
12118                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12119                                tx_id: header.tx_id,
12120                            },
12121                        })
12122                    }
12123                    0x55a8028685791ea8 => {
12124                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12125                        let mut req = fidl::new_empty!(
12126                            NodeSetFlagsRequest,
12127                            fdomain_client::fidl::FDomainResourceDialect
12128                        );
12129                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
12130                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12131                        Ok(NodeRequest::SetFlags {
12132                            flags: req.flags,
12133
12134                            responder: NodeSetFlagsResponder {
12135                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12136                                tx_id: header.tx_id,
12137                            },
12138                        })
12139                    }
12140                    0x6f344a1c6b0a0610 => {
12141                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12142                        let mut req = fidl::new_empty!(
12143                            fidl::encoding::EmptyPayload,
12144                            fdomain_client::fidl::FDomainResourceDialect
12145                        );
12146                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12147                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12148                        Ok(NodeRequest::QueryFilesystem {
12149                            responder: NodeQueryFilesystemResponder {
12150                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12151                                tx_id: header.tx_id,
12152                            },
12153                        })
12154                    }
12155                    0x5054f0ade7076cec => {
12156                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12157                        let mut req = fidl::new_empty!(
12158                            fidl::encoding::EmptyPayload,
12159                            fdomain_client::fidl::FDomainResourceDialect
12160                        );
12161                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12162                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12163                        Ok(NodeRequest::GetToken {
12164                            responder: NodeGetTokenResponder {
12165                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12166                                tx_id: header.tx_id,
12167                            },
12168                        })
12169                    }
12170                    0x3d4396a638ea053b => {
12171                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12172                        let mut req = fidl::new_empty!(
12173                            NodeGetAttributesRequest,
12174                            fdomain_client::fidl::FDomainResourceDialect
12175                        );
12176                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
12177                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12178                        Ok(NodeRequest::GetAttributes {
12179                            query: req.query,
12180
12181                            responder: NodeGetAttributesResponder {
12182                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12183                                tx_id: header.tx_id,
12184                            },
12185                        })
12186                    }
12187                    0x3308c1da5a89bf08 => {
12188                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12189                        let mut req = fidl::new_empty!(
12190                            MutableNodeAttributes,
12191                            fdomain_client::fidl::FDomainResourceDialect
12192                        );
12193                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
12194                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12195                        Ok(NodeRequest::UpdateAttributes {
12196                            payload: req,
12197                            responder: NodeUpdateAttributesResponder {
12198                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12199                                tx_id: header.tx_id,
12200                            },
12201                        })
12202                    }
12203                    0x2c5c27ca0ab5dc49 => {
12204                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12205                        let mut req = fidl::new_empty!(
12206                            fidl::encoding::EmptyPayload,
12207                            fdomain_client::fidl::FDomainResourceDialect
12208                        );
12209                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12210                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12211                        Ok(NodeRequest::Sync {
12212                            responder: NodeSyncResponder {
12213                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12214                                tx_id: header.tx_id,
12215                            },
12216                        })
12217                    }
12218                    0x4b61033de007fcd0 => {
12219                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12220                        let mut req = fidl::new_empty!(
12221                            NodeListExtendedAttributesRequest,
12222                            fdomain_client::fidl::FDomainResourceDialect
12223                        );
12224                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
12225                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12226                        Ok(NodeRequest::ListExtendedAttributes {
12227                            iterator: req.iterator,
12228
12229                            control_handle,
12230                        })
12231                    }
12232                    0x45ffa3ccfdeb76db => {
12233                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12234                        let mut req = fidl::new_empty!(
12235                            NodeGetExtendedAttributeRequest,
12236                            fdomain_client::fidl::FDomainResourceDialect
12237                        );
12238                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12239                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12240                        Ok(NodeRequest::GetExtendedAttribute {
12241                            name: req.name,
12242
12243                            responder: NodeGetExtendedAttributeResponder {
12244                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12245                                tx_id: header.tx_id,
12246                            },
12247                        })
12248                    }
12249                    0x4a951362f681f23c => {
12250                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12251                        let mut req = fidl::new_empty!(
12252                            NodeSetExtendedAttributeRequest,
12253                            fdomain_client::fidl::FDomainResourceDialect
12254                        );
12255                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12256                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12257                        Ok(NodeRequest::SetExtendedAttribute {
12258                            name: req.name,
12259                            value: req.value,
12260                            mode: req.mode,
12261
12262                            responder: NodeSetExtendedAttributeResponder {
12263                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12264                                tx_id: header.tx_id,
12265                            },
12266                        })
12267                    }
12268                    0x7a0b9f3a9bf9032d => {
12269                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12270                        let mut req = fidl::new_empty!(
12271                            NodeRemoveExtendedAttributeRequest,
12272                            fdomain_client::fidl::FDomainResourceDialect
12273                        );
12274                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12275                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12276                        Ok(NodeRequest::RemoveExtendedAttribute {
12277                            name: req.name,
12278
12279                            responder: NodeRemoveExtendedAttributeResponder {
12280                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12281                                tx_id: header.tx_id,
12282                            },
12283                        })
12284                    }
12285                    _ if header.tx_id == 0
12286                        && header
12287                            .dynamic_flags()
12288                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12289                    {
12290                        Ok(NodeRequest::_UnknownMethod {
12291                            ordinal: header.ordinal,
12292                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12293                            method_type: fidl::MethodType::OneWay,
12294                        })
12295                    }
12296                    _ if header
12297                        .dynamic_flags()
12298                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12299                    {
12300                        this.inner.send_framework_err(
12301                            fidl::encoding::FrameworkErr::UnknownMethod,
12302                            header.tx_id,
12303                            header.ordinal,
12304                            header.dynamic_flags(),
12305                            (bytes, handles),
12306                        )?;
12307                        Ok(NodeRequest::_UnknownMethod {
12308                            ordinal: header.ordinal,
12309                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12310                            method_type: fidl::MethodType::TwoWay,
12311                        })
12312                    }
12313                    _ => Err(fidl::Error::UnknownOrdinal {
12314                        ordinal: header.ordinal,
12315                        protocol_name:
12316                            <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
12317                    }),
12318                }))
12319            },
12320        )
12321    }
12322}
12323
12324/// Node defines the minimal interface for entities which can be accessed in a filesystem.
12325#[derive(Debug)]
12326pub enum NodeRequest {
12327    Clone {
12328        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12329        control_handle: NodeControlHandle,
12330    },
12331    /// Terminates the connection.
12332    ///
12333    /// After calling `Close`, the client must not send any other requests.
12334    ///
12335    /// Servers, after sending the status response, should close the connection
12336    /// regardless of status and without sending an epitaph.
12337    ///
12338    /// Closing the client end of the channel should be semantically equivalent
12339    /// to calling `Close` without knowing when the close has completed or its
12340    /// status.
12341    Close {
12342        responder: NodeCloseResponder,
12343    },
12344    Query {
12345        responder: NodeQueryResponder,
12346    },
12347    /// DEPRECATED - Use `Node.GetAttributes` instead.
12348    ///
12349    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12350    DeprecatedGetAttr {
12351        responder: NodeDeprecatedGetAttrResponder,
12352    },
12353    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12354    DeprecatedSetAttr {
12355        flags: NodeAttributeFlags,
12356        attributes: NodeAttributes,
12357        responder: NodeDeprecatedSetAttrResponder,
12358    },
12359    /// [DEPRECATED - Use new GetFlags method instead.]
12360    DeprecatedGetFlags {
12361        responder: NodeDeprecatedGetFlagsResponder,
12362    },
12363    /// [DEPRECATED - Use new SetFlags method instead.]
12364    DeprecatedSetFlags {
12365        flags: OpenFlags,
12366        responder: NodeDeprecatedSetFlagsResponder,
12367    },
12368    /// Queries the flags that apply to this node after it has been opened/created. This method does
12369    /// not require any rights.
12370    ///
12371    /// Note that the final set of flags that apply to the connection may differ from those
12372    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
12373    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
12374    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
12375    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
12376    GetFlags {
12377        responder: NodeGetFlagsResponder,
12378    },
12379    /// Sets the flags that apply to this node after it has been opened. This method does not
12380    /// require any rights.
12381    ///
12382    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
12383    /// clear append mode.
12384    ///
12385    /// Errors:
12386    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
12387    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
12388    SetFlags {
12389        flags: Flags,
12390        responder: NodeSetFlagsResponder,
12391    },
12392    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
12393    /// volume has different settings or the storage is accounted seperately from the rest of the
12394    /// filesystem that may be reported instead of filesystem-wide details.
12395    QueryFilesystem {
12396        responder: NodeQueryFilesystemResponder,
12397    },
12398    /// Acquires a token which can be used to identify this connection at a later point in
12399    /// time. The token will remain valid for as long as the connection requesting the token
12400    /// remains open.
12401    ///
12402    /// This method does not require any rights. Note that the token identifies
12403    /// the connection, hence carries the rights information on this connection.
12404    GetToken {
12405        responder: NodeGetTokenResponder,
12406    },
12407    /// Acquires information about the node.
12408    ///
12409    /// The attributes of a node should be stable, independent of the
12410    /// specific protocol used to access it.
12411    ///
12412    /// If a particular attribute is not applicable or not supported,
12413    /// filesystems should leave the corresponding field absent.
12414    ///
12415    /// + `query` a bit-mask specifying which attributes to fetch. The server
12416    ///   should not return more than necessary.
12417    /// - `attributes` the returned attributes.
12418    ///
12419    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12420    GetAttributes {
12421        query: NodeAttributesQuery,
12422        responder: NodeGetAttributesResponder,
12423    },
12424    /// Updates information about the node.
12425    ///
12426    /// + `attributes` the presence of a table field in `attributes` indicates
12427    /// the intent to update the corresponding attribute.
12428    ///
12429    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
12430    ///
12431    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12432    UpdateAttributes {
12433        payload: MutableNodeAttributes,
12434        responder: NodeUpdateAttributesResponder,
12435    },
12436    /// Synchronizes updates to the node to the underlying media, if it exists.
12437    ///
12438    /// This method will return when the filesystem server has flushed the
12439    /// relevant updates to the underlying media, but does not guarantee the
12440    /// underlying media has persisted the information, nor that any information
12441    /// is committed to hardware. Clients may use `Sync` to ensure ordering
12442    /// between operations.
12443    ///
12444    /// This method does not require any rights.
12445    Sync {
12446        responder: NodeSyncResponder,
12447    },
12448    /// Creates an iterator over all the extended attribute names associated
12449    /// with this node. If an error occurs it is returned as an epitaph on the
12450    /// iterator request channel, and then the channel is closed.
12451    ///
12452    /// GetExtendedAttributes can be used with any of these names to retrieve
12453    /// the associated value.
12454    ///
12455    /// This method requires the [`Rights.READ_BYTES`] right.
12456    ListExtendedAttributes {
12457        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
12458        control_handle: NodeControlHandle,
12459    },
12460    /// Get the value associated with the given attribute `name` for this node.
12461    ///
12462    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
12463    /// particular structure is imposed on them.
12464    ///
12465    /// This method requires the [`Rights.READ_BYTES`] right.
12466    GetExtendedAttribute {
12467        name: Vec<u8>,
12468        responder: NodeGetExtendedAttributeResponder,
12469    },
12470    /// Set the value for the given attribute `name` to `value` for this node.
12471    ///
12472    /// The attribute name may exist, in which case the attribute is updated.
12473    /// If the attribute doesn't exist, it is created. The name should have no
12474    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
12475    ///
12476    /// This method requires the [`Rights.WRITE_BYTES`] right.
12477    SetExtendedAttribute {
12478        name: Vec<u8>,
12479        value: ExtendedAttributeValue,
12480        mode: SetExtendedAttributeMode,
12481        responder: NodeSetExtendedAttributeResponder,
12482    },
12483    /// Remove the specified extended attribute.
12484    ///
12485    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
12486    ///
12487    /// This method requires the [`Rights.WRITE_BYTES`] right.
12488    RemoveExtendedAttribute {
12489        name: Vec<u8>,
12490        responder: NodeRemoveExtendedAttributeResponder,
12491    },
12492    /// An interaction was received which does not match any known method.
12493    #[non_exhaustive]
12494    _UnknownMethod {
12495        /// Ordinal of the method that was called.
12496        ordinal: u64,
12497        control_handle: NodeControlHandle,
12498        method_type: fidl::MethodType,
12499    },
12500}
12501
12502impl NodeRequest {
12503    #[allow(irrefutable_let_patterns)]
12504    pub fn into_clone(
12505        self,
12506    ) -> Option<(
12507        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12508        NodeControlHandle,
12509    )> {
12510        if let NodeRequest::Clone { request, control_handle } = self {
12511            Some((request, control_handle))
12512        } else {
12513            None
12514        }
12515    }
12516
12517    #[allow(irrefutable_let_patterns)]
12518    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
12519        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
12520    }
12521
12522    #[allow(irrefutable_let_patterns)]
12523    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
12524        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
12525    }
12526
12527    #[allow(irrefutable_let_patterns)]
12528    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
12529        if let NodeRequest::DeprecatedGetAttr { responder } = self {
12530            Some((responder))
12531        } else {
12532            None
12533        }
12534    }
12535
12536    #[allow(irrefutable_let_patterns)]
12537    pub fn into_deprecated_set_attr(
12538        self,
12539    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
12540        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
12541            Some((flags, attributes, responder))
12542        } else {
12543            None
12544        }
12545    }
12546
12547    #[allow(irrefutable_let_patterns)]
12548    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
12549        if let NodeRequest::DeprecatedGetFlags { responder } = self {
12550            Some((responder))
12551        } else {
12552            None
12553        }
12554    }
12555
12556    #[allow(irrefutable_let_patterns)]
12557    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
12558        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
12559            Some((flags, responder))
12560        } else {
12561            None
12562        }
12563    }
12564
12565    #[allow(irrefutable_let_patterns)]
12566    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
12567        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
12568    }
12569
12570    #[allow(irrefutable_let_patterns)]
12571    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
12572        if let NodeRequest::SetFlags { flags, responder } = self {
12573            Some((flags, responder))
12574        } else {
12575            None
12576        }
12577    }
12578
12579    #[allow(irrefutable_let_patterns)]
12580    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
12581        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
12582    }
12583
12584    #[allow(irrefutable_let_patterns)]
12585    pub fn into_get_token(self) -> Option<(NodeGetTokenResponder)> {
12586        if let NodeRequest::GetToken { responder } = self { Some((responder)) } else { None }
12587    }
12588
12589    #[allow(irrefutable_let_patterns)]
12590    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
12591        if let NodeRequest::GetAttributes { query, responder } = self {
12592            Some((query, responder))
12593        } else {
12594            None
12595        }
12596    }
12597
12598    #[allow(irrefutable_let_patterns)]
12599    pub fn into_update_attributes(
12600        self,
12601    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
12602        if let NodeRequest::UpdateAttributes { payload, responder } = self {
12603            Some((payload, responder))
12604        } else {
12605            None
12606        }
12607    }
12608
12609    #[allow(irrefutable_let_patterns)]
12610    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
12611        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
12612    }
12613
12614    #[allow(irrefutable_let_patterns)]
12615    pub fn into_list_extended_attributes(
12616        self,
12617    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
12618    {
12619        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
12620            Some((iterator, control_handle))
12621        } else {
12622            None
12623        }
12624    }
12625
12626    #[allow(irrefutable_let_patterns)]
12627    pub fn into_get_extended_attribute(
12628        self,
12629    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
12630        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
12631            Some((name, responder))
12632        } else {
12633            None
12634        }
12635    }
12636
12637    #[allow(irrefutable_let_patterns)]
12638    pub fn into_set_extended_attribute(
12639        self,
12640    ) -> Option<(
12641        Vec<u8>,
12642        ExtendedAttributeValue,
12643        SetExtendedAttributeMode,
12644        NodeSetExtendedAttributeResponder,
12645    )> {
12646        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
12647            Some((name, value, mode, responder))
12648        } else {
12649            None
12650        }
12651    }
12652
12653    #[allow(irrefutable_let_patterns)]
12654    pub fn into_remove_extended_attribute(
12655        self,
12656    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
12657        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
12658            Some((name, responder))
12659        } else {
12660            None
12661        }
12662    }
12663
12664    /// Name of the method defined in FIDL
12665    pub fn method_name(&self) -> &'static str {
12666        match *self {
12667            NodeRequest::Clone { .. } => "clone",
12668            NodeRequest::Close { .. } => "close",
12669            NodeRequest::Query { .. } => "query",
12670            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
12671            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
12672            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
12673            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
12674            NodeRequest::GetFlags { .. } => "get_flags",
12675            NodeRequest::SetFlags { .. } => "set_flags",
12676            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
12677            NodeRequest::GetToken { .. } => "get_token",
12678            NodeRequest::GetAttributes { .. } => "get_attributes",
12679            NodeRequest::UpdateAttributes { .. } => "update_attributes",
12680            NodeRequest::Sync { .. } => "sync",
12681            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
12682            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
12683            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
12684            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
12685            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12686                "unknown one-way method"
12687            }
12688            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12689                "unknown two-way method"
12690            }
12691        }
12692    }
12693}
12694
12695#[derive(Debug, Clone)]
12696pub struct NodeControlHandle {
12697    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
12698}
12699
12700impl NodeControlHandle {
12701    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12702        self.inner.shutdown_with_epitaph(status.into())
12703    }
12704}
12705
12706impl fdomain_client::fidl::ControlHandle for NodeControlHandle {
12707    fn shutdown(&self) {
12708        self.inner.shutdown()
12709    }
12710
12711    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12712        self.inner.shutdown_with_epitaph(status)
12713    }
12714
12715    fn is_closed(&self) -> bool {
12716        self.inner.channel().is_closed()
12717    }
12718    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
12719        self.inner.channel().on_closed()
12720    }
12721}
12722
12723impl NodeControlHandle {
12724    pub fn send_on_open_(
12725        &self,
12726        mut s: i32,
12727        mut info: Option<NodeInfoDeprecated>,
12728    ) -> Result<(), fidl::Error> {
12729        self.inner.send::<NodeOnOpenRequest>(
12730            (s, info.as_mut()),
12731            0,
12732            0x7fc7bbb1dbfd1972,
12733            fidl::encoding::DynamicFlags::FLEXIBLE,
12734        )
12735    }
12736
12737    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
12738        self.inner.send::<Representation>(
12739            &mut payload,
12740            0,
12741            0x5cb40567d80a510c,
12742            fidl::encoding::DynamicFlags::empty(),
12743        )
12744    }
12745}
12746
12747#[must_use = "FIDL methods require a response to be sent"]
12748#[derive(Debug)]
12749pub struct NodeCloseResponder {
12750    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12751    tx_id: u32,
12752}
12753
12754/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12755/// if the responder is dropped without sending a response, so that the client
12756/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12757impl std::ops::Drop for NodeCloseResponder {
12758    fn drop(&mut self) {
12759        self.control_handle.shutdown();
12760        // Safety: drops once, never accessed again
12761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12762    }
12763}
12764
12765impl fdomain_client::fidl::Responder for NodeCloseResponder {
12766    type ControlHandle = NodeControlHandle;
12767
12768    fn control_handle(&self) -> &NodeControlHandle {
12769        &self.control_handle
12770    }
12771
12772    fn drop_without_shutdown(mut self) {
12773        // Safety: drops once, never accessed again due to mem::forget
12774        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12775        // Prevent Drop from running (which would shut down the channel)
12776        std::mem::forget(self);
12777    }
12778}
12779
12780impl NodeCloseResponder {
12781    /// Sends a response to the FIDL transaction.
12782    ///
12783    /// Sets the channel to shutdown if an error occurs.
12784    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12785        let _result = self.send_raw(result);
12786        if _result.is_err() {
12787            self.control_handle.shutdown();
12788        }
12789        self.drop_without_shutdown();
12790        _result
12791    }
12792
12793    /// Similar to "send" but does not shutdown the channel if an error occurs.
12794    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12795        let _result = self.send_raw(result);
12796        self.drop_without_shutdown();
12797        _result
12798    }
12799
12800    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12801        self.control_handle
12802            .inner
12803            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12804                result,
12805                self.tx_id,
12806                0x5ac5d459ad7f657e,
12807                fidl::encoding::DynamicFlags::empty(),
12808            )
12809    }
12810}
12811
12812#[must_use = "FIDL methods require a response to be sent"]
12813#[derive(Debug)]
12814pub struct NodeQueryResponder {
12815    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12816    tx_id: u32,
12817}
12818
12819/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12820/// if the responder is dropped without sending a response, so that the client
12821/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12822impl std::ops::Drop for NodeQueryResponder {
12823    fn drop(&mut self) {
12824        self.control_handle.shutdown();
12825        // Safety: drops once, never accessed again
12826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12827    }
12828}
12829
12830impl fdomain_client::fidl::Responder for NodeQueryResponder {
12831    type ControlHandle = NodeControlHandle;
12832
12833    fn control_handle(&self) -> &NodeControlHandle {
12834        &self.control_handle
12835    }
12836
12837    fn drop_without_shutdown(mut self) {
12838        // Safety: drops once, never accessed again due to mem::forget
12839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12840        // Prevent Drop from running (which would shut down the channel)
12841        std::mem::forget(self);
12842    }
12843}
12844
12845impl NodeQueryResponder {
12846    /// Sends a response to the FIDL transaction.
12847    ///
12848    /// Sets the channel to shutdown if an error occurs.
12849    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12850        let _result = self.send_raw(protocol);
12851        if _result.is_err() {
12852            self.control_handle.shutdown();
12853        }
12854        self.drop_without_shutdown();
12855        _result
12856    }
12857
12858    /// Similar to "send" but does not shutdown the channel if an error occurs.
12859    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12860        let _result = self.send_raw(protocol);
12861        self.drop_without_shutdown();
12862        _result
12863    }
12864
12865    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12866        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
12867            (protocol,),
12868            self.tx_id,
12869            0x2658edee9decfc06,
12870            fidl::encoding::DynamicFlags::empty(),
12871        )
12872    }
12873}
12874
12875#[must_use = "FIDL methods require a response to be sent"]
12876#[derive(Debug)]
12877pub struct NodeDeprecatedGetAttrResponder {
12878    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12879    tx_id: u32,
12880}
12881
12882/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12883/// if the responder is dropped without sending a response, so that the client
12884/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12885impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
12886    fn drop(&mut self) {
12887        self.control_handle.shutdown();
12888        // Safety: drops once, never accessed again
12889        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12890    }
12891}
12892
12893impl fdomain_client::fidl::Responder for NodeDeprecatedGetAttrResponder {
12894    type ControlHandle = NodeControlHandle;
12895
12896    fn control_handle(&self) -> &NodeControlHandle {
12897        &self.control_handle
12898    }
12899
12900    fn drop_without_shutdown(mut self) {
12901        // Safety: drops once, never accessed again due to mem::forget
12902        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12903        // Prevent Drop from running (which would shut down the channel)
12904        std::mem::forget(self);
12905    }
12906}
12907
12908impl NodeDeprecatedGetAttrResponder {
12909    /// Sends a response to the FIDL transaction.
12910    ///
12911    /// Sets the channel to shutdown if an error occurs.
12912    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12913        let _result = self.send_raw(s, attributes);
12914        if _result.is_err() {
12915            self.control_handle.shutdown();
12916        }
12917        self.drop_without_shutdown();
12918        _result
12919    }
12920
12921    /// Similar to "send" but does not shutdown the channel if an error occurs.
12922    pub fn send_no_shutdown_on_err(
12923        self,
12924        mut s: i32,
12925        mut attributes: &NodeAttributes,
12926    ) -> Result<(), fidl::Error> {
12927        let _result = self.send_raw(s, attributes);
12928        self.drop_without_shutdown();
12929        _result
12930    }
12931
12932    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12933        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
12934            (s, attributes),
12935            self.tx_id,
12936            0x78985e216314dafd,
12937            fidl::encoding::DynamicFlags::empty(),
12938        )
12939    }
12940}
12941
12942#[must_use = "FIDL methods require a response to be sent"]
12943#[derive(Debug)]
12944pub struct NodeDeprecatedSetAttrResponder {
12945    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12946    tx_id: u32,
12947}
12948
12949/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12950/// if the responder is dropped without sending a response, so that the client
12951/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12952impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
12953    fn drop(&mut self) {
12954        self.control_handle.shutdown();
12955        // Safety: drops once, never accessed again
12956        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12957    }
12958}
12959
12960impl fdomain_client::fidl::Responder for NodeDeprecatedSetAttrResponder {
12961    type ControlHandle = NodeControlHandle;
12962
12963    fn control_handle(&self) -> &NodeControlHandle {
12964        &self.control_handle
12965    }
12966
12967    fn drop_without_shutdown(mut self) {
12968        // Safety: drops once, never accessed again due to mem::forget
12969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12970        // Prevent Drop from running (which would shut down the channel)
12971        std::mem::forget(self);
12972    }
12973}
12974
12975impl NodeDeprecatedSetAttrResponder {
12976    /// Sends a response to the FIDL transaction.
12977    ///
12978    /// Sets the channel to shutdown if an error occurs.
12979    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12980        let _result = self.send_raw(s);
12981        if _result.is_err() {
12982            self.control_handle.shutdown();
12983        }
12984        self.drop_without_shutdown();
12985        _result
12986    }
12987
12988    /// Similar to "send" but does not shutdown the channel if an error occurs.
12989    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12990        let _result = self.send_raw(s);
12991        self.drop_without_shutdown();
12992        _result
12993    }
12994
12995    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12996        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
12997            (s,),
12998            self.tx_id,
12999            0x4186c0f40d938f46,
13000            fidl::encoding::DynamicFlags::empty(),
13001        )
13002    }
13003}
13004
13005#[must_use = "FIDL methods require a response to be sent"]
13006#[derive(Debug)]
13007pub struct NodeDeprecatedGetFlagsResponder {
13008    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13009    tx_id: u32,
13010}
13011
13012/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13013/// if the responder is dropped without sending a response, so that the client
13014/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13015impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
13016    fn drop(&mut self) {
13017        self.control_handle.shutdown();
13018        // Safety: drops once, never accessed again
13019        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13020    }
13021}
13022
13023impl fdomain_client::fidl::Responder for NodeDeprecatedGetFlagsResponder {
13024    type ControlHandle = NodeControlHandle;
13025
13026    fn control_handle(&self) -> &NodeControlHandle {
13027        &self.control_handle
13028    }
13029
13030    fn drop_without_shutdown(mut self) {
13031        // Safety: drops once, never accessed again due to mem::forget
13032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13033        // Prevent Drop from running (which would shut down the channel)
13034        std::mem::forget(self);
13035    }
13036}
13037
13038impl NodeDeprecatedGetFlagsResponder {
13039    /// Sends a response to the FIDL transaction.
13040    ///
13041    /// Sets the channel to shutdown if an error occurs.
13042    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
13043        let _result = self.send_raw(s, flags);
13044        if _result.is_err() {
13045            self.control_handle.shutdown();
13046        }
13047        self.drop_without_shutdown();
13048        _result
13049    }
13050
13051    /// Similar to "send" but does not shutdown the channel if an error occurs.
13052    pub fn send_no_shutdown_on_err(
13053        self,
13054        mut s: i32,
13055        mut flags: OpenFlags,
13056    ) -> Result<(), fidl::Error> {
13057        let _result = self.send_raw(s, flags);
13058        self.drop_without_shutdown();
13059        _result
13060    }
13061
13062    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
13063        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
13064            (s, flags),
13065            self.tx_id,
13066            0x5b88fffb8eda3aa1,
13067            fidl::encoding::DynamicFlags::empty(),
13068        )
13069    }
13070}
13071
13072#[must_use = "FIDL methods require a response to be sent"]
13073#[derive(Debug)]
13074pub struct NodeDeprecatedSetFlagsResponder {
13075    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13076    tx_id: u32,
13077}
13078
13079/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13080/// if the responder is dropped without sending a response, so that the client
13081/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13082impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
13083    fn drop(&mut self) {
13084        self.control_handle.shutdown();
13085        // Safety: drops once, never accessed again
13086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13087    }
13088}
13089
13090impl fdomain_client::fidl::Responder for NodeDeprecatedSetFlagsResponder {
13091    type ControlHandle = NodeControlHandle;
13092
13093    fn control_handle(&self) -> &NodeControlHandle {
13094        &self.control_handle
13095    }
13096
13097    fn drop_without_shutdown(mut self) {
13098        // Safety: drops once, never accessed again due to mem::forget
13099        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13100        // Prevent Drop from running (which would shut down the channel)
13101        std::mem::forget(self);
13102    }
13103}
13104
13105impl NodeDeprecatedSetFlagsResponder {
13106    /// Sends a response to the FIDL transaction.
13107    ///
13108    /// Sets the channel to shutdown if an error occurs.
13109    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
13110        let _result = self.send_raw(s);
13111        if _result.is_err() {
13112            self.control_handle.shutdown();
13113        }
13114        self.drop_without_shutdown();
13115        _result
13116    }
13117
13118    /// Similar to "send" but does not shutdown the channel if an error occurs.
13119    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
13120        let _result = self.send_raw(s);
13121        self.drop_without_shutdown();
13122        _result
13123    }
13124
13125    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
13126        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
13127            (s,),
13128            self.tx_id,
13129            0x5295b76c71fde733,
13130            fidl::encoding::DynamicFlags::empty(),
13131        )
13132    }
13133}
13134
13135#[must_use = "FIDL methods require a response to be sent"]
13136#[derive(Debug)]
13137pub struct NodeGetFlagsResponder {
13138    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13139    tx_id: u32,
13140}
13141
13142/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13143/// if the responder is dropped without sending a response, so that the client
13144/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13145impl std::ops::Drop for NodeGetFlagsResponder {
13146    fn drop(&mut self) {
13147        self.control_handle.shutdown();
13148        // Safety: drops once, never accessed again
13149        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13150    }
13151}
13152
13153impl fdomain_client::fidl::Responder for NodeGetFlagsResponder {
13154    type ControlHandle = NodeControlHandle;
13155
13156    fn control_handle(&self) -> &NodeControlHandle {
13157        &self.control_handle
13158    }
13159
13160    fn drop_without_shutdown(mut self) {
13161        // Safety: drops once, never accessed again due to mem::forget
13162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13163        // Prevent Drop from running (which would shut down the channel)
13164        std::mem::forget(self);
13165    }
13166}
13167
13168impl NodeGetFlagsResponder {
13169    /// Sends a response to the FIDL transaction.
13170    ///
13171    /// Sets the channel to shutdown if an error occurs.
13172    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
13173        let _result = self.send_raw(result);
13174        if _result.is_err() {
13175            self.control_handle.shutdown();
13176        }
13177        self.drop_without_shutdown();
13178        _result
13179    }
13180
13181    /// Similar to "send" but does not shutdown the channel if an error occurs.
13182    pub fn send_no_shutdown_on_err(
13183        self,
13184        mut result: Result<Flags, i32>,
13185    ) -> Result<(), fidl::Error> {
13186        let _result = self.send_raw(result);
13187        self.drop_without_shutdown();
13188        _result
13189    }
13190
13191    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
13192        self.control_handle
13193            .inner
13194            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
13195                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
13196                self.tx_id,
13197                0x176eb318f64ec23,
13198                fidl::encoding::DynamicFlags::FLEXIBLE,
13199            )
13200    }
13201}
13202
13203#[must_use = "FIDL methods require a response to be sent"]
13204#[derive(Debug)]
13205pub struct NodeSetFlagsResponder {
13206    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13207    tx_id: u32,
13208}
13209
13210/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13211/// if the responder is dropped without sending a response, so that the client
13212/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13213impl std::ops::Drop for NodeSetFlagsResponder {
13214    fn drop(&mut self) {
13215        self.control_handle.shutdown();
13216        // Safety: drops once, never accessed again
13217        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13218    }
13219}
13220
13221impl fdomain_client::fidl::Responder for NodeSetFlagsResponder {
13222    type ControlHandle = NodeControlHandle;
13223
13224    fn control_handle(&self) -> &NodeControlHandle {
13225        &self.control_handle
13226    }
13227
13228    fn drop_without_shutdown(mut self) {
13229        // Safety: drops once, never accessed again due to mem::forget
13230        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13231        // Prevent Drop from running (which would shut down the channel)
13232        std::mem::forget(self);
13233    }
13234}
13235
13236impl NodeSetFlagsResponder {
13237    /// Sends a response to the FIDL transaction.
13238    ///
13239    /// Sets the channel to shutdown if an error occurs.
13240    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13241        let _result = self.send_raw(result);
13242        if _result.is_err() {
13243            self.control_handle.shutdown();
13244        }
13245        self.drop_without_shutdown();
13246        _result
13247    }
13248
13249    /// Similar to "send" but does not shutdown the channel if an error occurs.
13250    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13251        let _result = self.send_raw(result);
13252        self.drop_without_shutdown();
13253        _result
13254    }
13255
13256    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13257        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
13258            fidl::encoding::EmptyStruct,
13259            i32,
13260        >>(
13261            fidl::encoding::FlexibleResult::new(result),
13262            self.tx_id,
13263            0x55a8028685791ea8,
13264            fidl::encoding::DynamicFlags::FLEXIBLE,
13265        )
13266    }
13267}
13268
13269#[must_use = "FIDL methods require a response to be sent"]
13270#[derive(Debug)]
13271pub struct NodeQueryFilesystemResponder {
13272    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13273    tx_id: u32,
13274}
13275
13276/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13277/// if the responder is dropped without sending a response, so that the client
13278/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13279impl std::ops::Drop for NodeQueryFilesystemResponder {
13280    fn drop(&mut self) {
13281        self.control_handle.shutdown();
13282        // Safety: drops once, never accessed again
13283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13284    }
13285}
13286
13287impl fdomain_client::fidl::Responder for NodeQueryFilesystemResponder {
13288    type ControlHandle = NodeControlHandle;
13289
13290    fn control_handle(&self) -> &NodeControlHandle {
13291        &self.control_handle
13292    }
13293
13294    fn drop_without_shutdown(mut self) {
13295        // Safety: drops once, never accessed again due to mem::forget
13296        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13297        // Prevent Drop from running (which would shut down the channel)
13298        std::mem::forget(self);
13299    }
13300}
13301
13302impl NodeQueryFilesystemResponder {
13303    /// Sends a response to the FIDL transaction.
13304    ///
13305    /// Sets the channel to shutdown if an error occurs.
13306    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13307        let _result = self.send_raw(s, info);
13308        if _result.is_err() {
13309            self.control_handle.shutdown();
13310        }
13311        self.drop_without_shutdown();
13312        _result
13313    }
13314
13315    /// Similar to "send" but does not shutdown the channel if an error occurs.
13316    pub fn send_no_shutdown_on_err(
13317        self,
13318        mut s: i32,
13319        mut info: Option<&FilesystemInfo>,
13320    ) -> Result<(), fidl::Error> {
13321        let _result = self.send_raw(s, info);
13322        self.drop_without_shutdown();
13323        _result
13324    }
13325
13326    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13327        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
13328            (s, info),
13329            self.tx_id,
13330            0x6f344a1c6b0a0610,
13331            fidl::encoding::DynamicFlags::empty(),
13332        )
13333    }
13334}
13335
13336#[must_use = "FIDL methods require a response to be sent"]
13337#[derive(Debug)]
13338pub struct NodeGetTokenResponder {
13339    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13340    tx_id: u32,
13341}
13342
13343/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13344/// if the responder is dropped without sending a response, so that the client
13345/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13346impl std::ops::Drop for NodeGetTokenResponder {
13347    fn drop(&mut self) {
13348        self.control_handle.shutdown();
13349        // Safety: drops once, never accessed again
13350        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13351    }
13352}
13353
13354impl fdomain_client::fidl::Responder for NodeGetTokenResponder {
13355    type ControlHandle = NodeControlHandle;
13356
13357    fn control_handle(&self) -> &NodeControlHandle {
13358        &self.control_handle
13359    }
13360
13361    fn drop_without_shutdown(mut self) {
13362        // Safety: drops once, never accessed again due to mem::forget
13363        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13364        // Prevent Drop from running (which would shut down the channel)
13365        std::mem::forget(self);
13366    }
13367}
13368
13369impl NodeGetTokenResponder {
13370    /// Sends a response to the FIDL transaction.
13371    ///
13372    /// Sets the channel to shutdown if an error occurs.
13373    pub fn send(self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
13374        let _result = self.send_raw(result);
13375        if _result.is_err() {
13376            self.control_handle.shutdown();
13377        }
13378        self.drop_without_shutdown();
13379        _result
13380    }
13381
13382    /// Similar to "send" but does not shutdown the channel if an error occurs.
13383    pub fn send_no_shutdown_on_err(
13384        self,
13385        mut result: Result<fdomain_client::Event, i32>,
13386    ) -> Result<(), fidl::Error> {
13387        let _result = self.send_raw(result);
13388        self.drop_without_shutdown();
13389        _result
13390    }
13391
13392    fn send_raw(&self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
13393        self.control_handle
13394            .inner
13395            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
13396                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
13397                self.tx_id,
13398                0x5054f0ade7076cec,
13399                fidl::encoding::DynamicFlags::FLEXIBLE,
13400            )
13401    }
13402}
13403
13404#[must_use = "FIDL methods require a response to be sent"]
13405#[derive(Debug)]
13406pub struct NodeGetAttributesResponder {
13407    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13408    tx_id: u32,
13409}
13410
13411/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13412/// if the responder is dropped without sending a response, so that the client
13413/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13414impl std::ops::Drop for NodeGetAttributesResponder {
13415    fn drop(&mut self) {
13416        self.control_handle.shutdown();
13417        // Safety: drops once, never accessed again
13418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13419    }
13420}
13421
13422impl fdomain_client::fidl::Responder for NodeGetAttributesResponder {
13423    type ControlHandle = NodeControlHandle;
13424
13425    fn control_handle(&self) -> &NodeControlHandle {
13426        &self.control_handle
13427    }
13428
13429    fn drop_without_shutdown(mut self) {
13430        // Safety: drops once, never accessed again due to mem::forget
13431        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13432        // Prevent Drop from running (which would shut down the channel)
13433        std::mem::forget(self);
13434    }
13435}
13436
13437impl NodeGetAttributesResponder {
13438    /// Sends a response to the FIDL transaction.
13439    ///
13440    /// Sets the channel to shutdown if an error occurs.
13441    pub fn send(
13442        self,
13443        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13444    ) -> Result<(), fidl::Error> {
13445        let _result = self.send_raw(result);
13446        if _result.is_err() {
13447            self.control_handle.shutdown();
13448        }
13449        self.drop_without_shutdown();
13450        _result
13451    }
13452
13453    /// Similar to "send" but does not shutdown the channel if an error occurs.
13454    pub fn send_no_shutdown_on_err(
13455        self,
13456        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13457    ) -> Result<(), fidl::Error> {
13458        let _result = self.send_raw(result);
13459        self.drop_without_shutdown();
13460        _result
13461    }
13462
13463    fn send_raw(
13464        &self,
13465        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13466    ) -> Result<(), fidl::Error> {
13467        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
13468            result,
13469            self.tx_id,
13470            0x3d4396a638ea053b,
13471            fidl::encoding::DynamicFlags::empty(),
13472        )
13473    }
13474}
13475
13476#[must_use = "FIDL methods require a response to be sent"]
13477#[derive(Debug)]
13478pub struct NodeUpdateAttributesResponder {
13479    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13480    tx_id: u32,
13481}
13482
13483/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13484/// if the responder is dropped without sending a response, so that the client
13485/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13486impl std::ops::Drop for NodeUpdateAttributesResponder {
13487    fn drop(&mut self) {
13488        self.control_handle.shutdown();
13489        // Safety: drops once, never accessed again
13490        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13491    }
13492}
13493
13494impl fdomain_client::fidl::Responder for NodeUpdateAttributesResponder {
13495    type ControlHandle = NodeControlHandle;
13496
13497    fn control_handle(&self) -> &NodeControlHandle {
13498        &self.control_handle
13499    }
13500
13501    fn drop_without_shutdown(mut self) {
13502        // Safety: drops once, never accessed again due to mem::forget
13503        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13504        // Prevent Drop from running (which would shut down the channel)
13505        std::mem::forget(self);
13506    }
13507}
13508
13509impl NodeUpdateAttributesResponder {
13510    /// Sends a response to the FIDL transaction.
13511    ///
13512    /// Sets the channel to shutdown if an error occurs.
13513    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13514        let _result = self.send_raw(result);
13515        if _result.is_err() {
13516            self.control_handle.shutdown();
13517        }
13518        self.drop_without_shutdown();
13519        _result
13520    }
13521
13522    /// Similar to "send" but does not shutdown the channel if an error occurs.
13523    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13524        let _result = self.send_raw(result);
13525        self.drop_without_shutdown();
13526        _result
13527    }
13528
13529    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13530        self.control_handle
13531            .inner
13532            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13533                result,
13534                self.tx_id,
13535                0x3308c1da5a89bf08,
13536                fidl::encoding::DynamicFlags::empty(),
13537            )
13538    }
13539}
13540
13541#[must_use = "FIDL methods require a response to be sent"]
13542#[derive(Debug)]
13543pub struct NodeSyncResponder {
13544    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13545    tx_id: u32,
13546}
13547
13548/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13549/// if the responder is dropped without sending a response, so that the client
13550/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13551impl std::ops::Drop for NodeSyncResponder {
13552    fn drop(&mut self) {
13553        self.control_handle.shutdown();
13554        // Safety: drops once, never accessed again
13555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13556    }
13557}
13558
13559impl fdomain_client::fidl::Responder for NodeSyncResponder {
13560    type ControlHandle = NodeControlHandle;
13561
13562    fn control_handle(&self) -> &NodeControlHandle {
13563        &self.control_handle
13564    }
13565
13566    fn drop_without_shutdown(mut self) {
13567        // Safety: drops once, never accessed again due to mem::forget
13568        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13569        // Prevent Drop from running (which would shut down the channel)
13570        std::mem::forget(self);
13571    }
13572}
13573
13574impl NodeSyncResponder {
13575    /// Sends a response to the FIDL transaction.
13576    ///
13577    /// Sets the channel to shutdown if an error occurs.
13578    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13579        let _result = self.send_raw(result);
13580        if _result.is_err() {
13581            self.control_handle.shutdown();
13582        }
13583        self.drop_without_shutdown();
13584        _result
13585    }
13586
13587    /// Similar to "send" but does not shutdown the channel if an error occurs.
13588    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13589        let _result = self.send_raw(result);
13590        self.drop_without_shutdown();
13591        _result
13592    }
13593
13594    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13595        self.control_handle
13596            .inner
13597            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13598                result,
13599                self.tx_id,
13600                0x2c5c27ca0ab5dc49,
13601                fidl::encoding::DynamicFlags::empty(),
13602            )
13603    }
13604}
13605
13606#[must_use = "FIDL methods require a response to be sent"]
13607#[derive(Debug)]
13608pub struct NodeGetExtendedAttributeResponder {
13609    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13610    tx_id: u32,
13611}
13612
13613/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13614/// if the responder is dropped without sending a response, so that the client
13615/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13616impl std::ops::Drop for NodeGetExtendedAttributeResponder {
13617    fn drop(&mut self) {
13618        self.control_handle.shutdown();
13619        // Safety: drops once, never accessed again
13620        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13621    }
13622}
13623
13624impl fdomain_client::fidl::Responder for NodeGetExtendedAttributeResponder {
13625    type ControlHandle = NodeControlHandle;
13626
13627    fn control_handle(&self) -> &NodeControlHandle {
13628        &self.control_handle
13629    }
13630
13631    fn drop_without_shutdown(mut self) {
13632        // Safety: drops once, never accessed again due to mem::forget
13633        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13634        // Prevent Drop from running (which would shut down the channel)
13635        std::mem::forget(self);
13636    }
13637}
13638
13639impl NodeGetExtendedAttributeResponder {
13640    /// Sends a response to the FIDL transaction.
13641    ///
13642    /// Sets the channel to shutdown if an error occurs.
13643    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13644        let _result = self.send_raw(result);
13645        if _result.is_err() {
13646            self.control_handle.shutdown();
13647        }
13648        self.drop_without_shutdown();
13649        _result
13650    }
13651
13652    /// Similar to "send" but does not shutdown the channel if an error occurs.
13653    pub fn send_no_shutdown_on_err(
13654        self,
13655        mut result: Result<ExtendedAttributeValue, i32>,
13656    ) -> Result<(), fidl::Error> {
13657        let _result = self.send_raw(result);
13658        self.drop_without_shutdown();
13659        _result
13660    }
13661
13662    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13663        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
13664            result.as_mut().map_err(|e| *e),
13665            self.tx_id,
13666            0x45ffa3ccfdeb76db,
13667            fidl::encoding::DynamicFlags::empty(),
13668        )
13669    }
13670}
13671
13672#[must_use = "FIDL methods require a response to be sent"]
13673#[derive(Debug)]
13674pub struct NodeSetExtendedAttributeResponder {
13675    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13676    tx_id: u32,
13677}
13678
13679/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13680/// if the responder is dropped without sending a response, so that the client
13681/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13682impl std::ops::Drop for NodeSetExtendedAttributeResponder {
13683    fn drop(&mut self) {
13684        self.control_handle.shutdown();
13685        // Safety: drops once, never accessed again
13686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13687    }
13688}
13689
13690impl fdomain_client::fidl::Responder for NodeSetExtendedAttributeResponder {
13691    type ControlHandle = NodeControlHandle;
13692
13693    fn control_handle(&self) -> &NodeControlHandle {
13694        &self.control_handle
13695    }
13696
13697    fn drop_without_shutdown(mut self) {
13698        // Safety: drops once, never accessed again due to mem::forget
13699        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13700        // Prevent Drop from running (which would shut down the channel)
13701        std::mem::forget(self);
13702    }
13703}
13704
13705impl NodeSetExtendedAttributeResponder {
13706    /// Sends a response to the FIDL transaction.
13707    ///
13708    /// Sets the channel to shutdown if an error occurs.
13709    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13710        let _result = self.send_raw(result);
13711        if _result.is_err() {
13712            self.control_handle.shutdown();
13713        }
13714        self.drop_without_shutdown();
13715        _result
13716    }
13717
13718    /// Similar to "send" but does not shutdown the channel if an error occurs.
13719    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13720        let _result = self.send_raw(result);
13721        self.drop_without_shutdown();
13722        _result
13723    }
13724
13725    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13726        self.control_handle
13727            .inner
13728            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13729                result,
13730                self.tx_id,
13731                0x4a951362f681f23c,
13732                fidl::encoding::DynamicFlags::empty(),
13733            )
13734    }
13735}
13736
13737#[must_use = "FIDL methods require a response to be sent"]
13738#[derive(Debug)]
13739pub struct NodeRemoveExtendedAttributeResponder {
13740    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13741    tx_id: u32,
13742}
13743
13744/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13745/// if the responder is dropped without sending a response, so that the client
13746/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13747impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
13748    fn drop(&mut self) {
13749        self.control_handle.shutdown();
13750        // Safety: drops once, never accessed again
13751        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13752    }
13753}
13754
13755impl fdomain_client::fidl::Responder for NodeRemoveExtendedAttributeResponder {
13756    type ControlHandle = NodeControlHandle;
13757
13758    fn control_handle(&self) -> &NodeControlHandle {
13759        &self.control_handle
13760    }
13761
13762    fn drop_without_shutdown(mut self) {
13763        // Safety: drops once, never accessed again due to mem::forget
13764        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13765        // Prevent Drop from running (which would shut down the channel)
13766        std::mem::forget(self);
13767    }
13768}
13769
13770impl NodeRemoveExtendedAttributeResponder {
13771    /// Sends a response to the FIDL transaction.
13772    ///
13773    /// Sets the channel to shutdown if an error occurs.
13774    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13775        let _result = self.send_raw(result);
13776        if _result.is_err() {
13777            self.control_handle.shutdown();
13778        }
13779        self.drop_without_shutdown();
13780        _result
13781    }
13782
13783    /// Similar to "send" but does not shutdown the channel if an error occurs.
13784    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13785        let _result = self.send_raw(result);
13786        self.drop_without_shutdown();
13787        _result
13788    }
13789
13790    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13791        self.control_handle
13792            .inner
13793            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13794                result,
13795                self.tx_id,
13796                0x7a0b9f3a9bf9032d,
13797                fidl::encoding::DynamicFlags::empty(),
13798            )
13799    }
13800}
13801
13802#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13803pub struct OpenableMarker;
13804
13805impl fdomain_client::fidl::ProtocolMarker for OpenableMarker {
13806    type Proxy = OpenableProxy;
13807    type RequestStream = OpenableRequestStream;
13808
13809    const DEBUG_NAME: &'static str = "(anonymous) Openable";
13810}
13811
13812pub trait OpenableProxyInterface: Send + Sync {
13813    fn r#open(
13814        &self,
13815        path: &str,
13816        flags: Flags,
13817        options: &Options,
13818        object: fdomain_client::Channel,
13819    ) -> Result<(), fidl::Error>;
13820}
13821
13822#[derive(Debug, Clone)]
13823pub struct OpenableProxy {
13824    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13825}
13826
13827impl fdomain_client::fidl::Proxy for OpenableProxy {
13828    type Protocol = OpenableMarker;
13829
13830    fn from_channel(inner: fdomain_client::Channel) -> Self {
13831        Self::new(inner)
13832    }
13833
13834    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13835        self.client.into_channel().map_err(|client| Self { client })
13836    }
13837
13838    fn as_channel(&self) -> &fdomain_client::Channel {
13839        self.client.as_channel()
13840    }
13841}
13842
13843impl OpenableProxy {
13844    /// Create a new Proxy for fuchsia.io/Openable.
13845    pub fn new(channel: fdomain_client::Channel) -> Self {
13846        let protocol_name = <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13847        Self { client: fidl::client::Client::new(channel, protocol_name) }
13848    }
13849
13850    /// Get a Stream of events from the remote end of the protocol.
13851    ///
13852    /// # Panics
13853    ///
13854    /// Panics if the event stream was already taken.
13855    pub fn take_event_stream(&self) -> OpenableEventStream {
13856        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
13857    }
13858
13859    /// Open (or create) a node relative to this directory. Any errors are communicated via an
13860    /// epitaph sent on the `object` channel.
13861    ///
13862    /// Errors:
13863    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
13864    /// * See [`Flags`] for other errors which may be communicated based on `flags`
13865    pub fn r#open(
13866        &self,
13867        mut path: &str,
13868        mut flags: Flags,
13869        mut options: &Options,
13870        mut object: fdomain_client::Channel,
13871    ) -> Result<(), fidl::Error> {
13872        OpenableProxyInterface::r#open(self, path, flags, options, object)
13873    }
13874}
13875
13876impl OpenableProxyInterface for OpenableProxy {
13877    fn r#open(
13878        &self,
13879        mut path: &str,
13880        mut flags: Flags,
13881        mut options: &Options,
13882        mut object: fdomain_client::Channel,
13883    ) -> Result<(), fidl::Error> {
13884        self.client.send::<OpenableOpenRequest>(
13885            (path, flags, options, object),
13886            0x568ddcb9a9cbb6d9,
13887            fidl::encoding::DynamicFlags::FLEXIBLE,
13888        )
13889    }
13890}
13891
13892pub struct OpenableEventStream {
13893    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
13894}
13895
13896impl std::marker::Unpin for OpenableEventStream {}
13897
13898impl futures::stream::FusedStream for OpenableEventStream {
13899    fn is_terminated(&self) -> bool {
13900        self.event_receiver.is_terminated()
13901    }
13902}
13903
13904impl futures::Stream for OpenableEventStream {
13905    type Item = Result<OpenableEvent, fidl::Error>;
13906
13907    fn poll_next(
13908        mut self: std::pin::Pin<&mut Self>,
13909        cx: &mut std::task::Context<'_>,
13910    ) -> std::task::Poll<Option<Self::Item>> {
13911        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13912            &mut self.event_receiver,
13913            cx
13914        )?) {
13915            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
13916            None => std::task::Poll::Ready(None),
13917        }
13918    }
13919}
13920
13921#[derive(Debug)]
13922pub enum OpenableEvent {
13923    #[non_exhaustive]
13924    _UnknownEvent {
13925        /// Ordinal of the event that was sent.
13926        ordinal: u64,
13927    },
13928}
13929
13930impl OpenableEvent {
13931    /// Decodes a message buffer as a [`OpenableEvent`].
13932    fn decode(
13933        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13934    ) -> Result<OpenableEvent, fidl::Error> {
13935        let (bytes, _handles) = buf.split_mut();
13936        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13937        debug_assert_eq!(tx_header.tx_id, 0);
13938        match tx_header.ordinal {
13939            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13940                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
13941            }
13942            _ => Err(fidl::Error::UnknownOrdinal {
13943                ordinal: tx_header.ordinal,
13944                protocol_name: <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13945            }),
13946        }
13947    }
13948}
13949
13950/// A Stream of incoming requests for fuchsia.io/Openable.
13951pub struct OpenableRequestStream {
13952    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13953    is_terminated: bool,
13954}
13955
13956impl std::marker::Unpin for OpenableRequestStream {}
13957
13958impl futures::stream::FusedStream for OpenableRequestStream {
13959    fn is_terminated(&self) -> bool {
13960        self.is_terminated
13961    }
13962}
13963
13964impl fdomain_client::fidl::RequestStream for OpenableRequestStream {
13965    type Protocol = OpenableMarker;
13966    type ControlHandle = OpenableControlHandle;
13967
13968    fn from_channel(channel: fdomain_client::Channel) -> Self {
13969        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13970    }
13971
13972    fn control_handle(&self) -> Self::ControlHandle {
13973        OpenableControlHandle { inner: self.inner.clone() }
13974    }
13975
13976    fn into_inner(
13977        self,
13978    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
13979    {
13980        (self.inner, self.is_terminated)
13981    }
13982
13983    fn from_inner(
13984        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13985        is_terminated: bool,
13986    ) -> Self {
13987        Self { inner, is_terminated }
13988    }
13989}
13990
13991impl futures::Stream for OpenableRequestStream {
13992    type Item = Result<OpenableRequest, fidl::Error>;
13993
13994    fn poll_next(
13995        mut self: std::pin::Pin<&mut Self>,
13996        cx: &mut std::task::Context<'_>,
13997    ) -> std::task::Poll<Option<Self::Item>> {
13998        let this = &mut *self;
13999        if this.inner.check_shutdown(cx) {
14000            this.is_terminated = true;
14001            return std::task::Poll::Ready(None);
14002        }
14003        if this.is_terminated {
14004            panic!("polled OpenableRequestStream after completion");
14005        }
14006        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14007            |bytes, handles| {
14008                match this.inner.channel().read_etc(cx, bytes, handles) {
14009                    std::task::Poll::Ready(Ok(())) => {}
14010                    std::task::Poll::Pending => return std::task::Poll::Pending,
14011                    std::task::Poll::Ready(Err(None)) => {
14012                        this.is_terminated = true;
14013                        return std::task::Poll::Ready(None);
14014                    }
14015                    std::task::Poll::Ready(Err(Some(e))) => {
14016                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14017                            e.into(),
14018                        ))));
14019                    }
14020                }
14021
14022                // A message has been received from the channel
14023                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14024
14025                std::task::Poll::Ready(Some(match header.ordinal {
14026                    0x568ddcb9a9cbb6d9 => {
14027                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14028                        let mut req = fidl::new_empty!(
14029                            OpenableOpenRequest,
14030                            fdomain_client::fidl::FDomainResourceDialect
14031                        );
14032                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
14033                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
14034                        Ok(OpenableRequest::Open {
14035                            path: req.path,
14036                            flags: req.flags,
14037                            options: req.options,
14038                            object: req.object,
14039
14040                            control_handle,
14041                        })
14042                    }
14043                    _ if header.tx_id == 0
14044                        && header
14045                            .dynamic_flags()
14046                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14047                    {
14048                        Ok(OpenableRequest::_UnknownMethod {
14049                            ordinal: header.ordinal,
14050                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
14051                            method_type: fidl::MethodType::OneWay,
14052                        })
14053                    }
14054                    _ if header
14055                        .dynamic_flags()
14056                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14057                    {
14058                        this.inner.send_framework_err(
14059                            fidl::encoding::FrameworkErr::UnknownMethod,
14060                            header.tx_id,
14061                            header.ordinal,
14062                            header.dynamic_flags(),
14063                            (bytes, handles),
14064                        )?;
14065                        Ok(OpenableRequest::_UnknownMethod {
14066                            ordinal: header.ordinal,
14067                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
14068                            method_type: fidl::MethodType::TwoWay,
14069                        })
14070                    }
14071                    _ => Err(fidl::Error::UnknownOrdinal {
14072                        ordinal: header.ordinal,
14073                        protocol_name:
14074                            <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14075                    }),
14076                }))
14077            },
14078        )
14079    }
14080}
14081
14082/// Openable defines a node which is capable of opening other objects.
14083#[derive(Debug)]
14084pub enum OpenableRequest {
14085    /// Open (or create) a node relative to this directory. Any errors are communicated via an
14086    /// epitaph sent on the `object` channel.
14087    ///
14088    /// Errors:
14089    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
14090    /// * See [`Flags`] for other errors which may be communicated based on `flags`
14091    Open {
14092        path: String,
14093        flags: Flags,
14094        options: Options,
14095        object: fdomain_client::Channel,
14096        control_handle: OpenableControlHandle,
14097    },
14098    /// An interaction was received which does not match any known method.
14099    #[non_exhaustive]
14100    _UnknownMethod {
14101        /// Ordinal of the method that was called.
14102        ordinal: u64,
14103        control_handle: OpenableControlHandle,
14104        method_type: fidl::MethodType,
14105    },
14106}
14107
14108impl OpenableRequest {
14109    #[allow(irrefutable_let_patterns)]
14110    pub fn into_open(
14111        self,
14112    ) -> Option<(String, Flags, Options, fdomain_client::Channel, OpenableControlHandle)> {
14113        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
14114            Some((path, flags, options, object, control_handle))
14115        } else {
14116            None
14117        }
14118    }
14119
14120    /// Name of the method defined in FIDL
14121    pub fn method_name(&self) -> &'static str {
14122        match *self {
14123            OpenableRequest::Open { .. } => "open",
14124            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14125                "unknown one-way method"
14126            }
14127            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14128                "unknown two-way method"
14129            }
14130        }
14131    }
14132}
14133
14134#[derive(Debug, Clone)]
14135pub struct OpenableControlHandle {
14136    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14137}
14138
14139impl OpenableControlHandle {
14140    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
14141        self.inner.shutdown_with_epitaph(status.into())
14142    }
14143}
14144
14145impl fdomain_client::fidl::ControlHandle for OpenableControlHandle {
14146    fn shutdown(&self) {
14147        self.inner.shutdown()
14148    }
14149
14150    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
14151        self.inner.shutdown_with_epitaph(status)
14152    }
14153
14154    fn is_closed(&self) -> bool {
14155        self.inner.channel().is_closed()
14156    }
14157    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
14158        self.inner.channel().on_closed()
14159    }
14160}
14161
14162impl OpenableControlHandle {}
14163
14164#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
14165pub struct ReadableMarker;
14166
14167impl fdomain_client::fidl::ProtocolMarker for ReadableMarker {
14168    type Proxy = ReadableProxy;
14169    type RequestStream = ReadableRequestStream;
14170
14171    const DEBUG_NAME: &'static str = "(anonymous) Readable";
14172}
14173pub type ReadableReadResult = Result<Vec<u8>, i32>;
14174
14175pub trait ReadableProxyInterface: Send + Sync {
14176    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
14177        + Send;
14178    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
14179}
14180
14181#[derive(Debug, Clone)]
14182pub struct ReadableProxy {
14183    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
14184}
14185
14186impl fdomain_client::fidl::Proxy for ReadableProxy {
14187    type Protocol = ReadableMarker;
14188
14189    fn from_channel(inner: fdomain_client::Channel) -> Self {
14190        Self::new(inner)
14191    }
14192
14193    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
14194        self.client.into_channel().map_err(|client| Self { client })
14195    }
14196
14197    fn as_channel(&self) -> &fdomain_client::Channel {
14198        self.client.as_channel()
14199    }
14200}
14201
14202impl ReadableProxy {
14203    /// Create a new Proxy for fuchsia.io/Readable.
14204    pub fn new(channel: fdomain_client::Channel) -> Self {
14205        let protocol_name = <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
14206        Self { client: fidl::client::Client::new(channel, protocol_name) }
14207    }
14208
14209    /// Get a Stream of events from the remote end of the protocol.
14210    ///
14211    /// # Panics
14212    ///
14213    /// Panics if the event stream was already taken.
14214    pub fn take_event_stream(&self) -> ReadableEventStream {
14215        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
14216    }
14217
14218    /// Reads up to 'count' bytes at the seek offset.
14219    /// The seek offset is moved forward by the number of bytes read.
14220    ///
14221    /// ## Invariants
14222    ///
14223    /// * The returned `data.length` will never be greater than `count`.
14224    /// * If `data.length` is less than `count`, it means that the seek offset
14225    ///   has reached the end of file as part of this operation.
14226    /// * If `data.length` is zero while `count` is not, it means that the
14227    ///   seek offset is already at or beyond the end of file, and no data could
14228    ///   be read.
14229    /// * If `count` is zero, the server should perform all the checks ensuring
14230    ///   read access without actually read anything, and return an empty
14231    ///   `data` vector.
14232    ///
14233    /// This method requires the [`Rights.READ_BYTES`] right.
14234    ///
14235    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
14236    pub fn r#read(
14237        &self,
14238        mut count: u64,
14239    ) -> fidl::client::QueryResponseFut<
14240        ReadableReadResult,
14241        fdomain_client::fidl::FDomainResourceDialect,
14242    > {
14243        ReadableProxyInterface::r#read(self, count)
14244    }
14245}
14246
14247impl ReadableProxyInterface for ReadableProxy {
14248    type ReadResponseFut = fidl::client::QueryResponseFut<
14249        ReadableReadResult,
14250        fdomain_client::fidl::FDomainResourceDialect,
14251    >;
14252    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
14253        fn _decode(
14254            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14255        ) -> Result<ReadableReadResult, fidl::Error> {
14256            let _response = fidl::client::decode_transaction_body::<
14257                fidl::encoding::ResultType<ReadableReadResponse, i32>,
14258                fdomain_client::fidl::FDomainResourceDialect,
14259                0x57e419a298c8ede,
14260            >(_buf?)?;
14261            Ok(_response.map(|x| x.data))
14262        }
14263        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
14264            (count,),
14265            0x57e419a298c8ede,
14266            fidl::encoding::DynamicFlags::empty(),
14267            _decode,
14268        )
14269    }
14270}
14271
14272pub struct ReadableEventStream {
14273    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
14274}
14275
14276impl std::marker::Unpin for ReadableEventStream {}
14277
14278impl futures::stream::FusedStream for ReadableEventStream {
14279    fn is_terminated(&self) -> bool {
14280        self.event_receiver.is_terminated()
14281    }
14282}
14283
14284impl futures::Stream for ReadableEventStream {
14285    type Item = Result<ReadableEvent, fidl::Error>;
14286
14287    fn poll_next(
14288        mut self: std::pin::Pin<&mut Self>,
14289        cx: &mut std::task::Context<'_>,
14290    ) -> std::task::Poll<Option<Self::Item>> {
14291        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14292            &mut self.event_receiver,
14293            cx
14294        )?) {
14295            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
14296            None => std::task::Poll::Ready(None),
14297        }
14298    }
14299}
14300
14301#[derive(Debug)]
14302pub enum ReadableEvent {}
14303
14304impl ReadableEvent {
14305    /// Decodes a message buffer as a [`ReadableEvent`].
14306    fn decode(
14307        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14308    ) -> Result<ReadableEvent, fidl::Error> {
14309        let (bytes, _handles) = buf.split_mut();
14310        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14311        debug_assert_eq!(tx_header.tx_id, 0);
14312        match tx_header.ordinal {
14313            _ => Err(fidl::Error::UnknownOrdinal {
14314                ordinal: tx_header.ordinal,
14315                protocol_name: <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14316            }),
14317        }
14318    }
14319}
14320
14321/// A Stream of incoming requests for fuchsia.io/Readable.
14322pub struct ReadableRequestStream {
14323    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14324    is_terminated: bool,
14325}
14326
14327impl std::marker::Unpin for ReadableRequestStream {}
14328
14329impl futures::stream::FusedStream for ReadableRequestStream {
14330    fn is_terminated(&self) -> bool {
14331        self.is_terminated
14332    }
14333}
14334
14335impl fdomain_client::fidl::RequestStream for ReadableRequestStream {
14336    type Protocol = ReadableMarker;
14337    type ControlHandle = ReadableControlHandle;
14338
14339    fn from_channel(channel: fdomain_client::Channel) -> Self {
14340        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14341    }
14342
14343    fn control_handle(&self) -> Self::ControlHandle {
14344        ReadableControlHandle { inner: self.inner.clone() }
14345    }
14346
14347    fn into_inner(
14348        self,
14349    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
14350    {
14351        (self.inner, self.is_terminated)
14352    }
14353
14354    fn from_inner(
14355        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14356        is_terminated: bool,
14357    ) -> Self {
14358        Self { inner, is_terminated }
14359    }
14360}
14361
14362impl futures::Stream for ReadableRequestStream {
14363    type Item = Result<ReadableRequest, fidl::Error>;
14364
14365    fn poll_next(
14366        mut self: std::pin::Pin<&mut Self>,
14367        cx: &mut std::task::Context<'_>,
14368    ) -> std::task::Poll<Option<Self::Item>> {
14369        let this = &mut *self;
14370        if this.inner.check_shutdown(cx) {
14371            this.is_terminated = true;
14372            return std::task::Poll::Ready(None);
14373        }
14374        if this.is_terminated {
14375            panic!("polled ReadableRequestStream after completion");
14376        }
14377        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14378            |bytes, handles| {
14379                match this.inner.channel().read_etc(cx, bytes, handles) {
14380                    std::task::Poll::Ready(Ok(())) => {}
14381                    std::task::Poll::Pending => return std::task::Poll::Pending,
14382                    std::task::Poll::Ready(Err(None)) => {
14383                        this.is_terminated = true;
14384                        return std::task::Poll::Ready(None);
14385                    }
14386                    std::task::Poll::Ready(Err(Some(e))) => {
14387                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14388                            e.into(),
14389                        ))));
14390                    }
14391                }
14392
14393                // A message has been received from the channel
14394                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14395
14396                std::task::Poll::Ready(Some(match header.ordinal {
14397                    0x57e419a298c8ede => {
14398                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14399                        let mut req = fidl::new_empty!(
14400                            ReadableReadRequest,
14401                            fdomain_client::fidl::FDomainResourceDialect
14402                        );
14403                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
14404                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
14405                        Ok(ReadableRequest::Read {
14406                            count: req.count,
14407
14408                            responder: ReadableReadResponder {
14409                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14410                                tx_id: header.tx_id,
14411                            },
14412                        })
14413                    }
14414                    _ => Err(fidl::Error::UnknownOrdinal {
14415                        ordinal: header.ordinal,
14416                        protocol_name:
14417                            <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14418                    }),
14419                }))
14420            },
14421        )
14422    }
14423}
14424
14425#[derive(Debug)]
14426pub enum ReadableRequest {
14427    /// Reads up to 'count' bytes at the seek offset.
14428    /// The seek offset is moved forward by the number of bytes read.
14429    ///
14430    /// ## Invariants
14431    ///
14432    /// * The returned `data.length` will never be greater than `count`.
14433    /// * If `data.length` is less than `count`, it means that the seek offset
14434    ///   has reached the end of file as part of this operation.
14435    /// * If `data.length` is zero while `count` is not, it means that the
14436    ///   seek offset is already at or beyond the end of file, and no data could
14437    ///   be read.
14438    /// * If `count` is zero, the server should perform all the checks ensuring
14439    ///   read access without actually read anything, and return an empty
14440    ///   `data` vector.
14441    ///
14442    /// This method requires the [`Rights.READ_BYTES`] right.
14443    ///
14444    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
14445    Read { count: u64, responder: ReadableReadResponder },
14446}
14447
14448impl ReadableRequest {
14449    #[allow(irrefutable_let_patterns)]
14450    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
14451        if let ReadableRequest::Read { count, responder } = self {
14452            Some((count, responder))
14453        } else {
14454            None
14455        }
14456    }
14457
14458    /// Name of the method defined in FIDL
14459    pub fn method_name(&self) -> &'static str {
14460        match *self {
14461            ReadableRequest::Read { .. } => "read",
14462        }
14463    }
14464}
14465
14466#[derive(Debug, Clone)]
14467pub struct ReadableControlHandle {
14468    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14469}
14470
14471impl ReadableControlHandle {
14472    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
14473        self.inner.shutdown_with_epitaph(status.into())
14474    }
14475}
14476
14477impl fdomain_client::fidl::ControlHandle for ReadableControlHandle {
14478    fn shutdown(&self) {
14479        self.inner.shutdown()
14480    }
14481
14482    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
14483        self.inner.shutdown_with_epitaph(status)
14484    }
14485
14486    fn is_closed(&self) -> bool {
14487        self.inner.channel().is_closed()
14488    }
14489    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
14490        self.inner.channel().on_closed()
14491    }
14492}
14493
14494impl ReadableControlHandle {}
14495
14496#[must_use = "FIDL methods require a response to be sent"]
14497#[derive(Debug)]
14498pub struct ReadableReadResponder {
14499    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
14500    tx_id: u32,
14501}
14502
14503/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
14504/// if the responder is dropped without sending a response, so that the client
14505/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14506impl std::ops::Drop for ReadableReadResponder {
14507    fn drop(&mut self) {
14508        self.control_handle.shutdown();
14509        // Safety: drops once, never accessed again
14510        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14511    }
14512}
14513
14514impl fdomain_client::fidl::Responder for ReadableReadResponder {
14515    type ControlHandle = ReadableControlHandle;
14516
14517    fn control_handle(&self) -> &ReadableControlHandle {
14518        &self.control_handle
14519    }
14520
14521    fn drop_without_shutdown(mut self) {
14522        // Safety: drops once, never accessed again due to mem::forget
14523        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14524        // Prevent Drop from running (which would shut down the channel)
14525        std::mem::forget(self);
14526    }
14527}
14528
14529impl ReadableReadResponder {
14530    /// Sends a response to the FIDL transaction.
14531    ///
14532    /// Sets the channel to shutdown if an error occurs.
14533    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14534        let _result = self.send_raw(result);
14535        if _result.is_err() {
14536            self.control_handle.shutdown();
14537        }
14538        self.drop_without_shutdown();
14539        _result
14540    }
14541
14542    /// Similar to "send" but does not shutdown the channel if an error occurs.
14543    pub fn send_no_shutdown_on_err(
14544        self,
14545        mut result: Result<&[u8], i32>,
14546    ) -> Result<(), fidl::Error> {
14547        let _result = self.send_raw(result);
14548        self.drop_without_shutdown();
14549        _result
14550    }
14551
14552    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14553        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
14554            result.map(|data| (data,)),
14555            self.tx_id,
14556            0x57e419a298c8ede,
14557            fidl::encoding::DynamicFlags::empty(),
14558        )
14559    }
14560}
14561
14562#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
14563pub struct SymlinkMarker;
14564
14565impl fdomain_client::fidl::ProtocolMarker for SymlinkMarker {
14566    type Proxy = SymlinkProxy;
14567    type RequestStream = SymlinkRequestStream;
14568
14569    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
14570}
14571impl fdomain_client::fidl::DiscoverableProtocolMarker for SymlinkMarker {}
14572
14573pub trait SymlinkProxyInterface: Send + Sync {
14574    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
14575        + Send;
14576    fn r#link_into(
14577        &self,
14578        dst_parent_token: fdomain_client::Event,
14579        dst: &str,
14580    ) -> Self::LinkIntoResponseFut;
14581    fn r#clone(
14582        &self,
14583        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14584    ) -> Result<(), fidl::Error>;
14585    type CloseResponseFut: std::future::Future<
14586            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
14587        > + Send;
14588    fn r#close(&self) -> Self::CloseResponseFut;
14589    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
14590    fn r#query(&self) -> Self::QueryResponseFut;
14591    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
14592        + Send;
14593    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
14594    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
14595    fn r#deprecated_set_attr(
14596        &self,
14597        flags: NodeAttributeFlags,
14598        attributes: &NodeAttributes,
14599    ) -> Self::DeprecatedSetAttrResponseFut;
14600    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
14601        + Send;
14602    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
14603    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
14604        + Send;
14605    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
14606    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
14607        + Send;
14608    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
14609    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
14610        + Send;
14611    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
14612    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
14613        + Send;
14614    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
14615    type GetTokenResponseFut: std::future::Future<Output = Result<NodeGetTokenResult, fidl::Error>>
14616        + Send;
14617    fn r#get_token(&self) -> Self::GetTokenResponseFut;
14618    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
14619        + Send;
14620    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
14621    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
14622        + Send;
14623    fn r#update_attributes(
14624        &self,
14625        payload: &MutableNodeAttributes,
14626    ) -> Self::UpdateAttributesResponseFut;
14627    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
14628    fn r#sync(&self) -> Self::SyncResponseFut;
14629    fn r#list_extended_attributes(
14630        &self,
14631        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14632    ) -> Result<(), fidl::Error>;
14633    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
14634        + Send;
14635    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
14636    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
14637        + Send;
14638    fn r#set_extended_attribute(
14639        &self,
14640        name: &[u8],
14641        value: ExtendedAttributeValue,
14642        mode: SetExtendedAttributeMode,
14643    ) -> Self::SetExtendedAttributeResponseFut;
14644    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
14645        + Send;
14646    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
14647    fn r#open(
14648        &self,
14649        path: &str,
14650        flags: Flags,
14651        options: &Options,
14652        object: fdomain_client::Channel,
14653    ) -> Result<(), fidl::Error>;
14654    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
14655    fn r#describe(&self) -> Self::DescribeResponseFut;
14656}
14657
14658#[derive(Debug, Clone)]
14659pub struct SymlinkProxy {
14660    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
14661}
14662
14663impl fdomain_client::fidl::Proxy for SymlinkProxy {
14664    type Protocol = SymlinkMarker;
14665
14666    fn from_channel(inner: fdomain_client::Channel) -> Self {
14667        Self::new(inner)
14668    }
14669
14670    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
14671        self.client.into_channel().map_err(|client| Self { client })
14672    }
14673
14674    fn as_channel(&self) -> &fdomain_client::Channel {
14675        self.client.as_channel()
14676    }
14677}
14678
14679impl SymlinkProxy {
14680    /// Create a new Proxy for fuchsia.io/Symlink.
14681    pub fn new(channel: fdomain_client::Channel) -> Self {
14682        let protocol_name = <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
14683        Self { client: fidl::client::Client::new(channel, protocol_name) }
14684    }
14685
14686    /// Get a Stream of events from the remote end of the protocol.
14687    ///
14688    /// # Panics
14689    ///
14690    /// Panics if the event stream was already taken.
14691    pub fn take_event_stream(&self) -> SymlinkEventStream {
14692        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
14693    }
14694
14695    /// Creates a link to this this object with name `dst` in the directory represented by
14696    /// `dst_parent_token`.
14697    ///
14698    /// `dst` must be a resolved object name. Including "/" in the string will return
14699    /// `ZX_ERR_INVALID_ARGS`.
14700    ///
14701    /// This method requires the maximal set of rights supported by the filesystem for this object.
14702    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
14703    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
14704    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
14705    /// `ZX_ERR_ACCESS_DENIED`.
14706    ///
14707    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
14708    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
14709    ///
14710    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
14711    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
14712    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
14713    ///
14714    /// This method does not have the same atomicity properties has the `Directory::Link` method,
14715    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
14716    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
14717    pub fn r#link_into(
14718        &self,
14719        mut dst_parent_token: fdomain_client::Event,
14720        mut dst: &str,
14721    ) -> fidl::client::QueryResponseFut<
14722        LinkableLinkIntoResult,
14723        fdomain_client::fidl::FDomainResourceDialect,
14724    > {
14725        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
14726    }
14727
14728    pub fn r#clone(
14729        &self,
14730        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14731    ) -> Result<(), fidl::Error> {
14732        SymlinkProxyInterface::r#clone(self, request)
14733    }
14734
14735    /// Terminates the connection.
14736    ///
14737    /// After calling `Close`, the client must not send any other requests.
14738    ///
14739    /// Servers, after sending the status response, should close the connection
14740    /// regardless of status and without sending an epitaph.
14741    ///
14742    /// Closing the client end of the channel should be semantically equivalent
14743    /// to calling `Close` without knowing when the close has completed or its
14744    /// status.
14745    pub fn r#close(
14746        &self,
14747    ) -> fidl::client::QueryResponseFut<
14748        fdomain_fuchsia_unknown::CloseableCloseResult,
14749        fdomain_client::fidl::FDomainResourceDialect,
14750    > {
14751        SymlinkProxyInterface::r#close(self)
14752    }
14753
14754    pub fn r#query(
14755        &self,
14756    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
14757        SymlinkProxyInterface::r#query(self)
14758    }
14759
14760    /// DEPRECATED - Use `Node.GetAttributes` instead.
14761    ///
14762    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14763    pub fn r#deprecated_get_attr(
14764        &self,
14765    ) -> fidl::client::QueryResponseFut<
14766        (i32, NodeAttributes),
14767        fdomain_client::fidl::FDomainResourceDialect,
14768    > {
14769        SymlinkProxyInterface::r#deprecated_get_attr(self)
14770    }
14771
14772    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14773    pub fn r#deprecated_set_attr(
14774        &self,
14775        mut flags: NodeAttributeFlags,
14776        mut attributes: &NodeAttributes,
14777    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14778        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
14779    }
14780
14781    /// [DEPRECATED - Use new GetFlags method instead.]
14782    pub fn r#deprecated_get_flags(
14783        &self,
14784    ) -> fidl::client::QueryResponseFut<
14785        (i32, OpenFlags),
14786        fdomain_client::fidl::FDomainResourceDialect,
14787    > {
14788        SymlinkProxyInterface::r#deprecated_get_flags(self)
14789    }
14790
14791    /// [DEPRECATED - Use new SetFlags method instead.]
14792    pub fn r#deprecated_set_flags(
14793        &self,
14794        mut flags: OpenFlags,
14795    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14796        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
14797    }
14798
14799    /// Queries the flags that apply to this node after it has been opened/created. This method does
14800    /// not require any rights.
14801    ///
14802    /// Note that the final set of flags that apply to the connection may differ from those
14803    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14804    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14805    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14806    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14807    pub fn r#get_flags(
14808        &self,
14809    ) -> fidl::client::QueryResponseFut<
14810        NodeGetFlagsResult,
14811        fdomain_client::fidl::FDomainResourceDialect,
14812    > {
14813        SymlinkProxyInterface::r#get_flags(self)
14814    }
14815
14816    /// Sets the flags that apply to this node after it has been opened. This method does not
14817    /// require any rights.
14818    ///
14819    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14820    /// clear append mode.
14821    ///
14822    /// Errors:
14823    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14824    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14825    pub fn r#set_flags(
14826        &self,
14827        mut flags: Flags,
14828    ) -> fidl::client::QueryResponseFut<
14829        NodeSetFlagsResult,
14830        fdomain_client::fidl::FDomainResourceDialect,
14831    > {
14832        SymlinkProxyInterface::r#set_flags(self, flags)
14833    }
14834
14835    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14836    /// volume has different settings or the storage is accounted seperately from the rest of the
14837    /// filesystem that may be reported instead of filesystem-wide details.
14838    pub fn r#query_filesystem(
14839        &self,
14840    ) -> fidl::client::QueryResponseFut<
14841        (i32, Option<Box<FilesystemInfo>>),
14842        fdomain_client::fidl::FDomainResourceDialect,
14843    > {
14844        SymlinkProxyInterface::r#query_filesystem(self)
14845    }
14846
14847    /// Acquires a token which can be used to identify this connection at a later point in
14848    /// time. The token will remain valid for as long as the connection requesting the token
14849    /// remains open.
14850    ///
14851    /// This method does not require any rights. Note that the token identifies
14852    /// the connection, hence carries the rights information on this connection.
14853    pub fn r#get_token(
14854        &self,
14855    ) -> fidl::client::QueryResponseFut<
14856        NodeGetTokenResult,
14857        fdomain_client::fidl::FDomainResourceDialect,
14858    > {
14859        SymlinkProxyInterface::r#get_token(self)
14860    }
14861
14862    /// Acquires information about the node.
14863    ///
14864    /// The attributes of a node should be stable, independent of the
14865    /// specific protocol used to access it.
14866    ///
14867    /// If a particular attribute is not applicable or not supported,
14868    /// filesystems should leave the corresponding field absent.
14869    ///
14870    /// + `query` a bit-mask specifying which attributes to fetch. The server
14871    ///   should not return more than necessary.
14872    /// - `attributes` the returned attributes.
14873    ///
14874    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14875    pub fn r#get_attributes(
14876        &self,
14877        mut query: NodeAttributesQuery,
14878    ) -> fidl::client::QueryResponseFut<
14879        NodeGetAttributesResult,
14880        fdomain_client::fidl::FDomainResourceDialect,
14881    > {
14882        SymlinkProxyInterface::r#get_attributes(self, query)
14883    }
14884
14885    /// Updates information about the node.
14886    ///
14887    /// + `attributes` the presence of a table field in `attributes` indicates
14888    /// the intent to update the corresponding attribute.
14889    ///
14890    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14891    ///
14892    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14893    pub fn r#update_attributes(
14894        &self,
14895        mut payload: &MutableNodeAttributes,
14896    ) -> fidl::client::QueryResponseFut<
14897        NodeUpdateAttributesResult,
14898        fdomain_client::fidl::FDomainResourceDialect,
14899    > {
14900        SymlinkProxyInterface::r#update_attributes(self, payload)
14901    }
14902
14903    /// Synchronizes updates to the node to the underlying media, if it exists.
14904    ///
14905    /// This method will return when the filesystem server has flushed the
14906    /// relevant updates to the underlying media, but does not guarantee the
14907    /// underlying media has persisted the information, nor that any information
14908    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14909    /// between operations.
14910    ///
14911    /// This method does not require any rights.
14912    pub fn r#sync(
14913        &self,
14914    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
14915    {
14916        SymlinkProxyInterface::r#sync(self)
14917    }
14918
14919    /// Creates an iterator over all the extended attribute names associated
14920    /// with this node. If an error occurs it is returned as an epitaph on the
14921    /// iterator request channel, and then the channel is closed.
14922    ///
14923    /// GetExtendedAttributes can be used with any of these names to retrieve
14924    /// the associated value.
14925    ///
14926    /// This method requires the [`Rights.READ_BYTES`] right.
14927    pub fn r#list_extended_attributes(
14928        &self,
14929        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14930    ) -> Result<(), fidl::Error> {
14931        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
14932    }
14933
14934    /// Get the value associated with the given attribute `name` for this node.
14935    ///
14936    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14937    /// particular structure is imposed on them.
14938    ///
14939    /// This method requires the [`Rights.READ_BYTES`] right.
14940    pub fn r#get_extended_attribute(
14941        &self,
14942        mut name: &[u8],
14943    ) -> fidl::client::QueryResponseFut<
14944        NodeGetExtendedAttributeResult,
14945        fdomain_client::fidl::FDomainResourceDialect,
14946    > {
14947        SymlinkProxyInterface::r#get_extended_attribute(self, name)
14948    }
14949
14950    /// Set the value for the given attribute `name` to `value` for this node.
14951    ///
14952    /// The attribute name may exist, in which case the attribute is updated.
14953    /// If the attribute doesn't exist, it is created. The name should have no
14954    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14955    ///
14956    /// This method requires the [`Rights.WRITE_BYTES`] right.
14957    pub fn r#set_extended_attribute(
14958        &self,
14959        mut name: &[u8],
14960        mut value: ExtendedAttributeValue,
14961        mut mode: SetExtendedAttributeMode,
14962    ) -> fidl::client::QueryResponseFut<
14963        NodeSetExtendedAttributeResult,
14964        fdomain_client::fidl::FDomainResourceDialect,
14965    > {
14966        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
14967    }
14968
14969    /// Remove the specified extended attribute.
14970    ///
14971    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14972    ///
14973    /// This method requires the [`Rights.WRITE_BYTES`] right.
14974    pub fn r#remove_extended_attribute(
14975        &self,
14976        mut name: &[u8],
14977    ) -> fidl::client::QueryResponseFut<
14978        NodeRemoveExtendedAttributeResult,
14979        fdomain_client::fidl::FDomainResourceDialect,
14980    > {
14981        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
14982    }
14983
14984    /// Open (or create) a node relative to this directory. Any errors are communicated via an
14985    /// epitaph sent on the `object` channel.
14986    ///
14987    /// Errors:
14988    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
14989    /// * See [`Flags`] for other errors which may be communicated based on `flags`
14990    pub fn r#open(
14991        &self,
14992        mut path: &str,
14993        mut flags: Flags,
14994        mut options: &Options,
14995        mut object: fdomain_client::Channel,
14996    ) -> Result<(), fidl::Error> {
14997        SymlinkProxyInterface::r#open(self, path, flags, options, object)
14998    }
14999
15000    pub fn r#describe(
15001        &self,
15002    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>
15003    {
15004        SymlinkProxyInterface::r#describe(self)
15005    }
15006}
15007
15008impl SymlinkProxyInterface for SymlinkProxy {
15009    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
15010        LinkableLinkIntoResult,
15011        fdomain_client::fidl::FDomainResourceDialect,
15012    >;
15013    fn r#link_into(
15014        &self,
15015        mut dst_parent_token: fdomain_client::Event,
15016        mut dst: &str,
15017    ) -> Self::LinkIntoResponseFut {
15018        fn _decode(
15019            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15020        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
15021            let _response = fidl::client::decode_transaction_body::<
15022                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15023                fdomain_client::fidl::FDomainResourceDialect,
15024                0x54f3949246a03e74,
15025            >(_buf?)?;
15026            Ok(_response.map(|x| x))
15027        }
15028        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
15029            (dst_parent_token, dst),
15030            0x54f3949246a03e74,
15031            fidl::encoding::DynamicFlags::empty(),
15032            _decode,
15033        )
15034    }
15035
15036    fn r#clone(
15037        &self,
15038        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15039    ) -> Result<(), fidl::Error> {
15040        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
15041            (request,),
15042            0x20d8a7aba2168a79,
15043            fidl::encoding::DynamicFlags::empty(),
15044        )
15045    }
15046
15047    type CloseResponseFut = fidl::client::QueryResponseFut<
15048        fdomain_fuchsia_unknown::CloseableCloseResult,
15049        fdomain_client::fidl::FDomainResourceDialect,
15050    >;
15051    fn r#close(&self) -> Self::CloseResponseFut {
15052        fn _decode(
15053            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15054        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
15055            let _response = fidl::client::decode_transaction_body::<
15056                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15057                fdomain_client::fidl::FDomainResourceDialect,
15058                0x5ac5d459ad7f657e,
15059            >(_buf?)?;
15060            Ok(_response.map(|x| x))
15061        }
15062        self.client.send_query_and_decode::<
15063            fidl::encoding::EmptyPayload,
15064            fdomain_fuchsia_unknown::CloseableCloseResult,
15065        >(
15066            (),
15067            0x5ac5d459ad7f657e,
15068            fidl::encoding::DynamicFlags::empty(),
15069            _decode,
15070        )
15071    }
15072
15073    type QueryResponseFut =
15074        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
15075    fn r#query(&self) -> Self::QueryResponseFut {
15076        fn _decode(
15077            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15078        ) -> Result<Vec<u8>, fidl::Error> {
15079            let _response = fidl::client::decode_transaction_body::<
15080                fdomain_fuchsia_unknown::QueryableQueryResponse,
15081                fdomain_client::fidl::FDomainResourceDialect,
15082                0x2658edee9decfc06,
15083            >(_buf?)?;
15084            Ok(_response.protocol)
15085        }
15086        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
15087            (),
15088            0x2658edee9decfc06,
15089            fidl::encoding::DynamicFlags::empty(),
15090            _decode,
15091        )
15092    }
15093
15094    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
15095        (i32, NodeAttributes),
15096        fdomain_client::fidl::FDomainResourceDialect,
15097    >;
15098    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
15099        fn _decode(
15100            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15101        ) -> Result<(i32, NodeAttributes), fidl::Error> {
15102            let _response = fidl::client::decode_transaction_body::<
15103                NodeDeprecatedGetAttrResponse,
15104                fdomain_client::fidl::FDomainResourceDialect,
15105                0x78985e216314dafd,
15106            >(_buf?)?;
15107            Ok((_response.s, _response.attributes))
15108        }
15109        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
15110            (),
15111            0x78985e216314dafd,
15112            fidl::encoding::DynamicFlags::empty(),
15113            _decode,
15114        )
15115    }
15116
15117    type DeprecatedSetAttrResponseFut =
15118        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
15119    fn r#deprecated_set_attr(
15120        &self,
15121        mut flags: NodeAttributeFlags,
15122        mut attributes: &NodeAttributes,
15123    ) -> Self::DeprecatedSetAttrResponseFut {
15124        fn _decode(
15125            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15126        ) -> Result<i32, fidl::Error> {
15127            let _response = fidl::client::decode_transaction_body::<
15128                NodeDeprecatedSetAttrResponse,
15129                fdomain_client::fidl::FDomainResourceDialect,
15130                0x4186c0f40d938f46,
15131            >(_buf?)?;
15132            Ok(_response.s)
15133        }
15134        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
15135            (flags, attributes),
15136            0x4186c0f40d938f46,
15137            fidl::encoding::DynamicFlags::empty(),
15138            _decode,
15139        )
15140    }
15141
15142    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
15143        (i32, OpenFlags),
15144        fdomain_client::fidl::FDomainResourceDialect,
15145    >;
15146    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
15147        fn _decode(
15148            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15149        ) -> Result<(i32, OpenFlags), fidl::Error> {
15150            let _response = fidl::client::decode_transaction_body::<
15151                NodeDeprecatedGetFlagsResponse,
15152                fdomain_client::fidl::FDomainResourceDialect,
15153                0x5b88fffb8eda3aa1,
15154            >(_buf?)?;
15155            Ok((_response.s, _response.flags))
15156        }
15157        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
15158            (),
15159            0x5b88fffb8eda3aa1,
15160            fidl::encoding::DynamicFlags::empty(),
15161            _decode,
15162        )
15163    }
15164
15165    type DeprecatedSetFlagsResponseFut =
15166        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
15167    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
15168        fn _decode(
15169            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15170        ) -> Result<i32, fidl::Error> {
15171            let _response = fidl::client::decode_transaction_body::<
15172                NodeDeprecatedSetFlagsResponse,
15173                fdomain_client::fidl::FDomainResourceDialect,
15174                0x5295b76c71fde733,
15175            >(_buf?)?;
15176            Ok(_response.s)
15177        }
15178        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
15179            (flags,),
15180            0x5295b76c71fde733,
15181            fidl::encoding::DynamicFlags::empty(),
15182            _decode,
15183        )
15184    }
15185
15186    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
15187        NodeGetFlagsResult,
15188        fdomain_client::fidl::FDomainResourceDialect,
15189    >;
15190    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
15191        fn _decode(
15192            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15193        ) -> Result<NodeGetFlagsResult, fidl::Error> {
15194            let _response = fidl::client::decode_transaction_body::<
15195                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
15196                fdomain_client::fidl::FDomainResourceDialect,
15197                0x176eb318f64ec23,
15198            >(_buf?)?
15199            .into_result_fdomain::<SymlinkMarker>("get_flags")?;
15200            Ok(_response.map(|x| x.flags))
15201        }
15202        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
15203            (),
15204            0x176eb318f64ec23,
15205            fidl::encoding::DynamicFlags::FLEXIBLE,
15206            _decode,
15207        )
15208    }
15209
15210    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
15211        NodeSetFlagsResult,
15212        fdomain_client::fidl::FDomainResourceDialect,
15213    >;
15214    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
15215        fn _decode(
15216            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15217        ) -> Result<NodeSetFlagsResult, fidl::Error> {
15218            let _response = fidl::client::decode_transaction_body::<
15219                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
15220                fdomain_client::fidl::FDomainResourceDialect,
15221                0x55a8028685791ea8,
15222            >(_buf?)?
15223            .into_result_fdomain::<SymlinkMarker>("set_flags")?;
15224            Ok(_response.map(|x| x))
15225        }
15226        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
15227            (flags,),
15228            0x55a8028685791ea8,
15229            fidl::encoding::DynamicFlags::FLEXIBLE,
15230            _decode,
15231        )
15232    }
15233
15234    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
15235        (i32, Option<Box<FilesystemInfo>>),
15236        fdomain_client::fidl::FDomainResourceDialect,
15237    >;
15238    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
15239        fn _decode(
15240            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15241        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
15242            let _response = fidl::client::decode_transaction_body::<
15243                NodeQueryFilesystemResponse,
15244                fdomain_client::fidl::FDomainResourceDialect,
15245                0x6f344a1c6b0a0610,
15246            >(_buf?)?;
15247            Ok((_response.s, _response.info))
15248        }
15249        self.client.send_query_and_decode::<
15250            fidl::encoding::EmptyPayload,
15251            (i32, Option<Box<FilesystemInfo>>),
15252        >(
15253            (),
15254            0x6f344a1c6b0a0610,
15255            fidl::encoding::DynamicFlags::empty(),
15256            _decode,
15257        )
15258    }
15259
15260    type GetTokenResponseFut = fidl::client::QueryResponseFut<
15261        NodeGetTokenResult,
15262        fdomain_client::fidl::FDomainResourceDialect,
15263    >;
15264    fn r#get_token(&self) -> Self::GetTokenResponseFut {
15265        fn _decode(
15266            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15267        ) -> Result<NodeGetTokenResult, fidl::Error> {
15268            let _response = fidl::client::decode_transaction_body::<
15269                fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>,
15270                fdomain_client::fidl::FDomainResourceDialect,
15271                0x5054f0ade7076cec,
15272            >(_buf?)?
15273            .into_result_fdomain::<SymlinkMarker>("get_token")?;
15274            Ok(_response.map(|x| x.token))
15275        }
15276        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetTokenResult>(
15277            (),
15278            0x5054f0ade7076cec,
15279            fidl::encoding::DynamicFlags::FLEXIBLE,
15280            _decode,
15281        )
15282    }
15283
15284    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
15285        NodeGetAttributesResult,
15286        fdomain_client::fidl::FDomainResourceDialect,
15287    >;
15288    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
15289        fn _decode(
15290            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15291        ) -> Result<NodeGetAttributesResult, fidl::Error> {
15292            let _response = fidl::client::decode_transaction_body::<
15293                fidl::encoding::ResultType<NodeAttributes2, i32>,
15294                fdomain_client::fidl::FDomainResourceDialect,
15295                0x3d4396a638ea053b,
15296            >(_buf?)?;
15297            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
15298        }
15299        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
15300            (query,),
15301            0x3d4396a638ea053b,
15302            fidl::encoding::DynamicFlags::empty(),
15303            _decode,
15304        )
15305    }
15306
15307    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
15308        NodeUpdateAttributesResult,
15309        fdomain_client::fidl::FDomainResourceDialect,
15310    >;
15311    fn r#update_attributes(
15312        &self,
15313        mut payload: &MutableNodeAttributes,
15314    ) -> Self::UpdateAttributesResponseFut {
15315        fn _decode(
15316            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15317        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
15318            let _response = fidl::client::decode_transaction_body::<
15319                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15320                fdomain_client::fidl::FDomainResourceDialect,
15321                0x3308c1da5a89bf08,
15322            >(_buf?)?;
15323            Ok(_response.map(|x| x))
15324        }
15325        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
15326            payload,
15327            0x3308c1da5a89bf08,
15328            fidl::encoding::DynamicFlags::empty(),
15329            _decode,
15330        )
15331    }
15332
15333    type SyncResponseFut = fidl::client::QueryResponseFut<
15334        NodeSyncResult,
15335        fdomain_client::fidl::FDomainResourceDialect,
15336    >;
15337    fn r#sync(&self) -> Self::SyncResponseFut {
15338        fn _decode(
15339            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15340        ) -> Result<NodeSyncResult, fidl::Error> {
15341            let _response = fidl::client::decode_transaction_body::<
15342                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15343                fdomain_client::fidl::FDomainResourceDialect,
15344                0x2c5c27ca0ab5dc49,
15345            >(_buf?)?;
15346            Ok(_response.map(|x| x))
15347        }
15348        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
15349            (),
15350            0x2c5c27ca0ab5dc49,
15351            fidl::encoding::DynamicFlags::empty(),
15352            _decode,
15353        )
15354    }
15355
15356    fn r#list_extended_attributes(
15357        &self,
15358        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15359    ) -> Result<(), fidl::Error> {
15360        self.client.send::<NodeListExtendedAttributesRequest>(
15361            (iterator,),
15362            0x4b61033de007fcd0,
15363            fidl::encoding::DynamicFlags::empty(),
15364        )
15365    }
15366
15367    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15368        NodeGetExtendedAttributeResult,
15369        fdomain_client::fidl::FDomainResourceDialect,
15370    >;
15371    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
15372        fn _decode(
15373            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15374        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
15375            let _response = fidl::client::decode_transaction_body::<
15376                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
15377                fdomain_client::fidl::FDomainResourceDialect,
15378                0x45ffa3ccfdeb76db,
15379            >(_buf?)?;
15380            Ok(_response.map(|x| x))
15381        }
15382        self.client.send_query_and_decode::<
15383            NodeGetExtendedAttributeRequest,
15384            NodeGetExtendedAttributeResult,
15385        >(
15386            (name,),
15387            0x45ffa3ccfdeb76db,
15388            fidl::encoding::DynamicFlags::empty(),
15389            _decode,
15390        )
15391    }
15392
15393    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15394        NodeSetExtendedAttributeResult,
15395        fdomain_client::fidl::FDomainResourceDialect,
15396    >;
15397    fn r#set_extended_attribute(
15398        &self,
15399        mut name: &[u8],
15400        mut value: ExtendedAttributeValue,
15401        mut mode: SetExtendedAttributeMode,
15402    ) -> Self::SetExtendedAttributeResponseFut {
15403        fn _decode(
15404            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15405        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
15406            let _response = fidl::client::decode_transaction_body::<
15407                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15408                fdomain_client::fidl::FDomainResourceDialect,
15409                0x4a951362f681f23c,
15410            >(_buf?)?;
15411            Ok(_response.map(|x| x))
15412        }
15413        self.client.send_query_and_decode::<
15414            NodeSetExtendedAttributeRequest,
15415            NodeSetExtendedAttributeResult,
15416        >(
15417            (name, &mut value, mode,),
15418            0x4a951362f681f23c,
15419            fidl::encoding::DynamicFlags::empty(),
15420            _decode,
15421        )
15422    }
15423
15424    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15425        NodeRemoveExtendedAttributeResult,
15426        fdomain_client::fidl::FDomainResourceDialect,
15427    >;
15428    fn r#remove_extended_attribute(
15429        &self,
15430        mut name: &[u8],
15431    ) -> Self::RemoveExtendedAttributeResponseFut {
15432        fn _decode(
15433            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15434        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
15435            let _response = fidl::client::decode_transaction_body::<
15436                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15437                fdomain_client::fidl::FDomainResourceDialect,
15438                0x7a0b9f3a9bf9032d,
15439            >(_buf?)?;
15440            Ok(_response.map(|x| x))
15441        }
15442        self.client.send_query_and_decode::<
15443            NodeRemoveExtendedAttributeRequest,
15444            NodeRemoveExtendedAttributeResult,
15445        >(
15446            (name,),
15447            0x7a0b9f3a9bf9032d,
15448            fidl::encoding::DynamicFlags::empty(),
15449            _decode,
15450        )
15451    }
15452
15453    fn r#open(
15454        &self,
15455        mut path: &str,
15456        mut flags: Flags,
15457        mut options: &Options,
15458        mut object: fdomain_client::Channel,
15459    ) -> Result<(), fidl::Error> {
15460        self.client.send::<OpenableOpenRequest>(
15461            (path, flags, options, object),
15462            0x568ddcb9a9cbb6d9,
15463            fidl::encoding::DynamicFlags::FLEXIBLE,
15464        )
15465    }
15466
15467    type DescribeResponseFut =
15468        fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>;
15469    fn r#describe(&self) -> Self::DescribeResponseFut {
15470        fn _decode(
15471            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15472        ) -> Result<SymlinkInfo, fidl::Error> {
15473            let _response = fidl::client::decode_transaction_body::<
15474                fidl::encoding::FlexibleType<SymlinkInfo>,
15475                fdomain_client::fidl::FDomainResourceDialect,
15476                0x742c2ea5e89831f3,
15477            >(_buf?)?
15478            .into_result_fdomain::<SymlinkMarker>("describe")?;
15479            Ok(_response)
15480        }
15481        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
15482            (),
15483            0x742c2ea5e89831f3,
15484            fidl::encoding::DynamicFlags::FLEXIBLE,
15485            _decode,
15486        )
15487    }
15488}
15489
15490pub struct SymlinkEventStream {
15491    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
15492}
15493
15494impl std::marker::Unpin for SymlinkEventStream {}
15495
15496impl futures::stream::FusedStream for SymlinkEventStream {
15497    fn is_terminated(&self) -> bool {
15498        self.event_receiver.is_terminated()
15499    }
15500}
15501
15502impl futures::Stream for SymlinkEventStream {
15503    type Item = Result<SymlinkEvent, fidl::Error>;
15504
15505    fn poll_next(
15506        mut self: std::pin::Pin<&mut Self>,
15507        cx: &mut std::task::Context<'_>,
15508    ) -> std::task::Poll<Option<Self::Item>> {
15509        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
15510            &mut self.event_receiver,
15511            cx
15512        )?) {
15513            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
15514            None => std::task::Poll::Ready(None),
15515        }
15516    }
15517}
15518
15519#[derive(Debug)]
15520pub enum SymlinkEvent {
15521    OnOpen_ {
15522        s: i32,
15523        info: Option<Box<NodeInfoDeprecated>>,
15524    },
15525    OnRepresentation {
15526        payload: Representation,
15527    },
15528    #[non_exhaustive]
15529    _UnknownEvent {
15530        /// Ordinal of the event that was sent.
15531        ordinal: u64,
15532    },
15533}
15534
15535impl SymlinkEvent {
15536    #[allow(irrefutable_let_patterns)]
15537    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
15538        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
15539    }
15540    #[allow(irrefutable_let_patterns)]
15541    pub fn into_on_representation(self) -> Option<Representation> {
15542        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
15543    }
15544
15545    /// Decodes a message buffer as a [`SymlinkEvent`].
15546    fn decode(
15547        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
15548    ) -> Result<SymlinkEvent, fidl::Error> {
15549        let (bytes, _handles) = buf.split_mut();
15550        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15551        debug_assert_eq!(tx_header.tx_id, 0);
15552        match tx_header.ordinal {
15553            0x7fc7bbb1dbfd1972 => {
15554                let mut out = fidl::new_empty!(
15555                    NodeOnOpenRequest,
15556                    fdomain_client::fidl::FDomainResourceDialect
15557                );
15558                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
15559                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
15560            }
15561            0x5cb40567d80a510c => {
15562                let mut out =
15563                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
15564                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
15565                Ok((SymlinkEvent::OnRepresentation { payload: out }))
15566            }
15567            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
15568                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
15569            }
15570            _ => Err(fidl::Error::UnknownOrdinal {
15571                ordinal: tx_header.ordinal,
15572                protocol_name: <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15573            }),
15574        }
15575    }
15576}
15577
15578/// A Stream of incoming requests for fuchsia.io/Symlink.
15579pub struct SymlinkRequestStream {
15580    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15581    is_terminated: bool,
15582}
15583
15584impl std::marker::Unpin for SymlinkRequestStream {}
15585
15586impl futures::stream::FusedStream for SymlinkRequestStream {
15587    fn is_terminated(&self) -> bool {
15588        self.is_terminated
15589    }
15590}
15591
15592impl fdomain_client::fidl::RequestStream for SymlinkRequestStream {
15593    type Protocol = SymlinkMarker;
15594    type ControlHandle = SymlinkControlHandle;
15595
15596    fn from_channel(channel: fdomain_client::Channel) -> Self {
15597        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
15598    }
15599
15600    fn control_handle(&self) -> Self::ControlHandle {
15601        SymlinkControlHandle { inner: self.inner.clone() }
15602    }
15603
15604    fn into_inner(
15605        self,
15606    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
15607    {
15608        (self.inner, self.is_terminated)
15609    }
15610
15611    fn from_inner(
15612        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15613        is_terminated: bool,
15614    ) -> Self {
15615        Self { inner, is_terminated }
15616    }
15617}
15618
15619impl futures::Stream for SymlinkRequestStream {
15620    type Item = Result<SymlinkRequest, fidl::Error>;
15621
15622    fn poll_next(
15623        mut self: std::pin::Pin<&mut Self>,
15624        cx: &mut std::task::Context<'_>,
15625    ) -> std::task::Poll<Option<Self::Item>> {
15626        let this = &mut *self;
15627        if this.inner.check_shutdown(cx) {
15628            this.is_terminated = true;
15629            return std::task::Poll::Ready(None);
15630        }
15631        if this.is_terminated {
15632            panic!("polled SymlinkRequestStream after completion");
15633        }
15634        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
15635            |bytes, handles| {
15636                match this.inner.channel().read_etc(cx, bytes, handles) {
15637                    std::task::Poll::Ready(Ok(())) => {}
15638                    std::task::Poll::Pending => return std::task::Poll::Pending,
15639                    std::task::Poll::Ready(Err(None)) => {
15640                        this.is_terminated = true;
15641                        return std::task::Poll::Ready(None);
15642                    }
15643                    std::task::Poll::Ready(Err(Some(e))) => {
15644                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
15645                            e.into(),
15646                        ))));
15647                    }
15648                }
15649
15650                // A message has been received from the channel
15651                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15652
15653                std::task::Poll::Ready(Some(match header.ordinal {
15654                    0x54f3949246a03e74 => {
15655                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15656                        let mut req = fidl::new_empty!(
15657                            LinkableLinkIntoRequest,
15658                            fdomain_client::fidl::FDomainResourceDialect
15659                        );
15660                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
15661                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15662                        Ok(SymlinkRequest::LinkInto {
15663                            dst_parent_token: req.dst_parent_token,
15664                            dst: req.dst,
15665
15666                            responder: SymlinkLinkIntoResponder {
15667                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15668                                tx_id: header.tx_id,
15669                            },
15670                        })
15671                    }
15672                    0x20d8a7aba2168a79 => {
15673                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15674                        let mut req = fidl::new_empty!(
15675                            fdomain_fuchsia_unknown::CloneableCloneRequest,
15676                            fdomain_client::fidl::FDomainResourceDialect
15677                        );
15678                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
15679                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15680                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
15681                    }
15682                    0x5ac5d459ad7f657e => {
15683                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15684                        let mut req = fidl::new_empty!(
15685                            fidl::encoding::EmptyPayload,
15686                            fdomain_client::fidl::FDomainResourceDialect
15687                        );
15688                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15689                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15690                        Ok(SymlinkRequest::Close {
15691                            responder: SymlinkCloseResponder {
15692                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15693                                tx_id: header.tx_id,
15694                            },
15695                        })
15696                    }
15697                    0x2658edee9decfc06 => {
15698                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15699                        let mut req = fidl::new_empty!(
15700                            fidl::encoding::EmptyPayload,
15701                            fdomain_client::fidl::FDomainResourceDialect
15702                        );
15703                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15704                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15705                        Ok(SymlinkRequest::Query {
15706                            responder: SymlinkQueryResponder {
15707                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15708                                tx_id: header.tx_id,
15709                            },
15710                        })
15711                    }
15712                    0x78985e216314dafd => {
15713                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15714                        let mut req = fidl::new_empty!(
15715                            fidl::encoding::EmptyPayload,
15716                            fdomain_client::fidl::FDomainResourceDialect
15717                        );
15718                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15719                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15720                        Ok(SymlinkRequest::DeprecatedGetAttr {
15721                            responder: SymlinkDeprecatedGetAttrResponder {
15722                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15723                                tx_id: header.tx_id,
15724                            },
15725                        })
15726                    }
15727                    0x4186c0f40d938f46 => {
15728                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15729                        let mut req = fidl::new_empty!(
15730                            NodeDeprecatedSetAttrRequest,
15731                            fdomain_client::fidl::FDomainResourceDialect
15732                        );
15733                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
15734                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15735                        Ok(SymlinkRequest::DeprecatedSetAttr {
15736                            flags: req.flags,
15737                            attributes: req.attributes,
15738
15739                            responder: SymlinkDeprecatedSetAttrResponder {
15740                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15741                                tx_id: header.tx_id,
15742                            },
15743                        })
15744                    }
15745                    0x5b88fffb8eda3aa1 => {
15746                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15747                        let mut req = fidl::new_empty!(
15748                            fidl::encoding::EmptyPayload,
15749                            fdomain_client::fidl::FDomainResourceDialect
15750                        );
15751                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15752                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15753                        Ok(SymlinkRequest::DeprecatedGetFlags {
15754                            responder: SymlinkDeprecatedGetFlagsResponder {
15755                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15756                                tx_id: header.tx_id,
15757                            },
15758                        })
15759                    }
15760                    0x5295b76c71fde733 => {
15761                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15762                        let mut req = fidl::new_empty!(
15763                            NodeDeprecatedSetFlagsRequest,
15764                            fdomain_client::fidl::FDomainResourceDialect
15765                        );
15766                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15767                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15768                        Ok(SymlinkRequest::DeprecatedSetFlags {
15769                            flags: req.flags,
15770
15771                            responder: SymlinkDeprecatedSetFlagsResponder {
15772                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15773                                tx_id: header.tx_id,
15774                            },
15775                        })
15776                    }
15777                    0x176eb318f64ec23 => {
15778                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15779                        let mut req = fidl::new_empty!(
15780                            fidl::encoding::EmptyPayload,
15781                            fdomain_client::fidl::FDomainResourceDialect
15782                        );
15783                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15784                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15785                        Ok(SymlinkRequest::GetFlags {
15786                            responder: SymlinkGetFlagsResponder {
15787                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15788                                tx_id: header.tx_id,
15789                            },
15790                        })
15791                    }
15792                    0x55a8028685791ea8 => {
15793                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15794                        let mut req = fidl::new_empty!(
15795                            NodeSetFlagsRequest,
15796                            fdomain_client::fidl::FDomainResourceDialect
15797                        );
15798                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15799                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15800                        Ok(SymlinkRequest::SetFlags {
15801                            flags: req.flags,
15802
15803                            responder: SymlinkSetFlagsResponder {
15804                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15805                                tx_id: header.tx_id,
15806                            },
15807                        })
15808                    }
15809                    0x6f344a1c6b0a0610 => {
15810                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15811                        let mut req = fidl::new_empty!(
15812                            fidl::encoding::EmptyPayload,
15813                            fdomain_client::fidl::FDomainResourceDialect
15814                        );
15815                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15816                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15817                        Ok(SymlinkRequest::QueryFilesystem {
15818                            responder: SymlinkQueryFilesystemResponder {
15819                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15820                                tx_id: header.tx_id,
15821                            },
15822                        })
15823                    }
15824                    0x5054f0ade7076cec => {
15825                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15826                        let mut req = fidl::new_empty!(
15827                            fidl::encoding::EmptyPayload,
15828                            fdomain_client::fidl::FDomainResourceDialect
15829                        );
15830                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15831                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15832                        Ok(SymlinkRequest::GetToken {
15833                            responder: SymlinkGetTokenResponder {
15834                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15835                                tx_id: header.tx_id,
15836                            },
15837                        })
15838                    }
15839                    0x3d4396a638ea053b => {
15840                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15841                        let mut req = fidl::new_empty!(
15842                            NodeGetAttributesRequest,
15843                            fdomain_client::fidl::FDomainResourceDialect
15844                        );
15845                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15846                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15847                        Ok(SymlinkRequest::GetAttributes {
15848                            query: req.query,
15849
15850                            responder: SymlinkGetAttributesResponder {
15851                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15852                                tx_id: header.tx_id,
15853                            },
15854                        })
15855                    }
15856                    0x3308c1da5a89bf08 => {
15857                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15858                        let mut req = fidl::new_empty!(
15859                            MutableNodeAttributes,
15860                            fdomain_client::fidl::FDomainResourceDialect
15861                        );
15862                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
15863                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15864                        Ok(SymlinkRequest::UpdateAttributes {
15865                            payload: req,
15866                            responder: SymlinkUpdateAttributesResponder {
15867                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15868                                tx_id: header.tx_id,
15869                            },
15870                        })
15871                    }
15872                    0x2c5c27ca0ab5dc49 => {
15873                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15874                        let mut req = fidl::new_empty!(
15875                            fidl::encoding::EmptyPayload,
15876                            fdomain_client::fidl::FDomainResourceDialect
15877                        );
15878                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15879                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15880                        Ok(SymlinkRequest::Sync {
15881                            responder: SymlinkSyncResponder {
15882                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15883                                tx_id: header.tx_id,
15884                            },
15885                        })
15886                    }
15887                    0x4b61033de007fcd0 => {
15888                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15889                        let mut req = fidl::new_empty!(
15890                            NodeListExtendedAttributesRequest,
15891                            fdomain_client::fidl::FDomainResourceDialect
15892                        );
15893                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15894                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15895                        Ok(SymlinkRequest::ListExtendedAttributes {
15896                            iterator: req.iterator,
15897
15898                            control_handle,
15899                        })
15900                    }
15901                    0x45ffa3ccfdeb76db => {
15902                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15903                        let mut req = fidl::new_empty!(
15904                            NodeGetExtendedAttributeRequest,
15905                            fdomain_client::fidl::FDomainResourceDialect
15906                        );
15907                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15908                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15909                        Ok(SymlinkRequest::GetExtendedAttribute {
15910                            name: req.name,
15911
15912                            responder: SymlinkGetExtendedAttributeResponder {
15913                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15914                                tx_id: header.tx_id,
15915                            },
15916                        })
15917                    }
15918                    0x4a951362f681f23c => {
15919                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15920                        let mut req = fidl::new_empty!(
15921                            NodeSetExtendedAttributeRequest,
15922                            fdomain_client::fidl::FDomainResourceDialect
15923                        );
15924                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15925                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15926                        Ok(SymlinkRequest::SetExtendedAttribute {
15927                            name: req.name,
15928                            value: req.value,
15929                            mode: req.mode,
15930
15931                            responder: SymlinkSetExtendedAttributeResponder {
15932                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15933                                tx_id: header.tx_id,
15934                            },
15935                        })
15936                    }
15937                    0x7a0b9f3a9bf9032d => {
15938                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15939                        let mut req = fidl::new_empty!(
15940                            NodeRemoveExtendedAttributeRequest,
15941                            fdomain_client::fidl::FDomainResourceDialect
15942                        );
15943                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15944                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15945                        Ok(SymlinkRequest::RemoveExtendedAttribute {
15946                            name: req.name,
15947
15948                            responder: SymlinkRemoveExtendedAttributeResponder {
15949                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15950                                tx_id: header.tx_id,
15951                            },
15952                        })
15953                    }
15954                    0x568ddcb9a9cbb6d9 => {
15955                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15956                        let mut req = fidl::new_empty!(
15957                            OpenableOpenRequest,
15958                            fdomain_client::fidl::FDomainResourceDialect
15959                        );
15960                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
15961                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15962                        Ok(SymlinkRequest::Open {
15963                            path: req.path,
15964                            flags: req.flags,
15965                            options: req.options,
15966                            object: req.object,
15967
15968                            control_handle,
15969                        })
15970                    }
15971                    0x742c2ea5e89831f3 => {
15972                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15973                        let mut req = fidl::new_empty!(
15974                            fidl::encoding::EmptyPayload,
15975                            fdomain_client::fidl::FDomainResourceDialect
15976                        );
15977                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15978                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15979                        Ok(SymlinkRequest::Describe {
15980                            responder: SymlinkDescribeResponder {
15981                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15982                                tx_id: header.tx_id,
15983                            },
15984                        })
15985                    }
15986                    _ if header.tx_id == 0
15987                        && header
15988                            .dynamic_flags()
15989                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15990                    {
15991                        Ok(SymlinkRequest::_UnknownMethod {
15992                            ordinal: header.ordinal,
15993                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15994                            method_type: fidl::MethodType::OneWay,
15995                        })
15996                    }
15997                    _ if header
15998                        .dynamic_flags()
15999                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16000                    {
16001                        this.inner.send_framework_err(
16002                            fidl::encoding::FrameworkErr::UnknownMethod,
16003                            header.tx_id,
16004                            header.ordinal,
16005                            header.dynamic_flags(),
16006                            (bytes, handles),
16007                        )?;
16008                        Ok(SymlinkRequest::_UnknownMethod {
16009                            ordinal: header.ordinal,
16010                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
16011                            method_type: fidl::MethodType::TwoWay,
16012                        })
16013                    }
16014                    _ => Err(fidl::Error::UnknownOrdinal {
16015                        ordinal: header.ordinal,
16016                        protocol_name:
16017                            <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
16018                    }),
16019                }))
16020            },
16021        )
16022    }
16023}
16024
16025/// A ['Node'] which contains a symbolic link.
16026#[derive(Debug)]
16027pub enum SymlinkRequest {
16028    /// Creates a link to this this object with name `dst` in the directory represented by
16029    /// `dst_parent_token`.
16030    ///
16031    /// `dst` must be a resolved object name. Including "/" in the string will return
16032    /// `ZX_ERR_INVALID_ARGS`.
16033    ///
16034    /// This method requires the maximal set of rights supported by the filesystem for this object.
16035    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
16036    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
16037    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
16038    /// `ZX_ERR_ACCESS_DENIED`.
16039    ///
16040    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
16041    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
16042    ///
16043    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
16044    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
16045    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
16046    ///
16047    /// This method does not have the same atomicity properties has the `Directory::Link` method,
16048    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
16049    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
16050    LinkInto {
16051        dst_parent_token: fdomain_client::Event,
16052        dst: String,
16053        responder: SymlinkLinkIntoResponder,
16054    },
16055    Clone {
16056        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
16057        control_handle: SymlinkControlHandle,
16058    },
16059    /// Terminates the connection.
16060    ///
16061    /// After calling `Close`, the client must not send any other requests.
16062    ///
16063    /// Servers, after sending the status response, should close the connection
16064    /// regardless of status and without sending an epitaph.
16065    ///
16066    /// Closing the client end of the channel should be semantically equivalent
16067    /// to calling `Close` without knowing when the close has completed or its
16068    /// status.
16069    Close {
16070        responder: SymlinkCloseResponder,
16071    },
16072    Query {
16073        responder: SymlinkQueryResponder,
16074    },
16075    /// DEPRECATED - Use `Node.GetAttributes` instead.
16076    ///
16077    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16078    DeprecatedGetAttr {
16079        responder: SymlinkDeprecatedGetAttrResponder,
16080    },
16081    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
16082    DeprecatedSetAttr {
16083        flags: NodeAttributeFlags,
16084        attributes: NodeAttributes,
16085        responder: SymlinkDeprecatedSetAttrResponder,
16086    },
16087    /// [DEPRECATED - Use new GetFlags method instead.]
16088    DeprecatedGetFlags {
16089        responder: SymlinkDeprecatedGetFlagsResponder,
16090    },
16091    /// [DEPRECATED - Use new SetFlags method instead.]
16092    DeprecatedSetFlags {
16093        flags: OpenFlags,
16094        responder: SymlinkDeprecatedSetFlagsResponder,
16095    },
16096    /// Queries the flags that apply to this node after it has been opened/created. This method does
16097    /// not require any rights.
16098    ///
16099    /// Note that the final set of flags that apply to the connection may differ from those
16100    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
16101    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
16102    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
16103    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
16104    GetFlags {
16105        responder: SymlinkGetFlagsResponder,
16106    },
16107    /// Sets the flags that apply to this node after it has been opened. This method does not
16108    /// require any rights.
16109    ///
16110    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
16111    /// clear append mode.
16112    ///
16113    /// Errors:
16114    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
16115    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
16116    SetFlags {
16117        flags: Flags,
16118        responder: SymlinkSetFlagsResponder,
16119    },
16120    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
16121    /// volume has different settings or the storage is accounted seperately from the rest of the
16122    /// filesystem that may be reported instead of filesystem-wide details.
16123    QueryFilesystem {
16124        responder: SymlinkQueryFilesystemResponder,
16125    },
16126    /// Acquires a token which can be used to identify this connection at a later point in
16127    /// time. The token will remain valid for as long as the connection requesting the token
16128    /// remains open.
16129    ///
16130    /// This method does not require any rights. Note that the token identifies
16131    /// the connection, hence carries the rights information on this connection.
16132    GetToken {
16133        responder: SymlinkGetTokenResponder,
16134    },
16135    /// Acquires information about the node.
16136    ///
16137    /// The attributes of a node should be stable, independent of the
16138    /// specific protocol used to access it.
16139    ///
16140    /// If a particular attribute is not applicable or not supported,
16141    /// filesystems should leave the corresponding field absent.
16142    ///
16143    /// + `query` a bit-mask specifying which attributes to fetch. The server
16144    ///   should not return more than necessary.
16145    /// - `attributes` the returned attributes.
16146    ///
16147    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
16148    GetAttributes {
16149        query: NodeAttributesQuery,
16150        responder: SymlinkGetAttributesResponder,
16151    },
16152    /// Updates information about the node.
16153    ///
16154    /// + `attributes` the presence of a table field in `attributes` indicates
16155    /// the intent to update the corresponding attribute.
16156    ///
16157    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
16158    ///
16159    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
16160    UpdateAttributes {
16161        payload: MutableNodeAttributes,
16162        responder: SymlinkUpdateAttributesResponder,
16163    },
16164    /// Synchronizes updates to the node to the underlying media, if it exists.
16165    ///
16166    /// This method will return when the filesystem server has flushed the
16167    /// relevant updates to the underlying media, but does not guarantee the
16168    /// underlying media has persisted the information, nor that any information
16169    /// is committed to hardware. Clients may use `Sync` to ensure ordering
16170    /// between operations.
16171    ///
16172    /// This method does not require any rights.
16173    Sync {
16174        responder: SymlinkSyncResponder,
16175    },
16176    /// Creates an iterator over all the extended attribute names associated
16177    /// with this node. If an error occurs it is returned as an epitaph on the
16178    /// iterator request channel, and then the channel is closed.
16179    ///
16180    /// GetExtendedAttributes can be used with any of these names to retrieve
16181    /// the associated value.
16182    ///
16183    /// This method requires the [`Rights.READ_BYTES`] right.
16184    ListExtendedAttributes {
16185        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
16186        control_handle: SymlinkControlHandle,
16187    },
16188    /// Get the value associated with the given attribute `name` for this node.
16189    ///
16190    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
16191    /// particular structure is imposed on them.
16192    ///
16193    /// This method requires the [`Rights.READ_BYTES`] right.
16194    GetExtendedAttribute {
16195        name: Vec<u8>,
16196        responder: SymlinkGetExtendedAttributeResponder,
16197    },
16198    /// Set the value for the given attribute `name` to `value` for this node.
16199    ///
16200    /// The attribute name may exist, in which case the attribute is updated.
16201    /// If the attribute doesn't exist, it is created. The name should have no
16202    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
16203    ///
16204    /// This method requires the [`Rights.WRITE_BYTES`] right.
16205    SetExtendedAttribute {
16206        name: Vec<u8>,
16207        value: ExtendedAttributeValue,
16208        mode: SetExtendedAttributeMode,
16209        responder: SymlinkSetExtendedAttributeResponder,
16210    },
16211    /// Remove the specified extended attribute.
16212    ///
16213    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
16214    ///
16215    /// This method requires the [`Rights.WRITE_BYTES`] right.
16216    RemoveExtendedAttribute {
16217        name: Vec<u8>,
16218        responder: SymlinkRemoveExtendedAttributeResponder,
16219    },
16220    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16221    /// epitaph sent on the `object` channel.
16222    ///
16223    /// Errors:
16224    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16225    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16226    Open {
16227        path: String,
16228        flags: Flags,
16229        options: Options,
16230        object: fdomain_client::Channel,
16231        control_handle: SymlinkControlHandle,
16232    },
16233    Describe {
16234        responder: SymlinkDescribeResponder,
16235    },
16236    /// An interaction was received which does not match any known method.
16237    #[non_exhaustive]
16238    _UnknownMethod {
16239        /// Ordinal of the method that was called.
16240        ordinal: u64,
16241        control_handle: SymlinkControlHandle,
16242        method_type: fidl::MethodType,
16243    },
16244}
16245
16246impl SymlinkRequest {
16247    #[allow(irrefutable_let_patterns)]
16248    pub fn into_link_into(
16249        self,
16250    ) -> Option<(fdomain_client::Event, String, SymlinkLinkIntoResponder)> {
16251        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
16252            Some((dst_parent_token, dst, responder))
16253        } else {
16254            None
16255        }
16256    }
16257
16258    #[allow(irrefutable_let_patterns)]
16259    pub fn into_clone(
16260        self,
16261    ) -> Option<(
16262        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
16263        SymlinkControlHandle,
16264    )> {
16265        if let SymlinkRequest::Clone { request, control_handle } = self {
16266            Some((request, control_handle))
16267        } else {
16268            None
16269        }
16270    }
16271
16272    #[allow(irrefutable_let_patterns)]
16273    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
16274        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
16275    }
16276
16277    #[allow(irrefutable_let_patterns)]
16278    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
16279        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
16280    }
16281
16282    #[allow(irrefutable_let_patterns)]
16283    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
16284        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
16285            Some((responder))
16286        } else {
16287            None
16288        }
16289    }
16290
16291    #[allow(irrefutable_let_patterns)]
16292    pub fn into_deprecated_set_attr(
16293        self,
16294    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
16295        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
16296            Some((flags, attributes, responder))
16297        } else {
16298            None
16299        }
16300    }
16301
16302    #[allow(irrefutable_let_patterns)]
16303    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
16304        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
16305            Some((responder))
16306        } else {
16307            None
16308        }
16309    }
16310
16311    #[allow(irrefutable_let_patterns)]
16312    pub fn into_deprecated_set_flags(
16313        self,
16314    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
16315        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
16316            Some((flags, responder))
16317        } else {
16318            None
16319        }
16320    }
16321
16322    #[allow(irrefutable_let_patterns)]
16323    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
16324        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
16325    }
16326
16327    #[allow(irrefutable_let_patterns)]
16328    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
16329        if let SymlinkRequest::SetFlags { flags, responder } = self {
16330            Some((flags, responder))
16331        } else {
16332            None
16333        }
16334    }
16335
16336    #[allow(irrefutable_let_patterns)]
16337    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
16338        if let SymlinkRequest::QueryFilesystem { responder } = self {
16339            Some((responder))
16340        } else {
16341            None
16342        }
16343    }
16344
16345    #[allow(irrefutable_let_patterns)]
16346    pub fn into_get_token(self) -> Option<(SymlinkGetTokenResponder)> {
16347        if let SymlinkRequest::GetToken { responder } = self { Some((responder)) } else { None }
16348    }
16349
16350    #[allow(irrefutable_let_patterns)]
16351    pub fn into_get_attributes(
16352        self,
16353    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
16354        if let SymlinkRequest::GetAttributes { query, responder } = self {
16355            Some((query, responder))
16356        } else {
16357            None
16358        }
16359    }
16360
16361    #[allow(irrefutable_let_patterns)]
16362    pub fn into_update_attributes(
16363        self,
16364    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
16365        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
16366            Some((payload, responder))
16367        } else {
16368            None
16369        }
16370    }
16371
16372    #[allow(irrefutable_let_patterns)]
16373    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
16374        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
16375    }
16376
16377    #[allow(irrefutable_let_patterns)]
16378    pub fn into_list_extended_attributes(
16379        self,
16380    ) -> Option<(
16381        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
16382        SymlinkControlHandle,
16383    )> {
16384        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
16385            Some((iterator, control_handle))
16386        } else {
16387            None
16388        }
16389    }
16390
16391    #[allow(irrefutable_let_patterns)]
16392    pub fn into_get_extended_attribute(
16393        self,
16394    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
16395        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
16396            Some((name, responder))
16397        } else {
16398            None
16399        }
16400    }
16401
16402    #[allow(irrefutable_let_patterns)]
16403    pub fn into_set_extended_attribute(
16404        self,
16405    ) -> Option<(
16406        Vec<u8>,
16407        ExtendedAttributeValue,
16408        SetExtendedAttributeMode,
16409        SymlinkSetExtendedAttributeResponder,
16410    )> {
16411        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
16412            Some((name, value, mode, responder))
16413        } else {
16414            None
16415        }
16416    }
16417
16418    #[allow(irrefutable_let_patterns)]
16419    pub fn into_remove_extended_attribute(
16420        self,
16421    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
16422        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
16423            Some((name, responder))
16424        } else {
16425            None
16426        }
16427    }
16428
16429    #[allow(irrefutable_let_patterns)]
16430    pub fn into_open(
16431        self,
16432    ) -> Option<(String, Flags, Options, fdomain_client::Channel, SymlinkControlHandle)> {
16433        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
16434            Some((path, flags, options, object, control_handle))
16435        } else {
16436            None
16437        }
16438    }
16439
16440    #[allow(irrefutable_let_patterns)]
16441    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
16442        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
16443    }
16444
16445    /// Name of the method defined in FIDL
16446    pub fn method_name(&self) -> &'static str {
16447        match *self {
16448            SymlinkRequest::LinkInto { .. } => "link_into",
16449            SymlinkRequest::Clone { .. } => "clone",
16450            SymlinkRequest::Close { .. } => "close",
16451            SymlinkRequest::Query { .. } => "query",
16452            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
16453            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
16454            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
16455            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
16456            SymlinkRequest::GetFlags { .. } => "get_flags",
16457            SymlinkRequest::SetFlags { .. } => "set_flags",
16458            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
16459            SymlinkRequest::GetToken { .. } => "get_token",
16460            SymlinkRequest::GetAttributes { .. } => "get_attributes",
16461            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
16462            SymlinkRequest::Sync { .. } => "sync",
16463            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
16464            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
16465            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
16466            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
16467            SymlinkRequest::Open { .. } => "open",
16468            SymlinkRequest::Describe { .. } => "describe",
16469            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16470                "unknown one-way method"
16471            }
16472            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16473                "unknown two-way method"
16474            }
16475        }
16476    }
16477}
16478
16479#[derive(Debug, Clone)]
16480pub struct SymlinkControlHandle {
16481    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
16482}
16483
16484impl SymlinkControlHandle {
16485    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16486        self.inner.shutdown_with_epitaph(status.into())
16487    }
16488}
16489
16490impl fdomain_client::fidl::ControlHandle for SymlinkControlHandle {
16491    fn shutdown(&self) {
16492        self.inner.shutdown()
16493    }
16494
16495    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16496        self.inner.shutdown_with_epitaph(status)
16497    }
16498
16499    fn is_closed(&self) -> bool {
16500        self.inner.channel().is_closed()
16501    }
16502    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
16503        self.inner.channel().on_closed()
16504    }
16505}
16506
16507impl SymlinkControlHandle {
16508    pub fn send_on_open_(
16509        &self,
16510        mut s: i32,
16511        mut info: Option<NodeInfoDeprecated>,
16512    ) -> Result<(), fidl::Error> {
16513        self.inner.send::<NodeOnOpenRequest>(
16514            (s, info.as_mut()),
16515            0,
16516            0x7fc7bbb1dbfd1972,
16517            fidl::encoding::DynamicFlags::FLEXIBLE,
16518        )
16519    }
16520
16521    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
16522        self.inner.send::<Representation>(
16523            &mut payload,
16524            0,
16525            0x5cb40567d80a510c,
16526            fidl::encoding::DynamicFlags::empty(),
16527        )
16528    }
16529}
16530
16531#[must_use = "FIDL methods require a response to be sent"]
16532#[derive(Debug)]
16533pub struct SymlinkLinkIntoResponder {
16534    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16535    tx_id: u32,
16536}
16537
16538/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16539/// if the responder is dropped without sending a response, so that the client
16540/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16541impl std::ops::Drop for SymlinkLinkIntoResponder {
16542    fn drop(&mut self) {
16543        self.control_handle.shutdown();
16544        // Safety: drops once, never accessed again
16545        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16546    }
16547}
16548
16549impl fdomain_client::fidl::Responder for SymlinkLinkIntoResponder {
16550    type ControlHandle = SymlinkControlHandle;
16551
16552    fn control_handle(&self) -> &SymlinkControlHandle {
16553        &self.control_handle
16554    }
16555
16556    fn drop_without_shutdown(mut self) {
16557        // Safety: drops once, never accessed again due to mem::forget
16558        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16559        // Prevent Drop from running (which would shut down the channel)
16560        std::mem::forget(self);
16561    }
16562}
16563
16564impl SymlinkLinkIntoResponder {
16565    /// Sends a response to the FIDL transaction.
16566    ///
16567    /// Sets the channel to shutdown if an error occurs.
16568    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16569        let _result = self.send_raw(result);
16570        if _result.is_err() {
16571            self.control_handle.shutdown();
16572        }
16573        self.drop_without_shutdown();
16574        _result
16575    }
16576
16577    /// Similar to "send" but does not shutdown the channel if an error occurs.
16578    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16579        let _result = self.send_raw(result);
16580        self.drop_without_shutdown();
16581        _result
16582    }
16583
16584    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16585        self.control_handle
16586            .inner
16587            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16588                result,
16589                self.tx_id,
16590                0x54f3949246a03e74,
16591                fidl::encoding::DynamicFlags::empty(),
16592            )
16593    }
16594}
16595
16596#[must_use = "FIDL methods require a response to be sent"]
16597#[derive(Debug)]
16598pub struct SymlinkCloseResponder {
16599    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16600    tx_id: u32,
16601}
16602
16603/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16604/// if the responder is dropped without sending a response, so that the client
16605/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16606impl std::ops::Drop for SymlinkCloseResponder {
16607    fn drop(&mut self) {
16608        self.control_handle.shutdown();
16609        // Safety: drops once, never accessed again
16610        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16611    }
16612}
16613
16614impl fdomain_client::fidl::Responder for SymlinkCloseResponder {
16615    type ControlHandle = SymlinkControlHandle;
16616
16617    fn control_handle(&self) -> &SymlinkControlHandle {
16618        &self.control_handle
16619    }
16620
16621    fn drop_without_shutdown(mut self) {
16622        // Safety: drops once, never accessed again due to mem::forget
16623        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16624        // Prevent Drop from running (which would shut down the channel)
16625        std::mem::forget(self);
16626    }
16627}
16628
16629impl SymlinkCloseResponder {
16630    /// Sends a response to the FIDL transaction.
16631    ///
16632    /// Sets the channel to shutdown if an error occurs.
16633    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16634        let _result = self.send_raw(result);
16635        if _result.is_err() {
16636            self.control_handle.shutdown();
16637        }
16638        self.drop_without_shutdown();
16639        _result
16640    }
16641
16642    /// Similar to "send" but does not shutdown the channel if an error occurs.
16643    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16644        let _result = self.send_raw(result);
16645        self.drop_without_shutdown();
16646        _result
16647    }
16648
16649    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16650        self.control_handle
16651            .inner
16652            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16653                result,
16654                self.tx_id,
16655                0x5ac5d459ad7f657e,
16656                fidl::encoding::DynamicFlags::empty(),
16657            )
16658    }
16659}
16660
16661#[must_use = "FIDL methods require a response to be sent"]
16662#[derive(Debug)]
16663pub struct SymlinkQueryResponder {
16664    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16665    tx_id: u32,
16666}
16667
16668/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16669/// if the responder is dropped without sending a response, so that the client
16670/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16671impl std::ops::Drop for SymlinkQueryResponder {
16672    fn drop(&mut self) {
16673        self.control_handle.shutdown();
16674        // Safety: drops once, never accessed again
16675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16676    }
16677}
16678
16679impl fdomain_client::fidl::Responder for SymlinkQueryResponder {
16680    type ControlHandle = SymlinkControlHandle;
16681
16682    fn control_handle(&self) -> &SymlinkControlHandle {
16683        &self.control_handle
16684    }
16685
16686    fn drop_without_shutdown(mut self) {
16687        // Safety: drops once, never accessed again due to mem::forget
16688        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16689        // Prevent Drop from running (which would shut down the channel)
16690        std::mem::forget(self);
16691    }
16692}
16693
16694impl SymlinkQueryResponder {
16695    /// Sends a response to the FIDL transaction.
16696    ///
16697    /// Sets the channel to shutdown if an error occurs.
16698    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16699        let _result = self.send_raw(protocol);
16700        if _result.is_err() {
16701            self.control_handle.shutdown();
16702        }
16703        self.drop_without_shutdown();
16704        _result
16705    }
16706
16707    /// Similar to "send" but does not shutdown the channel if an error occurs.
16708    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16709        let _result = self.send_raw(protocol);
16710        self.drop_without_shutdown();
16711        _result
16712    }
16713
16714    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16715        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
16716            (protocol,),
16717            self.tx_id,
16718            0x2658edee9decfc06,
16719            fidl::encoding::DynamicFlags::empty(),
16720        )
16721    }
16722}
16723
16724#[must_use = "FIDL methods require a response to be sent"]
16725#[derive(Debug)]
16726pub struct SymlinkDeprecatedGetAttrResponder {
16727    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16728    tx_id: u32,
16729}
16730
16731/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16732/// if the responder is dropped without sending a response, so that the client
16733/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16734impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
16735    fn drop(&mut self) {
16736        self.control_handle.shutdown();
16737        // Safety: drops once, never accessed again
16738        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16739    }
16740}
16741
16742impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetAttrResponder {
16743    type ControlHandle = SymlinkControlHandle;
16744
16745    fn control_handle(&self) -> &SymlinkControlHandle {
16746        &self.control_handle
16747    }
16748
16749    fn drop_without_shutdown(mut self) {
16750        // Safety: drops once, never accessed again due to mem::forget
16751        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16752        // Prevent Drop from running (which would shut down the channel)
16753        std::mem::forget(self);
16754    }
16755}
16756
16757impl SymlinkDeprecatedGetAttrResponder {
16758    /// Sends a response to the FIDL transaction.
16759    ///
16760    /// Sets the channel to shutdown if an error occurs.
16761    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16762        let _result = self.send_raw(s, attributes);
16763        if _result.is_err() {
16764            self.control_handle.shutdown();
16765        }
16766        self.drop_without_shutdown();
16767        _result
16768    }
16769
16770    /// Similar to "send" but does not shutdown the channel if an error occurs.
16771    pub fn send_no_shutdown_on_err(
16772        self,
16773        mut s: i32,
16774        mut attributes: &NodeAttributes,
16775    ) -> Result<(), fidl::Error> {
16776        let _result = self.send_raw(s, attributes);
16777        self.drop_without_shutdown();
16778        _result
16779    }
16780
16781    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16782        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
16783            (s, attributes),
16784            self.tx_id,
16785            0x78985e216314dafd,
16786            fidl::encoding::DynamicFlags::empty(),
16787        )
16788    }
16789}
16790
16791#[must_use = "FIDL methods require a response to be sent"]
16792#[derive(Debug)]
16793pub struct SymlinkDeprecatedSetAttrResponder {
16794    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16795    tx_id: u32,
16796}
16797
16798/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16799/// if the responder is dropped without sending a response, so that the client
16800/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16801impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
16802    fn drop(&mut self) {
16803        self.control_handle.shutdown();
16804        // Safety: drops once, never accessed again
16805        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16806    }
16807}
16808
16809impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetAttrResponder {
16810    type ControlHandle = SymlinkControlHandle;
16811
16812    fn control_handle(&self) -> &SymlinkControlHandle {
16813        &self.control_handle
16814    }
16815
16816    fn drop_without_shutdown(mut self) {
16817        // Safety: drops once, never accessed again due to mem::forget
16818        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16819        // Prevent Drop from running (which would shut down the channel)
16820        std::mem::forget(self);
16821    }
16822}
16823
16824impl SymlinkDeprecatedSetAttrResponder {
16825    /// Sends a response to the FIDL transaction.
16826    ///
16827    /// Sets the channel to shutdown if an error occurs.
16828    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16829        let _result = self.send_raw(s);
16830        if _result.is_err() {
16831            self.control_handle.shutdown();
16832        }
16833        self.drop_without_shutdown();
16834        _result
16835    }
16836
16837    /// Similar to "send" but does not shutdown the channel if an error occurs.
16838    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16839        let _result = self.send_raw(s);
16840        self.drop_without_shutdown();
16841        _result
16842    }
16843
16844    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16845        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
16846            (s,),
16847            self.tx_id,
16848            0x4186c0f40d938f46,
16849            fidl::encoding::DynamicFlags::empty(),
16850        )
16851    }
16852}
16853
16854#[must_use = "FIDL methods require a response to be sent"]
16855#[derive(Debug)]
16856pub struct SymlinkDeprecatedGetFlagsResponder {
16857    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16858    tx_id: u32,
16859}
16860
16861/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16862/// if the responder is dropped without sending a response, so that the client
16863/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16864impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
16865    fn drop(&mut self) {
16866        self.control_handle.shutdown();
16867        // Safety: drops once, never accessed again
16868        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16869    }
16870}
16871
16872impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetFlagsResponder {
16873    type ControlHandle = SymlinkControlHandle;
16874
16875    fn control_handle(&self) -> &SymlinkControlHandle {
16876        &self.control_handle
16877    }
16878
16879    fn drop_without_shutdown(mut self) {
16880        // Safety: drops once, never accessed again due to mem::forget
16881        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16882        // Prevent Drop from running (which would shut down the channel)
16883        std::mem::forget(self);
16884    }
16885}
16886
16887impl SymlinkDeprecatedGetFlagsResponder {
16888    /// Sends a response to the FIDL transaction.
16889    ///
16890    /// Sets the channel to shutdown if an error occurs.
16891    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16892        let _result = self.send_raw(s, flags);
16893        if _result.is_err() {
16894            self.control_handle.shutdown();
16895        }
16896        self.drop_without_shutdown();
16897        _result
16898    }
16899
16900    /// Similar to "send" but does not shutdown the channel if an error occurs.
16901    pub fn send_no_shutdown_on_err(
16902        self,
16903        mut s: i32,
16904        mut flags: OpenFlags,
16905    ) -> Result<(), fidl::Error> {
16906        let _result = self.send_raw(s, flags);
16907        self.drop_without_shutdown();
16908        _result
16909    }
16910
16911    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16912        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
16913            (s, flags),
16914            self.tx_id,
16915            0x5b88fffb8eda3aa1,
16916            fidl::encoding::DynamicFlags::empty(),
16917        )
16918    }
16919}
16920
16921#[must_use = "FIDL methods require a response to be sent"]
16922#[derive(Debug)]
16923pub struct SymlinkDeprecatedSetFlagsResponder {
16924    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16925    tx_id: u32,
16926}
16927
16928/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16929/// if the responder is dropped without sending a response, so that the client
16930/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16931impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
16932    fn drop(&mut self) {
16933        self.control_handle.shutdown();
16934        // Safety: drops once, never accessed again
16935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16936    }
16937}
16938
16939impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetFlagsResponder {
16940    type ControlHandle = SymlinkControlHandle;
16941
16942    fn control_handle(&self) -> &SymlinkControlHandle {
16943        &self.control_handle
16944    }
16945
16946    fn drop_without_shutdown(mut self) {
16947        // Safety: drops once, never accessed again due to mem::forget
16948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16949        // Prevent Drop from running (which would shut down the channel)
16950        std::mem::forget(self);
16951    }
16952}
16953
16954impl SymlinkDeprecatedSetFlagsResponder {
16955    /// Sends a response to the FIDL transaction.
16956    ///
16957    /// Sets the channel to shutdown if an error occurs.
16958    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16959        let _result = self.send_raw(s);
16960        if _result.is_err() {
16961            self.control_handle.shutdown();
16962        }
16963        self.drop_without_shutdown();
16964        _result
16965    }
16966
16967    /// Similar to "send" but does not shutdown the channel if an error occurs.
16968    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16969        let _result = self.send_raw(s);
16970        self.drop_without_shutdown();
16971        _result
16972    }
16973
16974    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16975        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
16976            (s,),
16977            self.tx_id,
16978            0x5295b76c71fde733,
16979            fidl::encoding::DynamicFlags::empty(),
16980        )
16981    }
16982}
16983
16984#[must_use = "FIDL methods require a response to be sent"]
16985#[derive(Debug)]
16986pub struct SymlinkGetFlagsResponder {
16987    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16988    tx_id: u32,
16989}
16990
16991/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16992/// if the responder is dropped without sending a response, so that the client
16993/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16994impl std::ops::Drop for SymlinkGetFlagsResponder {
16995    fn drop(&mut self) {
16996        self.control_handle.shutdown();
16997        // Safety: drops once, never accessed again
16998        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16999    }
17000}
17001
17002impl fdomain_client::fidl::Responder for SymlinkGetFlagsResponder {
17003    type ControlHandle = SymlinkControlHandle;
17004
17005    fn control_handle(&self) -> &SymlinkControlHandle {
17006        &self.control_handle
17007    }
17008
17009    fn drop_without_shutdown(mut self) {
17010        // Safety: drops once, never accessed again due to mem::forget
17011        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17012        // Prevent Drop from running (which would shut down the channel)
17013        std::mem::forget(self);
17014    }
17015}
17016
17017impl SymlinkGetFlagsResponder {
17018    /// Sends a response to the FIDL transaction.
17019    ///
17020    /// Sets the channel to shutdown if an error occurs.
17021    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
17022        let _result = self.send_raw(result);
17023        if _result.is_err() {
17024            self.control_handle.shutdown();
17025        }
17026        self.drop_without_shutdown();
17027        _result
17028    }
17029
17030    /// Similar to "send" but does not shutdown the channel if an error occurs.
17031    pub fn send_no_shutdown_on_err(
17032        self,
17033        mut result: Result<Flags, i32>,
17034    ) -> Result<(), fidl::Error> {
17035        let _result = self.send_raw(result);
17036        self.drop_without_shutdown();
17037        _result
17038    }
17039
17040    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
17041        self.control_handle
17042            .inner
17043            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
17044                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
17045                self.tx_id,
17046                0x176eb318f64ec23,
17047                fidl::encoding::DynamicFlags::FLEXIBLE,
17048            )
17049    }
17050}
17051
17052#[must_use = "FIDL methods require a response to be sent"]
17053#[derive(Debug)]
17054pub struct SymlinkSetFlagsResponder {
17055    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17056    tx_id: u32,
17057}
17058
17059/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17060/// if the responder is dropped without sending a response, so that the client
17061/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17062impl std::ops::Drop for SymlinkSetFlagsResponder {
17063    fn drop(&mut self) {
17064        self.control_handle.shutdown();
17065        // Safety: drops once, never accessed again
17066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17067    }
17068}
17069
17070impl fdomain_client::fidl::Responder for SymlinkSetFlagsResponder {
17071    type ControlHandle = SymlinkControlHandle;
17072
17073    fn control_handle(&self) -> &SymlinkControlHandle {
17074        &self.control_handle
17075    }
17076
17077    fn drop_without_shutdown(mut self) {
17078        // Safety: drops once, never accessed again due to mem::forget
17079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17080        // Prevent Drop from running (which would shut down the channel)
17081        std::mem::forget(self);
17082    }
17083}
17084
17085impl SymlinkSetFlagsResponder {
17086    /// Sends a response to the FIDL transaction.
17087    ///
17088    /// Sets the channel to shutdown if an error occurs.
17089    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17090        let _result = self.send_raw(result);
17091        if _result.is_err() {
17092            self.control_handle.shutdown();
17093        }
17094        self.drop_without_shutdown();
17095        _result
17096    }
17097
17098    /// Similar to "send" but does not shutdown the channel if an error occurs.
17099    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17100        let _result = self.send_raw(result);
17101        self.drop_without_shutdown();
17102        _result
17103    }
17104
17105    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17106        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
17107            fidl::encoding::EmptyStruct,
17108            i32,
17109        >>(
17110            fidl::encoding::FlexibleResult::new(result),
17111            self.tx_id,
17112            0x55a8028685791ea8,
17113            fidl::encoding::DynamicFlags::FLEXIBLE,
17114        )
17115    }
17116}
17117
17118#[must_use = "FIDL methods require a response to be sent"]
17119#[derive(Debug)]
17120pub struct SymlinkQueryFilesystemResponder {
17121    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17122    tx_id: u32,
17123}
17124
17125/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17126/// if the responder is dropped without sending a response, so that the client
17127/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17128impl std::ops::Drop for SymlinkQueryFilesystemResponder {
17129    fn drop(&mut self) {
17130        self.control_handle.shutdown();
17131        // Safety: drops once, never accessed again
17132        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17133    }
17134}
17135
17136impl fdomain_client::fidl::Responder for SymlinkQueryFilesystemResponder {
17137    type ControlHandle = SymlinkControlHandle;
17138
17139    fn control_handle(&self) -> &SymlinkControlHandle {
17140        &self.control_handle
17141    }
17142
17143    fn drop_without_shutdown(mut self) {
17144        // Safety: drops once, never accessed again due to mem::forget
17145        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17146        // Prevent Drop from running (which would shut down the channel)
17147        std::mem::forget(self);
17148    }
17149}
17150
17151impl SymlinkQueryFilesystemResponder {
17152    /// Sends a response to the FIDL transaction.
17153    ///
17154    /// Sets the channel to shutdown if an error occurs.
17155    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
17156        let _result = self.send_raw(s, info);
17157        if _result.is_err() {
17158            self.control_handle.shutdown();
17159        }
17160        self.drop_without_shutdown();
17161        _result
17162    }
17163
17164    /// Similar to "send" but does not shutdown the channel if an error occurs.
17165    pub fn send_no_shutdown_on_err(
17166        self,
17167        mut s: i32,
17168        mut info: Option<&FilesystemInfo>,
17169    ) -> Result<(), fidl::Error> {
17170        let _result = self.send_raw(s, info);
17171        self.drop_without_shutdown();
17172        _result
17173    }
17174
17175    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
17176        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
17177            (s, info),
17178            self.tx_id,
17179            0x6f344a1c6b0a0610,
17180            fidl::encoding::DynamicFlags::empty(),
17181        )
17182    }
17183}
17184
17185#[must_use = "FIDL methods require a response to be sent"]
17186#[derive(Debug)]
17187pub struct SymlinkGetTokenResponder {
17188    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17189    tx_id: u32,
17190}
17191
17192/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17193/// if the responder is dropped without sending a response, so that the client
17194/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17195impl std::ops::Drop for SymlinkGetTokenResponder {
17196    fn drop(&mut self) {
17197        self.control_handle.shutdown();
17198        // Safety: drops once, never accessed again
17199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17200    }
17201}
17202
17203impl fdomain_client::fidl::Responder for SymlinkGetTokenResponder {
17204    type ControlHandle = SymlinkControlHandle;
17205
17206    fn control_handle(&self) -> &SymlinkControlHandle {
17207        &self.control_handle
17208    }
17209
17210    fn drop_without_shutdown(mut self) {
17211        // Safety: drops once, never accessed again due to mem::forget
17212        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17213        // Prevent Drop from running (which would shut down the channel)
17214        std::mem::forget(self);
17215    }
17216}
17217
17218impl SymlinkGetTokenResponder {
17219    /// Sends a response to the FIDL transaction.
17220    ///
17221    /// Sets the channel to shutdown if an error occurs.
17222    pub fn send(self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
17223        let _result = self.send_raw(result);
17224        if _result.is_err() {
17225            self.control_handle.shutdown();
17226        }
17227        self.drop_without_shutdown();
17228        _result
17229    }
17230
17231    /// Similar to "send" but does not shutdown the channel if an error occurs.
17232    pub fn send_no_shutdown_on_err(
17233        self,
17234        mut result: Result<fdomain_client::Event, i32>,
17235    ) -> Result<(), fidl::Error> {
17236        let _result = self.send_raw(result);
17237        self.drop_without_shutdown();
17238        _result
17239    }
17240
17241    fn send_raw(&self, mut result: Result<fdomain_client::Event, i32>) -> Result<(), fidl::Error> {
17242        self.control_handle
17243            .inner
17244            .send::<fidl::encoding::FlexibleResultType<NodeGetTokenResponse, i32>>(
17245                fidl::encoding::FlexibleResult::new(result.map(|token| (token,))),
17246                self.tx_id,
17247                0x5054f0ade7076cec,
17248                fidl::encoding::DynamicFlags::FLEXIBLE,
17249            )
17250    }
17251}
17252
17253#[must_use = "FIDL methods require a response to be sent"]
17254#[derive(Debug)]
17255pub struct SymlinkGetAttributesResponder {
17256    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17257    tx_id: u32,
17258}
17259
17260/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17261/// if the responder is dropped without sending a response, so that the client
17262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17263impl std::ops::Drop for SymlinkGetAttributesResponder {
17264    fn drop(&mut self) {
17265        self.control_handle.shutdown();
17266        // Safety: drops once, never accessed again
17267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17268    }
17269}
17270
17271impl fdomain_client::fidl::Responder for SymlinkGetAttributesResponder {
17272    type ControlHandle = SymlinkControlHandle;
17273
17274    fn control_handle(&self) -> &SymlinkControlHandle {
17275        &self.control_handle
17276    }
17277
17278    fn drop_without_shutdown(mut self) {
17279        // Safety: drops once, never accessed again due to mem::forget
17280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17281        // Prevent Drop from running (which would shut down the channel)
17282        std::mem::forget(self);
17283    }
17284}
17285
17286impl SymlinkGetAttributesResponder {
17287    /// Sends a response to the FIDL transaction.
17288    ///
17289    /// Sets the channel to shutdown if an error occurs.
17290    pub fn send(
17291        self,
17292        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
17293    ) -> Result<(), fidl::Error> {
17294        let _result = self.send_raw(result);
17295        if _result.is_err() {
17296            self.control_handle.shutdown();
17297        }
17298        self.drop_without_shutdown();
17299        _result
17300    }
17301
17302    /// Similar to "send" but does not shutdown the channel if an error occurs.
17303    pub fn send_no_shutdown_on_err(
17304        self,
17305        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
17306    ) -> Result<(), fidl::Error> {
17307        let _result = self.send_raw(result);
17308        self.drop_without_shutdown();
17309        _result
17310    }
17311
17312    fn send_raw(
17313        &self,
17314        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
17315    ) -> Result<(), fidl::Error> {
17316        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
17317            result,
17318            self.tx_id,
17319            0x3d4396a638ea053b,
17320            fidl::encoding::DynamicFlags::empty(),
17321        )
17322    }
17323}
17324
17325#[must_use = "FIDL methods require a response to be sent"]
17326#[derive(Debug)]
17327pub struct SymlinkUpdateAttributesResponder {
17328    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17329    tx_id: u32,
17330}
17331
17332/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17333/// if the responder is dropped without sending a response, so that the client
17334/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17335impl std::ops::Drop for SymlinkUpdateAttributesResponder {
17336    fn drop(&mut self) {
17337        self.control_handle.shutdown();
17338        // Safety: drops once, never accessed again
17339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17340    }
17341}
17342
17343impl fdomain_client::fidl::Responder for SymlinkUpdateAttributesResponder {
17344    type ControlHandle = SymlinkControlHandle;
17345
17346    fn control_handle(&self) -> &SymlinkControlHandle {
17347        &self.control_handle
17348    }
17349
17350    fn drop_without_shutdown(mut self) {
17351        // Safety: drops once, never accessed again due to mem::forget
17352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17353        // Prevent Drop from running (which would shut down the channel)
17354        std::mem::forget(self);
17355    }
17356}
17357
17358impl SymlinkUpdateAttributesResponder {
17359    /// Sends a response to the FIDL transaction.
17360    ///
17361    /// Sets the channel to shutdown if an error occurs.
17362    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17363        let _result = self.send_raw(result);
17364        if _result.is_err() {
17365            self.control_handle.shutdown();
17366        }
17367        self.drop_without_shutdown();
17368        _result
17369    }
17370
17371    /// Similar to "send" but does not shutdown the channel if an error occurs.
17372    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17373        let _result = self.send_raw(result);
17374        self.drop_without_shutdown();
17375        _result
17376    }
17377
17378    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17379        self.control_handle
17380            .inner
17381            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17382                result,
17383                self.tx_id,
17384                0x3308c1da5a89bf08,
17385                fidl::encoding::DynamicFlags::empty(),
17386            )
17387    }
17388}
17389
17390#[must_use = "FIDL methods require a response to be sent"]
17391#[derive(Debug)]
17392pub struct SymlinkSyncResponder {
17393    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17394    tx_id: u32,
17395}
17396
17397/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17398/// if the responder is dropped without sending a response, so that the client
17399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17400impl std::ops::Drop for SymlinkSyncResponder {
17401    fn drop(&mut self) {
17402        self.control_handle.shutdown();
17403        // Safety: drops once, never accessed again
17404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17405    }
17406}
17407
17408impl fdomain_client::fidl::Responder for SymlinkSyncResponder {
17409    type ControlHandle = SymlinkControlHandle;
17410
17411    fn control_handle(&self) -> &SymlinkControlHandle {
17412        &self.control_handle
17413    }
17414
17415    fn drop_without_shutdown(mut self) {
17416        // Safety: drops once, never accessed again due to mem::forget
17417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17418        // Prevent Drop from running (which would shut down the channel)
17419        std::mem::forget(self);
17420    }
17421}
17422
17423impl SymlinkSyncResponder {
17424    /// Sends a response to the FIDL transaction.
17425    ///
17426    /// Sets the channel to shutdown if an error occurs.
17427    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17428        let _result = self.send_raw(result);
17429        if _result.is_err() {
17430            self.control_handle.shutdown();
17431        }
17432        self.drop_without_shutdown();
17433        _result
17434    }
17435
17436    /// Similar to "send" but does not shutdown the channel if an error occurs.
17437    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17438        let _result = self.send_raw(result);
17439        self.drop_without_shutdown();
17440        _result
17441    }
17442
17443    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17444        self.control_handle
17445            .inner
17446            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17447                result,
17448                self.tx_id,
17449                0x2c5c27ca0ab5dc49,
17450                fidl::encoding::DynamicFlags::empty(),
17451            )
17452    }
17453}
17454
17455#[must_use = "FIDL methods require a response to be sent"]
17456#[derive(Debug)]
17457pub struct SymlinkGetExtendedAttributeResponder {
17458    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17459    tx_id: u32,
17460}
17461
17462/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17463/// if the responder is dropped without sending a response, so that the client
17464/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17465impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
17466    fn drop(&mut self) {
17467        self.control_handle.shutdown();
17468        // Safety: drops once, never accessed again
17469        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17470    }
17471}
17472
17473impl fdomain_client::fidl::Responder for SymlinkGetExtendedAttributeResponder {
17474    type ControlHandle = SymlinkControlHandle;
17475
17476    fn control_handle(&self) -> &SymlinkControlHandle {
17477        &self.control_handle
17478    }
17479
17480    fn drop_without_shutdown(mut self) {
17481        // Safety: drops once, never accessed again due to mem::forget
17482        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17483        // Prevent Drop from running (which would shut down the channel)
17484        std::mem::forget(self);
17485    }
17486}
17487
17488impl SymlinkGetExtendedAttributeResponder {
17489    /// Sends a response to the FIDL transaction.
17490    ///
17491    /// Sets the channel to shutdown if an error occurs.
17492    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17493        let _result = self.send_raw(result);
17494        if _result.is_err() {
17495            self.control_handle.shutdown();
17496        }
17497        self.drop_without_shutdown();
17498        _result
17499    }
17500
17501    /// Similar to "send" but does not shutdown the channel if an error occurs.
17502    pub fn send_no_shutdown_on_err(
17503        self,
17504        mut result: Result<ExtendedAttributeValue, i32>,
17505    ) -> Result<(), fidl::Error> {
17506        let _result = self.send_raw(result);
17507        self.drop_without_shutdown();
17508        _result
17509    }
17510
17511    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17512        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
17513            result.as_mut().map_err(|e| *e),
17514            self.tx_id,
17515            0x45ffa3ccfdeb76db,
17516            fidl::encoding::DynamicFlags::empty(),
17517        )
17518    }
17519}
17520
17521#[must_use = "FIDL methods require a response to be sent"]
17522#[derive(Debug)]
17523pub struct SymlinkSetExtendedAttributeResponder {
17524    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17525    tx_id: u32,
17526}
17527
17528/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17529/// if the responder is dropped without sending a response, so that the client
17530/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17531impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
17532    fn drop(&mut self) {
17533        self.control_handle.shutdown();
17534        // Safety: drops once, never accessed again
17535        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17536    }
17537}
17538
17539impl fdomain_client::fidl::Responder for SymlinkSetExtendedAttributeResponder {
17540    type ControlHandle = SymlinkControlHandle;
17541
17542    fn control_handle(&self) -> &SymlinkControlHandle {
17543        &self.control_handle
17544    }
17545
17546    fn drop_without_shutdown(mut self) {
17547        // Safety: drops once, never accessed again due to mem::forget
17548        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17549        // Prevent Drop from running (which would shut down the channel)
17550        std::mem::forget(self);
17551    }
17552}
17553
17554impl SymlinkSetExtendedAttributeResponder {
17555    /// Sends a response to the FIDL transaction.
17556    ///
17557    /// Sets the channel to shutdown if an error occurs.
17558    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17559        let _result = self.send_raw(result);
17560        if _result.is_err() {
17561            self.control_handle.shutdown();
17562        }
17563        self.drop_without_shutdown();
17564        _result
17565    }
17566
17567    /// Similar to "send" but does not shutdown the channel if an error occurs.
17568    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17569        let _result = self.send_raw(result);
17570        self.drop_without_shutdown();
17571        _result
17572    }
17573
17574    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17575        self.control_handle
17576            .inner
17577            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17578                result,
17579                self.tx_id,
17580                0x4a951362f681f23c,
17581                fidl::encoding::DynamicFlags::empty(),
17582            )
17583    }
17584}
17585
17586#[must_use = "FIDL methods require a response to be sent"]
17587#[derive(Debug)]
17588pub struct SymlinkRemoveExtendedAttributeResponder {
17589    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17590    tx_id: u32,
17591}
17592
17593/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17594/// if the responder is dropped without sending a response, so that the client
17595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17596impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
17597    fn drop(&mut self) {
17598        self.control_handle.shutdown();
17599        // Safety: drops once, never accessed again
17600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17601    }
17602}
17603
17604impl fdomain_client::fidl::Responder for SymlinkRemoveExtendedAttributeResponder {
17605    type ControlHandle = SymlinkControlHandle;
17606
17607    fn control_handle(&self) -> &SymlinkControlHandle {
17608        &self.control_handle
17609    }
17610
17611    fn drop_without_shutdown(mut self) {
17612        // Safety: drops once, never accessed again due to mem::forget
17613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17614        // Prevent Drop from running (which would shut down the channel)
17615        std::mem::forget(self);
17616    }
17617}
17618
17619impl SymlinkRemoveExtendedAttributeResponder {
17620    /// Sends a response to the FIDL transaction.
17621    ///
17622    /// Sets the channel to shutdown if an error occurs.
17623    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17624        let _result = self.send_raw(result);
17625        if _result.is_err() {
17626            self.control_handle.shutdown();
17627        }
17628        self.drop_without_shutdown();
17629        _result
17630    }
17631
17632    /// Similar to "send" but does not shutdown the channel if an error occurs.
17633    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17634        let _result = self.send_raw(result);
17635        self.drop_without_shutdown();
17636        _result
17637    }
17638
17639    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17640        self.control_handle
17641            .inner
17642            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17643                result,
17644                self.tx_id,
17645                0x7a0b9f3a9bf9032d,
17646                fidl::encoding::DynamicFlags::empty(),
17647            )
17648    }
17649}
17650
17651#[must_use = "FIDL methods require a response to be sent"]
17652#[derive(Debug)]
17653pub struct SymlinkDescribeResponder {
17654    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17655    tx_id: u32,
17656}
17657
17658/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17659/// if the responder is dropped without sending a response, so that the client
17660/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17661impl std::ops::Drop for SymlinkDescribeResponder {
17662    fn drop(&mut self) {
17663        self.control_handle.shutdown();
17664        // Safety: drops once, never accessed again
17665        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17666    }
17667}
17668
17669impl fdomain_client::fidl::Responder for SymlinkDescribeResponder {
17670    type ControlHandle = SymlinkControlHandle;
17671
17672    fn control_handle(&self) -> &SymlinkControlHandle {
17673        &self.control_handle
17674    }
17675
17676    fn drop_without_shutdown(mut self) {
17677        // Safety: drops once, never accessed again due to mem::forget
17678        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17679        // Prevent Drop from running (which would shut down the channel)
17680        std::mem::forget(self);
17681    }
17682}
17683
17684impl SymlinkDescribeResponder {
17685    /// Sends a response to the FIDL transaction.
17686    ///
17687    /// Sets the channel to shutdown if an error occurs.
17688    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17689        let _result = self.send_raw(payload);
17690        if _result.is_err() {
17691            self.control_handle.shutdown();
17692        }
17693        self.drop_without_shutdown();
17694        _result
17695    }
17696
17697    /// Similar to "send" but does not shutdown the channel if an error occurs.
17698    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17699        let _result = self.send_raw(payload);
17700        self.drop_without_shutdown();
17701        _result
17702    }
17703
17704    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17705        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
17706            fidl::encoding::Flexible::new(payload),
17707            self.tx_id,
17708            0x742c2ea5e89831f3,
17709            fidl::encoding::DynamicFlags::FLEXIBLE,
17710        )
17711    }
17712}
17713
17714#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17715pub struct WritableMarker;
17716
17717impl fdomain_client::fidl::ProtocolMarker for WritableMarker {
17718    type Proxy = WritableProxy;
17719    type RequestStream = WritableRequestStream;
17720
17721    const DEBUG_NAME: &'static str = "(anonymous) Writable";
17722}
17723pub type WritableWriteResult = Result<u64, i32>;
17724
17725pub trait WritableProxyInterface: Send + Sync {
17726    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
17727        + Send;
17728    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
17729}
17730
17731#[derive(Debug, Clone)]
17732pub struct WritableProxy {
17733    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
17734}
17735
17736impl fdomain_client::fidl::Proxy for WritableProxy {
17737    type Protocol = WritableMarker;
17738
17739    fn from_channel(inner: fdomain_client::Channel) -> Self {
17740        Self::new(inner)
17741    }
17742
17743    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
17744        self.client.into_channel().map_err(|client| Self { client })
17745    }
17746
17747    fn as_channel(&self) -> &fdomain_client::Channel {
17748        self.client.as_channel()
17749    }
17750}
17751
17752impl WritableProxy {
17753    /// Create a new Proxy for fuchsia.io/Writable.
17754    pub fn new(channel: fdomain_client::Channel) -> Self {
17755        let protocol_name = <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
17756        Self { client: fidl::client::Client::new(channel, protocol_name) }
17757    }
17758
17759    /// Get a Stream of events from the remote end of the protocol.
17760    ///
17761    /// # Panics
17762    ///
17763    /// Panics if the event stream was already taken.
17764    pub fn take_event_stream(&self) -> WritableEventStream {
17765        WritableEventStream { event_receiver: self.client.take_event_receiver() }
17766    }
17767
17768    /// Writes data at the seek offset.
17769    /// The seek offset is moved forward by the number of bytes written.
17770    /// If the file is in append mode, the seek offset is first set to the end
17771    /// of the file, followed by the write, in one atomic step.
17772    ///
17773    /// The file size may grow if the seek offset plus `data.length` is beyond
17774    /// the current end of file.
17775    ///
17776    /// + request `data` the byte buffer to write to the file.
17777    /// - response `actual_count` the number of bytes written.
17778    ///
17779    /// ## Invariants
17780    ///
17781    /// * The returned `actual_count` will never be greater than `data.length`.
17782    /// * If the server is unable to write all the data due to e.g. not enough
17783    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17784    ///   could be written, an error is returned.
17785    /// * If `data.length` is zero, the server should perform all the checks
17786    ///   ensuring write access without mutating the file and return a
17787    ///   successful write of zero bytes.  The seek offset is still updated if
17788    ///   in append mode.
17789    ///
17790    /// This method requires the [`Rights.WRITE_BYTES`] right.
17791    pub fn r#write(
17792        &self,
17793        mut data: &[u8],
17794    ) -> fidl::client::QueryResponseFut<
17795        WritableWriteResult,
17796        fdomain_client::fidl::FDomainResourceDialect,
17797    > {
17798        WritableProxyInterface::r#write(self, data)
17799    }
17800}
17801
17802impl WritableProxyInterface for WritableProxy {
17803    type WriteResponseFut = fidl::client::QueryResponseFut<
17804        WritableWriteResult,
17805        fdomain_client::fidl::FDomainResourceDialect,
17806    >;
17807    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
17808        fn _decode(
17809            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17810        ) -> Result<WritableWriteResult, fidl::Error> {
17811            let _response = fidl::client::decode_transaction_body::<
17812                fidl::encoding::ResultType<WritableWriteResponse, i32>,
17813                fdomain_client::fidl::FDomainResourceDialect,
17814                0x6a31437832469f82,
17815            >(_buf?)?;
17816            Ok(_response.map(|x| x.actual_count))
17817        }
17818        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
17819            (data,),
17820            0x6a31437832469f82,
17821            fidl::encoding::DynamicFlags::empty(),
17822            _decode,
17823        )
17824    }
17825}
17826
17827pub struct WritableEventStream {
17828    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
17829}
17830
17831impl std::marker::Unpin for WritableEventStream {}
17832
17833impl futures::stream::FusedStream for WritableEventStream {
17834    fn is_terminated(&self) -> bool {
17835        self.event_receiver.is_terminated()
17836    }
17837}
17838
17839impl futures::Stream for WritableEventStream {
17840    type Item = Result<WritableEvent, fidl::Error>;
17841
17842    fn poll_next(
17843        mut self: std::pin::Pin<&mut Self>,
17844        cx: &mut std::task::Context<'_>,
17845    ) -> std::task::Poll<Option<Self::Item>> {
17846        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17847            &mut self.event_receiver,
17848            cx
17849        )?) {
17850            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
17851            None => std::task::Poll::Ready(None),
17852        }
17853    }
17854}
17855
17856#[derive(Debug)]
17857pub enum WritableEvent {}
17858
17859impl WritableEvent {
17860    /// Decodes a message buffer as a [`WritableEvent`].
17861    fn decode(
17862        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17863    ) -> Result<WritableEvent, fidl::Error> {
17864        let (bytes, _handles) = buf.split_mut();
17865        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17866        debug_assert_eq!(tx_header.tx_id, 0);
17867        match tx_header.ordinal {
17868            _ => Err(fidl::Error::UnknownOrdinal {
17869                ordinal: tx_header.ordinal,
17870                protocol_name: <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17871            }),
17872        }
17873    }
17874}
17875
17876/// A Stream of incoming requests for fuchsia.io/Writable.
17877pub struct WritableRequestStream {
17878    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17879    is_terminated: bool,
17880}
17881
17882impl std::marker::Unpin for WritableRequestStream {}
17883
17884impl futures::stream::FusedStream for WritableRequestStream {
17885    fn is_terminated(&self) -> bool {
17886        self.is_terminated
17887    }
17888}
17889
17890impl fdomain_client::fidl::RequestStream for WritableRequestStream {
17891    type Protocol = WritableMarker;
17892    type ControlHandle = WritableControlHandle;
17893
17894    fn from_channel(channel: fdomain_client::Channel) -> Self {
17895        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17896    }
17897
17898    fn control_handle(&self) -> Self::ControlHandle {
17899        WritableControlHandle { inner: self.inner.clone() }
17900    }
17901
17902    fn into_inner(
17903        self,
17904    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
17905    {
17906        (self.inner, self.is_terminated)
17907    }
17908
17909    fn from_inner(
17910        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17911        is_terminated: bool,
17912    ) -> Self {
17913        Self { inner, is_terminated }
17914    }
17915}
17916
17917impl futures::Stream for WritableRequestStream {
17918    type Item = Result<WritableRequest, fidl::Error>;
17919
17920    fn poll_next(
17921        mut self: std::pin::Pin<&mut Self>,
17922        cx: &mut std::task::Context<'_>,
17923    ) -> std::task::Poll<Option<Self::Item>> {
17924        let this = &mut *self;
17925        if this.inner.check_shutdown(cx) {
17926            this.is_terminated = true;
17927            return std::task::Poll::Ready(None);
17928        }
17929        if this.is_terminated {
17930            panic!("polled WritableRequestStream after completion");
17931        }
17932        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
17933            |bytes, handles| {
17934                match this.inner.channel().read_etc(cx, bytes, handles) {
17935                    std::task::Poll::Ready(Ok(())) => {}
17936                    std::task::Poll::Pending => return std::task::Poll::Pending,
17937                    std::task::Poll::Ready(Err(None)) => {
17938                        this.is_terminated = true;
17939                        return std::task::Poll::Ready(None);
17940                    }
17941                    std::task::Poll::Ready(Err(Some(e))) => {
17942                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17943                            e.into(),
17944                        ))));
17945                    }
17946                }
17947
17948                // A message has been received from the channel
17949                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17950
17951                std::task::Poll::Ready(Some(match header.ordinal {
17952                    0x6a31437832469f82 => {
17953                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17954                        let mut req = fidl::new_empty!(
17955                            WritableWriteRequest,
17956                            fdomain_client::fidl::FDomainResourceDialect
17957                        );
17958                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
17959                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
17960                        Ok(WritableRequest::Write {
17961                            data: req.data,
17962
17963                            responder: WritableWriteResponder {
17964                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17965                                tx_id: header.tx_id,
17966                            },
17967                        })
17968                    }
17969                    _ => Err(fidl::Error::UnknownOrdinal {
17970                        ordinal: header.ordinal,
17971                        protocol_name:
17972                            <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17973                    }),
17974                }))
17975            },
17976        )
17977    }
17978}
17979
17980#[derive(Debug)]
17981pub enum WritableRequest {
17982    /// Writes data at the seek offset.
17983    /// The seek offset is moved forward by the number of bytes written.
17984    /// If the file is in append mode, the seek offset is first set to the end
17985    /// of the file, followed by the write, in one atomic step.
17986    ///
17987    /// The file size may grow if the seek offset plus `data.length` is beyond
17988    /// the current end of file.
17989    ///
17990    /// + request `data` the byte buffer to write to the file.
17991    /// - response `actual_count` the number of bytes written.
17992    ///
17993    /// ## Invariants
17994    ///
17995    /// * The returned `actual_count` will never be greater than `data.length`.
17996    /// * If the server is unable to write all the data due to e.g. not enough
17997    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17998    ///   could be written, an error is returned.
17999    /// * If `data.length` is zero, the server should perform all the checks
18000    ///   ensuring write access without mutating the file and return a
18001    ///   successful write of zero bytes.  The seek offset is still updated if
18002    ///   in append mode.
18003    ///
18004    /// This method requires the [`Rights.WRITE_BYTES`] right.
18005    Write { data: Vec<u8>, responder: WritableWriteResponder },
18006}
18007
18008impl WritableRequest {
18009    #[allow(irrefutable_let_patterns)]
18010    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
18011        if let WritableRequest::Write { data, responder } = self {
18012            Some((data, responder))
18013        } else {
18014            None
18015        }
18016    }
18017
18018    /// Name of the method defined in FIDL
18019    pub fn method_name(&self) -> &'static str {
18020        match *self {
18021            WritableRequest::Write { .. } => "write",
18022        }
18023    }
18024}
18025
18026#[derive(Debug, Clone)]
18027pub struct WritableControlHandle {
18028    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
18029}
18030
18031impl WritableControlHandle {
18032    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
18033        self.inner.shutdown_with_epitaph(status.into())
18034    }
18035}
18036
18037impl fdomain_client::fidl::ControlHandle for WritableControlHandle {
18038    fn shutdown(&self) {
18039        self.inner.shutdown()
18040    }
18041
18042    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
18043        self.inner.shutdown_with_epitaph(status)
18044    }
18045
18046    fn is_closed(&self) -> bool {
18047        self.inner.channel().is_closed()
18048    }
18049    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
18050        self.inner.channel().on_closed()
18051    }
18052}
18053
18054impl WritableControlHandle {}
18055
18056#[must_use = "FIDL methods require a response to be sent"]
18057#[derive(Debug)]
18058pub struct WritableWriteResponder {
18059    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
18060    tx_id: u32,
18061}
18062
18063/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
18064/// if the responder is dropped without sending a response, so that the client
18065/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
18066impl std::ops::Drop for WritableWriteResponder {
18067    fn drop(&mut self) {
18068        self.control_handle.shutdown();
18069        // Safety: drops once, never accessed again
18070        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18071    }
18072}
18073
18074impl fdomain_client::fidl::Responder for WritableWriteResponder {
18075    type ControlHandle = WritableControlHandle;
18076
18077    fn control_handle(&self) -> &WritableControlHandle {
18078        &self.control_handle
18079    }
18080
18081    fn drop_without_shutdown(mut self) {
18082        // Safety: drops once, never accessed again due to mem::forget
18083        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
18084        // Prevent Drop from running (which would shut down the channel)
18085        std::mem::forget(self);
18086    }
18087}
18088
18089impl WritableWriteResponder {
18090    /// Sends a response to the FIDL transaction.
18091    ///
18092    /// Sets the channel to shutdown if an error occurs.
18093    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
18094        let _result = self.send_raw(result);
18095        if _result.is_err() {
18096            self.control_handle.shutdown();
18097        }
18098        self.drop_without_shutdown();
18099        _result
18100    }
18101
18102    /// Similar to "send" but does not shutdown the channel if an error occurs.
18103    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
18104        let _result = self.send_raw(result);
18105        self.drop_without_shutdown();
18106        _result
18107    }
18108
18109    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
18110        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
18111            result.map(|actual_count| (actual_count,)),
18112            self.tx_id,
18113            0x6a31437832469f82,
18114            fidl::encoding::DynamicFlags::empty(),
18115        )
18116    }
18117}
18118
18119mod internal {
18120    use super::*;
18121
18122    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
18123        type Borrowed<'a> = &'a mut Self;
18124        fn take_or_borrow<'a>(
18125            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18126        ) -> Self::Borrowed<'a> {
18127            value
18128        }
18129    }
18130
18131    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
18132        type Owned = Self;
18133
18134        #[inline(always)]
18135        fn inline_align(_context: fidl::encoding::Context) -> usize {
18136            8
18137        }
18138
18139        #[inline(always)]
18140        fn inline_size(_context: fidl::encoding::Context) -> usize {
18141            40
18142        }
18143    }
18144
18145    unsafe impl
18146        fidl::encoding::Encode<
18147            DirectoryCreateSymlinkRequest,
18148            fdomain_client::fidl::FDomainResourceDialect,
18149        > for &mut DirectoryCreateSymlinkRequest
18150    {
18151        #[inline]
18152        unsafe fn encode(
18153            self,
18154            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18155            offset: usize,
18156            _depth: fidl::encoding::Depth,
18157        ) -> fidl::Result<()> {
18158            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
18159            // Delegate to tuple encoding.
18160            fidl::encoding::Encode::<
18161                DirectoryCreateSymlinkRequest,
18162                fdomain_client::fidl::FDomainResourceDialect,
18163            >::encode(
18164                (
18165                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18166                        &self.name,
18167                    ),
18168                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
18169                        &self.target,
18170                    ),
18171                    <fidl::encoding::Optional<
18172                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
18173                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18174                        &mut self.connection
18175                    ),
18176                ),
18177                encoder,
18178                offset,
18179                _depth,
18180            )
18181        }
18182    }
18183    unsafe impl<
18184        T0: fidl::encoding::Encode<
18185                fidl::encoding::BoundedString<255>,
18186                fdomain_client::fidl::FDomainResourceDialect,
18187            >,
18188        T1: fidl::encoding::Encode<
18189                fidl::encoding::Vector<u8, 4095>,
18190                fdomain_client::fidl::FDomainResourceDialect,
18191            >,
18192        T2: fidl::encoding::Encode<
18193                fidl::encoding::Optional<
18194                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
18195                >,
18196                fdomain_client::fidl::FDomainResourceDialect,
18197            >,
18198    >
18199        fidl::encoding::Encode<
18200            DirectoryCreateSymlinkRequest,
18201            fdomain_client::fidl::FDomainResourceDialect,
18202        > for (T0, T1, T2)
18203    {
18204        #[inline]
18205        unsafe fn encode(
18206            self,
18207            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18208            offset: usize,
18209            depth: fidl::encoding::Depth,
18210        ) -> fidl::Result<()> {
18211            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
18212            // Zero out padding regions. There's no need to apply masks
18213            // because the unmasked parts will be overwritten by fields.
18214            unsafe {
18215                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
18216                (ptr as *mut u64).write_unaligned(0);
18217            }
18218            // Write the fields.
18219            self.0.encode(encoder, offset + 0, depth)?;
18220            self.1.encode(encoder, offset + 16, depth)?;
18221            self.2.encode(encoder, offset + 32, depth)?;
18222            Ok(())
18223        }
18224    }
18225
18226    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18227        for DirectoryCreateSymlinkRequest
18228    {
18229        #[inline(always)]
18230        fn new_empty() -> Self {
18231            Self {
18232                name: fidl::new_empty!(
18233                    fidl::encoding::BoundedString<255>,
18234                    fdomain_client::fidl::FDomainResourceDialect
18235                ),
18236                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect),
18237                connection: fidl::new_empty!(
18238                    fidl::encoding::Optional<
18239                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
18240                    >,
18241                    fdomain_client::fidl::FDomainResourceDialect
18242                ),
18243            }
18244        }
18245
18246        #[inline]
18247        unsafe fn decode(
18248            &mut self,
18249            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18250            offset: usize,
18251            _depth: fidl::encoding::Depth,
18252        ) -> fidl::Result<()> {
18253            decoder.debug_check_bounds::<Self>(offset);
18254            // Verify that padding bytes are zero.
18255            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
18256            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18257            let mask = 0xffffffff00000000u64;
18258            let maskedval = padval & mask;
18259            if maskedval != 0 {
18260                return Err(fidl::Error::NonZeroPadding {
18261                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
18262                });
18263            }
18264            fidl::decode!(
18265                fidl::encoding::BoundedString<255>,
18266                fdomain_client::fidl::FDomainResourceDialect,
18267                &mut self.name,
18268                decoder,
18269                offset + 0,
18270                _depth
18271            )?;
18272            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
18273            fidl::decode!(
18274                fidl::encoding::Optional<
18275                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
18276                >,
18277                fdomain_client::fidl::FDomainResourceDialect,
18278                &mut self.connection,
18279                decoder,
18280                offset + 32,
18281                _depth
18282            )?;
18283            Ok(())
18284        }
18285    }
18286
18287    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedGetTokenResponse {
18288        type Borrowed<'a> = &'a mut Self;
18289        fn take_or_borrow<'a>(
18290            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18291        ) -> Self::Borrowed<'a> {
18292            value
18293        }
18294    }
18295
18296    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedGetTokenResponse {
18297        type Owned = Self;
18298
18299        #[inline(always)]
18300        fn inline_align(_context: fidl::encoding::Context) -> usize {
18301            4
18302        }
18303
18304        #[inline(always)]
18305        fn inline_size(_context: fidl::encoding::Context) -> usize {
18306            8
18307        }
18308    }
18309
18310    unsafe impl
18311        fidl::encoding::Encode<
18312            DirectoryDeprecatedGetTokenResponse,
18313            fdomain_client::fidl::FDomainResourceDialect,
18314        > for &mut DirectoryDeprecatedGetTokenResponse
18315    {
18316        #[inline]
18317        unsafe fn encode(
18318            self,
18319            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18320            offset: usize,
18321            _depth: fidl::encoding::Depth,
18322        ) -> fidl::Result<()> {
18323            encoder.debug_check_bounds::<DirectoryDeprecatedGetTokenResponse>(offset);
18324            // Delegate to tuple encoding.
18325            fidl::encoding::Encode::<
18326                DirectoryDeprecatedGetTokenResponse,
18327                fdomain_client::fidl::FDomainResourceDialect,
18328            >::encode(
18329                (
18330                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
18331                    <fidl::encoding::Optional<
18332                        fidl::encoding::HandleType<
18333                            fdomain_client::NullableHandle,
18334                            { fidl::ObjectType::NONE.into_raw() },
18335                            2147483648,
18336                        >,
18337                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18338                        &mut self.token
18339                    ),
18340                ),
18341                encoder,
18342                offset,
18343                _depth,
18344            )
18345        }
18346    }
18347    unsafe impl<
18348        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
18349        T1: fidl::encoding::Encode<
18350                fidl::encoding::Optional<
18351                    fidl::encoding::HandleType<
18352                        fdomain_client::NullableHandle,
18353                        { fidl::ObjectType::NONE.into_raw() },
18354                        2147483648,
18355                    >,
18356                >,
18357                fdomain_client::fidl::FDomainResourceDialect,
18358            >,
18359    >
18360        fidl::encoding::Encode<
18361            DirectoryDeprecatedGetTokenResponse,
18362            fdomain_client::fidl::FDomainResourceDialect,
18363        > for (T0, T1)
18364    {
18365        #[inline]
18366        unsafe fn encode(
18367            self,
18368            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18369            offset: usize,
18370            depth: fidl::encoding::Depth,
18371        ) -> fidl::Result<()> {
18372            encoder.debug_check_bounds::<DirectoryDeprecatedGetTokenResponse>(offset);
18373            // Zero out padding regions. There's no need to apply masks
18374            // because the unmasked parts will be overwritten by fields.
18375            // Write the fields.
18376            self.0.encode(encoder, offset + 0, depth)?;
18377            self.1.encode(encoder, offset + 4, depth)?;
18378            Ok(())
18379        }
18380    }
18381
18382    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18383        for DirectoryDeprecatedGetTokenResponse
18384    {
18385        #[inline(always)]
18386        fn new_empty() -> Self {
18387            Self {
18388                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
18389                token: fidl::new_empty!(
18390                    fidl::encoding::Optional<
18391                        fidl::encoding::HandleType<
18392                            fdomain_client::NullableHandle,
18393                            { fidl::ObjectType::NONE.into_raw() },
18394                            2147483648,
18395                        >,
18396                    >,
18397                    fdomain_client::fidl::FDomainResourceDialect
18398                ),
18399            }
18400        }
18401
18402        #[inline]
18403        unsafe fn decode(
18404            &mut self,
18405            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18406            offset: usize,
18407            _depth: fidl::encoding::Depth,
18408        ) -> fidl::Result<()> {
18409            decoder.debug_check_bounds::<Self>(offset);
18410            // Verify that padding bytes are zero.
18411            fidl::decode!(
18412                i32,
18413                fdomain_client::fidl::FDomainResourceDialect,
18414                &mut self.s,
18415                decoder,
18416                offset + 0,
18417                _depth
18418            )?;
18419            fidl::decode!(
18420                fidl::encoding::Optional<
18421                    fidl::encoding::HandleType<
18422                        fdomain_client::NullableHandle,
18423                        { fidl::ObjectType::NONE.into_raw() },
18424                        2147483648,
18425                    >,
18426                >,
18427                fdomain_client::fidl::FDomainResourceDialect,
18428                &mut self.token,
18429                decoder,
18430                offset + 4,
18431                _depth
18432            )?;
18433            Ok(())
18434        }
18435    }
18436
18437    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
18438        type Borrowed<'a> = &'a mut Self;
18439        fn take_or_borrow<'a>(
18440            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18441        ) -> Self::Borrowed<'a> {
18442            value
18443        }
18444    }
18445
18446    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
18447        type Owned = Self;
18448
18449        #[inline(always)]
18450        fn inline_align(_context: fidl::encoding::Context) -> usize {
18451            8
18452        }
18453
18454        #[inline(always)]
18455        fn inline_size(_context: fidl::encoding::Context) -> usize {
18456            32
18457        }
18458    }
18459
18460    unsafe impl
18461        fidl::encoding::Encode<
18462            DirectoryDeprecatedOpenRequest,
18463            fdomain_client::fidl::FDomainResourceDialect,
18464        > for &mut DirectoryDeprecatedOpenRequest
18465    {
18466        #[inline]
18467        unsafe fn encode(
18468            self,
18469            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18470            offset: usize,
18471            _depth: fidl::encoding::Depth,
18472        ) -> fidl::Result<()> {
18473            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
18474            // Delegate to tuple encoding.
18475            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
18476                (
18477                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
18478                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
18479                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
18480                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
18481                ),
18482                encoder, offset, _depth
18483            )
18484        }
18485    }
18486    unsafe impl<
18487        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
18488        T1: fidl::encoding::Encode<ModeType, fdomain_client::fidl::FDomainResourceDialect>,
18489        T2: fidl::encoding::Encode<
18490                fidl::encoding::BoundedString<4095>,
18491                fdomain_client::fidl::FDomainResourceDialect,
18492            >,
18493        T3: fidl::encoding::Encode<
18494                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18495                fdomain_client::fidl::FDomainResourceDialect,
18496            >,
18497    >
18498        fidl::encoding::Encode<
18499            DirectoryDeprecatedOpenRequest,
18500            fdomain_client::fidl::FDomainResourceDialect,
18501        > for (T0, T1, T2, T3)
18502    {
18503        #[inline]
18504        unsafe fn encode(
18505            self,
18506            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18507            offset: usize,
18508            depth: fidl::encoding::Depth,
18509        ) -> fidl::Result<()> {
18510            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
18511            // Zero out padding regions. There's no need to apply masks
18512            // because the unmasked parts will be overwritten by fields.
18513            unsafe {
18514                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
18515                (ptr as *mut u64).write_unaligned(0);
18516            }
18517            // Write the fields.
18518            self.0.encode(encoder, offset + 0, depth)?;
18519            self.1.encode(encoder, offset + 4, depth)?;
18520            self.2.encode(encoder, offset + 8, depth)?;
18521            self.3.encode(encoder, offset + 24, depth)?;
18522            Ok(())
18523        }
18524    }
18525
18526    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18527        for DirectoryDeprecatedOpenRequest
18528    {
18529        #[inline(always)]
18530        fn new_empty() -> Self {
18531            Self {
18532                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
18533                mode: fidl::new_empty!(ModeType, fdomain_client::fidl::FDomainResourceDialect),
18534                path: fidl::new_empty!(
18535                    fidl::encoding::BoundedString<4095>,
18536                    fdomain_client::fidl::FDomainResourceDialect
18537                ),
18538                object: fidl::new_empty!(
18539                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18540                    fdomain_client::fidl::FDomainResourceDialect
18541                ),
18542            }
18543        }
18544
18545        #[inline]
18546        unsafe fn decode(
18547            &mut self,
18548            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18549            offset: usize,
18550            _depth: fidl::encoding::Depth,
18551        ) -> fidl::Result<()> {
18552            decoder.debug_check_bounds::<Self>(offset);
18553            // Verify that padding bytes are zero.
18554            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
18555            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18556            let mask = 0xffffffff00000000u64;
18557            let maskedval = padval & mask;
18558            if maskedval != 0 {
18559                return Err(fidl::Error::NonZeroPadding {
18560                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
18561                });
18562            }
18563            fidl::decode!(
18564                OpenFlags,
18565                fdomain_client::fidl::FDomainResourceDialect,
18566                &mut self.flags,
18567                decoder,
18568                offset + 0,
18569                _depth
18570            )?;
18571            fidl::decode!(
18572                ModeType,
18573                fdomain_client::fidl::FDomainResourceDialect,
18574                &mut self.mode,
18575                decoder,
18576                offset + 4,
18577                _depth
18578            )?;
18579            fidl::decode!(
18580                fidl::encoding::BoundedString<4095>,
18581                fdomain_client::fidl::FDomainResourceDialect,
18582                &mut self.path,
18583                decoder,
18584                offset + 8,
18585                _depth
18586            )?;
18587            fidl::decode!(
18588                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18589                fdomain_client::fidl::FDomainResourceDialect,
18590                &mut self.object,
18591                decoder,
18592                offset + 24,
18593                _depth
18594            )?;
18595            Ok(())
18596        }
18597    }
18598
18599    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
18600        type Borrowed<'a> = &'a mut Self;
18601        fn take_or_borrow<'a>(
18602            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18603        ) -> Self::Borrowed<'a> {
18604            value
18605        }
18606    }
18607
18608    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
18609        type Owned = Self;
18610
18611        #[inline(always)]
18612        fn inline_align(_context: fidl::encoding::Context) -> usize {
18613            8
18614        }
18615
18616        #[inline(always)]
18617        fn inline_size(_context: fidl::encoding::Context) -> usize {
18618            40
18619        }
18620    }
18621
18622    unsafe impl
18623        fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18624        for &mut DirectoryLinkRequest
18625    {
18626        #[inline]
18627        unsafe fn encode(
18628            self,
18629            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18630            offset: usize,
18631            _depth: fidl::encoding::Depth,
18632        ) -> fidl::Result<()> {
18633            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18634            // Delegate to tuple encoding.
18635            fidl::encoding::Encode::<
18636                DirectoryLinkRequest,
18637                fdomain_client::fidl::FDomainResourceDialect,
18638            >::encode(
18639                (
18640                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18641                        &self.src,
18642                    ),
18643                    <fidl::encoding::HandleType<
18644                        fdomain_client::NullableHandle,
18645                        { fidl::ObjectType::NONE.into_raw() },
18646                        2147483648,
18647                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18648                        &mut self.dst_parent_token,
18649                    ),
18650                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18651                        &self.dst,
18652                    ),
18653                ),
18654                encoder,
18655                offset,
18656                _depth,
18657            )
18658        }
18659    }
18660    unsafe impl<
18661        T0: fidl::encoding::Encode<
18662                fidl::encoding::BoundedString<255>,
18663                fdomain_client::fidl::FDomainResourceDialect,
18664            >,
18665        T1: fidl::encoding::Encode<
18666                fidl::encoding::HandleType<
18667                    fdomain_client::NullableHandle,
18668                    { fidl::ObjectType::NONE.into_raw() },
18669                    2147483648,
18670                >,
18671                fdomain_client::fidl::FDomainResourceDialect,
18672            >,
18673        T2: fidl::encoding::Encode<
18674                fidl::encoding::BoundedString<255>,
18675                fdomain_client::fidl::FDomainResourceDialect,
18676            >,
18677    > fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18678        for (T0, T1, T2)
18679    {
18680        #[inline]
18681        unsafe fn encode(
18682            self,
18683            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18684            offset: usize,
18685            depth: fidl::encoding::Depth,
18686        ) -> fidl::Result<()> {
18687            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18688            // Zero out padding regions. There's no need to apply masks
18689            // because the unmasked parts will be overwritten by fields.
18690            unsafe {
18691                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18692                (ptr as *mut u64).write_unaligned(0);
18693            }
18694            // Write the fields.
18695            self.0.encode(encoder, offset + 0, depth)?;
18696            self.1.encode(encoder, offset + 16, depth)?;
18697            self.2.encode(encoder, offset + 24, depth)?;
18698            Ok(())
18699        }
18700    }
18701
18702    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18703        for DirectoryLinkRequest
18704    {
18705        #[inline(always)]
18706        fn new_empty() -> Self {
18707            Self {
18708                src: fidl::new_empty!(
18709                    fidl::encoding::BoundedString<255>,
18710                    fdomain_client::fidl::FDomainResourceDialect
18711                ),
18712                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18713                dst: fidl::new_empty!(
18714                    fidl::encoding::BoundedString<255>,
18715                    fdomain_client::fidl::FDomainResourceDialect
18716                ),
18717            }
18718        }
18719
18720        #[inline]
18721        unsafe fn decode(
18722            &mut self,
18723            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18724            offset: usize,
18725            _depth: fidl::encoding::Depth,
18726        ) -> fidl::Result<()> {
18727            decoder.debug_check_bounds::<Self>(offset);
18728            // Verify that padding bytes are zero.
18729            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18730            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18731            let mask = 0xffffffff00000000u64;
18732            let maskedval = padval & mask;
18733            if maskedval != 0 {
18734                return Err(fidl::Error::NonZeroPadding {
18735                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18736                });
18737            }
18738            fidl::decode!(
18739                fidl::encoding::BoundedString<255>,
18740                fdomain_client::fidl::FDomainResourceDialect,
18741                &mut self.src,
18742                decoder,
18743                offset + 0,
18744                _depth
18745            )?;
18746            fidl::decode!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
18747            fidl::decode!(
18748                fidl::encoding::BoundedString<255>,
18749                fdomain_client::fidl::FDomainResourceDialect,
18750                &mut self.dst,
18751                decoder,
18752                offset + 24,
18753                _depth
18754            )?;
18755            Ok(())
18756        }
18757    }
18758
18759    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
18760        type Borrowed<'a> = &'a mut Self;
18761        fn take_or_borrow<'a>(
18762            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18763        ) -> Self::Borrowed<'a> {
18764            value
18765        }
18766    }
18767
18768    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
18769        type Owned = Self;
18770
18771        #[inline(always)]
18772        fn inline_align(_context: fidl::encoding::Context) -> usize {
18773            8
18774        }
18775
18776        #[inline(always)]
18777        fn inline_size(_context: fidl::encoding::Context) -> usize {
18778            40
18779        }
18780    }
18781
18782    unsafe impl
18783        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18784        for &mut DirectoryRenameRequest
18785    {
18786        #[inline]
18787        unsafe fn encode(
18788            self,
18789            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18790            offset: usize,
18791            _depth: fidl::encoding::Depth,
18792        ) -> fidl::Result<()> {
18793            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18794            // Delegate to tuple encoding.
18795            fidl::encoding::Encode::<
18796                DirectoryRenameRequest,
18797                fdomain_client::fidl::FDomainResourceDialect,
18798            >::encode(
18799                (
18800                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18801                        &self.src,
18802                    ),
18803                    <fidl::encoding::HandleType<
18804                        fdomain_client::Event,
18805                        { fidl::ObjectType::EVENT.into_raw() },
18806                        2147483648,
18807                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18808                        &mut self.dst_parent_token,
18809                    ),
18810                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18811                        &self.dst,
18812                    ),
18813                ),
18814                encoder,
18815                offset,
18816                _depth,
18817            )
18818        }
18819    }
18820    unsafe impl<
18821        T0: fidl::encoding::Encode<
18822                fidl::encoding::BoundedString<255>,
18823                fdomain_client::fidl::FDomainResourceDialect,
18824            >,
18825        T1: fidl::encoding::Encode<
18826                fidl::encoding::HandleType<
18827                    fdomain_client::Event,
18828                    { fidl::ObjectType::EVENT.into_raw() },
18829                    2147483648,
18830                >,
18831                fdomain_client::fidl::FDomainResourceDialect,
18832            >,
18833        T2: fidl::encoding::Encode<
18834                fidl::encoding::BoundedString<255>,
18835                fdomain_client::fidl::FDomainResourceDialect,
18836            >,
18837    >
18838        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18839        for (T0, T1, T2)
18840    {
18841        #[inline]
18842        unsafe fn encode(
18843            self,
18844            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18845            offset: usize,
18846            depth: fidl::encoding::Depth,
18847        ) -> fidl::Result<()> {
18848            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18849            // Zero out padding regions. There's no need to apply masks
18850            // because the unmasked parts will be overwritten by fields.
18851            unsafe {
18852                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18853                (ptr as *mut u64).write_unaligned(0);
18854            }
18855            // Write the fields.
18856            self.0.encode(encoder, offset + 0, depth)?;
18857            self.1.encode(encoder, offset + 16, depth)?;
18858            self.2.encode(encoder, offset + 24, depth)?;
18859            Ok(())
18860        }
18861    }
18862
18863    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18864        for DirectoryRenameRequest
18865    {
18866        #[inline(always)]
18867        fn new_empty() -> Self {
18868            Self {
18869                src: fidl::new_empty!(
18870                    fidl::encoding::BoundedString<255>,
18871                    fdomain_client::fidl::FDomainResourceDialect
18872                ),
18873                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18874                dst: fidl::new_empty!(
18875                    fidl::encoding::BoundedString<255>,
18876                    fdomain_client::fidl::FDomainResourceDialect
18877                ),
18878            }
18879        }
18880
18881        #[inline]
18882        unsafe fn decode(
18883            &mut self,
18884            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18885            offset: usize,
18886            _depth: fidl::encoding::Depth,
18887        ) -> fidl::Result<()> {
18888            decoder.debug_check_bounds::<Self>(offset);
18889            // Verify that padding bytes are zero.
18890            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18891            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18892            let mask = 0xffffffff00000000u64;
18893            let maskedval = padval & mask;
18894            if maskedval != 0 {
18895                return Err(fidl::Error::NonZeroPadding {
18896                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18897                });
18898            }
18899            fidl::decode!(
18900                fidl::encoding::BoundedString<255>,
18901                fdomain_client::fidl::FDomainResourceDialect,
18902                &mut self.src,
18903                decoder,
18904                offset + 0,
18905                _depth
18906            )?;
18907            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
18908            fidl::decode!(
18909                fidl::encoding::BoundedString<255>,
18910                fdomain_client::fidl::FDomainResourceDialect,
18911                &mut self.dst,
18912                decoder,
18913                offset + 24,
18914                _depth
18915            )?;
18916            Ok(())
18917        }
18918    }
18919
18920    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
18921        type Borrowed<'a> = &'a mut Self;
18922        fn take_or_borrow<'a>(
18923            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18924        ) -> Self::Borrowed<'a> {
18925            value
18926        }
18927    }
18928
18929    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
18930        type Owned = Self;
18931
18932        #[inline(always)]
18933        fn inline_align(_context: fidl::encoding::Context) -> usize {
18934            4
18935        }
18936
18937        #[inline(always)]
18938        fn inline_size(_context: fidl::encoding::Context) -> usize {
18939            12
18940        }
18941    }
18942
18943    unsafe impl
18944        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18945        for &mut DirectoryWatchRequest
18946    {
18947        #[inline]
18948        unsafe fn encode(
18949            self,
18950            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18951            offset: usize,
18952            _depth: fidl::encoding::Depth,
18953        ) -> fidl::Result<()> {
18954            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18955            // Delegate to tuple encoding.
18956            fidl::encoding::Encode::<
18957                DirectoryWatchRequest,
18958                fdomain_client::fidl::FDomainResourceDialect,
18959            >::encode(
18960                (
18961                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
18962                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
18963                    <fidl::encoding::Endpoint<
18964                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18965                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18966                        &mut self.watcher
18967                    ),
18968                ),
18969                encoder,
18970                offset,
18971                _depth,
18972            )
18973        }
18974    }
18975    unsafe impl<
18976        T0: fidl::encoding::Encode<WatchMask, fdomain_client::fidl::FDomainResourceDialect>,
18977        T1: fidl::encoding::Encode<u32, fdomain_client::fidl::FDomainResourceDialect>,
18978        T2: fidl::encoding::Encode<
18979                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18980                fdomain_client::fidl::FDomainResourceDialect,
18981            >,
18982    >
18983        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18984        for (T0, T1, T2)
18985    {
18986        #[inline]
18987        unsafe fn encode(
18988            self,
18989            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18990            offset: usize,
18991            depth: fidl::encoding::Depth,
18992        ) -> fidl::Result<()> {
18993            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18994            // Zero out padding regions. There's no need to apply masks
18995            // because the unmasked parts will be overwritten by fields.
18996            // Write the fields.
18997            self.0.encode(encoder, offset + 0, depth)?;
18998            self.1.encode(encoder, offset + 4, depth)?;
18999            self.2.encode(encoder, offset + 8, depth)?;
19000            Ok(())
19001        }
19002    }
19003
19004    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19005        for DirectoryWatchRequest
19006    {
19007        #[inline(always)]
19008        fn new_empty() -> Self {
19009            Self {
19010                mask: fidl::new_empty!(WatchMask, fdomain_client::fidl::FDomainResourceDialect),
19011                options: fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect),
19012                watcher: fidl::new_empty!(
19013                    fidl::encoding::Endpoint<
19014                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
19015                    >,
19016                    fdomain_client::fidl::FDomainResourceDialect
19017                ),
19018            }
19019        }
19020
19021        #[inline]
19022        unsafe fn decode(
19023            &mut self,
19024            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19025            offset: usize,
19026            _depth: fidl::encoding::Depth,
19027        ) -> fidl::Result<()> {
19028            decoder.debug_check_bounds::<Self>(offset);
19029            // Verify that padding bytes are zero.
19030            fidl::decode!(
19031                WatchMask,
19032                fdomain_client::fidl::FDomainResourceDialect,
19033                &mut self.mask,
19034                decoder,
19035                offset + 0,
19036                _depth
19037            )?;
19038            fidl::decode!(
19039                u32,
19040                fdomain_client::fidl::FDomainResourceDialect,
19041                &mut self.options,
19042                decoder,
19043                offset + 4,
19044                _depth
19045            )?;
19046            fidl::decode!(
19047                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
19048                fdomain_client::fidl::FDomainResourceDialect,
19049                &mut self.watcher,
19050                decoder,
19051                offset + 8,
19052                _depth
19053            )?;
19054            Ok(())
19055        }
19056    }
19057
19058    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
19059        type Borrowed<'a> = &'a mut Self;
19060        fn take_or_borrow<'a>(
19061            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19062        ) -> Self::Borrowed<'a> {
19063            value
19064        }
19065    }
19066
19067    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
19068        type Owned = Self;
19069
19070        #[inline(always)]
19071        fn inline_align(_context: fidl::encoding::Context) -> usize {
19072            8
19073        }
19074
19075        #[inline(always)]
19076        fn inline_size(_context: fidl::encoding::Context) -> usize {
19077            24
19078        }
19079    }
19080
19081    unsafe impl
19082        fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
19083        for &mut FileAllocateRequest
19084    {
19085        #[inline]
19086        unsafe fn encode(
19087            self,
19088            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19089            offset: usize,
19090            _depth: fidl::encoding::Depth,
19091        ) -> fidl::Result<()> {
19092            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
19093            // Delegate to tuple encoding.
19094            fidl::encoding::Encode::<
19095                FileAllocateRequest,
19096                fdomain_client::fidl::FDomainResourceDialect,
19097            >::encode(
19098                (
19099                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
19100                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
19101                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
19102                ),
19103                encoder,
19104                offset,
19105                _depth,
19106            )
19107        }
19108    }
19109    unsafe impl<
19110        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
19111        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
19112        T2: fidl::encoding::Encode<AllocateMode, fdomain_client::fidl::FDomainResourceDialect>,
19113    > fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
19114        for (T0, T1, T2)
19115    {
19116        #[inline]
19117        unsafe fn encode(
19118            self,
19119            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19120            offset: usize,
19121            depth: fidl::encoding::Depth,
19122        ) -> fidl::Result<()> {
19123            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
19124            // Zero out padding regions. There's no need to apply masks
19125            // because the unmasked parts will be overwritten by fields.
19126            unsafe {
19127                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
19128                (ptr as *mut u64).write_unaligned(0);
19129            }
19130            // Write the fields.
19131            self.0.encode(encoder, offset + 0, depth)?;
19132            self.1.encode(encoder, offset + 8, depth)?;
19133            self.2.encode(encoder, offset + 16, depth)?;
19134            Ok(())
19135        }
19136    }
19137
19138    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19139        for FileAllocateRequest
19140    {
19141        #[inline(always)]
19142        fn new_empty() -> Self {
19143            Self {
19144                offset: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
19145                length: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
19146                mode: fidl::new_empty!(AllocateMode, fdomain_client::fidl::FDomainResourceDialect),
19147            }
19148        }
19149
19150        #[inline]
19151        unsafe fn decode(
19152            &mut self,
19153            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19154            offset: usize,
19155            _depth: fidl::encoding::Depth,
19156        ) -> fidl::Result<()> {
19157            decoder.debug_check_bounds::<Self>(offset);
19158            // Verify that padding bytes are zero.
19159            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
19160            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19161            let mask = 0xffffffff00000000u64;
19162            let maskedval = padval & mask;
19163            if maskedval != 0 {
19164                return Err(fidl::Error::NonZeroPadding {
19165                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
19166                });
19167            }
19168            fidl::decode!(
19169                u64,
19170                fdomain_client::fidl::FDomainResourceDialect,
19171                &mut self.offset,
19172                decoder,
19173                offset + 0,
19174                _depth
19175            )?;
19176            fidl::decode!(
19177                u64,
19178                fdomain_client::fidl::FDomainResourceDialect,
19179                &mut self.length,
19180                decoder,
19181                offset + 8,
19182                _depth
19183            )?;
19184            fidl::decode!(
19185                AllocateMode,
19186                fdomain_client::fidl::FDomainResourceDialect,
19187                &mut self.mode,
19188                decoder,
19189                offset + 16,
19190                _depth
19191            )?;
19192            Ok(())
19193        }
19194    }
19195
19196    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
19197        type Borrowed<'a> = &'a mut Self;
19198        fn take_or_borrow<'a>(
19199            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19200        ) -> Self::Borrowed<'a> {
19201            value
19202        }
19203    }
19204
19205    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
19206        type Owned = Self;
19207
19208        #[inline(always)]
19209        fn inline_align(_context: fidl::encoding::Context) -> usize {
19210            8
19211        }
19212
19213        #[inline(always)]
19214        fn inline_size(_context: fidl::encoding::Context) -> usize {
19215            16
19216        }
19217    }
19218
19219    unsafe impl
19220        fidl::encoding::Encode<
19221            FileEnableVerityRequest,
19222            fdomain_client::fidl::FDomainResourceDialect,
19223        > for &mut FileEnableVerityRequest
19224    {
19225        #[inline]
19226        unsafe fn encode(
19227            self,
19228            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19229            offset: usize,
19230            _depth: fidl::encoding::Depth,
19231        ) -> fidl::Result<()> {
19232            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
19233            // Delegate to tuple encoding.
19234            fidl::encoding::Encode::<
19235                FileEnableVerityRequest,
19236                fdomain_client::fidl::FDomainResourceDialect,
19237            >::encode(
19238                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
19239                encoder,
19240                offset,
19241                _depth,
19242            )
19243        }
19244    }
19245    unsafe impl<
19246        T0: fidl::encoding::Encode<VerificationOptions, fdomain_client::fidl::FDomainResourceDialect>,
19247    >
19248        fidl::encoding::Encode<
19249            FileEnableVerityRequest,
19250            fdomain_client::fidl::FDomainResourceDialect,
19251        > for (T0,)
19252    {
19253        #[inline]
19254        unsafe fn encode(
19255            self,
19256            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19257            offset: usize,
19258            depth: fidl::encoding::Depth,
19259        ) -> fidl::Result<()> {
19260            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
19261            // Zero out padding regions. There's no need to apply masks
19262            // because the unmasked parts will be overwritten by fields.
19263            // Write the fields.
19264            self.0.encode(encoder, offset + 0, depth)?;
19265            Ok(())
19266        }
19267    }
19268
19269    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19270        for FileEnableVerityRequest
19271    {
19272        #[inline(always)]
19273        fn new_empty() -> Self {
19274            Self {
19275                options: fidl::new_empty!(
19276                    VerificationOptions,
19277                    fdomain_client::fidl::FDomainResourceDialect
19278                ),
19279            }
19280        }
19281
19282        #[inline]
19283        unsafe fn decode(
19284            &mut self,
19285            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19286            offset: usize,
19287            _depth: fidl::encoding::Depth,
19288        ) -> fidl::Result<()> {
19289            decoder.debug_check_bounds::<Self>(offset);
19290            // Verify that padding bytes are zero.
19291            fidl::decode!(
19292                VerificationOptions,
19293                fdomain_client::fidl::FDomainResourceDialect,
19294                &mut self.options,
19295                decoder,
19296                offset + 0,
19297                _depth
19298            )?;
19299            Ok(())
19300        }
19301    }
19302
19303    impl fidl::encoding::ResourceTypeMarker for FileObject {
19304        type Borrowed<'a> = &'a mut Self;
19305        fn take_or_borrow<'a>(
19306            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19307        ) -> Self::Borrowed<'a> {
19308            value
19309        }
19310    }
19311
19312    unsafe impl fidl::encoding::TypeMarker for FileObject {
19313        type Owned = Self;
19314
19315        #[inline(always)]
19316        fn inline_align(_context: fidl::encoding::Context) -> usize {
19317            4
19318        }
19319
19320        #[inline(always)]
19321        fn inline_size(_context: fidl::encoding::Context) -> usize {
19322            8
19323        }
19324    }
19325
19326    unsafe impl fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
19327        for &mut FileObject
19328    {
19329        #[inline]
19330        unsafe fn encode(
19331            self,
19332            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19333            offset: usize,
19334            _depth: fidl::encoding::Depth,
19335        ) -> fidl::Result<()> {
19336            encoder.debug_check_bounds::<FileObject>(offset);
19337            // Delegate to tuple encoding.
19338            fidl::encoding::Encode::<FileObject, fdomain_client::fidl::FDomainResourceDialect>::encode(
19339                (
19340                    <fidl::encoding::Optional<fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
19341                    <fidl::encoding::Optional<fidl::encoding::HandleType<fdomain_client::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
19342                ),
19343                encoder, offset, _depth
19344            )
19345        }
19346    }
19347    unsafe impl<
19348        T0: fidl::encoding::Encode<
19349                fidl::encoding::Optional<
19350                    fidl::encoding::HandleType<
19351                        fdomain_client::Event,
19352                        { fidl::ObjectType::EVENT.into_raw() },
19353                        2147483648,
19354                    >,
19355                >,
19356                fdomain_client::fidl::FDomainResourceDialect,
19357            >,
19358        T1: fidl::encoding::Encode<
19359                fidl::encoding::Optional<
19360                    fidl::encoding::HandleType<
19361                        fdomain_client::Stream,
19362                        { fidl::ObjectType::STREAM.into_raw() },
19363                        2147483648,
19364                    >,
19365                >,
19366                fdomain_client::fidl::FDomainResourceDialect,
19367            >,
19368    > fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
19369        for (T0, T1)
19370    {
19371        #[inline]
19372        unsafe fn encode(
19373            self,
19374            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19375            offset: usize,
19376            depth: fidl::encoding::Depth,
19377        ) -> fidl::Result<()> {
19378            encoder.debug_check_bounds::<FileObject>(offset);
19379            // Zero out padding regions. There's no need to apply masks
19380            // because the unmasked parts will be overwritten by fields.
19381            // Write the fields.
19382            self.0.encode(encoder, offset + 0, depth)?;
19383            self.1.encode(encoder, offset + 4, depth)?;
19384            Ok(())
19385        }
19386    }
19387
19388    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileObject {
19389        #[inline(always)]
19390        fn new_empty() -> Self {
19391            Self {
19392                event: fidl::new_empty!(
19393                    fidl::encoding::Optional<
19394                        fidl::encoding::HandleType<
19395                            fdomain_client::Event,
19396                            { fidl::ObjectType::EVENT.into_raw() },
19397                            2147483648,
19398                        >,
19399                    >,
19400                    fdomain_client::fidl::FDomainResourceDialect
19401                ),
19402                stream: fidl::new_empty!(
19403                    fidl::encoding::Optional<
19404                        fidl::encoding::HandleType<
19405                            fdomain_client::Stream,
19406                            { fidl::ObjectType::STREAM.into_raw() },
19407                            2147483648,
19408                        >,
19409                    >,
19410                    fdomain_client::fidl::FDomainResourceDialect
19411                ),
19412            }
19413        }
19414
19415        #[inline]
19416        unsafe fn decode(
19417            &mut self,
19418            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19419            offset: usize,
19420            _depth: fidl::encoding::Depth,
19421        ) -> fidl::Result<()> {
19422            decoder.debug_check_bounds::<Self>(offset);
19423            // Verify that padding bytes are zero.
19424            fidl::decode!(
19425                fidl::encoding::Optional<
19426                    fidl::encoding::HandleType<
19427                        fdomain_client::Event,
19428                        { fidl::ObjectType::EVENT.into_raw() },
19429                        2147483648,
19430                    >,
19431                >,
19432                fdomain_client::fidl::FDomainResourceDialect,
19433                &mut self.event,
19434                decoder,
19435                offset + 0,
19436                _depth
19437            )?;
19438            fidl::decode!(
19439                fidl::encoding::Optional<
19440                    fidl::encoding::HandleType<
19441                        fdomain_client::Stream,
19442                        { fidl::ObjectType::STREAM.into_raw() },
19443                        2147483648,
19444                    >,
19445                >,
19446                fdomain_client::fidl::FDomainResourceDialect,
19447                &mut self.stream,
19448                decoder,
19449                offset + 4,
19450                _depth
19451            )?;
19452            Ok(())
19453        }
19454    }
19455
19456    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
19457        type Borrowed<'a> = &'a mut Self;
19458        fn take_or_borrow<'a>(
19459            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19460        ) -> Self::Borrowed<'a> {
19461            value
19462        }
19463    }
19464
19465    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
19466        type Owned = Self;
19467
19468        #[inline(always)]
19469        fn inline_align(_context: fidl::encoding::Context) -> usize {
19470            4
19471        }
19472
19473        #[inline(always)]
19474        fn inline_size(_context: fidl::encoding::Context) -> usize {
19475            4
19476        }
19477    }
19478
19479    unsafe impl
19480        fidl::encoding::Encode<
19481            FileGetBackingMemoryResponse,
19482            fdomain_client::fidl::FDomainResourceDialect,
19483        > for &mut FileGetBackingMemoryResponse
19484    {
19485        #[inline]
19486        unsafe fn encode(
19487            self,
19488            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19489            offset: usize,
19490            _depth: fidl::encoding::Depth,
19491        ) -> fidl::Result<()> {
19492            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19493            // Delegate to tuple encoding.
19494            fidl::encoding::Encode::<
19495                FileGetBackingMemoryResponse,
19496                fdomain_client::fidl::FDomainResourceDialect,
19497            >::encode(
19498                (<fidl::encoding::HandleType<
19499                    fdomain_client::Vmo,
19500                    { fidl::ObjectType::VMO.into_raw() },
19501                    2147483648,
19502                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19503                    &mut self.vmo
19504                ),),
19505                encoder,
19506                offset,
19507                _depth,
19508            )
19509        }
19510    }
19511    unsafe impl<
19512        T0: fidl::encoding::Encode<
19513                fidl::encoding::HandleType<
19514                    fdomain_client::Vmo,
19515                    { fidl::ObjectType::VMO.into_raw() },
19516                    2147483648,
19517                >,
19518                fdomain_client::fidl::FDomainResourceDialect,
19519            >,
19520    >
19521        fidl::encoding::Encode<
19522            FileGetBackingMemoryResponse,
19523            fdomain_client::fidl::FDomainResourceDialect,
19524        > for (T0,)
19525    {
19526        #[inline]
19527        unsafe fn encode(
19528            self,
19529            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19530            offset: usize,
19531            depth: fidl::encoding::Depth,
19532        ) -> fidl::Result<()> {
19533            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19534            // Zero out padding regions. There's no need to apply masks
19535            // because the unmasked parts will be overwritten by fields.
19536            // Write the fields.
19537            self.0.encode(encoder, offset + 0, depth)?;
19538            Ok(())
19539        }
19540    }
19541
19542    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19543        for FileGetBackingMemoryResponse
19544    {
19545        #[inline(always)]
19546        fn new_empty() -> Self {
19547            Self {
19548                vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19549            }
19550        }
19551
19552        #[inline]
19553        unsafe fn decode(
19554            &mut self,
19555            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19556            offset: usize,
19557            _depth: fidl::encoding::Depth,
19558        ) -> fidl::Result<()> {
19559            decoder.debug_check_bounds::<Self>(offset);
19560            // Verify that padding bytes are zero.
19561            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
19562            Ok(())
19563        }
19564    }
19565
19566    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
19567        type Borrowed<'a> = &'a mut Self;
19568        fn take_or_borrow<'a>(
19569            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19570        ) -> Self::Borrowed<'a> {
19571            value
19572        }
19573    }
19574
19575    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
19576        type Owned = Self;
19577
19578        #[inline(always)]
19579        fn inline_align(_context: fidl::encoding::Context) -> usize {
19580            8
19581        }
19582
19583        #[inline(always)]
19584        fn inline_size(_context: fidl::encoding::Context) -> usize {
19585            24
19586        }
19587    }
19588
19589    unsafe impl
19590        fidl::encoding::Encode<
19591            LinkableLinkIntoRequest,
19592            fdomain_client::fidl::FDomainResourceDialect,
19593        > for &mut LinkableLinkIntoRequest
19594    {
19595        #[inline]
19596        unsafe fn encode(
19597            self,
19598            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19599            offset: usize,
19600            _depth: fidl::encoding::Depth,
19601        ) -> fidl::Result<()> {
19602            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19603            // Delegate to tuple encoding.
19604            fidl::encoding::Encode::<
19605                LinkableLinkIntoRequest,
19606                fdomain_client::fidl::FDomainResourceDialect,
19607            >::encode(
19608                (
19609                    <fidl::encoding::HandleType<
19610                        fdomain_client::Event,
19611                        { fidl::ObjectType::EVENT.into_raw() },
19612                        2147483648,
19613                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19614                        &mut self.dst_parent_token,
19615                    ),
19616                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
19617                        &self.dst,
19618                    ),
19619                ),
19620                encoder,
19621                offset,
19622                _depth,
19623            )
19624        }
19625    }
19626    unsafe impl<
19627        T0: fidl::encoding::Encode<
19628                fidl::encoding::HandleType<
19629                    fdomain_client::Event,
19630                    { fidl::ObjectType::EVENT.into_raw() },
19631                    2147483648,
19632                >,
19633                fdomain_client::fidl::FDomainResourceDialect,
19634            >,
19635        T1: fidl::encoding::Encode<
19636                fidl::encoding::BoundedString<255>,
19637                fdomain_client::fidl::FDomainResourceDialect,
19638            >,
19639    >
19640        fidl::encoding::Encode<
19641            LinkableLinkIntoRequest,
19642            fdomain_client::fidl::FDomainResourceDialect,
19643        > for (T0, T1)
19644    {
19645        #[inline]
19646        unsafe fn encode(
19647            self,
19648            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19649            offset: usize,
19650            depth: fidl::encoding::Depth,
19651        ) -> fidl::Result<()> {
19652            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19653            // Zero out padding regions. There's no need to apply masks
19654            // because the unmasked parts will be overwritten by fields.
19655            unsafe {
19656                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19657                (ptr as *mut u64).write_unaligned(0);
19658            }
19659            // Write the fields.
19660            self.0.encode(encoder, offset + 0, depth)?;
19661            self.1.encode(encoder, offset + 8, depth)?;
19662            Ok(())
19663        }
19664    }
19665
19666    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19667        for LinkableLinkIntoRequest
19668    {
19669        #[inline(always)]
19670        fn new_empty() -> Self {
19671            Self {
19672                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19673                dst: fidl::new_empty!(
19674                    fidl::encoding::BoundedString<255>,
19675                    fdomain_client::fidl::FDomainResourceDialect
19676                ),
19677            }
19678        }
19679
19680        #[inline]
19681        unsafe fn decode(
19682            &mut self,
19683            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19684            offset: usize,
19685            _depth: fidl::encoding::Depth,
19686        ) -> fidl::Result<()> {
19687            decoder.debug_check_bounds::<Self>(offset);
19688            // Verify that padding bytes are zero.
19689            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19690            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19691            let mask = 0xffffffff00000000u64;
19692            let maskedval = padval & mask;
19693            if maskedval != 0 {
19694                return Err(fidl::Error::NonZeroPadding {
19695                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19696                });
19697            }
19698            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.dst_parent_token, decoder, offset + 0, _depth)?;
19699            fidl::decode!(
19700                fidl::encoding::BoundedString<255>,
19701                fdomain_client::fidl::FDomainResourceDialect,
19702                &mut self.dst,
19703                decoder,
19704                offset + 8,
19705                _depth
19706            )?;
19707            Ok(())
19708        }
19709    }
19710
19711    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
19712        type Borrowed<'a> = &'a mut Self;
19713        fn take_or_borrow<'a>(
19714            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19715        ) -> Self::Borrowed<'a> {
19716            value
19717        }
19718    }
19719
19720    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
19721        type Owned = Self;
19722
19723        #[inline(always)]
19724        fn inline_align(_context: fidl::encoding::Context) -> usize {
19725            4
19726        }
19727
19728        #[inline(always)]
19729        fn inline_size(_context: fidl::encoding::Context) -> usize {
19730            4
19731        }
19732    }
19733
19734    unsafe impl
19735        fidl::encoding::Encode<
19736            NodeListExtendedAttributesRequest,
19737            fdomain_client::fidl::FDomainResourceDialect,
19738        > for &mut NodeListExtendedAttributesRequest
19739    {
19740        #[inline]
19741        unsafe fn encode(
19742            self,
19743            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19744            offset: usize,
19745            _depth: fidl::encoding::Depth,
19746        ) -> fidl::Result<()> {
19747            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19748            // Delegate to tuple encoding.
19749            fidl::encoding::Encode::<
19750                NodeListExtendedAttributesRequest,
19751                fdomain_client::fidl::FDomainResourceDialect,
19752            >::encode(
19753                (<fidl::encoding::Endpoint<
19754                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19755                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19756                    &mut self.iterator
19757                ),),
19758                encoder,
19759                offset,
19760                _depth,
19761            )
19762        }
19763    }
19764    unsafe impl<
19765        T0: fidl::encoding::Encode<
19766                fidl::encoding::Endpoint<
19767                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19768                >,
19769                fdomain_client::fidl::FDomainResourceDialect,
19770            >,
19771    >
19772        fidl::encoding::Encode<
19773            NodeListExtendedAttributesRequest,
19774            fdomain_client::fidl::FDomainResourceDialect,
19775        > for (T0,)
19776    {
19777        #[inline]
19778        unsafe fn encode(
19779            self,
19780            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19781            offset: usize,
19782            depth: fidl::encoding::Depth,
19783        ) -> fidl::Result<()> {
19784            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19785            // Zero out padding regions. There's no need to apply masks
19786            // because the unmasked parts will be overwritten by fields.
19787            // Write the fields.
19788            self.0.encode(encoder, offset + 0, depth)?;
19789            Ok(())
19790        }
19791    }
19792
19793    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19794        for NodeListExtendedAttributesRequest
19795    {
19796        #[inline(always)]
19797        fn new_empty() -> Self {
19798            Self {
19799                iterator: fidl::new_empty!(
19800                    fidl::encoding::Endpoint<
19801                        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19802                    >,
19803                    fdomain_client::fidl::FDomainResourceDialect
19804                ),
19805            }
19806        }
19807
19808        #[inline]
19809        unsafe fn decode(
19810            &mut self,
19811            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19812            offset: usize,
19813            _depth: fidl::encoding::Depth,
19814        ) -> fidl::Result<()> {
19815            decoder.debug_check_bounds::<Self>(offset);
19816            // Verify that padding bytes are zero.
19817            fidl::decode!(
19818                fidl::encoding::Endpoint<
19819                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19820                >,
19821                fdomain_client::fidl::FDomainResourceDialect,
19822                &mut self.iterator,
19823                decoder,
19824                offset + 0,
19825                _depth
19826            )?;
19827            Ok(())
19828        }
19829    }
19830
19831    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
19832        type Borrowed<'a> = &'a mut Self;
19833        fn take_or_borrow<'a>(
19834            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19835        ) -> Self::Borrowed<'a> {
19836            value
19837        }
19838    }
19839
19840    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
19841        type Owned = Self;
19842
19843        #[inline(always)]
19844        fn inline_align(_context: fidl::encoding::Context) -> usize {
19845            8
19846        }
19847
19848        #[inline(always)]
19849        fn inline_size(_context: fidl::encoding::Context) -> usize {
19850            24
19851        }
19852    }
19853
19854    unsafe impl
19855        fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19856        for &mut NodeOnOpenRequest
19857    {
19858        #[inline]
19859        unsafe fn encode(
19860            self,
19861            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19862            offset: usize,
19863            _depth: fidl::encoding::Depth,
19864        ) -> fidl::Result<()> {
19865            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19866            // Delegate to tuple encoding.
19867            fidl::encoding::Encode::<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19868                (
19869                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
19870                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
19871                ),
19872                encoder, offset, _depth
19873            )
19874        }
19875    }
19876    unsafe impl<
19877        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
19878        T1: fidl::encoding::Encode<
19879                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19880                fdomain_client::fidl::FDomainResourceDialect,
19881            >,
19882    > fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19883        for (T0, T1)
19884    {
19885        #[inline]
19886        unsafe fn encode(
19887            self,
19888            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19889            offset: usize,
19890            depth: fidl::encoding::Depth,
19891        ) -> fidl::Result<()> {
19892            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19893            // Zero out padding regions. There's no need to apply masks
19894            // because the unmasked parts will be overwritten by fields.
19895            unsafe {
19896                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19897                (ptr as *mut u64).write_unaligned(0);
19898            }
19899            // Write the fields.
19900            self.0.encode(encoder, offset + 0, depth)?;
19901            self.1.encode(encoder, offset + 8, depth)?;
19902            Ok(())
19903        }
19904    }
19905
19906    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19907        for NodeOnOpenRequest
19908    {
19909        #[inline(always)]
19910        fn new_empty() -> Self {
19911            Self {
19912                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
19913                info: fidl::new_empty!(
19914                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19915                    fdomain_client::fidl::FDomainResourceDialect
19916                ),
19917            }
19918        }
19919
19920        #[inline]
19921        unsafe fn decode(
19922            &mut self,
19923            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19924            offset: usize,
19925            _depth: fidl::encoding::Depth,
19926        ) -> fidl::Result<()> {
19927            decoder.debug_check_bounds::<Self>(offset);
19928            // Verify that padding bytes are zero.
19929            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19930            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19931            let mask = 0xffffffff00000000u64;
19932            let maskedval = padval & mask;
19933            if maskedval != 0 {
19934                return Err(fidl::Error::NonZeroPadding {
19935                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19936                });
19937            }
19938            fidl::decode!(
19939                i32,
19940                fdomain_client::fidl::FDomainResourceDialect,
19941                &mut self.s,
19942                decoder,
19943                offset + 0,
19944                _depth
19945            )?;
19946            fidl::decode!(
19947                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19948                fdomain_client::fidl::FDomainResourceDialect,
19949                &mut self.info,
19950                decoder,
19951                offset + 8,
19952                _depth
19953            )?;
19954            Ok(())
19955        }
19956    }
19957
19958    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
19959        type Borrowed<'a> = &'a mut Self;
19960        fn take_or_borrow<'a>(
19961            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19962        ) -> Self::Borrowed<'a> {
19963            value
19964        }
19965    }
19966
19967    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
19968        type Owned = Self;
19969
19970        #[inline(always)]
19971        fn inline_align(_context: fidl::encoding::Context) -> usize {
19972            8
19973        }
19974
19975        #[inline(always)]
19976        fn inline_size(_context: fidl::encoding::Context) -> usize {
19977            40
19978        }
19979    }
19980
19981    unsafe impl
19982        fidl::encoding::Encode<
19983            NodeSetExtendedAttributeRequest,
19984            fdomain_client::fidl::FDomainResourceDialect,
19985        > for &mut NodeSetExtendedAttributeRequest
19986    {
19987        #[inline]
19988        unsafe fn encode(
19989            self,
19990            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19991            offset: usize,
19992            _depth: fidl::encoding::Depth,
19993        ) -> fidl::Result<()> {
19994            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19995            // Delegate to tuple encoding.
19996            fidl::encoding::Encode::<
19997                NodeSetExtendedAttributeRequest,
19998                fdomain_client::fidl::FDomainResourceDialect,
19999            >::encode(
20000                (
20001                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
20002                        &self.name,
20003                    ),
20004                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20005                        &mut self.value,
20006                    ),
20007                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
20008                        &self.mode,
20009                    ),
20010                ),
20011                encoder,
20012                offset,
20013                _depth,
20014            )
20015        }
20016    }
20017    unsafe impl<
20018        T0: fidl::encoding::Encode<
20019                fidl::encoding::Vector<u8, 255>,
20020                fdomain_client::fidl::FDomainResourceDialect,
20021            >,
20022        T1: fidl::encoding::Encode<
20023                ExtendedAttributeValue,
20024                fdomain_client::fidl::FDomainResourceDialect,
20025            >,
20026        T2: fidl::encoding::Encode<
20027                SetExtendedAttributeMode,
20028                fdomain_client::fidl::FDomainResourceDialect,
20029            >,
20030    >
20031        fidl::encoding::Encode<
20032            NodeSetExtendedAttributeRequest,
20033            fdomain_client::fidl::FDomainResourceDialect,
20034        > for (T0, T1, T2)
20035    {
20036        #[inline]
20037        unsafe fn encode(
20038            self,
20039            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20040            offset: usize,
20041            depth: fidl::encoding::Depth,
20042        ) -> fidl::Result<()> {
20043            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
20044            // Zero out padding regions. There's no need to apply masks
20045            // because the unmasked parts will be overwritten by fields.
20046            unsafe {
20047                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
20048                (ptr as *mut u64).write_unaligned(0);
20049            }
20050            // Write the fields.
20051            self.0.encode(encoder, offset + 0, depth)?;
20052            self.1.encode(encoder, offset + 16, depth)?;
20053            self.2.encode(encoder, offset + 32, depth)?;
20054            Ok(())
20055        }
20056    }
20057
20058    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20059        for NodeSetExtendedAttributeRequest
20060    {
20061        #[inline(always)]
20062        fn new_empty() -> Self {
20063            Self {
20064                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect),
20065                value: fidl::new_empty!(
20066                    ExtendedAttributeValue,
20067                    fdomain_client::fidl::FDomainResourceDialect
20068                ),
20069                mode: fidl::new_empty!(
20070                    SetExtendedAttributeMode,
20071                    fdomain_client::fidl::FDomainResourceDialect
20072                ),
20073            }
20074        }
20075
20076        #[inline]
20077        unsafe fn decode(
20078            &mut self,
20079            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20080            offset: usize,
20081            _depth: fidl::encoding::Depth,
20082        ) -> fidl::Result<()> {
20083            decoder.debug_check_bounds::<Self>(offset);
20084            // Verify that padding bytes are zero.
20085            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
20086            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20087            let mask = 0xffffffff00000000u64;
20088            let maskedval = padval & mask;
20089            if maskedval != 0 {
20090                return Err(fidl::Error::NonZeroPadding {
20091                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
20092                });
20093            }
20094            fidl::decode!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
20095            fidl::decode!(
20096                ExtendedAttributeValue,
20097                fdomain_client::fidl::FDomainResourceDialect,
20098                &mut self.value,
20099                decoder,
20100                offset + 16,
20101                _depth
20102            )?;
20103            fidl::decode!(
20104                SetExtendedAttributeMode,
20105                fdomain_client::fidl::FDomainResourceDialect,
20106                &mut self.mode,
20107                decoder,
20108                offset + 32,
20109                _depth
20110            )?;
20111            Ok(())
20112        }
20113    }
20114
20115    impl fidl::encoding::ResourceTypeMarker for NodeGetTokenResponse {
20116        type Borrowed<'a> = &'a mut Self;
20117        fn take_or_borrow<'a>(
20118            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20119        ) -> Self::Borrowed<'a> {
20120            value
20121        }
20122    }
20123
20124    unsafe impl fidl::encoding::TypeMarker for NodeGetTokenResponse {
20125        type Owned = Self;
20126
20127        #[inline(always)]
20128        fn inline_align(_context: fidl::encoding::Context) -> usize {
20129            4
20130        }
20131
20132        #[inline(always)]
20133        fn inline_size(_context: fidl::encoding::Context) -> usize {
20134            4
20135        }
20136    }
20137
20138    unsafe impl
20139        fidl::encoding::Encode<NodeGetTokenResponse, fdomain_client::fidl::FDomainResourceDialect>
20140        for &mut NodeGetTokenResponse
20141    {
20142        #[inline]
20143        unsafe fn encode(
20144            self,
20145            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20146            offset: usize,
20147            _depth: fidl::encoding::Depth,
20148        ) -> fidl::Result<()> {
20149            encoder.debug_check_bounds::<NodeGetTokenResponse>(offset);
20150            // Delegate to tuple encoding.
20151            fidl::encoding::Encode::<
20152                NodeGetTokenResponse,
20153                fdomain_client::fidl::FDomainResourceDialect,
20154            >::encode(
20155                (<fidl::encoding::HandleType<
20156                    fdomain_client::Event,
20157                    { fidl::ObjectType::EVENT.into_raw() },
20158                    2147483648,
20159                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20160                    &mut self.token
20161                ),),
20162                encoder,
20163                offset,
20164                _depth,
20165            )
20166        }
20167    }
20168    unsafe impl<
20169        T0: fidl::encoding::Encode<
20170                fidl::encoding::HandleType<
20171                    fdomain_client::Event,
20172                    { fidl::ObjectType::EVENT.into_raw() },
20173                    2147483648,
20174                >,
20175                fdomain_client::fidl::FDomainResourceDialect,
20176            >,
20177    > fidl::encoding::Encode<NodeGetTokenResponse, fdomain_client::fidl::FDomainResourceDialect>
20178        for (T0,)
20179    {
20180        #[inline]
20181        unsafe fn encode(
20182            self,
20183            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20184            offset: usize,
20185            depth: fidl::encoding::Depth,
20186        ) -> fidl::Result<()> {
20187            encoder.debug_check_bounds::<NodeGetTokenResponse>(offset);
20188            // Zero out padding regions. There's no need to apply masks
20189            // because the unmasked parts will be overwritten by fields.
20190            // Write the fields.
20191            self.0.encode(encoder, offset + 0, depth)?;
20192            Ok(())
20193        }
20194    }
20195
20196    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20197        for NodeGetTokenResponse
20198    {
20199        #[inline(always)]
20200        fn new_empty() -> Self {
20201            Self {
20202                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20203            }
20204        }
20205
20206        #[inline]
20207        unsafe fn decode(
20208            &mut self,
20209            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20210            offset: usize,
20211            _depth: fidl::encoding::Depth,
20212        ) -> fidl::Result<()> {
20213            decoder.debug_check_bounds::<Self>(offset);
20214            // Verify that padding bytes are zero.
20215            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
20216            Ok(())
20217        }
20218    }
20219
20220    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
20221        type Borrowed<'a> = &'a mut Self;
20222        fn take_or_borrow<'a>(
20223            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20224        ) -> Self::Borrowed<'a> {
20225            value
20226        }
20227    }
20228
20229    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
20230        type Owned = Self;
20231
20232        #[inline(always)]
20233        fn inline_align(_context: fidl::encoding::Context) -> usize {
20234            8
20235        }
20236
20237        #[inline(always)]
20238        fn inline_size(_context: fidl::encoding::Context) -> usize {
20239            48
20240        }
20241    }
20242
20243    unsafe impl
20244        fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
20245        for &mut OpenableOpenRequest
20246    {
20247        #[inline]
20248        unsafe fn encode(
20249            self,
20250            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20251            offset: usize,
20252            _depth: fidl::encoding::Depth,
20253        ) -> fidl::Result<()> {
20254            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
20255            // Delegate to tuple encoding.
20256            fidl::encoding::Encode::<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
20257                (
20258                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
20259                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
20260                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
20261                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
20262                ),
20263                encoder, offset, _depth
20264            )
20265        }
20266    }
20267    unsafe impl<
20268        T0: fidl::encoding::Encode<
20269                fidl::encoding::BoundedString<4095>,
20270                fdomain_client::fidl::FDomainResourceDialect,
20271            >,
20272        T1: fidl::encoding::Encode<Flags, fdomain_client::fidl::FDomainResourceDialect>,
20273        T2: fidl::encoding::Encode<Options, fdomain_client::fidl::FDomainResourceDialect>,
20274        T3: fidl::encoding::Encode<
20275                fidl::encoding::HandleType<
20276                    fdomain_client::Channel,
20277                    { fidl::ObjectType::CHANNEL.into_raw() },
20278                    2147483648,
20279                >,
20280                fdomain_client::fidl::FDomainResourceDialect,
20281            >,
20282    > fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
20283        for (T0, T1, T2, T3)
20284    {
20285        #[inline]
20286        unsafe fn encode(
20287            self,
20288            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20289            offset: usize,
20290            depth: fidl::encoding::Depth,
20291        ) -> fidl::Result<()> {
20292            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
20293            // Zero out padding regions. There's no need to apply masks
20294            // because the unmasked parts will be overwritten by fields.
20295            unsafe {
20296                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
20297                (ptr as *mut u64).write_unaligned(0);
20298            }
20299            // Write the fields.
20300            self.0.encode(encoder, offset + 0, depth)?;
20301            self.1.encode(encoder, offset + 16, depth)?;
20302            self.2.encode(encoder, offset + 24, depth)?;
20303            self.3.encode(encoder, offset + 40, depth)?;
20304            Ok(())
20305        }
20306    }
20307
20308    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20309        for OpenableOpenRequest
20310    {
20311        #[inline(always)]
20312        fn new_empty() -> Self {
20313            Self {
20314                path: fidl::new_empty!(
20315                    fidl::encoding::BoundedString<4095>,
20316                    fdomain_client::fidl::FDomainResourceDialect
20317                ),
20318                flags: fidl::new_empty!(Flags, fdomain_client::fidl::FDomainResourceDialect),
20319                options: fidl::new_empty!(Options, fdomain_client::fidl::FDomainResourceDialect),
20320                object: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20321            }
20322        }
20323
20324        #[inline]
20325        unsafe fn decode(
20326            &mut self,
20327            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20328            offset: usize,
20329            _depth: fidl::encoding::Depth,
20330        ) -> fidl::Result<()> {
20331            decoder.debug_check_bounds::<Self>(offset);
20332            // Verify that padding bytes are zero.
20333            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
20334            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20335            let mask = 0xffffffff00000000u64;
20336            let maskedval = padval & mask;
20337            if maskedval != 0 {
20338                return Err(fidl::Error::NonZeroPadding {
20339                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
20340                });
20341            }
20342            fidl::decode!(
20343                fidl::encoding::BoundedString<4095>,
20344                fdomain_client::fidl::FDomainResourceDialect,
20345                &mut self.path,
20346                decoder,
20347                offset + 0,
20348                _depth
20349            )?;
20350            fidl::decode!(
20351                Flags,
20352                fdomain_client::fidl::FDomainResourceDialect,
20353                &mut self.flags,
20354                decoder,
20355                offset + 16,
20356                _depth
20357            )?;
20358            fidl::decode!(
20359                Options,
20360                fdomain_client::fidl::FDomainResourceDialect,
20361                &mut self.options,
20362                decoder,
20363                offset + 24,
20364                _depth
20365            )?;
20366            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
20367            Ok(())
20368        }
20369    }
20370
20371    impl ConnectionInfo {
20372        #[inline(always)]
20373        fn max_ordinal_present(&self) -> u64 {
20374            if let Some(_) = self.rights {
20375                return 1;
20376            }
20377            0
20378        }
20379    }
20380
20381    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
20382        type Borrowed<'a> = &'a mut Self;
20383        fn take_or_borrow<'a>(
20384            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20385        ) -> Self::Borrowed<'a> {
20386            value
20387        }
20388    }
20389
20390    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
20391        type Owned = Self;
20392
20393        #[inline(always)]
20394        fn inline_align(_context: fidl::encoding::Context) -> usize {
20395            8
20396        }
20397
20398        #[inline(always)]
20399        fn inline_size(_context: fidl::encoding::Context) -> usize {
20400            16
20401        }
20402    }
20403
20404    unsafe impl fidl::encoding::Encode<ConnectionInfo, fdomain_client::fidl::FDomainResourceDialect>
20405        for &mut ConnectionInfo
20406    {
20407        unsafe fn encode(
20408            self,
20409            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20410            offset: usize,
20411            mut depth: fidl::encoding::Depth,
20412        ) -> fidl::Result<()> {
20413            encoder.debug_check_bounds::<ConnectionInfo>(offset);
20414            // Vector header
20415            let max_ordinal: u64 = self.max_ordinal_present();
20416            encoder.write_num(max_ordinal, offset);
20417            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20418            // Calling encoder.out_of_line_offset(0) is not allowed.
20419            if max_ordinal == 0 {
20420                return Ok(());
20421            }
20422            depth.increment()?;
20423            let envelope_size = 8;
20424            let bytes_len = max_ordinal as usize * envelope_size;
20425            #[allow(unused_variables)]
20426            let offset = encoder.out_of_line_offset(bytes_len);
20427            let mut _prev_end_offset: usize = 0;
20428            if 1 > max_ordinal {
20429                return Ok(());
20430            }
20431
20432            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20433            // are envelope_size bytes.
20434            let cur_offset: usize = (1 - 1) * envelope_size;
20435
20436            // Zero reserved fields.
20437            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20438
20439            // Safety:
20440            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20441            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20442            //   envelope_size bytes, there is always sufficient room.
20443            fidl::encoding::encode_in_envelope_optional::<
20444                Operations,
20445                fdomain_client::fidl::FDomainResourceDialect,
20446            >(
20447                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
20448                encoder,
20449                offset + cur_offset,
20450                depth,
20451            )?;
20452
20453            _prev_end_offset = cur_offset + envelope_size;
20454
20455            Ok(())
20456        }
20457    }
20458
20459    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {
20460        #[inline(always)]
20461        fn new_empty() -> Self {
20462            Self::default()
20463        }
20464
20465        unsafe fn decode(
20466            &mut self,
20467            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20468            offset: usize,
20469            mut depth: fidl::encoding::Depth,
20470        ) -> fidl::Result<()> {
20471            decoder.debug_check_bounds::<Self>(offset);
20472            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20473                None => return Err(fidl::Error::NotNullable),
20474                Some(len) => len,
20475            };
20476            // Calling decoder.out_of_line_offset(0) is not allowed.
20477            if len == 0 {
20478                return Ok(());
20479            };
20480            depth.increment()?;
20481            let envelope_size = 8;
20482            let bytes_len = len * envelope_size;
20483            let offset = decoder.out_of_line_offset(bytes_len)?;
20484            // Decode the envelope for each type.
20485            let mut _next_ordinal_to_read = 0;
20486            let mut next_offset = offset;
20487            let end_offset = offset + bytes_len;
20488            _next_ordinal_to_read += 1;
20489            if next_offset >= end_offset {
20490                return Ok(());
20491            }
20492
20493            // Decode unknown envelopes for gaps in ordinals.
20494            while _next_ordinal_to_read < 1 {
20495                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20496                _next_ordinal_to_read += 1;
20497                next_offset += envelope_size;
20498            }
20499
20500            let next_out_of_line = decoder.next_out_of_line();
20501            let handles_before = decoder.remaining_handles();
20502            if let Some((inlined, num_bytes, num_handles)) =
20503                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20504            {
20505                let member_inline_size =
20506                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20507                if inlined != (member_inline_size <= 4) {
20508                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20509                }
20510                let inner_offset;
20511                let mut inner_depth = depth.clone();
20512                if inlined {
20513                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20514                    inner_offset = next_offset;
20515                } else {
20516                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20517                    inner_depth.increment()?;
20518                }
20519                let val_ref = self.rights.get_or_insert_with(|| {
20520                    fidl::new_empty!(Operations, fdomain_client::fidl::FDomainResourceDialect)
20521                });
20522                fidl::decode!(
20523                    Operations,
20524                    fdomain_client::fidl::FDomainResourceDialect,
20525                    val_ref,
20526                    decoder,
20527                    inner_offset,
20528                    inner_depth
20529                )?;
20530                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20531                {
20532                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20533                }
20534                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20535                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20536                }
20537            }
20538
20539            next_offset += envelope_size;
20540
20541            // Decode the remaining unknown envelopes.
20542            while next_offset < end_offset {
20543                _next_ordinal_to_read += 1;
20544                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20545                next_offset += envelope_size;
20546            }
20547
20548            Ok(())
20549        }
20550    }
20551
20552    impl FileInfo {
20553        #[inline(always)]
20554        fn max_ordinal_present(&self) -> u64 {
20555            if let Some(_) = self.attributes {
20556                return 4;
20557            }
20558            if let Some(_) = self.stream {
20559                return 3;
20560            }
20561            if let Some(_) = self.observer {
20562                return 2;
20563            }
20564            if let Some(_) = self.is_append {
20565                return 1;
20566            }
20567            0
20568        }
20569    }
20570
20571    impl fidl::encoding::ResourceTypeMarker for FileInfo {
20572        type Borrowed<'a> = &'a mut Self;
20573        fn take_or_borrow<'a>(
20574            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20575        ) -> Self::Borrowed<'a> {
20576            value
20577        }
20578    }
20579
20580    unsafe impl fidl::encoding::TypeMarker for FileInfo {
20581        type Owned = Self;
20582
20583        #[inline(always)]
20584        fn inline_align(_context: fidl::encoding::Context) -> usize {
20585            8
20586        }
20587
20588        #[inline(always)]
20589        fn inline_size(_context: fidl::encoding::Context) -> usize {
20590            16
20591        }
20592    }
20593
20594    unsafe impl fidl::encoding::Encode<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
20595        for &mut FileInfo
20596    {
20597        unsafe fn encode(
20598            self,
20599            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20600            offset: usize,
20601            mut depth: fidl::encoding::Depth,
20602        ) -> fidl::Result<()> {
20603            encoder.debug_check_bounds::<FileInfo>(offset);
20604            // Vector header
20605            let max_ordinal: u64 = self.max_ordinal_present();
20606            encoder.write_num(max_ordinal, offset);
20607            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20608            // Calling encoder.out_of_line_offset(0) is not allowed.
20609            if max_ordinal == 0 {
20610                return Ok(());
20611            }
20612            depth.increment()?;
20613            let envelope_size = 8;
20614            let bytes_len = max_ordinal as usize * envelope_size;
20615            #[allow(unused_variables)]
20616            let offset = encoder.out_of_line_offset(bytes_len);
20617            let mut _prev_end_offset: usize = 0;
20618            if 1 > max_ordinal {
20619                return Ok(());
20620            }
20621
20622            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20623            // are envelope_size bytes.
20624            let cur_offset: usize = (1 - 1) * envelope_size;
20625
20626            // Zero reserved fields.
20627            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20628
20629            // Safety:
20630            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20631            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20632            //   envelope_size bytes, there is always sufficient room.
20633            fidl::encoding::encode_in_envelope_optional::<
20634                bool,
20635                fdomain_client::fidl::FDomainResourceDialect,
20636            >(
20637                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20638                encoder,
20639                offset + cur_offset,
20640                depth,
20641            )?;
20642
20643            _prev_end_offset = cur_offset + envelope_size;
20644            if 2 > max_ordinal {
20645                return Ok(());
20646            }
20647
20648            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20649            // are envelope_size bytes.
20650            let cur_offset: usize = (2 - 1) * envelope_size;
20651
20652            // Zero reserved fields.
20653            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20654
20655            // Safety:
20656            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20657            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20658            //   envelope_size bytes, there is always sufficient room.
20659            fidl::encoding::encode_in_envelope_optional::<
20660                fidl::encoding::HandleType<
20661                    fdomain_client::Event,
20662                    { fidl::ObjectType::EVENT.into_raw() },
20663                    2147483648,
20664                >,
20665                fdomain_client::fidl::FDomainResourceDialect,
20666            >(
20667                self.observer.as_mut().map(
20668                    <fidl::encoding::HandleType<
20669                        fdomain_client::Event,
20670                        { fidl::ObjectType::EVENT.into_raw() },
20671                        2147483648,
20672                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20673                ),
20674                encoder,
20675                offset + cur_offset,
20676                depth,
20677            )?;
20678
20679            _prev_end_offset = cur_offset + envelope_size;
20680            if 3 > max_ordinal {
20681                return Ok(());
20682            }
20683
20684            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20685            // are envelope_size bytes.
20686            let cur_offset: usize = (3 - 1) * envelope_size;
20687
20688            // Zero reserved fields.
20689            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20690
20691            // Safety:
20692            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20693            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20694            //   envelope_size bytes, there is always sufficient room.
20695            fidl::encoding::encode_in_envelope_optional::<
20696                fidl::encoding::HandleType<
20697                    fdomain_client::Stream,
20698                    { fidl::ObjectType::STREAM.into_raw() },
20699                    2147483648,
20700                >,
20701                fdomain_client::fidl::FDomainResourceDialect,
20702            >(
20703                self.stream.as_mut().map(
20704                    <fidl::encoding::HandleType<
20705                        fdomain_client::Stream,
20706                        { fidl::ObjectType::STREAM.into_raw() },
20707                        2147483648,
20708                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20709                ),
20710                encoder,
20711                offset + cur_offset,
20712                depth,
20713            )?;
20714
20715            _prev_end_offset = cur_offset + envelope_size;
20716            if 4 > max_ordinal {
20717                return Ok(());
20718            }
20719
20720            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20721            // are envelope_size bytes.
20722            let cur_offset: usize = (4 - 1) * envelope_size;
20723
20724            // Zero reserved fields.
20725            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20726
20727            // Safety:
20728            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20729            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20730            //   envelope_size bytes, there is always sufficient room.
20731            fidl::encoding::encode_in_envelope_optional::<
20732                NodeAttributes2,
20733                fdomain_client::fidl::FDomainResourceDialect,
20734            >(
20735                self.attributes
20736                    .as_ref()
20737                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
20738                encoder,
20739                offset + cur_offset,
20740                depth,
20741            )?;
20742
20743            _prev_end_offset = cur_offset + envelope_size;
20744
20745            Ok(())
20746        }
20747    }
20748
20749    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileInfo {
20750        #[inline(always)]
20751        fn new_empty() -> Self {
20752            Self::default()
20753        }
20754
20755        unsafe fn decode(
20756            &mut self,
20757            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20758            offset: usize,
20759            mut depth: fidl::encoding::Depth,
20760        ) -> fidl::Result<()> {
20761            decoder.debug_check_bounds::<Self>(offset);
20762            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20763                None => return Err(fidl::Error::NotNullable),
20764                Some(len) => len,
20765            };
20766            // Calling decoder.out_of_line_offset(0) is not allowed.
20767            if len == 0 {
20768                return Ok(());
20769            };
20770            depth.increment()?;
20771            let envelope_size = 8;
20772            let bytes_len = len * envelope_size;
20773            let offset = decoder.out_of_line_offset(bytes_len)?;
20774            // Decode the envelope for each type.
20775            let mut _next_ordinal_to_read = 0;
20776            let mut next_offset = offset;
20777            let end_offset = offset + bytes_len;
20778            _next_ordinal_to_read += 1;
20779            if next_offset >= end_offset {
20780                return Ok(());
20781            }
20782
20783            // Decode unknown envelopes for gaps in ordinals.
20784            while _next_ordinal_to_read < 1 {
20785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20786                _next_ordinal_to_read += 1;
20787                next_offset += envelope_size;
20788            }
20789
20790            let next_out_of_line = decoder.next_out_of_line();
20791            let handles_before = decoder.remaining_handles();
20792            if let Some((inlined, num_bytes, num_handles)) =
20793                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20794            {
20795                let member_inline_size =
20796                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20797                if inlined != (member_inline_size <= 4) {
20798                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20799                }
20800                let inner_offset;
20801                let mut inner_depth = depth.clone();
20802                if inlined {
20803                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20804                    inner_offset = next_offset;
20805                } else {
20806                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20807                    inner_depth.increment()?;
20808                }
20809                let val_ref = self.is_append.get_or_insert_with(|| {
20810                    fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect)
20811                });
20812                fidl::decode!(
20813                    bool,
20814                    fdomain_client::fidl::FDomainResourceDialect,
20815                    val_ref,
20816                    decoder,
20817                    inner_offset,
20818                    inner_depth
20819                )?;
20820                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20821                {
20822                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20823                }
20824                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20825                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20826                }
20827            }
20828
20829            next_offset += envelope_size;
20830            _next_ordinal_to_read += 1;
20831            if next_offset >= end_offset {
20832                return Ok(());
20833            }
20834
20835            // Decode unknown envelopes for gaps in ordinals.
20836            while _next_ordinal_to_read < 2 {
20837                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20838                _next_ordinal_to_read += 1;
20839                next_offset += envelope_size;
20840            }
20841
20842            let next_out_of_line = decoder.next_out_of_line();
20843            let handles_before = decoder.remaining_handles();
20844            if let Some((inlined, num_bytes, num_handles)) =
20845                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20846            {
20847                let member_inline_size = <fidl::encoding::HandleType<
20848                    fdomain_client::Event,
20849                    { fidl::ObjectType::EVENT.into_raw() },
20850                    2147483648,
20851                > as fidl::encoding::TypeMarker>::inline_size(
20852                    decoder.context
20853                );
20854                if inlined != (member_inline_size <= 4) {
20855                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20856                }
20857                let inner_offset;
20858                let mut inner_depth = depth.clone();
20859                if inlined {
20860                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20861                    inner_offset = next_offset;
20862                } else {
20863                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20864                    inner_depth.increment()?;
20865                }
20866                let val_ref =
20867                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
20868                fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
20869                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20870                {
20871                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20872                }
20873                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20874                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20875                }
20876            }
20877
20878            next_offset += envelope_size;
20879            _next_ordinal_to_read += 1;
20880            if next_offset >= end_offset {
20881                return Ok(());
20882            }
20883
20884            // Decode unknown envelopes for gaps in ordinals.
20885            while _next_ordinal_to_read < 3 {
20886                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20887                _next_ordinal_to_read += 1;
20888                next_offset += envelope_size;
20889            }
20890
20891            let next_out_of_line = decoder.next_out_of_line();
20892            let handles_before = decoder.remaining_handles();
20893            if let Some((inlined, num_bytes, num_handles)) =
20894                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20895            {
20896                let member_inline_size = <fidl::encoding::HandleType<
20897                    fdomain_client::Stream,
20898                    { fidl::ObjectType::STREAM.into_raw() },
20899                    2147483648,
20900                > as fidl::encoding::TypeMarker>::inline_size(
20901                    decoder.context
20902                );
20903                if inlined != (member_inline_size <= 4) {
20904                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20905                }
20906                let inner_offset;
20907                let mut inner_depth = depth.clone();
20908                if inlined {
20909                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20910                    inner_offset = next_offset;
20911                } else {
20912                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20913                    inner_depth.increment()?;
20914                }
20915                let val_ref =
20916                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
20917                fidl::decode!(fidl::encoding::HandleType<fdomain_client::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
20918                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20919                {
20920                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20921                }
20922                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20923                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20924                }
20925            }
20926
20927            next_offset += envelope_size;
20928            _next_ordinal_to_read += 1;
20929            if next_offset >= end_offset {
20930                return Ok(());
20931            }
20932
20933            // Decode unknown envelopes for gaps in ordinals.
20934            while _next_ordinal_to_read < 4 {
20935                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20936                _next_ordinal_to_read += 1;
20937                next_offset += envelope_size;
20938            }
20939
20940            let next_out_of_line = decoder.next_out_of_line();
20941            let handles_before = decoder.remaining_handles();
20942            if let Some((inlined, num_bytes, num_handles)) =
20943                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20944            {
20945                let member_inline_size =
20946                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20947                if inlined != (member_inline_size <= 4) {
20948                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20949                }
20950                let inner_offset;
20951                let mut inner_depth = depth.clone();
20952                if inlined {
20953                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20954                    inner_offset = next_offset;
20955                } else {
20956                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20957                    inner_depth.increment()?;
20958                }
20959                let val_ref = self.attributes.get_or_insert_with(|| {
20960                    fidl::new_empty!(NodeAttributes2, fdomain_client::fidl::FDomainResourceDialect)
20961                });
20962                fidl::decode!(
20963                    NodeAttributes2,
20964                    fdomain_client::fidl::FDomainResourceDialect,
20965                    val_ref,
20966                    decoder,
20967                    inner_offset,
20968                    inner_depth
20969                )?;
20970                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20971                {
20972                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20973                }
20974                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20975                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20976                }
20977            }
20978
20979            next_offset += envelope_size;
20980
20981            // Decode the remaining unknown envelopes.
20982            while next_offset < end_offset {
20983                _next_ordinal_to_read += 1;
20984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20985                next_offset += envelope_size;
20986            }
20987
20988            Ok(())
20989        }
20990    }
20991
20992    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
20993        type Borrowed<'a> = &'a mut Self;
20994        fn take_or_borrow<'a>(
20995            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20996        ) -> Self::Borrowed<'a> {
20997            value
20998        }
20999    }
21000
21001    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
21002        type Owned = Self;
21003
21004        #[inline(always)]
21005        fn inline_align(_context: fidl::encoding::Context) -> usize {
21006            8
21007        }
21008
21009        #[inline(always)]
21010        fn inline_size(_context: fidl::encoding::Context) -> usize {
21011            16
21012        }
21013    }
21014
21015    unsafe impl
21016        fidl::encoding::Encode<ExtendedAttributeValue, fdomain_client::fidl::FDomainResourceDialect>
21017        for &mut ExtendedAttributeValue
21018    {
21019        #[inline]
21020        unsafe fn encode(
21021            self,
21022            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21023            offset: usize,
21024            _depth: fidl::encoding::Depth,
21025        ) -> fidl::Result<()> {
21026            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
21027            encoder.write_num::<u64>(self.ordinal(), offset);
21028            match self {
21029                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
21030                    fidl::encoding::Vector<u8, 32768>,
21031                    fdomain_client::fidl::FDomainResourceDialect,
21032                >(
21033                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
21034                        val,
21035                    ),
21036                    encoder,
21037                    offset + 8,
21038                    _depth,
21039                ),
21040                ExtendedAttributeValue::Buffer(ref mut val) => {
21041                    fidl::encoding::encode_in_envelope::<
21042                        fidl::encoding::HandleType<
21043                            fdomain_client::Vmo,
21044                            { fidl::ObjectType::VMO.into_raw() },
21045                            2147483648,
21046                        >,
21047                        fdomain_client::fidl::FDomainResourceDialect,
21048                    >(
21049                        <fidl::encoding::HandleType<
21050                            fdomain_client::Vmo,
21051                            { fidl::ObjectType::VMO.into_raw() },
21052                            2147483648,
21053                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21054                            val
21055                        ),
21056                        encoder,
21057                        offset + 8,
21058                        _depth,
21059                    )
21060                }
21061                ExtendedAttributeValue::__SourceBreaking { .. } => {
21062                    Err(fidl::Error::UnknownUnionTag)
21063                }
21064            }
21065        }
21066    }
21067
21068    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
21069        for ExtendedAttributeValue
21070    {
21071        #[inline(always)]
21072        fn new_empty() -> Self {
21073            Self::__SourceBreaking { unknown_ordinal: 0 }
21074        }
21075
21076        #[inline]
21077        unsafe fn decode(
21078            &mut self,
21079            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21080            offset: usize,
21081            mut depth: fidl::encoding::Depth,
21082        ) -> fidl::Result<()> {
21083            decoder.debug_check_bounds::<Self>(offset);
21084            #[allow(unused_variables)]
21085            let next_out_of_line = decoder.next_out_of_line();
21086            let handles_before = decoder.remaining_handles();
21087            let (ordinal, inlined, num_bytes, num_handles) =
21088                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
21089
21090            let member_inline_size = match ordinal {
21091                1 => {
21092                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
21093                        decoder.context,
21094                    )
21095                }
21096                2 => <fidl::encoding::HandleType<
21097                    fdomain_client::Vmo,
21098                    { fidl::ObjectType::VMO.into_raw() },
21099                    2147483648,
21100                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21101                0 => return Err(fidl::Error::UnknownUnionTag),
21102                _ => num_bytes as usize,
21103            };
21104
21105            if inlined != (member_inline_size <= 4) {
21106                return Err(fidl::Error::InvalidInlineBitInEnvelope);
21107            }
21108            let _inner_offset;
21109            if inlined {
21110                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
21111                _inner_offset = offset + 8;
21112            } else {
21113                depth.increment()?;
21114                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21115            }
21116            match ordinal {
21117                1 => {
21118                    #[allow(irrefutable_let_patterns)]
21119                    if let ExtendedAttributeValue::Bytes(_) = self {
21120                        // Do nothing, read the value into the object
21121                    } else {
21122                        // Initialize `self` to the right variant
21123                        *self = ExtendedAttributeValue::Bytes(
21124                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect),
21125                        );
21126                    }
21127                    #[allow(irrefutable_let_patterns)]
21128                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
21129                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
21130                    } else {
21131                        unreachable!()
21132                    }
21133                }
21134                2 => {
21135                    #[allow(irrefutable_let_patterns)]
21136                    if let ExtendedAttributeValue::Buffer(_) = self {
21137                        // Do nothing, read the value into the object
21138                    } else {
21139                        // Initialize `self` to the right variant
21140                        *self = ExtendedAttributeValue::Buffer(
21141                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
21142                        );
21143                    }
21144                    #[allow(irrefutable_let_patterns)]
21145                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
21146                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
21147                    } else {
21148                        unreachable!()
21149                    }
21150                }
21151                #[allow(deprecated)]
21152                ordinal => {
21153                    for _ in 0..num_handles {
21154                        decoder.drop_next_handle()?;
21155                    }
21156                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
21157                }
21158            }
21159            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21160                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21161            }
21162            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21163                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21164            }
21165            Ok(())
21166        }
21167    }
21168
21169    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
21170        type Borrowed<'a> = &'a mut Self;
21171        fn take_or_borrow<'a>(
21172            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21173        ) -> Self::Borrowed<'a> {
21174            value
21175        }
21176    }
21177
21178    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
21179        type Owned = Self;
21180
21181        #[inline(always)]
21182        fn inline_align(_context: fidl::encoding::Context) -> usize {
21183            8
21184        }
21185
21186        #[inline(always)]
21187        fn inline_size(_context: fidl::encoding::Context) -> usize {
21188            16
21189        }
21190    }
21191
21192    unsafe impl
21193        fidl::encoding::Encode<NodeInfoDeprecated, fdomain_client::fidl::FDomainResourceDialect>
21194        for &mut NodeInfoDeprecated
21195    {
21196        #[inline]
21197        unsafe fn encode(
21198            self,
21199            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21200            offset: usize,
21201            _depth: fidl::encoding::Depth,
21202        ) -> fidl::Result<()> {
21203            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
21204            encoder.write_num::<u64>(self.ordinal(), offset);
21205            match self {
21206                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
21207                    Service,
21208                    fdomain_client::fidl::FDomainResourceDialect,
21209                >(
21210                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
21211                    encoder,
21212                    offset + 8,
21213                    _depth,
21214                ),
21215                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
21216                    FileObject,
21217                    fdomain_client::fidl::FDomainResourceDialect,
21218                >(
21219                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
21220                    encoder,
21221                    offset + 8,
21222                    _depth,
21223                ),
21224                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
21225                    DirectoryObject,
21226                    fdomain_client::fidl::FDomainResourceDialect,
21227                >(
21228                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
21229                    encoder,
21230                    offset + 8,
21231                    _depth,
21232                ),
21233                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
21234                    SymlinkObject,
21235                    fdomain_client::fidl::FDomainResourceDialect,
21236                >(
21237                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
21238                    encoder,
21239                    offset + 8,
21240                    _depth,
21241                ),
21242            }
21243        }
21244    }
21245
21246    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
21247        for NodeInfoDeprecated
21248    {
21249        #[inline(always)]
21250        fn new_empty() -> Self {
21251            Self::Service(fidl::new_empty!(Service, fdomain_client::fidl::FDomainResourceDialect))
21252        }
21253
21254        #[inline]
21255        unsafe fn decode(
21256            &mut self,
21257            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21258            offset: usize,
21259            mut depth: fidl::encoding::Depth,
21260        ) -> fidl::Result<()> {
21261            decoder.debug_check_bounds::<Self>(offset);
21262            #[allow(unused_variables)]
21263            let next_out_of_line = decoder.next_out_of_line();
21264            let handles_before = decoder.remaining_handles();
21265            let (ordinal, inlined, num_bytes, num_handles) =
21266                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
21267
21268            let member_inline_size = match ordinal {
21269                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21270                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21271                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21272                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21273                _ => return Err(fidl::Error::UnknownUnionTag),
21274            };
21275
21276            if inlined != (member_inline_size <= 4) {
21277                return Err(fidl::Error::InvalidInlineBitInEnvelope);
21278            }
21279            let _inner_offset;
21280            if inlined {
21281                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
21282                _inner_offset = offset + 8;
21283            } else {
21284                depth.increment()?;
21285                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21286            }
21287            match ordinal {
21288                1 => {
21289                    #[allow(irrefutable_let_patterns)]
21290                    if let NodeInfoDeprecated::Service(_) = self {
21291                        // Do nothing, read the value into the object
21292                    } else {
21293                        // Initialize `self` to the right variant
21294                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
21295                            Service,
21296                            fdomain_client::fidl::FDomainResourceDialect
21297                        ));
21298                    }
21299                    #[allow(irrefutable_let_patterns)]
21300                    if let NodeInfoDeprecated::Service(ref mut val) = self {
21301                        fidl::decode!(
21302                            Service,
21303                            fdomain_client::fidl::FDomainResourceDialect,
21304                            val,
21305                            decoder,
21306                            _inner_offset,
21307                            depth
21308                        )?;
21309                    } else {
21310                        unreachable!()
21311                    }
21312                }
21313                2 => {
21314                    #[allow(irrefutable_let_patterns)]
21315                    if let NodeInfoDeprecated::File(_) = self {
21316                        // Do nothing, read the value into the object
21317                    } else {
21318                        // Initialize `self` to the right variant
21319                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
21320                            FileObject,
21321                            fdomain_client::fidl::FDomainResourceDialect
21322                        ));
21323                    }
21324                    #[allow(irrefutable_let_patterns)]
21325                    if let NodeInfoDeprecated::File(ref mut val) = self {
21326                        fidl::decode!(
21327                            FileObject,
21328                            fdomain_client::fidl::FDomainResourceDialect,
21329                            val,
21330                            decoder,
21331                            _inner_offset,
21332                            depth
21333                        )?;
21334                    } else {
21335                        unreachable!()
21336                    }
21337                }
21338                3 => {
21339                    #[allow(irrefutable_let_patterns)]
21340                    if let NodeInfoDeprecated::Directory(_) = self {
21341                        // Do nothing, read the value into the object
21342                    } else {
21343                        // Initialize `self` to the right variant
21344                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
21345                            DirectoryObject,
21346                            fdomain_client::fidl::FDomainResourceDialect
21347                        ));
21348                    }
21349                    #[allow(irrefutable_let_patterns)]
21350                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
21351                        fidl::decode!(
21352                            DirectoryObject,
21353                            fdomain_client::fidl::FDomainResourceDialect,
21354                            val,
21355                            decoder,
21356                            _inner_offset,
21357                            depth
21358                        )?;
21359                    } else {
21360                        unreachable!()
21361                    }
21362                }
21363                4 => {
21364                    #[allow(irrefutable_let_patterns)]
21365                    if let NodeInfoDeprecated::Symlink(_) = self {
21366                        // Do nothing, read the value into the object
21367                    } else {
21368                        // Initialize `self` to the right variant
21369                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
21370                            SymlinkObject,
21371                            fdomain_client::fidl::FDomainResourceDialect
21372                        ));
21373                    }
21374                    #[allow(irrefutable_let_patterns)]
21375                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
21376                        fidl::decode!(
21377                            SymlinkObject,
21378                            fdomain_client::fidl::FDomainResourceDialect,
21379                            val,
21380                            decoder,
21381                            _inner_offset,
21382                            depth
21383                        )?;
21384                    } else {
21385                        unreachable!()
21386                    }
21387                }
21388                ordinal => panic!("unexpected ordinal {:?}", ordinal),
21389            }
21390            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21391                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21392            }
21393            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21394                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21395            }
21396            Ok(())
21397        }
21398    }
21399
21400    impl fidl::encoding::ResourceTypeMarker for Representation {
21401        type Borrowed<'a> = &'a mut Self;
21402        fn take_or_borrow<'a>(
21403            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21404        ) -> Self::Borrowed<'a> {
21405            value
21406        }
21407    }
21408
21409    unsafe impl fidl::encoding::TypeMarker for Representation {
21410        type Owned = Self;
21411
21412        #[inline(always)]
21413        fn inline_align(_context: fidl::encoding::Context) -> usize {
21414            8
21415        }
21416
21417        #[inline(always)]
21418        fn inline_size(_context: fidl::encoding::Context) -> usize {
21419            16
21420        }
21421    }
21422
21423    unsafe impl fidl::encoding::Encode<Representation, fdomain_client::fidl::FDomainResourceDialect>
21424        for &mut Representation
21425    {
21426        #[inline]
21427        unsafe fn encode(
21428            self,
21429            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21430            offset: usize,
21431            _depth: fidl::encoding::Depth,
21432        ) -> fidl::Result<()> {
21433            encoder.debug_check_bounds::<Representation>(offset);
21434            encoder.write_num::<u64>(self.ordinal(), offset);
21435            match self {
21436                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
21437                    NodeInfo,
21438                    fdomain_client::fidl::FDomainResourceDialect,
21439                >(
21440                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21441                    encoder,
21442                    offset + 8,
21443                    _depth,
21444                ),
21445                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
21446                    DirectoryInfo,
21447                    fdomain_client::fidl::FDomainResourceDialect,
21448                >(
21449                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21450                    encoder,
21451                    offset + 8,
21452                    _depth,
21453                ),
21454                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
21455                    FileInfo,
21456                    fdomain_client::fidl::FDomainResourceDialect,
21457                >(
21458                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
21459                    encoder,
21460                    offset + 8,
21461                    _depth,
21462                ),
21463                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
21464                    SymlinkInfo,
21465                    fdomain_client::fidl::FDomainResourceDialect,
21466                >(
21467                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21468                    encoder,
21469                    offset + 8,
21470                    _depth,
21471                ),
21472                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
21473            }
21474        }
21475    }
21476
21477    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Representation {
21478        #[inline(always)]
21479        fn new_empty() -> Self {
21480            Self::__SourceBreaking { unknown_ordinal: 0 }
21481        }
21482
21483        #[inline]
21484        unsafe fn decode(
21485            &mut self,
21486            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21487            offset: usize,
21488            mut depth: fidl::encoding::Depth,
21489        ) -> fidl::Result<()> {
21490            decoder.debug_check_bounds::<Self>(offset);
21491            #[allow(unused_variables)]
21492            let next_out_of_line = decoder.next_out_of_line();
21493            let handles_before = decoder.remaining_handles();
21494            let (ordinal, inlined, num_bytes, num_handles) =
21495                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
21496
21497            let member_inline_size = match ordinal {
21498                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21499                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21500                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21501                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21502                0 => return Err(fidl::Error::UnknownUnionTag),
21503                _ => num_bytes as usize,
21504            };
21505
21506            if inlined != (member_inline_size <= 4) {
21507                return Err(fidl::Error::InvalidInlineBitInEnvelope);
21508            }
21509            let _inner_offset;
21510            if inlined {
21511                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
21512                _inner_offset = offset + 8;
21513            } else {
21514                depth.increment()?;
21515                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21516            }
21517            match ordinal {
21518                1 => {
21519                    #[allow(irrefutable_let_patterns)]
21520                    if let Representation::Node(_) = self {
21521                        // Do nothing, read the value into the object
21522                    } else {
21523                        // Initialize `self` to the right variant
21524                        *self = Representation::Node(fidl::new_empty!(
21525                            NodeInfo,
21526                            fdomain_client::fidl::FDomainResourceDialect
21527                        ));
21528                    }
21529                    #[allow(irrefutable_let_patterns)]
21530                    if let Representation::Node(ref mut val) = self {
21531                        fidl::decode!(
21532                            NodeInfo,
21533                            fdomain_client::fidl::FDomainResourceDialect,
21534                            val,
21535                            decoder,
21536                            _inner_offset,
21537                            depth
21538                        )?;
21539                    } else {
21540                        unreachable!()
21541                    }
21542                }
21543                2 => {
21544                    #[allow(irrefutable_let_patterns)]
21545                    if let Representation::Directory(_) = self {
21546                        // Do nothing, read the value into the object
21547                    } else {
21548                        // Initialize `self` to the right variant
21549                        *self = Representation::Directory(fidl::new_empty!(
21550                            DirectoryInfo,
21551                            fdomain_client::fidl::FDomainResourceDialect
21552                        ));
21553                    }
21554                    #[allow(irrefutable_let_patterns)]
21555                    if let Representation::Directory(ref mut val) = self {
21556                        fidl::decode!(
21557                            DirectoryInfo,
21558                            fdomain_client::fidl::FDomainResourceDialect,
21559                            val,
21560                            decoder,
21561                            _inner_offset,
21562                            depth
21563                        )?;
21564                    } else {
21565                        unreachable!()
21566                    }
21567                }
21568                3 => {
21569                    #[allow(irrefutable_let_patterns)]
21570                    if let Representation::File(_) = self {
21571                        // Do nothing, read the value into the object
21572                    } else {
21573                        // Initialize `self` to the right variant
21574                        *self = Representation::File(fidl::new_empty!(
21575                            FileInfo,
21576                            fdomain_client::fidl::FDomainResourceDialect
21577                        ));
21578                    }
21579                    #[allow(irrefutable_let_patterns)]
21580                    if let Representation::File(ref mut val) = self {
21581                        fidl::decode!(
21582                            FileInfo,
21583                            fdomain_client::fidl::FDomainResourceDialect,
21584                            val,
21585                            decoder,
21586                            _inner_offset,
21587                            depth
21588                        )?;
21589                    } else {
21590                        unreachable!()
21591                    }
21592                }
21593                4 => {
21594                    #[allow(irrefutable_let_patterns)]
21595                    if let Representation::Symlink(_) = self {
21596                        // Do nothing, read the value into the object
21597                    } else {
21598                        // Initialize `self` to the right variant
21599                        *self = Representation::Symlink(fidl::new_empty!(
21600                            SymlinkInfo,
21601                            fdomain_client::fidl::FDomainResourceDialect
21602                        ));
21603                    }
21604                    #[allow(irrefutable_let_patterns)]
21605                    if let Representation::Symlink(ref mut val) = self {
21606                        fidl::decode!(
21607                            SymlinkInfo,
21608                            fdomain_client::fidl::FDomainResourceDialect,
21609                            val,
21610                            decoder,
21611                            _inner_offset,
21612                            depth
21613                        )?;
21614                    } else {
21615                        unreachable!()
21616                    }
21617                }
21618                #[allow(deprecated)]
21619                ordinal => {
21620                    for _ in 0..num_handles {
21621                        decoder.drop_next_handle()?;
21622                    }
21623                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
21624                }
21625            }
21626            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21627                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21628            }
21629            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21630                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21631            }
21632            Ok(())
21633        }
21634    }
21635}