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 DirectoryDeprecatedOpenRequest {
31    pub flags: OpenFlags,
32    pub mode: ModeType,
33    pub path: String,
34    pub object: fdomain_client::fidl::ServerEnd<NodeMarker>,
35}
36
37impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
38    for DirectoryDeprecatedOpenRequest
39{
40}
41
42#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
43pub struct DirectoryGetTokenResponse {
44    pub s: i32,
45    pub token: Option<fdomain_client::NullableHandle>,
46}
47
48impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryGetTokenResponse {}
49
50#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
51pub struct DirectoryLinkRequest {
52    pub src: String,
53    pub dst_parent_token: fdomain_client::NullableHandle,
54    pub dst: String,
55}
56
57impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryLinkRequest {}
58
59#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct DirectoryRenameRequest {
61    pub src: String,
62    pub dst_parent_token: fdomain_client::Event,
63    pub dst: String,
64}
65
66impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryRenameRequest {}
67
68#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
69pub struct DirectoryWatchRequest {
70    pub mask: WatchMask,
71    pub options: u32,
72    pub watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
73}
74
75impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryWatchRequest {}
76
77#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
78pub struct FileAllocateRequest {
79    pub offset: u64,
80    pub length: u64,
81    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
82    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
83    /// support a particular provided mode bit, or combination of mode bits, an error is
84    /// returned.
85    pub mode: AllocateMode,
86}
87
88impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileAllocateRequest {}
89
90#[derive(Debug, PartialEq)]
91pub struct FileEnableVerityRequest {
92    pub options: VerificationOptions,
93}
94
95impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileEnableVerityRequest {}
96
97#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct FileObject {
99    /// An optional event which transmits information about an object's readability
100    /// or writability. This event relays information about the underlying object, not
101    /// the capability granted to client: this event may be signalled "readable" on a
102    /// connection that does not have the capability to read.
103    ///
104    /// The "`FILE_SIGNAL_`" values may be observed on this event.
105    pub event: Option<fdomain_client::Event>,
106    /// A placeholder for future stream support.
107    ///
108    /// Currently, servers are required not to send a handle in this field.
109    pub stream: Option<fdomain_client::Stream>,
110}
111
112impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileObject {}
113
114#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
115pub struct FileGetBackingMemoryResponse {
116    pub vmo: fdomain_client::Vmo,
117}
118
119impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
120    for FileGetBackingMemoryResponse
121{
122}
123
124#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct LinkableLinkIntoRequest {
126    pub dst_parent_token: fdomain_client::Event,
127    pub dst: String,
128}
129
130impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for LinkableLinkIntoRequest {}
131
132#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133pub struct NodeDeprecatedCloneRequest {
134    pub flags: OpenFlags,
135    pub object: fdomain_client::fidl::ServerEnd<NodeMarker>,
136}
137
138impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeDeprecatedCloneRequest {}
139
140#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
141pub struct NodeListExtendedAttributesRequest {
142    pub iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
143}
144
145impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
146    for NodeListExtendedAttributesRequest
147{
148}
149
150#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151pub struct NodeOnOpenRequest {
152    pub s: i32,
153    pub info: Option<Box<NodeInfoDeprecated>>,
154}
155
156impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeOnOpenRequest {}
157
158#[derive(Debug, PartialEq)]
159pub struct NodeSetExtendedAttributeRequest {
160    pub name: Vec<u8>,
161    pub value: ExtendedAttributeValue,
162    /// Specifies the behavior based on the current state of the attribute.
163    pub mode: SetExtendedAttributeMode,
164}
165
166impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
167    for NodeSetExtendedAttributeRequest
168{
169}
170
171#[derive(Debug, PartialEq)]
172pub struct OpenableOpenRequest {
173    pub path: String,
174    pub flags: Flags,
175    pub options: Options,
176    pub object: fdomain_client::Channel,
177}
178
179impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for OpenableOpenRequest {}
180
181#[derive(Debug, Default, PartialEq)]
182pub struct ConnectionInfo {
183    /// The rights possessed by the current connection. Note: `rights` limits
184    /// the set of operations allowed on the connection, but does not guarantee
185    /// their availability. For example, one may have the [`Rights.EXECUTE`]
186    /// right on a file connection, but the file itself does not have the
187    /// `EXECUTE` ability, and hence cannot be executed. See
188    /// [`ConnectionOptions.rights`].
189    pub rights: Option<Operations>,
190    #[doc(hidden)]
191    pub __source_breaking: fidl::marker::SourceBreaking,
192}
193
194impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {}
195
196/// Auxiliary data for the file representation of a node.
197#[derive(Debug, Default, PartialEq)]
198pub struct FileInfo {
199    /// True if the file is opened in append mode.
200    /// In append mode, the seek offset is moved to the end before every
201    /// write, the two steps performed in an atomic manner.
202    pub is_append: Option<bool>,
203    /// An optional event which transmits information about an object's
204    /// readability or writability. This event relays information about the
205    /// underlying object, not the capability granted to client: this event
206    /// may be signalled "readable" on a connection that does not have
207    /// the capability to read.
208    ///
209    /// This event will be present if the following conditions are met:
210    ///
211    /// - The `available_operations` on the file connection is not empty.
212    /// - The filesystem supports signalling readability/writability events.
213    ///
214    /// The [`FileSignal`] values may be observed on this event.
215    pub observer: Option<fdomain_client::Event>,
216    /// An optional stream object, which can be used to read to and write from
217    /// the file more quickly than with fidl.
218    ///
219    /// The channel for the file *must* be held open while the stream is in use.
220    /// Using a stream object that has outlived the channel it came from may
221    /// result in failures or unexpected results.
222    pub stream: Option<fdomain_client::Stream>,
223    /// Requested attributes for the file. This is only populated if requested.
224    pub attributes: Option<NodeAttributes2>,
225    #[doc(hidden)]
226    pub __source_breaking: fidl::marker::SourceBreaking,
227}
228
229impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileInfo {}
230
231/// The value type for an extended attribute. If the value is less than 32768
232/// bytes, then it is included inline. Values larger than this size are written
233/// into a vmo buffer.
234#[derive(Debug)]
235pub enum ExtendedAttributeValue {
236    Bytes(Vec<u8>),
237    Buffer(fdomain_client::Vmo),
238    #[doc(hidden)]
239    __SourceBreaking {
240        unknown_ordinal: u64,
241    },
242}
243
244/// Pattern that matches an unknown `ExtendedAttributeValue` member.
245#[macro_export]
246macro_rules! ExtendedAttributeValueUnknown {
247    () => {
248        _
249    };
250}
251
252// Custom PartialEq so that unknown variants are not equal to themselves.
253impl PartialEq for ExtendedAttributeValue {
254    fn eq(&self, other: &Self) -> bool {
255        match (self, other) {
256            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
257            (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
258            _ => false,
259        }
260    }
261}
262
263impl ExtendedAttributeValue {
264    #[inline]
265    pub fn ordinal(&self) -> u64 {
266        match *self {
267            Self::Bytes(_) => 1,
268            Self::Buffer(_) => 2,
269            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
270        }
271    }
272
273    #[inline]
274    pub fn unknown_variant_for_testing() -> Self {
275        Self::__SourceBreaking { unknown_ordinal: 0 }
276    }
277
278    #[inline]
279    pub fn is_unknown(&self) -> bool {
280        match self {
281            Self::__SourceBreaking { .. } => true,
282            _ => false,
283        }
284    }
285}
286
287impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ExtendedAttributeValue {}
288
289#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
290pub enum NodeInfoDeprecated {
291    /// No protocol information was supplied by the connection.
292    Service(Service),
293    /// The connection composes [`File`].
294    File(FileObject),
295    /// The connection composes [`Directory`].
296    Directory(DirectoryObject),
297    /// The connection composes ['Symlink'].
298    Symlink(SymlinkObject),
299}
300
301impl NodeInfoDeprecated {
302    #[inline]
303    pub fn ordinal(&self) -> u64 {
304        match *self {
305            Self::Service(_) => 1,
306            Self::File(_) => 2,
307            Self::Directory(_) => 3,
308            Self::Symlink(_) => 4,
309        }
310    }
311}
312
313impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeInfoDeprecated {}
314
315#[derive(Debug)]
316pub enum Representation {
317    /// The [`Node`] protocol was negotiated for this connection.
318    Node(NodeInfo),
319    /// The [`File`] protocol was negotiated for this connection.
320    Directory(DirectoryInfo),
321    /// The [`File`] protocol was negotiated for this connection.
322    File(FileInfo),
323    /// The [`Symlink`] protocol was negotiated for this connection.
324    Symlink(SymlinkInfo),
325    #[doc(hidden)]
326    __SourceBreaking { unknown_ordinal: u64 },
327}
328
329/// Pattern that matches an unknown `Representation` member.
330#[macro_export]
331macro_rules! RepresentationUnknown {
332    () => {
333        _
334    };
335}
336
337// Custom PartialEq so that unknown variants are not equal to themselves.
338impl PartialEq for Representation {
339    fn eq(&self, other: &Self) -> bool {
340        match (self, other) {
341            (Self::Node(x), Self::Node(y)) => *x == *y,
342            (Self::Directory(x), Self::Directory(y)) => *x == *y,
343            (Self::File(x), Self::File(y)) => *x == *y,
344            (Self::Symlink(x), Self::Symlink(y)) => *x == *y,
345            _ => false,
346        }
347    }
348}
349
350impl Representation {
351    #[inline]
352    pub fn ordinal(&self) -> u64 {
353        match *self {
354            Self::Node(_) => 1,
355            Self::Directory(_) => 2,
356            Self::File(_) => 3,
357            Self::Symlink(_) => 4,
358            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
359        }
360    }
361
362    #[inline]
363    pub fn unknown_variant_for_testing() -> Self {
364        Self::__SourceBreaking { unknown_ordinal: 0 }
365    }
366
367    #[inline]
368    pub fn is_unknown(&self) -> bool {
369        match self {
370            Self::__SourceBreaking { .. } => true,
371            _ => false,
372        }
373    }
374}
375
376impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Representation {}
377
378#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
379pub struct AdvisoryLockingMarker;
380
381impl fdomain_client::fidl::ProtocolMarker for AdvisoryLockingMarker {
382    type Proxy = AdvisoryLockingProxy;
383    type RequestStream = AdvisoryLockingRequestStream;
384
385    const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
386}
387pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
388
389pub trait AdvisoryLockingProxyInterface: Send + Sync {
390    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
391        + Send;
392    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
393}
394
395#[derive(Debug, Clone)]
396pub struct AdvisoryLockingProxy {
397    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
398}
399
400impl fdomain_client::fidl::Proxy for AdvisoryLockingProxy {
401    type Protocol = AdvisoryLockingMarker;
402
403    fn from_channel(inner: fdomain_client::Channel) -> Self {
404        Self::new(inner)
405    }
406
407    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
408        self.client.into_channel().map_err(|client| Self { client })
409    }
410
411    fn as_channel(&self) -> &fdomain_client::Channel {
412        self.client.as_channel()
413    }
414}
415
416impl AdvisoryLockingProxy {
417    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
418    pub fn new(channel: fdomain_client::Channel) -> Self {
419        let protocol_name =
420            <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
421        Self { client: fidl::client::Client::new(channel, protocol_name) }
422    }
423
424    /// Get a Stream of events from the remote end of the protocol.
425    ///
426    /// # Panics
427    ///
428    /// Panics if the event stream was already taken.
429    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
430        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
431    }
432
433    /// Acquires an advisory lock on the underlying file.
434    ///
435    /// The lock lasts until either this connection is closed or
436    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
437    /// explicitly.
438    ///
439    /// Advisory locks are purely advisory. They do not prevent actual read or
440    /// write operations from occurring on the file, either through this
441    /// connection or through other connections.
442    ///
443    /// This method requires the following rights:
444    ///
445    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
446    /// * [`Rights.WRITE_BYTES`] if `request.type` is
447    ///   [`AdvisoryLockType.WRITE`].
448    ///
449    /// # Errors
450    ///
451    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
452    ///   example, another connection might hold a conflicting lock type.
453    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
454    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
455    ///   to acquire the given type of lock.
456    pub fn r#advisory_lock(
457        &self,
458        mut request: &AdvisoryLockRequest,
459    ) -> fidl::client::QueryResponseFut<
460        AdvisoryLockingAdvisoryLockResult,
461        fdomain_client::fidl::FDomainResourceDialect,
462    > {
463        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
464    }
465}
466
467impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
468    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
469        AdvisoryLockingAdvisoryLockResult,
470        fdomain_client::fidl::FDomainResourceDialect,
471    >;
472    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
473        fn _decode(
474            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
475        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
476            let _response = fidl::client::decode_transaction_body::<
477                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
478                fdomain_client::fidl::FDomainResourceDialect,
479                0x6ee9c0ad53ec87aa,
480            >(_buf?)?;
481            Ok(_response.map(|x| x))
482        }
483        self.client.send_query_and_decode::<
484            AdvisoryLockingAdvisoryLockRequest,
485            AdvisoryLockingAdvisoryLockResult,
486        >(
487            (request,),
488            0x6ee9c0ad53ec87aa,
489            fidl::encoding::DynamicFlags::empty(),
490            _decode,
491        )
492    }
493}
494
495pub struct AdvisoryLockingEventStream {
496    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
497}
498
499impl std::marker::Unpin for AdvisoryLockingEventStream {}
500
501impl futures::stream::FusedStream for AdvisoryLockingEventStream {
502    fn is_terminated(&self) -> bool {
503        self.event_receiver.is_terminated()
504    }
505}
506
507impl futures::Stream for AdvisoryLockingEventStream {
508    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
509
510    fn poll_next(
511        mut self: std::pin::Pin<&mut Self>,
512        cx: &mut std::task::Context<'_>,
513    ) -> std::task::Poll<Option<Self::Item>> {
514        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
515            &mut self.event_receiver,
516            cx
517        )?) {
518            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
519            None => std::task::Poll::Ready(None),
520        }
521    }
522}
523
524#[derive(Debug)]
525pub enum AdvisoryLockingEvent {}
526
527impl AdvisoryLockingEvent {
528    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
529    fn decode(
530        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
531    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
532        let (bytes, _handles) = buf.split_mut();
533        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
534        debug_assert_eq!(tx_header.tx_id, 0);
535        match tx_header.ordinal {
536            _ => Err(fidl::Error::UnknownOrdinal {
537                ordinal: tx_header.ordinal,
538                protocol_name:
539                    <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
540            }),
541        }
542    }
543}
544
545/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
546pub struct AdvisoryLockingRequestStream {
547    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
548    is_terminated: bool,
549}
550
551impl std::marker::Unpin for AdvisoryLockingRequestStream {}
552
553impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
554    fn is_terminated(&self) -> bool {
555        self.is_terminated
556    }
557}
558
559impl fdomain_client::fidl::RequestStream for AdvisoryLockingRequestStream {
560    type Protocol = AdvisoryLockingMarker;
561    type ControlHandle = AdvisoryLockingControlHandle;
562
563    fn from_channel(channel: fdomain_client::Channel) -> Self {
564        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
565    }
566
567    fn control_handle(&self) -> Self::ControlHandle {
568        AdvisoryLockingControlHandle { inner: self.inner.clone() }
569    }
570
571    fn into_inner(
572        self,
573    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
574    {
575        (self.inner, self.is_terminated)
576    }
577
578    fn from_inner(
579        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
580        is_terminated: bool,
581    ) -> Self {
582        Self { inner, is_terminated }
583    }
584}
585
586impl futures::Stream for AdvisoryLockingRequestStream {
587    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
588
589    fn poll_next(
590        mut self: std::pin::Pin<&mut Self>,
591        cx: &mut std::task::Context<'_>,
592    ) -> std::task::Poll<Option<Self::Item>> {
593        let this = &mut *self;
594        if this.inner.check_shutdown(cx) {
595            this.is_terminated = true;
596            return std::task::Poll::Ready(None);
597        }
598        if this.is_terminated {
599            panic!("polled AdvisoryLockingRequestStream after completion");
600        }
601        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
602            |bytes, handles| {
603                match this.inner.channel().read_etc(cx, bytes, handles) {
604                    std::task::Poll::Ready(Ok(())) => {}
605                    std::task::Poll::Pending => return std::task::Poll::Pending,
606                    std::task::Poll::Ready(Err(None)) => {
607                        this.is_terminated = true;
608                        return std::task::Poll::Ready(None);
609                    }
610                    std::task::Poll::Ready(Err(Some(e))) => {
611                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
612                            e.into(),
613                        ))));
614                    }
615                }
616
617                // A message has been received from the channel
618                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
619
620                std::task::Poll::Ready(Some(match header.ordinal {
621                0x6ee9c0ad53ec87aa => {
622                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
623                    let mut req = fidl::new_empty!(AdvisoryLockingAdvisoryLockRequest, fdomain_client::fidl::FDomainResourceDialect);
624                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
625                    let control_handle = AdvisoryLockingControlHandle {
626                        inner: this.inner.clone(),
627                    };
628                    Ok(AdvisoryLockingRequest::AdvisoryLock {request: req.request,
629
630                        responder: AdvisoryLockingAdvisoryLockResponder {
631                            control_handle: std::mem::ManuallyDrop::new(control_handle),
632                            tx_id: header.tx_id,
633                        },
634                    })
635                }
636                _ => Err(fidl::Error::UnknownOrdinal {
637                    ordinal: header.ordinal,
638                    protocol_name: <AdvisoryLockingMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
639                }),
640            }))
641            },
642        )
643    }
644}
645
646/// Advisory locking protocol.
647///
648/// This protocol is intended to be composed into the |File| protocol to
649/// provide support for advisory locking.
650///
651/// Advisory locks are purely advisory. They do not prevent actual read or
652/// write operations from occurring on the file, either through this
653/// connection or through other connections.
654///
655/// These primitives are designed to support the flock() and fcntl(),
656/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
657/// running on Fuchsia expects from other operating systems.
658#[derive(Debug)]
659pub enum AdvisoryLockingRequest {
660    /// Acquires an advisory lock on the underlying file.
661    ///
662    /// The lock lasts until either this connection is closed or
663    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
664    /// explicitly.
665    ///
666    /// Advisory locks are purely advisory. They do not prevent actual read or
667    /// write operations from occurring on the file, either through this
668    /// connection or through other connections.
669    ///
670    /// This method requires the following rights:
671    ///
672    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
673    /// * [`Rights.WRITE_BYTES`] if `request.type` is
674    ///   [`AdvisoryLockType.WRITE`].
675    ///
676    /// # Errors
677    ///
678    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
679    ///   example, another connection might hold a conflicting lock type.
680    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
681    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
682    ///   to acquire the given type of lock.
683    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
684}
685
686impl AdvisoryLockingRequest {
687    #[allow(irrefutable_let_patterns)]
688    pub fn into_advisory_lock(
689        self,
690    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
691        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
692            Some((request, responder))
693        } else {
694            None
695        }
696    }
697
698    /// Name of the method defined in FIDL
699    pub fn method_name(&self) -> &'static str {
700        match *self {
701            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
702        }
703    }
704}
705
706#[derive(Debug, Clone)]
707pub struct AdvisoryLockingControlHandle {
708    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
709}
710
711impl AdvisoryLockingControlHandle {
712    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
713        self.inner.shutdown_with_epitaph(status.into())
714    }
715}
716
717impl fdomain_client::fidl::ControlHandle for AdvisoryLockingControlHandle {
718    fn shutdown(&self) {
719        self.inner.shutdown()
720    }
721
722    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
723        self.inner.shutdown_with_epitaph(status)
724    }
725
726    fn is_closed(&self) -> bool {
727        self.inner.channel().is_closed()
728    }
729    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
730        self.inner.channel().on_closed()
731    }
732}
733
734impl AdvisoryLockingControlHandle {}
735
736#[must_use = "FIDL methods require a response to be sent"]
737#[derive(Debug)]
738pub struct AdvisoryLockingAdvisoryLockResponder {
739    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
740    tx_id: u32,
741}
742
743/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
744/// if the responder is dropped without sending a response, so that the client
745/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
746impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
747    fn drop(&mut self) {
748        self.control_handle.shutdown();
749        // Safety: drops once, never accessed again
750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
751    }
752}
753
754impl fdomain_client::fidl::Responder for AdvisoryLockingAdvisoryLockResponder {
755    type ControlHandle = AdvisoryLockingControlHandle;
756
757    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
758        &self.control_handle
759    }
760
761    fn drop_without_shutdown(mut self) {
762        // Safety: drops once, never accessed again due to mem::forget
763        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
764        // Prevent Drop from running (which would shut down the channel)
765        std::mem::forget(self);
766    }
767}
768
769impl AdvisoryLockingAdvisoryLockResponder {
770    /// Sends a response to the FIDL transaction.
771    ///
772    /// Sets the channel to shutdown if an error occurs.
773    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
774        let _result = self.send_raw(result);
775        if _result.is_err() {
776            self.control_handle.shutdown();
777        }
778        self.drop_without_shutdown();
779        _result
780    }
781
782    /// Similar to "send" but does not shutdown the channel if an error occurs.
783    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
784        let _result = self.send_raw(result);
785        self.drop_without_shutdown();
786        _result
787    }
788
789    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
790        self.control_handle
791            .inner
792            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
793                result,
794                self.tx_id,
795                0x6ee9c0ad53ec87aa,
796                fidl::encoding::DynamicFlags::empty(),
797            )
798    }
799}
800
801#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
802pub struct DirectoryMarker;
803
804impl fdomain_client::fidl::ProtocolMarker for DirectoryMarker {
805    type Proxy = DirectoryProxy;
806    type RequestStream = DirectoryRequestStream;
807
808    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
809}
810impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryMarker {}
811pub type DirectoryUnlinkResult = Result<(), i32>;
812pub type DirectoryRenameResult = Result<(), i32>;
813pub type DirectoryCreateSymlinkResult = Result<(), i32>;
814
815pub trait DirectoryProxyInterface: Send + Sync {
816    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
817        + Send;
818    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
819    fn r#clone(
820        &self,
821        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
822    ) -> Result<(), fidl::Error>;
823    type CloseResponseFut: std::future::Future<
824            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
825        > + Send;
826    fn r#close(&self) -> Self::CloseResponseFut;
827    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
828    fn r#query(&self) -> Self::QueryResponseFut;
829    fn r#deprecated_clone(
830        &self,
831        flags: OpenFlags,
832        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
833    ) -> Result<(), fidl::Error>;
834    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
835        + Send;
836    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
837    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
838    fn r#deprecated_set_attr(
839        &self,
840        flags: NodeAttributeFlags,
841        attributes: &NodeAttributes,
842    ) -> Self::DeprecatedSetAttrResponseFut;
843    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
844        + Send;
845    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
846    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
847        + Send;
848    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
849    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
850        + Send;
851    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
852    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
853        + Send;
854    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
855    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
856        + Send;
857    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
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 GetTokenResponseFut: std::future::Future<
907            Output = Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error>,
908        > + Send;
909    fn r#get_token(&self) -> Self::GetTokenResponseFut;
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 `fuchsia.unknown/Cloneable.Clone` instead.
1048    pub fn r#deprecated_clone(
1049        &self,
1050        mut flags: OpenFlags,
1051        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1052    ) -> Result<(), fidl::Error> {
1053        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1054    }
1055
1056    /// DEPRECATED - Use `Node.GetAttributes` instead.
1057    ///
1058    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1059    pub fn r#deprecated_get_attr(
1060        &self,
1061    ) -> fidl::client::QueryResponseFut<
1062        (i32, NodeAttributes),
1063        fdomain_client::fidl::FDomainResourceDialect,
1064    > {
1065        DirectoryProxyInterface::r#deprecated_get_attr(self)
1066    }
1067
1068    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1069    pub fn r#deprecated_set_attr(
1070        &self,
1071        mut flags: NodeAttributeFlags,
1072        mut attributes: &NodeAttributes,
1073    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1074        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1075    }
1076
1077    /// [DEPRECATED - Use new GetFlags method instead.]
1078    pub fn r#deprecated_get_flags(
1079        &self,
1080    ) -> fidl::client::QueryResponseFut<
1081        (i32, OpenFlags),
1082        fdomain_client::fidl::FDomainResourceDialect,
1083    > {
1084        DirectoryProxyInterface::r#deprecated_get_flags(self)
1085    }
1086
1087    /// [DEPRECATED - Use new SetFlags method instead.]
1088    pub fn r#deprecated_set_flags(
1089        &self,
1090        mut flags: OpenFlags,
1091    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1092        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1093    }
1094
1095    /// Queries the flags that apply to this node after it has been opened/created. This method does
1096    /// not require any rights.
1097    ///
1098    /// Note that the final set of flags that apply to the connection may differ from those
1099    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1100    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1101    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1102    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1103    pub fn r#get_flags(
1104        &self,
1105    ) -> fidl::client::QueryResponseFut<
1106        NodeGetFlagsResult,
1107        fdomain_client::fidl::FDomainResourceDialect,
1108    > {
1109        DirectoryProxyInterface::r#get_flags(self)
1110    }
1111
1112    /// Sets the flags that apply to this node after it has been opened. This method does not
1113    /// require any rights.
1114    ///
1115    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1116    /// clear append mode.
1117    ///
1118    /// Errors:
1119    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1120    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1121    pub fn r#set_flags(
1122        &self,
1123        mut flags: Flags,
1124    ) -> fidl::client::QueryResponseFut<
1125        NodeSetFlagsResult,
1126        fdomain_client::fidl::FDomainResourceDialect,
1127    > {
1128        DirectoryProxyInterface::r#set_flags(self, flags)
1129    }
1130
1131    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1132    /// volume has different settings or the storage is accounted seperately from the rest of the
1133    /// filesystem that may be reported instead of filesystem-wide details.
1134    pub fn r#query_filesystem(
1135        &self,
1136    ) -> fidl::client::QueryResponseFut<
1137        (i32, Option<Box<FilesystemInfo>>),
1138        fdomain_client::fidl::FDomainResourceDialect,
1139    > {
1140        DirectoryProxyInterface::r#query_filesystem(self)
1141    }
1142
1143    /// Acquires information about the node.
1144    ///
1145    /// The attributes of a node should be stable, independent of the
1146    /// specific protocol used to access it.
1147    ///
1148    /// If a particular attribute is not applicable or not supported,
1149    /// filesystems should leave the corresponding field absent.
1150    ///
1151    /// + `query` a bit-mask specifying which attributes to fetch. The server
1152    ///   should not return more than necessary.
1153    /// - `attributes` the returned attributes.
1154    ///
1155    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1156    pub fn r#get_attributes(
1157        &self,
1158        mut query: NodeAttributesQuery,
1159    ) -> fidl::client::QueryResponseFut<
1160        NodeGetAttributesResult,
1161        fdomain_client::fidl::FDomainResourceDialect,
1162    > {
1163        DirectoryProxyInterface::r#get_attributes(self, query)
1164    }
1165
1166    /// Updates information about the node.
1167    ///
1168    /// + `attributes` the presence of a table field in `attributes` indicates
1169    /// the intent to update the corresponding attribute.
1170    ///
1171    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1172    ///
1173    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1174    pub fn r#update_attributes(
1175        &self,
1176        mut payload: &MutableNodeAttributes,
1177    ) -> fidl::client::QueryResponseFut<
1178        NodeUpdateAttributesResult,
1179        fdomain_client::fidl::FDomainResourceDialect,
1180    > {
1181        DirectoryProxyInterface::r#update_attributes(self, payload)
1182    }
1183
1184    /// Synchronizes updates to the node to the underlying media, if it exists.
1185    ///
1186    /// This method will return when the filesystem server has flushed the
1187    /// relevant updates to the underlying media, but does not guarantee the
1188    /// underlying media has persisted the information, nor that any information
1189    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1190    /// between operations.
1191    ///
1192    /// This method does not require any rights.
1193    pub fn r#sync(
1194        &self,
1195    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
1196    {
1197        DirectoryProxyInterface::r#sync(self)
1198    }
1199
1200    /// Creates an iterator over all the extended attribute names associated
1201    /// with this node. If an error occurs it is returned as an epitaph on the
1202    /// iterator request channel, and then the channel is closed.
1203    ///
1204    /// GetExtendedAttributes can be used with any of these names to retrieve
1205    /// the associated value.
1206    ///
1207    /// This method requires the [`Rights.READ_BYTES`] right.
1208    pub fn r#list_extended_attributes(
1209        &self,
1210        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1211    ) -> Result<(), fidl::Error> {
1212        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
1213    }
1214
1215    /// Get the value associated with the given attribute `name` for this node.
1216    ///
1217    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1218    /// particular structure is imposed on them.
1219    ///
1220    /// This method requires the [`Rights.READ_BYTES`] right.
1221    pub fn r#get_extended_attribute(
1222        &self,
1223        mut name: &[u8],
1224    ) -> fidl::client::QueryResponseFut<
1225        NodeGetExtendedAttributeResult,
1226        fdomain_client::fidl::FDomainResourceDialect,
1227    > {
1228        DirectoryProxyInterface::r#get_extended_attribute(self, name)
1229    }
1230
1231    /// Set the value for the given attribute `name` to `value` for this node.
1232    ///
1233    /// The attribute name may exist, in which case the attribute is updated.
1234    /// If the attribute doesn't exist, it is created. The name should have no
1235    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1236    ///
1237    /// This method requires the [`Rights.WRITE_BYTES`] right.
1238    pub fn r#set_extended_attribute(
1239        &self,
1240        mut name: &[u8],
1241        mut value: ExtendedAttributeValue,
1242        mut mode: SetExtendedAttributeMode,
1243    ) -> fidl::client::QueryResponseFut<
1244        NodeSetExtendedAttributeResult,
1245        fdomain_client::fidl::FDomainResourceDialect,
1246    > {
1247        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
1248    }
1249
1250    /// Remove the specified extended attribute.
1251    ///
1252    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1253    ///
1254    /// This method requires the [`Rights.WRITE_BYTES`] right.
1255    pub fn r#remove_extended_attribute(
1256        &self,
1257        mut name: &[u8],
1258    ) -> fidl::client::QueryResponseFut<
1259        NodeRemoveExtendedAttributeResult,
1260        fdomain_client::fidl::FDomainResourceDialect,
1261    > {
1262        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
1263    }
1264
1265    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1266    /// epitaph sent on the `object` channel.
1267    ///
1268    /// Errors:
1269    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1270    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1271    pub fn r#open(
1272        &self,
1273        mut path: &str,
1274        mut flags: Flags,
1275        mut options: &Options,
1276        mut object: fdomain_client::Channel,
1277    ) -> Result<(), fidl::Error> {
1278        DirectoryProxyInterface::r#open(self, path, flags, options, object)
1279    }
1280
1281    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1282    pub fn r#deprecated_open(
1283        &self,
1284        mut flags: OpenFlags,
1285        mut mode: ModeType,
1286        mut path: &str,
1287        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1288    ) -> Result<(), fidl::Error> {
1289        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
1290    }
1291
1292    /// Reads a collection of variably sized dirents into a buffer.
1293    /// The number of dirents in a directory may be very large: akin to
1294    /// calling read multiple times on a file, directories have a seek
1295    /// offset which is updated on subsequent calls to ReadDirents.
1296    /// Each call to ReadDirents will only return whole dirent structures,
1297    /// they will not get split across ReadDirent calls. When the seek
1298    /// offset reaches the end, `dirents` will be empty.
1299    ///
1300    /// These dirents are of the form:
1301    /// ```
1302    /// struct dirent {
1303    ///   // Describes the inode of the entry.
1304    ///   uint64 ino;
1305    ///   // Describes the length of the dirent name in bytes.
1306    ///   uint8 size;
1307    ///   // Describes the type of the entry. Aligned with the
1308    ///   // POSIX d_type values. Use `DirentType` constants.
1309    ///   uint8 type;
1310    ///   // Unterminated name of entry.
1311    ///   char name[0];
1312    /// }
1313    /// ```
1314    ///
1315    /// This method does not require any rights, since one could always probe for
1316    /// directory contents by triggering name conflicts during file creation.
1317    pub fn r#read_dirents(
1318        &self,
1319        mut max_bytes: u64,
1320    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fdomain_client::fidl::FDomainResourceDialect>
1321    {
1322        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
1323    }
1324
1325    /// Resets the directory seek offset.
1326    ///
1327    /// This method does not require any rights, similar to ReadDirents.
1328    pub fn r#rewind(
1329        &self,
1330    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1331        DirectoryProxyInterface::r#rewind(self)
1332    }
1333
1334    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1335    /// in time. The token will remain valid for as long as the connection requesting the token
1336    /// remains open.
1337    ///
1338    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1339    /// `ZX_ERR_BAD_HANDLE`.
1340    pub fn r#get_token(
1341        &self,
1342    ) -> fidl::client::QueryResponseFut<
1343        (i32, Option<fdomain_client::NullableHandle>),
1344        fdomain_client::fidl::FDomainResourceDialect,
1345    > {
1346        DirectoryProxyInterface::r#get_token(self)
1347    }
1348
1349    /// Creates a link to an object named src by the name dst, within a directory represented by
1350    /// token.
1351    ///
1352    /// `src` must be a resolved object name. Including "/" in the string will
1353    /// return `ZX_ERR_INVALID_ARGS`.
1354    ///
1355    /// `dst` must be a resolved object name. Including "/" in the string will
1356    /// return `ZX_ERR_INVALID_ARGS`.
1357    ///
1358    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1359    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1360    ///
1361    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1362    /// there are two actors operating concurrently, and one actor performs a rename that affects
1363    /// the source within this directory, and the other does a link, each will appear to occur
1364    /// atomically in an unspecified order.
1365    pub fn r#link(
1366        &self,
1367        mut src: &str,
1368        mut dst_parent_token: fdomain_client::NullableHandle,
1369        mut dst: &str,
1370    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1371        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
1372    }
1373
1374    /// Removes a child node from the this directory's list of entries.
1375    ///
1376    /// Note: this does not guarantee that the underlying object is destroyed.
1377    /// Although the link will be removed from the containing directory,
1378    /// objects with multiple references (such as files which are still open)
1379    /// will not actually be destroyed until all references are closed.
1380    ///
1381    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1382    ///   [`Rights.WRITE_BYTES`].
1383    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1384    ///   support writing.
1385    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1386    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1387    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1388    ///   containing a remote channel.
1389    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1390    ///     something other than a directory was found.
1391    ///
1392    /// Other errors may be returned for filesystem-specific reasons.
1393    ///
1394    /// This method requires the following rights:
1395    ///
1396    /// * [`Rights.ENUMERATE`]
1397    /// * [`Rights.MODIFY_DIRECTORY`]
1398    pub fn r#unlink(
1399        &self,
1400        mut name: &str,
1401        mut options: &UnlinkOptions,
1402    ) -> fidl::client::QueryResponseFut<
1403        DirectoryUnlinkResult,
1404        fdomain_client::fidl::FDomainResourceDialect,
1405    > {
1406        DirectoryProxyInterface::r#unlink(self, name, options)
1407    }
1408
1409    /// Renames a node named `src` to the name `dst`, in a directory represented
1410    /// by `dst_parent_token`.
1411    ///
1412    /// `src` and `dst` must be valid node names.
1413    /// See [`Name`] for what constitutes a valid name.
1414    ///
1415    /// This method requires the following rights on both the current connection, and the connection
1416    /// identified by `dst_parent_token`:
1417    ///
1418    /// * [`Rights.ENUMERATE`]
1419    /// * [`Rights.MODIFY_DIRECTORY`]
1420    ///
1421    /// The following requirements are necessary to avoid rights escalations.
1422    ///
1423    /// If the source and destination directory differ, the source directory must also have the
1424    /// maximal set of abilities supported for files, which would typically be
1425    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1426    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1427    /// right.
1428    ///
1429    /// If `src` refers to a directory, and differs from the destination directory, then the source
1430    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1431    ///
1432    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1433    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1434    pub fn r#rename(
1435        &self,
1436        mut src: &str,
1437        mut dst_parent_token: fdomain_client::Event,
1438        mut dst: &str,
1439    ) -> fidl::client::QueryResponseFut<
1440        DirectoryRenameResult,
1441        fdomain_client::fidl::FDomainResourceDialect,
1442    > {
1443        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
1444    }
1445
1446    /// Creates a symbolic link.
1447    ///
1448    /// `name` is the name to be given to the created symbolic link.
1449    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1450    /// will perform no validation of `target` except for a server chosen maximum length.
1451    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1452    /// on the successfully created node.
1453    ///
1454    /// * [`Rights.MODIFY_DIRECTORY`]
1455    ///
1456    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1457    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1458    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1459    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1460    pub fn r#create_symlink(
1461        &self,
1462        mut name: &str,
1463        mut target: &[u8],
1464        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
1465    ) -> fidl::client::QueryResponseFut<
1466        DirectoryCreateSymlinkResult,
1467        fdomain_client::fidl::FDomainResourceDialect,
1468    > {
1469        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
1470    }
1471
1472    /// Watches a directory, receiving events of added messages on the
1473    /// watcher request channel.
1474    ///
1475    /// Options must be zero; it is reserved.
1476    ///
1477    /// This method does not require any rights, similar to ReadDirents.
1478    pub fn r#watch(
1479        &self,
1480        mut mask: WatchMask,
1481        mut options: u32,
1482        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
1483    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1484        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
1485    }
1486}
1487
1488impl DirectoryProxyInterface for DirectoryProxy {
1489    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
1490        AdvisoryLockingAdvisoryLockResult,
1491        fdomain_client::fidl::FDomainResourceDialect,
1492    >;
1493    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
1494        fn _decode(
1495            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1496        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1497            let _response = fidl::client::decode_transaction_body::<
1498                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1499                fdomain_client::fidl::FDomainResourceDialect,
1500                0x6ee9c0ad53ec87aa,
1501            >(_buf?)?;
1502            Ok(_response.map(|x| x))
1503        }
1504        self.client.send_query_and_decode::<
1505            AdvisoryLockingAdvisoryLockRequest,
1506            AdvisoryLockingAdvisoryLockResult,
1507        >(
1508            (request,),
1509            0x6ee9c0ad53ec87aa,
1510            fidl::encoding::DynamicFlags::empty(),
1511            _decode,
1512        )
1513    }
1514
1515    fn r#clone(
1516        &self,
1517        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1518    ) -> Result<(), fidl::Error> {
1519        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
1520            (request,),
1521            0x20d8a7aba2168a79,
1522            fidl::encoding::DynamicFlags::empty(),
1523        )
1524    }
1525
1526    type CloseResponseFut = fidl::client::QueryResponseFut<
1527        fdomain_fuchsia_unknown::CloseableCloseResult,
1528        fdomain_client::fidl::FDomainResourceDialect,
1529    >;
1530    fn r#close(&self) -> Self::CloseResponseFut {
1531        fn _decode(
1532            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1533        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1534            let _response = fidl::client::decode_transaction_body::<
1535                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1536                fdomain_client::fidl::FDomainResourceDialect,
1537                0x5ac5d459ad7f657e,
1538            >(_buf?)?;
1539            Ok(_response.map(|x| x))
1540        }
1541        self.client.send_query_and_decode::<
1542            fidl::encoding::EmptyPayload,
1543            fdomain_fuchsia_unknown::CloseableCloseResult,
1544        >(
1545            (),
1546            0x5ac5d459ad7f657e,
1547            fidl::encoding::DynamicFlags::empty(),
1548            _decode,
1549        )
1550    }
1551
1552    type QueryResponseFut =
1553        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
1554    fn r#query(&self) -> Self::QueryResponseFut {
1555        fn _decode(
1556            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1557        ) -> Result<Vec<u8>, fidl::Error> {
1558            let _response = fidl::client::decode_transaction_body::<
1559                fdomain_fuchsia_unknown::QueryableQueryResponse,
1560                fdomain_client::fidl::FDomainResourceDialect,
1561                0x2658edee9decfc06,
1562            >(_buf?)?;
1563            Ok(_response.protocol)
1564        }
1565        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
1566            (),
1567            0x2658edee9decfc06,
1568            fidl::encoding::DynamicFlags::empty(),
1569            _decode,
1570        )
1571    }
1572
1573    fn r#deprecated_clone(
1574        &self,
1575        mut flags: OpenFlags,
1576        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1577    ) -> Result<(), fidl::Error> {
1578        self.client.send::<NodeDeprecatedCloneRequest>(
1579            (flags, object),
1580            0x5a61678f293ce16f,
1581            fidl::encoding::DynamicFlags::FLEXIBLE,
1582        )
1583    }
1584
1585    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
1586        (i32, NodeAttributes),
1587        fdomain_client::fidl::FDomainResourceDialect,
1588    >;
1589    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
1590        fn _decode(
1591            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1592        ) -> Result<(i32, NodeAttributes), fidl::Error> {
1593            let _response = fidl::client::decode_transaction_body::<
1594                NodeDeprecatedGetAttrResponse,
1595                fdomain_client::fidl::FDomainResourceDialect,
1596                0x78985e216314dafd,
1597            >(_buf?)?;
1598            Ok((_response.s, _response.attributes))
1599        }
1600        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
1601            (),
1602            0x78985e216314dafd,
1603            fidl::encoding::DynamicFlags::empty(),
1604            _decode,
1605        )
1606    }
1607
1608    type DeprecatedSetAttrResponseFut =
1609        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1610    fn r#deprecated_set_attr(
1611        &self,
1612        mut flags: NodeAttributeFlags,
1613        mut attributes: &NodeAttributes,
1614    ) -> Self::DeprecatedSetAttrResponseFut {
1615        fn _decode(
1616            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1617        ) -> Result<i32, fidl::Error> {
1618            let _response = fidl::client::decode_transaction_body::<
1619                NodeDeprecatedSetAttrResponse,
1620                fdomain_client::fidl::FDomainResourceDialect,
1621                0x4186c0f40d938f46,
1622            >(_buf?)?;
1623            Ok(_response.s)
1624        }
1625        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
1626            (flags, attributes),
1627            0x4186c0f40d938f46,
1628            fidl::encoding::DynamicFlags::empty(),
1629            _decode,
1630        )
1631    }
1632
1633    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
1634        (i32, OpenFlags),
1635        fdomain_client::fidl::FDomainResourceDialect,
1636    >;
1637    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
1638        fn _decode(
1639            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1640        ) -> Result<(i32, OpenFlags), fidl::Error> {
1641            let _response = fidl::client::decode_transaction_body::<
1642                NodeDeprecatedGetFlagsResponse,
1643                fdomain_client::fidl::FDomainResourceDialect,
1644                0x5b88fffb8eda3aa1,
1645            >(_buf?)?;
1646            Ok((_response.s, _response.flags))
1647        }
1648        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
1649            (),
1650            0x5b88fffb8eda3aa1,
1651            fidl::encoding::DynamicFlags::empty(),
1652            _decode,
1653        )
1654    }
1655
1656    type DeprecatedSetFlagsResponseFut =
1657        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1658    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
1659        fn _decode(
1660            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1661        ) -> Result<i32, fidl::Error> {
1662            let _response = fidl::client::decode_transaction_body::<
1663                NodeDeprecatedSetFlagsResponse,
1664                fdomain_client::fidl::FDomainResourceDialect,
1665                0x5295b76c71fde733,
1666            >(_buf?)?;
1667            Ok(_response.s)
1668        }
1669        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
1670            (flags,),
1671            0x5295b76c71fde733,
1672            fidl::encoding::DynamicFlags::empty(),
1673            _decode,
1674        )
1675    }
1676
1677    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
1678        NodeGetFlagsResult,
1679        fdomain_client::fidl::FDomainResourceDialect,
1680    >;
1681    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
1682        fn _decode(
1683            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1684        ) -> Result<NodeGetFlagsResult, fidl::Error> {
1685            let _response = fidl::client::decode_transaction_body::<
1686                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1687                fdomain_client::fidl::FDomainResourceDialect,
1688                0x176eb318f64ec23,
1689            >(_buf?)?
1690            .into_result_fdomain::<DirectoryMarker>("get_flags")?;
1691            Ok(_response.map(|x| x.flags))
1692        }
1693        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
1694            (),
1695            0x176eb318f64ec23,
1696            fidl::encoding::DynamicFlags::FLEXIBLE,
1697            _decode,
1698        )
1699    }
1700
1701    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
1702        NodeSetFlagsResult,
1703        fdomain_client::fidl::FDomainResourceDialect,
1704    >;
1705    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
1706        fn _decode(
1707            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1708        ) -> Result<NodeSetFlagsResult, fidl::Error> {
1709            let _response = fidl::client::decode_transaction_body::<
1710                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1711                fdomain_client::fidl::FDomainResourceDialect,
1712                0x55a8028685791ea8,
1713            >(_buf?)?
1714            .into_result_fdomain::<DirectoryMarker>("set_flags")?;
1715            Ok(_response.map(|x| x))
1716        }
1717        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
1718            (flags,),
1719            0x55a8028685791ea8,
1720            fidl::encoding::DynamicFlags::FLEXIBLE,
1721            _decode,
1722        )
1723    }
1724
1725    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
1726        (i32, Option<Box<FilesystemInfo>>),
1727        fdomain_client::fidl::FDomainResourceDialect,
1728    >;
1729    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
1730        fn _decode(
1731            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1732        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1733            let _response = fidl::client::decode_transaction_body::<
1734                NodeQueryFilesystemResponse,
1735                fdomain_client::fidl::FDomainResourceDialect,
1736                0x6f344a1c6b0a0610,
1737            >(_buf?)?;
1738            Ok((_response.s, _response.info))
1739        }
1740        self.client.send_query_and_decode::<
1741            fidl::encoding::EmptyPayload,
1742            (i32, Option<Box<FilesystemInfo>>),
1743        >(
1744            (),
1745            0x6f344a1c6b0a0610,
1746            fidl::encoding::DynamicFlags::empty(),
1747            _decode,
1748        )
1749    }
1750
1751    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
1752        NodeGetAttributesResult,
1753        fdomain_client::fidl::FDomainResourceDialect,
1754    >;
1755    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
1756        fn _decode(
1757            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1758        ) -> Result<NodeGetAttributesResult, fidl::Error> {
1759            let _response = fidl::client::decode_transaction_body::<
1760                fidl::encoding::ResultType<NodeAttributes2, i32>,
1761                fdomain_client::fidl::FDomainResourceDialect,
1762                0x3d4396a638ea053b,
1763            >(_buf?)?;
1764            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1765        }
1766        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
1767            (query,),
1768            0x3d4396a638ea053b,
1769            fidl::encoding::DynamicFlags::empty(),
1770            _decode,
1771        )
1772    }
1773
1774    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
1775        NodeUpdateAttributesResult,
1776        fdomain_client::fidl::FDomainResourceDialect,
1777    >;
1778    fn r#update_attributes(
1779        &self,
1780        mut payload: &MutableNodeAttributes,
1781    ) -> Self::UpdateAttributesResponseFut {
1782        fn _decode(
1783            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1784        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1785            let _response = fidl::client::decode_transaction_body::<
1786                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1787                fdomain_client::fidl::FDomainResourceDialect,
1788                0x3308c1da5a89bf08,
1789            >(_buf?)?;
1790            Ok(_response.map(|x| x))
1791        }
1792        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
1793            payload,
1794            0x3308c1da5a89bf08,
1795            fidl::encoding::DynamicFlags::empty(),
1796            _decode,
1797        )
1798    }
1799
1800    type SyncResponseFut = fidl::client::QueryResponseFut<
1801        NodeSyncResult,
1802        fdomain_client::fidl::FDomainResourceDialect,
1803    >;
1804    fn r#sync(&self) -> Self::SyncResponseFut {
1805        fn _decode(
1806            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1807        ) -> Result<NodeSyncResult, fidl::Error> {
1808            let _response = fidl::client::decode_transaction_body::<
1809                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1810                fdomain_client::fidl::FDomainResourceDialect,
1811                0x2c5c27ca0ab5dc49,
1812            >(_buf?)?;
1813            Ok(_response.map(|x| x))
1814        }
1815        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
1816            (),
1817            0x2c5c27ca0ab5dc49,
1818            fidl::encoding::DynamicFlags::empty(),
1819            _decode,
1820        )
1821    }
1822
1823    fn r#list_extended_attributes(
1824        &self,
1825        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1826    ) -> Result<(), fidl::Error> {
1827        self.client.send::<NodeListExtendedAttributesRequest>(
1828            (iterator,),
1829            0x4b61033de007fcd0,
1830            fidl::encoding::DynamicFlags::empty(),
1831        )
1832    }
1833
1834    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1835        NodeGetExtendedAttributeResult,
1836        fdomain_client::fidl::FDomainResourceDialect,
1837    >;
1838    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
1839        fn _decode(
1840            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1841        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1842            let _response = fidl::client::decode_transaction_body::<
1843                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1844                fdomain_client::fidl::FDomainResourceDialect,
1845                0x45ffa3ccfdeb76db,
1846            >(_buf?)?;
1847            Ok(_response.map(|x| x))
1848        }
1849        self.client.send_query_and_decode::<
1850            NodeGetExtendedAttributeRequest,
1851            NodeGetExtendedAttributeResult,
1852        >(
1853            (name,),
1854            0x45ffa3ccfdeb76db,
1855            fidl::encoding::DynamicFlags::empty(),
1856            _decode,
1857        )
1858    }
1859
1860    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1861        NodeSetExtendedAttributeResult,
1862        fdomain_client::fidl::FDomainResourceDialect,
1863    >;
1864    fn r#set_extended_attribute(
1865        &self,
1866        mut name: &[u8],
1867        mut value: ExtendedAttributeValue,
1868        mut mode: SetExtendedAttributeMode,
1869    ) -> Self::SetExtendedAttributeResponseFut {
1870        fn _decode(
1871            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1872        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1873            let _response = fidl::client::decode_transaction_body::<
1874                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1875                fdomain_client::fidl::FDomainResourceDialect,
1876                0x4a951362f681f23c,
1877            >(_buf?)?;
1878            Ok(_response.map(|x| x))
1879        }
1880        self.client.send_query_and_decode::<
1881            NodeSetExtendedAttributeRequest,
1882            NodeSetExtendedAttributeResult,
1883        >(
1884            (name, &mut value, mode,),
1885            0x4a951362f681f23c,
1886            fidl::encoding::DynamicFlags::empty(),
1887            _decode,
1888        )
1889    }
1890
1891    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1892        NodeRemoveExtendedAttributeResult,
1893        fdomain_client::fidl::FDomainResourceDialect,
1894    >;
1895    fn r#remove_extended_attribute(
1896        &self,
1897        mut name: &[u8],
1898    ) -> Self::RemoveExtendedAttributeResponseFut {
1899        fn _decode(
1900            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1901        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1902            let _response = fidl::client::decode_transaction_body::<
1903                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1904                fdomain_client::fidl::FDomainResourceDialect,
1905                0x7a0b9f3a9bf9032d,
1906            >(_buf?)?;
1907            Ok(_response.map(|x| x))
1908        }
1909        self.client.send_query_and_decode::<
1910            NodeRemoveExtendedAttributeRequest,
1911            NodeRemoveExtendedAttributeResult,
1912        >(
1913            (name,),
1914            0x7a0b9f3a9bf9032d,
1915            fidl::encoding::DynamicFlags::empty(),
1916            _decode,
1917        )
1918    }
1919
1920    fn r#open(
1921        &self,
1922        mut path: &str,
1923        mut flags: Flags,
1924        mut options: &Options,
1925        mut object: fdomain_client::Channel,
1926    ) -> Result<(), fidl::Error> {
1927        self.client.send::<OpenableOpenRequest>(
1928            (path, flags, options, object),
1929            0x568ddcb9a9cbb6d9,
1930            fidl::encoding::DynamicFlags::FLEXIBLE,
1931        )
1932    }
1933
1934    fn r#deprecated_open(
1935        &self,
1936        mut flags: OpenFlags,
1937        mut mode: ModeType,
1938        mut path: &str,
1939        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1940    ) -> Result<(), fidl::Error> {
1941        self.client.send::<DirectoryDeprecatedOpenRequest>(
1942            (flags, mode, path, object),
1943            0x2c5044561d685ec0,
1944            fidl::encoding::DynamicFlags::FLEXIBLE,
1945        )
1946    }
1947
1948    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
1949        (i32, Vec<u8>),
1950        fdomain_client::fidl::FDomainResourceDialect,
1951    >;
1952    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
1953        fn _decode(
1954            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1955        ) -> Result<(i32, Vec<u8>), fidl::Error> {
1956            let _response = fidl::client::decode_transaction_body::<
1957                DirectoryReadDirentsResponse,
1958                fdomain_client::fidl::FDomainResourceDialect,
1959                0x3582806bf27faa0a,
1960            >(_buf?)?;
1961            Ok((_response.s, _response.dirents))
1962        }
1963        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
1964            (max_bytes,),
1965            0x3582806bf27faa0a,
1966            fidl::encoding::DynamicFlags::empty(),
1967            _decode,
1968        )
1969    }
1970
1971    type RewindResponseFut =
1972        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1973    fn r#rewind(&self) -> Self::RewindResponseFut {
1974        fn _decode(
1975            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1976        ) -> Result<i32, fidl::Error> {
1977            let _response = fidl::client::decode_transaction_body::<
1978                DirectoryRewindResponse,
1979                fdomain_client::fidl::FDomainResourceDialect,
1980                0x16b1202af0f34c71,
1981            >(_buf?)?;
1982            Ok(_response.s)
1983        }
1984        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1985            (),
1986            0x16b1202af0f34c71,
1987            fidl::encoding::DynamicFlags::empty(),
1988            _decode,
1989        )
1990    }
1991
1992    type GetTokenResponseFut = fidl::client::QueryResponseFut<
1993        (i32, Option<fdomain_client::NullableHandle>),
1994        fdomain_client::fidl::FDomainResourceDialect,
1995    >;
1996    fn r#get_token(&self) -> Self::GetTokenResponseFut {
1997        fn _decode(
1998            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1999        ) -> Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error> {
2000            let _response = fidl::client::decode_transaction_body::<
2001                DirectoryGetTokenResponse,
2002                fdomain_client::fidl::FDomainResourceDialect,
2003                0x26ae9d18763c8655,
2004            >(_buf?)?;
2005            Ok((_response.s, _response.token))
2006        }
2007        self.client.send_query_and_decode::<
2008            fidl::encoding::EmptyPayload,
2009            (i32, Option<fdomain_client::NullableHandle>),
2010        >(
2011            (),
2012            0x26ae9d18763c8655,
2013            fidl::encoding::DynamicFlags::empty(),
2014            _decode,
2015        )
2016    }
2017
2018    type LinkResponseFut =
2019        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2020    fn r#link(
2021        &self,
2022        mut src: &str,
2023        mut dst_parent_token: fdomain_client::NullableHandle,
2024        mut dst: &str,
2025    ) -> Self::LinkResponseFut {
2026        fn _decode(
2027            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2028        ) -> Result<i32, fidl::Error> {
2029            let _response = fidl::client::decode_transaction_body::<
2030                DirectoryLinkResponse,
2031                fdomain_client::fidl::FDomainResourceDialect,
2032                0x740604c0c7c930e7,
2033            >(_buf?)?;
2034            Ok(_response.s)
2035        }
2036        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2037            (src, dst_parent_token, dst),
2038            0x740604c0c7c930e7,
2039            fidl::encoding::DynamicFlags::empty(),
2040            _decode,
2041        )
2042    }
2043
2044    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2045        DirectoryUnlinkResult,
2046        fdomain_client::fidl::FDomainResourceDialect,
2047    >;
2048    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2049        fn _decode(
2050            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2051        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2052            let _response = fidl::client::decode_transaction_body::<
2053                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2054                fdomain_client::fidl::FDomainResourceDialect,
2055                0x750a0326a78d7bed,
2056            >(_buf?)?;
2057            Ok(_response.map(|x| x))
2058        }
2059        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2060            (name, options),
2061            0x750a0326a78d7bed,
2062            fidl::encoding::DynamicFlags::empty(),
2063            _decode,
2064        )
2065    }
2066
2067    type RenameResponseFut = fidl::client::QueryResponseFut<
2068        DirectoryRenameResult,
2069        fdomain_client::fidl::FDomainResourceDialect,
2070    >;
2071    fn r#rename(
2072        &self,
2073        mut src: &str,
2074        mut dst_parent_token: fdomain_client::Event,
2075        mut dst: &str,
2076    ) -> Self::RenameResponseFut {
2077        fn _decode(
2078            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2079        ) -> Result<DirectoryRenameResult, fidl::Error> {
2080            let _response = fidl::client::decode_transaction_body::<
2081                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2082                fdomain_client::fidl::FDomainResourceDialect,
2083                0x7060e7723b9928de,
2084            >(_buf?)?;
2085            Ok(_response.map(|x| x))
2086        }
2087        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2088            (src, dst_parent_token, dst),
2089            0x7060e7723b9928de,
2090            fidl::encoding::DynamicFlags::empty(),
2091            _decode,
2092        )
2093    }
2094
2095    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2096        DirectoryCreateSymlinkResult,
2097        fdomain_client::fidl::FDomainResourceDialect,
2098    >;
2099    fn r#create_symlink(
2100        &self,
2101        mut name: &str,
2102        mut target: &[u8],
2103        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
2104    ) -> Self::CreateSymlinkResponseFut {
2105        fn _decode(
2106            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2107        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2108            let _response = fidl::client::decode_transaction_body::<
2109                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2110                fdomain_client::fidl::FDomainResourceDialect,
2111                0x21ce0f19ec043889,
2112            >(_buf?)?;
2113            Ok(_response.map(|x| x))
2114        }
2115        self.client
2116            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2117                (name, target, connection),
2118                0x21ce0f19ec043889,
2119                fidl::encoding::DynamicFlags::empty(),
2120                _decode,
2121            )
2122    }
2123
2124    type WatchResponseFut =
2125        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2126    fn r#watch(
2127        &self,
2128        mut mask: WatchMask,
2129        mut options: u32,
2130        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
2131    ) -> Self::WatchResponseFut {
2132        fn _decode(
2133            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2134        ) -> Result<i32, fidl::Error> {
2135            let _response = fidl::client::decode_transaction_body::<
2136                DirectoryWatchResponse,
2137                fdomain_client::fidl::FDomainResourceDialect,
2138                0x5717193a59d66d91,
2139            >(_buf?)?;
2140            Ok(_response.s)
2141        }
2142        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2143            (mask, options, watcher),
2144            0x5717193a59d66d91,
2145            fidl::encoding::DynamicFlags::empty(),
2146            _decode,
2147        )
2148    }
2149}
2150
2151pub struct DirectoryEventStream {
2152    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2153}
2154
2155impl std::marker::Unpin for DirectoryEventStream {}
2156
2157impl futures::stream::FusedStream for DirectoryEventStream {
2158    fn is_terminated(&self) -> bool {
2159        self.event_receiver.is_terminated()
2160    }
2161}
2162
2163impl futures::Stream for DirectoryEventStream {
2164    type Item = Result<DirectoryEvent, fidl::Error>;
2165
2166    fn poll_next(
2167        mut self: std::pin::Pin<&mut Self>,
2168        cx: &mut std::task::Context<'_>,
2169    ) -> std::task::Poll<Option<Self::Item>> {
2170        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2171            &mut self.event_receiver,
2172            cx
2173        )?) {
2174            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
2175            None => std::task::Poll::Ready(None),
2176        }
2177    }
2178}
2179
2180#[derive(Debug)]
2181pub enum DirectoryEvent {
2182    OnOpen_ {
2183        s: i32,
2184        info: Option<Box<NodeInfoDeprecated>>,
2185    },
2186    OnRepresentation {
2187        payload: Representation,
2188    },
2189    #[non_exhaustive]
2190    _UnknownEvent {
2191        /// Ordinal of the event that was sent.
2192        ordinal: u64,
2193    },
2194}
2195
2196impl DirectoryEvent {
2197    #[allow(irrefutable_let_patterns)]
2198    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
2199        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
2200    }
2201    #[allow(irrefutable_let_patterns)]
2202    pub fn into_on_representation(self) -> Option<Representation> {
2203        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
2204    }
2205
2206    /// Decodes a message buffer as a [`DirectoryEvent`].
2207    fn decode(
2208        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2209    ) -> Result<DirectoryEvent, fidl::Error> {
2210        let (bytes, _handles) = buf.split_mut();
2211        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2212        debug_assert_eq!(tx_header.tx_id, 0);
2213        match tx_header.ordinal {
2214            0x7fc7bbb1dbfd1972 => {
2215                let mut out = fidl::new_empty!(
2216                    NodeOnOpenRequest,
2217                    fdomain_client::fidl::FDomainResourceDialect
2218                );
2219                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2220                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
2221            }
2222            0x5cb40567d80a510c => {
2223                let mut out =
2224                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
2225                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
2226                Ok((DirectoryEvent::OnRepresentation { payload: out }))
2227            }
2228            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2229                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2230            }
2231            _ => Err(fidl::Error::UnknownOrdinal {
2232                ordinal: tx_header.ordinal,
2233                protocol_name:
2234                    <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2235            }),
2236        }
2237    }
2238}
2239
2240/// A Stream of incoming requests for fuchsia.io/Directory.
2241pub struct DirectoryRequestStream {
2242    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2243    is_terminated: bool,
2244}
2245
2246impl std::marker::Unpin for DirectoryRequestStream {}
2247
2248impl futures::stream::FusedStream for DirectoryRequestStream {
2249    fn is_terminated(&self) -> bool {
2250        self.is_terminated
2251    }
2252}
2253
2254impl fdomain_client::fidl::RequestStream for DirectoryRequestStream {
2255    type Protocol = DirectoryMarker;
2256    type ControlHandle = DirectoryControlHandle;
2257
2258    fn from_channel(channel: fdomain_client::Channel) -> Self {
2259        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2260    }
2261
2262    fn control_handle(&self) -> Self::ControlHandle {
2263        DirectoryControlHandle { inner: self.inner.clone() }
2264    }
2265
2266    fn into_inner(
2267        self,
2268    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2269    {
2270        (self.inner, self.is_terminated)
2271    }
2272
2273    fn from_inner(
2274        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2275        is_terminated: bool,
2276    ) -> Self {
2277        Self { inner, is_terminated }
2278    }
2279}
2280
2281impl futures::Stream for DirectoryRequestStream {
2282    type Item = Result<DirectoryRequest, fidl::Error>;
2283
2284    fn poll_next(
2285        mut self: std::pin::Pin<&mut Self>,
2286        cx: &mut std::task::Context<'_>,
2287    ) -> std::task::Poll<Option<Self::Item>> {
2288        let this = &mut *self;
2289        if this.inner.check_shutdown(cx) {
2290            this.is_terminated = true;
2291            return std::task::Poll::Ready(None);
2292        }
2293        if this.is_terminated {
2294            panic!("polled DirectoryRequestStream after completion");
2295        }
2296        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2297            |bytes, handles| {
2298                match this.inner.channel().read_etc(cx, bytes, handles) {
2299                    std::task::Poll::Ready(Ok(())) => {}
2300                    std::task::Poll::Pending => return std::task::Poll::Pending,
2301                    std::task::Poll::Ready(Err(None)) => {
2302                        this.is_terminated = true;
2303                        return std::task::Poll::Ready(None);
2304                    }
2305                    std::task::Poll::Ready(Err(Some(e))) => {
2306                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2307                            e.into(),
2308                        ))));
2309                    }
2310                }
2311
2312                // A message has been received from the channel
2313                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2314
2315                std::task::Poll::Ready(Some(match header.ordinal {
2316                    0x6ee9c0ad53ec87aa => {
2317                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2318                        let mut req = fidl::new_empty!(
2319                            AdvisoryLockingAdvisoryLockRequest,
2320                            fdomain_client::fidl::FDomainResourceDialect
2321                        );
2322                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
2323                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2324                        Ok(DirectoryRequest::AdvisoryLock {
2325                            request: req.request,
2326
2327                            responder: DirectoryAdvisoryLockResponder {
2328                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2329                                tx_id: header.tx_id,
2330                            },
2331                        })
2332                    }
2333                    0x20d8a7aba2168a79 => {
2334                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2335                        let mut req = fidl::new_empty!(
2336                            fdomain_fuchsia_unknown::CloneableCloneRequest,
2337                            fdomain_client::fidl::FDomainResourceDialect
2338                        );
2339                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2340                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2341                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
2342                    }
2343                    0x5ac5d459ad7f657e => {
2344                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2345                        let mut req = fidl::new_empty!(
2346                            fidl::encoding::EmptyPayload,
2347                            fdomain_client::fidl::FDomainResourceDialect
2348                        );
2349                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2350                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2351                        Ok(DirectoryRequest::Close {
2352                            responder: DirectoryCloseResponder {
2353                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2354                                tx_id: header.tx_id,
2355                            },
2356                        })
2357                    }
2358                    0x2658edee9decfc06 => {
2359                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2360                        let mut req = fidl::new_empty!(
2361                            fidl::encoding::EmptyPayload,
2362                            fdomain_client::fidl::FDomainResourceDialect
2363                        );
2364                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2365                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2366                        Ok(DirectoryRequest::Query {
2367                            responder: DirectoryQueryResponder {
2368                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2369                                tx_id: header.tx_id,
2370                            },
2371                        })
2372                    }
2373                    0x5a61678f293ce16f => {
2374                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2375                        let mut req = fidl::new_empty!(
2376                            NodeDeprecatedCloneRequest,
2377                            fdomain_client::fidl::FDomainResourceDialect
2378                        );
2379                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2380                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2381                        Ok(DirectoryRequest::DeprecatedClone {
2382                            flags: req.flags,
2383                            object: req.object,
2384
2385                            control_handle,
2386                        })
2387                    }
2388                    0x78985e216314dafd => {
2389                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2390                        let mut req = fidl::new_empty!(
2391                            fidl::encoding::EmptyPayload,
2392                            fdomain_client::fidl::FDomainResourceDialect
2393                        );
2394                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2395                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2396                        Ok(DirectoryRequest::DeprecatedGetAttr {
2397                            responder: DirectoryDeprecatedGetAttrResponder {
2398                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2399                                tx_id: header.tx_id,
2400                            },
2401                        })
2402                    }
2403                    0x4186c0f40d938f46 => {
2404                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2405                        let mut req = fidl::new_empty!(
2406                            NodeDeprecatedSetAttrRequest,
2407                            fdomain_client::fidl::FDomainResourceDialect
2408                        );
2409                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
2410                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2411                        Ok(DirectoryRequest::DeprecatedSetAttr {
2412                            flags: req.flags,
2413                            attributes: req.attributes,
2414
2415                            responder: DirectoryDeprecatedSetAttrResponder {
2416                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2417                                tx_id: header.tx_id,
2418                            },
2419                        })
2420                    }
2421                    0x5b88fffb8eda3aa1 => {
2422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2423                        let mut req = fidl::new_empty!(
2424                            fidl::encoding::EmptyPayload,
2425                            fdomain_client::fidl::FDomainResourceDialect
2426                        );
2427                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2428                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2429                        Ok(DirectoryRequest::DeprecatedGetFlags {
2430                            responder: DirectoryDeprecatedGetFlagsResponder {
2431                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2432                                tx_id: header.tx_id,
2433                            },
2434                        })
2435                    }
2436                    0x5295b76c71fde733 => {
2437                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2438                        let mut req = fidl::new_empty!(
2439                            NodeDeprecatedSetFlagsRequest,
2440                            fdomain_client::fidl::FDomainResourceDialect
2441                        );
2442                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2443                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2444                        Ok(DirectoryRequest::DeprecatedSetFlags {
2445                            flags: req.flags,
2446
2447                            responder: DirectoryDeprecatedSetFlagsResponder {
2448                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2449                                tx_id: header.tx_id,
2450                            },
2451                        })
2452                    }
2453                    0x176eb318f64ec23 => {
2454                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2455                        let mut req = fidl::new_empty!(
2456                            fidl::encoding::EmptyPayload,
2457                            fdomain_client::fidl::FDomainResourceDialect
2458                        );
2459                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2460                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2461                        Ok(DirectoryRequest::GetFlags {
2462                            responder: DirectoryGetFlagsResponder {
2463                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2464                                tx_id: header.tx_id,
2465                            },
2466                        })
2467                    }
2468                    0x55a8028685791ea8 => {
2469                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2470                        let mut req = fidl::new_empty!(
2471                            NodeSetFlagsRequest,
2472                            fdomain_client::fidl::FDomainResourceDialect
2473                        );
2474                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2475                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2476                        Ok(DirectoryRequest::SetFlags {
2477                            flags: req.flags,
2478
2479                            responder: DirectorySetFlagsResponder {
2480                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2481                                tx_id: header.tx_id,
2482                            },
2483                        })
2484                    }
2485                    0x6f344a1c6b0a0610 => {
2486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2487                        let mut req = fidl::new_empty!(
2488                            fidl::encoding::EmptyPayload,
2489                            fdomain_client::fidl::FDomainResourceDialect
2490                        );
2491                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2492                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2493                        Ok(DirectoryRequest::QueryFilesystem {
2494                            responder: DirectoryQueryFilesystemResponder {
2495                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2496                                tx_id: header.tx_id,
2497                            },
2498                        })
2499                    }
2500                    0x3d4396a638ea053b => {
2501                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2502                        let mut req = fidl::new_empty!(
2503                            NodeGetAttributesRequest,
2504                            fdomain_client::fidl::FDomainResourceDialect
2505                        );
2506                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2507                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2508                        Ok(DirectoryRequest::GetAttributes {
2509                            query: req.query,
2510
2511                            responder: DirectoryGetAttributesResponder {
2512                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2513                                tx_id: header.tx_id,
2514                            },
2515                        })
2516                    }
2517                    0x3308c1da5a89bf08 => {
2518                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2519                        let mut req = fidl::new_empty!(
2520                            MutableNodeAttributes,
2521                            fdomain_client::fidl::FDomainResourceDialect
2522                        );
2523                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
2524                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2525                        Ok(DirectoryRequest::UpdateAttributes {
2526                            payload: req,
2527                            responder: DirectoryUpdateAttributesResponder {
2528                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2529                                tx_id: header.tx_id,
2530                            },
2531                        })
2532                    }
2533                    0x2c5c27ca0ab5dc49 => {
2534                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2535                        let mut req = fidl::new_empty!(
2536                            fidl::encoding::EmptyPayload,
2537                            fdomain_client::fidl::FDomainResourceDialect
2538                        );
2539                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2540                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2541                        Ok(DirectoryRequest::Sync {
2542                            responder: DirectorySyncResponder {
2543                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2544                                tx_id: header.tx_id,
2545                            },
2546                        })
2547                    }
2548                    0x4b61033de007fcd0 => {
2549                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2550                        let mut req = fidl::new_empty!(
2551                            NodeListExtendedAttributesRequest,
2552                            fdomain_client::fidl::FDomainResourceDialect
2553                        );
2554                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2555                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2556                        Ok(DirectoryRequest::ListExtendedAttributes {
2557                            iterator: req.iterator,
2558
2559                            control_handle,
2560                        })
2561                    }
2562                    0x45ffa3ccfdeb76db => {
2563                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2564                        let mut req = fidl::new_empty!(
2565                            NodeGetExtendedAttributeRequest,
2566                            fdomain_client::fidl::FDomainResourceDialect
2567                        );
2568                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2569                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2570                        Ok(DirectoryRequest::GetExtendedAttribute {
2571                            name: req.name,
2572
2573                            responder: DirectoryGetExtendedAttributeResponder {
2574                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2575                                tx_id: header.tx_id,
2576                            },
2577                        })
2578                    }
2579                    0x4a951362f681f23c => {
2580                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2581                        let mut req = fidl::new_empty!(
2582                            NodeSetExtendedAttributeRequest,
2583                            fdomain_client::fidl::FDomainResourceDialect
2584                        );
2585                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2586                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2587                        Ok(DirectoryRequest::SetExtendedAttribute {
2588                            name: req.name,
2589                            value: req.value,
2590                            mode: req.mode,
2591
2592                            responder: DirectorySetExtendedAttributeResponder {
2593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2594                                tx_id: header.tx_id,
2595                            },
2596                        })
2597                    }
2598                    0x7a0b9f3a9bf9032d => {
2599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2600                        let mut req = fidl::new_empty!(
2601                            NodeRemoveExtendedAttributeRequest,
2602                            fdomain_client::fidl::FDomainResourceDialect
2603                        );
2604                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2605                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2606                        Ok(DirectoryRequest::RemoveExtendedAttribute {
2607                            name: req.name,
2608
2609                            responder: DirectoryRemoveExtendedAttributeResponder {
2610                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2611                                tx_id: header.tx_id,
2612                            },
2613                        })
2614                    }
2615                    0x568ddcb9a9cbb6d9 => {
2616                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2617                        let mut req = fidl::new_empty!(
2618                            OpenableOpenRequest,
2619                            fdomain_client::fidl::FDomainResourceDialect
2620                        );
2621                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2622                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2623                        Ok(DirectoryRequest::Open {
2624                            path: req.path,
2625                            flags: req.flags,
2626                            options: req.options,
2627                            object: req.object,
2628
2629                            control_handle,
2630                        })
2631                    }
2632                    0x2c5044561d685ec0 => {
2633                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2634                        let mut req = fidl::new_empty!(
2635                            DirectoryDeprecatedOpenRequest,
2636                            fdomain_client::fidl::FDomainResourceDialect
2637                        );
2638                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2639                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2640                        Ok(DirectoryRequest::DeprecatedOpen {
2641                            flags: req.flags,
2642                            mode: req.mode,
2643                            path: req.path,
2644                            object: req.object,
2645
2646                            control_handle,
2647                        })
2648                    }
2649                    0x3582806bf27faa0a => {
2650                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2651                        let mut req = fidl::new_empty!(
2652                            DirectoryReadDirentsRequest,
2653                            fdomain_client::fidl::FDomainResourceDialect
2654                        );
2655                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
2656                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2657                        Ok(DirectoryRequest::ReadDirents {
2658                            max_bytes: req.max_bytes,
2659
2660                            responder: DirectoryReadDirentsResponder {
2661                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2662                                tx_id: header.tx_id,
2663                            },
2664                        })
2665                    }
2666                    0x16b1202af0f34c71 => {
2667                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2668                        let mut req = fidl::new_empty!(
2669                            fidl::encoding::EmptyPayload,
2670                            fdomain_client::fidl::FDomainResourceDialect
2671                        );
2672                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2673                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2674                        Ok(DirectoryRequest::Rewind {
2675                            responder: DirectoryRewindResponder {
2676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2677                                tx_id: header.tx_id,
2678                            },
2679                        })
2680                    }
2681                    0x26ae9d18763c8655 => {
2682                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2683                        let mut req = fidl::new_empty!(
2684                            fidl::encoding::EmptyPayload,
2685                            fdomain_client::fidl::FDomainResourceDialect
2686                        );
2687                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2688                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2689                        Ok(DirectoryRequest::GetToken {
2690                            responder: DirectoryGetTokenResponder {
2691                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2692                                tx_id: header.tx_id,
2693                            },
2694                        })
2695                    }
2696                    0x740604c0c7c930e7 => {
2697                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2698                        let mut req = fidl::new_empty!(
2699                            DirectoryLinkRequest,
2700                            fdomain_client::fidl::FDomainResourceDialect
2701                        );
2702                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
2703                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2704                        Ok(DirectoryRequest::Link {
2705                            src: req.src,
2706                            dst_parent_token: req.dst_parent_token,
2707                            dst: req.dst,
2708
2709                            responder: DirectoryLinkResponder {
2710                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2711                                tx_id: header.tx_id,
2712                            },
2713                        })
2714                    }
2715                    0x750a0326a78d7bed => {
2716                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2717                        let mut req = fidl::new_empty!(
2718                            DirectoryUnlinkRequest,
2719                            fdomain_client::fidl::FDomainResourceDialect
2720                        );
2721                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2722                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2723                        Ok(DirectoryRequest::Unlink {
2724                            name: req.name,
2725                            options: req.options,
2726
2727                            responder: DirectoryUnlinkResponder {
2728                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2729                                tx_id: header.tx_id,
2730                            },
2731                        })
2732                    }
2733                    0x7060e7723b9928de => {
2734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2735                        let mut req = fidl::new_empty!(
2736                            DirectoryRenameRequest,
2737                            fdomain_client::fidl::FDomainResourceDialect
2738                        );
2739                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
2740                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2741                        Ok(DirectoryRequest::Rename {
2742                            src: req.src,
2743                            dst_parent_token: req.dst_parent_token,
2744                            dst: req.dst,
2745
2746                            responder: DirectoryRenameResponder {
2747                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2748                                tx_id: header.tx_id,
2749                            },
2750                        })
2751                    }
2752                    0x21ce0f19ec043889 => {
2753                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2754                        let mut req = fidl::new_empty!(
2755                            DirectoryCreateSymlinkRequest,
2756                            fdomain_client::fidl::FDomainResourceDialect
2757                        );
2758                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2759                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2760                        Ok(DirectoryRequest::CreateSymlink {
2761                            name: req.name,
2762                            target: req.target,
2763                            connection: req.connection,
2764
2765                            responder: DirectoryCreateSymlinkResponder {
2766                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2767                                tx_id: header.tx_id,
2768                            },
2769                        })
2770                    }
2771                    0x5717193a59d66d91 => {
2772                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2773                        let mut req = fidl::new_empty!(
2774                            DirectoryWatchRequest,
2775                            fdomain_client::fidl::FDomainResourceDialect
2776                        );
2777                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2778                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2779                        Ok(DirectoryRequest::Watch {
2780                            mask: req.mask,
2781                            options: req.options,
2782                            watcher: req.watcher,
2783
2784                            responder: DirectoryWatchResponder {
2785                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2786                                tx_id: header.tx_id,
2787                            },
2788                        })
2789                    }
2790                    _ if header.tx_id == 0
2791                        && header
2792                            .dynamic_flags()
2793                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2794                    {
2795                        Ok(DirectoryRequest::_UnknownMethod {
2796                            ordinal: header.ordinal,
2797                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2798                            method_type: fidl::MethodType::OneWay,
2799                        })
2800                    }
2801                    _ if header
2802                        .dynamic_flags()
2803                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2804                    {
2805                        this.inner.send_framework_err(
2806                            fidl::encoding::FrameworkErr::UnknownMethod,
2807                            header.tx_id,
2808                            header.ordinal,
2809                            header.dynamic_flags(),
2810                            (bytes, handles),
2811                        )?;
2812                        Ok(DirectoryRequest::_UnknownMethod {
2813                            ordinal: header.ordinal,
2814                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2815                            method_type: fidl::MethodType::TwoWay,
2816                        })
2817                    }
2818                    _ => Err(fidl::Error::UnknownOrdinal {
2819                        ordinal: header.ordinal,
2820                        protocol_name:
2821                            <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2822                    }),
2823                }))
2824            },
2825        )
2826    }
2827}
2828
2829/// Directory defines a node which is capable of containing other Objects.
2830#[derive(Debug)]
2831pub enum DirectoryRequest {
2832    /// Acquires an advisory lock on the underlying file.
2833    ///
2834    /// The lock lasts until either this connection is closed or
2835    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
2836    /// explicitly.
2837    ///
2838    /// Advisory locks are purely advisory. They do not prevent actual read or
2839    /// write operations from occurring on the file, either through this
2840    /// connection or through other connections.
2841    ///
2842    /// This method requires the following rights:
2843    ///
2844    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
2845    /// * [`Rights.WRITE_BYTES`] if `request.type` is
2846    ///   [`AdvisoryLockType.WRITE`].
2847    ///
2848    /// # Errors
2849    ///
2850    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
2851    ///   example, another connection might hold a conflicting lock type.
2852    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
2853    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
2854    ///   to acquire the given type of lock.
2855    AdvisoryLock {
2856        request: AdvisoryLockRequest,
2857        responder: DirectoryAdvisoryLockResponder,
2858    },
2859    Clone {
2860        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
2861        control_handle: DirectoryControlHandle,
2862    },
2863    /// Terminates the connection.
2864    ///
2865    /// After calling `Close`, the client must not send any other requests.
2866    ///
2867    /// Servers, after sending the status response, should close the connection
2868    /// regardless of status and without sending an epitaph.
2869    ///
2870    /// Closing the client end of the channel should be semantically equivalent
2871    /// to calling `Close` without knowing when the close has completed or its
2872    /// status.
2873    Close {
2874        responder: DirectoryCloseResponder,
2875    },
2876    Query {
2877        responder: DirectoryQueryResponder,
2878    },
2879    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
2880    DeprecatedClone {
2881        flags: OpenFlags,
2882        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
2883        control_handle: DirectoryControlHandle,
2884    },
2885    /// DEPRECATED - Use `Node.GetAttributes` instead.
2886    ///
2887    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2888    DeprecatedGetAttr {
2889        responder: DirectoryDeprecatedGetAttrResponder,
2890    },
2891    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
2892    DeprecatedSetAttr {
2893        flags: NodeAttributeFlags,
2894        attributes: NodeAttributes,
2895        responder: DirectoryDeprecatedSetAttrResponder,
2896    },
2897    /// [DEPRECATED - Use new GetFlags method instead.]
2898    DeprecatedGetFlags {
2899        responder: DirectoryDeprecatedGetFlagsResponder,
2900    },
2901    /// [DEPRECATED - Use new SetFlags method instead.]
2902    DeprecatedSetFlags {
2903        flags: OpenFlags,
2904        responder: DirectoryDeprecatedSetFlagsResponder,
2905    },
2906    /// Queries the flags that apply to this node after it has been opened/created. This method does
2907    /// not require any rights.
2908    ///
2909    /// Note that the final set of flags that apply to the connection may differ from those
2910    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2911    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2912    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2913    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2914    GetFlags {
2915        responder: DirectoryGetFlagsResponder,
2916    },
2917    /// Sets the flags that apply to this node after it has been opened. This method does not
2918    /// require any rights.
2919    ///
2920    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2921    /// clear append mode.
2922    ///
2923    /// Errors:
2924    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2925    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2926    SetFlags {
2927        flags: Flags,
2928        responder: DirectorySetFlagsResponder,
2929    },
2930    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2931    /// volume has different settings or the storage is accounted seperately from the rest of the
2932    /// filesystem that may be reported instead of filesystem-wide details.
2933    QueryFilesystem {
2934        responder: DirectoryQueryFilesystemResponder,
2935    },
2936    /// Acquires information about the node.
2937    ///
2938    /// The attributes of a node should be stable, independent of the
2939    /// specific protocol used to access it.
2940    ///
2941    /// If a particular attribute is not applicable or not supported,
2942    /// filesystems should leave the corresponding field absent.
2943    ///
2944    /// + `query` a bit-mask specifying which attributes to fetch. The server
2945    ///   should not return more than necessary.
2946    /// - `attributes` the returned attributes.
2947    ///
2948    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2949    GetAttributes {
2950        query: NodeAttributesQuery,
2951        responder: DirectoryGetAttributesResponder,
2952    },
2953    /// Updates information about the node.
2954    ///
2955    /// + `attributes` the presence of a table field in `attributes` indicates
2956    /// the intent to update the corresponding attribute.
2957    ///
2958    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2959    ///
2960    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2961    UpdateAttributes {
2962        payload: MutableNodeAttributes,
2963        responder: DirectoryUpdateAttributesResponder,
2964    },
2965    /// Synchronizes updates to the node to the underlying media, if it exists.
2966    ///
2967    /// This method will return when the filesystem server has flushed the
2968    /// relevant updates to the underlying media, but does not guarantee the
2969    /// underlying media has persisted the information, nor that any information
2970    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2971    /// between operations.
2972    ///
2973    /// This method does not require any rights.
2974    Sync {
2975        responder: DirectorySyncResponder,
2976    },
2977    /// Creates an iterator over all the extended attribute names associated
2978    /// with this node. If an error occurs it is returned as an epitaph on the
2979    /// iterator request channel, and then the channel is closed.
2980    ///
2981    /// GetExtendedAttributes can be used with any of these names to retrieve
2982    /// the associated value.
2983    ///
2984    /// This method requires the [`Rights.READ_BYTES`] right.
2985    ListExtendedAttributes {
2986        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
2987        control_handle: DirectoryControlHandle,
2988    },
2989    /// Get the value associated with the given attribute `name` for this node.
2990    ///
2991    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2992    /// particular structure is imposed on them.
2993    ///
2994    /// This method requires the [`Rights.READ_BYTES`] right.
2995    GetExtendedAttribute {
2996        name: Vec<u8>,
2997        responder: DirectoryGetExtendedAttributeResponder,
2998    },
2999    /// Set the value for the given attribute `name` to `value` for this node.
3000    ///
3001    /// The attribute name may exist, in which case the attribute is updated.
3002    /// If the attribute doesn't exist, it is created. The name should have no
3003    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3004    ///
3005    /// This method requires the [`Rights.WRITE_BYTES`] right.
3006    SetExtendedAttribute {
3007        name: Vec<u8>,
3008        value: ExtendedAttributeValue,
3009        mode: SetExtendedAttributeMode,
3010        responder: DirectorySetExtendedAttributeResponder,
3011    },
3012    /// Remove the specified extended attribute.
3013    ///
3014    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3015    ///
3016    /// This method requires the [`Rights.WRITE_BYTES`] right.
3017    RemoveExtendedAttribute {
3018        name: Vec<u8>,
3019        responder: DirectoryRemoveExtendedAttributeResponder,
3020    },
3021    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3022    /// epitaph sent on the `object` channel.
3023    ///
3024    /// Errors:
3025    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3026    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3027    Open {
3028        path: String,
3029        flags: Flags,
3030        options: Options,
3031        object: fdomain_client::Channel,
3032        control_handle: DirectoryControlHandle,
3033    },
3034    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3035    DeprecatedOpen {
3036        flags: OpenFlags,
3037        mode: ModeType,
3038        path: String,
3039        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
3040        control_handle: DirectoryControlHandle,
3041    },
3042    /// Reads a collection of variably sized dirents into a buffer.
3043    /// The number of dirents in a directory may be very large: akin to
3044    /// calling read multiple times on a file, directories have a seek
3045    /// offset which is updated on subsequent calls to ReadDirents.
3046    /// Each call to ReadDirents will only return whole dirent structures,
3047    /// they will not get split across ReadDirent calls. When the seek
3048    /// offset reaches the end, `dirents` will be empty.
3049    ///
3050    /// These dirents are of the form:
3051    /// ```
3052    /// struct dirent {
3053    ///   // Describes the inode of the entry.
3054    ///   uint64 ino;
3055    ///   // Describes the length of the dirent name in bytes.
3056    ///   uint8 size;
3057    ///   // Describes the type of the entry. Aligned with the
3058    ///   // POSIX d_type values. Use `DirentType` constants.
3059    ///   uint8 type;
3060    ///   // Unterminated name of entry.
3061    ///   char name[0];
3062    /// }
3063    /// ```
3064    ///
3065    /// This method does not require any rights, since one could always probe for
3066    /// directory contents by triggering name conflicts during file creation.
3067    ReadDirents {
3068        max_bytes: u64,
3069        responder: DirectoryReadDirentsResponder,
3070    },
3071    /// Resets the directory seek offset.
3072    ///
3073    /// This method does not require any rights, similar to ReadDirents.
3074    Rewind {
3075        responder: DirectoryRewindResponder,
3076    },
3077    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3078    /// in time. The token will remain valid for as long as the connection requesting the token
3079    /// remains open.
3080    ///
3081    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3082    /// `ZX_ERR_BAD_HANDLE`.
3083    GetToken {
3084        responder: DirectoryGetTokenResponder,
3085    },
3086    /// Creates a link to an object named src by the name dst, within a directory represented by
3087    /// token.
3088    ///
3089    /// `src` must be a resolved object name. Including "/" in the string will
3090    /// return `ZX_ERR_INVALID_ARGS`.
3091    ///
3092    /// `dst` must be a resolved object name. Including "/" in the string will
3093    /// return `ZX_ERR_INVALID_ARGS`.
3094    ///
3095    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3096    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3097    ///
3098    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3099    /// there are two actors operating concurrently, and one actor performs a rename that affects
3100    /// the source within this directory, and the other does a link, each will appear to occur
3101    /// atomically in an unspecified order.
3102    Link {
3103        src: String,
3104        dst_parent_token: fdomain_client::NullableHandle,
3105        dst: String,
3106        responder: DirectoryLinkResponder,
3107    },
3108    /// Removes a child node from the this directory's list of entries.
3109    ///
3110    /// Note: this does not guarantee that the underlying object is destroyed.
3111    /// Although the link will be removed from the containing directory,
3112    /// objects with multiple references (such as files which are still open)
3113    /// will not actually be destroyed until all references are closed.
3114    ///
3115    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3116    ///   [`Rights.WRITE_BYTES`].
3117    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3118    ///   support writing.
3119    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3120    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3121    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3122    ///   containing a remote channel.
3123    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3124    ///     something other than a directory was found.
3125    ///
3126    /// Other errors may be returned for filesystem-specific reasons.
3127    ///
3128    /// This method requires the following rights:
3129    ///
3130    /// * [`Rights.ENUMERATE`]
3131    /// * [`Rights.MODIFY_DIRECTORY`]
3132    Unlink {
3133        name: String,
3134        options: UnlinkOptions,
3135        responder: DirectoryUnlinkResponder,
3136    },
3137    /// Renames a node named `src` to the name `dst`, in a directory represented
3138    /// by `dst_parent_token`.
3139    ///
3140    /// `src` and `dst` must be valid node names.
3141    /// See [`Name`] for what constitutes a valid name.
3142    ///
3143    /// This method requires the following rights on both the current connection, and the connection
3144    /// identified by `dst_parent_token`:
3145    ///
3146    /// * [`Rights.ENUMERATE`]
3147    /// * [`Rights.MODIFY_DIRECTORY`]
3148    ///
3149    /// The following requirements are necessary to avoid rights escalations.
3150    ///
3151    /// If the source and destination directory differ, the source directory must also have the
3152    /// maximal set of abilities supported for files, which would typically be
3153    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
3154    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
3155    /// right.
3156    ///
3157    /// If `src` refers to a directory, and differs from the destination directory, then the source
3158    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
3159    ///
3160    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
3161    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
3162    Rename {
3163        src: String,
3164        dst_parent_token: fdomain_client::Event,
3165        dst: String,
3166        responder: DirectoryRenameResponder,
3167    },
3168    /// Creates a symbolic link.
3169    ///
3170    /// `name` is the name to be given to the created symbolic link.
3171    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
3172    /// will perform no validation of `target` except for a server chosen maximum length.
3173    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
3174    /// on the successfully created node.
3175    ///
3176    /// * [`Rights.MODIFY_DIRECTORY`]
3177    ///
3178    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
3179    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
3180    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
3181    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
3182    CreateSymlink {
3183        name: String,
3184        target: Vec<u8>,
3185        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3186        responder: DirectoryCreateSymlinkResponder,
3187    },
3188    /// Watches a directory, receiving events of added messages on the
3189    /// watcher request channel.
3190    ///
3191    /// Options must be zero; it is reserved.
3192    ///
3193    /// This method does not require any rights, similar to ReadDirents.
3194    Watch {
3195        mask: WatchMask,
3196        options: u32,
3197        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3198        responder: DirectoryWatchResponder,
3199    },
3200    /// An interaction was received which does not match any known method.
3201    #[non_exhaustive]
3202    _UnknownMethod {
3203        /// Ordinal of the method that was called.
3204        ordinal: u64,
3205        control_handle: DirectoryControlHandle,
3206        method_type: fidl::MethodType,
3207    },
3208}
3209
3210impl DirectoryRequest {
3211    #[allow(irrefutable_let_patterns)]
3212    pub fn into_advisory_lock(
3213        self,
3214    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
3215        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
3216            Some((request, responder))
3217        } else {
3218            None
3219        }
3220    }
3221
3222    #[allow(irrefutable_let_patterns)]
3223    pub fn into_clone(
3224        self,
3225    ) -> Option<(
3226        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
3227        DirectoryControlHandle,
3228    )> {
3229        if let DirectoryRequest::Clone { request, control_handle } = self {
3230            Some((request, control_handle))
3231        } else {
3232            None
3233        }
3234    }
3235
3236    #[allow(irrefutable_let_patterns)]
3237    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
3238        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
3239    }
3240
3241    #[allow(irrefutable_let_patterns)]
3242    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
3243        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
3244    }
3245
3246    #[allow(irrefutable_let_patterns)]
3247    pub fn into_deprecated_clone(
3248        self,
3249    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, DirectoryControlHandle)>
3250    {
3251        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
3252            Some((flags, object, control_handle))
3253        } else {
3254            None
3255        }
3256    }
3257
3258    #[allow(irrefutable_let_patterns)]
3259    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
3260        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
3261            Some((responder))
3262        } else {
3263            None
3264        }
3265    }
3266
3267    #[allow(irrefutable_let_patterns)]
3268    pub fn into_deprecated_set_attr(
3269        self,
3270    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
3271        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
3272            Some((flags, attributes, responder))
3273        } else {
3274            None
3275        }
3276    }
3277
3278    #[allow(irrefutable_let_patterns)]
3279    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
3280        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
3281            Some((responder))
3282        } else {
3283            None
3284        }
3285    }
3286
3287    #[allow(irrefutable_let_patterns)]
3288    pub fn into_deprecated_set_flags(
3289        self,
3290    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
3291        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
3292            Some((flags, responder))
3293        } else {
3294            None
3295        }
3296    }
3297
3298    #[allow(irrefutable_let_patterns)]
3299    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
3300        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
3301    }
3302
3303    #[allow(irrefutable_let_patterns)]
3304    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
3305        if let DirectoryRequest::SetFlags { flags, responder } = self {
3306            Some((flags, responder))
3307        } else {
3308            None
3309        }
3310    }
3311
3312    #[allow(irrefutable_let_patterns)]
3313    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
3314        if let DirectoryRequest::QueryFilesystem { responder } = self {
3315            Some((responder))
3316        } else {
3317            None
3318        }
3319    }
3320
3321    #[allow(irrefutable_let_patterns)]
3322    pub fn into_get_attributes(
3323        self,
3324    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
3325        if let DirectoryRequest::GetAttributes { query, responder } = self {
3326            Some((query, responder))
3327        } else {
3328            None
3329        }
3330    }
3331
3332    #[allow(irrefutable_let_patterns)]
3333    pub fn into_update_attributes(
3334        self,
3335    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
3336        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
3337            Some((payload, responder))
3338        } else {
3339            None
3340        }
3341    }
3342
3343    #[allow(irrefutable_let_patterns)]
3344    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
3345        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
3346    }
3347
3348    #[allow(irrefutable_let_patterns)]
3349    pub fn into_list_extended_attributes(
3350        self,
3351    ) -> Option<(
3352        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3353        DirectoryControlHandle,
3354    )> {
3355        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
3356            Some((iterator, control_handle))
3357        } else {
3358            None
3359        }
3360    }
3361
3362    #[allow(irrefutable_let_patterns)]
3363    pub fn into_get_extended_attribute(
3364        self,
3365    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
3366        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
3367            Some((name, responder))
3368        } else {
3369            None
3370        }
3371    }
3372
3373    #[allow(irrefutable_let_patterns)]
3374    pub fn into_set_extended_attribute(
3375        self,
3376    ) -> Option<(
3377        Vec<u8>,
3378        ExtendedAttributeValue,
3379        SetExtendedAttributeMode,
3380        DirectorySetExtendedAttributeResponder,
3381    )> {
3382        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
3383            Some((name, value, mode, responder))
3384        } else {
3385            None
3386        }
3387    }
3388
3389    #[allow(irrefutable_let_patterns)]
3390    pub fn into_remove_extended_attribute(
3391        self,
3392    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
3393        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
3394            Some((name, responder))
3395        } else {
3396            None
3397        }
3398    }
3399
3400    #[allow(irrefutable_let_patterns)]
3401    pub fn into_open(
3402        self,
3403    ) -> Option<(String, Flags, Options, fdomain_client::Channel, DirectoryControlHandle)> {
3404        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
3405            Some((path, flags, options, object, control_handle))
3406        } else {
3407            None
3408        }
3409    }
3410
3411    #[allow(irrefutable_let_patterns)]
3412    pub fn into_deprecated_open(
3413        self,
3414    ) -> Option<(
3415        OpenFlags,
3416        ModeType,
3417        String,
3418        fdomain_client::fidl::ServerEnd<NodeMarker>,
3419        DirectoryControlHandle,
3420    )> {
3421        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
3422        {
3423            Some((flags, mode, path, object, control_handle))
3424        } else {
3425            None
3426        }
3427    }
3428
3429    #[allow(irrefutable_let_patterns)]
3430    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
3431        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
3432            Some((max_bytes, responder))
3433        } else {
3434            None
3435        }
3436    }
3437
3438    #[allow(irrefutable_let_patterns)]
3439    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
3440        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
3441    }
3442
3443    #[allow(irrefutable_let_patterns)]
3444    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
3445        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
3446    }
3447
3448    #[allow(irrefutable_let_patterns)]
3449    pub fn into_link(
3450        self,
3451    ) -> Option<(String, fdomain_client::NullableHandle, String, DirectoryLinkResponder)> {
3452        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
3453            Some((src, dst_parent_token, dst, responder))
3454        } else {
3455            None
3456        }
3457    }
3458
3459    #[allow(irrefutable_let_patterns)]
3460    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
3461        if let DirectoryRequest::Unlink { name, options, responder } = self {
3462            Some((name, options, responder))
3463        } else {
3464            None
3465        }
3466    }
3467
3468    #[allow(irrefutable_let_patterns)]
3469    pub fn into_rename(
3470        self,
3471    ) -> Option<(String, fdomain_client::Event, String, DirectoryRenameResponder)> {
3472        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
3473            Some((src, dst_parent_token, dst, responder))
3474        } else {
3475            None
3476        }
3477    }
3478
3479    #[allow(irrefutable_let_patterns)]
3480    pub fn into_create_symlink(
3481        self,
3482    ) -> Option<(
3483        String,
3484        Vec<u8>,
3485        Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3486        DirectoryCreateSymlinkResponder,
3487    )> {
3488        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
3489            Some((name, target, connection, responder))
3490        } else {
3491            None
3492        }
3493    }
3494
3495    #[allow(irrefutable_let_patterns)]
3496    pub fn into_watch(
3497        self,
3498    ) -> Option<(
3499        WatchMask,
3500        u32,
3501        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3502        DirectoryWatchResponder,
3503    )> {
3504        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
3505            Some((mask, options, watcher, responder))
3506        } else {
3507            None
3508        }
3509    }
3510
3511    /// Name of the method defined in FIDL
3512    pub fn method_name(&self) -> &'static str {
3513        match *self {
3514            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
3515            DirectoryRequest::Clone { .. } => "clone",
3516            DirectoryRequest::Close { .. } => "close",
3517            DirectoryRequest::Query { .. } => "query",
3518            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
3519            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
3520            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
3521            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
3522            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
3523            DirectoryRequest::GetFlags { .. } => "get_flags",
3524            DirectoryRequest::SetFlags { .. } => "set_flags",
3525            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
3526            DirectoryRequest::GetAttributes { .. } => "get_attributes",
3527            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
3528            DirectoryRequest::Sync { .. } => "sync",
3529            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
3530            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
3531            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
3532            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
3533            DirectoryRequest::Open { .. } => "open",
3534            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
3535            DirectoryRequest::ReadDirents { .. } => "read_dirents",
3536            DirectoryRequest::Rewind { .. } => "rewind",
3537            DirectoryRequest::GetToken { .. } => "get_token",
3538            DirectoryRequest::Link { .. } => "link",
3539            DirectoryRequest::Unlink { .. } => "unlink",
3540            DirectoryRequest::Rename { .. } => "rename",
3541            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
3542            DirectoryRequest::Watch { .. } => "watch",
3543            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3544                "unknown one-way method"
3545            }
3546            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3547                "unknown two-way method"
3548            }
3549        }
3550    }
3551}
3552
3553#[derive(Debug, Clone)]
3554pub struct DirectoryControlHandle {
3555    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3556}
3557
3558impl DirectoryControlHandle {
3559    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3560        self.inner.shutdown_with_epitaph(status.into())
3561    }
3562}
3563
3564impl fdomain_client::fidl::ControlHandle for DirectoryControlHandle {
3565    fn shutdown(&self) {
3566        self.inner.shutdown()
3567    }
3568
3569    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3570        self.inner.shutdown_with_epitaph(status)
3571    }
3572
3573    fn is_closed(&self) -> bool {
3574        self.inner.channel().is_closed()
3575    }
3576    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3577        self.inner.channel().on_closed()
3578    }
3579}
3580
3581impl DirectoryControlHandle {
3582    pub fn send_on_open_(
3583        &self,
3584        mut s: i32,
3585        mut info: Option<NodeInfoDeprecated>,
3586    ) -> Result<(), fidl::Error> {
3587        self.inner.send::<NodeOnOpenRequest>(
3588            (s, info.as_mut()),
3589            0,
3590            0x7fc7bbb1dbfd1972,
3591            fidl::encoding::DynamicFlags::FLEXIBLE,
3592        )
3593    }
3594
3595    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
3596        self.inner.send::<Representation>(
3597            &mut payload,
3598            0,
3599            0x5cb40567d80a510c,
3600            fidl::encoding::DynamicFlags::empty(),
3601        )
3602    }
3603}
3604
3605#[must_use = "FIDL methods require a response to be sent"]
3606#[derive(Debug)]
3607pub struct DirectoryAdvisoryLockResponder {
3608    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3609    tx_id: u32,
3610}
3611
3612/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3613/// if the responder is dropped without sending a response, so that the client
3614/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3615impl std::ops::Drop for DirectoryAdvisoryLockResponder {
3616    fn drop(&mut self) {
3617        self.control_handle.shutdown();
3618        // Safety: drops once, never accessed again
3619        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3620    }
3621}
3622
3623impl fdomain_client::fidl::Responder for DirectoryAdvisoryLockResponder {
3624    type ControlHandle = DirectoryControlHandle;
3625
3626    fn control_handle(&self) -> &DirectoryControlHandle {
3627        &self.control_handle
3628    }
3629
3630    fn drop_without_shutdown(mut self) {
3631        // Safety: drops once, never accessed again due to mem::forget
3632        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3633        // Prevent Drop from running (which would shut down the channel)
3634        std::mem::forget(self);
3635    }
3636}
3637
3638impl DirectoryAdvisoryLockResponder {
3639    /// Sends a response to the FIDL transaction.
3640    ///
3641    /// Sets the channel to shutdown if an error occurs.
3642    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3643        let _result = self.send_raw(result);
3644        if _result.is_err() {
3645            self.control_handle.shutdown();
3646        }
3647        self.drop_without_shutdown();
3648        _result
3649    }
3650
3651    /// Similar to "send" but does not shutdown the channel if an error occurs.
3652    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3653        let _result = self.send_raw(result);
3654        self.drop_without_shutdown();
3655        _result
3656    }
3657
3658    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3659        self.control_handle
3660            .inner
3661            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3662                result,
3663                self.tx_id,
3664                0x6ee9c0ad53ec87aa,
3665                fidl::encoding::DynamicFlags::empty(),
3666            )
3667    }
3668}
3669
3670#[must_use = "FIDL methods require a response to be sent"]
3671#[derive(Debug)]
3672pub struct DirectoryCloseResponder {
3673    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3674    tx_id: u32,
3675}
3676
3677/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3678/// if the responder is dropped without sending a response, so that the client
3679/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3680impl std::ops::Drop for DirectoryCloseResponder {
3681    fn drop(&mut self) {
3682        self.control_handle.shutdown();
3683        // Safety: drops once, never accessed again
3684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3685    }
3686}
3687
3688impl fdomain_client::fidl::Responder for DirectoryCloseResponder {
3689    type ControlHandle = DirectoryControlHandle;
3690
3691    fn control_handle(&self) -> &DirectoryControlHandle {
3692        &self.control_handle
3693    }
3694
3695    fn drop_without_shutdown(mut self) {
3696        // Safety: drops once, never accessed again due to mem::forget
3697        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3698        // Prevent Drop from running (which would shut down the channel)
3699        std::mem::forget(self);
3700    }
3701}
3702
3703impl DirectoryCloseResponder {
3704    /// Sends a response to the FIDL transaction.
3705    ///
3706    /// Sets the channel to shutdown if an error occurs.
3707    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3708        let _result = self.send_raw(result);
3709        if _result.is_err() {
3710            self.control_handle.shutdown();
3711        }
3712        self.drop_without_shutdown();
3713        _result
3714    }
3715
3716    /// Similar to "send" but does not shutdown the channel if an error occurs.
3717    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3718        let _result = self.send_raw(result);
3719        self.drop_without_shutdown();
3720        _result
3721    }
3722
3723    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3724        self.control_handle
3725            .inner
3726            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3727                result,
3728                self.tx_id,
3729                0x5ac5d459ad7f657e,
3730                fidl::encoding::DynamicFlags::empty(),
3731            )
3732    }
3733}
3734
3735#[must_use = "FIDL methods require a response to be sent"]
3736#[derive(Debug)]
3737pub struct DirectoryQueryResponder {
3738    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3739    tx_id: u32,
3740}
3741
3742/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3743/// if the responder is dropped without sending a response, so that the client
3744/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3745impl std::ops::Drop for DirectoryQueryResponder {
3746    fn drop(&mut self) {
3747        self.control_handle.shutdown();
3748        // Safety: drops once, never accessed again
3749        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3750    }
3751}
3752
3753impl fdomain_client::fidl::Responder for DirectoryQueryResponder {
3754    type ControlHandle = DirectoryControlHandle;
3755
3756    fn control_handle(&self) -> &DirectoryControlHandle {
3757        &self.control_handle
3758    }
3759
3760    fn drop_without_shutdown(mut self) {
3761        // Safety: drops once, never accessed again due to mem::forget
3762        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3763        // Prevent Drop from running (which would shut down the channel)
3764        std::mem::forget(self);
3765    }
3766}
3767
3768impl DirectoryQueryResponder {
3769    /// Sends a response to the FIDL transaction.
3770    ///
3771    /// Sets the channel to shutdown if an error occurs.
3772    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3773        let _result = self.send_raw(protocol);
3774        if _result.is_err() {
3775            self.control_handle.shutdown();
3776        }
3777        self.drop_without_shutdown();
3778        _result
3779    }
3780
3781    /// Similar to "send" but does not shutdown the channel if an error occurs.
3782    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3783        let _result = self.send_raw(protocol);
3784        self.drop_without_shutdown();
3785        _result
3786    }
3787
3788    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3789        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
3790            (protocol,),
3791            self.tx_id,
3792            0x2658edee9decfc06,
3793            fidl::encoding::DynamicFlags::empty(),
3794        )
3795    }
3796}
3797
3798#[must_use = "FIDL methods require a response to be sent"]
3799#[derive(Debug)]
3800pub struct DirectoryDeprecatedGetAttrResponder {
3801    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3802    tx_id: u32,
3803}
3804
3805/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3806/// if the responder is dropped without sending a response, so that the client
3807/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3808impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
3809    fn drop(&mut self) {
3810        self.control_handle.shutdown();
3811        // Safety: drops once, never accessed again
3812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3813    }
3814}
3815
3816impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetAttrResponder {
3817    type ControlHandle = DirectoryControlHandle;
3818
3819    fn control_handle(&self) -> &DirectoryControlHandle {
3820        &self.control_handle
3821    }
3822
3823    fn drop_without_shutdown(mut self) {
3824        // Safety: drops once, never accessed again due to mem::forget
3825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3826        // Prevent Drop from running (which would shut down the channel)
3827        std::mem::forget(self);
3828    }
3829}
3830
3831impl DirectoryDeprecatedGetAttrResponder {
3832    /// Sends a response to the FIDL transaction.
3833    ///
3834    /// Sets the channel to shutdown if an error occurs.
3835    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3836        let _result = self.send_raw(s, attributes);
3837        if _result.is_err() {
3838            self.control_handle.shutdown();
3839        }
3840        self.drop_without_shutdown();
3841        _result
3842    }
3843
3844    /// Similar to "send" but does not shutdown the channel if an error occurs.
3845    pub fn send_no_shutdown_on_err(
3846        self,
3847        mut s: i32,
3848        mut attributes: &NodeAttributes,
3849    ) -> Result<(), fidl::Error> {
3850        let _result = self.send_raw(s, attributes);
3851        self.drop_without_shutdown();
3852        _result
3853    }
3854
3855    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3856        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
3857            (s, attributes),
3858            self.tx_id,
3859            0x78985e216314dafd,
3860            fidl::encoding::DynamicFlags::empty(),
3861        )
3862    }
3863}
3864
3865#[must_use = "FIDL methods require a response to be sent"]
3866#[derive(Debug)]
3867pub struct DirectoryDeprecatedSetAttrResponder {
3868    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3869    tx_id: u32,
3870}
3871
3872/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3873/// if the responder is dropped without sending a response, so that the client
3874/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3875impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
3876    fn drop(&mut self) {
3877        self.control_handle.shutdown();
3878        // Safety: drops once, never accessed again
3879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3880    }
3881}
3882
3883impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetAttrResponder {
3884    type ControlHandle = DirectoryControlHandle;
3885
3886    fn control_handle(&self) -> &DirectoryControlHandle {
3887        &self.control_handle
3888    }
3889
3890    fn drop_without_shutdown(mut self) {
3891        // Safety: drops once, never accessed again due to mem::forget
3892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3893        // Prevent Drop from running (which would shut down the channel)
3894        std::mem::forget(self);
3895    }
3896}
3897
3898impl DirectoryDeprecatedSetAttrResponder {
3899    /// Sends a response to the FIDL transaction.
3900    ///
3901    /// Sets the channel to shutdown if an error occurs.
3902    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
3903        let _result = self.send_raw(s);
3904        if _result.is_err() {
3905            self.control_handle.shutdown();
3906        }
3907        self.drop_without_shutdown();
3908        _result
3909    }
3910
3911    /// Similar to "send" but does not shutdown the channel if an error occurs.
3912    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
3913        let _result = self.send_raw(s);
3914        self.drop_without_shutdown();
3915        _result
3916    }
3917
3918    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
3919        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
3920            (s,),
3921            self.tx_id,
3922            0x4186c0f40d938f46,
3923            fidl::encoding::DynamicFlags::empty(),
3924        )
3925    }
3926}
3927
3928#[must_use = "FIDL methods require a response to be sent"]
3929#[derive(Debug)]
3930pub struct DirectoryDeprecatedGetFlagsResponder {
3931    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3932    tx_id: u32,
3933}
3934
3935/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3936/// if the responder is dropped without sending a response, so that the client
3937/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3938impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
3939    fn drop(&mut self) {
3940        self.control_handle.shutdown();
3941        // Safety: drops once, never accessed again
3942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3943    }
3944}
3945
3946impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetFlagsResponder {
3947    type ControlHandle = DirectoryControlHandle;
3948
3949    fn control_handle(&self) -> &DirectoryControlHandle {
3950        &self.control_handle
3951    }
3952
3953    fn drop_without_shutdown(mut self) {
3954        // Safety: drops once, never accessed again due to mem::forget
3955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3956        // Prevent Drop from running (which would shut down the channel)
3957        std::mem::forget(self);
3958    }
3959}
3960
3961impl DirectoryDeprecatedGetFlagsResponder {
3962    /// Sends a response to the FIDL transaction.
3963    ///
3964    /// Sets the channel to shutdown if an error occurs.
3965    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3966        let _result = self.send_raw(s, flags);
3967        if _result.is_err() {
3968            self.control_handle.shutdown();
3969        }
3970        self.drop_without_shutdown();
3971        _result
3972    }
3973
3974    /// Similar to "send" but does not shutdown the channel if an error occurs.
3975    pub fn send_no_shutdown_on_err(
3976        self,
3977        mut s: i32,
3978        mut flags: OpenFlags,
3979    ) -> Result<(), fidl::Error> {
3980        let _result = self.send_raw(s, flags);
3981        self.drop_without_shutdown();
3982        _result
3983    }
3984
3985    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3986        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
3987            (s, flags),
3988            self.tx_id,
3989            0x5b88fffb8eda3aa1,
3990            fidl::encoding::DynamicFlags::empty(),
3991        )
3992    }
3993}
3994
3995#[must_use = "FIDL methods require a response to be sent"]
3996#[derive(Debug)]
3997pub struct DirectoryDeprecatedSetFlagsResponder {
3998    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3999    tx_id: u32,
4000}
4001
4002/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4003/// if the responder is dropped without sending a response, so that the client
4004/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4005impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4006    fn drop(&mut self) {
4007        self.control_handle.shutdown();
4008        // Safety: drops once, never accessed again
4009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4010    }
4011}
4012
4013impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetFlagsResponder {
4014    type ControlHandle = DirectoryControlHandle;
4015
4016    fn control_handle(&self) -> &DirectoryControlHandle {
4017        &self.control_handle
4018    }
4019
4020    fn drop_without_shutdown(mut self) {
4021        // Safety: drops once, never accessed again due to mem::forget
4022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4023        // Prevent Drop from running (which would shut down the channel)
4024        std::mem::forget(self);
4025    }
4026}
4027
4028impl DirectoryDeprecatedSetFlagsResponder {
4029    /// Sends a response to the FIDL transaction.
4030    ///
4031    /// Sets the channel to shutdown if an error occurs.
4032    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4033        let _result = self.send_raw(s);
4034        if _result.is_err() {
4035            self.control_handle.shutdown();
4036        }
4037        self.drop_without_shutdown();
4038        _result
4039    }
4040
4041    /// Similar to "send" but does not shutdown the channel if an error occurs.
4042    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4043        let _result = self.send_raw(s);
4044        self.drop_without_shutdown();
4045        _result
4046    }
4047
4048    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4049        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4050            (s,),
4051            self.tx_id,
4052            0x5295b76c71fde733,
4053            fidl::encoding::DynamicFlags::empty(),
4054        )
4055    }
4056}
4057
4058#[must_use = "FIDL methods require a response to be sent"]
4059#[derive(Debug)]
4060pub struct DirectoryGetFlagsResponder {
4061    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4062    tx_id: u32,
4063}
4064
4065/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4066/// if the responder is dropped without sending a response, so that the client
4067/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4068impl std::ops::Drop for DirectoryGetFlagsResponder {
4069    fn drop(&mut self) {
4070        self.control_handle.shutdown();
4071        // Safety: drops once, never accessed again
4072        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4073    }
4074}
4075
4076impl fdomain_client::fidl::Responder for DirectoryGetFlagsResponder {
4077    type ControlHandle = DirectoryControlHandle;
4078
4079    fn control_handle(&self) -> &DirectoryControlHandle {
4080        &self.control_handle
4081    }
4082
4083    fn drop_without_shutdown(mut self) {
4084        // Safety: drops once, never accessed again due to mem::forget
4085        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4086        // Prevent Drop from running (which would shut down the channel)
4087        std::mem::forget(self);
4088    }
4089}
4090
4091impl DirectoryGetFlagsResponder {
4092    /// Sends a response to the FIDL transaction.
4093    ///
4094    /// Sets the channel to shutdown if an error occurs.
4095    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4096        let _result = self.send_raw(result);
4097        if _result.is_err() {
4098            self.control_handle.shutdown();
4099        }
4100        self.drop_without_shutdown();
4101        _result
4102    }
4103
4104    /// Similar to "send" but does not shutdown the channel if an error occurs.
4105    pub fn send_no_shutdown_on_err(
4106        self,
4107        mut result: Result<Flags, i32>,
4108    ) -> Result<(), fidl::Error> {
4109        let _result = self.send_raw(result);
4110        self.drop_without_shutdown();
4111        _result
4112    }
4113
4114    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4115        self.control_handle
4116            .inner
4117            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4118                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4119                self.tx_id,
4120                0x176eb318f64ec23,
4121                fidl::encoding::DynamicFlags::FLEXIBLE,
4122            )
4123    }
4124}
4125
4126#[must_use = "FIDL methods require a response to be sent"]
4127#[derive(Debug)]
4128pub struct DirectorySetFlagsResponder {
4129    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4130    tx_id: u32,
4131}
4132
4133/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4134/// if the responder is dropped without sending a response, so that the client
4135/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4136impl std::ops::Drop for DirectorySetFlagsResponder {
4137    fn drop(&mut self) {
4138        self.control_handle.shutdown();
4139        // Safety: drops once, never accessed again
4140        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4141    }
4142}
4143
4144impl fdomain_client::fidl::Responder for DirectorySetFlagsResponder {
4145    type ControlHandle = DirectoryControlHandle;
4146
4147    fn control_handle(&self) -> &DirectoryControlHandle {
4148        &self.control_handle
4149    }
4150
4151    fn drop_without_shutdown(mut self) {
4152        // Safety: drops once, never accessed again due to mem::forget
4153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4154        // Prevent Drop from running (which would shut down the channel)
4155        std::mem::forget(self);
4156    }
4157}
4158
4159impl DirectorySetFlagsResponder {
4160    /// Sends a response to the FIDL transaction.
4161    ///
4162    /// Sets the channel to shutdown if an error occurs.
4163    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4164        let _result = self.send_raw(result);
4165        if _result.is_err() {
4166            self.control_handle.shutdown();
4167        }
4168        self.drop_without_shutdown();
4169        _result
4170    }
4171
4172    /// Similar to "send" but does not shutdown the channel if an error occurs.
4173    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4174        let _result = self.send_raw(result);
4175        self.drop_without_shutdown();
4176        _result
4177    }
4178
4179    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4180        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4181            fidl::encoding::EmptyStruct,
4182            i32,
4183        >>(
4184            fidl::encoding::FlexibleResult::new(result),
4185            self.tx_id,
4186            0x55a8028685791ea8,
4187            fidl::encoding::DynamicFlags::FLEXIBLE,
4188        )
4189    }
4190}
4191
4192#[must_use = "FIDL methods require a response to be sent"]
4193#[derive(Debug)]
4194pub struct DirectoryQueryFilesystemResponder {
4195    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4196    tx_id: u32,
4197}
4198
4199/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4200/// if the responder is dropped without sending a response, so that the client
4201/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4202impl std::ops::Drop for DirectoryQueryFilesystemResponder {
4203    fn drop(&mut self) {
4204        self.control_handle.shutdown();
4205        // Safety: drops once, never accessed again
4206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4207    }
4208}
4209
4210impl fdomain_client::fidl::Responder for DirectoryQueryFilesystemResponder {
4211    type ControlHandle = DirectoryControlHandle;
4212
4213    fn control_handle(&self) -> &DirectoryControlHandle {
4214        &self.control_handle
4215    }
4216
4217    fn drop_without_shutdown(mut self) {
4218        // Safety: drops once, never accessed again due to mem::forget
4219        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4220        // Prevent Drop from running (which would shut down the channel)
4221        std::mem::forget(self);
4222    }
4223}
4224
4225impl DirectoryQueryFilesystemResponder {
4226    /// Sends a response to the FIDL transaction.
4227    ///
4228    /// Sets the channel to shutdown if an error occurs.
4229    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4230        let _result = self.send_raw(s, info);
4231        if _result.is_err() {
4232            self.control_handle.shutdown();
4233        }
4234        self.drop_without_shutdown();
4235        _result
4236    }
4237
4238    /// Similar to "send" but does not shutdown the channel if an error occurs.
4239    pub fn send_no_shutdown_on_err(
4240        self,
4241        mut s: i32,
4242        mut info: Option<&FilesystemInfo>,
4243    ) -> Result<(), fidl::Error> {
4244        let _result = self.send_raw(s, info);
4245        self.drop_without_shutdown();
4246        _result
4247    }
4248
4249    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4250        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
4251            (s, info),
4252            self.tx_id,
4253            0x6f344a1c6b0a0610,
4254            fidl::encoding::DynamicFlags::empty(),
4255        )
4256    }
4257}
4258
4259#[must_use = "FIDL methods require a response to be sent"]
4260#[derive(Debug)]
4261pub struct DirectoryGetAttributesResponder {
4262    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4263    tx_id: u32,
4264}
4265
4266/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4267/// if the responder is dropped without sending a response, so that the client
4268/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4269impl std::ops::Drop for DirectoryGetAttributesResponder {
4270    fn drop(&mut self) {
4271        self.control_handle.shutdown();
4272        // Safety: drops once, never accessed again
4273        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4274    }
4275}
4276
4277impl fdomain_client::fidl::Responder for DirectoryGetAttributesResponder {
4278    type ControlHandle = DirectoryControlHandle;
4279
4280    fn control_handle(&self) -> &DirectoryControlHandle {
4281        &self.control_handle
4282    }
4283
4284    fn drop_without_shutdown(mut self) {
4285        // Safety: drops once, never accessed again due to mem::forget
4286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4287        // Prevent Drop from running (which would shut down the channel)
4288        std::mem::forget(self);
4289    }
4290}
4291
4292impl DirectoryGetAttributesResponder {
4293    /// Sends a response to the FIDL transaction.
4294    ///
4295    /// Sets the channel to shutdown if an error occurs.
4296    pub fn send(
4297        self,
4298        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4299    ) -> Result<(), fidl::Error> {
4300        let _result = self.send_raw(result);
4301        if _result.is_err() {
4302            self.control_handle.shutdown();
4303        }
4304        self.drop_without_shutdown();
4305        _result
4306    }
4307
4308    /// Similar to "send" but does not shutdown the channel if an error occurs.
4309    pub fn send_no_shutdown_on_err(
4310        self,
4311        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4312    ) -> Result<(), fidl::Error> {
4313        let _result = self.send_raw(result);
4314        self.drop_without_shutdown();
4315        _result
4316    }
4317
4318    fn send_raw(
4319        &self,
4320        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4321    ) -> Result<(), fidl::Error> {
4322        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
4323            result,
4324            self.tx_id,
4325            0x3d4396a638ea053b,
4326            fidl::encoding::DynamicFlags::empty(),
4327        )
4328    }
4329}
4330
4331#[must_use = "FIDL methods require a response to be sent"]
4332#[derive(Debug)]
4333pub struct DirectoryUpdateAttributesResponder {
4334    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4335    tx_id: u32,
4336}
4337
4338/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4339/// if the responder is dropped without sending a response, so that the client
4340/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4341impl std::ops::Drop for DirectoryUpdateAttributesResponder {
4342    fn drop(&mut self) {
4343        self.control_handle.shutdown();
4344        // Safety: drops once, never accessed again
4345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4346    }
4347}
4348
4349impl fdomain_client::fidl::Responder for DirectoryUpdateAttributesResponder {
4350    type ControlHandle = DirectoryControlHandle;
4351
4352    fn control_handle(&self) -> &DirectoryControlHandle {
4353        &self.control_handle
4354    }
4355
4356    fn drop_without_shutdown(mut self) {
4357        // Safety: drops once, never accessed again due to mem::forget
4358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4359        // Prevent Drop from running (which would shut down the channel)
4360        std::mem::forget(self);
4361    }
4362}
4363
4364impl DirectoryUpdateAttributesResponder {
4365    /// Sends a response to the FIDL transaction.
4366    ///
4367    /// Sets the channel to shutdown if an error occurs.
4368    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4369        let _result = self.send_raw(result);
4370        if _result.is_err() {
4371            self.control_handle.shutdown();
4372        }
4373        self.drop_without_shutdown();
4374        _result
4375    }
4376
4377    /// Similar to "send" but does not shutdown the channel if an error occurs.
4378    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4379        let _result = self.send_raw(result);
4380        self.drop_without_shutdown();
4381        _result
4382    }
4383
4384    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4385        self.control_handle
4386            .inner
4387            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4388                result,
4389                self.tx_id,
4390                0x3308c1da5a89bf08,
4391                fidl::encoding::DynamicFlags::empty(),
4392            )
4393    }
4394}
4395
4396#[must_use = "FIDL methods require a response to be sent"]
4397#[derive(Debug)]
4398pub struct DirectorySyncResponder {
4399    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4400    tx_id: u32,
4401}
4402
4403/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4404/// if the responder is dropped without sending a response, so that the client
4405/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4406impl std::ops::Drop for DirectorySyncResponder {
4407    fn drop(&mut self) {
4408        self.control_handle.shutdown();
4409        // Safety: drops once, never accessed again
4410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4411    }
4412}
4413
4414impl fdomain_client::fidl::Responder for DirectorySyncResponder {
4415    type ControlHandle = DirectoryControlHandle;
4416
4417    fn control_handle(&self) -> &DirectoryControlHandle {
4418        &self.control_handle
4419    }
4420
4421    fn drop_without_shutdown(mut self) {
4422        // Safety: drops once, never accessed again due to mem::forget
4423        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4424        // Prevent Drop from running (which would shut down the channel)
4425        std::mem::forget(self);
4426    }
4427}
4428
4429impl DirectorySyncResponder {
4430    /// Sends a response to the FIDL transaction.
4431    ///
4432    /// Sets the channel to shutdown if an error occurs.
4433    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4434        let _result = self.send_raw(result);
4435        if _result.is_err() {
4436            self.control_handle.shutdown();
4437        }
4438        self.drop_without_shutdown();
4439        _result
4440    }
4441
4442    /// Similar to "send" but does not shutdown the channel if an error occurs.
4443    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4444        let _result = self.send_raw(result);
4445        self.drop_without_shutdown();
4446        _result
4447    }
4448
4449    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4450        self.control_handle
4451            .inner
4452            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4453                result,
4454                self.tx_id,
4455                0x2c5c27ca0ab5dc49,
4456                fidl::encoding::DynamicFlags::empty(),
4457            )
4458    }
4459}
4460
4461#[must_use = "FIDL methods require a response to be sent"]
4462#[derive(Debug)]
4463pub struct DirectoryGetExtendedAttributeResponder {
4464    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4465    tx_id: u32,
4466}
4467
4468/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4469/// if the responder is dropped without sending a response, so that the client
4470/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4471impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
4472    fn drop(&mut self) {
4473        self.control_handle.shutdown();
4474        // Safety: drops once, never accessed again
4475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4476    }
4477}
4478
4479impl fdomain_client::fidl::Responder for DirectoryGetExtendedAttributeResponder {
4480    type ControlHandle = DirectoryControlHandle;
4481
4482    fn control_handle(&self) -> &DirectoryControlHandle {
4483        &self.control_handle
4484    }
4485
4486    fn drop_without_shutdown(mut self) {
4487        // Safety: drops once, never accessed again due to mem::forget
4488        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4489        // Prevent Drop from running (which would shut down the channel)
4490        std::mem::forget(self);
4491    }
4492}
4493
4494impl DirectoryGetExtendedAttributeResponder {
4495    /// Sends a response to the FIDL transaction.
4496    ///
4497    /// Sets the channel to shutdown if an error occurs.
4498    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4499        let _result = self.send_raw(result);
4500        if _result.is_err() {
4501            self.control_handle.shutdown();
4502        }
4503        self.drop_without_shutdown();
4504        _result
4505    }
4506
4507    /// Similar to "send" but does not shutdown the channel if an error occurs.
4508    pub fn send_no_shutdown_on_err(
4509        self,
4510        mut result: Result<ExtendedAttributeValue, i32>,
4511    ) -> Result<(), fidl::Error> {
4512        let _result = self.send_raw(result);
4513        self.drop_without_shutdown();
4514        _result
4515    }
4516
4517    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4518        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
4519            result.as_mut().map_err(|e| *e),
4520            self.tx_id,
4521            0x45ffa3ccfdeb76db,
4522            fidl::encoding::DynamicFlags::empty(),
4523        )
4524    }
4525}
4526
4527#[must_use = "FIDL methods require a response to be sent"]
4528#[derive(Debug)]
4529pub struct DirectorySetExtendedAttributeResponder {
4530    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4531    tx_id: u32,
4532}
4533
4534/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4535/// if the responder is dropped without sending a response, so that the client
4536/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4537impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
4538    fn drop(&mut self) {
4539        self.control_handle.shutdown();
4540        // Safety: drops once, never accessed again
4541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4542    }
4543}
4544
4545impl fdomain_client::fidl::Responder for DirectorySetExtendedAttributeResponder {
4546    type ControlHandle = DirectoryControlHandle;
4547
4548    fn control_handle(&self) -> &DirectoryControlHandle {
4549        &self.control_handle
4550    }
4551
4552    fn drop_without_shutdown(mut self) {
4553        // Safety: drops once, never accessed again due to mem::forget
4554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4555        // Prevent Drop from running (which would shut down the channel)
4556        std::mem::forget(self);
4557    }
4558}
4559
4560impl DirectorySetExtendedAttributeResponder {
4561    /// Sends a response to the FIDL transaction.
4562    ///
4563    /// Sets the channel to shutdown if an error occurs.
4564    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4565        let _result = self.send_raw(result);
4566        if _result.is_err() {
4567            self.control_handle.shutdown();
4568        }
4569        self.drop_without_shutdown();
4570        _result
4571    }
4572
4573    /// Similar to "send" but does not shutdown the channel if an error occurs.
4574    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4575        let _result = self.send_raw(result);
4576        self.drop_without_shutdown();
4577        _result
4578    }
4579
4580    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4581        self.control_handle
4582            .inner
4583            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4584                result,
4585                self.tx_id,
4586                0x4a951362f681f23c,
4587                fidl::encoding::DynamicFlags::empty(),
4588            )
4589    }
4590}
4591
4592#[must_use = "FIDL methods require a response to be sent"]
4593#[derive(Debug)]
4594pub struct DirectoryRemoveExtendedAttributeResponder {
4595    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4596    tx_id: u32,
4597}
4598
4599/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4600/// if the responder is dropped without sending a response, so that the client
4601/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4602impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
4603    fn drop(&mut self) {
4604        self.control_handle.shutdown();
4605        // Safety: drops once, never accessed again
4606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4607    }
4608}
4609
4610impl fdomain_client::fidl::Responder for DirectoryRemoveExtendedAttributeResponder {
4611    type ControlHandle = DirectoryControlHandle;
4612
4613    fn control_handle(&self) -> &DirectoryControlHandle {
4614        &self.control_handle
4615    }
4616
4617    fn drop_without_shutdown(mut self) {
4618        // Safety: drops once, never accessed again due to mem::forget
4619        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4620        // Prevent Drop from running (which would shut down the channel)
4621        std::mem::forget(self);
4622    }
4623}
4624
4625impl DirectoryRemoveExtendedAttributeResponder {
4626    /// Sends a response to the FIDL transaction.
4627    ///
4628    /// Sets the channel to shutdown if an error occurs.
4629    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4630        let _result = self.send_raw(result);
4631        if _result.is_err() {
4632            self.control_handle.shutdown();
4633        }
4634        self.drop_without_shutdown();
4635        _result
4636    }
4637
4638    /// Similar to "send" but does not shutdown the channel if an error occurs.
4639    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4640        let _result = self.send_raw(result);
4641        self.drop_without_shutdown();
4642        _result
4643    }
4644
4645    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4646        self.control_handle
4647            .inner
4648            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4649                result,
4650                self.tx_id,
4651                0x7a0b9f3a9bf9032d,
4652                fidl::encoding::DynamicFlags::empty(),
4653            )
4654    }
4655}
4656
4657#[must_use = "FIDL methods require a response to be sent"]
4658#[derive(Debug)]
4659pub struct DirectoryReadDirentsResponder {
4660    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4661    tx_id: u32,
4662}
4663
4664/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4665/// if the responder is dropped without sending a response, so that the client
4666/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4667impl std::ops::Drop for DirectoryReadDirentsResponder {
4668    fn drop(&mut self) {
4669        self.control_handle.shutdown();
4670        // Safety: drops once, never accessed again
4671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4672    }
4673}
4674
4675impl fdomain_client::fidl::Responder for DirectoryReadDirentsResponder {
4676    type ControlHandle = DirectoryControlHandle;
4677
4678    fn control_handle(&self) -> &DirectoryControlHandle {
4679        &self.control_handle
4680    }
4681
4682    fn drop_without_shutdown(mut self) {
4683        // Safety: drops once, never accessed again due to mem::forget
4684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4685        // Prevent Drop from running (which would shut down the channel)
4686        std::mem::forget(self);
4687    }
4688}
4689
4690impl DirectoryReadDirentsResponder {
4691    /// Sends a response to the FIDL transaction.
4692    ///
4693    /// Sets the channel to shutdown if an error occurs.
4694    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4695        let _result = self.send_raw(s, dirents);
4696        if _result.is_err() {
4697            self.control_handle.shutdown();
4698        }
4699        self.drop_without_shutdown();
4700        _result
4701    }
4702
4703    /// Similar to "send" but does not shutdown the channel if an error occurs.
4704    pub fn send_no_shutdown_on_err(
4705        self,
4706        mut s: i32,
4707        mut dirents: &[u8],
4708    ) -> Result<(), fidl::Error> {
4709        let _result = self.send_raw(s, dirents);
4710        self.drop_without_shutdown();
4711        _result
4712    }
4713
4714    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4715        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
4716            (s, dirents),
4717            self.tx_id,
4718            0x3582806bf27faa0a,
4719            fidl::encoding::DynamicFlags::empty(),
4720        )
4721    }
4722}
4723
4724#[must_use = "FIDL methods require a response to be sent"]
4725#[derive(Debug)]
4726pub struct DirectoryRewindResponder {
4727    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4728    tx_id: u32,
4729}
4730
4731/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4732/// if the responder is dropped without sending a response, so that the client
4733/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4734impl std::ops::Drop for DirectoryRewindResponder {
4735    fn drop(&mut self) {
4736        self.control_handle.shutdown();
4737        // Safety: drops once, never accessed again
4738        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4739    }
4740}
4741
4742impl fdomain_client::fidl::Responder for DirectoryRewindResponder {
4743    type ControlHandle = DirectoryControlHandle;
4744
4745    fn control_handle(&self) -> &DirectoryControlHandle {
4746        &self.control_handle
4747    }
4748
4749    fn drop_without_shutdown(mut self) {
4750        // Safety: drops once, never accessed again due to mem::forget
4751        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4752        // Prevent Drop from running (which would shut down the channel)
4753        std::mem::forget(self);
4754    }
4755}
4756
4757impl DirectoryRewindResponder {
4758    /// Sends a response to the FIDL transaction.
4759    ///
4760    /// Sets the channel to shutdown if an error occurs.
4761    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4762        let _result = self.send_raw(s);
4763        if _result.is_err() {
4764            self.control_handle.shutdown();
4765        }
4766        self.drop_without_shutdown();
4767        _result
4768    }
4769
4770    /// Similar to "send" but does not shutdown the channel if an error occurs.
4771    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4772        let _result = self.send_raw(s);
4773        self.drop_without_shutdown();
4774        _result
4775    }
4776
4777    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4778        self.control_handle.inner.send::<DirectoryRewindResponse>(
4779            (s,),
4780            self.tx_id,
4781            0x16b1202af0f34c71,
4782            fidl::encoding::DynamicFlags::empty(),
4783        )
4784    }
4785}
4786
4787#[must_use = "FIDL methods require a response to be sent"]
4788#[derive(Debug)]
4789pub struct DirectoryGetTokenResponder {
4790    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4791    tx_id: u32,
4792}
4793
4794/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4795/// if the responder is dropped without sending a response, so that the client
4796/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4797impl std::ops::Drop for DirectoryGetTokenResponder {
4798    fn drop(&mut self) {
4799        self.control_handle.shutdown();
4800        // Safety: drops once, never accessed again
4801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4802    }
4803}
4804
4805impl fdomain_client::fidl::Responder for DirectoryGetTokenResponder {
4806    type ControlHandle = DirectoryControlHandle;
4807
4808    fn control_handle(&self) -> &DirectoryControlHandle {
4809        &self.control_handle
4810    }
4811
4812    fn drop_without_shutdown(mut self) {
4813        // Safety: drops once, never accessed again due to mem::forget
4814        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4815        // Prevent Drop from running (which would shut down the channel)
4816        std::mem::forget(self);
4817    }
4818}
4819
4820impl DirectoryGetTokenResponder {
4821    /// Sends a response to the FIDL transaction.
4822    ///
4823    /// Sets the channel to shutdown if an error occurs.
4824    pub fn send(
4825        self,
4826        mut s: i32,
4827        mut token: Option<fdomain_client::NullableHandle>,
4828    ) -> Result<(), fidl::Error> {
4829        let _result = self.send_raw(s, token);
4830        if _result.is_err() {
4831            self.control_handle.shutdown();
4832        }
4833        self.drop_without_shutdown();
4834        _result
4835    }
4836
4837    /// Similar to "send" but does not shutdown the channel if an error occurs.
4838    pub fn send_no_shutdown_on_err(
4839        self,
4840        mut s: i32,
4841        mut token: Option<fdomain_client::NullableHandle>,
4842    ) -> Result<(), fidl::Error> {
4843        let _result = self.send_raw(s, token);
4844        self.drop_without_shutdown();
4845        _result
4846    }
4847
4848    fn send_raw(
4849        &self,
4850        mut s: i32,
4851        mut token: Option<fdomain_client::NullableHandle>,
4852    ) -> Result<(), fidl::Error> {
4853        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
4854            (s, token),
4855            self.tx_id,
4856            0x26ae9d18763c8655,
4857            fidl::encoding::DynamicFlags::empty(),
4858        )
4859    }
4860}
4861
4862#[must_use = "FIDL methods require a response to be sent"]
4863#[derive(Debug)]
4864pub struct DirectoryLinkResponder {
4865    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4866    tx_id: u32,
4867}
4868
4869/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4870/// if the responder is dropped without sending a response, so that the client
4871/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4872impl std::ops::Drop for DirectoryLinkResponder {
4873    fn drop(&mut self) {
4874        self.control_handle.shutdown();
4875        // Safety: drops once, never accessed again
4876        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4877    }
4878}
4879
4880impl fdomain_client::fidl::Responder for DirectoryLinkResponder {
4881    type ControlHandle = DirectoryControlHandle;
4882
4883    fn control_handle(&self) -> &DirectoryControlHandle {
4884        &self.control_handle
4885    }
4886
4887    fn drop_without_shutdown(mut self) {
4888        // Safety: drops once, never accessed again due to mem::forget
4889        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4890        // Prevent Drop from running (which would shut down the channel)
4891        std::mem::forget(self);
4892    }
4893}
4894
4895impl DirectoryLinkResponder {
4896    /// Sends a response to the FIDL transaction.
4897    ///
4898    /// Sets the channel to shutdown if an error occurs.
4899    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4900        let _result = self.send_raw(s);
4901        if _result.is_err() {
4902            self.control_handle.shutdown();
4903        }
4904        self.drop_without_shutdown();
4905        _result
4906    }
4907
4908    /// Similar to "send" but does not shutdown the channel if an error occurs.
4909    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4910        let _result = self.send_raw(s);
4911        self.drop_without_shutdown();
4912        _result
4913    }
4914
4915    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4916        self.control_handle.inner.send::<DirectoryLinkResponse>(
4917            (s,),
4918            self.tx_id,
4919            0x740604c0c7c930e7,
4920            fidl::encoding::DynamicFlags::empty(),
4921        )
4922    }
4923}
4924
4925#[must_use = "FIDL methods require a response to be sent"]
4926#[derive(Debug)]
4927pub struct DirectoryUnlinkResponder {
4928    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4929    tx_id: u32,
4930}
4931
4932/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4933/// if the responder is dropped without sending a response, so that the client
4934/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4935impl std::ops::Drop for DirectoryUnlinkResponder {
4936    fn drop(&mut self) {
4937        self.control_handle.shutdown();
4938        // Safety: drops once, never accessed again
4939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4940    }
4941}
4942
4943impl fdomain_client::fidl::Responder for DirectoryUnlinkResponder {
4944    type ControlHandle = DirectoryControlHandle;
4945
4946    fn control_handle(&self) -> &DirectoryControlHandle {
4947        &self.control_handle
4948    }
4949
4950    fn drop_without_shutdown(mut self) {
4951        // Safety: drops once, never accessed again due to mem::forget
4952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4953        // Prevent Drop from running (which would shut down the channel)
4954        std::mem::forget(self);
4955    }
4956}
4957
4958impl DirectoryUnlinkResponder {
4959    /// Sends a response to the FIDL transaction.
4960    ///
4961    /// Sets the channel to shutdown if an error occurs.
4962    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4963        let _result = self.send_raw(result);
4964        if _result.is_err() {
4965            self.control_handle.shutdown();
4966        }
4967        self.drop_without_shutdown();
4968        _result
4969    }
4970
4971    /// Similar to "send" but does not shutdown the channel if an error occurs.
4972    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4973        let _result = self.send_raw(result);
4974        self.drop_without_shutdown();
4975        _result
4976    }
4977
4978    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4979        self.control_handle
4980            .inner
4981            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4982                result,
4983                self.tx_id,
4984                0x750a0326a78d7bed,
4985                fidl::encoding::DynamicFlags::empty(),
4986            )
4987    }
4988}
4989
4990#[must_use = "FIDL methods require a response to be sent"]
4991#[derive(Debug)]
4992pub struct DirectoryRenameResponder {
4993    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4994    tx_id: u32,
4995}
4996
4997/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4998/// if the responder is dropped without sending a response, so that the client
4999/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5000impl std::ops::Drop for DirectoryRenameResponder {
5001    fn drop(&mut self) {
5002        self.control_handle.shutdown();
5003        // Safety: drops once, never accessed again
5004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5005    }
5006}
5007
5008impl fdomain_client::fidl::Responder for DirectoryRenameResponder {
5009    type ControlHandle = DirectoryControlHandle;
5010
5011    fn control_handle(&self) -> &DirectoryControlHandle {
5012        &self.control_handle
5013    }
5014
5015    fn drop_without_shutdown(mut self) {
5016        // Safety: drops once, never accessed again due to mem::forget
5017        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5018        // Prevent Drop from running (which would shut down the channel)
5019        std::mem::forget(self);
5020    }
5021}
5022
5023impl DirectoryRenameResponder {
5024    /// Sends a response to the FIDL transaction.
5025    ///
5026    /// Sets the channel to shutdown if an error occurs.
5027    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5028        let _result = self.send_raw(result);
5029        if _result.is_err() {
5030            self.control_handle.shutdown();
5031        }
5032        self.drop_without_shutdown();
5033        _result
5034    }
5035
5036    /// Similar to "send" but does not shutdown the channel if an error occurs.
5037    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5038        let _result = self.send_raw(result);
5039        self.drop_without_shutdown();
5040        _result
5041    }
5042
5043    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5044        self.control_handle
5045            .inner
5046            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5047                result,
5048                self.tx_id,
5049                0x7060e7723b9928de,
5050                fidl::encoding::DynamicFlags::empty(),
5051            )
5052    }
5053}
5054
5055#[must_use = "FIDL methods require a response to be sent"]
5056#[derive(Debug)]
5057pub struct DirectoryCreateSymlinkResponder {
5058    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5059    tx_id: u32,
5060}
5061
5062/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5063/// if the responder is dropped without sending a response, so that the client
5064/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5065impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5066    fn drop(&mut self) {
5067        self.control_handle.shutdown();
5068        // Safety: drops once, never accessed again
5069        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5070    }
5071}
5072
5073impl fdomain_client::fidl::Responder for DirectoryCreateSymlinkResponder {
5074    type ControlHandle = DirectoryControlHandle;
5075
5076    fn control_handle(&self) -> &DirectoryControlHandle {
5077        &self.control_handle
5078    }
5079
5080    fn drop_without_shutdown(mut self) {
5081        // Safety: drops once, never accessed again due to mem::forget
5082        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5083        // Prevent Drop from running (which would shut down the channel)
5084        std::mem::forget(self);
5085    }
5086}
5087
5088impl DirectoryCreateSymlinkResponder {
5089    /// Sends a response to the FIDL transaction.
5090    ///
5091    /// Sets the channel to shutdown if an error occurs.
5092    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5093        let _result = self.send_raw(result);
5094        if _result.is_err() {
5095            self.control_handle.shutdown();
5096        }
5097        self.drop_without_shutdown();
5098        _result
5099    }
5100
5101    /// Similar to "send" but does not shutdown the channel if an error occurs.
5102    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5103        let _result = self.send_raw(result);
5104        self.drop_without_shutdown();
5105        _result
5106    }
5107
5108    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5109        self.control_handle
5110            .inner
5111            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5112                result,
5113                self.tx_id,
5114                0x21ce0f19ec043889,
5115                fidl::encoding::DynamicFlags::empty(),
5116            )
5117    }
5118}
5119
5120#[must_use = "FIDL methods require a response to be sent"]
5121#[derive(Debug)]
5122pub struct DirectoryWatchResponder {
5123    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5124    tx_id: u32,
5125}
5126
5127/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5128/// if the responder is dropped without sending a response, so that the client
5129/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5130impl std::ops::Drop for DirectoryWatchResponder {
5131    fn drop(&mut self) {
5132        self.control_handle.shutdown();
5133        // Safety: drops once, never accessed again
5134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5135    }
5136}
5137
5138impl fdomain_client::fidl::Responder for DirectoryWatchResponder {
5139    type ControlHandle = DirectoryControlHandle;
5140
5141    fn control_handle(&self) -> &DirectoryControlHandle {
5142        &self.control_handle
5143    }
5144
5145    fn drop_without_shutdown(mut self) {
5146        // Safety: drops once, never accessed again due to mem::forget
5147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5148        // Prevent Drop from running (which would shut down the channel)
5149        std::mem::forget(self);
5150    }
5151}
5152
5153impl DirectoryWatchResponder {
5154    /// Sends a response to the FIDL transaction.
5155    ///
5156    /// Sets the channel to shutdown if an error occurs.
5157    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5158        let _result = self.send_raw(s);
5159        if _result.is_err() {
5160            self.control_handle.shutdown();
5161        }
5162        self.drop_without_shutdown();
5163        _result
5164    }
5165
5166    /// Similar to "send" but does not shutdown the channel if an error occurs.
5167    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5168        let _result = self.send_raw(s);
5169        self.drop_without_shutdown();
5170        _result
5171    }
5172
5173    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5174        self.control_handle.inner.send::<DirectoryWatchResponse>(
5175            (s,),
5176            self.tx_id,
5177            0x5717193a59d66d91,
5178            fidl::encoding::DynamicFlags::empty(),
5179        )
5180    }
5181}
5182
5183#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5184pub struct DirectoryWatcherMarker;
5185
5186impl fdomain_client::fidl::ProtocolMarker for DirectoryWatcherMarker {
5187    type Proxy = DirectoryWatcherProxy;
5188    type RequestStream = DirectoryWatcherRequestStream;
5189
5190    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
5191}
5192
5193pub trait DirectoryWatcherProxyInterface: Send + Sync {}
5194
5195#[derive(Debug, Clone)]
5196pub struct DirectoryWatcherProxy {
5197    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5198}
5199
5200impl fdomain_client::fidl::Proxy for DirectoryWatcherProxy {
5201    type Protocol = DirectoryWatcherMarker;
5202
5203    fn from_channel(inner: fdomain_client::Channel) -> Self {
5204        Self::new(inner)
5205    }
5206
5207    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5208        self.client.into_channel().map_err(|client| Self { client })
5209    }
5210
5211    fn as_channel(&self) -> &fdomain_client::Channel {
5212        self.client.as_channel()
5213    }
5214}
5215
5216impl DirectoryWatcherProxy {
5217    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
5218    pub fn new(channel: fdomain_client::Channel) -> Self {
5219        let protocol_name =
5220            <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5221        Self { client: fidl::client::Client::new(channel, protocol_name) }
5222    }
5223
5224    /// Get a Stream of events from the remote end of the protocol.
5225    ///
5226    /// # Panics
5227    ///
5228    /// Panics if the event stream was already taken.
5229    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
5230        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
5231    }
5232}
5233
5234impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
5235
5236pub struct DirectoryWatcherEventStream {
5237    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5238}
5239
5240impl std::marker::Unpin for DirectoryWatcherEventStream {}
5241
5242impl futures::stream::FusedStream for DirectoryWatcherEventStream {
5243    fn is_terminated(&self) -> bool {
5244        self.event_receiver.is_terminated()
5245    }
5246}
5247
5248impl futures::Stream for DirectoryWatcherEventStream {
5249    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
5250
5251    fn poll_next(
5252        mut self: std::pin::Pin<&mut Self>,
5253        cx: &mut std::task::Context<'_>,
5254    ) -> std::task::Poll<Option<Self::Item>> {
5255        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5256            &mut self.event_receiver,
5257            cx
5258        )?) {
5259            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
5260            None => std::task::Poll::Ready(None),
5261        }
5262    }
5263}
5264
5265#[derive(Debug)]
5266pub enum DirectoryWatcherEvent {}
5267
5268impl DirectoryWatcherEvent {
5269    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
5270    fn decode(
5271        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5272    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
5273        let (bytes, _handles) = buf.split_mut();
5274        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5275        debug_assert_eq!(tx_header.tx_id, 0);
5276        match tx_header.ordinal {
5277            _ => Err(fidl::Error::UnknownOrdinal {
5278                ordinal: tx_header.ordinal,
5279                protocol_name:
5280                    <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5281            }),
5282        }
5283    }
5284}
5285
5286/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
5287pub struct DirectoryWatcherRequestStream {
5288    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5289    is_terminated: bool,
5290}
5291
5292impl std::marker::Unpin for DirectoryWatcherRequestStream {}
5293
5294impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
5295    fn is_terminated(&self) -> bool {
5296        self.is_terminated
5297    }
5298}
5299
5300impl fdomain_client::fidl::RequestStream for DirectoryWatcherRequestStream {
5301    type Protocol = DirectoryWatcherMarker;
5302    type ControlHandle = DirectoryWatcherControlHandle;
5303
5304    fn from_channel(channel: fdomain_client::Channel) -> Self {
5305        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5306    }
5307
5308    fn control_handle(&self) -> Self::ControlHandle {
5309        DirectoryWatcherControlHandle { inner: self.inner.clone() }
5310    }
5311
5312    fn into_inner(
5313        self,
5314    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5315    {
5316        (self.inner, self.is_terminated)
5317    }
5318
5319    fn from_inner(
5320        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5321        is_terminated: bool,
5322    ) -> Self {
5323        Self { inner, is_terminated }
5324    }
5325}
5326
5327impl futures::Stream for DirectoryWatcherRequestStream {
5328    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
5329
5330    fn poll_next(
5331        mut self: std::pin::Pin<&mut Self>,
5332        cx: &mut std::task::Context<'_>,
5333    ) -> std::task::Poll<Option<Self::Item>> {
5334        let this = &mut *self;
5335        if this.inner.check_shutdown(cx) {
5336            this.is_terminated = true;
5337            return std::task::Poll::Ready(None);
5338        }
5339        if this.is_terminated {
5340            panic!("polled DirectoryWatcherRequestStream after completion");
5341        }
5342        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5343            |bytes, handles| {
5344                match this.inner.channel().read_etc(cx, bytes, handles) {
5345                    std::task::Poll::Ready(Ok(())) => {}
5346                    std::task::Poll::Pending => return std::task::Poll::Pending,
5347                    std::task::Poll::Ready(Err(None)) => {
5348                        this.is_terminated = true;
5349                        return std::task::Poll::Ready(None);
5350                    }
5351                    std::task::Poll::Ready(Err(Some(e))) => {
5352                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5353                            e.into(),
5354                        ))));
5355                    }
5356                }
5357
5358                // A message has been received from the channel
5359                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5360
5361                std::task::Poll::Ready(Some(match header.ordinal {
5362                _ => Err(fidl::Error::UnknownOrdinal {
5363                    ordinal: header.ordinal,
5364                    protocol_name: <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5365                }),
5366            }))
5367            },
5368        )
5369    }
5370}
5371
5372/// DirectoryWatcher transmits messages from a filesystem server
5373/// about events happening in the filesystem. Clients can register
5374/// new watchers using the `Directory.Watch` method, where they can
5375/// filter which events they want to receive notifications for.
5376///
5377/// The DirectoryWatcher will send messages of the form:
5378/// ```
5379/// struct {
5380///   uint8 event;
5381///   uint8 len;
5382///   char name[];
5383/// };
5384/// ```
5385/// Where names are NOT null-terminated. The name is the relative
5386/// path to the entry the event is refering to. It will be empty if
5387/// the event isn't referencing a particular entry (e.g. for the
5388/// `IDLE` event).
5389#[derive(Debug)]
5390pub enum DirectoryWatcherRequest {}
5391
5392impl DirectoryWatcherRequest {
5393    /// Name of the method defined in FIDL
5394    pub fn method_name(&self) -> &'static str {
5395        match *self {}
5396    }
5397}
5398
5399#[derive(Debug, Clone)]
5400pub struct DirectoryWatcherControlHandle {
5401    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5402}
5403
5404impl DirectoryWatcherControlHandle {
5405    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5406        self.inner.shutdown_with_epitaph(status.into())
5407    }
5408}
5409
5410impl fdomain_client::fidl::ControlHandle for DirectoryWatcherControlHandle {
5411    fn shutdown(&self) {
5412        self.inner.shutdown()
5413    }
5414
5415    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5416        self.inner.shutdown_with_epitaph(status)
5417    }
5418
5419    fn is_closed(&self) -> bool {
5420        self.inner.channel().is_closed()
5421    }
5422    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5423        self.inner.channel().on_closed()
5424    }
5425}
5426
5427impl DirectoryWatcherControlHandle {}
5428
5429#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5430pub struct ExtendedAttributeIteratorMarker;
5431
5432impl fdomain_client::fidl::ProtocolMarker for ExtendedAttributeIteratorMarker {
5433    type Proxy = ExtendedAttributeIteratorProxy;
5434    type RequestStream = ExtendedAttributeIteratorRequestStream;
5435
5436    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
5437}
5438pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
5439
5440pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
5441    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
5442        + Send;
5443    fn r#get_next(&self) -> Self::GetNextResponseFut;
5444}
5445
5446#[derive(Debug, Clone)]
5447pub struct ExtendedAttributeIteratorProxy {
5448    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5449}
5450
5451impl fdomain_client::fidl::Proxy for ExtendedAttributeIteratorProxy {
5452    type Protocol = ExtendedAttributeIteratorMarker;
5453
5454    fn from_channel(inner: fdomain_client::Channel) -> Self {
5455        Self::new(inner)
5456    }
5457
5458    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5459        self.client.into_channel().map_err(|client| Self { client })
5460    }
5461
5462    fn as_channel(&self) -> &fdomain_client::Channel {
5463        self.client.as_channel()
5464    }
5465}
5466
5467impl ExtendedAttributeIteratorProxy {
5468    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
5469    pub fn new(channel: fdomain_client::Channel) -> Self {
5470        let protocol_name =
5471            <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5472        Self { client: fidl::client::Client::new(channel, protocol_name) }
5473    }
5474
5475    /// Get a Stream of events from the remote end of the protocol.
5476    ///
5477    /// # Panics
5478    ///
5479    /// Panics if the event stream was already taken.
5480    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
5481        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5482    }
5483
5484    /// Get the next chunk of extended attribute names. If this is the last
5485    /// chunk, last will be true, and the channel will be closed after the
5486    /// call.
5487    pub fn r#get_next(
5488        &self,
5489    ) -> fidl::client::QueryResponseFut<
5490        ExtendedAttributeIteratorGetNextResult,
5491        fdomain_client::fidl::FDomainResourceDialect,
5492    > {
5493        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
5494    }
5495}
5496
5497impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
5498    type GetNextResponseFut = fidl::client::QueryResponseFut<
5499        ExtendedAttributeIteratorGetNextResult,
5500        fdomain_client::fidl::FDomainResourceDialect,
5501    >;
5502    fn r#get_next(&self) -> Self::GetNextResponseFut {
5503        fn _decode(
5504            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5505        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
5506            let _response = fidl::client::decode_transaction_body::<
5507                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
5508                fdomain_client::fidl::FDomainResourceDialect,
5509                0x3ba664a1c2e45a7,
5510            >(_buf?)?;
5511            Ok(_response.map(|x| (x.attributes, x.last)))
5512        }
5513        self.client.send_query_and_decode::<
5514            fidl::encoding::EmptyPayload,
5515            ExtendedAttributeIteratorGetNextResult,
5516        >(
5517            (),
5518            0x3ba664a1c2e45a7,
5519            fidl::encoding::DynamicFlags::empty(),
5520            _decode,
5521        )
5522    }
5523}
5524
5525pub struct ExtendedAttributeIteratorEventStream {
5526    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5527}
5528
5529impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
5530
5531impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
5532    fn is_terminated(&self) -> bool {
5533        self.event_receiver.is_terminated()
5534    }
5535}
5536
5537impl futures::Stream for ExtendedAttributeIteratorEventStream {
5538    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
5539
5540    fn poll_next(
5541        mut self: std::pin::Pin<&mut Self>,
5542        cx: &mut std::task::Context<'_>,
5543    ) -> std::task::Poll<Option<Self::Item>> {
5544        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5545            &mut self.event_receiver,
5546            cx
5547        )?) {
5548            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
5549            None => std::task::Poll::Ready(None),
5550        }
5551    }
5552}
5553
5554#[derive(Debug)]
5555pub enum ExtendedAttributeIteratorEvent {}
5556
5557impl ExtendedAttributeIteratorEvent {
5558    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
5559    fn decode(
5560        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5561    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
5562        let (bytes, _handles) = buf.split_mut();
5563        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5564        debug_assert_eq!(tx_header.tx_id, 0);
5565        match tx_header.ordinal {
5566            _ => Err(fidl::Error::UnknownOrdinal {
5567                ordinal: tx_header.ordinal,
5568                protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5569            })
5570        }
5571    }
5572}
5573
5574/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
5575pub struct ExtendedAttributeIteratorRequestStream {
5576    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5577    is_terminated: bool,
5578}
5579
5580impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
5581
5582impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
5583    fn is_terminated(&self) -> bool {
5584        self.is_terminated
5585    }
5586}
5587
5588impl fdomain_client::fidl::RequestStream for ExtendedAttributeIteratorRequestStream {
5589    type Protocol = ExtendedAttributeIteratorMarker;
5590    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5591
5592    fn from_channel(channel: fdomain_client::Channel) -> Self {
5593        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5594    }
5595
5596    fn control_handle(&self) -> Self::ControlHandle {
5597        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
5598    }
5599
5600    fn into_inner(
5601        self,
5602    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5603    {
5604        (self.inner, self.is_terminated)
5605    }
5606
5607    fn from_inner(
5608        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5609        is_terminated: bool,
5610    ) -> Self {
5611        Self { inner, is_terminated }
5612    }
5613}
5614
5615impl futures::Stream for ExtendedAttributeIteratorRequestStream {
5616    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
5617
5618    fn poll_next(
5619        mut self: std::pin::Pin<&mut Self>,
5620        cx: &mut std::task::Context<'_>,
5621    ) -> std::task::Poll<Option<Self::Item>> {
5622        let this = &mut *self;
5623        if this.inner.check_shutdown(cx) {
5624            this.is_terminated = true;
5625            return std::task::Poll::Ready(None);
5626        }
5627        if this.is_terminated {
5628            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
5629        }
5630        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5631            |bytes, handles| {
5632                match this.inner.channel().read_etc(cx, bytes, handles) {
5633                    std::task::Poll::Ready(Ok(())) => {}
5634                    std::task::Poll::Pending => return std::task::Poll::Pending,
5635                    std::task::Poll::Ready(Err(None)) => {
5636                        this.is_terminated = true;
5637                        return std::task::Poll::Ready(None);
5638                    }
5639                    std::task::Poll::Ready(Err(Some(e))) => {
5640                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5641                            e.into(),
5642                        ))));
5643                    }
5644                }
5645
5646                // A message has been received from the channel
5647                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5648
5649                std::task::Poll::Ready(Some(match header.ordinal {
5650                0x3ba664a1c2e45a7 => {
5651                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5652                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
5653                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5654                    let control_handle = ExtendedAttributeIteratorControlHandle {
5655                        inner: this.inner.clone(),
5656                    };
5657                    Ok(ExtendedAttributeIteratorRequest::GetNext {
5658                        responder: ExtendedAttributeIteratorGetNextResponder {
5659                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5660                            tx_id: header.tx_id,
5661                        },
5662                    })
5663                }
5664                _ => Err(fidl::Error::UnknownOrdinal {
5665                    ordinal: header.ordinal,
5666                    protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5667                }),
5668            }))
5669            },
5670        )
5671    }
5672}
5673
5674#[derive(Debug)]
5675pub enum ExtendedAttributeIteratorRequest {
5676    /// Get the next chunk of extended attribute names. If this is the last
5677    /// chunk, last will be true, and the channel will be closed after the
5678    /// call.
5679    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
5680}
5681
5682impl ExtendedAttributeIteratorRequest {
5683    #[allow(irrefutable_let_patterns)]
5684    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
5685        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
5686            Some((responder))
5687        } else {
5688            None
5689        }
5690    }
5691
5692    /// Name of the method defined in FIDL
5693    pub fn method_name(&self) -> &'static str {
5694        match *self {
5695            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
5696        }
5697    }
5698}
5699
5700#[derive(Debug, Clone)]
5701pub struct ExtendedAttributeIteratorControlHandle {
5702    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5703}
5704
5705impl ExtendedAttributeIteratorControlHandle {
5706    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5707        self.inner.shutdown_with_epitaph(status.into())
5708    }
5709}
5710
5711impl fdomain_client::fidl::ControlHandle for ExtendedAttributeIteratorControlHandle {
5712    fn shutdown(&self) {
5713        self.inner.shutdown()
5714    }
5715
5716    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5717        self.inner.shutdown_with_epitaph(status)
5718    }
5719
5720    fn is_closed(&self) -> bool {
5721        self.inner.channel().is_closed()
5722    }
5723    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5724        self.inner.channel().on_closed()
5725    }
5726}
5727
5728impl ExtendedAttributeIteratorControlHandle {}
5729
5730#[must_use = "FIDL methods require a response to be sent"]
5731#[derive(Debug)]
5732pub struct ExtendedAttributeIteratorGetNextResponder {
5733    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
5734    tx_id: u32,
5735}
5736
5737/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
5738/// if the responder is dropped without sending a response, so that the client
5739/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5740impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
5741    fn drop(&mut self) {
5742        self.control_handle.shutdown();
5743        // Safety: drops once, never accessed again
5744        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5745    }
5746}
5747
5748impl fdomain_client::fidl::Responder for ExtendedAttributeIteratorGetNextResponder {
5749    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5750
5751    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
5752        &self.control_handle
5753    }
5754
5755    fn drop_without_shutdown(mut self) {
5756        // Safety: drops once, never accessed again due to mem::forget
5757        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5758        // Prevent Drop from running (which would shut down the channel)
5759        std::mem::forget(self);
5760    }
5761}
5762
5763impl ExtendedAttributeIteratorGetNextResponder {
5764    /// Sends a response to the FIDL transaction.
5765    ///
5766    /// Sets the channel to shutdown if an error occurs.
5767    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5768        let _result = self.send_raw(result);
5769        if _result.is_err() {
5770            self.control_handle.shutdown();
5771        }
5772        self.drop_without_shutdown();
5773        _result
5774    }
5775
5776    /// Similar to "send" but does not shutdown the channel if an error occurs.
5777    pub fn send_no_shutdown_on_err(
5778        self,
5779        mut result: Result<(&[Vec<u8>], bool), i32>,
5780    ) -> Result<(), fidl::Error> {
5781        let _result = self.send_raw(result);
5782        self.drop_without_shutdown();
5783        _result
5784    }
5785
5786    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5787        self.control_handle.inner.send::<fidl::encoding::ResultType<
5788            ExtendedAttributeIteratorGetNextResponse,
5789            i32,
5790        >>(
5791            result,
5792            self.tx_id,
5793            0x3ba664a1c2e45a7,
5794            fidl::encoding::DynamicFlags::empty(),
5795        )
5796    }
5797}
5798
5799#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5800pub struct FileMarker;
5801
5802impl fdomain_client::fidl::ProtocolMarker for FileMarker {
5803    type Proxy = FileProxy;
5804    type RequestStream = FileRequestStream;
5805
5806    const DEBUG_NAME: &'static str = "fuchsia.io.File";
5807}
5808impl fdomain_client::fidl::DiscoverableProtocolMarker for FileMarker {}
5809pub type FileSeekResult = Result<u64, i32>;
5810pub type FileReadAtResult = Result<Vec<u8>, i32>;
5811pub type FileWriteAtResult = Result<u64, i32>;
5812pub type FileResizeResult = Result<(), i32>;
5813pub type FileGetBackingMemoryResult = Result<fdomain_client::Vmo, i32>;
5814pub type FileAllocateResult = Result<(), i32>;
5815pub type FileEnableVerityResult = Result<(), i32>;
5816
5817pub trait FileProxyInterface: Send + Sync {
5818    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
5819        + Send;
5820    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
5821    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
5822        + Send;
5823    fn r#link_into(
5824        &self,
5825        dst_parent_token: fdomain_client::Event,
5826        dst: &str,
5827    ) -> Self::LinkIntoResponseFut;
5828    fn r#clone(
5829        &self,
5830        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5831    ) -> Result<(), fidl::Error>;
5832    type CloseResponseFut: std::future::Future<
5833            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
5834        > + Send;
5835    fn r#close(&self) -> Self::CloseResponseFut;
5836    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
5837    fn r#query(&self) -> Self::QueryResponseFut;
5838    fn r#deprecated_clone(
5839        &self,
5840        flags: OpenFlags,
5841        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
5842    ) -> Result<(), fidl::Error>;
5843    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
5844        + Send;
5845    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
5846    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
5847    fn r#deprecated_set_attr(
5848        &self,
5849        flags: NodeAttributeFlags,
5850        attributes: &NodeAttributes,
5851    ) -> Self::DeprecatedSetAttrResponseFut;
5852    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
5853        + Send;
5854    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
5855    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
5856        + Send;
5857    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
5858    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
5859        + Send;
5860    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
5861    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
5862        + Send;
5863    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
5864    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
5865        + Send;
5866    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
5867    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
5868        + Send;
5869    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
5870    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
5871        + Send;
5872    fn r#update_attributes(
5873        &self,
5874        payload: &MutableNodeAttributes,
5875    ) -> Self::UpdateAttributesResponseFut;
5876    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
5877    fn r#sync(&self) -> Self::SyncResponseFut;
5878    fn r#list_extended_attributes(
5879        &self,
5880        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
5881    ) -> Result<(), fidl::Error>;
5882    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
5883        + Send;
5884    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
5885    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
5886        + Send;
5887    fn r#set_extended_attribute(
5888        &self,
5889        name: &[u8],
5890        value: ExtendedAttributeValue,
5891        mode: SetExtendedAttributeMode,
5892    ) -> Self::SetExtendedAttributeResponseFut;
5893    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
5894        + Send;
5895    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
5896    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
5897        + Send;
5898    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
5899    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
5900        + Send;
5901    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
5902    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
5903    fn r#describe(&self) -> Self::DescribeResponseFut;
5904    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
5905    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
5906    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
5907        + Send;
5908    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
5909    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
5910        + Send;
5911    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
5912    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
5913        + Send;
5914    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
5915    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
5916        + Send;
5917    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
5918    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
5919        + Send;
5920    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
5921    -> Self::AllocateResponseFut;
5922    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
5923        + Send;
5924    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
5925}
5926
5927#[derive(Debug, Clone)]
5928pub struct FileProxy {
5929    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5930}
5931
5932impl fdomain_client::fidl::Proxy for FileProxy {
5933    type Protocol = FileMarker;
5934
5935    fn from_channel(inner: fdomain_client::Channel) -> Self {
5936        Self::new(inner)
5937    }
5938
5939    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5940        self.client.into_channel().map_err(|client| Self { client })
5941    }
5942
5943    fn as_channel(&self) -> &fdomain_client::Channel {
5944        self.client.as_channel()
5945    }
5946}
5947
5948impl FileProxy {
5949    /// Create a new Proxy for fuchsia.io/File.
5950    pub fn new(channel: fdomain_client::Channel) -> Self {
5951        let protocol_name = <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5952        Self { client: fidl::client::Client::new(channel, protocol_name) }
5953    }
5954
5955    /// Get a Stream of events from the remote end of the protocol.
5956    ///
5957    /// # Panics
5958    ///
5959    /// Panics if the event stream was already taken.
5960    pub fn take_event_stream(&self) -> FileEventStream {
5961        FileEventStream { event_receiver: self.client.take_event_receiver() }
5962    }
5963
5964    /// Acquires an advisory lock on the underlying file.
5965    ///
5966    /// The lock lasts until either this connection is closed or
5967    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
5968    /// explicitly.
5969    ///
5970    /// Advisory locks are purely advisory. They do not prevent actual read or
5971    /// write operations from occurring on the file, either through this
5972    /// connection or through other connections.
5973    ///
5974    /// This method requires the following rights:
5975    ///
5976    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
5977    /// * [`Rights.WRITE_BYTES`] if `request.type` is
5978    ///   [`AdvisoryLockType.WRITE`].
5979    ///
5980    /// # Errors
5981    ///
5982    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
5983    ///   example, another connection might hold a conflicting lock type.
5984    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
5985    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
5986    ///   to acquire the given type of lock.
5987    pub fn r#advisory_lock(
5988        &self,
5989        mut request: &AdvisoryLockRequest,
5990    ) -> fidl::client::QueryResponseFut<
5991        AdvisoryLockingAdvisoryLockResult,
5992        fdomain_client::fidl::FDomainResourceDialect,
5993    > {
5994        FileProxyInterface::r#advisory_lock(self, request)
5995    }
5996
5997    /// Creates a link to this this object with name `dst` in the directory represented by
5998    /// `dst_parent_token`.
5999    ///
6000    /// `dst` must be a resolved object name. Including "/" in the string will return
6001    /// `ZX_ERR_INVALID_ARGS`.
6002    ///
6003    /// This method requires the maximal set of rights supported by the filesystem for this object.
6004    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
6005    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
6006    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
6007    /// `ZX_ERR_ACCESS_DENIED`.
6008    ///
6009    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
6010    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
6011    ///
6012    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
6013    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
6014    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
6015    ///
6016    /// This method does not have the same atomicity properties has the `Directory::Link` method,
6017    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
6018    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
6019    pub fn r#link_into(
6020        &self,
6021        mut dst_parent_token: fdomain_client::Event,
6022        mut dst: &str,
6023    ) -> fidl::client::QueryResponseFut<
6024        LinkableLinkIntoResult,
6025        fdomain_client::fidl::FDomainResourceDialect,
6026    > {
6027        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
6028    }
6029
6030    pub fn r#clone(
6031        &self,
6032        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6033    ) -> Result<(), fidl::Error> {
6034        FileProxyInterface::r#clone(self, request)
6035    }
6036
6037    /// Terminates the connection.
6038    ///
6039    /// After calling `Close`, the client must not send any other requests.
6040    ///
6041    /// Servers, after sending the status response, should close the connection
6042    /// regardless of status and without sending an epitaph.
6043    ///
6044    /// Closing the client end of the channel should be semantically equivalent
6045    /// to calling `Close` without knowing when the close has completed or its
6046    /// status.
6047    pub fn r#close(
6048        &self,
6049    ) -> fidl::client::QueryResponseFut<
6050        fdomain_fuchsia_unknown::CloseableCloseResult,
6051        fdomain_client::fidl::FDomainResourceDialect,
6052    > {
6053        FileProxyInterface::r#close(self)
6054    }
6055
6056    pub fn r#query(
6057        &self,
6058    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
6059        FileProxyInterface::r#query(self)
6060    }
6061
6062    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
6063    pub fn r#deprecated_clone(
6064        &self,
6065        mut flags: OpenFlags,
6066        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6067    ) -> Result<(), fidl::Error> {
6068        FileProxyInterface::r#deprecated_clone(self, flags, object)
6069    }
6070
6071    /// DEPRECATED - Use `Node.GetAttributes` instead.
6072    ///
6073    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6074    pub fn r#deprecated_get_attr(
6075        &self,
6076    ) -> fidl::client::QueryResponseFut<
6077        (i32, NodeAttributes),
6078        fdomain_client::fidl::FDomainResourceDialect,
6079    > {
6080        FileProxyInterface::r#deprecated_get_attr(self)
6081    }
6082
6083    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
6084    pub fn r#deprecated_set_attr(
6085        &self,
6086        mut flags: NodeAttributeFlags,
6087        mut attributes: &NodeAttributes,
6088    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6089        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
6090    }
6091
6092    /// [DEPRECATED - Use new GetFlags method instead.]
6093    pub fn r#deprecated_get_flags(
6094        &self,
6095    ) -> fidl::client::QueryResponseFut<
6096        (i32, OpenFlags),
6097        fdomain_client::fidl::FDomainResourceDialect,
6098    > {
6099        FileProxyInterface::r#deprecated_get_flags(self)
6100    }
6101
6102    /// [DEPRECATED - Use new SetFlags method instead.]
6103    pub fn r#deprecated_set_flags(
6104        &self,
6105        mut flags: OpenFlags,
6106    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6107        FileProxyInterface::r#deprecated_set_flags(self, flags)
6108    }
6109
6110    /// Queries the flags that apply to this node after it has been opened/created. This method does
6111    /// not require any rights.
6112    ///
6113    /// Note that the final set of flags that apply to the connection may differ from those
6114    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
6115    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
6116    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
6117    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
6118    pub fn r#get_flags(
6119        &self,
6120    ) -> fidl::client::QueryResponseFut<
6121        NodeGetFlagsResult,
6122        fdomain_client::fidl::FDomainResourceDialect,
6123    > {
6124        FileProxyInterface::r#get_flags(self)
6125    }
6126
6127    /// Sets the flags that apply to this node after it has been opened. This method does not
6128    /// require any rights.
6129    ///
6130    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
6131    /// clear append mode.
6132    ///
6133    /// Errors:
6134    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
6135    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
6136    pub fn r#set_flags(
6137        &self,
6138        mut flags: Flags,
6139    ) -> fidl::client::QueryResponseFut<
6140        NodeSetFlagsResult,
6141        fdomain_client::fidl::FDomainResourceDialect,
6142    > {
6143        FileProxyInterface::r#set_flags(self, flags)
6144    }
6145
6146    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
6147    /// volume has different settings or the storage is accounted seperately from the rest of the
6148    /// filesystem that may be reported instead of filesystem-wide details.
6149    pub fn r#query_filesystem(
6150        &self,
6151    ) -> fidl::client::QueryResponseFut<
6152        (i32, Option<Box<FilesystemInfo>>),
6153        fdomain_client::fidl::FDomainResourceDialect,
6154    > {
6155        FileProxyInterface::r#query_filesystem(self)
6156    }
6157
6158    /// Acquires information about the node.
6159    ///
6160    /// The attributes of a node should be stable, independent of the
6161    /// specific protocol used to access it.
6162    ///
6163    /// If a particular attribute is not applicable or not supported,
6164    /// filesystems should leave the corresponding field absent.
6165    ///
6166    /// + `query` a bit-mask specifying which attributes to fetch. The server
6167    ///   should not return more than necessary.
6168    /// - `attributes` the returned attributes.
6169    ///
6170    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6171    pub fn r#get_attributes(
6172        &self,
6173        mut query: NodeAttributesQuery,
6174    ) -> fidl::client::QueryResponseFut<
6175        NodeGetAttributesResult,
6176        fdomain_client::fidl::FDomainResourceDialect,
6177    > {
6178        FileProxyInterface::r#get_attributes(self, query)
6179    }
6180
6181    /// Updates information about the node.
6182    ///
6183    /// + `attributes` the presence of a table field in `attributes` indicates
6184    /// the intent to update the corresponding attribute.
6185    ///
6186    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
6187    ///
6188    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6189    pub fn r#update_attributes(
6190        &self,
6191        mut payload: &MutableNodeAttributes,
6192    ) -> fidl::client::QueryResponseFut<
6193        NodeUpdateAttributesResult,
6194        fdomain_client::fidl::FDomainResourceDialect,
6195    > {
6196        FileProxyInterface::r#update_attributes(self, payload)
6197    }
6198
6199    /// Synchronizes updates to the node to the underlying media, if it exists.
6200    ///
6201    /// This method will return when the filesystem server has flushed the
6202    /// relevant updates to the underlying media, but does not guarantee the
6203    /// underlying media has persisted the information, nor that any information
6204    /// is committed to hardware. Clients may use `Sync` to ensure ordering
6205    /// between operations.
6206    ///
6207    /// This method does not require any rights.
6208    pub fn r#sync(
6209        &self,
6210    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
6211    {
6212        FileProxyInterface::r#sync(self)
6213    }
6214
6215    /// Creates an iterator over all the extended attribute names associated
6216    /// with this node. If an error occurs it is returned as an epitaph on the
6217    /// iterator request channel, and then the channel is closed.
6218    ///
6219    /// GetExtendedAttributes can be used with any of these names to retrieve
6220    /// the associated value.
6221    ///
6222    /// This method requires the [`Rights.READ_BYTES`] right.
6223    pub fn r#list_extended_attributes(
6224        &self,
6225        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6226    ) -> Result<(), fidl::Error> {
6227        FileProxyInterface::r#list_extended_attributes(self, iterator)
6228    }
6229
6230    /// Get the value associated with the given attribute `name` for this node.
6231    ///
6232    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
6233    /// particular structure is imposed on them.
6234    ///
6235    /// This method requires the [`Rights.READ_BYTES`] right.
6236    pub fn r#get_extended_attribute(
6237        &self,
6238        mut name: &[u8],
6239    ) -> fidl::client::QueryResponseFut<
6240        NodeGetExtendedAttributeResult,
6241        fdomain_client::fidl::FDomainResourceDialect,
6242    > {
6243        FileProxyInterface::r#get_extended_attribute(self, name)
6244    }
6245
6246    /// Set the value for the given attribute `name` to `value` for this node.
6247    ///
6248    /// The attribute name may exist, in which case the attribute is updated.
6249    /// If the attribute doesn't exist, it is created. The name should have no
6250    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
6251    ///
6252    /// This method requires the [`Rights.WRITE_BYTES`] right.
6253    pub fn r#set_extended_attribute(
6254        &self,
6255        mut name: &[u8],
6256        mut value: ExtendedAttributeValue,
6257        mut mode: SetExtendedAttributeMode,
6258    ) -> fidl::client::QueryResponseFut<
6259        NodeSetExtendedAttributeResult,
6260        fdomain_client::fidl::FDomainResourceDialect,
6261    > {
6262        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
6263    }
6264
6265    /// Remove the specified extended attribute.
6266    ///
6267    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
6268    ///
6269    /// This method requires the [`Rights.WRITE_BYTES`] right.
6270    pub fn r#remove_extended_attribute(
6271        &self,
6272        mut name: &[u8],
6273    ) -> fidl::client::QueryResponseFut<
6274        NodeRemoveExtendedAttributeResult,
6275        fdomain_client::fidl::FDomainResourceDialect,
6276    > {
6277        FileProxyInterface::r#remove_extended_attribute(self, name)
6278    }
6279
6280    /// Reads up to 'count' bytes at the seek offset.
6281    /// The seek offset is moved forward by the number of bytes read.
6282    ///
6283    /// ## Invariants
6284    ///
6285    /// * The returned `data.length` will never be greater than `count`.
6286    /// * If `data.length` is less than `count`, it means that the seek offset
6287    ///   has reached the end of file as part of this operation.
6288    /// * If `data.length` is zero while `count` is not, it means that the
6289    ///   seek offset is already at or beyond the end of file, and no data could
6290    ///   be read.
6291    /// * If `count` is zero, the server should perform all the checks ensuring
6292    ///   read access without actually read anything, and return an empty
6293    ///   `data` vector.
6294    ///
6295    /// This method requires the [`Rights.READ_BYTES`] right.
6296    ///
6297    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6298    pub fn r#read(
6299        &self,
6300        mut count: u64,
6301    ) -> fidl::client::QueryResponseFut<
6302        ReadableReadResult,
6303        fdomain_client::fidl::FDomainResourceDialect,
6304    > {
6305        FileProxyInterface::r#read(self, count)
6306    }
6307
6308    /// Writes data at the seek offset.
6309    /// The seek offset is moved forward by the number of bytes written.
6310    /// If the file is in append mode, the seek offset is first set to the end
6311    /// of the file, followed by the write, in one atomic step.
6312    ///
6313    /// The file size may grow if the seek offset plus `data.length` is beyond
6314    /// the current end of file.
6315    ///
6316    /// + request `data` the byte buffer to write to the file.
6317    /// - response `actual_count` the number of bytes written.
6318    ///
6319    /// ## Invariants
6320    ///
6321    /// * The returned `actual_count` will never be greater than `data.length`.
6322    /// * If the server is unable to write all the data due to e.g. not enough
6323    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6324    ///   could be written, an error is returned.
6325    /// * If `data.length` is zero, the server should perform all the checks
6326    ///   ensuring write access without mutating the file and return a
6327    ///   successful write of zero bytes.  The seek offset is still updated if
6328    ///   in append mode.
6329    ///
6330    /// This method requires the [`Rights.WRITE_BYTES`] right.
6331    pub fn r#write(
6332        &self,
6333        mut data: &[u8],
6334    ) -> fidl::client::QueryResponseFut<
6335        WritableWriteResult,
6336        fdomain_client::fidl::FDomainResourceDialect,
6337    > {
6338        FileProxyInterface::r#write(self, data)
6339    }
6340
6341    pub fn r#describe(
6342        &self,
6343    ) -> fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
6344    {
6345        FileProxyInterface::r#describe(self)
6346    }
6347
6348    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
6349    /// will occur. The seek offset is specific to each file connection.
6350    ///
6351    /// + request `origin` the reference point where `offset` will be based on.
6352    /// + request `offset` the number of bytes to seek.
6353    /// - response `offset_from_start` the adjusted seek offset, from the start
6354    ///   of the file.
6355    ///
6356    /// This method does not require any rights.
6357    pub fn r#seek(
6358        &self,
6359        mut origin: SeekOrigin,
6360        mut offset: i64,
6361    ) -> fidl::client::QueryResponseFut<FileSeekResult, fdomain_client::fidl::FDomainResourceDialect>
6362    {
6363        FileProxyInterface::r#seek(self, origin, offset)
6364    }
6365
6366    /// Reads up to 'count' bytes at the provided offset.
6367    /// Does not affect the seek offset.
6368    ///
6369    /// ## Invariants
6370    ///
6371    /// * The returned `data.length` will never be greater than `count`.
6372    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
6373    ///   the end of file as part of this operation.
6374    /// * If `data.length` is zero while `count` is not, it means that `offset`
6375    ///   is at or past the end of file, and no data can be read.
6376    /// * If `count` is zero, the server should perform all the checks ensuring
6377    ///   read access without actually reading anything, and return an empty
6378    ///   `data` vector.
6379    ///
6380    /// This method requires the [`Rights.READ_BYTES`] right.
6381    ///
6382    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6383    pub fn r#read_at(
6384        &self,
6385        mut count: u64,
6386        mut offset: u64,
6387    ) -> fidl::client::QueryResponseFut<
6388        FileReadAtResult,
6389        fdomain_client::fidl::FDomainResourceDialect,
6390    > {
6391        FileProxyInterface::r#read_at(self, count, offset)
6392    }
6393
6394    /// Writes data at the provided offset.
6395    /// Does not affect the seek offset.
6396    ///
6397    /// The file size may grow if `offset` plus `data.length` is past the
6398    /// current end of file.
6399    ///
6400    /// + request `data` the byte buffer to write to the file.
6401    /// + request `offset` the offset from start of the file to begin writing.
6402    /// - response `actual_count` the number of bytes written.
6403    ///
6404    /// ## Invariants
6405    ///
6406    /// * The returned `actual_count` will never be greater than `data.length`.
6407    /// * If the server is unable to write all the data due to e.g. not enough
6408    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6409    ///   could be written, an error is returned.
6410    /// * If `data.length` is zero, the server should perform all the checks
6411    ///   ensuring write access without mutating the file, and will return a
6412    ///   successful write of zero bytes.
6413    ///
6414    /// This method requires the [`Rights.WRITE_BYTES`] right.
6415    pub fn r#write_at(
6416        &self,
6417        mut data: &[u8],
6418        mut offset: u64,
6419    ) -> fidl::client::QueryResponseFut<
6420        FileWriteAtResult,
6421        fdomain_client::fidl::FDomainResourceDialect,
6422    > {
6423        FileProxyInterface::r#write_at(self, data, offset)
6424    }
6425
6426    /// Shrinks or grows the file size to 'length' bytes.
6427    ///
6428    /// If file size is reduced by this operation, the extra trailing data'
6429    /// is discarded.
6430    /// If file size is increased by this operation, the extended area appears
6431    /// as if it was zeroed.
6432    ///
6433    /// This method requires the [`Rights.WRITE_BYTES`] right.
6434    pub fn r#resize(
6435        &self,
6436        mut length: u64,
6437    ) -> fidl::client::QueryResponseFut<
6438        FileResizeResult,
6439        fdomain_client::fidl::FDomainResourceDialect,
6440    > {
6441        FileProxyInterface::r#resize(self, length)
6442    }
6443
6444    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
6445    /// with the requested access rights.
6446    ///
6447    /// Implementations are not required to implement files backed by VMOs so
6448    /// this request may fail. Additionally, implementations may only support
6449    /// a certain subset of the flags. Clients should be prepared with fallback
6450    /// behavior if this request fails.
6451    ///
6452    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
6453    /// implementation is free to choose the semantics of the returned VMO.
6454    ///
6455    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
6456    /// - response `vmo` the requested [`zx.Handle:VMO`].
6457    /// * error a [`zx.Status`] value indicating the failure.
6458    ///
6459    /// This method requires the following rights:
6460    ///
6461    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
6462    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
6463    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
6464    pub fn r#get_backing_memory(
6465        &self,
6466        mut flags: VmoFlags,
6467    ) -> fidl::client::QueryResponseFut<
6468        FileGetBackingMemoryResult,
6469        fdomain_client::fidl::FDomainResourceDialect,
6470    > {
6471        FileProxyInterface::r#get_backing_memory(self, flags)
6472    }
6473
6474    /// Pre-allocate on-disk space for this file.
6475    pub fn r#allocate(
6476        &self,
6477        mut offset: u64,
6478        mut length: u64,
6479        mut mode: AllocateMode,
6480    ) -> fidl::client::QueryResponseFut<
6481        FileAllocateResult,
6482        fdomain_client::fidl::FDomainResourceDialect,
6483    > {
6484        FileProxyInterface::r#allocate(self, offset, length, mode)
6485    }
6486
6487    /// Enables verification for the file (permanently) which involves computing a merkle tree for
6488    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
6489    /// captured. Future reads will be verified against the computed merkle tree and writes will be
6490    /// rejected. This method can take some time to complete as it depends on the size of the file.
6491    /// This method can be aborted by closing the connection that this method was issued on.
6492    ///
6493    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6494    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
6495    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
6496    /// Also returns any error that might arise from reading the file, or from flushing the file,
6497    /// such as `ZX_ERR_IO`.
6498    pub fn r#enable_verity(
6499        &self,
6500        mut options: &VerificationOptions,
6501    ) -> fidl::client::QueryResponseFut<
6502        FileEnableVerityResult,
6503        fdomain_client::fidl::FDomainResourceDialect,
6504    > {
6505        FileProxyInterface::r#enable_verity(self, options)
6506    }
6507}
6508
6509impl FileProxyInterface for FileProxy {
6510    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
6511        AdvisoryLockingAdvisoryLockResult,
6512        fdomain_client::fidl::FDomainResourceDialect,
6513    >;
6514    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
6515        fn _decode(
6516            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6517        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
6518            let _response = fidl::client::decode_transaction_body::<
6519                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6520                fdomain_client::fidl::FDomainResourceDialect,
6521                0x6ee9c0ad53ec87aa,
6522            >(_buf?)?;
6523            Ok(_response.map(|x| x))
6524        }
6525        self.client.send_query_and_decode::<
6526            AdvisoryLockingAdvisoryLockRequest,
6527            AdvisoryLockingAdvisoryLockResult,
6528        >(
6529            (request,),
6530            0x6ee9c0ad53ec87aa,
6531            fidl::encoding::DynamicFlags::empty(),
6532            _decode,
6533        )
6534    }
6535
6536    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
6537        LinkableLinkIntoResult,
6538        fdomain_client::fidl::FDomainResourceDialect,
6539    >;
6540    fn r#link_into(
6541        &self,
6542        mut dst_parent_token: fdomain_client::Event,
6543        mut dst: &str,
6544    ) -> Self::LinkIntoResponseFut {
6545        fn _decode(
6546            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6547        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
6548            let _response = fidl::client::decode_transaction_body::<
6549                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6550                fdomain_client::fidl::FDomainResourceDialect,
6551                0x54f3949246a03e74,
6552            >(_buf?)?;
6553            Ok(_response.map(|x| x))
6554        }
6555        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
6556            (dst_parent_token, dst),
6557            0x54f3949246a03e74,
6558            fidl::encoding::DynamicFlags::empty(),
6559            _decode,
6560        )
6561    }
6562
6563    fn r#clone(
6564        &self,
6565        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6566    ) -> Result<(), fidl::Error> {
6567        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
6568            (request,),
6569            0x20d8a7aba2168a79,
6570            fidl::encoding::DynamicFlags::empty(),
6571        )
6572    }
6573
6574    type CloseResponseFut = fidl::client::QueryResponseFut<
6575        fdomain_fuchsia_unknown::CloseableCloseResult,
6576        fdomain_client::fidl::FDomainResourceDialect,
6577    >;
6578    fn r#close(&self) -> Self::CloseResponseFut {
6579        fn _decode(
6580            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6581        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
6582            let _response = fidl::client::decode_transaction_body::<
6583                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6584                fdomain_client::fidl::FDomainResourceDialect,
6585                0x5ac5d459ad7f657e,
6586            >(_buf?)?;
6587            Ok(_response.map(|x| x))
6588        }
6589        self.client.send_query_and_decode::<
6590            fidl::encoding::EmptyPayload,
6591            fdomain_fuchsia_unknown::CloseableCloseResult,
6592        >(
6593            (),
6594            0x5ac5d459ad7f657e,
6595            fidl::encoding::DynamicFlags::empty(),
6596            _decode,
6597        )
6598    }
6599
6600    type QueryResponseFut =
6601        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
6602    fn r#query(&self) -> Self::QueryResponseFut {
6603        fn _decode(
6604            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6605        ) -> Result<Vec<u8>, fidl::Error> {
6606            let _response = fidl::client::decode_transaction_body::<
6607                fdomain_fuchsia_unknown::QueryableQueryResponse,
6608                fdomain_client::fidl::FDomainResourceDialect,
6609                0x2658edee9decfc06,
6610            >(_buf?)?;
6611            Ok(_response.protocol)
6612        }
6613        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
6614            (),
6615            0x2658edee9decfc06,
6616            fidl::encoding::DynamicFlags::empty(),
6617            _decode,
6618        )
6619    }
6620
6621    fn r#deprecated_clone(
6622        &self,
6623        mut flags: OpenFlags,
6624        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6625    ) -> Result<(), fidl::Error> {
6626        self.client.send::<NodeDeprecatedCloneRequest>(
6627            (flags, object),
6628            0x5a61678f293ce16f,
6629            fidl::encoding::DynamicFlags::FLEXIBLE,
6630        )
6631    }
6632
6633    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
6634        (i32, NodeAttributes),
6635        fdomain_client::fidl::FDomainResourceDialect,
6636    >;
6637    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
6638        fn _decode(
6639            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6640        ) -> Result<(i32, NodeAttributes), fidl::Error> {
6641            let _response = fidl::client::decode_transaction_body::<
6642                NodeDeprecatedGetAttrResponse,
6643                fdomain_client::fidl::FDomainResourceDialect,
6644                0x78985e216314dafd,
6645            >(_buf?)?;
6646            Ok((_response.s, _response.attributes))
6647        }
6648        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
6649            (),
6650            0x78985e216314dafd,
6651            fidl::encoding::DynamicFlags::empty(),
6652            _decode,
6653        )
6654    }
6655
6656    type DeprecatedSetAttrResponseFut =
6657        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6658    fn r#deprecated_set_attr(
6659        &self,
6660        mut flags: NodeAttributeFlags,
6661        mut attributes: &NodeAttributes,
6662    ) -> Self::DeprecatedSetAttrResponseFut {
6663        fn _decode(
6664            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6665        ) -> Result<i32, fidl::Error> {
6666            let _response = fidl::client::decode_transaction_body::<
6667                NodeDeprecatedSetAttrResponse,
6668                fdomain_client::fidl::FDomainResourceDialect,
6669                0x4186c0f40d938f46,
6670            >(_buf?)?;
6671            Ok(_response.s)
6672        }
6673        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
6674            (flags, attributes),
6675            0x4186c0f40d938f46,
6676            fidl::encoding::DynamicFlags::empty(),
6677            _decode,
6678        )
6679    }
6680
6681    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
6682        (i32, OpenFlags),
6683        fdomain_client::fidl::FDomainResourceDialect,
6684    >;
6685    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
6686        fn _decode(
6687            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6688        ) -> Result<(i32, OpenFlags), fidl::Error> {
6689            let _response = fidl::client::decode_transaction_body::<
6690                NodeDeprecatedGetFlagsResponse,
6691                fdomain_client::fidl::FDomainResourceDialect,
6692                0x5b88fffb8eda3aa1,
6693            >(_buf?)?;
6694            Ok((_response.s, _response.flags))
6695        }
6696        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
6697            (),
6698            0x5b88fffb8eda3aa1,
6699            fidl::encoding::DynamicFlags::empty(),
6700            _decode,
6701        )
6702    }
6703
6704    type DeprecatedSetFlagsResponseFut =
6705        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6706    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
6707        fn _decode(
6708            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6709        ) -> Result<i32, fidl::Error> {
6710            let _response = fidl::client::decode_transaction_body::<
6711                NodeDeprecatedSetFlagsResponse,
6712                fdomain_client::fidl::FDomainResourceDialect,
6713                0x5295b76c71fde733,
6714            >(_buf?)?;
6715            Ok(_response.s)
6716        }
6717        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
6718            (flags,),
6719            0x5295b76c71fde733,
6720            fidl::encoding::DynamicFlags::empty(),
6721            _decode,
6722        )
6723    }
6724
6725    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
6726        NodeGetFlagsResult,
6727        fdomain_client::fidl::FDomainResourceDialect,
6728    >;
6729    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
6730        fn _decode(
6731            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6732        ) -> Result<NodeGetFlagsResult, fidl::Error> {
6733            let _response = fidl::client::decode_transaction_body::<
6734                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
6735                fdomain_client::fidl::FDomainResourceDialect,
6736                0x176eb318f64ec23,
6737            >(_buf?)?
6738            .into_result_fdomain::<FileMarker>("get_flags")?;
6739            Ok(_response.map(|x| x.flags))
6740        }
6741        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
6742            (),
6743            0x176eb318f64ec23,
6744            fidl::encoding::DynamicFlags::FLEXIBLE,
6745            _decode,
6746        )
6747    }
6748
6749    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
6750        NodeSetFlagsResult,
6751        fdomain_client::fidl::FDomainResourceDialect,
6752    >;
6753    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
6754        fn _decode(
6755            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6756        ) -> Result<NodeSetFlagsResult, fidl::Error> {
6757            let _response = fidl::client::decode_transaction_body::<
6758                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6759                fdomain_client::fidl::FDomainResourceDialect,
6760                0x55a8028685791ea8,
6761            >(_buf?)?
6762            .into_result_fdomain::<FileMarker>("set_flags")?;
6763            Ok(_response.map(|x| x))
6764        }
6765        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
6766            (flags,),
6767            0x55a8028685791ea8,
6768            fidl::encoding::DynamicFlags::FLEXIBLE,
6769            _decode,
6770        )
6771    }
6772
6773    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
6774        (i32, Option<Box<FilesystemInfo>>),
6775        fdomain_client::fidl::FDomainResourceDialect,
6776    >;
6777    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
6778        fn _decode(
6779            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6780        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
6781            let _response = fidl::client::decode_transaction_body::<
6782                NodeQueryFilesystemResponse,
6783                fdomain_client::fidl::FDomainResourceDialect,
6784                0x6f344a1c6b0a0610,
6785            >(_buf?)?;
6786            Ok((_response.s, _response.info))
6787        }
6788        self.client.send_query_and_decode::<
6789            fidl::encoding::EmptyPayload,
6790            (i32, Option<Box<FilesystemInfo>>),
6791        >(
6792            (),
6793            0x6f344a1c6b0a0610,
6794            fidl::encoding::DynamicFlags::empty(),
6795            _decode,
6796        )
6797    }
6798
6799    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
6800        NodeGetAttributesResult,
6801        fdomain_client::fidl::FDomainResourceDialect,
6802    >;
6803    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
6804        fn _decode(
6805            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6806        ) -> Result<NodeGetAttributesResult, fidl::Error> {
6807            let _response = fidl::client::decode_transaction_body::<
6808                fidl::encoding::ResultType<NodeAttributes2, i32>,
6809                fdomain_client::fidl::FDomainResourceDialect,
6810                0x3d4396a638ea053b,
6811            >(_buf?)?;
6812            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
6813        }
6814        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
6815            (query,),
6816            0x3d4396a638ea053b,
6817            fidl::encoding::DynamicFlags::empty(),
6818            _decode,
6819        )
6820    }
6821
6822    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
6823        NodeUpdateAttributesResult,
6824        fdomain_client::fidl::FDomainResourceDialect,
6825    >;
6826    fn r#update_attributes(
6827        &self,
6828        mut payload: &MutableNodeAttributes,
6829    ) -> Self::UpdateAttributesResponseFut {
6830        fn _decode(
6831            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6832        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
6833            let _response = fidl::client::decode_transaction_body::<
6834                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6835                fdomain_client::fidl::FDomainResourceDialect,
6836                0x3308c1da5a89bf08,
6837            >(_buf?)?;
6838            Ok(_response.map(|x| x))
6839        }
6840        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
6841            payload,
6842            0x3308c1da5a89bf08,
6843            fidl::encoding::DynamicFlags::empty(),
6844            _decode,
6845        )
6846    }
6847
6848    type SyncResponseFut = fidl::client::QueryResponseFut<
6849        NodeSyncResult,
6850        fdomain_client::fidl::FDomainResourceDialect,
6851    >;
6852    fn r#sync(&self) -> Self::SyncResponseFut {
6853        fn _decode(
6854            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6855        ) -> Result<NodeSyncResult, fidl::Error> {
6856            let _response = fidl::client::decode_transaction_body::<
6857                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6858                fdomain_client::fidl::FDomainResourceDialect,
6859                0x2c5c27ca0ab5dc49,
6860            >(_buf?)?;
6861            Ok(_response.map(|x| x))
6862        }
6863        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
6864            (),
6865            0x2c5c27ca0ab5dc49,
6866            fidl::encoding::DynamicFlags::empty(),
6867            _decode,
6868        )
6869    }
6870
6871    fn r#list_extended_attributes(
6872        &self,
6873        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6874    ) -> Result<(), fidl::Error> {
6875        self.client.send::<NodeListExtendedAttributesRequest>(
6876            (iterator,),
6877            0x4b61033de007fcd0,
6878            fidl::encoding::DynamicFlags::empty(),
6879        )
6880    }
6881
6882    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6883        NodeGetExtendedAttributeResult,
6884        fdomain_client::fidl::FDomainResourceDialect,
6885    >;
6886    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
6887        fn _decode(
6888            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6889        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
6890            let _response = fidl::client::decode_transaction_body::<
6891                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
6892                fdomain_client::fidl::FDomainResourceDialect,
6893                0x45ffa3ccfdeb76db,
6894            >(_buf?)?;
6895            Ok(_response.map(|x| x))
6896        }
6897        self.client.send_query_and_decode::<
6898            NodeGetExtendedAttributeRequest,
6899            NodeGetExtendedAttributeResult,
6900        >(
6901            (name,),
6902            0x45ffa3ccfdeb76db,
6903            fidl::encoding::DynamicFlags::empty(),
6904            _decode,
6905        )
6906    }
6907
6908    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6909        NodeSetExtendedAttributeResult,
6910        fdomain_client::fidl::FDomainResourceDialect,
6911    >;
6912    fn r#set_extended_attribute(
6913        &self,
6914        mut name: &[u8],
6915        mut value: ExtendedAttributeValue,
6916        mut mode: SetExtendedAttributeMode,
6917    ) -> Self::SetExtendedAttributeResponseFut {
6918        fn _decode(
6919            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6920        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
6921            let _response = fidl::client::decode_transaction_body::<
6922                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6923                fdomain_client::fidl::FDomainResourceDialect,
6924                0x4a951362f681f23c,
6925            >(_buf?)?;
6926            Ok(_response.map(|x| x))
6927        }
6928        self.client.send_query_and_decode::<
6929            NodeSetExtendedAttributeRequest,
6930            NodeSetExtendedAttributeResult,
6931        >(
6932            (name, &mut value, mode,),
6933            0x4a951362f681f23c,
6934            fidl::encoding::DynamicFlags::empty(),
6935            _decode,
6936        )
6937    }
6938
6939    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6940        NodeRemoveExtendedAttributeResult,
6941        fdomain_client::fidl::FDomainResourceDialect,
6942    >;
6943    fn r#remove_extended_attribute(
6944        &self,
6945        mut name: &[u8],
6946    ) -> Self::RemoveExtendedAttributeResponseFut {
6947        fn _decode(
6948            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6949        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
6950            let _response = fidl::client::decode_transaction_body::<
6951                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6952                fdomain_client::fidl::FDomainResourceDialect,
6953                0x7a0b9f3a9bf9032d,
6954            >(_buf?)?;
6955            Ok(_response.map(|x| x))
6956        }
6957        self.client.send_query_and_decode::<
6958            NodeRemoveExtendedAttributeRequest,
6959            NodeRemoveExtendedAttributeResult,
6960        >(
6961            (name,),
6962            0x7a0b9f3a9bf9032d,
6963            fidl::encoding::DynamicFlags::empty(),
6964            _decode,
6965        )
6966    }
6967
6968    type ReadResponseFut = fidl::client::QueryResponseFut<
6969        ReadableReadResult,
6970        fdomain_client::fidl::FDomainResourceDialect,
6971    >;
6972    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
6973        fn _decode(
6974            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6975        ) -> Result<ReadableReadResult, fidl::Error> {
6976            let _response = fidl::client::decode_transaction_body::<
6977                fidl::encoding::ResultType<ReadableReadResponse, i32>,
6978                fdomain_client::fidl::FDomainResourceDialect,
6979                0x57e419a298c8ede,
6980            >(_buf?)?;
6981            Ok(_response.map(|x| x.data))
6982        }
6983        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
6984            (count,),
6985            0x57e419a298c8ede,
6986            fidl::encoding::DynamicFlags::empty(),
6987            _decode,
6988        )
6989    }
6990
6991    type WriteResponseFut = fidl::client::QueryResponseFut<
6992        WritableWriteResult,
6993        fdomain_client::fidl::FDomainResourceDialect,
6994    >;
6995    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
6996        fn _decode(
6997            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6998        ) -> Result<WritableWriteResult, fidl::Error> {
6999            let _response = fidl::client::decode_transaction_body::<
7000                fidl::encoding::ResultType<WritableWriteResponse, i32>,
7001                fdomain_client::fidl::FDomainResourceDialect,
7002                0x6a31437832469f82,
7003            >(_buf?)?;
7004            Ok(_response.map(|x| x.actual_count))
7005        }
7006        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
7007            (data,),
7008            0x6a31437832469f82,
7009            fidl::encoding::DynamicFlags::empty(),
7010            _decode,
7011        )
7012    }
7013
7014    type DescribeResponseFut =
7015        fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>;
7016    fn r#describe(&self) -> Self::DescribeResponseFut {
7017        fn _decode(
7018            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7019        ) -> Result<FileInfo, fidl::Error> {
7020            let _response = fidl::client::decode_transaction_body::<
7021                FileInfo,
7022                fdomain_client::fidl::FDomainResourceDialect,
7023                0x68b5ac00c62906bc,
7024            >(_buf?)?;
7025            Ok(_response)
7026        }
7027        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
7028            (),
7029            0x68b5ac00c62906bc,
7030            fidl::encoding::DynamicFlags::empty(),
7031            _decode,
7032        )
7033    }
7034
7035    type SeekResponseFut = fidl::client::QueryResponseFut<
7036        FileSeekResult,
7037        fdomain_client::fidl::FDomainResourceDialect,
7038    >;
7039    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
7040        fn _decode(
7041            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7042        ) -> Result<FileSeekResult, fidl::Error> {
7043            let _response = fidl::client::decode_transaction_body::<
7044                fidl::encoding::ResultType<FileSeekResponse, i32>,
7045                fdomain_client::fidl::FDomainResourceDialect,
7046                0x78079168162c5207,
7047            >(_buf?)?;
7048            Ok(_response.map(|x| x.offset_from_start))
7049        }
7050        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
7051            (origin, offset),
7052            0x78079168162c5207,
7053            fidl::encoding::DynamicFlags::empty(),
7054            _decode,
7055        )
7056    }
7057
7058    type ReadAtResponseFut = fidl::client::QueryResponseFut<
7059        FileReadAtResult,
7060        fdomain_client::fidl::FDomainResourceDialect,
7061    >;
7062    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
7063        fn _decode(
7064            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7065        ) -> Result<FileReadAtResult, fidl::Error> {
7066            let _response = fidl::client::decode_transaction_body::<
7067                fidl::encoding::ResultType<FileReadAtResponse, i32>,
7068                fdomain_client::fidl::FDomainResourceDialect,
7069                0x1607a293a60d723e,
7070            >(_buf?)?;
7071            Ok(_response.map(|x| x.data))
7072        }
7073        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
7074            (count, offset),
7075            0x1607a293a60d723e,
7076            fidl::encoding::DynamicFlags::empty(),
7077            _decode,
7078        )
7079    }
7080
7081    type WriteAtResponseFut = fidl::client::QueryResponseFut<
7082        FileWriteAtResult,
7083        fdomain_client::fidl::FDomainResourceDialect,
7084    >;
7085    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
7086        fn _decode(
7087            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7088        ) -> Result<FileWriteAtResult, fidl::Error> {
7089            let _response = fidl::client::decode_transaction_body::<
7090                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7091                fdomain_client::fidl::FDomainResourceDialect,
7092                0x793eefc0045e792b,
7093            >(_buf?)?;
7094            Ok(_response.map(|x| x.actual_count))
7095        }
7096        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
7097            (data, offset),
7098            0x793eefc0045e792b,
7099            fidl::encoding::DynamicFlags::empty(),
7100            _decode,
7101        )
7102    }
7103
7104    type ResizeResponseFut = fidl::client::QueryResponseFut<
7105        FileResizeResult,
7106        fdomain_client::fidl::FDomainResourceDialect,
7107    >;
7108    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
7109        fn _decode(
7110            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7111        ) -> Result<FileResizeResult, fidl::Error> {
7112            let _response = fidl::client::decode_transaction_body::<
7113                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7114                fdomain_client::fidl::FDomainResourceDialect,
7115                0x2b80825f0535743a,
7116            >(_buf?)?;
7117            Ok(_response.map(|x| x))
7118        }
7119        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
7120            (length,),
7121            0x2b80825f0535743a,
7122            fidl::encoding::DynamicFlags::empty(),
7123            _decode,
7124        )
7125    }
7126
7127    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
7128        FileGetBackingMemoryResult,
7129        fdomain_client::fidl::FDomainResourceDialect,
7130    >;
7131    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
7132        fn _decode(
7133            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7134        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7135            let _response = fidl::client::decode_transaction_body::<
7136                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7137                fdomain_client::fidl::FDomainResourceDialect,
7138                0xa6a9e654cbf62b,
7139            >(_buf?)?;
7140            Ok(_response.map(|x| x.vmo))
7141        }
7142        self.client
7143            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
7144                (flags,),
7145                0xa6a9e654cbf62b,
7146                fidl::encoding::DynamicFlags::empty(),
7147                _decode,
7148            )
7149    }
7150
7151    type AllocateResponseFut = fidl::client::QueryResponseFut<
7152        FileAllocateResult,
7153        fdomain_client::fidl::FDomainResourceDialect,
7154    >;
7155    fn r#allocate(
7156        &self,
7157        mut offset: u64,
7158        mut length: u64,
7159        mut mode: AllocateMode,
7160    ) -> Self::AllocateResponseFut {
7161        fn _decode(
7162            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7163        ) -> Result<FileAllocateResult, fidl::Error> {
7164            let _response = fidl::client::decode_transaction_body::<
7165                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7166                fdomain_client::fidl::FDomainResourceDialect,
7167                0x77fa0c330b57fd2e,
7168            >(_buf?)?
7169            .into_result_fdomain::<FileMarker>("allocate")?;
7170            Ok(_response.map(|x| x))
7171        }
7172        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
7173            (offset, length, mode),
7174            0x77fa0c330b57fd2e,
7175            fidl::encoding::DynamicFlags::FLEXIBLE,
7176            _decode,
7177        )
7178    }
7179
7180    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
7181        FileEnableVerityResult,
7182        fdomain_client::fidl::FDomainResourceDialect,
7183    >;
7184    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
7185        fn _decode(
7186            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7187        ) -> Result<FileEnableVerityResult, fidl::Error> {
7188            let _response = fidl::client::decode_transaction_body::<
7189                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7190                fdomain_client::fidl::FDomainResourceDialect,
7191                0x2c421ec3faaeb8bb,
7192            >(_buf?)?
7193            .into_result_fdomain::<FileMarker>("enable_verity")?;
7194            Ok(_response.map(|x| x))
7195        }
7196        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
7197            (options,),
7198            0x2c421ec3faaeb8bb,
7199            fidl::encoding::DynamicFlags::FLEXIBLE,
7200            _decode,
7201        )
7202    }
7203}
7204
7205pub struct FileEventStream {
7206    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7207}
7208
7209impl std::marker::Unpin for FileEventStream {}
7210
7211impl futures::stream::FusedStream for FileEventStream {
7212    fn is_terminated(&self) -> bool {
7213        self.event_receiver.is_terminated()
7214    }
7215}
7216
7217impl futures::Stream for FileEventStream {
7218    type Item = Result<FileEvent, fidl::Error>;
7219
7220    fn poll_next(
7221        mut self: std::pin::Pin<&mut Self>,
7222        cx: &mut std::task::Context<'_>,
7223    ) -> std::task::Poll<Option<Self::Item>> {
7224        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7225            &mut self.event_receiver,
7226            cx
7227        )?) {
7228            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
7229            None => std::task::Poll::Ready(None),
7230        }
7231    }
7232}
7233
7234#[derive(Debug)]
7235pub enum FileEvent {
7236    OnOpen_ {
7237        s: i32,
7238        info: Option<Box<NodeInfoDeprecated>>,
7239    },
7240    OnRepresentation {
7241        payload: Representation,
7242    },
7243    #[non_exhaustive]
7244    _UnknownEvent {
7245        /// Ordinal of the event that was sent.
7246        ordinal: u64,
7247    },
7248}
7249
7250impl FileEvent {
7251    #[allow(irrefutable_let_patterns)]
7252    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
7253        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
7254    }
7255    #[allow(irrefutable_let_patterns)]
7256    pub fn into_on_representation(self) -> Option<Representation> {
7257        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
7258    }
7259
7260    /// Decodes a message buffer as a [`FileEvent`].
7261    fn decode(
7262        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7263    ) -> Result<FileEvent, fidl::Error> {
7264        let (bytes, _handles) = buf.split_mut();
7265        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7266        debug_assert_eq!(tx_header.tx_id, 0);
7267        match tx_header.ordinal {
7268            0x7fc7bbb1dbfd1972 => {
7269                let mut out = fidl::new_empty!(
7270                    NodeOnOpenRequest,
7271                    fdomain_client::fidl::FDomainResourceDialect
7272                );
7273                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
7274                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
7275            }
7276            0x5cb40567d80a510c => {
7277                let mut out =
7278                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
7279                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
7280                Ok((FileEvent::OnRepresentation { payload: out }))
7281            }
7282            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7283                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7284            }
7285            _ => Err(fidl::Error::UnknownOrdinal {
7286                ordinal: tx_header.ordinal,
7287                protocol_name: <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7288            }),
7289        }
7290    }
7291}
7292
7293/// A Stream of incoming requests for fuchsia.io/File.
7294pub struct FileRequestStream {
7295    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7296    is_terminated: bool,
7297}
7298
7299impl std::marker::Unpin for FileRequestStream {}
7300
7301impl futures::stream::FusedStream for FileRequestStream {
7302    fn is_terminated(&self) -> bool {
7303        self.is_terminated
7304    }
7305}
7306
7307impl fdomain_client::fidl::RequestStream for FileRequestStream {
7308    type Protocol = FileMarker;
7309    type ControlHandle = FileControlHandle;
7310
7311    fn from_channel(channel: fdomain_client::Channel) -> Self {
7312        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7313    }
7314
7315    fn control_handle(&self) -> Self::ControlHandle {
7316        FileControlHandle { inner: self.inner.clone() }
7317    }
7318
7319    fn into_inner(
7320        self,
7321    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7322    {
7323        (self.inner, self.is_terminated)
7324    }
7325
7326    fn from_inner(
7327        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7328        is_terminated: bool,
7329    ) -> Self {
7330        Self { inner, is_terminated }
7331    }
7332}
7333
7334impl futures::Stream for FileRequestStream {
7335    type Item = Result<FileRequest, fidl::Error>;
7336
7337    fn poll_next(
7338        mut self: std::pin::Pin<&mut Self>,
7339        cx: &mut std::task::Context<'_>,
7340    ) -> std::task::Poll<Option<Self::Item>> {
7341        let this = &mut *self;
7342        if this.inner.check_shutdown(cx) {
7343            this.is_terminated = true;
7344            return std::task::Poll::Ready(None);
7345        }
7346        if this.is_terminated {
7347            panic!("polled FileRequestStream after completion");
7348        }
7349        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7350            |bytes, handles| {
7351                match this.inner.channel().read_etc(cx, bytes, handles) {
7352                    std::task::Poll::Ready(Ok(())) => {}
7353                    std::task::Poll::Pending => return std::task::Poll::Pending,
7354                    std::task::Poll::Ready(Err(None)) => {
7355                        this.is_terminated = true;
7356                        return std::task::Poll::Ready(None);
7357                    }
7358                    std::task::Poll::Ready(Err(Some(e))) => {
7359                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7360                            e.into(),
7361                        ))));
7362                    }
7363                }
7364
7365                // A message has been received from the channel
7366                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7367
7368                std::task::Poll::Ready(Some(match header.ordinal {
7369                    0x6ee9c0ad53ec87aa => {
7370                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7371                        let mut req = fidl::new_empty!(
7372                            AdvisoryLockingAdvisoryLockRequest,
7373                            fdomain_client::fidl::FDomainResourceDialect
7374                        );
7375                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
7376                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7377                        Ok(FileRequest::AdvisoryLock {
7378                            request: req.request,
7379
7380                            responder: FileAdvisoryLockResponder {
7381                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7382                                tx_id: header.tx_id,
7383                            },
7384                        })
7385                    }
7386                    0x54f3949246a03e74 => {
7387                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7388                        let mut req = fidl::new_empty!(
7389                            LinkableLinkIntoRequest,
7390                            fdomain_client::fidl::FDomainResourceDialect
7391                        );
7392                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
7393                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7394                        Ok(FileRequest::LinkInto {
7395                            dst_parent_token: req.dst_parent_token,
7396                            dst: req.dst,
7397
7398                            responder: FileLinkIntoResponder {
7399                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7400                                tx_id: header.tx_id,
7401                            },
7402                        })
7403                    }
7404                    0x20d8a7aba2168a79 => {
7405                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7406                        let mut req = fidl::new_empty!(
7407                            fdomain_fuchsia_unknown::CloneableCloneRequest,
7408                            fdomain_client::fidl::FDomainResourceDialect
7409                        );
7410                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7411                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7412                        Ok(FileRequest::Clone { request: req.request, control_handle })
7413                    }
7414                    0x5ac5d459ad7f657e => {
7415                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7416                        let mut req = fidl::new_empty!(
7417                            fidl::encoding::EmptyPayload,
7418                            fdomain_client::fidl::FDomainResourceDialect
7419                        );
7420                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7421                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7422                        Ok(FileRequest::Close {
7423                            responder: FileCloseResponder {
7424                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7425                                tx_id: header.tx_id,
7426                            },
7427                        })
7428                    }
7429                    0x2658edee9decfc06 => {
7430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7431                        let mut req = fidl::new_empty!(
7432                            fidl::encoding::EmptyPayload,
7433                            fdomain_client::fidl::FDomainResourceDialect
7434                        );
7435                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7436                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7437                        Ok(FileRequest::Query {
7438                            responder: FileQueryResponder {
7439                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7440                                tx_id: header.tx_id,
7441                            },
7442                        })
7443                    }
7444                    0x5a61678f293ce16f => {
7445                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7446                        let mut req = fidl::new_empty!(
7447                            NodeDeprecatedCloneRequest,
7448                            fdomain_client::fidl::FDomainResourceDialect
7449                        );
7450                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7451                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7452                        Ok(FileRequest::DeprecatedClone {
7453                            flags: req.flags,
7454                            object: req.object,
7455
7456                            control_handle,
7457                        })
7458                    }
7459                    0x78985e216314dafd => {
7460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7461                        let mut req = fidl::new_empty!(
7462                            fidl::encoding::EmptyPayload,
7463                            fdomain_client::fidl::FDomainResourceDialect
7464                        );
7465                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7466                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7467                        Ok(FileRequest::DeprecatedGetAttr {
7468                            responder: FileDeprecatedGetAttrResponder {
7469                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7470                                tx_id: header.tx_id,
7471                            },
7472                        })
7473                    }
7474                    0x4186c0f40d938f46 => {
7475                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7476                        let mut req = fidl::new_empty!(
7477                            NodeDeprecatedSetAttrRequest,
7478                            fdomain_client::fidl::FDomainResourceDialect
7479                        );
7480                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
7481                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7482                        Ok(FileRequest::DeprecatedSetAttr {
7483                            flags: req.flags,
7484                            attributes: req.attributes,
7485
7486                            responder: FileDeprecatedSetAttrResponder {
7487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7488                                tx_id: header.tx_id,
7489                            },
7490                        })
7491                    }
7492                    0x5b88fffb8eda3aa1 => {
7493                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7494                        let mut req = fidl::new_empty!(
7495                            fidl::encoding::EmptyPayload,
7496                            fdomain_client::fidl::FDomainResourceDialect
7497                        );
7498                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7499                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7500                        Ok(FileRequest::DeprecatedGetFlags {
7501                            responder: FileDeprecatedGetFlagsResponder {
7502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7503                                tx_id: header.tx_id,
7504                            },
7505                        })
7506                    }
7507                    0x5295b76c71fde733 => {
7508                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7509                        let mut req = fidl::new_empty!(
7510                            NodeDeprecatedSetFlagsRequest,
7511                            fdomain_client::fidl::FDomainResourceDialect
7512                        );
7513                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7514                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7515                        Ok(FileRequest::DeprecatedSetFlags {
7516                            flags: req.flags,
7517
7518                            responder: FileDeprecatedSetFlagsResponder {
7519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7520                                tx_id: header.tx_id,
7521                            },
7522                        })
7523                    }
7524                    0x176eb318f64ec23 => {
7525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7526                        let mut req = fidl::new_empty!(
7527                            fidl::encoding::EmptyPayload,
7528                            fdomain_client::fidl::FDomainResourceDialect
7529                        );
7530                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7531                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7532                        Ok(FileRequest::GetFlags {
7533                            responder: FileGetFlagsResponder {
7534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7535                                tx_id: header.tx_id,
7536                            },
7537                        })
7538                    }
7539                    0x55a8028685791ea8 => {
7540                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7541                        let mut req = fidl::new_empty!(
7542                            NodeSetFlagsRequest,
7543                            fdomain_client::fidl::FDomainResourceDialect
7544                        );
7545                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7546                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7547                        Ok(FileRequest::SetFlags {
7548                            flags: req.flags,
7549
7550                            responder: FileSetFlagsResponder {
7551                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7552                                tx_id: header.tx_id,
7553                            },
7554                        })
7555                    }
7556                    0x6f344a1c6b0a0610 => {
7557                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7558                        let mut req = fidl::new_empty!(
7559                            fidl::encoding::EmptyPayload,
7560                            fdomain_client::fidl::FDomainResourceDialect
7561                        );
7562                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7563                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7564                        Ok(FileRequest::QueryFilesystem {
7565                            responder: FileQueryFilesystemResponder {
7566                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7567                                tx_id: header.tx_id,
7568                            },
7569                        })
7570                    }
7571                    0x3d4396a638ea053b => {
7572                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7573                        let mut req = fidl::new_empty!(
7574                            NodeGetAttributesRequest,
7575                            fdomain_client::fidl::FDomainResourceDialect
7576                        );
7577                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7578                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7579                        Ok(FileRequest::GetAttributes {
7580                            query: req.query,
7581
7582                            responder: FileGetAttributesResponder {
7583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7584                                tx_id: header.tx_id,
7585                            },
7586                        })
7587                    }
7588                    0x3308c1da5a89bf08 => {
7589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7590                        let mut req = fidl::new_empty!(
7591                            MutableNodeAttributes,
7592                            fdomain_client::fidl::FDomainResourceDialect
7593                        );
7594                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
7595                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7596                        Ok(FileRequest::UpdateAttributes {
7597                            payload: req,
7598                            responder: FileUpdateAttributesResponder {
7599                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7600                                tx_id: header.tx_id,
7601                            },
7602                        })
7603                    }
7604                    0x2c5c27ca0ab5dc49 => {
7605                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7606                        let mut req = fidl::new_empty!(
7607                            fidl::encoding::EmptyPayload,
7608                            fdomain_client::fidl::FDomainResourceDialect
7609                        );
7610                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7611                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7612                        Ok(FileRequest::Sync {
7613                            responder: FileSyncResponder {
7614                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7615                                tx_id: header.tx_id,
7616                            },
7617                        })
7618                    }
7619                    0x4b61033de007fcd0 => {
7620                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7621                        let mut req = fidl::new_empty!(
7622                            NodeListExtendedAttributesRequest,
7623                            fdomain_client::fidl::FDomainResourceDialect
7624                        );
7625                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7626                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7627                        Ok(FileRequest::ListExtendedAttributes {
7628                            iterator: req.iterator,
7629
7630                            control_handle,
7631                        })
7632                    }
7633                    0x45ffa3ccfdeb76db => {
7634                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7635                        let mut req = fidl::new_empty!(
7636                            NodeGetExtendedAttributeRequest,
7637                            fdomain_client::fidl::FDomainResourceDialect
7638                        );
7639                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7640                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7641                        Ok(FileRequest::GetExtendedAttribute {
7642                            name: req.name,
7643
7644                            responder: FileGetExtendedAttributeResponder {
7645                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7646                                tx_id: header.tx_id,
7647                            },
7648                        })
7649                    }
7650                    0x4a951362f681f23c => {
7651                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7652                        let mut req = fidl::new_empty!(
7653                            NodeSetExtendedAttributeRequest,
7654                            fdomain_client::fidl::FDomainResourceDialect
7655                        );
7656                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7657                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7658                        Ok(FileRequest::SetExtendedAttribute {
7659                            name: req.name,
7660                            value: req.value,
7661                            mode: req.mode,
7662
7663                            responder: FileSetExtendedAttributeResponder {
7664                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7665                                tx_id: header.tx_id,
7666                            },
7667                        })
7668                    }
7669                    0x7a0b9f3a9bf9032d => {
7670                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7671                        let mut req = fidl::new_empty!(
7672                            NodeRemoveExtendedAttributeRequest,
7673                            fdomain_client::fidl::FDomainResourceDialect
7674                        );
7675                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7676                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7677                        Ok(FileRequest::RemoveExtendedAttribute {
7678                            name: req.name,
7679
7680                            responder: FileRemoveExtendedAttributeResponder {
7681                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7682                                tx_id: header.tx_id,
7683                            },
7684                        })
7685                    }
7686                    0x57e419a298c8ede => {
7687                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7688                        let mut req = fidl::new_empty!(
7689                            ReadableReadRequest,
7690                            fdomain_client::fidl::FDomainResourceDialect
7691                        );
7692                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
7693                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7694                        Ok(FileRequest::Read {
7695                            count: req.count,
7696
7697                            responder: FileReadResponder {
7698                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7699                                tx_id: header.tx_id,
7700                            },
7701                        })
7702                    }
7703                    0x6a31437832469f82 => {
7704                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7705                        let mut req = fidl::new_empty!(
7706                            WritableWriteRequest,
7707                            fdomain_client::fidl::FDomainResourceDialect
7708                        );
7709                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
7710                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7711                        Ok(FileRequest::Write {
7712                            data: req.data,
7713
7714                            responder: FileWriteResponder {
7715                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7716                                tx_id: header.tx_id,
7717                            },
7718                        })
7719                    }
7720                    0x68b5ac00c62906bc => {
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::Describe {
7729                            responder: FileDescribeResponder {
7730                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7731                                tx_id: header.tx_id,
7732                            },
7733                        })
7734                    }
7735                    0x78079168162c5207 => {
7736                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7737                        let mut req = fidl::new_empty!(
7738                            FileSeekRequest,
7739                            fdomain_client::fidl::FDomainResourceDialect
7740                        );
7741                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
7742                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7743                        Ok(FileRequest::Seek {
7744                            origin: req.origin,
7745                            offset: req.offset,
7746
7747                            responder: FileSeekResponder {
7748                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7749                                tx_id: header.tx_id,
7750                            },
7751                        })
7752                    }
7753                    0x1607a293a60d723e => {
7754                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7755                        let mut req = fidl::new_empty!(
7756                            FileReadAtRequest,
7757                            fdomain_client::fidl::FDomainResourceDialect
7758                        );
7759                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
7760                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7761                        Ok(FileRequest::ReadAt {
7762                            count: req.count,
7763                            offset: req.offset,
7764
7765                            responder: FileReadAtResponder {
7766                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7767                                tx_id: header.tx_id,
7768                            },
7769                        })
7770                    }
7771                    0x793eefc0045e792b => {
7772                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7773                        let mut req = fidl::new_empty!(
7774                            FileWriteAtRequest,
7775                            fdomain_client::fidl::FDomainResourceDialect
7776                        );
7777                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
7778                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7779                        Ok(FileRequest::WriteAt {
7780                            data: req.data,
7781                            offset: req.offset,
7782
7783                            responder: FileWriteAtResponder {
7784                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7785                                tx_id: header.tx_id,
7786                            },
7787                        })
7788                    }
7789                    0x2b80825f0535743a => {
7790                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7791                        let mut req = fidl::new_empty!(
7792                            FileResizeRequest,
7793                            fdomain_client::fidl::FDomainResourceDialect
7794                        );
7795                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
7796                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7797                        Ok(FileRequest::Resize {
7798                            length: req.length,
7799
7800                            responder: FileResizeResponder {
7801                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7802                                tx_id: header.tx_id,
7803                            },
7804                        })
7805                    }
7806                    0xa6a9e654cbf62b => {
7807                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7808                        let mut req = fidl::new_empty!(
7809                            FileGetBackingMemoryRequest,
7810                            fdomain_client::fidl::FDomainResourceDialect
7811                        );
7812                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
7813                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7814                        Ok(FileRequest::GetBackingMemory {
7815                            flags: req.flags,
7816
7817                            responder: FileGetBackingMemoryResponder {
7818                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7819                                tx_id: header.tx_id,
7820                            },
7821                        })
7822                    }
7823                    0x77fa0c330b57fd2e => {
7824                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7825                        let mut req = fidl::new_empty!(
7826                            FileAllocateRequest,
7827                            fdomain_client::fidl::FDomainResourceDialect
7828                        );
7829                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
7830                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7831                        Ok(FileRequest::Allocate {
7832                            offset: req.offset,
7833                            length: req.length,
7834                            mode: req.mode,
7835
7836                            responder: FileAllocateResponder {
7837                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7838                                tx_id: header.tx_id,
7839                            },
7840                        })
7841                    }
7842                    0x2c421ec3faaeb8bb => {
7843                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7844                        let mut req = fidl::new_empty!(
7845                            FileEnableVerityRequest,
7846                            fdomain_client::fidl::FDomainResourceDialect
7847                        );
7848                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
7849                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7850                        Ok(FileRequest::EnableVerity {
7851                            options: req.options,
7852
7853                            responder: FileEnableVerityResponder {
7854                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7855                                tx_id: header.tx_id,
7856                            },
7857                        })
7858                    }
7859                    _ if header.tx_id == 0
7860                        && header
7861                            .dynamic_flags()
7862                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7863                    {
7864                        Ok(FileRequest::_UnknownMethod {
7865                            ordinal: header.ordinal,
7866                            control_handle: FileControlHandle { inner: this.inner.clone() },
7867                            method_type: fidl::MethodType::OneWay,
7868                        })
7869                    }
7870                    _ if header
7871                        .dynamic_flags()
7872                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7873                    {
7874                        this.inner.send_framework_err(
7875                            fidl::encoding::FrameworkErr::UnknownMethod,
7876                            header.tx_id,
7877                            header.ordinal,
7878                            header.dynamic_flags(),
7879                            (bytes, handles),
7880                        )?;
7881                        Ok(FileRequest::_UnknownMethod {
7882                            ordinal: header.ordinal,
7883                            control_handle: FileControlHandle { inner: this.inner.clone() },
7884                            method_type: fidl::MethodType::TwoWay,
7885                        })
7886                    }
7887                    _ => Err(fidl::Error::UnknownOrdinal {
7888                        ordinal: header.ordinal,
7889                        protocol_name:
7890                            <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7891                    }),
7892                }))
7893            },
7894        )
7895    }
7896}
7897
7898/// A [`Node`] which contains a sequence of bytes of definite length.
7899///
7900/// NOTE: cloned connections do not share their seek offset with their source
7901/// connection.
7902#[derive(Debug)]
7903pub enum FileRequest {
7904    /// Acquires an advisory lock on the underlying file.
7905    ///
7906    /// The lock lasts until either this connection is closed or
7907    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7908    /// explicitly.
7909    ///
7910    /// Advisory locks are purely advisory. They do not prevent actual read or
7911    /// write operations from occurring on the file, either through this
7912    /// connection or through other connections.
7913    ///
7914    /// This method requires the following rights:
7915    ///
7916    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7917    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7918    ///   [`AdvisoryLockType.WRITE`].
7919    ///
7920    /// # Errors
7921    ///
7922    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7923    ///   example, another connection might hold a conflicting lock type.
7924    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7925    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7926    ///   to acquire the given type of lock.
7927    AdvisoryLock {
7928        request: AdvisoryLockRequest,
7929        responder: FileAdvisoryLockResponder,
7930    },
7931    /// Creates a link to this this object with name `dst` in the directory represented by
7932    /// `dst_parent_token`.
7933    ///
7934    /// `dst` must be a resolved object name. Including "/" in the string will return
7935    /// `ZX_ERR_INVALID_ARGS`.
7936    ///
7937    /// This method requires the maximal set of rights supported by the filesystem for this object.
7938    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7939    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7940    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7941    /// `ZX_ERR_ACCESS_DENIED`.
7942    ///
7943    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7944    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7945    ///
7946    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7947    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7948    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7949    ///
7950    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7951    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7952    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7953    LinkInto {
7954        dst_parent_token: fdomain_client::Event,
7955        dst: String,
7956        responder: FileLinkIntoResponder,
7957    },
7958    Clone {
7959        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
7960        control_handle: FileControlHandle,
7961    },
7962    /// Terminates the connection.
7963    ///
7964    /// After calling `Close`, the client must not send any other requests.
7965    ///
7966    /// Servers, after sending the status response, should close the connection
7967    /// regardless of status and without sending an epitaph.
7968    ///
7969    /// Closing the client end of the channel should be semantically equivalent
7970    /// to calling `Close` without knowing when the close has completed or its
7971    /// status.
7972    Close {
7973        responder: FileCloseResponder,
7974    },
7975    Query {
7976        responder: FileQueryResponder,
7977    },
7978    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7979    DeprecatedClone {
7980        flags: OpenFlags,
7981        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
7982        control_handle: FileControlHandle,
7983    },
7984    /// DEPRECATED - Use `Node.GetAttributes` instead.
7985    ///
7986    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7987    DeprecatedGetAttr {
7988        responder: FileDeprecatedGetAttrResponder,
7989    },
7990    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7991    DeprecatedSetAttr {
7992        flags: NodeAttributeFlags,
7993        attributes: NodeAttributes,
7994        responder: FileDeprecatedSetAttrResponder,
7995    },
7996    /// [DEPRECATED - Use new GetFlags method instead.]
7997    DeprecatedGetFlags {
7998        responder: FileDeprecatedGetFlagsResponder,
7999    },
8000    /// [DEPRECATED - Use new SetFlags method instead.]
8001    DeprecatedSetFlags {
8002        flags: OpenFlags,
8003        responder: FileDeprecatedSetFlagsResponder,
8004    },
8005    /// Queries the flags that apply to this node after it has been opened/created. This method does
8006    /// not require any rights.
8007    ///
8008    /// Note that the final set of flags that apply to the connection may differ from those
8009    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8010    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8011    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8012    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8013    GetFlags {
8014        responder: FileGetFlagsResponder,
8015    },
8016    /// Sets the flags that apply to this node after it has been opened. This method does not
8017    /// require any rights.
8018    ///
8019    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8020    /// clear append mode.
8021    ///
8022    /// Errors:
8023    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8024    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8025    SetFlags {
8026        flags: Flags,
8027        responder: FileSetFlagsResponder,
8028    },
8029    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8030    /// volume has different settings or the storage is accounted seperately from the rest of the
8031    /// filesystem that may be reported instead of filesystem-wide details.
8032    QueryFilesystem {
8033        responder: FileQueryFilesystemResponder,
8034    },
8035    /// Acquires information about the node.
8036    ///
8037    /// The attributes of a node should be stable, independent of the
8038    /// specific protocol used to access it.
8039    ///
8040    /// If a particular attribute is not applicable or not supported,
8041    /// filesystems should leave the corresponding field absent.
8042    ///
8043    /// + `query` a bit-mask specifying which attributes to fetch. The server
8044    ///   should not return more than necessary.
8045    /// - `attributes` the returned attributes.
8046    ///
8047    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8048    GetAttributes {
8049        query: NodeAttributesQuery,
8050        responder: FileGetAttributesResponder,
8051    },
8052    /// Updates information about the node.
8053    ///
8054    /// + `attributes` the presence of a table field in `attributes` indicates
8055    /// the intent to update the corresponding attribute.
8056    ///
8057    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8058    ///
8059    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8060    UpdateAttributes {
8061        payload: MutableNodeAttributes,
8062        responder: FileUpdateAttributesResponder,
8063    },
8064    /// Synchronizes updates to the node to the underlying media, if it exists.
8065    ///
8066    /// This method will return when the filesystem server has flushed the
8067    /// relevant updates to the underlying media, but does not guarantee the
8068    /// underlying media has persisted the information, nor that any information
8069    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8070    /// between operations.
8071    ///
8072    /// This method does not require any rights.
8073    Sync {
8074        responder: FileSyncResponder,
8075    },
8076    /// Creates an iterator over all the extended attribute names associated
8077    /// with this node. If an error occurs it is returned as an epitaph on the
8078    /// iterator request channel, and then the channel is closed.
8079    ///
8080    /// GetExtendedAttributes can be used with any of these names to retrieve
8081    /// the associated value.
8082    ///
8083    /// This method requires the [`Rights.READ_BYTES`] right.
8084    ListExtendedAttributes {
8085        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
8086        control_handle: FileControlHandle,
8087    },
8088    /// Get the value associated with the given attribute `name` for this node.
8089    ///
8090    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8091    /// particular structure is imposed on them.
8092    ///
8093    /// This method requires the [`Rights.READ_BYTES`] right.
8094    GetExtendedAttribute {
8095        name: Vec<u8>,
8096        responder: FileGetExtendedAttributeResponder,
8097    },
8098    /// Set the value for the given attribute `name` to `value` for this node.
8099    ///
8100    /// The attribute name may exist, in which case the attribute is updated.
8101    /// If the attribute doesn't exist, it is created. The name should have no
8102    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8103    ///
8104    /// This method requires the [`Rights.WRITE_BYTES`] right.
8105    SetExtendedAttribute {
8106        name: Vec<u8>,
8107        value: ExtendedAttributeValue,
8108        mode: SetExtendedAttributeMode,
8109        responder: FileSetExtendedAttributeResponder,
8110    },
8111    /// Remove the specified extended attribute.
8112    ///
8113    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8114    ///
8115    /// This method requires the [`Rights.WRITE_BYTES`] right.
8116    RemoveExtendedAttribute {
8117        name: Vec<u8>,
8118        responder: FileRemoveExtendedAttributeResponder,
8119    },
8120    /// Reads up to 'count' bytes at the seek offset.
8121    /// The seek offset is moved forward by the number of bytes read.
8122    ///
8123    /// ## Invariants
8124    ///
8125    /// * The returned `data.length` will never be greater than `count`.
8126    /// * If `data.length` is less than `count`, it means that the seek offset
8127    ///   has reached the end of file as part of this operation.
8128    /// * If `data.length` is zero while `count` is not, it means that the
8129    ///   seek offset is already at or beyond the end of file, and no data could
8130    ///   be read.
8131    /// * If `count` is zero, the server should perform all the checks ensuring
8132    ///   read access without actually read anything, and return an empty
8133    ///   `data` vector.
8134    ///
8135    /// This method requires the [`Rights.READ_BYTES`] right.
8136    ///
8137    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8138    Read {
8139        count: u64,
8140        responder: FileReadResponder,
8141    },
8142    /// Writes data at the seek offset.
8143    /// The seek offset is moved forward by the number of bytes written.
8144    /// If the file is in append mode, the seek offset is first set to the end
8145    /// of the file, followed by the write, in one atomic step.
8146    ///
8147    /// The file size may grow if the seek offset plus `data.length` is beyond
8148    /// the current end of file.
8149    ///
8150    /// + request `data` the byte buffer to write to the file.
8151    /// - response `actual_count` the number of bytes written.
8152    ///
8153    /// ## Invariants
8154    ///
8155    /// * The returned `actual_count` will never be greater than `data.length`.
8156    /// * If the server is unable to write all the data due to e.g. not enough
8157    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8158    ///   could be written, an error is returned.
8159    /// * If `data.length` is zero, the server should perform all the checks
8160    ///   ensuring write access without mutating the file and return a
8161    ///   successful write of zero bytes.  The seek offset is still updated if
8162    ///   in append mode.
8163    ///
8164    /// This method requires the [`Rights.WRITE_BYTES`] right.
8165    Write {
8166        data: Vec<u8>,
8167        responder: FileWriteResponder,
8168    },
8169    Describe {
8170        responder: FileDescribeResponder,
8171    },
8172    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8173    /// will occur. The seek offset is specific to each file connection.
8174    ///
8175    /// + request `origin` the reference point where `offset` will be based on.
8176    /// + request `offset` the number of bytes to seek.
8177    /// - response `offset_from_start` the adjusted seek offset, from the start
8178    ///   of the file.
8179    ///
8180    /// This method does not require any rights.
8181    Seek {
8182        origin: SeekOrigin,
8183        offset: i64,
8184        responder: FileSeekResponder,
8185    },
8186    /// Reads up to 'count' bytes at the provided offset.
8187    /// Does not affect the seek offset.
8188    ///
8189    /// ## Invariants
8190    ///
8191    /// * The returned `data.length` will never be greater than `count`.
8192    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8193    ///   the end of file as part of this operation.
8194    /// * If `data.length` is zero while `count` is not, it means that `offset`
8195    ///   is at or past the end of file, and no data can be read.
8196    /// * If `count` is zero, the server should perform all the checks ensuring
8197    ///   read access without actually reading anything, and return an empty
8198    ///   `data` vector.
8199    ///
8200    /// This method requires the [`Rights.READ_BYTES`] right.
8201    ///
8202    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8203    ReadAt {
8204        count: u64,
8205        offset: u64,
8206        responder: FileReadAtResponder,
8207    },
8208    /// Writes data at the provided offset.
8209    /// Does not affect the seek offset.
8210    ///
8211    /// The file size may grow if `offset` plus `data.length` is past the
8212    /// current end of file.
8213    ///
8214    /// + request `data` the byte buffer to write to the file.
8215    /// + request `offset` the offset from start of the file to begin writing.
8216    /// - response `actual_count` the number of bytes written.
8217    ///
8218    /// ## Invariants
8219    ///
8220    /// * The returned `actual_count` will never be greater than `data.length`.
8221    /// * If the server is unable to write all the data due to e.g. not enough
8222    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8223    ///   could be written, an error is returned.
8224    /// * If `data.length` is zero, the server should perform all the checks
8225    ///   ensuring write access without mutating the file, and will return a
8226    ///   successful write of zero bytes.
8227    ///
8228    /// This method requires the [`Rights.WRITE_BYTES`] right.
8229    WriteAt {
8230        data: Vec<u8>,
8231        offset: u64,
8232        responder: FileWriteAtResponder,
8233    },
8234    /// Shrinks or grows the file size to 'length' bytes.
8235    ///
8236    /// If file size is reduced by this operation, the extra trailing data'
8237    /// is discarded.
8238    /// If file size is increased by this operation, the extended area appears
8239    /// as if it was zeroed.
8240    ///
8241    /// This method requires the [`Rights.WRITE_BYTES`] right.
8242    Resize {
8243        length: u64,
8244        responder: FileResizeResponder,
8245    },
8246    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8247    /// with the requested access rights.
8248    ///
8249    /// Implementations are not required to implement files backed by VMOs so
8250    /// this request may fail. Additionally, implementations may only support
8251    /// a certain subset of the flags. Clients should be prepared with fallback
8252    /// behavior if this request fails.
8253    ///
8254    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8255    /// implementation is free to choose the semantics of the returned VMO.
8256    ///
8257    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8258    /// - response `vmo` the requested [`zx.Handle:VMO`].
8259    /// * error a [`zx.Status`] value indicating the failure.
8260    ///
8261    /// This method requires the following rights:
8262    ///
8263    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8264    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8265    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8266    GetBackingMemory {
8267        flags: VmoFlags,
8268        responder: FileGetBackingMemoryResponder,
8269    },
8270    /// Pre-allocate on-disk space for this file.
8271    Allocate {
8272        offset: u64,
8273        length: u64,
8274        mode: AllocateMode,
8275        responder: FileAllocateResponder,
8276    },
8277    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8278    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8279    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8280    /// rejected. This method can take some time to complete as it depends on the size of the file.
8281    /// This method can be aborted by closing the connection that this method was issued on.
8282    ///
8283    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8284    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8285    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8286    /// Also returns any error that might arise from reading the file, or from flushing the file,
8287    /// such as `ZX_ERR_IO`.
8288    EnableVerity {
8289        options: VerificationOptions,
8290        responder: FileEnableVerityResponder,
8291    },
8292    /// An interaction was received which does not match any known method.
8293    #[non_exhaustive]
8294    _UnknownMethod {
8295        /// Ordinal of the method that was called.
8296        ordinal: u64,
8297        control_handle: FileControlHandle,
8298        method_type: fidl::MethodType,
8299    },
8300}
8301
8302impl FileRequest {
8303    #[allow(irrefutable_let_patterns)]
8304    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
8305        if let FileRequest::AdvisoryLock { request, responder } = self {
8306            Some((request, responder))
8307        } else {
8308            None
8309        }
8310    }
8311
8312    #[allow(irrefutable_let_patterns)]
8313    pub fn into_link_into(self) -> Option<(fdomain_client::Event, String, FileLinkIntoResponder)> {
8314        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
8315            Some((dst_parent_token, dst, responder))
8316        } else {
8317            None
8318        }
8319    }
8320
8321    #[allow(irrefutable_let_patterns)]
8322    pub fn into_clone(
8323        self,
8324    ) -> Option<(
8325        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8326        FileControlHandle,
8327    )> {
8328        if let FileRequest::Clone { request, control_handle } = self {
8329            Some((request, control_handle))
8330        } else {
8331            None
8332        }
8333    }
8334
8335    #[allow(irrefutable_let_patterns)]
8336    pub fn into_close(self) -> Option<(FileCloseResponder)> {
8337        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
8338    }
8339
8340    #[allow(irrefutable_let_patterns)]
8341    pub fn into_query(self) -> Option<(FileQueryResponder)> {
8342        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
8343    }
8344
8345    #[allow(irrefutable_let_patterns)]
8346    pub fn into_deprecated_clone(
8347        self,
8348    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, FileControlHandle)> {
8349        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
8350            Some((flags, object, control_handle))
8351        } else {
8352            None
8353        }
8354    }
8355
8356    #[allow(irrefutable_let_patterns)]
8357    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
8358        if let FileRequest::DeprecatedGetAttr { responder } = self {
8359            Some((responder))
8360        } else {
8361            None
8362        }
8363    }
8364
8365    #[allow(irrefutable_let_patterns)]
8366    pub fn into_deprecated_set_attr(
8367        self,
8368    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
8369        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
8370            Some((flags, attributes, responder))
8371        } else {
8372            None
8373        }
8374    }
8375
8376    #[allow(irrefutable_let_patterns)]
8377    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
8378        if let FileRequest::DeprecatedGetFlags { responder } = self {
8379            Some((responder))
8380        } else {
8381            None
8382        }
8383    }
8384
8385    #[allow(irrefutable_let_patterns)]
8386    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
8387        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
8388            Some((flags, responder))
8389        } else {
8390            None
8391        }
8392    }
8393
8394    #[allow(irrefutable_let_patterns)]
8395    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
8396        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
8397    }
8398
8399    #[allow(irrefutable_let_patterns)]
8400    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
8401        if let FileRequest::SetFlags { flags, responder } = self {
8402            Some((flags, responder))
8403        } else {
8404            None
8405        }
8406    }
8407
8408    #[allow(irrefutable_let_patterns)]
8409    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
8410        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
8411    }
8412
8413    #[allow(irrefutable_let_patterns)]
8414    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
8415        if let FileRequest::GetAttributes { query, responder } = self {
8416            Some((query, responder))
8417        } else {
8418            None
8419        }
8420    }
8421
8422    #[allow(irrefutable_let_patterns)]
8423    pub fn into_update_attributes(
8424        self,
8425    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
8426        if let FileRequest::UpdateAttributes { payload, responder } = self {
8427            Some((payload, responder))
8428        } else {
8429            None
8430        }
8431    }
8432
8433    #[allow(irrefutable_let_patterns)]
8434    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
8435        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
8436    }
8437
8438    #[allow(irrefutable_let_patterns)]
8439    pub fn into_list_extended_attributes(
8440        self,
8441    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
8442    {
8443        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
8444            Some((iterator, control_handle))
8445        } else {
8446            None
8447        }
8448    }
8449
8450    #[allow(irrefutable_let_patterns)]
8451    pub fn into_get_extended_attribute(
8452        self,
8453    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
8454        if let FileRequest::GetExtendedAttribute { name, responder } = self {
8455            Some((name, responder))
8456        } else {
8457            None
8458        }
8459    }
8460
8461    #[allow(irrefutable_let_patterns)]
8462    pub fn into_set_extended_attribute(
8463        self,
8464    ) -> Option<(
8465        Vec<u8>,
8466        ExtendedAttributeValue,
8467        SetExtendedAttributeMode,
8468        FileSetExtendedAttributeResponder,
8469    )> {
8470        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
8471            Some((name, value, mode, responder))
8472        } else {
8473            None
8474        }
8475    }
8476
8477    #[allow(irrefutable_let_patterns)]
8478    pub fn into_remove_extended_attribute(
8479        self,
8480    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
8481        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
8482            Some((name, responder))
8483        } else {
8484            None
8485        }
8486    }
8487
8488    #[allow(irrefutable_let_patterns)]
8489    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
8490        if let FileRequest::Read { count, responder } = self {
8491            Some((count, responder))
8492        } else {
8493            None
8494        }
8495    }
8496
8497    #[allow(irrefutable_let_patterns)]
8498    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
8499        if let FileRequest::Write { data, responder } = self {
8500            Some((data, responder))
8501        } else {
8502            None
8503        }
8504    }
8505
8506    #[allow(irrefutable_let_patterns)]
8507    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
8508        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
8509    }
8510
8511    #[allow(irrefutable_let_patterns)]
8512    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
8513        if let FileRequest::Seek { origin, offset, responder } = self {
8514            Some((origin, offset, responder))
8515        } else {
8516            None
8517        }
8518    }
8519
8520    #[allow(irrefutable_let_patterns)]
8521    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
8522        if let FileRequest::ReadAt { count, offset, responder } = self {
8523            Some((count, offset, responder))
8524        } else {
8525            None
8526        }
8527    }
8528
8529    #[allow(irrefutable_let_patterns)]
8530    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
8531        if let FileRequest::WriteAt { data, offset, responder } = self {
8532            Some((data, offset, responder))
8533        } else {
8534            None
8535        }
8536    }
8537
8538    #[allow(irrefutable_let_patterns)]
8539    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
8540        if let FileRequest::Resize { length, responder } = self {
8541            Some((length, responder))
8542        } else {
8543            None
8544        }
8545    }
8546
8547    #[allow(irrefutable_let_patterns)]
8548    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
8549        if let FileRequest::GetBackingMemory { flags, responder } = self {
8550            Some((flags, responder))
8551        } else {
8552            None
8553        }
8554    }
8555
8556    #[allow(irrefutable_let_patterns)]
8557    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
8558        if let FileRequest::Allocate { offset, length, mode, responder } = self {
8559            Some((offset, length, mode, responder))
8560        } else {
8561            None
8562        }
8563    }
8564
8565    #[allow(irrefutable_let_patterns)]
8566    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
8567        if let FileRequest::EnableVerity { options, responder } = self {
8568            Some((options, responder))
8569        } else {
8570            None
8571        }
8572    }
8573
8574    /// Name of the method defined in FIDL
8575    pub fn method_name(&self) -> &'static str {
8576        match *self {
8577            FileRequest::AdvisoryLock { .. } => "advisory_lock",
8578            FileRequest::LinkInto { .. } => "link_into",
8579            FileRequest::Clone { .. } => "clone",
8580            FileRequest::Close { .. } => "close",
8581            FileRequest::Query { .. } => "query",
8582            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
8583            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
8584            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
8585            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
8586            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
8587            FileRequest::GetFlags { .. } => "get_flags",
8588            FileRequest::SetFlags { .. } => "set_flags",
8589            FileRequest::QueryFilesystem { .. } => "query_filesystem",
8590            FileRequest::GetAttributes { .. } => "get_attributes",
8591            FileRequest::UpdateAttributes { .. } => "update_attributes",
8592            FileRequest::Sync { .. } => "sync",
8593            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
8594            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
8595            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
8596            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
8597            FileRequest::Read { .. } => "read",
8598            FileRequest::Write { .. } => "write",
8599            FileRequest::Describe { .. } => "describe",
8600            FileRequest::Seek { .. } => "seek",
8601            FileRequest::ReadAt { .. } => "read_at",
8602            FileRequest::WriteAt { .. } => "write_at",
8603            FileRequest::Resize { .. } => "resize",
8604            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
8605            FileRequest::Allocate { .. } => "allocate",
8606            FileRequest::EnableVerity { .. } => "enable_verity",
8607            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8608                "unknown one-way method"
8609            }
8610            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8611                "unknown two-way method"
8612            }
8613        }
8614    }
8615}
8616
8617#[derive(Debug, Clone)]
8618pub struct FileControlHandle {
8619    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8620}
8621
8622impl FileControlHandle {
8623    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8624        self.inner.shutdown_with_epitaph(status.into())
8625    }
8626}
8627
8628impl fdomain_client::fidl::ControlHandle for FileControlHandle {
8629    fn shutdown(&self) {
8630        self.inner.shutdown()
8631    }
8632
8633    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8634        self.inner.shutdown_with_epitaph(status)
8635    }
8636
8637    fn is_closed(&self) -> bool {
8638        self.inner.channel().is_closed()
8639    }
8640    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8641        self.inner.channel().on_closed()
8642    }
8643}
8644
8645impl FileControlHandle {
8646    pub fn send_on_open_(
8647        &self,
8648        mut s: i32,
8649        mut info: Option<NodeInfoDeprecated>,
8650    ) -> Result<(), fidl::Error> {
8651        self.inner.send::<NodeOnOpenRequest>(
8652            (s, info.as_mut()),
8653            0,
8654            0x7fc7bbb1dbfd1972,
8655            fidl::encoding::DynamicFlags::FLEXIBLE,
8656        )
8657    }
8658
8659    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
8660        self.inner.send::<Representation>(
8661            &mut payload,
8662            0,
8663            0x5cb40567d80a510c,
8664            fidl::encoding::DynamicFlags::empty(),
8665        )
8666    }
8667}
8668
8669#[must_use = "FIDL methods require a response to be sent"]
8670#[derive(Debug)]
8671pub struct FileAdvisoryLockResponder {
8672    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8673    tx_id: u32,
8674}
8675
8676/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8677/// if the responder is dropped without sending a response, so that the client
8678/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8679impl std::ops::Drop for FileAdvisoryLockResponder {
8680    fn drop(&mut self) {
8681        self.control_handle.shutdown();
8682        // Safety: drops once, never accessed again
8683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8684    }
8685}
8686
8687impl fdomain_client::fidl::Responder for FileAdvisoryLockResponder {
8688    type ControlHandle = FileControlHandle;
8689
8690    fn control_handle(&self) -> &FileControlHandle {
8691        &self.control_handle
8692    }
8693
8694    fn drop_without_shutdown(mut self) {
8695        // Safety: drops once, never accessed again due to mem::forget
8696        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8697        // Prevent Drop from running (which would shut down the channel)
8698        std::mem::forget(self);
8699    }
8700}
8701
8702impl FileAdvisoryLockResponder {
8703    /// Sends a response to the FIDL transaction.
8704    ///
8705    /// Sets the channel to shutdown if an error occurs.
8706    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8707        let _result = self.send_raw(result);
8708        if _result.is_err() {
8709            self.control_handle.shutdown();
8710        }
8711        self.drop_without_shutdown();
8712        _result
8713    }
8714
8715    /// Similar to "send" but does not shutdown the channel if an error occurs.
8716    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8717        let _result = self.send_raw(result);
8718        self.drop_without_shutdown();
8719        _result
8720    }
8721
8722    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8723        self.control_handle
8724            .inner
8725            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8726                result,
8727                self.tx_id,
8728                0x6ee9c0ad53ec87aa,
8729                fidl::encoding::DynamicFlags::empty(),
8730            )
8731    }
8732}
8733
8734#[must_use = "FIDL methods require a response to be sent"]
8735#[derive(Debug)]
8736pub struct FileLinkIntoResponder {
8737    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8738    tx_id: u32,
8739}
8740
8741/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8742/// if the responder is dropped without sending a response, so that the client
8743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8744impl std::ops::Drop for FileLinkIntoResponder {
8745    fn drop(&mut self) {
8746        self.control_handle.shutdown();
8747        // Safety: drops once, never accessed again
8748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8749    }
8750}
8751
8752impl fdomain_client::fidl::Responder for FileLinkIntoResponder {
8753    type ControlHandle = FileControlHandle;
8754
8755    fn control_handle(&self) -> &FileControlHandle {
8756        &self.control_handle
8757    }
8758
8759    fn drop_without_shutdown(mut self) {
8760        // Safety: drops once, never accessed again due to mem::forget
8761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8762        // Prevent Drop from running (which would shut down the channel)
8763        std::mem::forget(self);
8764    }
8765}
8766
8767impl FileLinkIntoResponder {
8768    /// Sends a response to the FIDL transaction.
8769    ///
8770    /// Sets the channel to shutdown if an error occurs.
8771    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8772        let _result = self.send_raw(result);
8773        if _result.is_err() {
8774            self.control_handle.shutdown();
8775        }
8776        self.drop_without_shutdown();
8777        _result
8778    }
8779
8780    /// Similar to "send" but does not shutdown the channel if an error occurs.
8781    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8782        let _result = self.send_raw(result);
8783        self.drop_without_shutdown();
8784        _result
8785    }
8786
8787    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8788        self.control_handle
8789            .inner
8790            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8791                result,
8792                self.tx_id,
8793                0x54f3949246a03e74,
8794                fidl::encoding::DynamicFlags::empty(),
8795            )
8796    }
8797}
8798
8799#[must_use = "FIDL methods require a response to be sent"]
8800#[derive(Debug)]
8801pub struct FileCloseResponder {
8802    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8803    tx_id: u32,
8804}
8805
8806/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8807/// if the responder is dropped without sending a response, so that the client
8808/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8809impl std::ops::Drop for FileCloseResponder {
8810    fn drop(&mut self) {
8811        self.control_handle.shutdown();
8812        // Safety: drops once, never accessed again
8813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8814    }
8815}
8816
8817impl fdomain_client::fidl::Responder for FileCloseResponder {
8818    type ControlHandle = FileControlHandle;
8819
8820    fn control_handle(&self) -> &FileControlHandle {
8821        &self.control_handle
8822    }
8823
8824    fn drop_without_shutdown(mut self) {
8825        // Safety: drops once, never accessed again due to mem::forget
8826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8827        // Prevent Drop from running (which would shut down the channel)
8828        std::mem::forget(self);
8829    }
8830}
8831
8832impl FileCloseResponder {
8833    /// Sends a response to the FIDL transaction.
8834    ///
8835    /// Sets the channel to shutdown if an error occurs.
8836    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8837        let _result = self.send_raw(result);
8838        if _result.is_err() {
8839            self.control_handle.shutdown();
8840        }
8841        self.drop_without_shutdown();
8842        _result
8843    }
8844
8845    /// Similar to "send" but does not shutdown the channel if an error occurs.
8846    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8847        let _result = self.send_raw(result);
8848        self.drop_without_shutdown();
8849        _result
8850    }
8851
8852    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8853        self.control_handle
8854            .inner
8855            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8856                result,
8857                self.tx_id,
8858                0x5ac5d459ad7f657e,
8859                fidl::encoding::DynamicFlags::empty(),
8860            )
8861    }
8862}
8863
8864#[must_use = "FIDL methods require a response to be sent"]
8865#[derive(Debug)]
8866pub struct FileQueryResponder {
8867    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8868    tx_id: u32,
8869}
8870
8871/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8872/// if the responder is dropped without sending a response, so that the client
8873/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8874impl std::ops::Drop for FileQueryResponder {
8875    fn drop(&mut self) {
8876        self.control_handle.shutdown();
8877        // Safety: drops once, never accessed again
8878        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8879    }
8880}
8881
8882impl fdomain_client::fidl::Responder for FileQueryResponder {
8883    type ControlHandle = FileControlHandle;
8884
8885    fn control_handle(&self) -> &FileControlHandle {
8886        &self.control_handle
8887    }
8888
8889    fn drop_without_shutdown(mut self) {
8890        // Safety: drops once, never accessed again due to mem::forget
8891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8892        // Prevent Drop from running (which would shut down the channel)
8893        std::mem::forget(self);
8894    }
8895}
8896
8897impl FileQueryResponder {
8898    /// Sends a response to the FIDL transaction.
8899    ///
8900    /// Sets the channel to shutdown if an error occurs.
8901    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8902        let _result = self.send_raw(protocol);
8903        if _result.is_err() {
8904            self.control_handle.shutdown();
8905        }
8906        self.drop_without_shutdown();
8907        _result
8908    }
8909
8910    /// Similar to "send" but does not shutdown the channel if an error occurs.
8911    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8912        let _result = self.send_raw(protocol);
8913        self.drop_without_shutdown();
8914        _result
8915    }
8916
8917    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8918        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
8919            (protocol,),
8920            self.tx_id,
8921            0x2658edee9decfc06,
8922            fidl::encoding::DynamicFlags::empty(),
8923        )
8924    }
8925}
8926
8927#[must_use = "FIDL methods require a response to be sent"]
8928#[derive(Debug)]
8929pub struct FileDeprecatedGetAttrResponder {
8930    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8931    tx_id: u32,
8932}
8933
8934/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8935/// if the responder is dropped without sending a response, so that the client
8936/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8937impl std::ops::Drop for FileDeprecatedGetAttrResponder {
8938    fn drop(&mut self) {
8939        self.control_handle.shutdown();
8940        // Safety: drops once, never accessed again
8941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8942    }
8943}
8944
8945impl fdomain_client::fidl::Responder for FileDeprecatedGetAttrResponder {
8946    type ControlHandle = FileControlHandle;
8947
8948    fn control_handle(&self) -> &FileControlHandle {
8949        &self.control_handle
8950    }
8951
8952    fn drop_without_shutdown(mut self) {
8953        // Safety: drops once, never accessed again due to mem::forget
8954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8955        // Prevent Drop from running (which would shut down the channel)
8956        std::mem::forget(self);
8957    }
8958}
8959
8960impl FileDeprecatedGetAttrResponder {
8961    /// Sends a response to the FIDL transaction.
8962    ///
8963    /// Sets the channel to shutdown if an error occurs.
8964    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8965        let _result = self.send_raw(s, attributes);
8966        if _result.is_err() {
8967            self.control_handle.shutdown();
8968        }
8969        self.drop_without_shutdown();
8970        _result
8971    }
8972
8973    /// Similar to "send" but does not shutdown the channel if an error occurs.
8974    pub fn send_no_shutdown_on_err(
8975        self,
8976        mut s: i32,
8977        mut attributes: &NodeAttributes,
8978    ) -> Result<(), fidl::Error> {
8979        let _result = self.send_raw(s, attributes);
8980        self.drop_without_shutdown();
8981        _result
8982    }
8983
8984    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8985        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
8986            (s, attributes),
8987            self.tx_id,
8988            0x78985e216314dafd,
8989            fidl::encoding::DynamicFlags::empty(),
8990        )
8991    }
8992}
8993
8994#[must_use = "FIDL methods require a response to be sent"]
8995#[derive(Debug)]
8996pub struct FileDeprecatedSetAttrResponder {
8997    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8998    tx_id: u32,
8999}
9000
9001/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9002/// if the responder is dropped without sending a response, so that the client
9003/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9004impl std::ops::Drop for FileDeprecatedSetAttrResponder {
9005    fn drop(&mut self) {
9006        self.control_handle.shutdown();
9007        // Safety: drops once, never accessed again
9008        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9009    }
9010}
9011
9012impl fdomain_client::fidl::Responder for FileDeprecatedSetAttrResponder {
9013    type ControlHandle = FileControlHandle;
9014
9015    fn control_handle(&self) -> &FileControlHandle {
9016        &self.control_handle
9017    }
9018
9019    fn drop_without_shutdown(mut self) {
9020        // Safety: drops once, never accessed again due to mem::forget
9021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9022        // Prevent Drop from running (which would shut down the channel)
9023        std::mem::forget(self);
9024    }
9025}
9026
9027impl FileDeprecatedSetAttrResponder {
9028    /// Sends a response to the FIDL transaction.
9029    ///
9030    /// Sets the channel to shutdown if an error occurs.
9031    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9032        let _result = self.send_raw(s);
9033        if _result.is_err() {
9034            self.control_handle.shutdown();
9035        }
9036        self.drop_without_shutdown();
9037        _result
9038    }
9039
9040    /// Similar to "send" but does not shutdown the channel if an error occurs.
9041    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9042        let _result = self.send_raw(s);
9043        self.drop_without_shutdown();
9044        _result
9045    }
9046
9047    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9048        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
9049            (s,),
9050            self.tx_id,
9051            0x4186c0f40d938f46,
9052            fidl::encoding::DynamicFlags::empty(),
9053        )
9054    }
9055}
9056
9057#[must_use = "FIDL methods require a response to be sent"]
9058#[derive(Debug)]
9059pub struct FileDeprecatedGetFlagsResponder {
9060    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9061    tx_id: u32,
9062}
9063
9064/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9065/// if the responder is dropped without sending a response, so that the client
9066/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9067impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
9068    fn drop(&mut self) {
9069        self.control_handle.shutdown();
9070        // Safety: drops once, never accessed again
9071        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9072    }
9073}
9074
9075impl fdomain_client::fidl::Responder for FileDeprecatedGetFlagsResponder {
9076    type ControlHandle = FileControlHandle;
9077
9078    fn control_handle(&self) -> &FileControlHandle {
9079        &self.control_handle
9080    }
9081
9082    fn drop_without_shutdown(mut self) {
9083        // Safety: drops once, never accessed again due to mem::forget
9084        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9085        // Prevent Drop from running (which would shut down the channel)
9086        std::mem::forget(self);
9087    }
9088}
9089
9090impl FileDeprecatedGetFlagsResponder {
9091    /// Sends a response to the FIDL transaction.
9092    ///
9093    /// Sets the channel to shutdown if an error occurs.
9094    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9095        let _result = self.send_raw(s, flags);
9096        if _result.is_err() {
9097            self.control_handle.shutdown();
9098        }
9099        self.drop_without_shutdown();
9100        _result
9101    }
9102
9103    /// Similar to "send" but does not shutdown the channel if an error occurs.
9104    pub fn send_no_shutdown_on_err(
9105        self,
9106        mut s: i32,
9107        mut flags: OpenFlags,
9108    ) -> Result<(), fidl::Error> {
9109        let _result = self.send_raw(s, flags);
9110        self.drop_without_shutdown();
9111        _result
9112    }
9113
9114    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9115        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
9116            (s, flags),
9117            self.tx_id,
9118            0x5b88fffb8eda3aa1,
9119            fidl::encoding::DynamicFlags::empty(),
9120        )
9121    }
9122}
9123
9124#[must_use = "FIDL methods require a response to be sent"]
9125#[derive(Debug)]
9126pub struct FileDeprecatedSetFlagsResponder {
9127    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9128    tx_id: u32,
9129}
9130
9131/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9132/// if the responder is dropped without sending a response, so that the client
9133/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9134impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
9135    fn drop(&mut self) {
9136        self.control_handle.shutdown();
9137        // Safety: drops once, never accessed again
9138        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9139    }
9140}
9141
9142impl fdomain_client::fidl::Responder for FileDeprecatedSetFlagsResponder {
9143    type ControlHandle = FileControlHandle;
9144
9145    fn control_handle(&self) -> &FileControlHandle {
9146        &self.control_handle
9147    }
9148
9149    fn drop_without_shutdown(mut self) {
9150        // Safety: drops once, never accessed again due to mem::forget
9151        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9152        // Prevent Drop from running (which would shut down the channel)
9153        std::mem::forget(self);
9154    }
9155}
9156
9157impl FileDeprecatedSetFlagsResponder {
9158    /// Sends a response to the FIDL transaction.
9159    ///
9160    /// Sets the channel to shutdown if an error occurs.
9161    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9162        let _result = self.send_raw(s);
9163        if _result.is_err() {
9164            self.control_handle.shutdown();
9165        }
9166        self.drop_without_shutdown();
9167        _result
9168    }
9169
9170    /// Similar to "send" but does not shutdown the channel if an error occurs.
9171    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9172        let _result = self.send_raw(s);
9173        self.drop_without_shutdown();
9174        _result
9175    }
9176
9177    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9178        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
9179            (s,),
9180            self.tx_id,
9181            0x5295b76c71fde733,
9182            fidl::encoding::DynamicFlags::empty(),
9183        )
9184    }
9185}
9186
9187#[must_use = "FIDL methods require a response to be sent"]
9188#[derive(Debug)]
9189pub struct FileGetFlagsResponder {
9190    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9191    tx_id: u32,
9192}
9193
9194/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9195/// if the responder is dropped without sending a response, so that the client
9196/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9197impl std::ops::Drop for FileGetFlagsResponder {
9198    fn drop(&mut self) {
9199        self.control_handle.shutdown();
9200        // Safety: drops once, never accessed again
9201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9202    }
9203}
9204
9205impl fdomain_client::fidl::Responder for FileGetFlagsResponder {
9206    type ControlHandle = FileControlHandle;
9207
9208    fn control_handle(&self) -> &FileControlHandle {
9209        &self.control_handle
9210    }
9211
9212    fn drop_without_shutdown(mut self) {
9213        // Safety: drops once, never accessed again due to mem::forget
9214        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9215        // Prevent Drop from running (which would shut down the channel)
9216        std::mem::forget(self);
9217    }
9218}
9219
9220impl FileGetFlagsResponder {
9221    /// Sends a response to the FIDL transaction.
9222    ///
9223    /// Sets the channel to shutdown if an error occurs.
9224    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9225        let _result = self.send_raw(result);
9226        if _result.is_err() {
9227            self.control_handle.shutdown();
9228        }
9229        self.drop_without_shutdown();
9230        _result
9231    }
9232
9233    /// Similar to "send" but does not shutdown the channel if an error occurs.
9234    pub fn send_no_shutdown_on_err(
9235        self,
9236        mut result: Result<Flags, i32>,
9237    ) -> Result<(), fidl::Error> {
9238        let _result = self.send_raw(result);
9239        self.drop_without_shutdown();
9240        _result
9241    }
9242
9243    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9244        self.control_handle
9245            .inner
9246            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
9247                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
9248                self.tx_id,
9249                0x176eb318f64ec23,
9250                fidl::encoding::DynamicFlags::FLEXIBLE,
9251            )
9252    }
9253}
9254
9255#[must_use = "FIDL methods require a response to be sent"]
9256#[derive(Debug)]
9257pub struct FileSetFlagsResponder {
9258    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9259    tx_id: u32,
9260}
9261
9262/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9263/// if the responder is dropped without sending a response, so that the client
9264/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9265impl std::ops::Drop for FileSetFlagsResponder {
9266    fn drop(&mut self) {
9267        self.control_handle.shutdown();
9268        // Safety: drops once, never accessed again
9269        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9270    }
9271}
9272
9273impl fdomain_client::fidl::Responder for FileSetFlagsResponder {
9274    type ControlHandle = FileControlHandle;
9275
9276    fn control_handle(&self) -> &FileControlHandle {
9277        &self.control_handle
9278    }
9279
9280    fn drop_without_shutdown(mut self) {
9281        // Safety: drops once, never accessed again due to mem::forget
9282        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9283        // Prevent Drop from running (which would shut down the channel)
9284        std::mem::forget(self);
9285    }
9286}
9287
9288impl FileSetFlagsResponder {
9289    /// Sends a response to the FIDL transaction.
9290    ///
9291    /// Sets the channel to shutdown if an error occurs.
9292    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9293        let _result = self.send_raw(result);
9294        if _result.is_err() {
9295            self.control_handle.shutdown();
9296        }
9297        self.drop_without_shutdown();
9298        _result
9299    }
9300
9301    /// Similar to "send" but does not shutdown the channel if an error occurs.
9302    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9303        let _result = self.send_raw(result);
9304        self.drop_without_shutdown();
9305        _result
9306    }
9307
9308    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9309        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9310            fidl::encoding::EmptyStruct,
9311            i32,
9312        >>(
9313            fidl::encoding::FlexibleResult::new(result),
9314            self.tx_id,
9315            0x55a8028685791ea8,
9316            fidl::encoding::DynamicFlags::FLEXIBLE,
9317        )
9318    }
9319}
9320
9321#[must_use = "FIDL methods require a response to be sent"]
9322#[derive(Debug)]
9323pub struct FileQueryFilesystemResponder {
9324    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9325    tx_id: u32,
9326}
9327
9328/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9329/// if the responder is dropped without sending a response, so that the client
9330/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9331impl std::ops::Drop for FileQueryFilesystemResponder {
9332    fn drop(&mut self) {
9333        self.control_handle.shutdown();
9334        // Safety: drops once, never accessed again
9335        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9336    }
9337}
9338
9339impl fdomain_client::fidl::Responder for FileQueryFilesystemResponder {
9340    type ControlHandle = FileControlHandle;
9341
9342    fn control_handle(&self) -> &FileControlHandle {
9343        &self.control_handle
9344    }
9345
9346    fn drop_without_shutdown(mut self) {
9347        // Safety: drops once, never accessed again due to mem::forget
9348        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9349        // Prevent Drop from running (which would shut down the channel)
9350        std::mem::forget(self);
9351    }
9352}
9353
9354impl FileQueryFilesystemResponder {
9355    /// Sends a response to the FIDL transaction.
9356    ///
9357    /// Sets the channel to shutdown if an error occurs.
9358    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9359        let _result = self.send_raw(s, info);
9360        if _result.is_err() {
9361            self.control_handle.shutdown();
9362        }
9363        self.drop_without_shutdown();
9364        _result
9365    }
9366
9367    /// Similar to "send" but does not shutdown the channel if an error occurs.
9368    pub fn send_no_shutdown_on_err(
9369        self,
9370        mut s: i32,
9371        mut info: Option<&FilesystemInfo>,
9372    ) -> Result<(), fidl::Error> {
9373        let _result = self.send_raw(s, info);
9374        self.drop_without_shutdown();
9375        _result
9376    }
9377
9378    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9379        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
9380            (s, info),
9381            self.tx_id,
9382            0x6f344a1c6b0a0610,
9383            fidl::encoding::DynamicFlags::empty(),
9384        )
9385    }
9386}
9387
9388#[must_use = "FIDL methods require a response to be sent"]
9389#[derive(Debug)]
9390pub struct FileGetAttributesResponder {
9391    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9392    tx_id: u32,
9393}
9394
9395/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9396/// if the responder is dropped without sending a response, so that the client
9397/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9398impl std::ops::Drop for FileGetAttributesResponder {
9399    fn drop(&mut self) {
9400        self.control_handle.shutdown();
9401        // Safety: drops once, never accessed again
9402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9403    }
9404}
9405
9406impl fdomain_client::fidl::Responder for FileGetAttributesResponder {
9407    type ControlHandle = FileControlHandle;
9408
9409    fn control_handle(&self) -> &FileControlHandle {
9410        &self.control_handle
9411    }
9412
9413    fn drop_without_shutdown(mut self) {
9414        // Safety: drops once, never accessed again due to mem::forget
9415        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9416        // Prevent Drop from running (which would shut down the channel)
9417        std::mem::forget(self);
9418    }
9419}
9420
9421impl FileGetAttributesResponder {
9422    /// Sends a response to the FIDL transaction.
9423    ///
9424    /// Sets the channel to shutdown if an error occurs.
9425    pub fn send(
9426        self,
9427        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9428    ) -> Result<(), fidl::Error> {
9429        let _result = self.send_raw(result);
9430        if _result.is_err() {
9431            self.control_handle.shutdown();
9432        }
9433        self.drop_without_shutdown();
9434        _result
9435    }
9436
9437    /// Similar to "send" but does not shutdown the channel if an error occurs.
9438    pub fn send_no_shutdown_on_err(
9439        self,
9440        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9441    ) -> Result<(), fidl::Error> {
9442        let _result = self.send_raw(result);
9443        self.drop_without_shutdown();
9444        _result
9445    }
9446
9447    fn send_raw(
9448        &self,
9449        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9450    ) -> Result<(), fidl::Error> {
9451        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
9452            result,
9453            self.tx_id,
9454            0x3d4396a638ea053b,
9455            fidl::encoding::DynamicFlags::empty(),
9456        )
9457    }
9458}
9459
9460#[must_use = "FIDL methods require a response to be sent"]
9461#[derive(Debug)]
9462pub struct FileUpdateAttributesResponder {
9463    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9464    tx_id: u32,
9465}
9466
9467/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9468/// if the responder is dropped without sending a response, so that the client
9469/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9470impl std::ops::Drop for FileUpdateAttributesResponder {
9471    fn drop(&mut self) {
9472        self.control_handle.shutdown();
9473        // Safety: drops once, never accessed again
9474        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9475    }
9476}
9477
9478impl fdomain_client::fidl::Responder for FileUpdateAttributesResponder {
9479    type ControlHandle = FileControlHandle;
9480
9481    fn control_handle(&self) -> &FileControlHandle {
9482        &self.control_handle
9483    }
9484
9485    fn drop_without_shutdown(mut self) {
9486        // Safety: drops once, never accessed again due to mem::forget
9487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9488        // Prevent Drop from running (which would shut down the channel)
9489        std::mem::forget(self);
9490    }
9491}
9492
9493impl FileUpdateAttributesResponder {
9494    /// Sends a response to the FIDL transaction.
9495    ///
9496    /// Sets the channel to shutdown if an error occurs.
9497    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9498        let _result = self.send_raw(result);
9499        if _result.is_err() {
9500            self.control_handle.shutdown();
9501        }
9502        self.drop_without_shutdown();
9503        _result
9504    }
9505
9506    /// Similar to "send" but does not shutdown the channel if an error occurs.
9507    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9508        let _result = self.send_raw(result);
9509        self.drop_without_shutdown();
9510        _result
9511    }
9512
9513    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9514        self.control_handle
9515            .inner
9516            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9517                result,
9518                self.tx_id,
9519                0x3308c1da5a89bf08,
9520                fidl::encoding::DynamicFlags::empty(),
9521            )
9522    }
9523}
9524
9525#[must_use = "FIDL methods require a response to be sent"]
9526#[derive(Debug)]
9527pub struct FileSyncResponder {
9528    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9529    tx_id: u32,
9530}
9531
9532/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9533/// if the responder is dropped without sending a response, so that the client
9534/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9535impl std::ops::Drop for FileSyncResponder {
9536    fn drop(&mut self) {
9537        self.control_handle.shutdown();
9538        // Safety: drops once, never accessed again
9539        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9540    }
9541}
9542
9543impl fdomain_client::fidl::Responder for FileSyncResponder {
9544    type ControlHandle = FileControlHandle;
9545
9546    fn control_handle(&self) -> &FileControlHandle {
9547        &self.control_handle
9548    }
9549
9550    fn drop_without_shutdown(mut self) {
9551        // Safety: drops once, never accessed again due to mem::forget
9552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9553        // Prevent Drop from running (which would shut down the channel)
9554        std::mem::forget(self);
9555    }
9556}
9557
9558impl FileSyncResponder {
9559    /// Sends a response to the FIDL transaction.
9560    ///
9561    /// Sets the channel to shutdown if an error occurs.
9562    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9563        let _result = self.send_raw(result);
9564        if _result.is_err() {
9565            self.control_handle.shutdown();
9566        }
9567        self.drop_without_shutdown();
9568        _result
9569    }
9570
9571    /// Similar to "send" but does not shutdown the channel if an error occurs.
9572    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9573        let _result = self.send_raw(result);
9574        self.drop_without_shutdown();
9575        _result
9576    }
9577
9578    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9579        self.control_handle
9580            .inner
9581            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9582                result,
9583                self.tx_id,
9584                0x2c5c27ca0ab5dc49,
9585                fidl::encoding::DynamicFlags::empty(),
9586            )
9587    }
9588}
9589
9590#[must_use = "FIDL methods require a response to be sent"]
9591#[derive(Debug)]
9592pub struct FileGetExtendedAttributeResponder {
9593    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9594    tx_id: u32,
9595}
9596
9597/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9598/// if the responder is dropped without sending a response, so that the client
9599/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9600impl std::ops::Drop for FileGetExtendedAttributeResponder {
9601    fn drop(&mut self) {
9602        self.control_handle.shutdown();
9603        // Safety: drops once, never accessed again
9604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9605    }
9606}
9607
9608impl fdomain_client::fidl::Responder for FileGetExtendedAttributeResponder {
9609    type ControlHandle = FileControlHandle;
9610
9611    fn control_handle(&self) -> &FileControlHandle {
9612        &self.control_handle
9613    }
9614
9615    fn drop_without_shutdown(mut self) {
9616        // Safety: drops once, never accessed again due to mem::forget
9617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9618        // Prevent Drop from running (which would shut down the channel)
9619        std::mem::forget(self);
9620    }
9621}
9622
9623impl FileGetExtendedAttributeResponder {
9624    /// Sends a response to the FIDL transaction.
9625    ///
9626    /// Sets the channel to shutdown if an error occurs.
9627    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9628        let _result = self.send_raw(result);
9629        if _result.is_err() {
9630            self.control_handle.shutdown();
9631        }
9632        self.drop_without_shutdown();
9633        _result
9634    }
9635
9636    /// Similar to "send" but does not shutdown the channel if an error occurs.
9637    pub fn send_no_shutdown_on_err(
9638        self,
9639        mut result: Result<ExtendedAttributeValue, i32>,
9640    ) -> Result<(), fidl::Error> {
9641        let _result = self.send_raw(result);
9642        self.drop_without_shutdown();
9643        _result
9644    }
9645
9646    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9647        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
9648            result.as_mut().map_err(|e| *e),
9649            self.tx_id,
9650            0x45ffa3ccfdeb76db,
9651            fidl::encoding::DynamicFlags::empty(),
9652        )
9653    }
9654}
9655
9656#[must_use = "FIDL methods require a response to be sent"]
9657#[derive(Debug)]
9658pub struct FileSetExtendedAttributeResponder {
9659    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9660    tx_id: u32,
9661}
9662
9663/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9664/// if the responder is dropped without sending a response, so that the client
9665/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9666impl std::ops::Drop for FileSetExtendedAttributeResponder {
9667    fn drop(&mut self) {
9668        self.control_handle.shutdown();
9669        // Safety: drops once, never accessed again
9670        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9671    }
9672}
9673
9674impl fdomain_client::fidl::Responder for FileSetExtendedAttributeResponder {
9675    type ControlHandle = FileControlHandle;
9676
9677    fn control_handle(&self) -> &FileControlHandle {
9678        &self.control_handle
9679    }
9680
9681    fn drop_without_shutdown(mut self) {
9682        // Safety: drops once, never accessed again due to mem::forget
9683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9684        // Prevent Drop from running (which would shut down the channel)
9685        std::mem::forget(self);
9686    }
9687}
9688
9689impl FileSetExtendedAttributeResponder {
9690    /// Sends a response to the FIDL transaction.
9691    ///
9692    /// Sets the channel to shutdown if an error occurs.
9693    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9694        let _result = self.send_raw(result);
9695        if _result.is_err() {
9696            self.control_handle.shutdown();
9697        }
9698        self.drop_without_shutdown();
9699        _result
9700    }
9701
9702    /// Similar to "send" but does not shutdown the channel if an error occurs.
9703    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9704        let _result = self.send_raw(result);
9705        self.drop_without_shutdown();
9706        _result
9707    }
9708
9709    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9710        self.control_handle
9711            .inner
9712            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9713                result,
9714                self.tx_id,
9715                0x4a951362f681f23c,
9716                fidl::encoding::DynamicFlags::empty(),
9717            )
9718    }
9719}
9720
9721#[must_use = "FIDL methods require a response to be sent"]
9722#[derive(Debug)]
9723pub struct FileRemoveExtendedAttributeResponder {
9724    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9725    tx_id: u32,
9726}
9727
9728/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9729/// if the responder is dropped without sending a response, so that the client
9730/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9731impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
9732    fn drop(&mut self) {
9733        self.control_handle.shutdown();
9734        // Safety: drops once, never accessed again
9735        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9736    }
9737}
9738
9739impl fdomain_client::fidl::Responder for FileRemoveExtendedAttributeResponder {
9740    type ControlHandle = FileControlHandle;
9741
9742    fn control_handle(&self) -> &FileControlHandle {
9743        &self.control_handle
9744    }
9745
9746    fn drop_without_shutdown(mut self) {
9747        // Safety: drops once, never accessed again due to mem::forget
9748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9749        // Prevent Drop from running (which would shut down the channel)
9750        std::mem::forget(self);
9751    }
9752}
9753
9754impl FileRemoveExtendedAttributeResponder {
9755    /// Sends a response to the FIDL transaction.
9756    ///
9757    /// Sets the channel to shutdown if an error occurs.
9758    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9759        let _result = self.send_raw(result);
9760        if _result.is_err() {
9761            self.control_handle.shutdown();
9762        }
9763        self.drop_without_shutdown();
9764        _result
9765    }
9766
9767    /// Similar to "send" but does not shutdown the channel if an error occurs.
9768    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9769        let _result = self.send_raw(result);
9770        self.drop_without_shutdown();
9771        _result
9772    }
9773
9774    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9775        self.control_handle
9776            .inner
9777            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9778                result,
9779                self.tx_id,
9780                0x7a0b9f3a9bf9032d,
9781                fidl::encoding::DynamicFlags::empty(),
9782            )
9783    }
9784}
9785
9786#[must_use = "FIDL methods require a response to be sent"]
9787#[derive(Debug)]
9788pub struct FileReadResponder {
9789    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9790    tx_id: u32,
9791}
9792
9793/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9794/// if the responder is dropped without sending a response, so that the client
9795/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9796impl std::ops::Drop for FileReadResponder {
9797    fn drop(&mut self) {
9798        self.control_handle.shutdown();
9799        // Safety: drops once, never accessed again
9800        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9801    }
9802}
9803
9804impl fdomain_client::fidl::Responder for FileReadResponder {
9805    type ControlHandle = FileControlHandle;
9806
9807    fn control_handle(&self) -> &FileControlHandle {
9808        &self.control_handle
9809    }
9810
9811    fn drop_without_shutdown(mut self) {
9812        // Safety: drops once, never accessed again due to mem::forget
9813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9814        // Prevent Drop from running (which would shut down the channel)
9815        std::mem::forget(self);
9816    }
9817}
9818
9819impl FileReadResponder {
9820    /// Sends a response to the FIDL transaction.
9821    ///
9822    /// Sets the channel to shutdown if an error occurs.
9823    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9824        let _result = self.send_raw(result);
9825        if _result.is_err() {
9826            self.control_handle.shutdown();
9827        }
9828        self.drop_without_shutdown();
9829        _result
9830    }
9831
9832    /// Similar to "send" but does not shutdown the channel if an error occurs.
9833    pub fn send_no_shutdown_on_err(
9834        self,
9835        mut result: Result<&[u8], i32>,
9836    ) -> Result<(), fidl::Error> {
9837        let _result = self.send_raw(result);
9838        self.drop_without_shutdown();
9839        _result
9840    }
9841
9842    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9843        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
9844            result.map(|data| (data,)),
9845            self.tx_id,
9846            0x57e419a298c8ede,
9847            fidl::encoding::DynamicFlags::empty(),
9848        )
9849    }
9850}
9851
9852#[must_use = "FIDL methods require a response to be sent"]
9853#[derive(Debug)]
9854pub struct FileWriteResponder {
9855    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9856    tx_id: u32,
9857}
9858
9859/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9860/// if the responder is dropped without sending a response, so that the client
9861/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9862impl std::ops::Drop for FileWriteResponder {
9863    fn drop(&mut self) {
9864        self.control_handle.shutdown();
9865        // Safety: drops once, never accessed again
9866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9867    }
9868}
9869
9870impl fdomain_client::fidl::Responder for FileWriteResponder {
9871    type ControlHandle = FileControlHandle;
9872
9873    fn control_handle(&self) -> &FileControlHandle {
9874        &self.control_handle
9875    }
9876
9877    fn drop_without_shutdown(mut self) {
9878        // Safety: drops once, never accessed again due to mem::forget
9879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9880        // Prevent Drop from running (which would shut down the channel)
9881        std::mem::forget(self);
9882    }
9883}
9884
9885impl FileWriteResponder {
9886    /// Sends a response to the FIDL transaction.
9887    ///
9888    /// Sets the channel to shutdown if an error occurs.
9889    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9890        let _result = self.send_raw(result);
9891        if _result.is_err() {
9892            self.control_handle.shutdown();
9893        }
9894        self.drop_without_shutdown();
9895        _result
9896    }
9897
9898    /// Similar to "send" but does not shutdown the channel if an error occurs.
9899    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9900        let _result = self.send_raw(result);
9901        self.drop_without_shutdown();
9902        _result
9903    }
9904
9905    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9906        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
9907            result.map(|actual_count| (actual_count,)),
9908            self.tx_id,
9909            0x6a31437832469f82,
9910            fidl::encoding::DynamicFlags::empty(),
9911        )
9912    }
9913}
9914
9915#[must_use = "FIDL methods require a response to be sent"]
9916#[derive(Debug)]
9917pub struct FileDescribeResponder {
9918    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9919    tx_id: u32,
9920}
9921
9922/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9923/// if the responder is dropped without sending a response, so that the client
9924/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9925impl std::ops::Drop for FileDescribeResponder {
9926    fn drop(&mut self) {
9927        self.control_handle.shutdown();
9928        // Safety: drops once, never accessed again
9929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9930    }
9931}
9932
9933impl fdomain_client::fidl::Responder for FileDescribeResponder {
9934    type ControlHandle = FileControlHandle;
9935
9936    fn control_handle(&self) -> &FileControlHandle {
9937        &self.control_handle
9938    }
9939
9940    fn drop_without_shutdown(mut self) {
9941        // Safety: drops once, never accessed again due to mem::forget
9942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9943        // Prevent Drop from running (which would shut down the channel)
9944        std::mem::forget(self);
9945    }
9946}
9947
9948impl FileDescribeResponder {
9949    /// Sends a response to the FIDL transaction.
9950    ///
9951    /// Sets the channel to shutdown if an error occurs.
9952    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9953        let _result = self.send_raw(payload);
9954        if _result.is_err() {
9955            self.control_handle.shutdown();
9956        }
9957        self.drop_without_shutdown();
9958        _result
9959    }
9960
9961    /// Similar to "send" but does not shutdown the channel if an error occurs.
9962    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9963        let _result = self.send_raw(payload);
9964        self.drop_without_shutdown();
9965        _result
9966    }
9967
9968    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9969        self.control_handle.inner.send::<FileInfo>(
9970            &mut payload,
9971            self.tx_id,
9972            0x68b5ac00c62906bc,
9973            fidl::encoding::DynamicFlags::empty(),
9974        )
9975    }
9976}
9977
9978#[must_use = "FIDL methods require a response to be sent"]
9979#[derive(Debug)]
9980pub struct FileSeekResponder {
9981    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9982    tx_id: u32,
9983}
9984
9985/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9986/// if the responder is dropped without sending a response, so that the client
9987/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9988impl std::ops::Drop for FileSeekResponder {
9989    fn drop(&mut self) {
9990        self.control_handle.shutdown();
9991        // Safety: drops once, never accessed again
9992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9993    }
9994}
9995
9996impl fdomain_client::fidl::Responder for FileSeekResponder {
9997    type ControlHandle = FileControlHandle;
9998
9999    fn control_handle(&self) -> &FileControlHandle {
10000        &self.control_handle
10001    }
10002
10003    fn drop_without_shutdown(mut self) {
10004        // Safety: drops once, never accessed again due to mem::forget
10005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10006        // Prevent Drop from running (which would shut down the channel)
10007        std::mem::forget(self);
10008    }
10009}
10010
10011impl FileSeekResponder {
10012    /// Sends a response to the FIDL transaction.
10013    ///
10014    /// Sets the channel to shutdown if an error occurs.
10015    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10016        let _result = self.send_raw(result);
10017        if _result.is_err() {
10018            self.control_handle.shutdown();
10019        }
10020        self.drop_without_shutdown();
10021        _result
10022    }
10023
10024    /// Similar to "send" but does not shutdown the channel if an error occurs.
10025    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10026        let _result = self.send_raw(result);
10027        self.drop_without_shutdown();
10028        _result
10029    }
10030
10031    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10032        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
10033            result.map(|offset_from_start| (offset_from_start,)),
10034            self.tx_id,
10035            0x78079168162c5207,
10036            fidl::encoding::DynamicFlags::empty(),
10037        )
10038    }
10039}
10040
10041#[must_use = "FIDL methods require a response to be sent"]
10042#[derive(Debug)]
10043pub struct FileReadAtResponder {
10044    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10045    tx_id: u32,
10046}
10047
10048/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10049/// if the responder is dropped without sending a response, so that the client
10050/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10051impl std::ops::Drop for FileReadAtResponder {
10052    fn drop(&mut self) {
10053        self.control_handle.shutdown();
10054        // Safety: drops once, never accessed again
10055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10056    }
10057}
10058
10059impl fdomain_client::fidl::Responder for FileReadAtResponder {
10060    type ControlHandle = FileControlHandle;
10061
10062    fn control_handle(&self) -> &FileControlHandle {
10063        &self.control_handle
10064    }
10065
10066    fn drop_without_shutdown(mut self) {
10067        // Safety: drops once, never accessed again due to mem::forget
10068        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10069        // Prevent Drop from running (which would shut down the channel)
10070        std::mem::forget(self);
10071    }
10072}
10073
10074impl FileReadAtResponder {
10075    /// Sends a response to the FIDL transaction.
10076    ///
10077    /// Sets the channel to shutdown if an error occurs.
10078    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10079        let _result = self.send_raw(result);
10080        if _result.is_err() {
10081            self.control_handle.shutdown();
10082        }
10083        self.drop_without_shutdown();
10084        _result
10085    }
10086
10087    /// Similar to "send" but does not shutdown the channel if an error occurs.
10088    pub fn send_no_shutdown_on_err(
10089        self,
10090        mut result: Result<&[u8], i32>,
10091    ) -> Result<(), fidl::Error> {
10092        let _result = self.send_raw(result);
10093        self.drop_without_shutdown();
10094        _result
10095    }
10096
10097    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10098        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
10099            result.map(|data| (data,)),
10100            self.tx_id,
10101            0x1607a293a60d723e,
10102            fidl::encoding::DynamicFlags::empty(),
10103        )
10104    }
10105}
10106
10107#[must_use = "FIDL methods require a response to be sent"]
10108#[derive(Debug)]
10109pub struct FileWriteAtResponder {
10110    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10111    tx_id: u32,
10112}
10113
10114/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10115/// if the responder is dropped without sending a response, so that the client
10116/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10117impl std::ops::Drop for FileWriteAtResponder {
10118    fn drop(&mut self) {
10119        self.control_handle.shutdown();
10120        // Safety: drops once, never accessed again
10121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10122    }
10123}
10124
10125impl fdomain_client::fidl::Responder for FileWriteAtResponder {
10126    type ControlHandle = FileControlHandle;
10127
10128    fn control_handle(&self) -> &FileControlHandle {
10129        &self.control_handle
10130    }
10131
10132    fn drop_without_shutdown(mut self) {
10133        // Safety: drops once, never accessed again due to mem::forget
10134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10135        // Prevent Drop from running (which would shut down the channel)
10136        std::mem::forget(self);
10137    }
10138}
10139
10140impl FileWriteAtResponder {
10141    /// Sends a response to the FIDL transaction.
10142    ///
10143    /// Sets the channel to shutdown if an error occurs.
10144    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10145        let _result = self.send_raw(result);
10146        if _result.is_err() {
10147            self.control_handle.shutdown();
10148        }
10149        self.drop_without_shutdown();
10150        _result
10151    }
10152
10153    /// Similar to "send" but does not shutdown the channel if an error occurs.
10154    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10155        let _result = self.send_raw(result);
10156        self.drop_without_shutdown();
10157        _result
10158    }
10159
10160    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10161        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
10162            result.map(|actual_count| (actual_count,)),
10163            self.tx_id,
10164            0x793eefc0045e792b,
10165            fidl::encoding::DynamicFlags::empty(),
10166        )
10167    }
10168}
10169
10170#[must_use = "FIDL methods require a response to be sent"]
10171#[derive(Debug)]
10172pub struct FileResizeResponder {
10173    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10174    tx_id: u32,
10175}
10176
10177/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10178/// if the responder is dropped without sending a response, so that the client
10179/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10180impl std::ops::Drop for FileResizeResponder {
10181    fn drop(&mut self) {
10182        self.control_handle.shutdown();
10183        // Safety: drops once, never accessed again
10184        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10185    }
10186}
10187
10188impl fdomain_client::fidl::Responder for FileResizeResponder {
10189    type ControlHandle = FileControlHandle;
10190
10191    fn control_handle(&self) -> &FileControlHandle {
10192        &self.control_handle
10193    }
10194
10195    fn drop_without_shutdown(mut self) {
10196        // Safety: drops once, never accessed again due to mem::forget
10197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10198        // Prevent Drop from running (which would shut down the channel)
10199        std::mem::forget(self);
10200    }
10201}
10202
10203impl FileResizeResponder {
10204    /// Sends a response to the FIDL transaction.
10205    ///
10206    /// Sets the channel to shutdown if an error occurs.
10207    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10208        let _result = self.send_raw(result);
10209        if _result.is_err() {
10210            self.control_handle.shutdown();
10211        }
10212        self.drop_without_shutdown();
10213        _result
10214    }
10215
10216    /// Similar to "send" but does not shutdown the channel if an error occurs.
10217    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10218        let _result = self.send_raw(result);
10219        self.drop_without_shutdown();
10220        _result
10221    }
10222
10223    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10224        self.control_handle
10225            .inner
10226            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10227                result,
10228                self.tx_id,
10229                0x2b80825f0535743a,
10230                fidl::encoding::DynamicFlags::empty(),
10231            )
10232    }
10233}
10234
10235#[must_use = "FIDL methods require a response to be sent"]
10236#[derive(Debug)]
10237pub struct FileGetBackingMemoryResponder {
10238    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10239    tx_id: u32,
10240}
10241
10242/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10243/// if the responder is dropped without sending a response, so that the client
10244/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10245impl std::ops::Drop for FileGetBackingMemoryResponder {
10246    fn drop(&mut self) {
10247        self.control_handle.shutdown();
10248        // Safety: drops once, never accessed again
10249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10250    }
10251}
10252
10253impl fdomain_client::fidl::Responder for FileGetBackingMemoryResponder {
10254    type ControlHandle = FileControlHandle;
10255
10256    fn control_handle(&self) -> &FileControlHandle {
10257        &self.control_handle
10258    }
10259
10260    fn drop_without_shutdown(mut self) {
10261        // Safety: drops once, never accessed again due to mem::forget
10262        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10263        // Prevent Drop from running (which would shut down the channel)
10264        std::mem::forget(self);
10265    }
10266}
10267
10268impl FileGetBackingMemoryResponder {
10269    /// Sends a response to the FIDL transaction.
10270    ///
10271    /// Sets the channel to shutdown if an error occurs.
10272    pub fn send(self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10273        let _result = self.send_raw(result);
10274        if _result.is_err() {
10275            self.control_handle.shutdown();
10276        }
10277        self.drop_without_shutdown();
10278        _result
10279    }
10280
10281    /// Similar to "send" but does not shutdown the channel if an error occurs.
10282    pub fn send_no_shutdown_on_err(
10283        self,
10284        mut result: Result<fdomain_client::Vmo, i32>,
10285    ) -> Result<(), fidl::Error> {
10286        let _result = self.send_raw(result);
10287        self.drop_without_shutdown();
10288        _result
10289    }
10290
10291    fn send_raw(&self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10292        self.control_handle
10293            .inner
10294            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
10295                result.map(|vmo| (vmo,)),
10296                self.tx_id,
10297                0xa6a9e654cbf62b,
10298                fidl::encoding::DynamicFlags::empty(),
10299            )
10300    }
10301}
10302
10303#[must_use = "FIDL methods require a response to be sent"]
10304#[derive(Debug)]
10305pub struct FileAllocateResponder {
10306    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10307    tx_id: u32,
10308}
10309
10310/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10311/// if the responder is dropped without sending a response, so that the client
10312/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10313impl std::ops::Drop for FileAllocateResponder {
10314    fn drop(&mut self) {
10315        self.control_handle.shutdown();
10316        // Safety: drops once, never accessed again
10317        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10318    }
10319}
10320
10321impl fdomain_client::fidl::Responder for FileAllocateResponder {
10322    type ControlHandle = FileControlHandle;
10323
10324    fn control_handle(&self) -> &FileControlHandle {
10325        &self.control_handle
10326    }
10327
10328    fn drop_without_shutdown(mut self) {
10329        // Safety: drops once, never accessed again due to mem::forget
10330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10331        // Prevent Drop from running (which would shut down the channel)
10332        std::mem::forget(self);
10333    }
10334}
10335
10336impl FileAllocateResponder {
10337    /// Sends a response to the FIDL transaction.
10338    ///
10339    /// Sets the channel to shutdown if an error occurs.
10340    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10341        let _result = self.send_raw(result);
10342        if _result.is_err() {
10343            self.control_handle.shutdown();
10344        }
10345        self.drop_without_shutdown();
10346        _result
10347    }
10348
10349    /// Similar to "send" but does not shutdown the channel if an error occurs.
10350    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10351        let _result = self.send_raw(result);
10352        self.drop_without_shutdown();
10353        _result
10354    }
10355
10356    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10357        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10358            fidl::encoding::EmptyStruct,
10359            i32,
10360        >>(
10361            fidl::encoding::FlexibleResult::new(result),
10362            self.tx_id,
10363            0x77fa0c330b57fd2e,
10364            fidl::encoding::DynamicFlags::FLEXIBLE,
10365        )
10366    }
10367}
10368
10369#[must_use = "FIDL methods require a response to be sent"]
10370#[derive(Debug)]
10371pub struct FileEnableVerityResponder {
10372    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10373    tx_id: u32,
10374}
10375
10376/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10377/// if the responder is dropped without sending a response, so that the client
10378/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10379impl std::ops::Drop for FileEnableVerityResponder {
10380    fn drop(&mut self) {
10381        self.control_handle.shutdown();
10382        // Safety: drops once, never accessed again
10383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10384    }
10385}
10386
10387impl fdomain_client::fidl::Responder for FileEnableVerityResponder {
10388    type ControlHandle = FileControlHandle;
10389
10390    fn control_handle(&self) -> &FileControlHandle {
10391        &self.control_handle
10392    }
10393
10394    fn drop_without_shutdown(mut self) {
10395        // Safety: drops once, never accessed again due to mem::forget
10396        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10397        // Prevent Drop from running (which would shut down the channel)
10398        std::mem::forget(self);
10399    }
10400}
10401
10402impl FileEnableVerityResponder {
10403    /// Sends a response to the FIDL transaction.
10404    ///
10405    /// Sets the channel to shutdown if an error occurs.
10406    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10407        let _result = self.send_raw(result);
10408        if _result.is_err() {
10409            self.control_handle.shutdown();
10410        }
10411        self.drop_without_shutdown();
10412        _result
10413    }
10414
10415    /// Similar to "send" but does not shutdown the channel if an error occurs.
10416    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10417        let _result = self.send_raw(result);
10418        self.drop_without_shutdown();
10419        _result
10420    }
10421
10422    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10423        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10424            fidl::encoding::EmptyStruct,
10425            i32,
10426        >>(
10427            fidl::encoding::FlexibleResult::new(result),
10428            self.tx_id,
10429            0x2c421ec3faaeb8bb,
10430            fidl::encoding::DynamicFlags::FLEXIBLE,
10431        )
10432    }
10433}
10434
10435#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10436pub struct LinkableMarker;
10437
10438impl fdomain_client::fidl::ProtocolMarker for LinkableMarker {
10439    type Proxy = LinkableProxy;
10440    type RequestStream = LinkableRequestStream;
10441
10442    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
10443}
10444pub type LinkableLinkIntoResult = Result<(), i32>;
10445
10446pub trait LinkableProxyInterface: Send + Sync {
10447    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
10448        + Send;
10449    fn r#link_into(
10450        &self,
10451        dst_parent_token: fdomain_client::Event,
10452        dst: &str,
10453    ) -> Self::LinkIntoResponseFut;
10454}
10455
10456#[derive(Debug, Clone)]
10457pub struct LinkableProxy {
10458    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10459}
10460
10461impl fdomain_client::fidl::Proxy for LinkableProxy {
10462    type Protocol = LinkableMarker;
10463
10464    fn from_channel(inner: fdomain_client::Channel) -> Self {
10465        Self::new(inner)
10466    }
10467
10468    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10469        self.client.into_channel().map_err(|client| Self { client })
10470    }
10471
10472    fn as_channel(&self) -> &fdomain_client::Channel {
10473        self.client.as_channel()
10474    }
10475}
10476
10477impl LinkableProxy {
10478    /// Create a new Proxy for fuchsia.io/Linkable.
10479    pub fn new(channel: fdomain_client::Channel) -> Self {
10480        let protocol_name = <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10481        Self { client: fidl::client::Client::new(channel, protocol_name) }
10482    }
10483
10484    /// Get a Stream of events from the remote end of the protocol.
10485    ///
10486    /// # Panics
10487    ///
10488    /// Panics if the event stream was already taken.
10489    pub fn take_event_stream(&self) -> LinkableEventStream {
10490        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
10491    }
10492
10493    /// Creates a link to this this object with name `dst` in the directory represented by
10494    /// `dst_parent_token`.
10495    ///
10496    /// `dst` must be a resolved object name. Including "/" in the string will return
10497    /// `ZX_ERR_INVALID_ARGS`.
10498    ///
10499    /// This method requires the maximal set of rights supported by the filesystem for this object.
10500    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10501    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10502    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10503    /// `ZX_ERR_ACCESS_DENIED`.
10504    ///
10505    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10506    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10507    ///
10508    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10509    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10510    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10511    ///
10512    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10513    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10514    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10515    pub fn r#link_into(
10516        &self,
10517        mut dst_parent_token: fdomain_client::Event,
10518        mut dst: &str,
10519    ) -> fidl::client::QueryResponseFut<
10520        LinkableLinkIntoResult,
10521        fdomain_client::fidl::FDomainResourceDialect,
10522    > {
10523        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
10524    }
10525}
10526
10527impl LinkableProxyInterface for LinkableProxy {
10528    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
10529        LinkableLinkIntoResult,
10530        fdomain_client::fidl::FDomainResourceDialect,
10531    >;
10532    fn r#link_into(
10533        &self,
10534        mut dst_parent_token: fdomain_client::Event,
10535        mut dst: &str,
10536    ) -> Self::LinkIntoResponseFut {
10537        fn _decode(
10538            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10539        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
10540            let _response = fidl::client::decode_transaction_body::<
10541                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10542                fdomain_client::fidl::FDomainResourceDialect,
10543                0x54f3949246a03e74,
10544            >(_buf?)?;
10545            Ok(_response.map(|x| x))
10546        }
10547        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
10548            (dst_parent_token, dst),
10549            0x54f3949246a03e74,
10550            fidl::encoding::DynamicFlags::empty(),
10551            _decode,
10552        )
10553    }
10554}
10555
10556pub struct LinkableEventStream {
10557    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
10558}
10559
10560impl std::marker::Unpin for LinkableEventStream {}
10561
10562impl futures::stream::FusedStream for LinkableEventStream {
10563    fn is_terminated(&self) -> bool {
10564        self.event_receiver.is_terminated()
10565    }
10566}
10567
10568impl futures::Stream for LinkableEventStream {
10569    type Item = Result<LinkableEvent, fidl::Error>;
10570
10571    fn poll_next(
10572        mut self: std::pin::Pin<&mut Self>,
10573        cx: &mut std::task::Context<'_>,
10574    ) -> std::task::Poll<Option<Self::Item>> {
10575        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10576            &mut self.event_receiver,
10577            cx
10578        )?) {
10579            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
10580            None => std::task::Poll::Ready(None),
10581        }
10582    }
10583}
10584
10585#[derive(Debug)]
10586pub enum LinkableEvent {}
10587
10588impl LinkableEvent {
10589    /// Decodes a message buffer as a [`LinkableEvent`].
10590    fn decode(
10591        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10592    ) -> Result<LinkableEvent, fidl::Error> {
10593        let (bytes, _handles) = buf.split_mut();
10594        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10595        debug_assert_eq!(tx_header.tx_id, 0);
10596        match tx_header.ordinal {
10597            _ => Err(fidl::Error::UnknownOrdinal {
10598                ordinal: tx_header.ordinal,
10599                protocol_name: <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10600            }),
10601        }
10602    }
10603}
10604
10605/// A Stream of incoming requests for fuchsia.io/Linkable.
10606pub struct LinkableRequestStream {
10607    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10608    is_terminated: bool,
10609}
10610
10611impl std::marker::Unpin for LinkableRequestStream {}
10612
10613impl futures::stream::FusedStream for LinkableRequestStream {
10614    fn is_terminated(&self) -> bool {
10615        self.is_terminated
10616    }
10617}
10618
10619impl fdomain_client::fidl::RequestStream for LinkableRequestStream {
10620    type Protocol = LinkableMarker;
10621    type ControlHandle = LinkableControlHandle;
10622
10623    fn from_channel(channel: fdomain_client::Channel) -> Self {
10624        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10625    }
10626
10627    fn control_handle(&self) -> Self::ControlHandle {
10628        LinkableControlHandle { inner: self.inner.clone() }
10629    }
10630
10631    fn into_inner(
10632        self,
10633    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
10634    {
10635        (self.inner, self.is_terminated)
10636    }
10637
10638    fn from_inner(
10639        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10640        is_terminated: bool,
10641    ) -> Self {
10642        Self { inner, is_terminated }
10643    }
10644}
10645
10646impl futures::Stream for LinkableRequestStream {
10647    type Item = Result<LinkableRequest, fidl::Error>;
10648
10649    fn poll_next(
10650        mut self: std::pin::Pin<&mut Self>,
10651        cx: &mut std::task::Context<'_>,
10652    ) -> std::task::Poll<Option<Self::Item>> {
10653        let this = &mut *self;
10654        if this.inner.check_shutdown(cx) {
10655            this.is_terminated = true;
10656            return std::task::Poll::Ready(None);
10657        }
10658        if this.is_terminated {
10659            panic!("polled LinkableRequestStream after completion");
10660        }
10661        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
10662            |bytes, handles| {
10663                match this.inner.channel().read_etc(cx, bytes, handles) {
10664                    std::task::Poll::Ready(Ok(())) => {}
10665                    std::task::Poll::Pending => return std::task::Poll::Pending,
10666                    std::task::Poll::Ready(Err(None)) => {
10667                        this.is_terminated = true;
10668                        return std::task::Poll::Ready(None);
10669                    }
10670                    std::task::Poll::Ready(Err(Some(e))) => {
10671                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10672                            e.into(),
10673                        ))));
10674                    }
10675                }
10676
10677                // A message has been received from the channel
10678                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10679
10680                std::task::Poll::Ready(Some(match header.ordinal {
10681                    0x54f3949246a03e74 => {
10682                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10683                        let mut req = fidl::new_empty!(
10684                            LinkableLinkIntoRequest,
10685                            fdomain_client::fidl::FDomainResourceDialect
10686                        );
10687                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
10688                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
10689                        Ok(LinkableRequest::LinkInto {
10690                            dst_parent_token: req.dst_parent_token,
10691                            dst: req.dst,
10692
10693                            responder: LinkableLinkIntoResponder {
10694                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10695                                tx_id: header.tx_id,
10696                            },
10697                        })
10698                    }
10699                    _ => Err(fidl::Error::UnknownOrdinal {
10700                        ordinal: header.ordinal,
10701                        protocol_name:
10702                            <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10703                    }),
10704                }))
10705            },
10706        )
10707    }
10708}
10709
10710#[derive(Debug)]
10711pub enum LinkableRequest {
10712    /// Creates a link to this this object with name `dst` in the directory represented by
10713    /// `dst_parent_token`.
10714    ///
10715    /// `dst` must be a resolved object name. Including "/" in the string will return
10716    /// `ZX_ERR_INVALID_ARGS`.
10717    ///
10718    /// This method requires the maximal set of rights supported by the filesystem for this object.
10719    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10720    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10721    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10722    /// `ZX_ERR_ACCESS_DENIED`.
10723    ///
10724    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10725    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10726    ///
10727    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10728    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10729    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10730    ///
10731    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10732    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10733    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10734    LinkInto {
10735        dst_parent_token: fdomain_client::Event,
10736        dst: String,
10737        responder: LinkableLinkIntoResponder,
10738    },
10739}
10740
10741impl LinkableRequest {
10742    #[allow(irrefutable_let_patterns)]
10743    pub fn into_link_into(
10744        self,
10745    ) -> Option<(fdomain_client::Event, String, LinkableLinkIntoResponder)> {
10746        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
10747            Some((dst_parent_token, dst, responder))
10748        } else {
10749            None
10750        }
10751    }
10752
10753    /// Name of the method defined in FIDL
10754    pub fn method_name(&self) -> &'static str {
10755        match *self {
10756            LinkableRequest::LinkInto { .. } => "link_into",
10757        }
10758    }
10759}
10760
10761#[derive(Debug, Clone)]
10762pub struct LinkableControlHandle {
10763    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10764}
10765
10766impl LinkableControlHandle {
10767    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10768        self.inner.shutdown_with_epitaph(status.into())
10769    }
10770}
10771
10772impl fdomain_client::fidl::ControlHandle for LinkableControlHandle {
10773    fn shutdown(&self) {
10774        self.inner.shutdown()
10775    }
10776
10777    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10778        self.inner.shutdown_with_epitaph(status)
10779    }
10780
10781    fn is_closed(&self) -> bool {
10782        self.inner.channel().is_closed()
10783    }
10784    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
10785        self.inner.channel().on_closed()
10786    }
10787}
10788
10789impl LinkableControlHandle {}
10790
10791#[must_use = "FIDL methods require a response to be sent"]
10792#[derive(Debug)]
10793pub struct LinkableLinkIntoResponder {
10794    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
10795    tx_id: u32,
10796}
10797
10798/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
10799/// if the responder is dropped without sending a response, so that the client
10800/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10801impl std::ops::Drop for LinkableLinkIntoResponder {
10802    fn drop(&mut self) {
10803        self.control_handle.shutdown();
10804        // Safety: drops once, never accessed again
10805        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10806    }
10807}
10808
10809impl fdomain_client::fidl::Responder for LinkableLinkIntoResponder {
10810    type ControlHandle = LinkableControlHandle;
10811
10812    fn control_handle(&self) -> &LinkableControlHandle {
10813        &self.control_handle
10814    }
10815
10816    fn drop_without_shutdown(mut self) {
10817        // Safety: drops once, never accessed again due to mem::forget
10818        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10819        // Prevent Drop from running (which would shut down the channel)
10820        std::mem::forget(self);
10821    }
10822}
10823
10824impl LinkableLinkIntoResponder {
10825    /// Sends a response to the FIDL transaction.
10826    ///
10827    /// Sets the channel to shutdown if an error occurs.
10828    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10829        let _result = self.send_raw(result);
10830        if _result.is_err() {
10831            self.control_handle.shutdown();
10832        }
10833        self.drop_without_shutdown();
10834        _result
10835    }
10836
10837    /// Similar to "send" but does not shutdown the channel if an error occurs.
10838    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10839        let _result = self.send_raw(result);
10840        self.drop_without_shutdown();
10841        _result
10842    }
10843
10844    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10845        self.control_handle
10846            .inner
10847            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10848                result,
10849                self.tx_id,
10850                0x54f3949246a03e74,
10851                fidl::encoding::DynamicFlags::empty(),
10852            )
10853    }
10854}
10855
10856#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10857pub struct NodeMarker;
10858
10859impl fdomain_client::fidl::ProtocolMarker for NodeMarker {
10860    type Proxy = NodeProxy;
10861    type RequestStream = NodeRequestStream;
10862
10863    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
10864}
10865impl fdomain_client::fidl::DiscoverableProtocolMarker for NodeMarker {}
10866pub type NodeGetFlagsResult = Result<Flags, i32>;
10867pub type NodeSetFlagsResult = Result<(), i32>;
10868pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
10869pub type NodeUpdateAttributesResult = Result<(), i32>;
10870pub type NodeSyncResult = Result<(), i32>;
10871pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
10872pub type NodeSetExtendedAttributeResult = Result<(), i32>;
10873pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
10874
10875pub trait NodeProxyInterface: Send + Sync {
10876    fn r#clone(
10877        &self,
10878        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10879    ) -> Result<(), fidl::Error>;
10880    type CloseResponseFut: std::future::Future<
10881            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
10882        > + Send;
10883    fn r#close(&self) -> Self::CloseResponseFut;
10884    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
10885    fn r#query(&self) -> Self::QueryResponseFut;
10886    fn r#deprecated_clone(
10887        &self,
10888        flags: OpenFlags,
10889        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10890    ) -> Result<(), fidl::Error>;
10891    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
10892        + Send;
10893    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
10894    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
10895    fn r#deprecated_set_attr(
10896        &self,
10897        flags: NodeAttributeFlags,
10898        attributes: &NodeAttributes,
10899    ) -> Self::DeprecatedSetAttrResponseFut;
10900    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
10901        + Send;
10902    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
10903    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
10904        + Send;
10905    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
10906    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
10907        + Send;
10908    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
10909    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
10910        + Send;
10911    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
10912    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
10913        + Send;
10914    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
10915    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
10916        + Send;
10917    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
10918    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
10919        + Send;
10920    fn r#update_attributes(
10921        &self,
10922        payload: &MutableNodeAttributes,
10923    ) -> Self::UpdateAttributesResponseFut;
10924    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
10925    fn r#sync(&self) -> Self::SyncResponseFut;
10926    fn r#list_extended_attributes(
10927        &self,
10928        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
10929    ) -> Result<(), fidl::Error>;
10930    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
10931        + Send;
10932    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
10933    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
10934        + Send;
10935    fn r#set_extended_attribute(
10936        &self,
10937        name: &[u8],
10938        value: ExtendedAttributeValue,
10939        mode: SetExtendedAttributeMode,
10940    ) -> Self::SetExtendedAttributeResponseFut;
10941    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
10942        + Send;
10943    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
10944}
10945
10946#[derive(Debug, Clone)]
10947pub struct NodeProxy {
10948    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10949}
10950
10951impl fdomain_client::fidl::Proxy for NodeProxy {
10952    type Protocol = NodeMarker;
10953
10954    fn from_channel(inner: fdomain_client::Channel) -> Self {
10955        Self::new(inner)
10956    }
10957
10958    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10959        self.client.into_channel().map_err(|client| Self { client })
10960    }
10961
10962    fn as_channel(&self) -> &fdomain_client::Channel {
10963        self.client.as_channel()
10964    }
10965}
10966
10967impl NodeProxy {
10968    /// Create a new Proxy for fuchsia.io/Node.
10969    pub fn new(channel: fdomain_client::Channel) -> Self {
10970        let protocol_name = <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10971        Self { client: fidl::client::Client::new(channel, protocol_name) }
10972    }
10973
10974    /// Get a Stream of events from the remote end of the protocol.
10975    ///
10976    /// # Panics
10977    ///
10978    /// Panics if the event stream was already taken.
10979    pub fn take_event_stream(&self) -> NodeEventStream {
10980        NodeEventStream { event_receiver: self.client.take_event_receiver() }
10981    }
10982
10983    pub fn r#clone(
10984        &self,
10985        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10986    ) -> Result<(), fidl::Error> {
10987        NodeProxyInterface::r#clone(self, request)
10988    }
10989
10990    /// Terminates the connection.
10991    ///
10992    /// After calling `Close`, the client must not send any other requests.
10993    ///
10994    /// Servers, after sending the status response, should close the connection
10995    /// regardless of status and without sending an epitaph.
10996    ///
10997    /// Closing the client end of the channel should be semantically equivalent
10998    /// to calling `Close` without knowing when the close has completed or its
10999    /// status.
11000    pub fn r#close(
11001        &self,
11002    ) -> fidl::client::QueryResponseFut<
11003        fdomain_fuchsia_unknown::CloseableCloseResult,
11004        fdomain_client::fidl::FDomainResourceDialect,
11005    > {
11006        NodeProxyInterface::r#close(self)
11007    }
11008
11009    pub fn r#query(
11010        &self,
11011    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
11012        NodeProxyInterface::r#query(self)
11013    }
11014
11015    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
11016    pub fn r#deprecated_clone(
11017        &self,
11018        mut flags: OpenFlags,
11019        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11020    ) -> Result<(), fidl::Error> {
11021        NodeProxyInterface::r#deprecated_clone(self, flags, object)
11022    }
11023
11024    /// DEPRECATED - Use `Node.GetAttributes` instead.
11025    ///
11026    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11027    pub fn r#deprecated_get_attr(
11028        &self,
11029    ) -> fidl::client::QueryResponseFut<
11030        (i32, NodeAttributes),
11031        fdomain_client::fidl::FDomainResourceDialect,
11032    > {
11033        NodeProxyInterface::r#deprecated_get_attr(self)
11034    }
11035
11036    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
11037    pub fn r#deprecated_set_attr(
11038        &self,
11039        mut flags: NodeAttributeFlags,
11040        mut attributes: &NodeAttributes,
11041    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11042        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
11043    }
11044
11045    /// [DEPRECATED - Use new GetFlags method instead.]
11046    pub fn r#deprecated_get_flags(
11047        &self,
11048    ) -> fidl::client::QueryResponseFut<
11049        (i32, OpenFlags),
11050        fdomain_client::fidl::FDomainResourceDialect,
11051    > {
11052        NodeProxyInterface::r#deprecated_get_flags(self)
11053    }
11054
11055    /// [DEPRECATED - Use new SetFlags method instead.]
11056    pub fn r#deprecated_set_flags(
11057        &self,
11058        mut flags: OpenFlags,
11059    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11060        NodeProxyInterface::r#deprecated_set_flags(self, flags)
11061    }
11062
11063    /// Queries the flags that apply to this node after it has been opened/created. This method does
11064    /// not require any rights.
11065    ///
11066    /// Note that the final set of flags that apply to the connection may differ from those
11067    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
11068    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
11069    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
11070    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
11071    pub fn r#get_flags(
11072        &self,
11073    ) -> fidl::client::QueryResponseFut<
11074        NodeGetFlagsResult,
11075        fdomain_client::fidl::FDomainResourceDialect,
11076    > {
11077        NodeProxyInterface::r#get_flags(self)
11078    }
11079
11080    /// Sets the flags that apply to this node after it has been opened. This method does not
11081    /// require any rights.
11082    ///
11083    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
11084    /// clear append mode.
11085    ///
11086    /// Errors:
11087    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
11088    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
11089    pub fn r#set_flags(
11090        &self,
11091        mut flags: Flags,
11092    ) -> fidl::client::QueryResponseFut<
11093        NodeSetFlagsResult,
11094        fdomain_client::fidl::FDomainResourceDialect,
11095    > {
11096        NodeProxyInterface::r#set_flags(self, flags)
11097    }
11098
11099    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
11100    /// volume has different settings or the storage is accounted seperately from the rest of the
11101    /// filesystem that may be reported instead of filesystem-wide details.
11102    pub fn r#query_filesystem(
11103        &self,
11104    ) -> fidl::client::QueryResponseFut<
11105        (i32, Option<Box<FilesystemInfo>>),
11106        fdomain_client::fidl::FDomainResourceDialect,
11107    > {
11108        NodeProxyInterface::r#query_filesystem(self)
11109    }
11110
11111    /// Acquires information about the node.
11112    ///
11113    /// The attributes of a node should be stable, independent of the
11114    /// specific protocol used to access it.
11115    ///
11116    /// If a particular attribute is not applicable or not supported,
11117    /// filesystems should leave the corresponding field absent.
11118    ///
11119    /// + `query` a bit-mask specifying which attributes to fetch. The server
11120    ///   should not return more than necessary.
11121    /// - `attributes` the returned attributes.
11122    ///
11123    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11124    pub fn r#get_attributes(
11125        &self,
11126        mut query: NodeAttributesQuery,
11127    ) -> fidl::client::QueryResponseFut<
11128        NodeGetAttributesResult,
11129        fdomain_client::fidl::FDomainResourceDialect,
11130    > {
11131        NodeProxyInterface::r#get_attributes(self, query)
11132    }
11133
11134    /// Updates information about the node.
11135    ///
11136    /// + `attributes` the presence of a table field in `attributes` indicates
11137    /// the intent to update the corresponding attribute.
11138    ///
11139    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
11140    ///
11141    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11142    pub fn r#update_attributes(
11143        &self,
11144        mut payload: &MutableNodeAttributes,
11145    ) -> fidl::client::QueryResponseFut<
11146        NodeUpdateAttributesResult,
11147        fdomain_client::fidl::FDomainResourceDialect,
11148    > {
11149        NodeProxyInterface::r#update_attributes(self, payload)
11150    }
11151
11152    /// Synchronizes updates to the node to the underlying media, if it exists.
11153    ///
11154    /// This method will return when the filesystem server has flushed the
11155    /// relevant updates to the underlying media, but does not guarantee the
11156    /// underlying media has persisted the information, nor that any information
11157    /// is committed to hardware. Clients may use `Sync` to ensure ordering
11158    /// between operations.
11159    ///
11160    /// This method does not require any rights.
11161    pub fn r#sync(
11162        &self,
11163    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
11164    {
11165        NodeProxyInterface::r#sync(self)
11166    }
11167
11168    /// Creates an iterator over all the extended attribute names associated
11169    /// with this node. If an error occurs it is returned as an epitaph on the
11170    /// iterator request channel, and then the channel is closed.
11171    ///
11172    /// GetExtendedAttributes can be used with any of these names to retrieve
11173    /// the associated value.
11174    ///
11175    /// This method requires the [`Rights.READ_BYTES`] right.
11176    pub fn r#list_extended_attributes(
11177        &self,
11178        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11179    ) -> Result<(), fidl::Error> {
11180        NodeProxyInterface::r#list_extended_attributes(self, iterator)
11181    }
11182
11183    /// Get the value associated with the given attribute `name` for this node.
11184    ///
11185    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
11186    /// particular structure is imposed on them.
11187    ///
11188    /// This method requires the [`Rights.READ_BYTES`] right.
11189    pub fn r#get_extended_attribute(
11190        &self,
11191        mut name: &[u8],
11192    ) -> fidl::client::QueryResponseFut<
11193        NodeGetExtendedAttributeResult,
11194        fdomain_client::fidl::FDomainResourceDialect,
11195    > {
11196        NodeProxyInterface::r#get_extended_attribute(self, name)
11197    }
11198
11199    /// Set the value for the given attribute `name` to `value` for this node.
11200    ///
11201    /// The attribute name may exist, in which case the attribute is updated.
11202    /// If the attribute doesn't exist, it is created. The name should have no
11203    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
11204    ///
11205    /// This method requires the [`Rights.WRITE_BYTES`] right.
11206    pub fn r#set_extended_attribute(
11207        &self,
11208        mut name: &[u8],
11209        mut value: ExtendedAttributeValue,
11210        mut mode: SetExtendedAttributeMode,
11211    ) -> fidl::client::QueryResponseFut<
11212        NodeSetExtendedAttributeResult,
11213        fdomain_client::fidl::FDomainResourceDialect,
11214    > {
11215        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
11216    }
11217
11218    /// Remove the specified extended attribute.
11219    ///
11220    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
11221    ///
11222    /// This method requires the [`Rights.WRITE_BYTES`] right.
11223    pub fn r#remove_extended_attribute(
11224        &self,
11225        mut name: &[u8],
11226    ) -> fidl::client::QueryResponseFut<
11227        NodeRemoveExtendedAttributeResult,
11228        fdomain_client::fidl::FDomainResourceDialect,
11229    > {
11230        NodeProxyInterface::r#remove_extended_attribute(self, name)
11231    }
11232}
11233
11234impl NodeProxyInterface for NodeProxy {
11235    fn r#clone(
11236        &self,
11237        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11238    ) -> Result<(), fidl::Error> {
11239        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
11240            (request,),
11241            0x20d8a7aba2168a79,
11242            fidl::encoding::DynamicFlags::empty(),
11243        )
11244    }
11245
11246    type CloseResponseFut = fidl::client::QueryResponseFut<
11247        fdomain_fuchsia_unknown::CloseableCloseResult,
11248        fdomain_client::fidl::FDomainResourceDialect,
11249    >;
11250    fn r#close(&self) -> Self::CloseResponseFut {
11251        fn _decode(
11252            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11253        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
11254            let _response = fidl::client::decode_transaction_body::<
11255                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11256                fdomain_client::fidl::FDomainResourceDialect,
11257                0x5ac5d459ad7f657e,
11258            >(_buf?)?;
11259            Ok(_response.map(|x| x))
11260        }
11261        self.client.send_query_and_decode::<
11262            fidl::encoding::EmptyPayload,
11263            fdomain_fuchsia_unknown::CloseableCloseResult,
11264        >(
11265            (),
11266            0x5ac5d459ad7f657e,
11267            fidl::encoding::DynamicFlags::empty(),
11268            _decode,
11269        )
11270    }
11271
11272    type QueryResponseFut =
11273        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
11274    fn r#query(&self) -> Self::QueryResponseFut {
11275        fn _decode(
11276            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11277        ) -> Result<Vec<u8>, fidl::Error> {
11278            let _response = fidl::client::decode_transaction_body::<
11279                fdomain_fuchsia_unknown::QueryableQueryResponse,
11280                fdomain_client::fidl::FDomainResourceDialect,
11281                0x2658edee9decfc06,
11282            >(_buf?)?;
11283            Ok(_response.protocol)
11284        }
11285        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
11286            (),
11287            0x2658edee9decfc06,
11288            fidl::encoding::DynamicFlags::empty(),
11289            _decode,
11290        )
11291    }
11292
11293    fn r#deprecated_clone(
11294        &self,
11295        mut flags: OpenFlags,
11296        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11297    ) -> Result<(), fidl::Error> {
11298        self.client.send::<NodeDeprecatedCloneRequest>(
11299            (flags, object),
11300            0x5a61678f293ce16f,
11301            fidl::encoding::DynamicFlags::FLEXIBLE,
11302        )
11303    }
11304
11305    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
11306        (i32, NodeAttributes),
11307        fdomain_client::fidl::FDomainResourceDialect,
11308    >;
11309    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
11310        fn _decode(
11311            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11312        ) -> Result<(i32, NodeAttributes), fidl::Error> {
11313            let _response = fidl::client::decode_transaction_body::<
11314                NodeDeprecatedGetAttrResponse,
11315                fdomain_client::fidl::FDomainResourceDialect,
11316                0x78985e216314dafd,
11317            >(_buf?)?;
11318            Ok((_response.s, _response.attributes))
11319        }
11320        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
11321            (),
11322            0x78985e216314dafd,
11323            fidl::encoding::DynamicFlags::empty(),
11324            _decode,
11325        )
11326    }
11327
11328    type DeprecatedSetAttrResponseFut =
11329        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11330    fn r#deprecated_set_attr(
11331        &self,
11332        mut flags: NodeAttributeFlags,
11333        mut attributes: &NodeAttributes,
11334    ) -> Self::DeprecatedSetAttrResponseFut {
11335        fn _decode(
11336            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11337        ) -> Result<i32, fidl::Error> {
11338            let _response = fidl::client::decode_transaction_body::<
11339                NodeDeprecatedSetAttrResponse,
11340                fdomain_client::fidl::FDomainResourceDialect,
11341                0x4186c0f40d938f46,
11342            >(_buf?)?;
11343            Ok(_response.s)
11344        }
11345        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
11346            (flags, attributes),
11347            0x4186c0f40d938f46,
11348            fidl::encoding::DynamicFlags::empty(),
11349            _decode,
11350        )
11351    }
11352
11353    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
11354        (i32, OpenFlags),
11355        fdomain_client::fidl::FDomainResourceDialect,
11356    >;
11357    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
11358        fn _decode(
11359            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11360        ) -> Result<(i32, OpenFlags), fidl::Error> {
11361            let _response = fidl::client::decode_transaction_body::<
11362                NodeDeprecatedGetFlagsResponse,
11363                fdomain_client::fidl::FDomainResourceDialect,
11364                0x5b88fffb8eda3aa1,
11365            >(_buf?)?;
11366            Ok((_response.s, _response.flags))
11367        }
11368        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
11369            (),
11370            0x5b88fffb8eda3aa1,
11371            fidl::encoding::DynamicFlags::empty(),
11372            _decode,
11373        )
11374    }
11375
11376    type DeprecatedSetFlagsResponseFut =
11377        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11378    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
11379        fn _decode(
11380            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11381        ) -> Result<i32, fidl::Error> {
11382            let _response = fidl::client::decode_transaction_body::<
11383                NodeDeprecatedSetFlagsResponse,
11384                fdomain_client::fidl::FDomainResourceDialect,
11385                0x5295b76c71fde733,
11386            >(_buf?)?;
11387            Ok(_response.s)
11388        }
11389        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
11390            (flags,),
11391            0x5295b76c71fde733,
11392            fidl::encoding::DynamicFlags::empty(),
11393            _decode,
11394        )
11395    }
11396
11397    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
11398        NodeGetFlagsResult,
11399        fdomain_client::fidl::FDomainResourceDialect,
11400    >;
11401    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
11402        fn _decode(
11403            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11404        ) -> Result<NodeGetFlagsResult, fidl::Error> {
11405            let _response = fidl::client::decode_transaction_body::<
11406                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
11407                fdomain_client::fidl::FDomainResourceDialect,
11408                0x176eb318f64ec23,
11409            >(_buf?)?
11410            .into_result_fdomain::<NodeMarker>("get_flags")?;
11411            Ok(_response.map(|x| x.flags))
11412        }
11413        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
11414            (),
11415            0x176eb318f64ec23,
11416            fidl::encoding::DynamicFlags::FLEXIBLE,
11417            _decode,
11418        )
11419    }
11420
11421    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
11422        NodeSetFlagsResult,
11423        fdomain_client::fidl::FDomainResourceDialect,
11424    >;
11425    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
11426        fn _decode(
11427            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11428        ) -> Result<NodeSetFlagsResult, fidl::Error> {
11429            let _response = fidl::client::decode_transaction_body::<
11430                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
11431                fdomain_client::fidl::FDomainResourceDialect,
11432                0x55a8028685791ea8,
11433            >(_buf?)?
11434            .into_result_fdomain::<NodeMarker>("set_flags")?;
11435            Ok(_response.map(|x| x))
11436        }
11437        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
11438            (flags,),
11439            0x55a8028685791ea8,
11440            fidl::encoding::DynamicFlags::FLEXIBLE,
11441            _decode,
11442        )
11443    }
11444
11445    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
11446        (i32, Option<Box<FilesystemInfo>>),
11447        fdomain_client::fidl::FDomainResourceDialect,
11448    >;
11449    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
11450        fn _decode(
11451            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11452        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
11453            let _response = fidl::client::decode_transaction_body::<
11454                NodeQueryFilesystemResponse,
11455                fdomain_client::fidl::FDomainResourceDialect,
11456                0x6f344a1c6b0a0610,
11457            >(_buf?)?;
11458            Ok((_response.s, _response.info))
11459        }
11460        self.client.send_query_and_decode::<
11461            fidl::encoding::EmptyPayload,
11462            (i32, Option<Box<FilesystemInfo>>),
11463        >(
11464            (),
11465            0x6f344a1c6b0a0610,
11466            fidl::encoding::DynamicFlags::empty(),
11467            _decode,
11468        )
11469    }
11470
11471    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
11472        NodeGetAttributesResult,
11473        fdomain_client::fidl::FDomainResourceDialect,
11474    >;
11475    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
11476        fn _decode(
11477            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11478        ) -> Result<NodeGetAttributesResult, fidl::Error> {
11479            let _response = fidl::client::decode_transaction_body::<
11480                fidl::encoding::ResultType<NodeAttributes2, i32>,
11481                fdomain_client::fidl::FDomainResourceDialect,
11482                0x3d4396a638ea053b,
11483            >(_buf?)?;
11484            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
11485        }
11486        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
11487            (query,),
11488            0x3d4396a638ea053b,
11489            fidl::encoding::DynamicFlags::empty(),
11490            _decode,
11491        )
11492    }
11493
11494    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
11495        NodeUpdateAttributesResult,
11496        fdomain_client::fidl::FDomainResourceDialect,
11497    >;
11498    fn r#update_attributes(
11499        &self,
11500        mut payload: &MutableNodeAttributes,
11501    ) -> Self::UpdateAttributesResponseFut {
11502        fn _decode(
11503            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11504        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
11505            let _response = fidl::client::decode_transaction_body::<
11506                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11507                fdomain_client::fidl::FDomainResourceDialect,
11508                0x3308c1da5a89bf08,
11509            >(_buf?)?;
11510            Ok(_response.map(|x| x))
11511        }
11512        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
11513            payload,
11514            0x3308c1da5a89bf08,
11515            fidl::encoding::DynamicFlags::empty(),
11516            _decode,
11517        )
11518    }
11519
11520    type SyncResponseFut = fidl::client::QueryResponseFut<
11521        NodeSyncResult,
11522        fdomain_client::fidl::FDomainResourceDialect,
11523    >;
11524    fn r#sync(&self) -> Self::SyncResponseFut {
11525        fn _decode(
11526            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11527        ) -> Result<NodeSyncResult, fidl::Error> {
11528            let _response = fidl::client::decode_transaction_body::<
11529                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11530                fdomain_client::fidl::FDomainResourceDialect,
11531                0x2c5c27ca0ab5dc49,
11532            >(_buf?)?;
11533            Ok(_response.map(|x| x))
11534        }
11535        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
11536            (),
11537            0x2c5c27ca0ab5dc49,
11538            fidl::encoding::DynamicFlags::empty(),
11539            _decode,
11540        )
11541    }
11542
11543    fn r#list_extended_attributes(
11544        &self,
11545        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11546    ) -> Result<(), fidl::Error> {
11547        self.client.send::<NodeListExtendedAttributesRequest>(
11548            (iterator,),
11549            0x4b61033de007fcd0,
11550            fidl::encoding::DynamicFlags::empty(),
11551        )
11552    }
11553
11554    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11555        NodeGetExtendedAttributeResult,
11556        fdomain_client::fidl::FDomainResourceDialect,
11557    >;
11558    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
11559        fn _decode(
11560            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11561        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
11562            let _response = fidl::client::decode_transaction_body::<
11563                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
11564                fdomain_client::fidl::FDomainResourceDialect,
11565                0x45ffa3ccfdeb76db,
11566            >(_buf?)?;
11567            Ok(_response.map(|x| x))
11568        }
11569        self.client.send_query_and_decode::<
11570            NodeGetExtendedAttributeRequest,
11571            NodeGetExtendedAttributeResult,
11572        >(
11573            (name,),
11574            0x45ffa3ccfdeb76db,
11575            fidl::encoding::DynamicFlags::empty(),
11576            _decode,
11577        )
11578    }
11579
11580    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11581        NodeSetExtendedAttributeResult,
11582        fdomain_client::fidl::FDomainResourceDialect,
11583    >;
11584    fn r#set_extended_attribute(
11585        &self,
11586        mut name: &[u8],
11587        mut value: ExtendedAttributeValue,
11588        mut mode: SetExtendedAttributeMode,
11589    ) -> Self::SetExtendedAttributeResponseFut {
11590        fn _decode(
11591            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11592        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
11593            let _response = fidl::client::decode_transaction_body::<
11594                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11595                fdomain_client::fidl::FDomainResourceDialect,
11596                0x4a951362f681f23c,
11597            >(_buf?)?;
11598            Ok(_response.map(|x| x))
11599        }
11600        self.client.send_query_and_decode::<
11601            NodeSetExtendedAttributeRequest,
11602            NodeSetExtendedAttributeResult,
11603        >(
11604            (name, &mut value, mode,),
11605            0x4a951362f681f23c,
11606            fidl::encoding::DynamicFlags::empty(),
11607            _decode,
11608        )
11609    }
11610
11611    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11612        NodeRemoveExtendedAttributeResult,
11613        fdomain_client::fidl::FDomainResourceDialect,
11614    >;
11615    fn r#remove_extended_attribute(
11616        &self,
11617        mut name: &[u8],
11618    ) -> Self::RemoveExtendedAttributeResponseFut {
11619        fn _decode(
11620            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11621        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
11622            let _response = fidl::client::decode_transaction_body::<
11623                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11624                fdomain_client::fidl::FDomainResourceDialect,
11625                0x7a0b9f3a9bf9032d,
11626            >(_buf?)?;
11627            Ok(_response.map(|x| x))
11628        }
11629        self.client.send_query_and_decode::<
11630            NodeRemoveExtendedAttributeRequest,
11631            NodeRemoveExtendedAttributeResult,
11632        >(
11633            (name,),
11634            0x7a0b9f3a9bf9032d,
11635            fidl::encoding::DynamicFlags::empty(),
11636            _decode,
11637        )
11638    }
11639}
11640
11641pub struct NodeEventStream {
11642    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
11643}
11644
11645impl std::marker::Unpin for NodeEventStream {}
11646
11647impl futures::stream::FusedStream for NodeEventStream {
11648    fn is_terminated(&self) -> bool {
11649        self.event_receiver.is_terminated()
11650    }
11651}
11652
11653impl futures::Stream for NodeEventStream {
11654    type Item = Result<NodeEvent, fidl::Error>;
11655
11656    fn poll_next(
11657        mut self: std::pin::Pin<&mut Self>,
11658        cx: &mut std::task::Context<'_>,
11659    ) -> std::task::Poll<Option<Self::Item>> {
11660        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11661            &mut self.event_receiver,
11662            cx
11663        )?) {
11664            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
11665            None => std::task::Poll::Ready(None),
11666        }
11667    }
11668}
11669
11670#[derive(Debug)]
11671pub enum NodeEvent {
11672    OnOpen_ {
11673        s: i32,
11674        info: Option<Box<NodeInfoDeprecated>>,
11675    },
11676    OnRepresentation {
11677        payload: Representation,
11678    },
11679    #[non_exhaustive]
11680    _UnknownEvent {
11681        /// Ordinal of the event that was sent.
11682        ordinal: u64,
11683    },
11684}
11685
11686impl NodeEvent {
11687    #[allow(irrefutable_let_patterns)]
11688    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
11689        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
11690    }
11691    #[allow(irrefutable_let_patterns)]
11692    pub fn into_on_representation(self) -> Option<Representation> {
11693        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
11694    }
11695
11696    /// Decodes a message buffer as a [`NodeEvent`].
11697    fn decode(
11698        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11699    ) -> Result<NodeEvent, fidl::Error> {
11700        let (bytes, _handles) = buf.split_mut();
11701        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11702        debug_assert_eq!(tx_header.tx_id, 0);
11703        match tx_header.ordinal {
11704            0x7fc7bbb1dbfd1972 => {
11705                let mut out = fidl::new_empty!(
11706                    NodeOnOpenRequest,
11707                    fdomain_client::fidl::FDomainResourceDialect
11708                );
11709                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
11710                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
11711            }
11712            0x5cb40567d80a510c => {
11713                let mut out =
11714                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
11715                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
11716                Ok((NodeEvent::OnRepresentation { payload: out }))
11717            }
11718            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11719                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11720            }
11721            _ => Err(fidl::Error::UnknownOrdinal {
11722                ordinal: tx_header.ordinal,
11723                protocol_name: <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
11724            }),
11725        }
11726    }
11727}
11728
11729/// A Stream of incoming requests for fuchsia.io/Node.
11730pub struct NodeRequestStream {
11731    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11732    is_terminated: bool,
11733}
11734
11735impl std::marker::Unpin for NodeRequestStream {}
11736
11737impl futures::stream::FusedStream for NodeRequestStream {
11738    fn is_terminated(&self) -> bool {
11739        self.is_terminated
11740    }
11741}
11742
11743impl fdomain_client::fidl::RequestStream for NodeRequestStream {
11744    type Protocol = NodeMarker;
11745    type ControlHandle = NodeControlHandle;
11746
11747    fn from_channel(channel: fdomain_client::Channel) -> Self {
11748        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11749    }
11750
11751    fn control_handle(&self) -> Self::ControlHandle {
11752        NodeControlHandle { inner: self.inner.clone() }
11753    }
11754
11755    fn into_inner(
11756        self,
11757    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
11758    {
11759        (self.inner, self.is_terminated)
11760    }
11761
11762    fn from_inner(
11763        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11764        is_terminated: bool,
11765    ) -> Self {
11766        Self { inner, is_terminated }
11767    }
11768}
11769
11770impl futures::Stream for NodeRequestStream {
11771    type Item = Result<NodeRequest, fidl::Error>;
11772
11773    fn poll_next(
11774        mut self: std::pin::Pin<&mut Self>,
11775        cx: &mut std::task::Context<'_>,
11776    ) -> std::task::Poll<Option<Self::Item>> {
11777        let this = &mut *self;
11778        if this.inner.check_shutdown(cx) {
11779            this.is_terminated = true;
11780            return std::task::Poll::Ready(None);
11781        }
11782        if this.is_terminated {
11783            panic!("polled NodeRequestStream after completion");
11784        }
11785        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
11786            |bytes, handles| {
11787                match this.inner.channel().read_etc(cx, bytes, handles) {
11788                    std::task::Poll::Ready(Ok(())) => {}
11789                    std::task::Poll::Pending => return std::task::Poll::Pending,
11790                    std::task::Poll::Ready(Err(None)) => {
11791                        this.is_terminated = true;
11792                        return std::task::Poll::Ready(None);
11793                    }
11794                    std::task::Poll::Ready(Err(Some(e))) => {
11795                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11796                            e.into(),
11797                        ))));
11798                    }
11799                }
11800
11801                // A message has been received from the channel
11802                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11803
11804                std::task::Poll::Ready(Some(match header.ordinal {
11805                    0x20d8a7aba2168a79 => {
11806                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11807                        let mut req = fidl::new_empty!(
11808                            fdomain_fuchsia_unknown::CloneableCloneRequest,
11809                            fdomain_client::fidl::FDomainResourceDialect
11810                        );
11811                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11812                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11813                        Ok(NodeRequest::Clone { request: req.request, control_handle })
11814                    }
11815                    0x5ac5d459ad7f657e => {
11816                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11817                        let mut req = fidl::new_empty!(
11818                            fidl::encoding::EmptyPayload,
11819                            fdomain_client::fidl::FDomainResourceDialect
11820                        );
11821                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11822                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11823                        Ok(NodeRequest::Close {
11824                            responder: NodeCloseResponder {
11825                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11826                                tx_id: header.tx_id,
11827                            },
11828                        })
11829                    }
11830                    0x2658edee9decfc06 => {
11831                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11832                        let mut req = fidl::new_empty!(
11833                            fidl::encoding::EmptyPayload,
11834                            fdomain_client::fidl::FDomainResourceDialect
11835                        );
11836                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11837                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11838                        Ok(NodeRequest::Query {
11839                            responder: NodeQueryResponder {
11840                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11841                                tx_id: header.tx_id,
11842                            },
11843                        })
11844                    }
11845                    0x5a61678f293ce16f => {
11846                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11847                        let mut req = fidl::new_empty!(
11848                            NodeDeprecatedCloneRequest,
11849                            fdomain_client::fidl::FDomainResourceDialect
11850                        );
11851                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11852                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11853                        Ok(NodeRequest::DeprecatedClone {
11854                            flags: req.flags,
11855                            object: req.object,
11856
11857                            control_handle,
11858                        })
11859                    }
11860                    0x78985e216314dafd => {
11861                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11862                        let mut req = fidl::new_empty!(
11863                            fidl::encoding::EmptyPayload,
11864                            fdomain_client::fidl::FDomainResourceDialect
11865                        );
11866                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11867                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11868                        Ok(NodeRequest::DeprecatedGetAttr {
11869                            responder: NodeDeprecatedGetAttrResponder {
11870                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11871                                tx_id: header.tx_id,
11872                            },
11873                        })
11874                    }
11875                    0x4186c0f40d938f46 => {
11876                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11877                        let mut req = fidl::new_empty!(
11878                            NodeDeprecatedSetAttrRequest,
11879                            fdomain_client::fidl::FDomainResourceDialect
11880                        );
11881                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
11882                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11883                        Ok(NodeRequest::DeprecatedSetAttr {
11884                            flags: req.flags,
11885                            attributes: req.attributes,
11886
11887                            responder: NodeDeprecatedSetAttrResponder {
11888                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11889                                tx_id: header.tx_id,
11890                            },
11891                        })
11892                    }
11893                    0x5b88fffb8eda3aa1 => {
11894                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11895                        let mut req = fidl::new_empty!(
11896                            fidl::encoding::EmptyPayload,
11897                            fdomain_client::fidl::FDomainResourceDialect
11898                        );
11899                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11900                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11901                        Ok(NodeRequest::DeprecatedGetFlags {
11902                            responder: NodeDeprecatedGetFlagsResponder {
11903                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11904                                tx_id: header.tx_id,
11905                            },
11906                        })
11907                    }
11908                    0x5295b76c71fde733 => {
11909                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11910                        let mut req = fidl::new_empty!(
11911                            NodeDeprecatedSetFlagsRequest,
11912                            fdomain_client::fidl::FDomainResourceDialect
11913                        );
11914                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11915                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11916                        Ok(NodeRequest::DeprecatedSetFlags {
11917                            flags: req.flags,
11918
11919                            responder: NodeDeprecatedSetFlagsResponder {
11920                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11921                                tx_id: header.tx_id,
11922                            },
11923                        })
11924                    }
11925                    0x176eb318f64ec23 => {
11926                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11927                        let mut req = fidl::new_empty!(
11928                            fidl::encoding::EmptyPayload,
11929                            fdomain_client::fidl::FDomainResourceDialect
11930                        );
11931                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11932                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11933                        Ok(NodeRequest::GetFlags {
11934                            responder: NodeGetFlagsResponder {
11935                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11936                                tx_id: header.tx_id,
11937                            },
11938                        })
11939                    }
11940                    0x55a8028685791ea8 => {
11941                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11942                        let mut req = fidl::new_empty!(
11943                            NodeSetFlagsRequest,
11944                            fdomain_client::fidl::FDomainResourceDialect
11945                        );
11946                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11947                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11948                        Ok(NodeRequest::SetFlags {
11949                            flags: req.flags,
11950
11951                            responder: NodeSetFlagsResponder {
11952                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11953                                tx_id: header.tx_id,
11954                            },
11955                        })
11956                    }
11957                    0x6f344a1c6b0a0610 => {
11958                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11959                        let mut req = fidl::new_empty!(
11960                            fidl::encoding::EmptyPayload,
11961                            fdomain_client::fidl::FDomainResourceDialect
11962                        );
11963                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11964                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11965                        Ok(NodeRequest::QueryFilesystem {
11966                            responder: NodeQueryFilesystemResponder {
11967                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11968                                tx_id: header.tx_id,
11969                            },
11970                        })
11971                    }
11972                    0x3d4396a638ea053b => {
11973                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11974                        let mut req = fidl::new_empty!(
11975                            NodeGetAttributesRequest,
11976                            fdomain_client::fidl::FDomainResourceDialect
11977                        );
11978                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11979                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11980                        Ok(NodeRequest::GetAttributes {
11981                            query: req.query,
11982
11983                            responder: NodeGetAttributesResponder {
11984                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11985                                tx_id: header.tx_id,
11986                            },
11987                        })
11988                    }
11989                    0x3308c1da5a89bf08 => {
11990                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11991                        let mut req = fidl::new_empty!(
11992                            MutableNodeAttributes,
11993                            fdomain_client::fidl::FDomainResourceDialect
11994                        );
11995                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
11996                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11997                        Ok(NodeRequest::UpdateAttributes {
11998                            payload: req,
11999                            responder: NodeUpdateAttributesResponder {
12000                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12001                                tx_id: header.tx_id,
12002                            },
12003                        })
12004                    }
12005                    0x2c5c27ca0ab5dc49 => {
12006                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12007                        let mut req = fidl::new_empty!(
12008                            fidl::encoding::EmptyPayload,
12009                            fdomain_client::fidl::FDomainResourceDialect
12010                        );
12011                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12012                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12013                        Ok(NodeRequest::Sync {
12014                            responder: NodeSyncResponder {
12015                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12016                                tx_id: header.tx_id,
12017                            },
12018                        })
12019                    }
12020                    0x4b61033de007fcd0 => {
12021                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12022                        let mut req = fidl::new_empty!(
12023                            NodeListExtendedAttributesRequest,
12024                            fdomain_client::fidl::FDomainResourceDialect
12025                        );
12026                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
12027                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12028                        Ok(NodeRequest::ListExtendedAttributes {
12029                            iterator: req.iterator,
12030
12031                            control_handle,
12032                        })
12033                    }
12034                    0x45ffa3ccfdeb76db => {
12035                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12036                        let mut req = fidl::new_empty!(
12037                            NodeGetExtendedAttributeRequest,
12038                            fdomain_client::fidl::FDomainResourceDialect
12039                        );
12040                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12041                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12042                        Ok(NodeRequest::GetExtendedAttribute {
12043                            name: req.name,
12044
12045                            responder: NodeGetExtendedAttributeResponder {
12046                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12047                                tx_id: header.tx_id,
12048                            },
12049                        })
12050                    }
12051                    0x4a951362f681f23c => {
12052                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12053                        let mut req = fidl::new_empty!(
12054                            NodeSetExtendedAttributeRequest,
12055                            fdomain_client::fidl::FDomainResourceDialect
12056                        );
12057                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12058                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12059                        Ok(NodeRequest::SetExtendedAttribute {
12060                            name: req.name,
12061                            value: req.value,
12062                            mode: req.mode,
12063
12064                            responder: NodeSetExtendedAttributeResponder {
12065                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12066                                tx_id: header.tx_id,
12067                            },
12068                        })
12069                    }
12070                    0x7a0b9f3a9bf9032d => {
12071                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12072                        let mut req = fidl::new_empty!(
12073                            NodeRemoveExtendedAttributeRequest,
12074                            fdomain_client::fidl::FDomainResourceDialect
12075                        );
12076                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12077                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12078                        Ok(NodeRequest::RemoveExtendedAttribute {
12079                            name: req.name,
12080
12081                            responder: NodeRemoveExtendedAttributeResponder {
12082                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12083                                tx_id: header.tx_id,
12084                            },
12085                        })
12086                    }
12087                    _ if header.tx_id == 0
12088                        && header
12089                            .dynamic_flags()
12090                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12091                    {
12092                        Ok(NodeRequest::_UnknownMethod {
12093                            ordinal: header.ordinal,
12094                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12095                            method_type: fidl::MethodType::OneWay,
12096                        })
12097                    }
12098                    _ if header
12099                        .dynamic_flags()
12100                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12101                    {
12102                        this.inner.send_framework_err(
12103                            fidl::encoding::FrameworkErr::UnknownMethod,
12104                            header.tx_id,
12105                            header.ordinal,
12106                            header.dynamic_flags(),
12107                            (bytes, handles),
12108                        )?;
12109                        Ok(NodeRequest::_UnknownMethod {
12110                            ordinal: header.ordinal,
12111                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12112                            method_type: fidl::MethodType::TwoWay,
12113                        })
12114                    }
12115                    _ => Err(fidl::Error::UnknownOrdinal {
12116                        ordinal: header.ordinal,
12117                        protocol_name:
12118                            <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
12119                    }),
12120                }))
12121            },
12122        )
12123    }
12124}
12125
12126/// Node defines the minimal interface for entities which can be accessed in a filesystem.
12127#[derive(Debug)]
12128pub enum NodeRequest {
12129    Clone {
12130        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12131        control_handle: NodeControlHandle,
12132    },
12133    /// Terminates the connection.
12134    ///
12135    /// After calling `Close`, the client must not send any other requests.
12136    ///
12137    /// Servers, after sending the status response, should close the connection
12138    /// regardless of status and without sending an epitaph.
12139    ///
12140    /// Closing the client end of the channel should be semantically equivalent
12141    /// to calling `Close` without knowing when the close has completed or its
12142    /// status.
12143    Close {
12144        responder: NodeCloseResponder,
12145    },
12146    Query {
12147        responder: NodeQueryResponder,
12148    },
12149    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12150    DeprecatedClone {
12151        flags: OpenFlags,
12152        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
12153        control_handle: NodeControlHandle,
12154    },
12155    /// DEPRECATED - Use `Node.GetAttributes` instead.
12156    ///
12157    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12158    DeprecatedGetAttr {
12159        responder: NodeDeprecatedGetAttrResponder,
12160    },
12161    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12162    DeprecatedSetAttr {
12163        flags: NodeAttributeFlags,
12164        attributes: NodeAttributes,
12165        responder: NodeDeprecatedSetAttrResponder,
12166    },
12167    /// [DEPRECATED - Use new GetFlags method instead.]
12168    DeprecatedGetFlags {
12169        responder: NodeDeprecatedGetFlagsResponder,
12170    },
12171    /// [DEPRECATED - Use new SetFlags method instead.]
12172    DeprecatedSetFlags {
12173        flags: OpenFlags,
12174        responder: NodeDeprecatedSetFlagsResponder,
12175    },
12176    /// Queries the flags that apply to this node after it has been opened/created. This method does
12177    /// not require any rights.
12178    ///
12179    /// Note that the final set of flags that apply to the connection may differ from those
12180    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
12181    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
12182    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
12183    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
12184    GetFlags {
12185        responder: NodeGetFlagsResponder,
12186    },
12187    /// Sets the flags that apply to this node after it has been opened. This method does not
12188    /// require any rights.
12189    ///
12190    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
12191    /// clear append mode.
12192    ///
12193    /// Errors:
12194    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
12195    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
12196    SetFlags {
12197        flags: Flags,
12198        responder: NodeSetFlagsResponder,
12199    },
12200    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
12201    /// volume has different settings or the storage is accounted seperately from the rest of the
12202    /// filesystem that may be reported instead of filesystem-wide details.
12203    QueryFilesystem {
12204        responder: NodeQueryFilesystemResponder,
12205    },
12206    /// Acquires information about the node.
12207    ///
12208    /// The attributes of a node should be stable, independent of the
12209    /// specific protocol used to access it.
12210    ///
12211    /// If a particular attribute is not applicable or not supported,
12212    /// filesystems should leave the corresponding field absent.
12213    ///
12214    /// + `query` a bit-mask specifying which attributes to fetch. The server
12215    ///   should not return more than necessary.
12216    /// - `attributes` the returned attributes.
12217    ///
12218    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12219    GetAttributes {
12220        query: NodeAttributesQuery,
12221        responder: NodeGetAttributesResponder,
12222    },
12223    /// Updates information about the node.
12224    ///
12225    /// + `attributes` the presence of a table field in `attributes` indicates
12226    /// the intent to update the corresponding attribute.
12227    ///
12228    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
12229    ///
12230    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12231    UpdateAttributes {
12232        payload: MutableNodeAttributes,
12233        responder: NodeUpdateAttributesResponder,
12234    },
12235    /// Synchronizes updates to the node to the underlying media, if it exists.
12236    ///
12237    /// This method will return when the filesystem server has flushed the
12238    /// relevant updates to the underlying media, but does not guarantee the
12239    /// underlying media has persisted the information, nor that any information
12240    /// is committed to hardware. Clients may use `Sync` to ensure ordering
12241    /// between operations.
12242    ///
12243    /// This method does not require any rights.
12244    Sync {
12245        responder: NodeSyncResponder,
12246    },
12247    /// Creates an iterator over all the extended attribute names associated
12248    /// with this node. If an error occurs it is returned as an epitaph on the
12249    /// iterator request channel, and then the channel is closed.
12250    ///
12251    /// GetExtendedAttributes can be used with any of these names to retrieve
12252    /// the associated value.
12253    ///
12254    /// This method requires the [`Rights.READ_BYTES`] right.
12255    ListExtendedAttributes {
12256        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
12257        control_handle: NodeControlHandle,
12258    },
12259    /// Get the value associated with the given attribute `name` for this node.
12260    ///
12261    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
12262    /// particular structure is imposed on them.
12263    ///
12264    /// This method requires the [`Rights.READ_BYTES`] right.
12265    GetExtendedAttribute {
12266        name: Vec<u8>,
12267        responder: NodeGetExtendedAttributeResponder,
12268    },
12269    /// Set the value for the given attribute `name` to `value` for this node.
12270    ///
12271    /// The attribute name may exist, in which case the attribute is updated.
12272    /// If the attribute doesn't exist, it is created. The name should have no
12273    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
12274    ///
12275    /// This method requires the [`Rights.WRITE_BYTES`] right.
12276    SetExtendedAttribute {
12277        name: Vec<u8>,
12278        value: ExtendedAttributeValue,
12279        mode: SetExtendedAttributeMode,
12280        responder: NodeSetExtendedAttributeResponder,
12281    },
12282    /// Remove the specified extended attribute.
12283    ///
12284    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
12285    ///
12286    /// This method requires the [`Rights.WRITE_BYTES`] right.
12287    RemoveExtendedAttribute {
12288        name: Vec<u8>,
12289        responder: NodeRemoveExtendedAttributeResponder,
12290    },
12291    /// An interaction was received which does not match any known method.
12292    #[non_exhaustive]
12293    _UnknownMethod {
12294        /// Ordinal of the method that was called.
12295        ordinal: u64,
12296        control_handle: NodeControlHandle,
12297        method_type: fidl::MethodType,
12298    },
12299}
12300
12301impl NodeRequest {
12302    #[allow(irrefutable_let_patterns)]
12303    pub fn into_clone(
12304        self,
12305    ) -> Option<(
12306        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12307        NodeControlHandle,
12308    )> {
12309        if let NodeRequest::Clone { request, control_handle } = self {
12310            Some((request, control_handle))
12311        } else {
12312            None
12313        }
12314    }
12315
12316    #[allow(irrefutable_let_patterns)]
12317    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
12318        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
12319    }
12320
12321    #[allow(irrefutable_let_patterns)]
12322    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
12323        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
12324    }
12325
12326    #[allow(irrefutable_let_patterns)]
12327    pub fn into_deprecated_clone(
12328        self,
12329    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, NodeControlHandle)> {
12330        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
12331            Some((flags, object, control_handle))
12332        } else {
12333            None
12334        }
12335    }
12336
12337    #[allow(irrefutable_let_patterns)]
12338    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
12339        if let NodeRequest::DeprecatedGetAttr { responder } = self {
12340            Some((responder))
12341        } else {
12342            None
12343        }
12344    }
12345
12346    #[allow(irrefutable_let_patterns)]
12347    pub fn into_deprecated_set_attr(
12348        self,
12349    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
12350        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
12351            Some((flags, attributes, responder))
12352        } else {
12353            None
12354        }
12355    }
12356
12357    #[allow(irrefutable_let_patterns)]
12358    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
12359        if let NodeRequest::DeprecatedGetFlags { responder } = self {
12360            Some((responder))
12361        } else {
12362            None
12363        }
12364    }
12365
12366    #[allow(irrefutable_let_patterns)]
12367    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
12368        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
12369            Some((flags, responder))
12370        } else {
12371            None
12372        }
12373    }
12374
12375    #[allow(irrefutable_let_patterns)]
12376    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
12377        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
12378    }
12379
12380    #[allow(irrefutable_let_patterns)]
12381    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
12382        if let NodeRequest::SetFlags { flags, responder } = self {
12383            Some((flags, responder))
12384        } else {
12385            None
12386        }
12387    }
12388
12389    #[allow(irrefutable_let_patterns)]
12390    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
12391        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
12392    }
12393
12394    #[allow(irrefutable_let_patterns)]
12395    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
12396        if let NodeRequest::GetAttributes { query, responder } = self {
12397            Some((query, responder))
12398        } else {
12399            None
12400        }
12401    }
12402
12403    #[allow(irrefutable_let_patterns)]
12404    pub fn into_update_attributes(
12405        self,
12406    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
12407        if let NodeRequest::UpdateAttributes { payload, responder } = self {
12408            Some((payload, responder))
12409        } else {
12410            None
12411        }
12412    }
12413
12414    #[allow(irrefutable_let_patterns)]
12415    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
12416        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
12417    }
12418
12419    #[allow(irrefutable_let_patterns)]
12420    pub fn into_list_extended_attributes(
12421        self,
12422    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
12423    {
12424        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
12425            Some((iterator, control_handle))
12426        } else {
12427            None
12428        }
12429    }
12430
12431    #[allow(irrefutable_let_patterns)]
12432    pub fn into_get_extended_attribute(
12433        self,
12434    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
12435        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
12436            Some((name, responder))
12437        } else {
12438            None
12439        }
12440    }
12441
12442    #[allow(irrefutable_let_patterns)]
12443    pub fn into_set_extended_attribute(
12444        self,
12445    ) -> Option<(
12446        Vec<u8>,
12447        ExtendedAttributeValue,
12448        SetExtendedAttributeMode,
12449        NodeSetExtendedAttributeResponder,
12450    )> {
12451        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
12452            Some((name, value, mode, responder))
12453        } else {
12454            None
12455        }
12456    }
12457
12458    #[allow(irrefutable_let_patterns)]
12459    pub fn into_remove_extended_attribute(
12460        self,
12461    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
12462        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
12463            Some((name, responder))
12464        } else {
12465            None
12466        }
12467    }
12468
12469    /// Name of the method defined in FIDL
12470    pub fn method_name(&self) -> &'static str {
12471        match *self {
12472            NodeRequest::Clone { .. } => "clone",
12473            NodeRequest::Close { .. } => "close",
12474            NodeRequest::Query { .. } => "query",
12475            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
12476            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
12477            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
12478            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
12479            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
12480            NodeRequest::GetFlags { .. } => "get_flags",
12481            NodeRequest::SetFlags { .. } => "set_flags",
12482            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
12483            NodeRequest::GetAttributes { .. } => "get_attributes",
12484            NodeRequest::UpdateAttributes { .. } => "update_attributes",
12485            NodeRequest::Sync { .. } => "sync",
12486            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
12487            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
12488            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
12489            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
12490            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12491                "unknown one-way method"
12492            }
12493            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12494                "unknown two-way method"
12495            }
12496        }
12497    }
12498}
12499
12500#[derive(Debug, Clone)]
12501pub struct NodeControlHandle {
12502    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
12503}
12504
12505impl NodeControlHandle {
12506    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12507        self.inner.shutdown_with_epitaph(status.into())
12508    }
12509}
12510
12511impl fdomain_client::fidl::ControlHandle for NodeControlHandle {
12512    fn shutdown(&self) {
12513        self.inner.shutdown()
12514    }
12515
12516    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12517        self.inner.shutdown_with_epitaph(status)
12518    }
12519
12520    fn is_closed(&self) -> bool {
12521        self.inner.channel().is_closed()
12522    }
12523    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
12524        self.inner.channel().on_closed()
12525    }
12526}
12527
12528impl NodeControlHandle {
12529    pub fn send_on_open_(
12530        &self,
12531        mut s: i32,
12532        mut info: Option<NodeInfoDeprecated>,
12533    ) -> Result<(), fidl::Error> {
12534        self.inner.send::<NodeOnOpenRequest>(
12535            (s, info.as_mut()),
12536            0,
12537            0x7fc7bbb1dbfd1972,
12538            fidl::encoding::DynamicFlags::FLEXIBLE,
12539        )
12540    }
12541
12542    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
12543        self.inner.send::<Representation>(
12544            &mut payload,
12545            0,
12546            0x5cb40567d80a510c,
12547            fidl::encoding::DynamicFlags::empty(),
12548        )
12549    }
12550}
12551
12552#[must_use = "FIDL methods require a response to be sent"]
12553#[derive(Debug)]
12554pub struct NodeCloseResponder {
12555    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12556    tx_id: u32,
12557}
12558
12559/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12560/// if the responder is dropped without sending a response, so that the client
12561/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12562impl std::ops::Drop for NodeCloseResponder {
12563    fn drop(&mut self) {
12564        self.control_handle.shutdown();
12565        // Safety: drops once, never accessed again
12566        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12567    }
12568}
12569
12570impl fdomain_client::fidl::Responder for NodeCloseResponder {
12571    type ControlHandle = NodeControlHandle;
12572
12573    fn control_handle(&self) -> &NodeControlHandle {
12574        &self.control_handle
12575    }
12576
12577    fn drop_without_shutdown(mut self) {
12578        // Safety: drops once, never accessed again due to mem::forget
12579        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12580        // Prevent Drop from running (which would shut down the channel)
12581        std::mem::forget(self);
12582    }
12583}
12584
12585impl NodeCloseResponder {
12586    /// Sends a response to the FIDL transaction.
12587    ///
12588    /// Sets the channel to shutdown if an error occurs.
12589    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12590        let _result = self.send_raw(result);
12591        if _result.is_err() {
12592            self.control_handle.shutdown();
12593        }
12594        self.drop_without_shutdown();
12595        _result
12596    }
12597
12598    /// Similar to "send" but does not shutdown the channel if an error occurs.
12599    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12600        let _result = self.send_raw(result);
12601        self.drop_without_shutdown();
12602        _result
12603    }
12604
12605    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12606        self.control_handle
12607            .inner
12608            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12609                result,
12610                self.tx_id,
12611                0x5ac5d459ad7f657e,
12612                fidl::encoding::DynamicFlags::empty(),
12613            )
12614    }
12615}
12616
12617#[must_use = "FIDL methods require a response to be sent"]
12618#[derive(Debug)]
12619pub struct NodeQueryResponder {
12620    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12621    tx_id: u32,
12622}
12623
12624/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12625/// if the responder is dropped without sending a response, so that the client
12626/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12627impl std::ops::Drop for NodeQueryResponder {
12628    fn drop(&mut self) {
12629        self.control_handle.shutdown();
12630        // Safety: drops once, never accessed again
12631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12632    }
12633}
12634
12635impl fdomain_client::fidl::Responder for NodeQueryResponder {
12636    type ControlHandle = NodeControlHandle;
12637
12638    fn control_handle(&self) -> &NodeControlHandle {
12639        &self.control_handle
12640    }
12641
12642    fn drop_without_shutdown(mut self) {
12643        // Safety: drops once, never accessed again due to mem::forget
12644        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12645        // Prevent Drop from running (which would shut down the channel)
12646        std::mem::forget(self);
12647    }
12648}
12649
12650impl NodeQueryResponder {
12651    /// Sends a response to the FIDL transaction.
12652    ///
12653    /// Sets the channel to shutdown if an error occurs.
12654    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12655        let _result = self.send_raw(protocol);
12656        if _result.is_err() {
12657            self.control_handle.shutdown();
12658        }
12659        self.drop_without_shutdown();
12660        _result
12661    }
12662
12663    /// Similar to "send" but does not shutdown the channel if an error occurs.
12664    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12665        let _result = self.send_raw(protocol);
12666        self.drop_without_shutdown();
12667        _result
12668    }
12669
12670    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12671        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
12672            (protocol,),
12673            self.tx_id,
12674            0x2658edee9decfc06,
12675            fidl::encoding::DynamicFlags::empty(),
12676        )
12677    }
12678}
12679
12680#[must_use = "FIDL methods require a response to be sent"]
12681#[derive(Debug)]
12682pub struct NodeDeprecatedGetAttrResponder {
12683    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12684    tx_id: u32,
12685}
12686
12687/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12688/// if the responder is dropped without sending a response, so that the client
12689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12690impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
12691    fn drop(&mut self) {
12692        self.control_handle.shutdown();
12693        // Safety: drops once, never accessed again
12694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12695    }
12696}
12697
12698impl fdomain_client::fidl::Responder for NodeDeprecatedGetAttrResponder {
12699    type ControlHandle = NodeControlHandle;
12700
12701    fn control_handle(&self) -> &NodeControlHandle {
12702        &self.control_handle
12703    }
12704
12705    fn drop_without_shutdown(mut self) {
12706        // Safety: drops once, never accessed again due to mem::forget
12707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12708        // Prevent Drop from running (which would shut down the channel)
12709        std::mem::forget(self);
12710    }
12711}
12712
12713impl NodeDeprecatedGetAttrResponder {
12714    /// Sends a response to the FIDL transaction.
12715    ///
12716    /// Sets the channel to shutdown if an error occurs.
12717    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12718        let _result = self.send_raw(s, attributes);
12719        if _result.is_err() {
12720            self.control_handle.shutdown();
12721        }
12722        self.drop_without_shutdown();
12723        _result
12724    }
12725
12726    /// Similar to "send" but does not shutdown the channel if an error occurs.
12727    pub fn send_no_shutdown_on_err(
12728        self,
12729        mut s: i32,
12730        mut attributes: &NodeAttributes,
12731    ) -> Result<(), fidl::Error> {
12732        let _result = self.send_raw(s, attributes);
12733        self.drop_without_shutdown();
12734        _result
12735    }
12736
12737    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12738        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
12739            (s, attributes),
12740            self.tx_id,
12741            0x78985e216314dafd,
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 NodeDeprecatedSetAttrResponder {
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 NodeDeprecatedSetAttrResponder {
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 NodeDeprecatedSetAttrResponder {
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 NodeDeprecatedSetAttrResponder {
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 s: i32) -> Result<(), fidl::Error> {
12785        let _result = self.send_raw(s);
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 s: i32) -> Result<(), fidl::Error> {
12795        let _result = self.send_raw(s);
12796        self.drop_without_shutdown();
12797        _result
12798    }
12799
12800    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12801        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
12802            (s,),
12803            self.tx_id,
12804            0x4186c0f40d938f46,
12805            fidl::encoding::DynamicFlags::empty(),
12806        )
12807    }
12808}
12809
12810#[must_use = "FIDL methods require a response to be sent"]
12811#[derive(Debug)]
12812pub struct NodeDeprecatedGetFlagsResponder {
12813    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12814    tx_id: u32,
12815}
12816
12817/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12818/// if the responder is dropped without sending a response, so that the client
12819/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12820impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
12821    fn drop(&mut self) {
12822        self.control_handle.shutdown();
12823        // Safety: drops once, never accessed again
12824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12825    }
12826}
12827
12828impl fdomain_client::fidl::Responder for NodeDeprecatedGetFlagsResponder {
12829    type ControlHandle = NodeControlHandle;
12830
12831    fn control_handle(&self) -> &NodeControlHandle {
12832        &self.control_handle
12833    }
12834
12835    fn drop_without_shutdown(mut self) {
12836        // Safety: drops once, never accessed again due to mem::forget
12837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12838        // Prevent Drop from running (which would shut down the channel)
12839        std::mem::forget(self);
12840    }
12841}
12842
12843impl NodeDeprecatedGetFlagsResponder {
12844    /// Sends a response to the FIDL transaction.
12845    ///
12846    /// Sets the channel to shutdown if an error occurs.
12847    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12848        let _result = self.send_raw(s, flags);
12849        if _result.is_err() {
12850            self.control_handle.shutdown();
12851        }
12852        self.drop_without_shutdown();
12853        _result
12854    }
12855
12856    /// Similar to "send" but does not shutdown the channel if an error occurs.
12857    pub fn send_no_shutdown_on_err(
12858        self,
12859        mut s: i32,
12860        mut flags: OpenFlags,
12861    ) -> Result<(), fidl::Error> {
12862        let _result = self.send_raw(s, flags);
12863        self.drop_without_shutdown();
12864        _result
12865    }
12866
12867    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12868        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
12869            (s, flags),
12870            self.tx_id,
12871            0x5b88fffb8eda3aa1,
12872            fidl::encoding::DynamicFlags::empty(),
12873        )
12874    }
12875}
12876
12877#[must_use = "FIDL methods require a response to be sent"]
12878#[derive(Debug)]
12879pub struct NodeDeprecatedSetFlagsResponder {
12880    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12881    tx_id: u32,
12882}
12883
12884/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12885/// if the responder is dropped without sending a response, so that the client
12886/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12887impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
12888    fn drop(&mut self) {
12889        self.control_handle.shutdown();
12890        // Safety: drops once, never accessed again
12891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12892    }
12893}
12894
12895impl fdomain_client::fidl::Responder for NodeDeprecatedSetFlagsResponder {
12896    type ControlHandle = NodeControlHandle;
12897
12898    fn control_handle(&self) -> &NodeControlHandle {
12899        &self.control_handle
12900    }
12901
12902    fn drop_without_shutdown(mut self) {
12903        // Safety: drops once, never accessed again due to mem::forget
12904        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12905        // Prevent Drop from running (which would shut down the channel)
12906        std::mem::forget(self);
12907    }
12908}
12909
12910impl NodeDeprecatedSetFlagsResponder {
12911    /// Sends a response to the FIDL transaction.
12912    ///
12913    /// Sets the channel to shutdown if an error occurs.
12914    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12915        let _result = self.send_raw(s);
12916        if _result.is_err() {
12917            self.control_handle.shutdown();
12918        }
12919        self.drop_without_shutdown();
12920        _result
12921    }
12922
12923    /// Similar to "send" but does not shutdown the channel if an error occurs.
12924    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12925        let _result = self.send_raw(s);
12926        self.drop_without_shutdown();
12927        _result
12928    }
12929
12930    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12931        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
12932            (s,),
12933            self.tx_id,
12934            0x5295b76c71fde733,
12935            fidl::encoding::DynamicFlags::empty(),
12936        )
12937    }
12938}
12939
12940#[must_use = "FIDL methods require a response to be sent"]
12941#[derive(Debug)]
12942pub struct NodeGetFlagsResponder {
12943    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12944    tx_id: u32,
12945}
12946
12947/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12948/// if the responder is dropped without sending a response, so that the client
12949/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12950impl std::ops::Drop for NodeGetFlagsResponder {
12951    fn drop(&mut self) {
12952        self.control_handle.shutdown();
12953        // Safety: drops once, never accessed again
12954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12955    }
12956}
12957
12958impl fdomain_client::fidl::Responder for NodeGetFlagsResponder {
12959    type ControlHandle = NodeControlHandle;
12960
12961    fn control_handle(&self) -> &NodeControlHandle {
12962        &self.control_handle
12963    }
12964
12965    fn drop_without_shutdown(mut self) {
12966        // Safety: drops once, never accessed again due to mem::forget
12967        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12968        // Prevent Drop from running (which would shut down the channel)
12969        std::mem::forget(self);
12970    }
12971}
12972
12973impl NodeGetFlagsResponder {
12974    /// Sends a response to the FIDL transaction.
12975    ///
12976    /// Sets the channel to shutdown if an error occurs.
12977    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12978        let _result = self.send_raw(result);
12979        if _result.is_err() {
12980            self.control_handle.shutdown();
12981        }
12982        self.drop_without_shutdown();
12983        _result
12984    }
12985
12986    /// Similar to "send" but does not shutdown the channel if an error occurs.
12987    pub fn send_no_shutdown_on_err(
12988        self,
12989        mut result: Result<Flags, i32>,
12990    ) -> Result<(), fidl::Error> {
12991        let _result = self.send_raw(result);
12992        self.drop_without_shutdown();
12993        _result
12994    }
12995
12996    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12997        self.control_handle
12998            .inner
12999            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
13000                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
13001                self.tx_id,
13002                0x176eb318f64ec23,
13003                fidl::encoding::DynamicFlags::FLEXIBLE,
13004            )
13005    }
13006}
13007
13008#[must_use = "FIDL methods require a response to be sent"]
13009#[derive(Debug)]
13010pub struct NodeSetFlagsResponder {
13011    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13012    tx_id: u32,
13013}
13014
13015/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13016/// if the responder is dropped without sending a response, so that the client
13017/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13018impl std::ops::Drop for NodeSetFlagsResponder {
13019    fn drop(&mut self) {
13020        self.control_handle.shutdown();
13021        // Safety: drops once, never accessed again
13022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13023    }
13024}
13025
13026impl fdomain_client::fidl::Responder for NodeSetFlagsResponder {
13027    type ControlHandle = NodeControlHandle;
13028
13029    fn control_handle(&self) -> &NodeControlHandle {
13030        &self.control_handle
13031    }
13032
13033    fn drop_without_shutdown(mut self) {
13034        // Safety: drops once, never accessed again due to mem::forget
13035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13036        // Prevent Drop from running (which would shut down the channel)
13037        std::mem::forget(self);
13038    }
13039}
13040
13041impl NodeSetFlagsResponder {
13042    /// Sends a response to the FIDL transaction.
13043    ///
13044    /// Sets the channel to shutdown if an error occurs.
13045    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13046        let _result = self.send_raw(result);
13047        if _result.is_err() {
13048            self.control_handle.shutdown();
13049        }
13050        self.drop_without_shutdown();
13051        _result
13052    }
13053
13054    /// Similar to "send" but does not shutdown the channel if an error occurs.
13055    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13056        let _result = self.send_raw(result);
13057        self.drop_without_shutdown();
13058        _result
13059    }
13060
13061    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13062        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
13063            fidl::encoding::EmptyStruct,
13064            i32,
13065        >>(
13066            fidl::encoding::FlexibleResult::new(result),
13067            self.tx_id,
13068            0x55a8028685791ea8,
13069            fidl::encoding::DynamicFlags::FLEXIBLE,
13070        )
13071    }
13072}
13073
13074#[must_use = "FIDL methods require a response to be sent"]
13075#[derive(Debug)]
13076pub struct NodeQueryFilesystemResponder {
13077    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13078    tx_id: u32,
13079}
13080
13081/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13082/// if the responder is dropped without sending a response, so that the client
13083/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13084impl std::ops::Drop for NodeQueryFilesystemResponder {
13085    fn drop(&mut self) {
13086        self.control_handle.shutdown();
13087        // Safety: drops once, never accessed again
13088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13089    }
13090}
13091
13092impl fdomain_client::fidl::Responder for NodeQueryFilesystemResponder {
13093    type ControlHandle = NodeControlHandle;
13094
13095    fn control_handle(&self) -> &NodeControlHandle {
13096        &self.control_handle
13097    }
13098
13099    fn drop_without_shutdown(mut self) {
13100        // Safety: drops once, never accessed again due to mem::forget
13101        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13102        // Prevent Drop from running (which would shut down the channel)
13103        std::mem::forget(self);
13104    }
13105}
13106
13107impl NodeQueryFilesystemResponder {
13108    /// Sends a response to the FIDL transaction.
13109    ///
13110    /// Sets the channel to shutdown if an error occurs.
13111    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13112        let _result = self.send_raw(s, info);
13113        if _result.is_err() {
13114            self.control_handle.shutdown();
13115        }
13116        self.drop_without_shutdown();
13117        _result
13118    }
13119
13120    /// Similar to "send" but does not shutdown the channel if an error occurs.
13121    pub fn send_no_shutdown_on_err(
13122        self,
13123        mut s: i32,
13124        mut info: Option<&FilesystemInfo>,
13125    ) -> Result<(), fidl::Error> {
13126        let _result = self.send_raw(s, info);
13127        self.drop_without_shutdown();
13128        _result
13129    }
13130
13131    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13132        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
13133            (s, info),
13134            self.tx_id,
13135            0x6f344a1c6b0a0610,
13136            fidl::encoding::DynamicFlags::empty(),
13137        )
13138    }
13139}
13140
13141#[must_use = "FIDL methods require a response to be sent"]
13142#[derive(Debug)]
13143pub struct NodeGetAttributesResponder {
13144    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13145    tx_id: u32,
13146}
13147
13148/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13149/// if the responder is dropped without sending a response, so that the client
13150/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13151impl std::ops::Drop for NodeGetAttributesResponder {
13152    fn drop(&mut self) {
13153        self.control_handle.shutdown();
13154        // Safety: drops once, never accessed again
13155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13156    }
13157}
13158
13159impl fdomain_client::fidl::Responder for NodeGetAttributesResponder {
13160    type ControlHandle = NodeControlHandle;
13161
13162    fn control_handle(&self) -> &NodeControlHandle {
13163        &self.control_handle
13164    }
13165
13166    fn drop_without_shutdown(mut self) {
13167        // Safety: drops once, never accessed again due to mem::forget
13168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13169        // Prevent Drop from running (which would shut down the channel)
13170        std::mem::forget(self);
13171    }
13172}
13173
13174impl NodeGetAttributesResponder {
13175    /// Sends a response to the FIDL transaction.
13176    ///
13177    /// Sets the channel to shutdown if an error occurs.
13178    pub fn send(
13179        self,
13180        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13181    ) -> Result<(), fidl::Error> {
13182        let _result = self.send_raw(result);
13183        if _result.is_err() {
13184            self.control_handle.shutdown();
13185        }
13186        self.drop_without_shutdown();
13187        _result
13188    }
13189
13190    /// Similar to "send" but does not shutdown the channel if an error occurs.
13191    pub fn send_no_shutdown_on_err(
13192        self,
13193        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13194    ) -> Result<(), fidl::Error> {
13195        let _result = self.send_raw(result);
13196        self.drop_without_shutdown();
13197        _result
13198    }
13199
13200    fn send_raw(
13201        &self,
13202        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13203    ) -> Result<(), fidl::Error> {
13204        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
13205            result,
13206            self.tx_id,
13207            0x3d4396a638ea053b,
13208            fidl::encoding::DynamicFlags::empty(),
13209        )
13210    }
13211}
13212
13213#[must_use = "FIDL methods require a response to be sent"]
13214#[derive(Debug)]
13215pub struct NodeUpdateAttributesResponder {
13216    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13217    tx_id: u32,
13218}
13219
13220/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13221/// if the responder is dropped without sending a response, so that the client
13222/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13223impl std::ops::Drop for NodeUpdateAttributesResponder {
13224    fn drop(&mut self) {
13225        self.control_handle.shutdown();
13226        // Safety: drops once, never accessed again
13227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13228    }
13229}
13230
13231impl fdomain_client::fidl::Responder for NodeUpdateAttributesResponder {
13232    type ControlHandle = NodeControlHandle;
13233
13234    fn control_handle(&self) -> &NodeControlHandle {
13235        &self.control_handle
13236    }
13237
13238    fn drop_without_shutdown(mut self) {
13239        // Safety: drops once, never accessed again due to mem::forget
13240        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13241        // Prevent Drop from running (which would shut down the channel)
13242        std::mem::forget(self);
13243    }
13244}
13245
13246impl NodeUpdateAttributesResponder {
13247    /// Sends a response to the FIDL transaction.
13248    ///
13249    /// Sets the channel to shutdown if an error occurs.
13250    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13251        let _result = self.send_raw(result);
13252        if _result.is_err() {
13253            self.control_handle.shutdown();
13254        }
13255        self.drop_without_shutdown();
13256        _result
13257    }
13258
13259    /// Similar to "send" but does not shutdown the channel if an error occurs.
13260    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13261        let _result = self.send_raw(result);
13262        self.drop_without_shutdown();
13263        _result
13264    }
13265
13266    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13267        self.control_handle
13268            .inner
13269            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13270                result,
13271                self.tx_id,
13272                0x3308c1da5a89bf08,
13273                fidl::encoding::DynamicFlags::empty(),
13274            )
13275    }
13276}
13277
13278#[must_use = "FIDL methods require a response to be sent"]
13279#[derive(Debug)]
13280pub struct NodeSyncResponder {
13281    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13282    tx_id: u32,
13283}
13284
13285/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13286/// if the responder is dropped without sending a response, so that the client
13287/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13288impl std::ops::Drop for NodeSyncResponder {
13289    fn drop(&mut self) {
13290        self.control_handle.shutdown();
13291        // Safety: drops once, never accessed again
13292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13293    }
13294}
13295
13296impl fdomain_client::fidl::Responder for NodeSyncResponder {
13297    type ControlHandle = NodeControlHandle;
13298
13299    fn control_handle(&self) -> &NodeControlHandle {
13300        &self.control_handle
13301    }
13302
13303    fn drop_without_shutdown(mut self) {
13304        // Safety: drops once, never accessed again due to mem::forget
13305        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13306        // Prevent Drop from running (which would shut down the channel)
13307        std::mem::forget(self);
13308    }
13309}
13310
13311impl NodeSyncResponder {
13312    /// Sends a response to the FIDL transaction.
13313    ///
13314    /// Sets the channel to shutdown if an error occurs.
13315    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13316        let _result = self.send_raw(result);
13317        if _result.is_err() {
13318            self.control_handle.shutdown();
13319        }
13320        self.drop_without_shutdown();
13321        _result
13322    }
13323
13324    /// Similar to "send" but does not shutdown the channel if an error occurs.
13325    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13326        let _result = self.send_raw(result);
13327        self.drop_without_shutdown();
13328        _result
13329    }
13330
13331    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13332        self.control_handle
13333            .inner
13334            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13335                result,
13336                self.tx_id,
13337                0x2c5c27ca0ab5dc49,
13338                fidl::encoding::DynamicFlags::empty(),
13339            )
13340    }
13341}
13342
13343#[must_use = "FIDL methods require a response to be sent"]
13344#[derive(Debug)]
13345pub struct NodeGetExtendedAttributeResponder {
13346    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13347    tx_id: u32,
13348}
13349
13350/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13351/// if the responder is dropped without sending a response, so that the client
13352/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13353impl std::ops::Drop for NodeGetExtendedAttributeResponder {
13354    fn drop(&mut self) {
13355        self.control_handle.shutdown();
13356        // Safety: drops once, never accessed again
13357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13358    }
13359}
13360
13361impl fdomain_client::fidl::Responder for NodeGetExtendedAttributeResponder {
13362    type ControlHandle = NodeControlHandle;
13363
13364    fn control_handle(&self) -> &NodeControlHandle {
13365        &self.control_handle
13366    }
13367
13368    fn drop_without_shutdown(mut self) {
13369        // Safety: drops once, never accessed again due to mem::forget
13370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13371        // Prevent Drop from running (which would shut down the channel)
13372        std::mem::forget(self);
13373    }
13374}
13375
13376impl NodeGetExtendedAttributeResponder {
13377    /// Sends a response to the FIDL transaction.
13378    ///
13379    /// Sets the channel to shutdown if an error occurs.
13380    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13381        let _result = self.send_raw(result);
13382        if _result.is_err() {
13383            self.control_handle.shutdown();
13384        }
13385        self.drop_without_shutdown();
13386        _result
13387    }
13388
13389    /// Similar to "send" but does not shutdown the channel if an error occurs.
13390    pub fn send_no_shutdown_on_err(
13391        self,
13392        mut result: Result<ExtendedAttributeValue, i32>,
13393    ) -> Result<(), fidl::Error> {
13394        let _result = self.send_raw(result);
13395        self.drop_without_shutdown();
13396        _result
13397    }
13398
13399    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13400        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
13401            result.as_mut().map_err(|e| *e),
13402            self.tx_id,
13403            0x45ffa3ccfdeb76db,
13404            fidl::encoding::DynamicFlags::empty(),
13405        )
13406    }
13407}
13408
13409#[must_use = "FIDL methods require a response to be sent"]
13410#[derive(Debug)]
13411pub struct NodeSetExtendedAttributeResponder {
13412    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13413    tx_id: u32,
13414}
13415
13416/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13417/// if the responder is dropped without sending a response, so that the client
13418/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13419impl std::ops::Drop for NodeSetExtendedAttributeResponder {
13420    fn drop(&mut self) {
13421        self.control_handle.shutdown();
13422        // Safety: drops once, never accessed again
13423        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13424    }
13425}
13426
13427impl fdomain_client::fidl::Responder for NodeSetExtendedAttributeResponder {
13428    type ControlHandle = NodeControlHandle;
13429
13430    fn control_handle(&self) -> &NodeControlHandle {
13431        &self.control_handle
13432    }
13433
13434    fn drop_without_shutdown(mut self) {
13435        // Safety: drops once, never accessed again due to mem::forget
13436        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13437        // Prevent Drop from running (which would shut down the channel)
13438        std::mem::forget(self);
13439    }
13440}
13441
13442impl NodeSetExtendedAttributeResponder {
13443    /// Sends a response to the FIDL transaction.
13444    ///
13445    /// Sets the channel to shutdown if an error occurs.
13446    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13447        let _result = self.send_raw(result);
13448        if _result.is_err() {
13449            self.control_handle.shutdown();
13450        }
13451        self.drop_without_shutdown();
13452        _result
13453    }
13454
13455    /// Similar to "send" but does not shutdown the channel if an error occurs.
13456    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13457        let _result = self.send_raw(result);
13458        self.drop_without_shutdown();
13459        _result
13460    }
13461
13462    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13463        self.control_handle
13464            .inner
13465            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13466                result,
13467                self.tx_id,
13468                0x4a951362f681f23c,
13469                fidl::encoding::DynamicFlags::empty(),
13470            )
13471    }
13472}
13473
13474#[must_use = "FIDL methods require a response to be sent"]
13475#[derive(Debug)]
13476pub struct NodeRemoveExtendedAttributeResponder {
13477    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13478    tx_id: u32,
13479}
13480
13481/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13482/// if the responder is dropped without sending a response, so that the client
13483/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13484impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
13485    fn drop(&mut self) {
13486        self.control_handle.shutdown();
13487        // Safety: drops once, never accessed again
13488        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13489    }
13490}
13491
13492impl fdomain_client::fidl::Responder for NodeRemoveExtendedAttributeResponder {
13493    type ControlHandle = NodeControlHandle;
13494
13495    fn control_handle(&self) -> &NodeControlHandle {
13496        &self.control_handle
13497    }
13498
13499    fn drop_without_shutdown(mut self) {
13500        // Safety: drops once, never accessed again due to mem::forget
13501        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13502        // Prevent Drop from running (which would shut down the channel)
13503        std::mem::forget(self);
13504    }
13505}
13506
13507impl NodeRemoveExtendedAttributeResponder {
13508    /// Sends a response to the FIDL transaction.
13509    ///
13510    /// Sets the channel to shutdown if an error occurs.
13511    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13512        let _result = self.send_raw(result);
13513        if _result.is_err() {
13514            self.control_handle.shutdown();
13515        }
13516        self.drop_without_shutdown();
13517        _result
13518    }
13519
13520    /// Similar to "send" but does not shutdown the channel if an error occurs.
13521    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13522        let _result = self.send_raw(result);
13523        self.drop_without_shutdown();
13524        _result
13525    }
13526
13527    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13528        self.control_handle
13529            .inner
13530            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13531                result,
13532                self.tx_id,
13533                0x7a0b9f3a9bf9032d,
13534                fidl::encoding::DynamicFlags::empty(),
13535            )
13536    }
13537}
13538
13539#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13540pub struct OpenableMarker;
13541
13542impl fdomain_client::fidl::ProtocolMarker for OpenableMarker {
13543    type Proxy = OpenableProxy;
13544    type RequestStream = OpenableRequestStream;
13545
13546    const DEBUG_NAME: &'static str = "(anonymous) Openable";
13547}
13548
13549pub trait OpenableProxyInterface: Send + Sync {
13550    fn r#open(
13551        &self,
13552        path: &str,
13553        flags: Flags,
13554        options: &Options,
13555        object: fdomain_client::Channel,
13556    ) -> Result<(), fidl::Error>;
13557}
13558
13559#[derive(Debug, Clone)]
13560pub struct OpenableProxy {
13561    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13562}
13563
13564impl fdomain_client::fidl::Proxy for OpenableProxy {
13565    type Protocol = OpenableMarker;
13566
13567    fn from_channel(inner: fdomain_client::Channel) -> Self {
13568        Self::new(inner)
13569    }
13570
13571    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13572        self.client.into_channel().map_err(|client| Self { client })
13573    }
13574
13575    fn as_channel(&self) -> &fdomain_client::Channel {
13576        self.client.as_channel()
13577    }
13578}
13579
13580impl OpenableProxy {
13581    /// Create a new Proxy for fuchsia.io/Openable.
13582    pub fn new(channel: fdomain_client::Channel) -> Self {
13583        let protocol_name = <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13584        Self { client: fidl::client::Client::new(channel, protocol_name) }
13585    }
13586
13587    /// Get a Stream of events from the remote end of the protocol.
13588    ///
13589    /// # Panics
13590    ///
13591    /// Panics if the event stream was already taken.
13592    pub fn take_event_stream(&self) -> OpenableEventStream {
13593        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
13594    }
13595
13596    /// Open (or create) a node relative to this directory. Any errors are communicated via an
13597    /// epitaph sent on the `object` channel.
13598    ///
13599    /// Errors:
13600    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
13601    /// * See [`Flags`] for other errors which may be communicated based on `flags`
13602    pub fn r#open(
13603        &self,
13604        mut path: &str,
13605        mut flags: Flags,
13606        mut options: &Options,
13607        mut object: fdomain_client::Channel,
13608    ) -> Result<(), fidl::Error> {
13609        OpenableProxyInterface::r#open(self, path, flags, options, object)
13610    }
13611}
13612
13613impl OpenableProxyInterface for OpenableProxy {
13614    fn r#open(
13615        &self,
13616        mut path: &str,
13617        mut flags: Flags,
13618        mut options: &Options,
13619        mut object: fdomain_client::Channel,
13620    ) -> Result<(), fidl::Error> {
13621        self.client.send::<OpenableOpenRequest>(
13622            (path, flags, options, object),
13623            0x568ddcb9a9cbb6d9,
13624            fidl::encoding::DynamicFlags::FLEXIBLE,
13625        )
13626    }
13627}
13628
13629pub struct OpenableEventStream {
13630    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
13631}
13632
13633impl std::marker::Unpin for OpenableEventStream {}
13634
13635impl futures::stream::FusedStream for OpenableEventStream {
13636    fn is_terminated(&self) -> bool {
13637        self.event_receiver.is_terminated()
13638    }
13639}
13640
13641impl futures::Stream for OpenableEventStream {
13642    type Item = Result<OpenableEvent, fidl::Error>;
13643
13644    fn poll_next(
13645        mut self: std::pin::Pin<&mut Self>,
13646        cx: &mut std::task::Context<'_>,
13647    ) -> std::task::Poll<Option<Self::Item>> {
13648        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13649            &mut self.event_receiver,
13650            cx
13651        )?) {
13652            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
13653            None => std::task::Poll::Ready(None),
13654        }
13655    }
13656}
13657
13658#[derive(Debug)]
13659pub enum OpenableEvent {
13660    #[non_exhaustive]
13661    _UnknownEvent {
13662        /// Ordinal of the event that was sent.
13663        ordinal: u64,
13664    },
13665}
13666
13667impl OpenableEvent {
13668    /// Decodes a message buffer as a [`OpenableEvent`].
13669    fn decode(
13670        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13671    ) -> Result<OpenableEvent, fidl::Error> {
13672        let (bytes, _handles) = buf.split_mut();
13673        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13674        debug_assert_eq!(tx_header.tx_id, 0);
13675        match tx_header.ordinal {
13676            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13677                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
13678            }
13679            _ => Err(fidl::Error::UnknownOrdinal {
13680                ordinal: tx_header.ordinal,
13681                protocol_name: <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13682            }),
13683        }
13684    }
13685}
13686
13687/// A Stream of incoming requests for fuchsia.io/Openable.
13688pub struct OpenableRequestStream {
13689    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13690    is_terminated: bool,
13691}
13692
13693impl std::marker::Unpin for OpenableRequestStream {}
13694
13695impl futures::stream::FusedStream for OpenableRequestStream {
13696    fn is_terminated(&self) -> bool {
13697        self.is_terminated
13698    }
13699}
13700
13701impl fdomain_client::fidl::RequestStream for OpenableRequestStream {
13702    type Protocol = OpenableMarker;
13703    type ControlHandle = OpenableControlHandle;
13704
13705    fn from_channel(channel: fdomain_client::Channel) -> Self {
13706        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13707    }
13708
13709    fn control_handle(&self) -> Self::ControlHandle {
13710        OpenableControlHandle { inner: self.inner.clone() }
13711    }
13712
13713    fn into_inner(
13714        self,
13715    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
13716    {
13717        (self.inner, self.is_terminated)
13718    }
13719
13720    fn from_inner(
13721        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13722        is_terminated: bool,
13723    ) -> Self {
13724        Self { inner, is_terminated }
13725    }
13726}
13727
13728impl futures::Stream for OpenableRequestStream {
13729    type Item = Result<OpenableRequest, fidl::Error>;
13730
13731    fn poll_next(
13732        mut self: std::pin::Pin<&mut Self>,
13733        cx: &mut std::task::Context<'_>,
13734    ) -> std::task::Poll<Option<Self::Item>> {
13735        let this = &mut *self;
13736        if this.inner.check_shutdown(cx) {
13737            this.is_terminated = true;
13738            return std::task::Poll::Ready(None);
13739        }
13740        if this.is_terminated {
13741            panic!("polled OpenableRequestStream after completion");
13742        }
13743        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
13744            |bytes, handles| {
13745                match this.inner.channel().read_etc(cx, bytes, handles) {
13746                    std::task::Poll::Ready(Ok(())) => {}
13747                    std::task::Poll::Pending => return std::task::Poll::Pending,
13748                    std::task::Poll::Ready(Err(None)) => {
13749                        this.is_terminated = true;
13750                        return std::task::Poll::Ready(None);
13751                    }
13752                    std::task::Poll::Ready(Err(Some(e))) => {
13753                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13754                            e.into(),
13755                        ))));
13756                    }
13757                }
13758
13759                // A message has been received from the channel
13760                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13761
13762                std::task::Poll::Ready(Some(match header.ordinal {
13763                    0x568ddcb9a9cbb6d9 => {
13764                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
13765                        let mut req = fidl::new_empty!(
13766                            OpenableOpenRequest,
13767                            fdomain_client::fidl::FDomainResourceDialect
13768                        );
13769                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
13770                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
13771                        Ok(OpenableRequest::Open {
13772                            path: req.path,
13773                            flags: req.flags,
13774                            options: req.options,
13775                            object: req.object,
13776
13777                            control_handle,
13778                        })
13779                    }
13780                    _ if header.tx_id == 0
13781                        && header
13782                            .dynamic_flags()
13783                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
13784                    {
13785                        Ok(OpenableRequest::_UnknownMethod {
13786                            ordinal: header.ordinal,
13787                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
13788                            method_type: fidl::MethodType::OneWay,
13789                        })
13790                    }
13791                    _ if header
13792                        .dynamic_flags()
13793                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
13794                    {
13795                        this.inner.send_framework_err(
13796                            fidl::encoding::FrameworkErr::UnknownMethod,
13797                            header.tx_id,
13798                            header.ordinal,
13799                            header.dynamic_flags(),
13800                            (bytes, handles),
13801                        )?;
13802                        Ok(OpenableRequest::_UnknownMethod {
13803                            ordinal: header.ordinal,
13804                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
13805                            method_type: fidl::MethodType::TwoWay,
13806                        })
13807                    }
13808                    _ => Err(fidl::Error::UnknownOrdinal {
13809                        ordinal: header.ordinal,
13810                        protocol_name:
13811                            <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13812                    }),
13813                }))
13814            },
13815        )
13816    }
13817}
13818
13819/// Openable defines a node which is capable of opening other objects.
13820#[derive(Debug)]
13821pub enum OpenableRequest {
13822    /// Open (or create) a node relative to this directory. Any errors are communicated via an
13823    /// epitaph sent on the `object` channel.
13824    ///
13825    /// Errors:
13826    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
13827    /// * See [`Flags`] for other errors which may be communicated based on `flags`
13828    Open {
13829        path: String,
13830        flags: Flags,
13831        options: Options,
13832        object: fdomain_client::Channel,
13833        control_handle: OpenableControlHandle,
13834    },
13835    /// An interaction was received which does not match any known method.
13836    #[non_exhaustive]
13837    _UnknownMethod {
13838        /// Ordinal of the method that was called.
13839        ordinal: u64,
13840        control_handle: OpenableControlHandle,
13841        method_type: fidl::MethodType,
13842    },
13843}
13844
13845impl OpenableRequest {
13846    #[allow(irrefutable_let_patterns)]
13847    pub fn into_open(
13848        self,
13849    ) -> Option<(String, Flags, Options, fdomain_client::Channel, OpenableControlHandle)> {
13850        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
13851            Some((path, flags, options, object, control_handle))
13852        } else {
13853            None
13854        }
13855    }
13856
13857    /// Name of the method defined in FIDL
13858    pub fn method_name(&self) -> &'static str {
13859        match *self {
13860            OpenableRequest::Open { .. } => "open",
13861            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
13862                "unknown one-way method"
13863            }
13864            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
13865                "unknown two-way method"
13866            }
13867        }
13868    }
13869}
13870
13871#[derive(Debug, Clone)]
13872pub struct OpenableControlHandle {
13873    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13874}
13875
13876impl OpenableControlHandle {
13877    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
13878        self.inner.shutdown_with_epitaph(status.into())
13879    }
13880}
13881
13882impl fdomain_client::fidl::ControlHandle for OpenableControlHandle {
13883    fn shutdown(&self) {
13884        self.inner.shutdown()
13885    }
13886
13887    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
13888        self.inner.shutdown_with_epitaph(status)
13889    }
13890
13891    fn is_closed(&self) -> bool {
13892        self.inner.channel().is_closed()
13893    }
13894    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
13895        self.inner.channel().on_closed()
13896    }
13897}
13898
13899impl OpenableControlHandle {}
13900
13901#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13902pub struct ReadableMarker;
13903
13904impl fdomain_client::fidl::ProtocolMarker for ReadableMarker {
13905    type Proxy = ReadableProxy;
13906    type RequestStream = ReadableRequestStream;
13907
13908    const DEBUG_NAME: &'static str = "(anonymous) Readable";
13909}
13910pub type ReadableReadResult = Result<Vec<u8>, i32>;
13911
13912pub trait ReadableProxyInterface: Send + Sync {
13913    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
13914        + Send;
13915    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
13916}
13917
13918#[derive(Debug, Clone)]
13919pub struct ReadableProxy {
13920    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13921}
13922
13923impl fdomain_client::fidl::Proxy for ReadableProxy {
13924    type Protocol = ReadableMarker;
13925
13926    fn from_channel(inner: fdomain_client::Channel) -> Self {
13927        Self::new(inner)
13928    }
13929
13930    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13931        self.client.into_channel().map_err(|client| Self { client })
13932    }
13933
13934    fn as_channel(&self) -> &fdomain_client::Channel {
13935        self.client.as_channel()
13936    }
13937}
13938
13939impl ReadableProxy {
13940    /// Create a new Proxy for fuchsia.io/Readable.
13941    pub fn new(channel: fdomain_client::Channel) -> Self {
13942        let protocol_name = <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13943        Self { client: fidl::client::Client::new(channel, protocol_name) }
13944    }
13945
13946    /// Get a Stream of events from the remote end of the protocol.
13947    ///
13948    /// # Panics
13949    ///
13950    /// Panics if the event stream was already taken.
13951    pub fn take_event_stream(&self) -> ReadableEventStream {
13952        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
13953    }
13954
13955    /// Reads up to 'count' bytes at the seek offset.
13956    /// The seek offset is moved forward by the number of bytes read.
13957    ///
13958    /// ## Invariants
13959    ///
13960    /// * The returned `data.length` will never be greater than `count`.
13961    /// * If `data.length` is less than `count`, it means that the seek offset
13962    ///   has reached the end of file as part of this operation.
13963    /// * If `data.length` is zero while `count` is not, it means that the
13964    ///   seek offset is already at or beyond the end of file, and no data could
13965    ///   be read.
13966    /// * If `count` is zero, the server should perform all the checks ensuring
13967    ///   read access without actually read anything, and return an empty
13968    ///   `data` vector.
13969    ///
13970    /// This method requires the [`Rights.READ_BYTES`] right.
13971    ///
13972    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13973    pub fn r#read(
13974        &self,
13975        mut count: u64,
13976    ) -> fidl::client::QueryResponseFut<
13977        ReadableReadResult,
13978        fdomain_client::fidl::FDomainResourceDialect,
13979    > {
13980        ReadableProxyInterface::r#read(self, count)
13981    }
13982}
13983
13984impl ReadableProxyInterface for ReadableProxy {
13985    type ReadResponseFut = fidl::client::QueryResponseFut<
13986        ReadableReadResult,
13987        fdomain_client::fidl::FDomainResourceDialect,
13988    >;
13989    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
13990        fn _decode(
13991            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13992        ) -> Result<ReadableReadResult, fidl::Error> {
13993            let _response = fidl::client::decode_transaction_body::<
13994                fidl::encoding::ResultType<ReadableReadResponse, i32>,
13995                fdomain_client::fidl::FDomainResourceDialect,
13996                0x57e419a298c8ede,
13997            >(_buf?)?;
13998            Ok(_response.map(|x| x.data))
13999        }
14000        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
14001            (count,),
14002            0x57e419a298c8ede,
14003            fidl::encoding::DynamicFlags::empty(),
14004            _decode,
14005        )
14006    }
14007}
14008
14009pub struct ReadableEventStream {
14010    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
14011}
14012
14013impl std::marker::Unpin for ReadableEventStream {}
14014
14015impl futures::stream::FusedStream for ReadableEventStream {
14016    fn is_terminated(&self) -> bool {
14017        self.event_receiver.is_terminated()
14018    }
14019}
14020
14021impl futures::Stream for ReadableEventStream {
14022    type Item = Result<ReadableEvent, fidl::Error>;
14023
14024    fn poll_next(
14025        mut self: std::pin::Pin<&mut Self>,
14026        cx: &mut std::task::Context<'_>,
14027    ) -> std::task::Poll<Option<Self::Item>> {
14028        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14029            &mut self.event_receiver,
14030            cx
14031        )?) {
14032            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
14033            None => std::task::Poll::Ready(None),
14034        }
14035    }
14036}
14037
14038#[derive(Debug)]
14039pub enum ReadableEvent {}
14040
14041impl ReadableEvent {
14042    /// Decodes a message buffer as a [`ReadableEvent`].
14043    fn decode(
14044        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14045    ) -> Result<ReadableEvent, fidl::Error> {
14046        let (bytes, _handles) = buf.split_mut();
14047        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14048        debug_assert_eq!(tx_header.tx_id, 0);
14049        match tx_header.ordinal {
14050            _ => Err(fidl::Error::UnknownOrdinal {
14051                ordinal: tx_header.ordinal,
14052                protocol_name: <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14053            }),
14054        }
14055    }
14056}
14057
14058/// A Stream of incoming requests for fuchsia.io/Readable.
14059pub struct ReadableRequestStream {
14060    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14061    is_terminated: bool,
14062}
14063
14064impl std::marker::Unpin for ReadableRequestStream {}
14065
14066impl futures::stream::FusedStream for ReadableRequestStream {
14067    fn is_terminated(&self) -> bool {
14068        self.is_terminated
14069    }
14070}
14071
14072impl fdomain_client::fidl::RequestStream for ReadableRequestStream {
14073    type Protocol = ReadableMarker;
14074    type ControlHandle = ReadableControlHandle;
14075
14076    fn from_channel(channel: fdomain_client::Channel) -> Self {
14077        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14078    }
14079
14080    fn control_handle(&self) -> Self::ControlHandle {
14081        ReadableControlHandle { inner: self.inner.clone() }
14082    }
14083
14084    fn into_inner(
14085        self,
14086    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
14087    {
14088        (self.inner, self.is_terminated)
14089    }
14090
14091    fn from_inner(
14092        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14093        is_terminated: bool,
14094    ) -> Self {
14095        Self { inner, is_terminated }
14096    }
14097}
14098
14099impl futures::Stream for ReadableRequestStream {
14100    type Item = Result<ReadableRequest, fidl::Error>;
14101
14102    fn poll_next(
14103        mut self: std::pin::Pin<&mut Self>,
14104        cx: &mut std::task::Context<'_>,
14105    ) -> std::task::Poll<Option<Self::Item>> {
14106        let this = &mut *self;
14107        if this.inner.check_shutdown(cx) {
14108            this.is_terminated = true;
14109            return std::task::Poll::Ready(None);
14110        }
14111        if this.is_terminated {
14112            panic!("polled ReadableRequestStream after completion");
14113        }
14114        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14115            |bytes, handles| {
14116                match this.inner.channel().read_etc(cx, bytes, handles) {
14117                    std::task::Poll::Ready(Ok(())) => {}
14118                    std::task::Poll::Pending => return std::task::Poll::Pending,
14119                    std::task::Poll::Ready(Err(None)) => {
14120                        this.is_terminated = true;
14121                        return std::task::Poll::Ready(None);
14122                    }
14123                    std::task::Poll::Ready(Err(Some(e))) => {
14124                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14125                            e.into(),
14126                        ))));
14127                    }
14128                }
14129
14130                // A message has been received from the channel
14131                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14132
14133                std::task::Poll::Ready(Some(match header.ordinal {
14134                    0x57e419a298c8ede => {
14135                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14136                        let mut req = fidl::new_empty!(
14137                            ReadableReadRequest,
14138                            fdomain_client::fidl::FDomainResourceDialect
14139                        );
14140                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
14141                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
14142                        Ok(ReadableRequest::Read {
14143                            count: req.count,
14144
14145                            responder: ReadableReadResponder {
14146                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14147                                tx_id: header.tx_id,
14148                            },
14149                        })
14150                    }
14151                    _ => Err(fidl::Error::UnknownOrdinal {
14152                        ordinal: header.ordinal,
14153                        protocol_name:
14154                            <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14155                    }),
14156                }))
14157            },
14158        )
14159    }
14160}
14161
14162#[derive(Debug)]
14163pub enum ReadableRequest {
14164    /// Reads up to 'count' bytes at the seek offset.
14165    /// The seek offset is moved forward by the number of bytes read.
14166    ///
14167    /// ## Invariants
14168    ///
14169    /// * The returned `data.length` will never be greater than `count`.
14170    /// * If `data.length` is less than `count`, it means that the seek offset
14171    ///   has reached the end of file as part of this operation.
14172    /// * If `data.length` is zero while `count` is not, it means that the
14173    ///   seek offset is already at or beyond the end of file, and no data could
14174    ///   be read.
14175    /// * If `count` is zero, the server should perform all the checks ensuring
14176    ///   read access without actually read anything, and return an empty
14177    ///   `data` vector.
14178    ///
14179    /// This method requires the [`Rights.READ_BYTES`] right.
14180    ///
14181    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
14182    Read { count: u64, responder: ReadableReadResponder },
14183}
14184
14185impl ReadableRequest {
14186    #[allow(irrefutable_let_patterns)]
14187    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
14188        if let ReadableRequest::Read { count, responder } = self {
14189            Some((count, responder))
14190        } else {
14191            None
14192        }
14193    }
14194
14195    /// Name of the method defined in FIDL
14196    pub fn method_name(&self) -> &'static str {
14197        match *self {
14198            ReadableRequest::Read { .. } => "read",
14199        }
14200    }
14201}
14202
14203#[derive(Debug, Clone)]
14204pub struct ReadableControlHandle {
14205    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14206}
14207
14208impl ReadableControlHandle {
14209    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
14210        self.inner.shutdown_with_epitaph(status.into())
14211    }
14212}
14213
14214impl fdomain_client::fidl::ControlHandle for ReadableControlHandle {
14215    fn shutdown(&self) {
14216        self.inner.shutdown()
14217    }
14218
14219    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
14220        self.inner.shutdown_with_epitaph(status)
14221    }
14222
14223    fn is_closed(&self) -> bool {
14224        self.inner.channel().is_closed()
14225    }
14226    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
14227        self.inner.channel().on_closed()
14228    }
14229}
14230
14231impl ReadableControlHandle {}
14232
14233#[must_use = "FIDL methods require a response to be sent"]
14234#[derive(Debug)]
14235pub struct ReadableReadResponder {
14236    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
14237    tx_id: u32,
14238}
14239
14240/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
14241/// if the responder is dropped without sending a response, so that the client
14242/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14243impl std::ops::Drop for ReadableReadResponder {
14244    fn drop(&mut self) {
14245        self.control_handle.shutdown();
14246        // Safety: drops once, never accessed again
14247        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14248    }
14249}
14250
14251impl fdomain_client::fidl::Responder for ReadableReadResponder {
14252    type ControlHandle = ReadableControlHandle;
14253
14254    fn control_handle(&self) -> &ReadableControlHandle {
14255        &self.control_handle
14256    }
14257
14258    fn drop_without_shutdown(mut self) {
14259        // Safety: drops once, never accessed again due to mem::forget
14260        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14261        // Prevent Drop from running (which would shut down the channel)
14262        std::mem::forget(self);
14263    }
14264}
14265
14266impl ReadableReadResponder {
14267    /// Sends a response to the FIDL transaction.
14268    ///
14269    /// Sets the channel to shutdown if an error occurs.
14270    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14271        let _result = self.send_raw(result);
14272        if _result.is_err() {
14273            self.control_handle.shutdown();
14274        }
14275        self.drop_without_shutdown();
14276        _result
14277    }
14278
14279    /// Similar to "send" but does not shutdown the channel if an error occurs.
14280    pub fn send_no_shutdown_on_err(
14281        self,
14282        mut result: Result<&[u8], i32>,
14283    ) -> Result<(), fidl::Error> {
14284        let _result = self.send_raw(result);
14285        self.drop_without_shutdown();
14286        _result
14287    }
14288
14289    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14290        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
14291            result.map(|data| (data,)),
14292            self.tx_id,
14293            0x57e419a298c8ede,
14294            fidl::encoding::DynamicFlags::empty(),
14295        )
14296    }
14297}
14298
14299#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
14300pub struct SymlinkMarker;
14301
14302impl fdomain_client::fidl::ProtocolMarker for SymlinkMarker {
14303    type Proxy = SymlinkProxy;
14304    type RequestStream = SymlinkRequestStream;
14305
14306    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
14307}
14308impl fdomain_client::fidl::DiscoverableProtocolMarker for SymlinkMarker {}
14309
14310pub trait SymlinkProxyInterface: Send + Sync {
14311    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
14312        + Send;
14313    fn r#link_into(
14314        &self,
14315        dst_parent_token: fdomain_client::Event,
14316        dst: &str,
14317    ) -> Self::LinkIntoResponseFut;
14318    fn r#clone(
14319        &self,
14320        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14321    ) -> Result<(), fidl::Error>;
14322    type CloseResponseFut: std::future::Future<
14323            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
14324        > + Send;
14325    fn r#close(&self) -> Self::CloseResponseFut;
14326    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
14327    fn r#query(&self) -> Self::QueryResponseFut;
14328    fn r#deprecated_clone(
14329        &self,
14330        flags: OpenFlags,
14331        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14332    ) -> Result<(), fidl::Error>;
14333    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
14334        + Send;
14335    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
14336    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
14337    fn r#deprecated_set_attr(
14338        &self,
14339        flags: NodeAttributeFlags,
14340        attributes: &NodeAttributes,
14341    ) -> Self::DeprecatedSetAttrResponseFut;
14342    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
14343        + Send;
14344    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
14345    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
14346        + Send;
14347    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
14348    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
14349        + Send;
14350    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
14351    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
14352        + Send;
14353    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
14354    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
14355        + Send;
14356    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
14357    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
14358        + Send;
14359    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
14360    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
14361        + Send;
14362    fn r#update_attributes(
14363        &self,
14364        payload: &MutableNodeAttributes,
14365    ) -> Self::UpdateAttributesResponseFut;
14366    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
14367    fn r#sync(&self) -> Self::SyncResponseFut;
14368    fn r#list_extended_attributes(
14369        &self,
14370        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14371    ) -> Result<(), fidl::Error>;
14372    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
14373        + Send;
14374    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
14375    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
14376        + Send;
14377    fn r#set_extended_attribute(
14378        &self,
14379        name: &[u8],
14380        value: ExtendedAttributeValue,
14381        mode: SetExtendedAttributeMode,
14382    ) -> Self::SetExtendedAttributeResponseFut;
14383    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
14384        + Send;
14385    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
14386    fn r#open(
14387        &self,
14388        path: &str,
14389        flags: Flags,
14390        options: &Options,
14391        object: fdomain_client::Channel,
14392    ) -> Result<(), fidl::Error>;
14393    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
14394    fn r#describe(&self) -> Self::DescribeResponseFut;
14395}
14396
14397#[derive(Debug, Clone)]
14398pub struct SymlinkProxy {
14399    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
14400}
14401
14402impl fdomain_client::fidl::Proxy for SymlinkProxy {
14403    type Protocol = SymlinkMarker;
14404
14405    fn from_channel(inner: fdomain_client::Channel) -> Self {
14406        Self::new(inner)
14407    }
14408
14409    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
14410        self.client.into_channel().map_err(|client| Self { client })
14411    }
14412
14413    fn as_channel(&self) -> &fdomain_client::Channel {
14414        self.client.as_channel()
14415    }
14416}
14417
14418impl SymlinkProxy {
14419    /// Create a new Proxy for fuchsia.io/Symlink.
14420    pub fn new(channel: fdomain_client::Channel) -> Self {
14421        let protocol_name = <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
14422        Self { client: fidl::client::Client::new(channel, protocol_name) }
14423    }
14424
14425    /// Get a Stream of events from the remote end of the protocol.
14426    ///
14427    /// # Panics
14428    ///
14429    /// Panics if the event stream was already taken.
14430    pub fn take_event_stream(&self) -> SymlinkEventStream {
14431        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
14432    }
14433
14434    /// Creates a link to this this object with name `dst` in the directory represented by
14435    /// `dst_parent_token`.
14436    ///
14437    /// `dst` must be a resolved object name. Including "/" in the string will return
14438    /// `ZX_ERR_INVALID_ARGS`.
14439    ///
14440    /// This method requires the maximal set of rights supported by the filesystem for this object.
14441    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
14442    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
14443    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
14444    /// `ZX_ERR_ACCESS_DENIED`.
14445    ///
14446    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
14447    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
14448    ///
14449    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
14450    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
14451    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
14452    ///
14453    /// This method does not have the same atomicity properties has the `Directory::Link` method,
14454    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
14455    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
14456    pub fn r#link_into(
14457        &self,
14458        mut dst_parent_token: fdomain_client::Event,
14459        mut dst: &str,
14460    ) -> fidl::client::QueryResponseFut<
14461        LinkableLinkIntoResult,
14462        fdomain_client::fidl::FDomainResourceDialect,
14463    > {
14464        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
14465    }
14466
14467    pub fn r#clone(
14468        &self,
14469        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14470    ) -> Result<(), fidl::Error> {
14471        SymlinkProxyInterface::r#clone(self, request)
14472    }
14473
14474    /// Terminates the connection.
14475    ///
14476    /// After calling `Close`, the client must not send any other requests.
14477    ///
14478    /// Servers, after sending the status response, should close the connection
14479    /// regardless of status and without sending an epitaph.
14480    ///
14481    /// Closing the client end of the channel should be semantically equivalent
14482    /// to calling `Close` without knowing when the close has completed or its
14483    /// status.
14484    pub fn r#close(
14485        &self,
14486    ) -> fidl::client::QueryResponseFut<
14487        fdomain_fuchsia_unknown::CloseableCloseResult,
14488        fdomain_client::fidl::FDomainResourceDialect,
14489    > {
14490        SymlinkProxyInterface::r#close(self)
14491    }
14492
14493    pub fn r#query(
14494        &self,
14495    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
14496        SymlinkProxyInterface::r#query(self)
14497    }
14498
14499    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14500    pub fn r#deprecated_clone(
14501        &self,
14502        mut flags: OpenFlags,
14503        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14504    ) -> Result<(), fidl::Error> {
14505        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
14506    }
14507
14508    /// DEPRECATED - Use `Node.GetAttributes` instead.
14509    ///
14510    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14511    pub fn r#deprecated_get_attr(
14512        &self,
14513    ) -> fidl::client::QueryResponseFut<
14514        (i32, NodeAttributes),
14515        fdomain_client::fidl::FDomainResourceDialect,
14516    > {
14517        SymlinkProxyInterface::r#deprecated_get_attr(self)
14518    }
14519
14520    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14521    pub fn r#deprecated_set_attr(
14522        &self,
14523        mut flags: NodeAttributeFlags,
14524        mut attributes: &NodeAttributes,
14525    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14526        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
14527    }
14528
14529    /// [DEPRECATED - Use new GetFlags method instead.]
14530    pub fn r#deprecated_get_flags(
14531        &self,
14532    ) -> fidl::client::QueryResponseFut<
14533        (i32, OpenFlags),
14534        fdomain_client::fidl::FDomainResourceDialect,
14535    > {
14536        SymlinkProxyInterface::r#deprecated_get_flags(self)
14537    }
14538
14539    /// [DEPRECATED - Use new SetFlags method instead.]
14540    pub fn r#deprecated_set_flags(
14541        &self,
14542        mut flags: OpenFlags,
14543    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14544        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
14545    }
14546
14547    /// Queries the flags that apply to this node after it has been opened/created. This method does
14548    /// not require any rights.
14549    ///
14550    /// Note that the final set of flags that apply to the connection may differ from those
14551    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14552    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14553    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14554    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14555    pub fn r#get_flags(
14556        &self,
14557    ) -> fidl::client::QueryResponseFut<
14558        NodeGetFlagsResult,
14559        fdomain_client::fidl::FDomainResourceDialect,
14560    > {
14561        SymlinkProxyInterface::r#get_flags(self)
14562    }
14563
14564    /// Sets the flags that apply to this node after it has been opened. This method does not
14565    /// require any rights.
14566    ///
14567    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14568    /// clear append mode.
14569    ///
14570    /// Errors:
14571    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14572    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14573    pub fn r#set_flags(
14574        &self,
14575        mut flags: Flags,
14576    ) -> fidl::client::QueryResponseFut<
14577        NodeSetFlagsResult,
14578        fdomain_client::fidl::FDomainResourceDialect,
14579    > {
14580        SymlinkProxyInterface::r#set_flags(self, flags)
14581    }
14582
14583    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14584    /// volume has different settings or the storage is accounted seperately from the rest of the
14585    /// filesystem that may be reported instead of filesystem-wide details.
14586    pub fn r#query_filesystem(
14587        &self,
14588    ) -> fidl::client::QueryResponseFut<
14589        (i32, Option<Box<FilesystemInfo>>),
14590        fdomain_client::fidl::FDomainResourceDialect,
14591    > {
14592        SymlinkProxyInterface::r#query_filesystem(self)
14593    }
14594
14595    /// Acquires information about the node.
14596    ///
14597    /// The attributes of a node should be stable, independent of the
14598    /// specific protocol used to access it.
14599    ///
14600    /// If a particular attribute is not applicable or not supported,
14601    /// filesystems should leave the corresponding field absent.
14602    ///
14603    /// + `query` a bit-mask specifying which attributes to fetch. The server
14604    ///   should not return more than necessary.
14605    /// - `attributes` the returned attributes.
14606    ///
14607    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14608    pub fn r#get_attributes(
14609        &self,
14610        mut query: NodeAttributesQuery,
14611    ) -> fidl::client::QueryResponseFut<
14612        NodeGetAttributesResult,
14613        fdomain_client::fidl::FDomainResourceDialect,
14614    > {
14615        SymlinkProxyInterface::r#get_attributes(self, query)
14616    }
14617
14618    /// Updates information about the node.
14619    ///
14620    /// + `attributes` the presence of a table field in `attributes` indicates
14621    /// the intent to update the corresponding attribute.
14622    ///
14623    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14624    ///
14625    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14626    pub fn r#update_attributes(
14627        &self,
14628        mut payload: &MutableNodeAttributes,
14629    ) -> fidl::client::QueryResponseFut<
14630        NodeUpdateAttributesResult,
14631        fdomain_client::fidl::FDomainResourceDialect,
14632    > {
14633        SymlinkProxyInterface::r#update_attributes(self, payload)
14634    }
14635
14636    /// Synchronizes updates to the node to the underlying media, if it exists.
14637    ///
14638    /// This method will return when the filesystem server has flushed the
14639    /// relevant updates to the underlying media, but does not guarantee the
14640    /// underlying media has persisted the information, nor that any information
14641    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14642    /// between operations.
14643    ///
14644    /// This method does not require any rights.
14645    pub fn r#sync(
14646        &self,
14647    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
14648    {
14649        SymlinkProxyInterface::r#sync(self)
14650    }
14651
14652    /// Creates an iterator over all the extended attribute names associated
14653    /// with this node. If an error occurs it is returned as an epitaph on the
14654    /// iterator request channel, and then the channel is closed.
14655    ///
14656    /// GetExtendedAttributes can be used with any of these names to retrieve
14657    /// the associated value.
14658    ///
14659    /// This method requires the [`Rights.READ_BYTES`] right.
14660    pub fn r#list_extended_attributes(
14661        &self,
14662        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14663    ) -> Result<(), fidl::Error> {
14664        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
14665    }
14666
14667    /// Get the value associated with the given attribute `name` for this node.
14668    ///
14669    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14670    /// particular structure is imposed on them.
14671    ///
14672    /// This method requires the [`Rights.READ_BYTES`] right.
14673    pub fn r#get_extended_attribute(
14674        &self,
14675        mut name: &[u8],
14676    ) -> fidl::client::QueryResponseFut<
14677        NodeGetExtendedAttributeResult,
14678        fdomain_client::fidl::FDomainResourceDialect,
14679    > {
14680        SymlinkProxyInterface::r#get_extended_attribute(self, name)
14681    }
14682
14683    /// Set the value for the given attribute `name` to `value` for this node.
14684    ///
14685    /// The attribute name may exist, in which case the attribute is updated.
14686    /// If the attribute doesn't exist, it is created. The name should have no
14687    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14688    ///
14689    /// This method requires the [`Rights.WRITE_BYTES`] right.
14690    pub fn r#set_extended_attribute(
14691        &self,
14692        mut name: &[u8],
14693        mut value: ExtendedAttributeValue,
14694        mut mode: SetExtendedAttributeMode,
14695    ) -> fidl::client::QueryResponseFut<
14696        NodeSetExtendedAttributeResult,
14697        fdomain_client::fidl::FDomainResourceDialect,
14698    > {
14699        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
14700    }
14701
14702    /// Remove the specified extended attribute.
14703    ///
14704    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14705    ///
14706    /// This method requires the [`Rights.WRITE_BYTES`] right.
14707    pub fn r#remove_extended_attribute(
14708        &self,
14709        mut name: &[u8],
14710    ) -> fidl::client::QueryResponseFut<
14711        NodeRemoveExtendedAttributeResult,
14712        fdomain_client::fidl::FDomainResourceDialect,
14713    > {
14714        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
14715    }
14716
14717    /// Open (or create) a node relative to this directory. Any errors are communicated via an
14718    /// epitaph sent on the `object` channel.
14719    ///
14720    /// Errors:
14721    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
14722    /// * See [`Flags`] for other errors which may be communicated based on `flags`
14723    pub fn r#open(
14724        &self,
14725        mut path: &str,
14726        mut flags: Flags,
14727        mut options: &Options,
14728        mut object: fdomain_client::Channel,
14729    ) -> Result<(), fidl::Error> {
14730        SymlinkProxyInterface::r#open(self, path, flags, options, object)
14731    }
14732
14733    pub fn r#describe(
14734        &self,
14735    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>
14736    {
14737        SymlinkProxyInterface::r#describe(self)
14738    }
14739}
14740
14741impl SymlinkProxyInterface for SymlinkProxy {
14742    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
14743        LinkableLinkIntoResult,
14744        fdomain_client::fidl::FDomainResourceDialect,
14745    >;
14746    fn r#link_into(
14747        &self,
14748        mut dst_parent_token: fdomain_client::Event,
14749        mut dst: &str,
14750    ) -> Self::LinkIntoResponseFut {
14751        fn _decode(
14752            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14753        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
14754            let _response = fidl::client::decode_transaction_body::<
14755                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14756                fdomain_client::fidl::FDomainResourceDialect,
14757                0x54f3949246a03e74,
14758            >(_buf?)?;
14759            Ok(_response.map(|x| x))
14760        }
14761        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
14762            (dst_parent_token, dst),
14763            0x54f3949246a03e74,
14764            fidl::encoding::DynamicFlags::empty(),
14765            _decode,
14766        )
14767    }
14768
14769    fn r#clone(
14770        &self,
14771        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14772    ) -> Result<(), fidl::Error> {
14773        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
14774            (request,),
14775            0x20d8a7aba2168a79,
14776            fidl::encoding::DynamicFlags::empty(),
14777        )
14778    }
14779
14780    type CloseResponseFut = fidl::client::QueryResponseFut<
14781        fdomain_fuchsia_unknown::CloseableCloseResult,
14782        fdomain_client::fidl::FDomainResourceDialect,
14783    >;
14784    fn r#close(&self) -> Self::CloseResponseFut {
14785        fn _decode(
14786            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14787        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
14788            let _response = fidl::client::decode_transaction_body::<
14789                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14790                fdomain_client::fidl::FDomainResourceDialect,
14791                0x5ac5d459ad7f657e,
14792            >(_buf?)?;
14793            Ok(_response.map(|x| x))
14794        }
14795        self.client.send_query_and_decode::<
14796            fidl::encoding::EmptyPayload,
14797            fdomain_fuchsia_unknown::CloseableCloseResult,
14798        >(
14799            (),
14800            0x5ac5d459ad7f657e,
14801            fidl::encoding::DynamicFlags::empty(),
14802            _decode,
14803        )
14804    }
14805
14806    type QueryResponseFut =
14807        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
14808    fn r#query(&self) -> Self::QueryResponseFut {
14809        fn _decode(
14810            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14811        ) -> Result<Vec<u8>, fidl::Error> {
14812            let _response = fidl::client::decode_transaction_body::<
14813                fdomain_fuchsia_unknown::QueryableQueryResponse,
14814                fdomain_client::fidl::FDomainResourceDialect,
14815                0x2658edee9decfc06,
14816            >(_buf?)?;
14817            Ok(_response.protocol)
14818        }
14819        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
14820            (),
14821            0x2658edee9decfc06,
14822            fidl::encoding::DynamicFlags::empty(),
14823            _decode,
14824        )
14825    }
14826
14827    fn r#deprecated_clone(
14828        &self,
14829        mut flags: OpenFlags,
14830        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14831    ) -> Result<(), fidl::Error> {
14832        self.client.send::<NodeDeprecatedCloneRequest>(
14833            (flags, object),
14834            0x5a61678f293ce16f,
14835            fidl::encoding::DynamicFlags::FLEXIBLE,
14836        )
14837    }
14838
14839    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
14840        (i32, NodeAttributes),
14841        fdomain_client::fidl::FDomainResourceDialect,
14842    >;
14843    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
14844        fn _decode(
14845            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14846        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14847            let _response = fidl::client::decode_transaction_body::<
14848                NodeDeprecatedGetAttrResponse,
14849                fdomain_client::fidl::FDomainResourceDialect,
14850                0x78985e216314dafd,
14851            >(_buf?)?;
14852            Ok((_response.s, _response.attributes))
14853        }
14854        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14855            (),
14856            0x78985e216314dafd,
14857            fidl::encoding::DynamicFlags::empty(),
14858            _decode,
14859        )
14860    }
14861
14862    type DeprecatedSetAttrResponseFut =
14863        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14864    fn r#deprecated_set_attr(
14865        &self,
14866        mut flags: NodeAttributeFlags,
14867        mut attributes: &NodeAttributes,
14868    ) -> Self::DeprecatedSetAttrResponseFut {
14869        fn _decode(
14870            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14871        ) -> Result<i32, fidl::Error> {
14872            let _response = fidl::client::decode_transaction_body::<
14873                NodeDeprecatedSetAttrResponse,
14874                fdomain_client::fidl::FDomainResourceDialect,
14875                0x4186c0f40d938f46,
14876            >(_buf?)?;
14877            Ok(_response.s)
14878        }
14879        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
14880            (flags, attributes),
14881            0x4186c0f40d938f46,
14882            fidl::encoding::DynamicFlags::empty(),
14883            _decode,
14884        )
14885    }
14886
14887    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14888        (i32, OpenFlags),
14889        fdomain_client::fidl::FDomainResourceDialect,
14890    >;
14891    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14892        fn _decode(
14893            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14894        ) -> Result<(i32, OpenFlags), fidl::Error> {
14895            let _response = fidl::client::decode_transaction_body::<
14896                NodeDeprecatedGetFlagsResponse,
14897                fdomain_client::fidl::FDomainResourceDialect,
14898                0x5b88fffb8eda3aa1,
14899            >(_buf?)?;
14900            Ok((_response.s, _response.flags))
14901        }
14902        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14903            (),
14904            0x5b88fffb8eda3aa1,
14905            fidl::encoding::DynamicFlags::empty(),
14906            _decode,
14907        )
14908    }
14909
14910    type DeprecatedSetFlagsResponseFut =
14911        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14912    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14913        fn _decode(
14914            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14915        ) -> Result<i32, fidl::Error> {
14916            let _response = fidl::client::decode_transaction_body::<
14917                NodeDeprecatedSetFlagsResponse,
14918                fdomain_client::fidl::FDomainResourceDialect,
14919                0x5295b76c71fde733,
14920            >(_buf?)?;
14921            Ok(_response.s)
14922        }
14923        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14924            (flags,),
14925            0x5295b76c71fde733,
14926            fidl::encoding::DynamicFlags::empty(),
14927            _decode,
14928        )
14929    }
14930
14931    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14932        NodeGetFlagsResult,
14933        fdomain_client::fidl::FDomainResourceDialect,
14934    >;
14935    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14936        fn _decode(
14937            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14938        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14939            let _response = fidl::client::decode_transaction_body::<
14940                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14941                fdomain_client::fidl::FDomainResourceDialect,
14942                0x176eb318f64ec23,
14943            >(_buf?)?
14944            .into_result_fdomain::<SymlinkMarker>("get_flags")?;
14945            Ok(_response.map(|x| x.flags))
14946        }
14947        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14948            (),
14949            0x176eb318f64ec23,
14950            fidl::encoding::DynamicFlags::FLEXIBLE,
14951            _decode,
14952        )
14953    }
14954
14955    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14956        NodeSetFlagsResult,
14957        fdomain_client::fidl::FDomainResourceDialect,
14958    >;
14959    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14960        fn _decode(
14961            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14962        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14963            let _response = fidl::client::decode_transaction_body::<
14964                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14965                fdomain_client::fidl::FDomainResourceDialect,
14966                0x55a8028685791ea8,
14967            >(_buf?)?
14968            .into_result_fdomain::<SymlinkMarker>("set_flags")?;
14969            Ok(_response.map(|x| x))
14970        }
14971        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14972            (flags,),
14973            0x55a8028685791ea8,
14974            fidl::encoding::DynamicFlags::FLEXIBLE,
14975            _decode,
14976        )
14977    }
14978
14979    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14980        (i32, Option<Box<FilesystemInfo>>),
14981        fdomain_client::fidl::FDomainResourceDialect,
14982    >;
14983    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14984        fn _decode(
14985            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14986        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14987            let _response = fidl::client::decode_transaction_body::<
14988                NodeQueryFilesystemResponse,
14989                fdomain_client::fidl::FDomainResourceDialect,
14990                0x6f344a1c6b0a0610,
14991            >(_buf?)?;
14992            Ok((_response.s, _response.info))
14993        }
14994        self.client.send_query_and_decode::<
14995            fidl::encoding::EmptyPayload,
14996            (i32, Option<Box<FilesystemInfo>>),
14997        >(
14998            (),
14999            0x6f344a1c6b0a0610,
15000            fidl::encoding::DynamicFlags::empty(),
15001            _decode,
15002        )
15003    }
15004
15005    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
15006        NodeGetAttributesResult,
15007        fdomain_client::fidl::FDomainResourceDialect,
15008    >;
15009    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
15010        fn _decode(
15011            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15012        ) -> Result<NodeGetAttributesResult, fidl::Error> {
15013            let _response = fidl::client::decode_transaction_body::<
15014                fidl::encoding::ResultType<NodeAttributes2, i32>,
15015                fdomain_client::fidl::FDomainResourceDialect,
15016                0x3d4396a638ea053b,
15017            >(_buf?)?;
15018            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
15019        }
15020        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
15021            (query,),
15022            0x3d4396a638ea053b,
15023            fidl::encoding::DynamicFlags::empty(),
15024            _decode,
15025        )
15026    }
15027
15028    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
15029        NodeUpdateAttributesResult,
15030        fdomain_client::fidl::FDomainResourceDialect,
15031    >;
15032    fn r#update_attributes(
15033        &self,
15034        mut payload: &MutableNodeAttributes,
15035    ) -> Self::UpdateAttributesResponseFut {
15036        fn _decode(
15037            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15038        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
15039            let _response = fidl::client::decode_transaction_body::<
15040                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15041                fdomain_client::fidl::FDomainResourceDialect,
15042                0x3308c1da5a89bf08,
15043            >(_buf?)?;
15044            Ok(_response.map(|x| x))
15045        }
15046        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
15047            payload,
15048            0x3308c1da5a89bf08,
15049            fidl::encoding::DynamicFlags::empty(),
15050            _decode,
15051        )
15052    }
15053
15054    type SyncResponseFut = fidl::client::QueryResponseFut<
15055        NodeSyncResult,
15056        fdomain_client::fidl::FDomainResourceDialect,
15057    >;
15058    fn r#sync(&self) -> Self::SyncResponseFut {
15059        fn _decode(
15060            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15061        ) -> Result<NodeSyncResult, fidl::Error> {
15062            let _response = fidl::client::decode_transaction_body::<
15063                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15064                fdomain_client::fidl::FDomainResourceDialect,
15065                0x2c5c27ca0ab5dc49,
15066            >(_buf?)?;
15067            Ok(_response.map(|x| x))
15068        }
15069        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
15070            (),
15071            0x2c5c27ca0ab5dc49,
15072            fidl::encoding::DynamicFlags::empty(),
15073            _decode,
15074        )
15075    }
15076
15077    fn r#list_extended_attributes(
15078        &self,
15079        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15080    ) -> Result<(), fidl::Error> {
15081        self.client.send::<NodeListExtendedAttributesRequest>(
15082            (iterator,),
15083            0x4b61033de007fcd0,
15084            fidl::encoding::DynamicFlags::empty(),
15085        )
15086    }
15087
15088    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15089        NodeGetExtendedAttributeResult,
15090        fdomain_client::fidl::FDomainResourceDialect,
15091    >;
15092    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
15093        fn _decode(
15094            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15095        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
15096            let _response = fidl::client::decode_transaction_body::<
15097                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
15098                fdomain_client::fidl::FDomainResourceDialect,
15099                0x45ffa3ccfdeb76db,
15100            >(_buf?)?;
15101            Ok(_response.map(|x| x))
15102        }
15103        self.client.send_query_and_decode::<
15104            NodeGetExtendedAttributeRequest,
15105            NodeGetExtendedAttributeResult,
15106        >(
15107            (name,),
15108            0x45ffa3ccfdeb76db,
15109            fidl::encoding::DynamicFlags::empty(),
15110            _decode,
15111        )
15112    }
15113
15114    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15115        NodeSetExtendedAttributeResult,
15116        fdomain_client::fidl::FDomainResourceDialect,
15117    >;
15118    fn r#set_extended_attribute(
15119        &self,
15120        mut name: &[u8],
15121        mut value: ExtendedAttributeValue,
15122        mut mode: SetExtendedAttributeMode,
15123    ) -> Self::SetExtendedAttributeResponseFut {
15124        fn _decode(
15125            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15126        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
15127            let _response = fidl::client::decode_transaction_body::<
15128                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15129                fdomain_client::fidl::FDomainResourceDialect,
15130                0x4a951362f681f23c,
15131            >(_buf?)?;
15132            Ok(_response.map(|x| x))
15133        }
15134        self.client.send_query_and_decode::<
15135            NodeSetExtendedAttributeRequest,
15136            NodeSetExtendedAttributeResult,
15137        >(
15138            (name, &mut value, mode,),
15139            0x4a951362f681f23c,
15140            fidl::encoding::DynamicFlags::empty(),
15141            _decode,
15142        )
15143    }
15144
15145    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15146        NodeRemoveExtendedAttributeResult,
15147        fdomain_client::fidl::FDomainResourceDialect,
15148    >;
15149    fn r#remove_extended_attribute(
15150        &self,
15151        mut name: &[u8],
15152    ) -> Self::RemoveExtendedAttributeResponseFut {
15153        fn _decode(
15154            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15155        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
15156            let _response = fidl::client::decode_transaction_body::<
15157                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15158                fdomain_client::fidl::FDomainResourceDialect,
15159                0x7a0b9f3a9bf9032d,
15160            >(_buf?)?;
15161            Ok(_response.map(|x| x))
15162        }
15163        self.client.send_query_and_decode::<
15164            NodeRemoveExtendedAttributeRequest,
15165            NodeRemoveExtendedAttributeResult,
15166        >(
15167            (name,),
15168            0x7a0b9f3a9bf9032d,
15169            fidl::encoding::DynamicFlags::empty(),
15170            _decode,
15171        )
15172    }
15173
15174    fn r#open(
15175        &self,
15176        mut path: &str,
15177        mut flags: Flags,
15178        mut options: &Options,
15179        mut object: fdomain_client::Channel,
15180    ) -> Result<(), fidl::Error> {
15181        self.client.send::<OpenableOpenRequest>(
15182            (path, flags, options, object),
15183            0x568ddcb9a9cbb6d9,
15184            fidl::encoding::DynamicFlags::FLEXIBLE,
15185        )
15186    }
15187
15188    type DescribeResponseFut =
15189        fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>;
15190    fn r#describe(&self) -> Self::DescribeResponseFut {
15191        fn _decode(
15192            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15193        ) -> Result<SymlinkInfo, fidl::Error> {
15194            let _response = fidl::client::decode_transaction_body::<
15195                fidl::encoding::FlexibleType<SymlinkInfo>,
15196                fdomain_client::fidl::FDomainResourceDialect,
15197                0x742c2ea5e89831f3,
15198            >(_buf?)?
15199            .into_result_fdomain::<SymlinkMarker>("describe")?;
15200            Ok(_response)
15201        }
15202        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
15203            (),
15204            0x742c2ea5e89831f3,
15205            fidl::encoding::DynamicFlags::FLEXIBLE,
15206            _decode,
15207        )
15208    }
15209}
15210
15211pub struct SymlinkEventStream {
15212    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
15213}
15214
15215impl std::marker::Unpin for SymlinkEventStream {}
15216
15217impl futures::stream::FusedStream for SymlinkEventStream {
15218    fn is_terminated(&self) -> bool {
15219        self.event_receiver.is_terminated()
15220    }
15221}
15222
15223impl futures::Stream for SymlinkEventStream {
15224    type Item = Result<SymlinkEvent, fidl::Error>;
15225
15226    fn poll_next(
15227        mut self: std::pin::Pin<&mut Self>,
15228        cx: &mut std::task::Context<'_>,
15229    ) -> std::task::Poll<Option<Self::Item>> {
15230        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
15231            &mut self.event_receiver,
15232            cx
15233        )?) {
15234            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
15235            None => std::task::Poll::Ready(None),
15236        }
15237    }
15238}
15239
15240#[derive(Debug)]
15241pub enum SymlinkEvent {
15242    OnOpen_ {
15243        s: i32,
15244        info: Option<Box<NodeInfoDeprecated>>,
15245    },
15246    OnRepresentation {
15247        payload: Representation,
15248    },
15249    #[non_exhaustive]
15250    _UnknownEvent {
15251        /// Ordinal of the event that was sent.
15252        ordinal: u64,
15253    },
15254}
15255
15256impl SymlinkEvent {
15257    #[allow(irrefutable_let_patterns)]
15258    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
15259        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
15260    }
15261    #[allow(irrefutable_let_patterns)]
15262    pub fn into_on_representation(self) -> Option<Representation> {
15263        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
15264    }
15265
15266    /// Decodes a message buffer as a [`SymlinkEvent`].
15267    fn decode(
15268        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
15269    ) -> Result<SymlinkEvent, fidl::Error> {
15270        let (bytes, _handles) = buf.split_mut();
15271        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15272        debug_assert_eq!(tx_header.tx_id, 0);
15273        match tx_header.ordinal {
15274            0x7fc7bbb1dbfd1972 => {
15275                let mut out = fidl::new_empty!(
15276                    NodeOnOpenRequest,
15277                    fdomain_client::fidl::FDomainResourceDialect
15278                );
15279                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
15280                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
15281            }
15282            0x5cb40567d80a510c => {
15283                let mut out =
15284                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
15285                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
15286                Ok((SymlinkEvent::OnRepresentation { payload: out }))
15287            }
15288            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
15289                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
15290            }
15291            _ => Err(fidl::Error::UnknownOrdinal {
15292                ordinal: tx_header.ordinal,
15293                protocol_name: <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15294            }),
15295        }
15296    }
15297}
15298
15299/// A Stream of incoming requests for fuchsia.io/Symlink.
15300pub struct SymlinkRequestStream {
15301    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15302    is_terminated: bool,
15303}
15304
15305impl std::marker::Unpin for SymlinkRequestStream {}
15306
15307impl futures::stream::FusedStream for SymlinkRequestStream {
15308    fn is_terminated(&self) -> bool {
15309        self.is_terminated
15310    }
15311}
15312
15313impl fdomain_client::fidl::RequestStream for SymlinkRequestStream {
15314    type Protocol = SymlinkMarker;
15315    type ControlHandle = SymlinkControlHandle;
15316
15317    fn from_channel(channel: fdomain_client::Channel) -> Self {
15318        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
15319    }
15320
15321    fn control_handle(&self) -> Self::ControlHandle {
15322        SymlinkControlHandle { inner: self.inner.clone() }
15323    }
15324
15325    fn into_inner(
15326        self,
15327    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
15328    {
15329        (self.inner, self.is_terminated)
15330    }
15331
15332    fn from_inner(
15333        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15334        is_terminated: bool,
15335    ) -> Self {
15336        Self { inner, is_terminated }
15337    }
15338}
15339
15340impl futures::Stream for SymlinkRequestStream {
15341    type Item = Result<SymlinkRequest, fidl::Error>;
15342
15343    fn poll_next(
15344        mut self: std::pin::Pin<&mut Self>,
15345        cx: &mut std::task::Context<'_>,
15346    ) -> std::task::Poll<Option<Self::Item>> {
15347        let this = &mut *self;
15348        if this.inner.check_shutdown(cx) {
15349            this.is_terminated = true;
15350            return std::task::Poll::Ready(None);
15351        }
15352        if this.is_terminated {
15353            panic!("polled SymlinkRequestStream after completion");
15354        }
15355        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
15356            |bytes, handles| {
15357                match this.inner.channel().read_etc(cx, bytes, handles) {
15358                    std::task::Poll::Ready(Ok(())) => {}
15359                    std::task::Poll::Pending => return std::task::Poll::Pending,
15360                    std::task::Poll::Ready(Err(None)) => {
15361                        this.is_terminated = true;
15362                        return std::task::Poll::Ready(None);
15363                    }
15364                    std::task::Poll::Ready(Err(Some(e))) => {
15365                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
15366                            e.into(),
15367                        ))));
15368                    }
15369                }
15370
15371                // A message has been received from the channel
15372                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15373
15374                std::task::Poll::Ready(Some(match header.ordinal {
15375                    0x54f3949246a03e74 => {
15376                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15377                        let mut req = fidl::new_empty!(
15378                            LinkableLinkIntoRequest,
15379                            fdomain_client::fidl::FDomainResourceDialect
15380                        );
15381                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
15382                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15383                        Ok(SymlinkRequest::LinkInto {
15384                            dst_parent_token: req.dst_parent_token,
15385                            dst: req.dst,
15386
15387                            responder: SymlinkLinkIntoResponder {
15388                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15389                                tx_id: header.tx_id,
15390                            },
15391                        })
15392                    }
15393                    0x20d8a7aba2168a79 => {
15394                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15395                        let mut req = fidl::new_empty!(
15396                            fdomain_fuchsia_unknown::CloneableCloneRequest,
15397                            fdomain_client::fidl::FDomainResourceDialect
15398                        );
15399                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
15400                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15401                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
15402                    }
15403                    0x5ac5d459ad7f657e => {
15404                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15405                        let mut req = fidl::new_empty!(
15406                            fidl::encoding::EmptyPayload,
15407                            fdomain_client::fidl::FDomainResourceDialect
15408                        );
15409                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15410                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15411                        Ok(SymlinkRequest::Close {
15412                            responder: SymlinkCloseResponder {
15413                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15414                                tx_id: header.tx_id,
15415                            },
15416                        })
15417                    }
15418                    0x2658edee9decfc06 => {
15419                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15420                        let mut req = fidl::new_empty!(
15421                            fidl::encoding::EmptyPayload,
15422                            fdomain_client::fidl::FDomainResourceDialect
15423                        );
15424                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15425                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15426                        Ok(SymlinkRequest::Query {
15427                            responder: SymlinkQueryResponder {
15428                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15429                                tx_id: header.tx_id,
15430                            },
15431                        })
15432                    }
15433                    0x5a61678f293ce16f => {
15434                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15435                        let mut req = fidl::new_empty!(
15436                            NodeDeprecatedCloneRequest,
15437                            fdomain_client::fidl::FDomainResourceDialect
15438                        );
15439                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
15440                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15441                        Ok(SymlinkRequest::DeprecatedClone {
15442                            flags: req.flags,
15443                            object: req.object,
15444
15445                            control_handle,
15446                        })
15447                    }
15448                    0x78985e216314dafd => {
15449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15450                        let mut req = fidl::new_empty!(
15451                            fidl::encoding::EmptyPayload,
15452                            fdomain_client::fidl::FDomainResourceDialect
15453                        );
15454                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15455                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15456                        Ok(SymlinkRequest::DeprecatedGetAttr {
15457                            responder: SymlinkDeprecatedGetAttrResponder {
15458                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15459                                tx_id: header.tx_id,
15460                            },
15461                        })
15462                    }
15463                    0x4186c0f40d938f46 => {
15464                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15465                        let mut req = fidl::new_empty!(
15466                            NodeDeprecatedSetAttrRequest,
15467                            fdomain_client::fidl::FDomainResourceDialect
15468                        );
15469                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
15470                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15471                        Ok(SymlinkRequest::DeprecatedSetAttr {
15472                            flags: req.flags,
15473                            attributes: req.attributes,
15474
15475                            responder: SymlinkDeprecatedSetAttrResponder {
15476                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15477                                tx_id: header.tx_id,
15478                            },
15479                        })
15480                    }
15481                    0x5b88fffb8eda3aa1 => {
15482                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15483                        let mut req = fidl::new_empty!(
15484                            fidl::encoding::EmptyPayload,
15485                            fdomain_client::fidl::FDomainResourceDialect
15486                        );
15487                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15488                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15489                        Ok(SymlinkRequest::DeprecatedGetFlags {
15490                            responder: SymlinkDeprecatedGetFlagsResponder {
15491                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15492                                tx_id: header.tx_id,
15493                            },
15494                        })
15495                    }
15496                    0x5295b76c71fde733 => {
15497                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15498                        let mut req = fidl::new_empty!(
15499                            NodeDeprecatedSetFlagsRequest,
15500                            fdomain_client::fidl::FDomainResourceDialect
15501                        );
15502                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15503                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15504                        Ok(SymlinkRequest::DeprecatedSetFlags {
15505                            flags: req.flags,
15506
15507                            responder: SymlinkDeprecatedSetFlagsResponder {
15508                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15509                                tx_id: header.tx_id,
15510                            },
15511                        })
15512                    }
15513                    0x176eb318f64ec23 => {
15514                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15515                        let mut req = fidl::new_empty!(
15516                            fidl::encoding::EmptyPayload,
15517                            fdomain_client::fidl::FDomainResourceDialect
15518                        );
15519                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15520                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15521                        Ok(SymlinkRequest::GetFlags {
15522                            responder: SymlinkGetFlagsResponder {
15523                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15524                                tx_id: header.tx_id,
15525                            },
15526                        })
15527                    }
15528                    0x55a8028685791ea8 => {
15529                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15530                        let mut req = fidl::new_empty!(
15531                            NodeSetFlagsRequest,
15532                            fdomain_client::fidl::FDomainResourceDialect
15533                        );
15534                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15535                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15536                        Ok(SymlinkRequest::SetFlags {
15537                            flags: req.flags,
15538
15539                            responder: SymlinkSetFlagsResponder {
15540                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15541                                tx_id: header.tx_id,
15542                            },
15543                        })
15544                    }
15545                    0x6f344a1c6b0a0610 => {
15546                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15547                        let mut req = fidl::new_empty!(
15548                            fidl::encoding::EmptyPayload,
15549                            fdomain_client::fidl::FDomainResourceDialect
15550                        );
15551                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15552                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15553                        Ok(SymlinkRequest::QueryFilesystem {
15554                            responder: SymlinkQueryFilesystemResponder {
15555                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15556                                tx_id: header.tx_id,
15557                            },
15558                        })
15559                    }
15560                    0x3d4396a638ea053b => {
15561                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15562                        let mut req = fidl::new_empty!(
15563                            NodeGetAttributesRequest,
15564                            fdomain_client::fidl::FDomainResourceDialect
15565                        );
15566                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15567                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15568                        Ok(SymlinkRequest::GetAttributes {
15569                            query: req.query,
15570
15571                            responder: SymlinkGetAttributesResponder {
15572                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15573                                tx_id: header.tx_id,
15574                            },
15575                        })
15576                    }
15577                    0x3308c1da5a89bf08 => {
15578                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15579                        let mut req = fidl::new_empty!(
15580                            MutableNodeAttributes,
15581                            fdomain_client::fidl::FDomainResourceDialect
15582                        );
15583                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
15584                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15585                        Ok(SymlinkRequest::UpdateAttributes {
15586                            payload: req,
15587                            responder: SymlinkUpdateAttributesResponder {
15588                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15589                                tx_id: header.tx_id,
15590                            },
15591                        })
15592                    }
15593                    0x2c5c27ca0ab5dc49 => {
15594                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15595                        let mut req = fidl::new_empty!(
15596                            fidl::encoding::EmptyPayload,
15597                            fdomain_client::fidl::FDomainResourceDialect
15598                        );
15599                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15600                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15601                        Ok(SymlinkRequest::Sync {
15602                            responder: SymlinkSyncResponder {
15603                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15604                                tx_id: header.tx_id,
15605                            },
15606                        })
15607                    }
15608                    0x4b61033de007fcd0 => {
15609                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15610                        let mut req = fidl::new_empty!(
15611                            NodeListExtendedAttributesRequest,
15612                            fdomain_client::fidl::FDomainResourceDialect
15613                        );
15614                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15615                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15616                        Ok(SymlinkRequest::ListExtendedAttributes {
15617                            iterator: req.iterator,
15618
15619                            control_handle,
15620                        })
15621                    }
15622                    0x45ffa3ccfdeb76db => {
15623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15624                        let mut req = fidl::new_empty!(
15625                            NodeGetExtendedAttributeRequest,
15626                            fdomain_client::fidl::FDomainResourceDialect
15627                        );
15628                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15629                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15630                        Ok(SymlinkRequest::GetExtendedAttribute {
15631                            name: req.name,
15632
15633                            responder: SymlinkGetExtendedAttributeResponder {
15634                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15635                                tx_id: header.tx_id,
15636                            },
15637                        })
15638                    }
15639                    0x4a951362f681f23c => {
15640                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15641                        let mut req = fidl::new_empty!(
15642                            NodeSetExtendedAttributeRequest,
15643                            fdomain_client::fidl::FDomainResourceDialect
15644                        );
15645                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15646                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15647                        Ok(SymlinkRequest::SetExtendedAttribute {
15648                            name: req.name,
15649                            value: req.value,
15650                            mode: req.mode,
15651
15652                            responder: SymlinkSetExtendedAttributeResponder {
15653                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15654                                tx_id: header.tx_id,
15655                            },
15656                        })
15657                    }
15658                    0x7a0b9f3a9bf9032d => {
15659                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15660                        let mut req = fidl::new_empty!(
15661                            NodeRemoveExtendedAttributeRequest,
15662                            fdomain_client::fidl::FDomainResourceDialect
15663                        );
15664                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15665                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15666                        Ok(SymlinkRequest::RemoveExtendedAttribute {
15667                            name: req.name,
15668
15669                            responder: SymlinkRemoveExtendedAttributeResponder {
15670                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15671                                tx_id: header.tx_id,
15672                            },
15673                        })
15674                    }
15675                    0x568ddcb9a9cbb6d9 => {
15676                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15677                        let mut req = fidl::new_empty!(
15678                            OpenableOpenRequest,
15679                            fdomain_client::fidl::FDomainResourceDialect
15680                        );
15681                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
15682                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15683                        Ok(SymlinkRequest::Open {
15684                            path: req.path,
15685                            flags: req.flags,
15686                            options: req.options,
15687                            object: req.object,
15688
15689                            control_handle,
15690                        })
15691                    }
15692                    0x742c2ea5e89831f3 => {
15693                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15694                        let mut req = fidl::new_empty!(
15695                            fidl::encoding::EmptyPayload,
15696                            fdomain_client::fidl::FDomainResourceDialect
15697                        );
15698                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15699                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15700                        Ok(SymlinkRequest::Describe {
15701                            responder: SymlinkDescribeResponder {
15702                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15703                                tx_id: header.tx_id,
15704                            },
15705                        })
15706                    }
15707                    _ if header.tx_id == 0
15708                        && header
15709                            .dynamic_flags()
15710                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15711                    {
15712                        Ok(SymlinkRequest::_UnknownMethod {
15713                            ordinal: header.ordinal,
15714                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15715                            method_type: fidl::MethodType::OneWay,
15716                        })
15717                    }
15718                    _ if header
15719                        .dynamic_flags()
15720                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15721                    {
15722                        this.inner.send_framework_err(
15723                            fidl::encoding::FrameworkErr::UnknownMethod,
15724                            header.tx_id,
15725                            header.ordinal,
15726                            header.dynamic_flags(),
15727                            (bytes, handles),
15728                        )?;
15729                        Ok(SymlinkRequest::_UnknownMethod {
15730                            ordinal: header.ordinal,
15731                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15732                            method_type: fidl::MethodType::TwoWay,
15733                        })
15734                    }
15735                    _ => Err(fidl::Error::UnknownOrdinal {
15736                        ordinal: header.ordinal,
15737                        protocol_name:
15738                            <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15739                    }),
15740                }))
15741            },
15742        )
15743    }
15744}
15745
15746/// A ['Node'] which contains a symbolic link.
15747#[derive(Debug)]
15748pub enum SymlinkRequest {
15749    /// Creates a link to this this object with name `dst` in the directory represented by
15750    /// `dst_parent_token`.
15751    ///
15752    /// `dst` must be a resolved object name. Including "/" in the string will return
15753    /// `ZX_ERR_INVALID_ARGS`.
15754    ///
15755    /// This method requires the maximal set of rights supported by the filesystem for this object.
15756    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
15757    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
15758    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
15759    /// `ZX_ERR_ACCESS_DENIED`.
15760    ///
15761    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
15762    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
15763    ///
15764    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
15765    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
15766    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
15767    ///
15768    /// This method does not have the same atomicity properties has the `Directory::Link` method,
15769    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
15770    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
15771    LinkInto {
15772        dst_parent_token: fdomain_client::Event,
15773        dst: String,
15774        responder: SymlinkLinkIntoResponder,
15775    },
15776    Clone {
15777        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15778        control_handle: SymlinkControlHandle,
15779    },
15780    /// Terminates the connection.
15781    ///
15782    /// After calling `Close`, the client must not send any other requests.
15783    ///
15784    /// Servers, after sending the status response, should close the connection
15785    /// regardless of status and without sending an epitaph.
15786    ///
15787    /// Closing the client end of the channel should be semantically equivalent
15788    /// to calling `Close` without knowing when the close has completed or its
15789    /// status.
15790    Close {
15791        responder: SymlinkCloseResponder,
15792    },
15793    Query {
15794        responder: SymlinkQueryResponder,
15795    },
15796    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
15797    DeprecatedClone {
15798        flags: OpenFlags,
15799        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
15800        control_handle: SymlinkControlHandle,
15801    },
15802    /// DEPRECATED - Use `Node.GetAttributes` instead.
15803    ///
15804    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15805    DeprecatedGetAttr {
15806        responder: SymlinkDeprecatedGetAttrResponder,
15807    },
15808    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
15809    DeprecatedSetAttr {
15810        flags: NodeAttributeFlags,
15811        attributes: NodeAttributes,
15812        responder: SymlinkDeprecatedSetAttrResponder,
15813    },
15814    /// [DEPRECATED - Use new GetFlags method instead.]
15815    DeprecatedGetFlags {
15816        responder: SymlinkDeprecatedGetFlagsResponder,
15817    },
15818    /// [DEPRECATED - Use new SetFlags method instead.]
15819    DeprecatedSetFlags {
15820        flags: OpenFlags,
15821        responder: SymlinkDeprecatedSetFlagsResponder,
15822    },
15823    /// Queries the flags that apply to this node after it has been opened/created. This method does
15824    /// not require any rights.
15825    ///
15826    /// Note that the final set of flags that apply to the connection may differ from those
15827    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
15828    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
15829    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
15830    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
15831    GetFlags {
15832        responder: SymlinkGetFlagsResponder,
15833    },
15834    /// Sets the flags that apply to this node after it has been opened. This method does not
15835    /// require any rights.
15836    ///
15837    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
15838    /// clear append mode.
15839    ///
15840    /// Errors:
15841    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
15842    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
15843    SetFlags {
15844        flags: Flags,
15845        responder: SymlinkSetFlagsResponder,
15846    },
15847    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
15848    /// volume has different settings or the storage is accounted seperately from the rest of the
15849    /// filesystem that may be reported instead of filesystem-wide details.
15850    QueryFilesystem {
15851        responder: SymlinkQueryFilesystemResponder,
15852    },
15853    /// Acquires information about the node.
15854    ///
15855    /// The attributes of a node should be stable, independent of the
15856    /// specific protocol used to access it.
15857    ///
15858    /// If a particular attribute is not applicable or not supported,
15859    /// filesystems should leave the corresponding field absent.
15860    ///
15861    /// + `query` a bit-mask specifying which attributes to fetch. The server
15862    ///   should not return more than necessary.
15863    /// - `attributes` the returned attributes.
15864    ///
15865    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15866    GetAttributes {
15867        query: NodeAttributesQuery,
15868        responder: SymlinkGetAttributesResponder,
15869    },
15870    /// Updates information about the node.
15871    ///
15872    /// + `attributes` the presence of a table field in `attributes` indicates
15873    /// the intent to update the corresponding attribute.
15874    ///
15875    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
15876    ///
15877    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15878    UpdateAttributes {
15879        payload: MutableNodeAttributes,
15880        responder: SymlinkUpdateAttributesResponder,
15881    },
15882    /// Synchronizes updates to the node to the underlying media, if it exists.
15883    ///
15884    /// This method will return when the filesystem server has flushed the
15885    /// relevant updates to the underlying media, but does not guarantee the
15886    /// underlying media has persisted the information, nor that any information
15887    /// is committed to hardware. Clients may use `Sync` to ensure ordering
15888    /// between operations.
15889    ///
15890    /// This method does not require any rights.
15891    Sync {
15892        responder: SymlinkSyncResponder,
15893    },
15894    /// Creates an iterator over all the extended attribute names associated
15895    /// with this node. If an error occurs it is returned as an epitaph on the
15896    /// iterator request channel, and then the channel is closed.
15897    ///
15898    /// GetExtendedAttributes can be used with any of these names to retrieve
15899    /// the associated value.
15900    ///
15901    /// This method requires the [`Rights.READ_BYTES`] right.
15902    ListExtendedAttributes {
15903        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15904        control_handle: SymlinkControlHandle,
15905    },
15906    /// Get the value associated with the given attribute `name` for this node.
15907    ///
15908    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15909    /// particular structure is imposed on them.
15910    ///
15911    /// This method requires the [`Rights.READ_BYTES`] right.
15912    GetExtendedAttribute {
15913        name: Vec<u8>,
15914        responder: SymlinkGetExtendedAttributeResponder,
15915    },
15916    /// Set the value for the given attribute `name` to `value` for this node.
15917    ///
15918    /// The attribute name may exist, in which case the attribute is updated.
15919    /// If the attribute doesn't exist, it is created. The name should have no
15920    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15921    ///
15922    /// This method requires the [`Rights.WRITE_BYTES`] right.
15923    SetExtendedAttribute {
15924        name: Vec<u8>,
15925        value: ExtendedAttributeValue,
15926        mode: SetExtendedAttributeMode,
15927        responder: SymlinkSetExtendedAttributeResponder,
15928    },
15929    /// Remove the specified extended attribute.
15930    ///
15931    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15932    ///
15933    /// This method requires the [`Rights.WRITE_BYTES`] right.
15934    RemoveExtendedAttribute {
15935        name: Vec<u8>,
15936        responder: SymlinkRemoveExtendedAttributeResponder,
15937    },
15938    /// Open (or create) a node relative to this directory. Any errors are communicated via an
15939    /// epitaph sent on the `object` channel.
15940    ///
15941    /// Errors:
15942    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
15943    /// * See [`Flags`] for other errors which may be communicated based on `flags`
15944    Open {
15945        path: String,
15946        flags: Flags,
15947        options: Options,
15948        object: fdomain_client::Channel,
15949        control_handle: SymlinkControlHandle,
15950    },
15951    Describe {
15952        responder: SymlinkDescribeResponder,
15953    },
15954    /// An interaction was received which does not match any known method.
15955    #[non_exhaustive]
15956    _UnknownMethod {
15957        /// Ordinal of the method that was called.
15958        ordinal: u64,
15959        control_handle: SymlinkControlHandle,
15960        method_type: fidl::MethodType,
15961    },
15962}
15963
15964impl SymlinkRequest {
15965    #[allow(irrefutable_let_patterns)]
15966    pub fn into_link_into(
15967        self,
15968    ) -> Option<(fdomain_client::Event, String, SymlinkLinkIntoResponder)> {
15969        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
15970            Some((dst_parent_token, dst, responder))
15971        } else {
15972            None
15973        }
15974    }
15975
15976    #[allow(irrefutable_let_patterns)]
15977    pub fn into_clone(
15978        self,
15979    ) -> Option<(
15980        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15981        SymlinkControlHandle,
15982    )> {
15983        if let SymlinkRequest::Clone { request, control_handle } = self {
15984            Some((request, control_handle))
15985        } else {
15986            None
15987        }
15988    }
15989
15990    #[allow(irrefutable_let_patterns)]
15991    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
15992        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
15993    }
15994
15995    #[allow(irrefutable_let_patterns)]
15996    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
15997        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
15998    }
15999
16000    #[allow(irrefutable_let_patterns)]
16001    pub fn into_deprecated_clone(
16002        self,
16003    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, SymlinkControlHandle)>
16004    {
16005        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
16006            Some((flags, object, control_handle))
16007        } else {
16008            None
16009        }
16010    }
16011
16012    #[allow(irrefutable_let_patterns)]
16013    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
16014        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
16015            Some((responder))
16016        } else {
16017            None
16018        }
16019    }
16020
16021    #[allow(irrefutable_let_patterns)]
16022    pub fn into_deprecated_set_attr(
16023        self,
16024    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
16025        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
16026            Some((flags, attributes, responder))
16027        } else {
16028            None
16029        }
16030    }
16031
16032    #[allow(irrefutable_let_patterns)]
16033    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
16034        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
16035            Some((responder))
16036        } else {
16037            None
16038        }
16039    }
16040
16041    #[allow(irrefutable_let_patterns)]
16042    pub fn into_deprecated_set_flags(
16043        self,
16044    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
16045        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
16046            Some((flags, responder))
16047        } else {
16048            None
16049        }
16050    }
16051
16052    #[allow(irrefutable_let_patterns)]
16053    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
16054        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
16055    }
16056
16057    #[allow(irrefutable_let_patterns)]
16058    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
16059        if let SymlinkRequest::SetFlags { flags, responder } = self {
16060            Some((flags, responder))
16061        } else {
16062            None
16063        }
16064    }
16065
16066    #[allow(irrefutable_let_patterns)]
16067    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
16068        if let SymlinkRequest::QueryFilesystem { responder } = self {
16069            Some((responder))
16070        } else {
16071            None
16072        }
16073    }
16074
16075    #[allow(irrefutable_let_patterns)]
16076    pub fn into_get_attributes(
16077        self,
16078    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
16079        if let SymlinkRequest::GetAttributes { query, responder } = self {
16080            Some((query, responder))
16081        } else {
16082            None
16083        }
16084    }
16085
16086    #[allow(irrefutable_let_patterns)]
16087    pub fn into_update_attributes(
16088        self,
16089    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
16090        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
16091            Some((payload, responder))
16092        } else {
16093            None
16094        }
16095    }
16096
16097    #[allow(irrefutable_let_patterns)]
16098    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
16099        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
16100    }
16101
16102    #[allow(irrefutable_let_patterns)]
16103    pub fn into_list_extended_attributes(
16104        self,
16105    ) -> Option<(
16106        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
16107        SymlinkControlHandle,
16108    )> {
16109        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
16110            Some((iterator, control_handle))
16111        } else {
16112            None
16113        }
16114    }
16115
16116    #[allow(irrefutable_let_patterns)]
16117    pub fn into_get_extended_attribute(
16118        self,
16119    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
16120        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
16121            Some((name, responder))
16122        } else {
16123            None
16124        }
16125    }
16126
16127    #[allow(irrefutable_let_patterns)]
16128    pub fn into_set_extended_attribute(
16129        self,
16130    ) -> Option<(
16131        Vec<u8>,
16132        ExtendedAttributeValue,
16133        SetExtendedAttributeMode,
16134        SymlinkSetExtendedAttributeResponder,
16135    )> {
16136        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
16137            Some((name, value, mode, responder))
16138        } else {
16139            None
16140        }
16141    }
16142
16143    #[allow(irrefutable_let_patterns)]
16144    pub fn into_remove_extended_attribute(
16145        self,
16146    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
16147        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
16148            Some((name, responder))
16149        } else {
16150            None
16151        }
16152    }
16153
16154    #[allow(irrefutable_let_patterns)]
16155    pub fn into_open(
16156        self,
16157    ) -> Option<(String, Flags, Options, fdomain_client::Channel, SymlinkControlHandle)> {
16158        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
16159            Some((path, flags, options, object, control_handle))
16160        } else {
16161            None
16162        }
16163    }
16164
16165    #[allow(irrefutable_let_patterns)]
16166    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
16167        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
16168    }
16169
16170    /// Name of the method defined in FIDL
16171    pub fn method_name(&self) -> &'static str {
16172        match *self {
16173            SymlinkRequest::LinkInto { .. } => "link_into",
16174            SymlinkRequest::Clone { .. } => "clone",
16175            SymlinkRequest::Close { .. } => "close",
16176            SymlinkRequest::Query { .. } => "query",
16177            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
16178            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
16179            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
16180            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
16181            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
16182            SymlinkRequest::GetFlags { .. } => "get_flags",
16183            SymlinkRequest::SetFlags { .. } => "set_flags",
16184            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
16185            SymlinkRequest::GetAttributes { .. } => "get_attributes",
16186            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
16187            SymlinkRequest::Sync { .. } => "sync",
16188            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
16189            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
16190            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
16191            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
16192            SymlinkRequest::Open { .. } => "open",
16193            SymlinkRequest::Describe { .. } => "describe",
16194            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16195                "unknown one-way method"
16196            }
16197            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16198                "unknown two-way method"
16199            }
16200        }
16201    }
16202}
16203
16204#[derive(Debug, Clone)]
16205pub struct SymlinkControlHandle {
16206    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
16207}
16208
16209impl SymlinkControlHandle {
16210    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16211        self.inner.shutdown_with_epitaph(status.into())
16212    }
16213}
16214
16215impl fdomain_client::fidl::ControlHandle for SymlinkControlHandle {
16216    fn shutdown(&self) {
16217        self.inner.shutdown()
16218    }
16219
16220    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16221        self.inner.shutdown_with_epitaph(status)
16222    }
16223
16224    fn is_closed(&self) -> bool {
16225        self.inner.channel().is_closed()
16226    }
16227    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
16228        self.inner.channel().on_closed()
16229    }
16230}
16231
16232impl SymlinkControlHandle {
16233    pub fn send_on_open_(
16234        &self,
16235        mut s: i32,
16236        mut info: Option<NodeInfoDeprecated>,
16237    ) -> Result<(), fidl::Error> {
16238        self.inner.send::<NodeOnOpenRequest>(
16239            (s, info.as_mut()),
16240            0,
16241            0x7fc7bbb1dbfd1972,
16242            fidl::encoding::DynamicFlags::FLEXIBLE,
16243        )
16244    }
16245
16246    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
16247        self.inner.send::<Representation>(
16248            &mut payload,
16249            0,
16250            0x5cb40567d80a510c,
16251            fidl::encoding::DynamicFlags::empty(),
16252        )
16253    }
16254}
16255
16256#[must_use = "FIDL methods require a response to be sent"]
16257#[derive(Debug)]
16258pub struct SymlinkLinkIntoResponder {
16259    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16260    tx_id: u32,
16261}
16262
16263/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16264/// if the responder is dropped without sending a response, so that the client
16265/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16266impl std::ops::Drop for SymlinkLinkIntoResponder {
16267    fn drop(&mut self) {
16268        self.control_handle.shutdown();
16269        // Safety: drops once, never accessed again
16270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16271    }
16272}
16273
16274impl fdomain_client::fidl::Responder for SymlinkLinkIntoResponder {
16275    type ControlHandle = SymlinkControlHandle;
16276
16277    fn control_handle(&self) -> &SymlinkControlHandle {
16278        &self.control_handle
16279    }
16280
16281    fn drop_without_shutdown(mut self) {
16282        // Safety: drops once, never accessed again due to mem::forget
16283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16284        // Prevent Drop from running (which would shut down the channel)
16285        std::mem::forget(self);
16286    }
16287}
16288
16289impl SymlinkLinkIntoResponder {
16290    /// Sends a response to the FIDL transaction.
16291    ///
16292    /// Sets the channel to shutdown if an error occurs.
16293    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16294        let _result = self.send_raw(result);
16295        if _result.is_err() {
16296            self.control_handle.shutdown();
16297        }
16298        self.drop_without_shutdown();
16299        _result
16300    }
16301
16302    /// Similar to "send" but does not shutdown the channel if an error occurs.
16303    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16304        let _result = self.send_raw(result);
16305        self.drop_without_shutdown();
16306        _result
16307    }
16308
16309    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16310        self.control_handle
16311            .inner
16312            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16313                result,
16314                self.tx_id,
16315                0x54f3949246a03e74,
16316                fidl::encoding::DynamicFlags::empty(),
16317            )
16318    }
16319}
16320
16321#[must_use = "FIDL methods require a response to be sent"]
16322#[derive(Debug)]
16323pub struct SymlinkCloseResponder {
16324    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16325    tx_id: u32,
16326}
16327
16328/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16329/// if the responder is dropped without sending a response, so that the client
16330/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16331impl std::ops::Drop for SymlinkCloseResponder {
16332    fn drop(&mut self) {
16333        self.control_handle.shutdown();
16334        // Safety: drops once, never accessed again
16335        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16336    }
16337}
16338
16339impl fdomain_client::fidl::Responder for SymlinkCloseResponder {
16340    type ControlHandle = SymlinkControlHandle;
16341
16342    fn control_handle(&self) -> &SymlinkControlHandle {
16343        &self.control_handle
16344    }
16345
16346    fn drop_without_shutdown(mut self) {
16347        // Safety: drops once, never accessed again due to mem::forget
16348        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16349        // Prevent Drop from running (which would shut down the channel)
16350        std::mem::forget(self);
16351    }
16352}
16353
16354impl SymlinkCloseResponder {
16355    /// Sends a response to the FIDL transaction.
16356    ///
16357    /// Sets the channel to shutdown if an error occurs.
16358    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16359        let _result = self.send_raw(result);
16360        if _result.is_err() {
16361            self.control_handle.shutdown();
16362        }
16363        self.drop_without_shutdown();
16364        _result
16365    }
16366
16367    /// Similar to "send" but does not shutdown the channel if an error occurs.
16368    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16369        let _result = self.send_raw(result);
16370        self.drop_without_shutdown();
16371        _result
16372    }
16373
16374    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16375        self.control_handle
16376            .inner
16377            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16378                result,
16379                self.tx_id,
16380                0x5ac5d459ad7f657e,
16381                fidl::encoding::DynamicFlags::empty(),
16382            )
16383    }
16384}
16385
16386#[must_use = "FIDL methods require a response to be sent"]
16387#[derive(Debug)]
16388pub struct SymlinkQueryResponder {
16389    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16390    tx_id: u32,
16391}
16392
16393/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16394/// if the responder is dropped without sending a response, so that the client
16395/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16396impl std::ops::Drop for SymlinkQueryResponder {
16397    fn drop(&mut self) {
16398        self.control_handle.shutdown();
16399        // Safety: drops once, never accessed again
16400        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16401    }
16402}
16403
16404impl fdomain_client::fidl::Responder for SymlinkQueryResponder {
16405    type ControlHandle = SymlinkControlHandle;
16406
16407    fn control_handle(&self) -> &SymlinkControlHandle {
16408        &self.control_handle
16409    }
16410
16411    fn drop_without_shutdown(mut self) {
16412        // Safety: drops once, never accessed again due to mem::forget
16413        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16414        // Prevent Drop from running (which would shut down the channel)
16415        std::mem::forget(self);
16416    }
16417}
16418
16419impl SymlinkQueryResponder {
16420    /// Sends a response to the FIDL transaction.
16421    ///
16422    /// Sets the channel to shutdown if an error occurs.
16423    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16424        let _result = self.send_raw(protocol);
16425        if _result.is_err() {
16426            self.control_handle.shutdown();
16427        }
16428        self.drop_without_shutdown();
16429        _result
16430    }
16431
16432    /// Similar to "send" but does not shutdown the channel if an error occurs.
16433    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16434        let _result = self.send_raw(protocol);
16435        self.drop_without_shutdown();
16436        _result
16437    }
16438
16439    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16440        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
16441            (protocol,),
16442            self.tx_id,
16443            0x2658edee9decfc06,
16444            fidl::encoding::DynamicFlags::empty(),
16445        )
16446    }
16447}
16448
16449#[must_use = "FIDL methods require a response to be sent"]
16450#[derive(Debug)]
16451pub struct SymlinkDeprecatedGetAttrResponder {
16452    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16453    tx_id: u32,
16454}
16455
16456/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16457/// if the responder is dropped without sending a response, so that the client
16458/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16459impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
16460    fn drop(&mut self) {
16461        self.control_handle.shutdown();
16462        // Safety: drops once, never accessed again
16463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16464    }
16465}
16466
16467impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetAttrResponder {
16468    type ControlHandle = SymlinkControlHandle;
16469
16470    fn control_handle(&self) -> &SymlinkControlHandle {
16471        &self.control_handle
16472    }
16473
16474    fn drop_without_shutdown(mut self) {
16475        // Safety: drops once, never accessed again due to mem::forget
16476        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16477        // Prevent Drop from running (which would shut down the channel)
16478        std::mem::forget(self);
16479    }
16480}
16481
16482impl SymlinkDeprecatedGetAttrResponder {
16483    /// Sends a response to the FIDL transaction.
16484    ///
16485    /// Sets the channel to shutdown if an error occurs.
16486    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16487        let _result = self.send_raw(s, attributes);
16488        if _result.is_err() {
16489            self.control_handle.shutdown();
16490        }
16491        self.drop_without_shutdown();
16492        _result
16493    }
16494
16495    /// Similar to "send" but does not shutdown the channel if an error occurs.
16496    pub fn send_no_shutdown_on_err(
16497        self,
16498        mut s: i32,
16499        mut attributes: &NodeAttributes,
16500    ) -> Result<(), fidl::Error> {
16501        let _result = self.send_raw(s, attributes);
16502        self.drop_without_shutdown();
16503        _result
16504    }
16505
16506    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16507        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
16508            (s, attributes),
16509            self.tx_id,
16510            0x78985e216314dafd,
16511            fidl::encoding::DynamicFlags::empty(),
16512        )
16513    }
16514}
16515
16516#[must_use = "FIDL methods require a response to be sent"]
16517#[derive(Debug)]
16518pub struct SymlinkDeprecatedSetAttrResponder {
16519    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16520    tx_id: u32,
16521}
16522
16523/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16524/// if the responder is dropped without sending a response, so that the client
16525/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16526impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
16527    fn drop(&mut self) {
16528        self.control_handle.shutdown();
16529        // Safety: drops once, never accessed again
16530        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16531    }
16532}
16533
16534impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetAttrResponder {
16535    type ControlHandle = SymlinkControlHandle;
16536
16537    fn control_handle(&self) -> &SymlinkControlHandle {
16538        &self.control_handle
16539    }
16540
16541    fn drop_without_shutdown(mut self) {
16542        // Safety: drops once, never accessed again due to mem::forget
16543        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16544        // Prevent Drop from running (which would shut down the channel)
16545        std::mem::forget(self);
16546    }
16547}
16548
16549impl SymlinkDeprecatedSetAttrResponder {
16550    /// Sends a response to the FIDL transaction.
16551    ///
16552    /// Sets the channel to shutdown if an error occurs.
16553    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16554        let _result = self.send_raw(s);
16555        if _result.is_err() {
16556            self.control_handle.shutdown();
16557        }
16558        self.drop_without_shutdown();
16559        _result
16560    }
16561
16562    /// Similar to "send" but does not shutdown the channel if an error occurs.
16563    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16564        let _result = self.send_raw(s);
16565        self.drop_without_shutdown();
16566        _result
16567    }
16568
16569    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16570        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
16571            (s,),
16572            self.tx_id,
16573            0x4186c0f40d938f46,
16574            fidl::encoding::DynamicFlags::empty(),
16575        )
16576    }
16577}
16578
16579#[must_use = "FIDL methods require a response to be sent"]
16580#[derive(Debug)]
16581pub struct SymlinkDeprecatedGetFlagsResponder {
16582    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16583    tx_id: u32,
16584}
16585
16586/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16587/// if the responder is dropped without sending a response, so that the client
16588/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16589impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
16590    fn drop(&mut self) {
16591        self.control_handle.shutdown();
16592        // Safety: drops once, never accessed again
16593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16594    }
16595}
16596
16597impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetFlagsResponder {
16598    type ControlHandle = SymlinkControlHandle;
16599
16600    fn control_handle(&self) -> &SymlinkControlHandle {
16601        &self.control_handle
16602    }
16603
16604    fn drop_without_shutdown(mut self) {
16605        // Safety: drops once, never accessed again due to mem::forget
16606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16607        // Prevent Drop from running (which would shut down the channel)
16608        std::mem::forget(self);
16609    }
16610}
16611
16612impl SymlinkDeprecatedGetFlagsResponder {
16613    /// Sends a response to the FIDL transaction.
16614    ///
16615    /// Sets the channel to shutdown if an error occurs.
16616    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16617        let _result = self.send_raw(s, flags);
16618        if _result.is_err() {
16619            self.control_handle.shutdown();
16620        }
16621        self.drop_without_shutdown();
16622        _result
16623    }
16624
16625    /// Similar to "send" but does not shutdown the channel if an error occurs.
16626    pub fn send_no_shutdown_on_err(
16627        self,
16628        mut s: i32,
16629        mut flags: OpenFlags,
16630    ) -> Result<(), fidl::Error> {
16631        let _result = self.send_raw(s, flags);
16632        self.drop_without_shutdown();
16633        _result
16634    }
16635
16636    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16637        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
16638            (s, flags),
16639            self.tx_id,
16640            0x5b88fffb8eda3aa1,
16641            fidl::encoding::DynamicFlags::empty(),
16642        )
16643    }
16644}
16645
16646#[must_use = "FIDL methods require a response to be sent"]
16647#[derive(Debug)]
16648pub struct SymlinkDeprecatedSetFlagsResponder {
16649    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16650    tx_id: u32,
16651}
16652
16653/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16654/// if the responder is dropped without sending a response, so that the client
16655/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16656impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
16657    fn drop(&mut self) {
16658        self.control_handle.shutdown();
16659        // Safety: drops once, never accessed again
16660        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16661    }
16662}
16663
16664impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetFlagsResponder {
16665    type ControlHandle = SymlinkControlHandle;
16666
16667    fn control_handle(&self) -> &SymlinkControlHandle {
16668        &self.control_handle
16669    }
16670
16671    fn drop_without_shutdown(mut self) {
16672        // Safety: drops once, never accessed again due to mem::forget
16673        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16674        // Prevent Drop from running (which would shut down the channel)
16675        std::mem::forget(self);
16676    }
16677}
16678
16679impl SymlinkDeprecatedSetFlagsResponder {
16680    /// Sends a response to the FIDL transaction.
16681    ///
16682    /// Sets the channel to shutdown if an error occurs.
16683    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16684        let _result = self.send_raw(s);
16685        if _result.is_err() {
16686            self.control_handle.shutdown();
16687        }
16688        self.drop_without_shutdown();
16689        _result
16690    }
16691
16692    /// Similar to "send" but does not shutdown the channel if an error occurs.
16693    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16694        let _result = self.send_raw(s);
16695        self.drop_without_shutdown();
16696        _result
16697    }
16698
16699    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16700        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
16701            (s,),
16702            self.tx_id,
16703            0x5295b76c71fde733,
16704            fidl::encoding::DynamicFlags::empty(),
16705        )
16706    }
16707}
16708
16709#[must_use = "FIDL methods require a response to be sent"]
16710#[derive(Debug)]
16711pub struct SymlinkGetFlagsResponder {
16712    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16713    tx_id: u32,
16714}
16715
16716/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16717/// if the responder is dropped without sending a response, so that the client
16718/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16719impl std::ops::Drop for SymlinkGetFlagsResponder {
16720    fn drop(&mut self) {
16721        self.control_handle.shutdown();
16722        // Safety: drops once, never accessed again
16723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16724    }
16725}
16726
16727impl fdomain_client::fidl::Responder for SymlinkGetFlagsResponder {
16728    type ControlHandle = SymlinkControlHandle;
16729
16730    fn control_handle(&self) -> &SymlinkControlHandle {
16731        &self.control_handle
16732    }
16733
16734    fn drop_without_shutdown(mut self) {
16735        // Safety: drops once, never accessed again due to mem::forget
16736        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16737        // Prevent Drop from running (which would shut down the channel)
16738        std::mem::forget(self);
16739    }
16740}
16741
16742impl SymlinkGetFlagsResponder {
16743    /// Sends a response to the FIDL transaction.
16744    ///
16745    /// Sets the channel to shutdown if an error occurs.
16746    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16747        let _result = self.send_raw(result);
16748        if _result.is_err() {
16749            self.control_handle.shutdown();
16750        }
16751        self.drop_without_shutdown();
16752        _result
16753    }
16754
16755    /// Similar to "send" but does not shutdown the channel if an error occurs.
16756    pub fn send_no_shutdown_on_err(
16757        self,
16758        mut result: Result<Flags, i32>,
16759    ) -> Result<(), fidl::Error> {
16760        let _result = self.send_raw(result);
16761        self.drop_without_shutdown();
16762        _result
16763    }
16764
16765    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16766        self.control_handle
16767            .inner
16768            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
16769                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
16770                self.tx_id,
16771                0x176eb318f64ec23,
16772                fidl::encoding::DynamicFlags::FLEXIBLE,
16773            )
16774    }
16775}
16776
16777#[must_use = "FIDL methods require a response to be sent"]
16778#[derive(Debug)]
16779pub struct SymlinkSetFlagsResponder {
16780    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16781    tx_id: u32,
16782}
16783
16784/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16785/// if the responder is dropped without sending a response, so that the client
16786/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16787impl std::ops::Drop for SymlinkSetFlagsResponder {
16788    fn drop(&mut self) {
16789        self.control_handle.shutdown();
16790        // Safety: drops once, never accessed again
16791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16792    }
16793}
16794
16795impl fdomain_client::fidl::Responder for SymlinkSetFlagsResponder {
16796    type ControlHandle = SymlinkControlHandle;
16797
16798    fn control_handle(&self) -> &SymlinkControlHandle {
16799        &self.control_handle
16800    }
16801
16802    fn drop_without_shutdown(mut self) {
16803        // Safety: drops once, never accessed again due to mem::forget
16804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16805        // Prevent Drop from running (which would shut down the channel)
16806        std::mem::forget(self);
16807    }
16808}
16809
16810impl SymlinkSetFlagsResponder {
16811    /// Sends a response to the FIDL transaction.
16812    ///
16813    /// Sets the channel to shutdown if an error occurs.
16814    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16815        let _result = self.send_raw(result);
16816        if _result.is_err() {
16817            self.control_handle.shutdown();
16818        }
16819        self.drop_without_shutdown();
16820        _result
16821    }
16822
16823    /// Similar to "send" but does not shutdown the channel if an error occurs.
16824    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16825        let _result = self.send_raw(result);
16826        self.drop_without_shutdown();
16827        _result
16828    }
16829
16830    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16831        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
16832            fidl::encoding::EmptyStruct,
16833            i32,
16834        >>(
16835            fidl::encoding::FlexibleResult::new(result),
16836            self.tx_id,
16837            0x55a8028685791ea8,
16838            fidl::encoding::DynamicFlags::FLEXIBLE,
16839        )
16840    }
16841}
16842
16843#[must_use = "FIDL methods require a response to be sent"]
16844#[derive(Debug)]
16845pub struct SymlinkQueryFilesystemResponder {
16846    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16847    tx_id: u32,
16848}
16849
16850/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16851/// if the responder is dropped without sending a response, so that the client
16852/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16853impl std::ops::Drop for SymlinkQueryFilesystemResponder {
16854    fn drop(&mut self) {
16855        self.control_handle.shutdown();
16856        // Safety: drops once, never accessed again
16857        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16858    }
16859}
16860
16861impl fdomain_client::fidl::Responder for SymlinkQueryFilesystemResponder {
16862    type ControlHandle = SymlinkControlHandle;
16863
16864    fn control_handle(&self) -> &SymlinkControlHandle {
16865        &self.control_handle
16866    }
16867
16868    fn drop_without_shutdown(mut self) {
16869        // Safety: drops once, never accessed again due to mem::forget
16870        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16871        // Prevent Drop from running (which would shut down the channel)
16872        std::mem::forget(self);
16873    }
16874}
16875
16876impl SymlinkQueryFilesystemResponder {
16877    /// Sends a response to the FIDL transaction.
16878    ///
16879    /// Sets the channel to shutdown if an error occurs.
16880    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16881        let _result = self.send_raw(s, info);
16882        if _result.is_err() {
16883            self.control_handle.shutdown();
16884        }
16885        self.drop_without_shutdown();
16886        _result
16887    }
16888
16889    /// Similar to "send" but does not shutdown the channel if an error occurs.
16890    pub fn send_no_shutdown_on_err(
16891        self,
16892        mut s: i32,
16893        mut info: Option<&FilesystemInfo>,
16894    ) -> Result<(), fidl::Error> {
16895        let _result = self.send_raw(s, info);
16896        self.drop_without_shutdown();
16897        _result
16898    }
16899
16900    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16901        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
16902            (s, info),
16903            self.tx_id,
16904            0x6f344a1c6b0a0610,
16905            fidl::encoding::DynamicFlags::empty(),
16906        )
16907    }
16908}
16909
16910#[must_use = "FIDL methods require a response to be sent"]
16911#[derive(Debug)]
16912pub struct SymlinkGetAttributesResponder {
16913    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16914    tx_id: u32,
16915}
16916
16917/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16918/// if the responder is dropped without sending a response, so that the client
16919/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16920impl std::ops::Drop for SymlinkGetAttributesResponder {
16921    fn drop(&mut self) {
16922        self.control_handle.shutdown();
16923        // Safety: drops once, never accessed again
16924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16925    }
16926}
16927
16928impl fdomain_client::fidl::Responder for SymlinkGetAttributesResponder {
16929    type ControlHandle = SymlinkControlHandle;
16930
16931    fn control_handle(&self) -> &SymlinkControlHandle {
16932        &self.control_handle
16933    }
16934
16935    fn drop_without_shutdown(mut self) {
16936        // Safety: drops once, never accessed again due to mem::forget
16937        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16938        // Prevent Drop from running (which would shut down the channel)
16939        std::mem::forget(self);
16940    }
16941}
16942
16943impl SymlinkGetAttributesResponder {
16944    /// Sends a response to the FIDL transaction.
16945    ///
16946    /// Sets the channel to shutdown if an error occurs.
16947    pub fn send(
16948        self,
16949        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16950    ) -> Result<(), fidl::Error> {
16951        let _result = self.send_raw(result);
16952        if _result.is_err() {
16953            self.control_handle.shutdown();
16954        }
16955        self.drop_without_shutdown();
16956        _result
16957    }
16958
16959    /// Similar to "send" but does not shutdown the channel if an error occurs.
16960    pub fn send_no_shutdown_on_err(
16961        self,
16962        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16963    ) -> Result<(), fidl::Error> {
16964        let _result = self.send_raw(result);
16965        self.drop_without_shutdown();
16966        _result
16967    }
16968
16969    fn send_raw(
16970        &self,
16971        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16972    ) -> Result<(), fidl::Error> {
16973        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16974            result,
16975            self.tx_id,
16976            0x3d4396a638ea053b,
16977            fidl::encoding::DynamicFlags::empty(),
16978        )
16979    }
16980}
16981
16982#[must_use = "FIDL methods require a response to be sent"]
16983#[derive(Debug)]
16984pub struct SymlinkUpdateAttributesResponder {
16985    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16986    tx_id: u32,
16987}
16988
16989/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16990/// if the responder is dropped without sending a response, so that the client
16991/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16992impl std::ops::Drop for SymlinkUpdateAttributesResponder {
16993    fn drop(&mut self) {
16994        self.control_handle.shutdown();
16995        // Safety: drops once, never accessed again
16996        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16997    }
16998}
16999
17000impl fdomain_client::fidl::Responder for SymlinkUpdateAttributesResponder {
17001    type ControlHandle = SymlinkControlHandle;
17002
17003    fn control_handle(&self) -> &SymlinkControlHandle {
17004        &self.control_handle
17005    }
17006
17007    fn drop_without_shutdown(mut self) {
17008        // Safety: drops once, never accessed again due to mem::forget
17009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17010        // Prevent Drop from running (which would shut down the channel)
17011        std::mem::forget(self);
17012    }
17013}
17014
17015impl SymlinkUpdateAttributesResponder {
17016    /// Sends a response to the FIDL transaction.
17017    ///
17018    /// Sets the channel to shutdown if an error occurs.
17019    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17020        let _result = self.send_raw(result);
17021        if _result.is_err() {
17022            self.control_handle.shutdown();
17023        }
17024        self.drop_without_shutdown();
17025        _result
17026    }
17027
17028    /// Similar to "send" but does not shutdown the channel if an error occurs.
17029    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17030        let _result = self.send_raw(result);
17031        self.drop_without_shutdown();
17032        _result
17033    }
17034
17035    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17036        self.control_handle
17037            .inner
17038            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17039                result,
17040                self.tx_id,
17041                0x3308c1da5a89bf08,
17042                fidl::encoding::DynamicFlags::empty(),
17043            )
17044    }
17045}
17046
17047#[must_use = "FIDL methods require a response to be sent"]
17048#[derive(Debug)]
17049pub struct SymlinkSyncResponder {
17050    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17051    tx_id: u32,
17052}
17053
17054/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17055/// if the responder is dropped without sending a response, so that the client
17056/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17057impl std::ops::Drop for SymlinkSyncResponder {
17058    fn drop(&mut self) {
17059        self.control_handle.shutdown();
17060        // Safety: drops once, never accessed again
17061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17062    }
17063}
17064
17065impl fdomain_client::fidl::Responder for SymlinkSyncResponder {
17066    type ControlHandle = SymlinkControlHandle;
17067
17068    fn control_handle(&self) -> &SymlinkControlHandle {
17069        &self.control_handle
17070    }
17071
17072    fn drop_without_shutdown(mut self) {
17073        // Safety: drops once, never accessed again due to mem::forget
17074        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17075        // Prevent Drop from running (which would shut down the channel)
17076        std::mem::forget(self);
17077    }
17078}
17079
17080impl SymlinkSyncResponder {
17081    /// Sends a response to the FIDL transaction.
17082    ///
17083    /// Sets the channel to shutdown if an error occurs.
17084    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17085        let _result = self.send_raw(result);
17086        if _result.is_err() {
17087            self.control_handle.shutdown();
17088        }
17089        self.drop_without_shutdown();
17090        _result
17091    }
17092
17093    /// Similar to "send" but does not shutdown the channel if an error occurs.
17094    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17095        let _result = self.send_raw(result);
17096        self.drop_without_shutdown();
17097        _result
17098    }
17099
17100    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17101        self.control_handle
17102            .inner
17103            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17104                result,
17105                self.tx_id,
17106                0x2c5c27ca0ab5dc49,
17107                fidl::encoding::DynamicFlags::empty(),
17108            )
17109    }
17110}
17111
17112#[must_use = "FIDL methods require a response to be sent"]
17113#[derive(Debug)]
17114pub struct SymlinkGetExtendedAttributeResponder {
17115    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17116    tx_id: u32,
17117}
17118
17119/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17120/// if the responder is dropped without sending a response, so that the client
17121/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17122impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
17123    fn drop(&mut self) {
17124        self.control_handle.shutdown();
17125        // Safety: drops once, never accessed again
17126        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17127    }
17128}
17129
17130impl fdomain_client::fidl::Responder for SymlinkGetExtendedAttributeResponder {
17131    type ControlHandle = SymlinkControlHandle;
17132
17133    fn control_handle(&self) -> &SymlinkControlHandle {
17134        &self.control_handle
17135    }
17136
17137    fn drop_without_shutdown(mut self) {
17138        // Safety: drops once, never accessed again due to mem::forget
17139        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17140        // Prevent Drop from running (which would shut down the channel)
17141        std::mem::forget(self);
17142    }
17143}
17144
17145impl SymlinkGetExtendedAttributeResponder {
17146    /// Sends a response to the FIDL transaction.
17147    ///
17148    /// Sets the channel to shutdown if an error occurs.
17149    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17150        let _result = self.send_raw(result);
17151        if _result.is_err() {
17152            self.control_handle.shutdown();
17153        }
17154        self.drop_without_shutdown();
17155        _result
17156    }
17157
17158    /// Similar to "send" but does not shutdown the channel if an error occurs.
17159    pub fn send_no_shutdown_on_err(
17160        self,
17161        mut result: Result<ExtendedAttributeValue, i32>,
17162    ) -> Result<(), fidl::Error> {
17163        let _result = self.send_raw(result);
17164        self.drop_without_shutdown();
17165        _result
17166    }
17167
17168    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17169        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
17170            result.as_mut().map_err(|e| *e),
17171            self.tx_id,
17172            0x45ffa3ccfdeb76db,
17173            fidl::encoding::DynamicFlags::empty(),
17174        )
17175    }
17176}
17177
17178#[must_use = "FIDL methods require a response to be sent"]
17179#[derive(Debug)]
17180pub struct SymlinkSetExtendedAttributeResponder {
17181    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17182    tx_id: u32,
17183}
17184
17185/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17186/// if the responder is dropped without sending a response, so that the client
17187/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17188impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
17189    fn drop(&mut self) {
17190        self.control_handle.shutdown();
17191        // Safety: drops once, never accessed again
17192        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17193    }
17194}
17195
17196impl fdomain_client::fidl::Responder for SymlinkSetExtendedAttributeResponder {
17197    type ControlHandle = SymlinkControlHandle;
17198
17199    fn control_handle(&self) -> &SymlinkControlHandle {
17200        &self.control_handle
17201    }
17202
17203    fn drop_without_shutdown(mut self) {
17204        // Safety: drops once, never accessed again due to mem::forget
17205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17206        // Prevent Drop from running (which would shut down the channel)
17207        std::mem::forget(self);
17208    }
17209}
17210
17211impl SymlinkSetExtendedAttributeResponder {
17212    /// Sends a response to the FIDL transaction.
17213    ///
17214    /// Sets the channel to shutdown if an error occurs.
17215    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17216        let _result = self.send_raw(result);
17217        if _result.is_err() {
17218            self.control_handle.shutdown();
17219        }
17220        self.drop_without_shutdown();
17221        _result
17222    }
17223
17224    /// Similar to "send" but does not shutdown the channel if an error occurs.
17225    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17226        let _result = self.send_raw(result);
17227        self.drop_without_shutdown();
17228        _result
17229    }
17230
17231    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17232        self.control_handle
17233            .inner
17234            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17235                result,
17236                self.tx_id,
17237                0x4a951362f681f23c,
17238                fidl::encoding::DynamicFlags::empty(),
17239            )
17240    }
17241}
17242
17243#[must_use = "FIDL methods require a response to be sent"]
17244#[derive(Debug)]
17245pub struct SymlinkRemoveExtendedAttributeResponder {
17246    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17247    tx_id: u32,
17248}
17249
17250/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17251/// if the responder is dropped without sending a response, so that the client
17252/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17253impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
17254    fn drop(&mut self) {
17255        self.control_handle.shutdown();
17256        // Safety: drops once, never accessed again
17257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17258    }
17259}
17260
17261impl fdomain_client::fidl::Responder for SymlinkRemoveExtendedAttributeResponder {
17262    type ControlHandle = SymlinkControlHandle;
17263
17264    fn control_handle(&self) -> &SymlinkControlHandle {
17265        &self.control_handle
17266    }
17267
17268    fn drop_without_shutdown(mut self) {
17269        // Safety: drops once, never accessed again due to mem::forget
17270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17271        // Prevent Drop from running (which would shut down the channel)
17272        std::mem::forget(self);
17273    }
17274}
17275
17276impl SymlinkRemoveExtendedAttributeResponder {
17277    /// Sends a response to the FIDL transaction.
17278    ///
17279    /// Sets the channel to shutdown if an error occurs.
17280    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17281        let _result = self.send_raw(result);
17282        if _result.is_err() {
17283            self.control_handle.shutdown();
17284        }
17285        self.drop_without_shutdown();
17286        _result
17287    }
17288
17289    /// Similar to "send" but does not shutdown the channel if an error occurs.
17290    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17291        let _result = self.send_raw(result);
17292        self.drop_without_shutdown();
17293        _result
17294    }
17295
17296    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17297        self.control_handle
17298            .inner
17299            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17300                result,
17301                self.tx_id,
17302                0x7a0b9f3a9bf9032d,
17303                fidl::encoding::DynamicFlags::empty(),
17304            )
17305    }
17306}
17307
17308#[must_use = "FIDL methods require a response to be sent"]
17309#[derive(Debug)]
17310pub struct SymlinkDescribeResponder {
17311    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17312    tx_id: u32,
17313}
17314
17315/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17316/// if the responder is dropped without sending a response, so that the client
17317/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17318impl std::ops::Drop for SymlinkDescribeResponder {
17319    fn drop(&mut self) {
17320        self.control_handle.shutdown();
17321        // Safety: drops once, never accessed again
17322        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17323    }
17324}
17325
17326impl fdomain_client::fidl::Responder for SymlinkDescribeResponder {
17327    type ControlHandle = SymlinkControlHandle;
17328
17329    fn control_handle(&self) -> &SymlinkControlHandle {
17330        &self.control_handle
17331    }
17332
17333    fn drop_without_shutdown(mut self) {
17334        // Safety: drops once, never accessed again due to mem::forget
17335        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17336        // Prevent Drop from running (which would shut down the channel)
17337        std::mem::forget(self);
17338    }
17339}
17340
17341impl SymlinkDescribeResponder {
17342    /// Sends a response to the FIDL transaction.
17343    ///
17344    /// Sets the channel to shutdown if an error occurs.
17345    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17346        let _result = self.send_raw(payload);
17347        if _result.is_err() {
17348            self.control_handle.shutdown();
17349        }
17350        self.drop_without_shutdown();
17351        _result
17352    }
17353
17354    /// Similar to "send" but does not shutdown the channel if an error occurs.
17355    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17356        let _result = self.send_raw(payload);
17357        self.drop_without_shutdown();
17358        _result
17359    }
17360
17361    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17362        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
17363            fidl::encoding::Flexible::new(payload),
17364            self.tx_id,
17365            0x742c2ea5e89831f3,
17366            fidl::encoding::DynamicFlags::FLEXIBLE,
17367        )
17368    }
17369}
17370
17371#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17372pub struct WritableMarker;
17373
17374impl fdomain_client::fidl::ProtocolMarker for WritableMarker {
17375    type Proxy = WritableProxy;
17376    type RequestStream = WritableRequestStream;
17377
17378    const DEBUG_NAME: &'static str = "(anonymous) Writable";
17379}
17380pub type WritableWriteResult = Result<u64, i32>;
17381
17382pub trait WritableProxyInterface: Send + Sync {
17383    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
17384        + Send;
17385    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
17386}
17387
17388#[derive(Debug, Clone)]
17389pub struct WritableProxy {
17390    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
17391}
17392
17393impl fdomain_client::fidl::Proxy for WritableProxy {
17394    type Protocol = WritableMarker;
17395
17396    fn from_channel(inner: fdomain_client::Channel) -> Self {
17397        Self::new(inner)
17398    }
17399
17400    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
17401        self.client.into_channel().map_err(|client| Self { client })
17402    }
17403
17404    fn as_channel(&self) -> &fdomain_client::Channel {
17405        self.client.as_channel()
17406    }
17407}
17408
17409impl WritableProxy {
17410    /// Create a new Proxy for fuchsia.io/Writable.
17411    pub fn new(channel: fdomain_client::Channel) -> Self {
17412        let protocol_name = <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
17413        Self { client: fidl::client::Client::new(channel, protocol_name) }
17414    }
17415
17416    /// Get a Stream of events from the remote end of the protocol.
17417    ///
17418    /// # Panics
17419    ///
17420    /// Panics if the event stream was already taken.
17421    pub fn take_event_stream(&self) -> WritableEventStream {
17422        WritableEventStream { event_receiver: self.client.take_event_receiver() }
17423    }
17424
17425    /// Writes data at the seek offset.
17426    /// The seek offset is moved forward by the number of bytes written.
17427    /// If the file is in append mode, the seek offset is first set to the end
17428    /// of the file, followed by the write, in one atomic step.
17429    ///
17430    /// The file size may grow if the seek offset plus `data.length` is beyond
17431    /// the current end of file.
17432    ///
17433    /// + request `data` the byte buffer to write to the file.
17434    /// - response `actual_count` the number of bytes written.
17435    ///
17436    /// ## Invariants
17437    ///
17438    /// * The returned `actual_count` will never be greater than `data.length`.
17439    /// * If the server is unable to write all the data due to e.g. not enough
17440    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17441    ///   could be written, an error is returned.
17442    /// * If `data.length` is zero, the server should perform all the checks
17443    ///   ensuring write access without mutating the file and return a
17444    ///   successful write of zero bytes.  The seek offset is still updated if
17445    ///   in append mode.
17446    ///
17447    /// This method requires the [`Rights.WRITE_BYTES`] right.
17448    pub fn r#write(
17449        &self,
17450        mut data: &[u8],
17451    ) -> fidl::client::QueryResponseFut<
17452        WritableWriteResult,
17453        fdomain_client::fidl::FDomainResourceDialect,
17454    > {
17455        WritableProxyInterface::r#write(self, data)
17456    }
17457}
17458
17459impl WritableProxyInterface for WritableProxy {
17460    type WriteResponseFut = fidl::client::QueryResponseFut<
17461        WritableWriteResult,
17462        fdomain_client::fidl::FDomainResourceDialect,
17463    >;
17464    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
17465        fn _decode(
17466            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17467        ) -> Result<WritableWriteResult, fidl::Error> {
17468            let _response = fidl::client::decode_transaction_body::<
17469                fidl::encoding::ResultType<WritableWriteResponse, i32>,
17470                fdomain_client::fidl::FDomainResourceDialect,
17471                0x6a31437832469f82,
17472            >(_buf?)?;
17473            Ok(_response.map(|x| x.actual_count))
17474        }
17475        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
17476            (data,),
17477            0x6a31437832469f82,
17478            fidl::encoding::DynamicFlags::empty(),
17479            _decode,
17480        )
17481    }
17482}
17483
17484pub struct WritableEventStream {
17485    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
17486}
17487
17488impl std::marker::Unpin for WritableEventStream {}
17489
17490impl futures::stream::FusedStream for WritableEventStream {
17491    fn is_terminated(&self) -> bool {
17492        self.event_receiver.is_terminated()
17493    }
17494}
17495
17496impl futures::Stream for WritableEventStream {
17497    type Item = Result<WritableEvent, fidl::Error>;
17498
17499    fn poll_next(
17500        mut self: std::pin::Pin<&mut Self>,
17501        cx: &mut std::task::Context<'_>,
17502    ) -> std::task::Poll<Option<Self::Item>> {
17503        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17504            &mut self.event_receiver,
17505            cx
17506        )?) {
17507            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
17508            None => std::task::Poll::Ready(None),
17509        }
17510    }
17511}
17512
17513#[derive(Debug)]
17514pub enum WritableEvent {}
17515
17516impl WritableEvent {
17517    /// Decodes a message buffer as a [`WritableEvent`].
17518    fn decode(
17519        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17520    ) -> Result<WritableEvent, fidl::Error> {
17521        let (bytes, _handles) = buf.split_mut();
17522        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17523        debug_assert_eq!(tx_header.tx_id, 0);
17524        match tx_header.ordinal {
17525            _ => Err(fidl::Error::UnknownOrdinal {
17526                ordinal: tx_header.ordinal,
17527                protocol_name: <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17528            }),
17529        }
17530    }
17531}
17532
17533/// A Stream of incoming requests for fuchsia.io/Writable.
17534pub struct WritableRequestStream {
17535    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17536    is_terminated: bool,
17537}
17538
17539impl std::marker::Unpin for WritableRequestStream {}
17540
17541impl futures::stream::FusedStream for WritableRequestStream {
17542    fn is_terminated(&self) -> bool {
17543        self.is_terminated
17544    }
17545}
17546
17547impl fdomain_client::fidl::RequestStream for WritableRequestStream {
17548    type Protocol = WritableMarker;
17549    type ControlHandle = WritableControlHandle;
17550
17551    fn from_channel(channel: fdomain_client::Channel) -> Self {
17552        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17553    }
17554
17555    fn control_handle(&self) -> Self::ControlHandle {
17556        WritableControlHandle { inner: self.inner.clone() }
17557    }
17558
17559    fn into_inner(
17560        self,
17561    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
17562    {
17563        (self.inner, self.is_terminated)
17564    }
17565
17566    fn from_inner(
17567        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17568        is_terminated: bool,
17569    ) -> Self {
17570        Self { inner, is_terminated }
17571    }
17572}
17573
17574impl futures::Stream for WritableRequestStream {
17575    type Item = Result<WritableRequest, fidl::Error>;
17576
17577    fn poll_next(
17578        mut self: std::pin::Pin<&mut Self>,
17579        cx: &mut std::task::Context<'_>,
17580    ) -> std::task::Poll<Option<Self::Item>> {
17581        let this = &mut *self;
17582        if this.inner.check_shutdown(cx) {
17583            this.is_terminated = true;
17584            return std::task::Poll::Ready(None);
17585        }
17586        if this.is_terminated {
17587            panic!("polled WritableRequestStream after completion");
17588        }
17589        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
17590            |bytes, handles| {
17591                match this.inner.channel().read_etc(cx, bytes, handles) {
17592                    std::task::Poll::Ready(Ok(())) => {}
17593                    std::task::Poll::Pending => return std::task::Poll::Pending,
17594                    std::task::Poll::Ready(Err(None)) => {
17595                        this.is_terminated = true;
17596                        return std::task::Poll::Ready(None);
17597                    }
17598                    std::task::Poll::Ready(Err(Some(e))) => {
17599                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17600                            e.into(),
17601                        ))));
17602                    }
17603                }
17604
17605                // A message has been received from the channel
17606                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17607
17608                std::task::Poll::Ready(Some(match header.ordinal {
17609                    0x6a31437832469f82 => {
17610                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17611                        let mut req = fidl::new_empty!(
17612                            WritableWriteRequest,
17613                            fdomain_client::fidl::FDomainResourceDialect
17614                        );
17615                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
17616                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
17617                        Ok(WritableRequest::Write {
17618                            data: req.data,
17619
17620                            responder: WritableWriteResponder {
17621                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17622                                tx_id: header.tx_id,
17623                            },
17624                        })
17625                    }
17626                    _ => Err(fidl::Error::UnknownOrdinal {
17627                        ordinal: header.ordinal,
17628                        protocol_name:
17629                            <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17630                    }),
17631                }))
17632            },
17633        )
17634    }
17635}
17636
17637#[derive(Debug)]
17638pub enum WritableRequest {
17639    /// Writes data at the seek offset.
17640    /// The seek offset is moved forward by the number of bytes written.
17641    /// If the file is in append mode, the seek offset is first set to the end
17642    /// of the file, followed by the write, in one atomic step.
17643    ///
17644    /// The file size may grow if the seek offset plus `data.length` is beyond
17645    /// the current end of file.
17646    ///
17647    /// + request `data` the byte buffer to write to the file.
17648    /// - response `actual_count` the number of bytes written.
17649    ///
17650    /// ## Invariants
17651    ///
17652    /// * The returned `actual_count` will never be greater than `data.length`.
17653    /// * If the server is unable to write all the data due to e.g. not enough
17654    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17655    ///   could be written, an error is returned.
17656    /// * If `data.length` is zero, the server should perform all the checks
17657    ///   ensuring write access without mutating the file and return a
17658    ///   successful write of zero bytes.  The seek offset is still updated if
17659    ///   in append mode.
17660    ///
17661    /// This method requires the [`Rights.WRITE_BYTES`] right.
17662    Write { data: Vec<u8>, responder: WritableWriteResponder },
17663}
17664
17665impl WritableRequest {
17666    #[allow(irrefutable_let_patterns)]
17667    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
17668        if let WritableRequest::Write { data, responder } = self {
17669            Some((data, responder))
17670        } else {
17671            None
17672        }
17673    }
17674
17675    /// Name of the method defined in FIDL
17676    pub fn method_name(&self) -> &'static str {
17677        match *self {
17678            WritableRequest::Write { .. } => "write",
17679        }
17680    }
17681}
17682
17683#[derive(Debug, Clone)]
17684pub struct WritableControlHandle {
17685    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17686}
17687
17688impl WritableControlHandle {
17689    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
17690        self.inner.shutdown_with_epitaph(status.into())
17691    }
17692}
17693
17694impl fdomain_client::fidl::ControlHandle for WritableControlHandle {
17695    fn shutdown(&self) {
17696        self.inner.shutdown()
17697    }
17698
17699    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
17700        self.inner.shutdown_with_epitaph(status)
17701    }
17702
17703    fn is_closed(&self) -> bool {
17704        self.inner.channel().is_closed()
17705    }
17706    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
17707        self.inner.channel().on_closed()
17708    }
17709}
17710
17711impl WritableControlHandle {}
17712
17713#[must_use = "FIDL methods require a response to be sent"]
17714#[derive(Debug)]
17715pub struct WritableWriteResponder {
17716    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
17717    tx_id: u32,
17718}
17719
17720/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
17721/// if the responder is dropped without sending a response, so that the client
17722/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17723impl std::ops::Drop for WritableWriteResponder {
17724    fn drop(&mut self) {
17725        self.control_handle.shutdown();
17726        // Safety: drops once, never accessed again
17727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17728    }
17729}
17730
17731impl fdomain_client::fidl::Responder for WritableWriteResponder {
17732    type ControlHandle = WritableControlHandle;
17733
17734    fn control_handle(&self) -> &WritableControlHandle {
17735        &self.control_handle
17736    }
17737
17738    fn drop_without_shutdown(mut self) {
17739        // Safety: drops once, never accessed again due to mem::forget
17740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17741        // Prevent Drop from running (which would shut down the channel)
17742        std::mem::forget(self);
17743    }
17744}
17745
17746impl WritableWriteResponder {
17747    /// Sends a response to the FIDL transaction.
17748    ///
17749    /// Sets the channel to shutdown if an error occurs.
17750    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17751        let _result = self.send_raw(result);
17752        if _result.is_err() {
17753            self.control_handle.shutdown();
17754        }
17755        self.drop_without_shutdown();
17756        _result
17757    }
17758
17759    /// Similar to "send" but does not shutdown the channel if an error occurs.
17760    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17761        let _result = self.send_raw(result);
17762        self.drop_without_shutdown();
17763        _result
17764    }
17765
17766    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17767        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
17768            result.map(|actual_count| (actual_count,)),
17769            self.tx_id,
17770            0x6a31437832469f82,
17771            fidl::encoding::DynamicFlags::empty(),
17772        )
17773    }
17774}
17775
17776mod internal {
17777    use super::*;
17778
17779    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
17780        type Borrowed<'a> = &'a mut Self;
17781        fn take_or_borrow<'a>(
17782            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17783        ) -> Self::Borrowed<'a> {
17784            value
17785        }
17786    }
17787
17788    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
17789        type Owned = Self;
17790
17791        #[inline(always)]
17792        fn inline_align(_context: fidl::encoding::Context) -> usize {
17793            8
17794        }
17795
17796        #[inline(always)]
17797        fn inline_size(_context: fidl::encoding::Context) -> usize {
17798            40
17799        }
17800    }
17801
17802    unsafe impl
17803        fidl::encoding::Encode<
17804            DirectoryCreateSymlinkRequest,
17805            fdomain_client::fidl::FDomainResourceDialect,
17806        > for &mut DirectoryCreateSymlinkRequest
17807    {
17808        #[inline]
17809        unsafe fn encode(
17810            self,
17811            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17812            offset: usize,
17813            _depth: fidl::encoding::Depth,
17814        ) -> fidl::Result<()> {
17815            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17816            // Delegate to tuple encoding.
17817            fidl::encoding::Encode::<
17818                DirectoryCreateSymlinkRequest,
17819                fdomain_client::fidl::FDomainResourceDialect,
17820            >::encode(
17821                (
17822                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17823                        &self.name,
17824                    ),
17825                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
17826                        &self.target,
17827                    ),
17828                    <fidl::encoding::Optional<
17829                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17830                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17831                        &mut self.connection
17832                    ),
17833                ),
17834                encoder,
17835                offset,
17836                _depth,
17837            )
17838        }
17839    }
17840    unsafe impl<
17841        T0: fidl::encoding::Encode<
17842                fidl::encoding::BoundedString<255>,
17843                fdomain_client::fidl::FDomainResourceDialect,
17844            >,
17845        T1: fidl::encoding::Encode<
17846                fidl::encoding::Vector<u8, 4095>,
17847                fdomain_client::fidl::FDomainResourceDialect,
17848            >,
17849        T2: fidl::encoding::Encode<
17850                fidl::encoding::Optional<
17851                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17852                >,
17853                fdomain_client::fidl::FDomainResourceDialect,
17854            >,
17855    >
17856        fidl::encoding::Encode<
17857            DirectoryCreateSymlinkRequest,
17858            fdomain_client::fidl::FDomainResourceDialect,
17859        > for (T0, T1, T2)
17860    {
17861        #[inline]
17862        unsafe fn encode(
17863            self,
17864            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17865            offset: usize,
17866            depth: fidl::encoding::Depth,
17867        ) -> fidl::Result<()> {
17868            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17869            // Zero out padding regions. There's no need to apply masks
17870            // because the unmasked parts will be overwritten by fields.
17871            unsafe {
17872                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
17873                (ptr as *mut u64).write_unaligned(0);
17874            }
17875            // Write the fields.
17876            self.0.encode(encoder, offset + 0, depth)?;
17877            self.1.encode(encoder, offset + 16, depth)?;
17878            self.2.encode(encoder, offset + 32, depth)?;
17879            Ok(())
17880        }
17881    }
17882
17883    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17884        for DirectoryCreateSymlinkRequest
17885    {
17886        #[inline(always)]
17887        fn new_empty() -> Self {
17888            Self {
17889                name: fidl::new_empty!(
17890                    fidl::encoding::BoundedString<255>,
17891                    fdomain_client::fidl::FDomainResourceDialect
17892                ),
17893                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect),
17894                connection: fidl::new_empty!(
17895                    fidl::encoding::Optional<
17896                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17897                    >,
17898                    fdomain_client::fidl::FDomainResourceDialect
17899                ),
17900            }
17901        }
17902
17903        #[inline]
17904        unsafe fn decode(
17905            &mut self,
17906            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17907            offset: usize,
17908            _depth: fidl::encoding::Depth,
17909        ) -> fidl::Result<()> {
17910            decoder.debug_check_bounds::<Self>(offset);
17911            // Verify that padding bytes are zero.
17912            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
17913            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17914            let mask = 0xffffffff00000000u64;
17915            let maskedval = padval & mask;
17916            if maskedval != 0 {
17917                return Err(fidl::Error::NonZeroPadding {
17918                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
17919                });
17920            }
17921            fidl::decode!(
17922                fidl::encoding::BoundedString<255>,
17923                fdomain_client::fidl::FDomainResourceDialect,
17924                &mut self.name,
17925                decoder,
17926                offset + 0,
17927                _depth
17928            )?;
17929            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
17930            fidl::decode!(
17931                fidl::encoding::Optional<
17932                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17933                >,
17934                fdomain_client::fidl::FDomainResourceDialect,
17935                &mut self.connection,
17936                decoder,
17937                offset + 32,
17938                _depth
17939            )?;
17940            Ok(())
17941        }
17942    }
17943
17944    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
17945        type Borrowed<'a> = &'a mut Self;
17946        fn take_or_borrow<'a>(
17947            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17948        ) -> Self::Borrowed<'a> {
17949            value
17950        }
17951    }
17952
17953    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
17954        type Owned = Self;
17955
17956        #[inline(always)]
17957        fn inline_align(_context: fidl::encoding::Context) -> usize {
17958            8
17959        }
17960
17961        #[inline(always)]
17962        fn inline_size(_context: fidl::encoding::Context) -> usize {
17963            32
17964        }
17965    }
17966
17967    unsafe impl
17968        fidl::encoding::Encode<
17969            DirectoryDeprecatedOpenRequest,
17970            fdomain_client::fidl::FDomainResourceDialect,
17971        > for &mut DirectoryDeprecatedOpenRequest
17972    {
17973        #[inline]
17974        unsafe fn encode(
17975            self,
17976            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17977            offset: usize,
17978            _depth: fidl::encoding::Depth,
17979        ) -> fidl::Result<()> {
17980            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17981            // Delegate to tuple encoding.
17982            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17983                (
17984                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17985                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
17986                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17987                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17988                ),
17989                encoder, offset, _depth
17990            )
17991        }
17992    }
17993    unsafe impl<
17994        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
17995        T1: fidl::encoding::Encode<ModeType, fdomain_client::fidl::FDomainResourceDialect>,
17996        T2: fidl::encoding::Encode<
17997                fidl::encoding::BoundedString<4095>,
17998                fdomain_client::fidl::FDomainResourceDialect,
17999            >,
18000        T3: fidl::encoding::Encode<
18001                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18002                fdomain_client::fidl::FDomainResourceDialect,
18003            >,
18004    >
18005        fidl::encoding::Encode<
18006            DirectoryDeprecatedOpenRequest,
18007            fdomain_client::fidl::FDomainResourceDialect,
18008        > for (T0, T1, T2, T3)
18009    {
18010        #[inline]
18011        unsafe fn encode(
18012            self,
18013            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18014            offset: usize,
18015            depth: fidl::encoding::Depth,
18016        ) -> fidl::Result<()> {
18017            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
18018            // Zero out padding regions. There's no need to apply masks
18019            // because the unmasked parts will be overwritten by fields.
18020            unsafe {
18021                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
18022                (ptr as *mut u64).write_unaligned(0);
18023            }
18024            // Write the fields.
18025            self.0.encode(encoder, offset + 0, depth)?;
18026            self.1.encode(encoder, offset + 4, depth)?;
18027            self.2.encode(encoder, offset + 8, depth)?;
18028            self.3.encode(encoder, offset + 24, depth)?;
18029            Ok(())
18030        }
18031    }
18032
18033    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18034        for DirectoryDeprecatedOpenRequest
18035    {
18036        #[inline(always)]
18037        fn new_empty() -> Self {
18038            Self {
18039                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
18040                mode: fidl::new_empty!(ModeType, fdomain_client::fidl::FDomainResourceDialect),
18041                path: fidl::new_empty!(
18042                    fidl::encoding::BoundedString<4095>,
18043                    fdomain_client::fidl::FDomainResourceDialect
18044                ),
18045                object: fidl::new_empty!(
18046                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18047                    fdomain_client::fidl::FDomainResourceDialect
18048                ),
18049            }
18050        }
18051
18052        #[inline]
18053        unsafe fn decode(
18054            &mut self,
18055            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18056            offset: usize,
18057            _depth: fidl::encoding::Depth,
18058        ) -> fidl::Result<()> {
18059            decoder.debug_check_bounds::<Self>(offset);
18060            // Verify that padding bytes are zero.
18061            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
18062            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18063            let mask = 0xffffffff00000000u64;
18064            let maskedval = padval & mask;
18065            if maskedval != 0 {
18066                return Err(fidl::Error::NonZeroPadding {
18067                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
18068                });
18069            }
18070            fidl::decode!(
18071                OpenFlags,
18072                fdomain_client::fidl::FDomainResourceDialect,
18073                &mut self.flags,
18074                decoder,
18075                offset + 0,
18076                _depth
18077            )?;
18078            fidl::decode!(
18079                ModeType,
18080                fdomain_client::fidl::FDomainResourceDialect,
18081                &mut self.mode,
18082                decoder,
18083                offset + 4,
18084                _depth
18085            )?;
18086            fidl::decode!(
18087                fidl::encoding::BoundedString<4095>,
18088                fdomain_client::fidl::FDomainResourceDialect,
18089                &mut self.path,
18090                decoder,
18091                offset + 8,
18092                _depth
18093            )?;
18094            fidl::decode!(
18095                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18096                fdomain_client::fidl::FDomainResourceDialect,
18097                &mut self.object,
18098                decoder,
18099                offset + 24,
18100                _depth
18101            )?;
18102            Ok(())
18103        }
18104    }
18105
18106    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
18107        type Borrowed<'a> = &'a mut Self;
18108        fn take_or_borrow<'a>(
18109            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18110        ) -> Self::Borrowed<'a> {
18111            value
18112        }
18113    }
18114
18115    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
18116        type Owned = Self;
18117
18118        #[inline(always)]
18119        fn inline_align(_context: fidl::encoding::Context) -> usize {
18120            4
18121        }
18122
18123        #[inline(always)]
18124        fn inline_size(_context: fidl::encoding::Context) -> usize {
18125            8
18126        }
18127    }
18128
18129    unsafe impl
18130        fidl::encoding::Encode<
18131            DirectoryGetTokenResponse,
18132            fdomain_client::fidl::FDomainResourceDialect,
18133        > for &mut DirectoryGetTokenResponse
18134    {
18135        #[inline]
18136        unsafe fn encode(
18137            self,
18138            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18139            offset: usize,
18140            _depth: fidl::encoding::Depth,
18141        ) -> fidl::Result<()> {
18142            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
18143            // Delegate to tuple encoding.
18144            fidl::encoding::Encode::<
18145                DirectoryGetTokenResponse,
18146                fdomain_client::fidl::FDomainResourceDialect,
18147            >::encode(
18148                (
18149                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
18150                    <fidl::encoding::Optional<
18151                        fidl::encoding::HandleType<
18152                            fdomain_client::NullableHandle,
18153                            { fidl::ObjectType::NONE.into_raw() },
18154                            2147483648,
18155                        >,
18156                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18157                        &mut self.token
18158                    ),
18159                ),
18160                encoder,
18161                offset,
18162                _depth,
18163            )
18164        }
18165    }
18166    unsafe impl<
18167        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
18168        T1: fidl::encoding::Encode<
18169                fidl::encoding::Optional<
18170                    fidl::encoding::HandleType<
18171                        fdomain_client::NullableHandle,
18172                        { fidl::ObjectType::NONE.into_raw() },
18173                        2147483648,
18174                    >,
18175                >,
18176                fdomain_client::fidl::FDomainResourceDialect,
18177            >,
18178    >
18179        fidl::encoding::Encode<
18180            DirectoryGetTokenResponse,
18181            fdomain_client::fidl::FDomainResourceDialect,
18182        > for (T0, T1)
18183    {
18184        #[inline]
18185        unsafe fn encode(
18186            self,
18187            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18188            offset: usize,
18189            depth: fidl::encoding::Depth,
18190        ) -> fidl::Result<()> {
18191            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
18192            // Zero out padding regions. There's no need to apply masks
18193            // because the unmasked parts will be overwritten by fields.
18194            // Write the fields.
18195            self.0.encode(encoder, offset + 0, depth)?;
18196            self.1.encode(encoder, offset + 4, depth)?;
18197            Ok(())
18198        }
18199    }
18200
18201    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18202        for DirectoryGetTokenResponse
18203    {
18204        #[inline(always)]
18205        fn new_empty() -> Self {
18206            Self {
18207                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
18208                token: fidl::new_empty!(
18209                    fidl::encoding::Optional<
18210                        fidl::encoding::HandleType<
18211                            fdomain_client::NullableHandle,
18212                            { fidl::ObjectType::NONE.into_raw() },
18213                            2147483648,
18214                        >,
18215                    >,
18216                    fdomain_client::fidl::FDomainResourceDialect
18217                ),
18218            }
18219        }
18220
18221        #[inline]
18222        unsafe fn decode(
18223            &mut self,
18224            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18225            offset: usize,
18226            _depth: fidl::encoding::Depth,
18227        ) -> fidl::Result<()> {
18228            decoder.debug_check_bounds::<Self>(offset);
18229            // Verify that padding bytes are zero.
18230            fidl::decode!(
18231                i32,
18232                fdomain_client::fidl::FDomainResourceDialect,
18233                &mut self.s,
18234                decoder,
18235                offset + 0,
18236                _depth
18237            )?;
18238            fidl::decode!(
18239                fidl::encoding::Optional<
18240                    fidl::encoding::HandleType<
18241                        fdomain_client::NullableHandle,
18242                        { fidl::ObjectType::NONE.into_raw() },
18243                        2147483648,
18244                    >,
18245                >,
18246                fdomain_client::fidl::FDomainResourceDialect,
18247                &mut self.token,
18248                decoder,
18249                offset + 4,
18250                _depth
18251            )?;
18252            Ok(())
18253        }
18254    }
18255
18256    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
18257        type Borrowed<'a> = &'a mut Self;
18258        fn take_or_borrow<'a>(
18259            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18260        ) -> Self::Borrowed<'a> {
18261            value
18262        }
18263    }
18264
18265    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
18266        type Owned = Self;
18267
18268        #[inline(always)]
18269        fn inline_align(_context: fidl::encoding::Context) -> usize {
18270            8
18271        }
18272
18273        #[inline(always)]
18274        fn inline_size(_context: fidl::encoding::Context) -> usize {
18275            40
18276        }
18277    }
18278
18279    unsafe impl
18280        fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18281        for &mut DirectoryLinkRequest
18282    {
18283        #[inline]
18284        unsafe fn encode(
18285            self,
18286            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18287            offset: usize,
18288            _depth: fidl::encoding::Depth,
18289        ) -> fidl::Result<()> {
18290            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18291            // Delegate to tuple encoding.
18292            fidl::encoding::Encode::<
18293                DirectoryLinkRequest,
18294                fdomain_client::fidl::FDomainResourceDialect,
18295            >::encode(
18296                (
18297                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18298                        &self.src,
18299                    ),
18300                    <fidl::encoding::HandleType<
18301                        fdomain_client::NullableHandle,
18302                        { fidl::ObjectType::NONE.into_raw() },
18303                        2147483648,
18304                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18305                        &mut self.dst_parent_token,
18306                    ),
18307                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18308                        &self.dst,
18309                    ),
18310                ),
18311                encoder,
18312                offset,
18313                _depth,
18314            )
18315        }
18316    }
18317    unsafe impl<
18318        T0: fidl::encoding::Encode<
18319                fidl::encoding::BoundedString<255>,
18320                fdomain_client::fidl::FDomainResourceDialect,
18321            >,
18322        T1: fidl::encoding::Encode<
18323                fidl::encoding::HandleType<
18324                    fdomain_client::NullableHandle,
18325                    { fidl::ObjectType::NONE.into_raw() },
18326                    2147483648,
18327                >,
18328                fdomain_client::fidl::FDomainResourceDialect,
18329            >,
18330        T2: fidl::encoding::Encode<
18331                fidl::encoding::BoundedString<255>,
18332                fdomain_client::fidl::FDomainResourceDialect,
18333            >,
18334    > fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18335        for (T0, T1, T2)
18336    {
18337        #[inline]
18338        unsafe fn encode(
18339            self,
18340            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18341            offset: usize,
18342            depth: fidl::encoding::Depth,
18343        ) -> fidl::Result<()> {
18344            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18345            // Zero out padding regions. There's no need to apply masks
18346            // because the unmasked parts will be overwritten by fields.
18347            unsafe {
18348                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18349                (ptr as *mut u64).write_unaligned(0);
18350            }
18351            // Write the fields.
18352            self.0.encode(encoder, offset + 0, depth)?;
18353            self.1.encode(encoder, offset + 16, depth)?;
18354            self.2.encode(encoder, offset + 24, depth)?;
18355            Ok(())
18356        }
18357    }
18358
18359    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18360        for DirectoryLinkRequest
18361    {
18362        #[inline(always)]
18363        fn new_empty() -> Self {
18364            Self {
18365                src: fidl::new_empty!(
18366                    fidl::encoding::BoundedString<255>,
18367                    fdomain_client::fidl::FDomainResourceDialect
18368                ),
18369                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18370                dst: fidl::new_empty!(
18371                    fidl::encoding::BoundedString<255>,
18372                    fdomain_client::fidl::FDomainResourceDialect
18373                ),
18374            }
18375        }
18376
18377        #[inline]
18378        unsafe fn decode(
18379            &mut self,
18380            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18381            offset: usize,
18382            _depth: fidl::encoding::Depth,
18383        ) -> fidl::Result<()> {
18384            decoder.debug_check_bounds::<Self>(offset);
18385            // Verify that padding bytes are zero.
18386            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18387            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18388            let mask = 0xffffffff00000000u64;
18389            let maskedval = padval & mask;
18390            if maskedval != 0 {
18391                return Err(fidl::Error::NonZeroPadding {
18392                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18393                });
18394            }
18395            fidl::decode!(
18396                fidl::encoding::BoundedString<255>,
18397                fdomain_client::fidl::FDomainResourceDialect,
18398                &mut self.src,
18399                decoder,
18400                offset + 0,
18401                _depth
18402            )?;
18403            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)?;
18404            fidl::decode!(
18405                fidl::encoding::BoundedString<255>,
18406                fdomain_client::fidl::FDomainResourceDialect,
18407                &mut self.dst,
18408                decoder,
18409                offset + 24,
18410                _depth
18411            )?;
18412            Ok(())
18413        }
18414    }
18415
18416    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
18417        type Borrowed<'a> = &'a mut Self;
18418        fn take_or_borrow<'a>(
18419            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18420        ) -> Self::Borrowed<'a> {
18421            value
18422        }
18423    }
18424
18425    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
18426        type Owned = Self;
18427
18428        #[inline(always)]
18429        fn inline_align(_context: fidl::encoding::Context) -> usize {
18430            8
18431        }
18432
18433        #[inline(always)]
18434        fn inline_size(_context: fidl::encoding::Context) -> usize {
18435            40
18436        }
18437    }
18438
18439    unsafe impl
18440        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18441        for &mut DirectoryRenameRequest
18442    {
18443        #[inline]
18444        unsafe fn encode(
18445            self,
18446            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18447            offset: usize,
18448            _depth: fidl::encoding::Depth,
18449        ) -> fidl::Result<()> {
18450            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18451            // Delegate to tuple encoding.
18452            fidl::encoding::Encode::<
18453                DirectoryRenameRequest,
18454                fdomain_client::fidl::FDomainResourceDialect,
18455            >::encode(
18456                (
18457                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18458                        &self.src,
18459                    ),
18460                    <fidl::encoding::HandleType<
18461                        fdomain_client::Event,
18462                        { fidl::ObjectType::EVENT.into_raw() },
18463                        2147483648,
18464                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18465                        &mut self.dst_parent_token,
18466                    ),
18467                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18468                        &self.dst,
18469                    ),
18470                ),
18471                encoder,
18472                offset,
18473                _depth,
18474            )
18475        }
18476    }
18477    unsafe impl<
18478        T0: fidl::encoding::Encode<
18479                fidl::encoding::BoundedString<255>,
18480                fdomain_client::fidl::FDomainResourceDialect,
18481            >,
18482        T1: fidl::encoding::Encode<
18483                fidl::encoding::HandleType<
18484                    fdomain_client::Event,
18485                    { fidl::ObjectType::EVENT.into_raw() },
18486                    2147483648,
18487                >,
18488                fdomain_client::fidl::FDomainResourceDialect,
18489            >,
18490        T2: fidl::encoding::Encode<
18491                fidl::encoding::BoundedString<255>,
18492                fdomain_client::fidl::FDomainResourceDialect,
18493            >,
18494    >
18495        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18496        for (T0, T1, T2)
18497    {
18498        #[inline]
18499        unsafe fn encode(
18500            self,
18501            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18502            offset: usize,
18503            depth: fidl::encoding::Depth,
18504        ) -> fidl::Result<()> {
18505            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18506            // Zero out padding regions. There's no need to apply masks
18507            // because the unmasked parts will be overwritten by fields.
18508            unsafe {
18509                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18510                (ptr as *mut u64).write_unaligned(0);
18511            }
18512            // Write the fields.
18513            self.0.encode(encoder, offset + 0, depth)?;
18514            self.1.encode(encoder, offset + 16, depth)?;
18515            self.2.encode(encoder, offset + 24, depth)?;
18516            Ok(())
18517        }
18518    }
18519
18520    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18521        for DirectoryRenameRequest
18522    {
18523        #[inline(always)]
18524        fn new_empty() -> Self {
18525            Self {
18526                src: fidl::new_empty!(
18527                    fidl::encoding::BoundedString<255>,
18528                    fdomain_client::fidl::FDomainResourceDialect
18529                ),
18530                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18531                dst: fidl::new_empty!(
18532                    fidl::encoding::BoundedString<255>,
18533                    fdomain_client::fidl::FDomainResourceDialect
18534                ),
18535            }
18536        }
18537
18538        #[inline]
18539        unsafe fn decode(
18540            &mut self,
18541            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18542            offset: usize,
18543            _depth: fidl::encoding::Depth,
18544        ) -> fidl::Result<()> {
18545            decoder.debug_check_bounds::<Self>(offset);
18546            // Verify that padding bytes are zero.
18547            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18548            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18549            let mask = 0xffffffff00000000u64;
18550            let maskedval = padval & mask;
18551            if maskedval != 0 {
18552                return Err(fidl::Error::NonZeroPadding {
18553                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18554                });
18555            }
18556            fidl::decode!(
18557                fidl::encoding::BoundedString<255>,
18558                fdomain_client::fidl::FDomainResourceDialect,
18559                &mut self.src,
18560                decoder,
18561                offset + 0,
18562                _depth
18563            )?;
18564            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)?;
18565            fidl::decode!(
18566                fidl::encoding::BoundedString<255>,
18567                fdomain_client::fidl::FDomainResourceDialect,
18568                &mut self.dst,
18569                decoder,
18570                offset + 24,
18571                _depth
18572            )?;
18573            Ok(())
18574        }
18575    }
18576
18577    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
18578        type Borrowed<'a> = &'a mut Self;
18579        fn take_or_borrow<'a>(
18580            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18581        ) -> Self::Borrowed<'a> {
18582            value
18583        }
18584    }
18585
18586    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
18587        type Owned = Self;
18588
18589        #[inline(always)]
18590        fn inline_align(_context: fidl::encoding::Context) -> usize {
18591            4
18592        }
18593
18594        #[inline(always)]
18595        fn inline_size(_context: fidl::encoding::Context) -> usize {
18596            12
18597        }
18598    }
18599
18600    unsafe impl
18601        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18602        for &mut DirectoryWatchRequest
18603    {
18604        #[inline]
18605        unsafe fn encode(
18606            self,
18607            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18608            offset: usize,
18609            _depth: fidl::encoding::Depth,
18610        ) -> fidl::Result<()> {
18611            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18612            // Delegate to tuple encoding.
18613            fidl::encoding::Encode::<
18614                DirectoryWatchRequest,
18615                fdomain_client::fidl::FDomainResourceDialect,
18616            >::encode(
18617                (
18618                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
18619                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
18620                    <fidl::encoding::Endpoint<
18621                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18622                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18623                        &mut self.watcher
18624                    ),
18625                ),
18626                encoder,
18627                offset,
18628                _depth,
18629            )
18630        }
18631    }
18632    unsafe impl<
18633        T0: fidl::encoding::Encode<WatchMask, fdomain_client::fidl::FDomainResourceDialect>,
18634        T1: fidl::encoding::Encode<u32, fdomain_client::fidl::FDomainResourceDialect>,
18635        T2: fidl::encoding::Encode<
18636                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18637                fdomain_client::fidl::FDomainResourceDialect,
18638            >,
18639    >
18640        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18641        for (T0, T1, T2)
18642    {
18643        #[inline]
18644        unsafe fn encode(
18645            self,
18646            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18647            offset: usize,
18648            depth: fidl::encoding::Depth,
18649        ) -> fidl::Result<()> {
18650            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18651            // Zero out padding regions. There's no need to apply masks
18652            // because the unmasked parts will be overwritten by fields.
18653            // Write the fields.
18654            self.0.encode(encoder, offset + 0, depth)?;
18655            self.1.encode(encoder, offset + 4, depth)?;
18656            self.2.encode(encoder, offset + 8, depth)?;
18657            Ok(())
18658        }
18659    }
18660
18661    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18662        for DirectoryWatchRequest
18663    {
18664        #[inline(always)]
18665        fn new_empty() -> Self {
18666            Self {
18667                mask: fidl::new_empty!(WatchMask, fdomain_client::fidl::FDomainResourceDialect),
18668                options: fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect),
18669                watcher: fidl::new_empty!(
18670                    fidl::encoding::Endpoint<
18671                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18672                    >,
18673                    fdomain_client::fidl::FDomainResourceDialect
18674                ),
18675            }
18676        }
18677
18678        #[inline]
18679        unsafe fn decode(
18680            &mut self,
18681            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18682            offset: usize,
18683            _depth: fidl::encoding::Depth,
18684        ) -> fidl::Result<()> {
18685            decoder.debug_check_bounds::<Self>(offset);
18686            // Verify that padding bytes are zero.
18687            fidl::decode!(
18688                WatchMask,
18689                fdomain_client::fidl::FDomainResourceDialect,
18690                &mut self.mask,
18691                decoder,
18692                offset + 0,
18693                _depth
18694            )?;
18695            fidl::decode!(
18696                u32,
18697                fdomain_client::fidl::FDomainResourceDialect,
18698                &mut self.options,
18699                decoder,
18700                offset + 4,
18701                _depth
18702            )?;
18703            fidl::decode!(
18704                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18705                fdomain_client::fidl::FDomainResourceDialect,
18706                &mut self.watcher,
18707                decoder,
18708                offset + 8,
18709                _depth
18710            )?;
18711            Ok(())
18712        }
18713    }
18714
18715    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
18716        type Borrowed<'a> = &'a mut Self;
18717        fn take_or_borrow<'a>(
18718            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18719        ) -> Self::Borrowed<'a> {
18720            value
18721        }
18722    }
18723
18724    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
18725        type Owned = Self;
18726
18727        #[inline(always)]
18728        fn inline_align(_context: fidl::encoding::Context) -> usize {
18729            8
18730        }
18731
18732        #[inline(always)]
18733        fn inline_size(_context: fidl::encoding::Context) -> usize {
18734            24
18735        }
18736    }
18737
18738    unsafe impl
18739        fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18740        for &mut FileAllocateRequest
18741    {
18742        #[inline]
18743        unsafe fn encode(
18744            self,
18745            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18746            offset: usize,
18747            _depth: fidl::encoding::Depth,
18748        ) -> fidl::Result<()> {
18749            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18750            // Delegate to tuple encoding.
18751            fidl::encoding::Encode::<
18752                FileAllocateRequest,
18753                fdomain_client::fidl::FDomainResourceDialect,
18754            >::encode(
18755                (
18756                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
18757                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
18758                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
18759                ),
18760                encoder,
18761                offset,
18762                _depth,
18763            )
18764        }
18765    }
18766    unsafe impl<
18767        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18768        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18769        T2: fidl::encoding::Encode<AllocateMode, fdomain_client::fidl::FDomainResourceDialect>,
18770    > fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18771        for (T0, T1, T2)
18772    {
18773        #[inline]
18774        unsafe fn encode(
18775            self,
18776            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18777            offset: usize,
18778            depth: fidl::encoding::Depth,
18779        ) -> fidl::Result<()> {
18780            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18781            // Zero out padding regions. There's no need to apply masks
18782            // because the unmasked parts will be overwritten by fields.
18783            unsafe {
18784                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18785                (ptr as *mut u64).write_unaligned(0);
18786            }
18787            // Write the fields.
18788            self.0.encode(encoder, offset + 0, depth)?;
18789            self.1.encode(encoder, offset + 8, depth)?;
18790            self.2.encode(encoder, offset + 16, depth)?;
18791            Ok(())
18792        }
18793    }
18794
18795    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18796        for FileAllocateRequest
18797    {
18798        #[inline(always)]
18799        fn new_empty() -> Self {
18800            Self {
18801                offset: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18802                length: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18803                mode: fidl::new_empty!(AllocateMode, fdomain_client::fidl::FDomainResourceDialect),
18804            }
18805        }
18806
18807        #[inline]
18808        unsafe fn decode(
18809            &mut self,
18810            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18811            offset: usize,
18812            _depth: fidl::encoding::Depth,
18813        ) -> fidl::Result<()> {
18814            decoder.debug_check_bounds::<Self>(offset);
18815            // Verify that padding bytes are zero.
18816            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18817            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18818            let mask = 0xffffffff00000000u64;
18819            let maskedval = padval & mask;
18820            if maskedval != 0 {
18821                return Err(fidl::Error::NonZeroPadding {
18822                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18823                });
18824            }
18825            fidl::decode!(
18826                u64,
18827                fdomain_client::fidl::FDomainResourceDialect,
18828                &mut self.offset,
18829                decoder,
18830                offset + 0,
18831                _depth
18832            )?;
18833            fidl::decode!(
18834                u64,
18835                fdomain_client::fidl::FDomainResourceDialect,
18836                &mut self.length,
18837                decoder,
18838                offset + 8,
18839                _depth
18840            )?;
18841            fidl::decode!(
18842                AllocateMode,
18843                fdomain_client::fidl::FDomainResourceDialect,
18844                &mut self.mode,
18845                decoder,
18846                offset + 16,
18847                _depth
18848            )?;
18849            Ok(())
18850        }
18851    }
18852
18853    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
18854        type Borrowed<'a> = &'a mut Self;
18855        fn take_or_borrow<'a>(
18856            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18857        ) -> Self::Borrowed<'a> {
18858            value
18859        }
18860    }
18861
18862    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
18863        type Owned = Self;
18864
18865        #[inline(always)]
18866        fn inline_align(_context: fidl::encoding::Context) -> usize {
18867            8
18868        }
18869
18870        #[inline(always)]
18871        fn inline_size(_context: fidl::encoding::Context) -> usize {
18872            16
18873        }
18874    }
18875
18876    unsafe impl
18877        fidl::encoding::Encode<
18878            FileEnableVerityRequest,
18879            fdomain_client::fidl::FDomainResourceDialect,
18880        > for &mut FileEnableVerityRequest
18881    {
18882        #[inline]
18883        unsafe fn encode(
18884            self,
18885            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18886            offset: usize,
18887            _depth: fidl::encoding::Depth,
18888        ) -> fidl::Result<()> {
18889            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18890            // Delegate to tuple encoding.
18891            fidl::encoding::Encode::<
18892                FileEnableVerityRequest,
18893                fdomain_client::fidl::FDomainResourceDialect,
18894            >::encode(
18895                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
18896                encoder,
18897                offset,
18898                _depth,
18899            )
18900        }
18901    }
18902    unsafe impl<
18903        T0: fidl::encoding::Encode<VerificationOptions, fdomain_client::fidl::FDomainResourceDialect>,
18904    >
18905        fidl::encoding::Encode<
18906            FileEnableVerityRequest,
18907            fdomain_client::fidl::FDomainResourceDialect,
18908        > for (T0,)
18909    {
18910        #[inline]
18911        unsafe fn encode(
18912            self,
18913            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18914            offset: usize,
18915            depth: fidl::encoding::Depth,
18916        ) -> fidl::Result<()> {
18917            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18918            // Zero out padding regions. There's no need to apply masks
18919            // because the unmasked parts will be overwritten by fields.
18920            // Write the fields.
18921            self.0.encode(encoder, offset + 0, depth)?;
18922            Ok(())
18923        }
18924    }
18925
18926    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18927        for FileEnableVerityRequest
18928    {
18929        #[inline(always)]
18930        fn new_empty() -> Self {
18931            Self {
18932                options: fidl::new_empty!(
18933                    VerificationOptions,
18934                    fdomain_client::fidl::FDomainResourceDialect
18935                ),
18936            }
18937        }
18938
18939        #[inline]
18940        unsafe fn decode(
18941            &mut self,
18942            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18943            offset: usize,
18944            _depth: fidl::encoding::Depth,
18945        ) -> fidl::Result<()> {
18946            decoder.debug_check_bounds::<Self>(offset);
18947            // Verify that padding bytes are zero.
18948            fidl::decode!(
18949                VerificationOptions,
18950                fdomain_client::fidl::FDomainResourceDialect,
18951                &mut self.options,
18952                decoder,
18953                offset + 0,
18954                _depth
18955            )?;
18956            Ok(())
18957        }
18958    }
18959
18960    impl fidl::encoding::ResourceTypeMarker for FileObject {
18961        type Borrowed<'a> = &'a mut Self;
18962        fn take_or_borrow<'a>(
18963            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18964        ) -> Self::Borrowed<'a> {
18965            value
18966        }
18967    }
18968
18969    unsafe impl fidl::encoding::TypeMarker for FileObject {
18970        type Owned = Self;
18971
18972        #[inline(always)]
18973        fn inline_align(_context: fidl::encoding::Context) -> usize {
18974            4
18975        }
18976
18977        #[inline(always)]
18978        fn inline_size(_context: fidl::encoding::Context) -> usize {
18979            8
18980        }
18981    }
18982
18983    unsafe impl fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18984        for &mut FileObject
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::<FileObject>(offset);
18994            // Delegate to tuple encoding.
18995            fidl::encoding::Encode::<FileObject, fdomain_client::fidl::FDomainResourceDialect>::encode(
18996                (
18997                    <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),
18998                    <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),
18999                ),
19000                encoder, offset, _depth
19001            )
19002        }
19003    }
19004    unsafe impl<
19005        T0: fidl::encoding::Encode<
19006                fidl::encoding::Optional<
19007                    fidl::encoding::HandleType<
19008                        fdomain_client::Event,
19009                        { fidl::ObjectType::EVENT.into_raw() },
19010                        2147483648,
19011                    >,
19012                >,
19013                fdomain_client::fidl::FDomainResourceDialect,
19014            >,
19015        T1: fidl::encoding::Encode<
19016                fidl::encoding::Optional<
19017                    fidl::encoding::HandleType<
19018                        fdomain_client::Stream,
19019                        { fidl::ObjectType::STREAM.into_raw() },
19020                        2147483648,
19021                    >,
19022                >,
19023                fdomain_client::fidl::FDomainResourceDialect,
19024            >,
19025    > fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
19026        for (T0, T1)
19027    {
19028        #[inline]
19029        unsafe fn encode(
19030            self,
19031            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19032            offset: usize,
19033            depth: fidl::encoding::Depth,
19034        ) -> fidl::Result<()> {
19035            encoder.debug_check_bounds::<FileObject>(offset);
19036            // Zero out padding regions. There's no need to apply masks
19037            // because the unmasked parts will be overwritten by fields.
19038            // Write the fields.
19039            self.0.encode(encoder, offset + 0, depth)?;
19040            self.1.encode(encoder, offset + 4, depth)?;
19041            Ok(())
19042        }
19043    }
19044
19045    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileObject {
19046        #[inline(always)]
19047        fn new_empty() -> Self {
19048            Self {
19049                event: fidl::new_empty!(
19050                    fidl::encoding::Optional<
19051                        fidl::encoding::HandleType<
19052                            fdomain_client::Event,
19053                            { fidl::ObjectType::EVENT.into_raw() },
19054                            2147483648,
19055                        >,
19056                    >,
19057                    fdomain_client::fidl::FDomainResourceDialect
19058                ),
19059                stream: fidl::new_empty!(
19060                    fidl::encoding::Optional<
19061                        fidl::encoding::HandleType<
19062                            fdomain_client::Stream,
19063                            { fidl::ObjectType::STREAM.into_raw() },
19064                            2147483648,
19065                        >,
19066                    >,
19067                    fdomain_client::fidl::FDomainResourceDialect
19068                ),
19069            }
19070        }
19071
19072        #[inline]
19073        unsafe fn decode(
19074            &mut self,
19075            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19076            offset: usize,
19077            _depth: fidl::encoding::Depth,
19078        ) -> fidl::Result<()> {
19079            decoder.debug_check_bounds::<Self>(offset);
19080            // Verify that padding bytes are zero.
19081            fidl::decode!(
19082                fidl::encoding::Optional<
19083                    fidl::encoding::HandleType<
19084                        fdomain_client::Event,
19085                        { fidl::ObjectType::EVENT.into_raw() },
19086                        2147483648,
19087                    >,
19088                >,
19089                fdomain_client::fidl::FDomainResourceDialect,
19090                &mut self.event,
19091                decoder,
19092                offset + 0,
19093                _depth
19094            )?;
19095            fidl::decode!(
19096                fidl::encoding::Optional<
19097                    fidl::encoding::HandleType<
19098                        fdomain_client::Stream,
19099                        { fidl::ObjectType::STREAM.into_raw() },
19100                        2147483648,
19101                    >,
19102                >,
19103                fdomain_client::fidl::FDomainResourceDialect,
19104                &mut self.stream,
19105                decoder,
19106                offset + 4,
19107                _depth
19108            )?;
19109            Ok(())
19110        }
19111    }
19112
19113    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
19114        type Borrowed<'a> = &'a mut Self;
19115        fn take_or_borrow<'a>(
19116            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19117        ) -> Self::Borrowed<'a> {
19118            value
19119        }
19120    }
19121
19122    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
19123        type Owned = Self;
19124
19125        #[inline(always)]
19126        fn inline_align(_context: fidl::encoding::Context) -> usize {
19127            4
19128        }
19129
19130        #[inline(always)]
19131        fn inline_size(_context: fidl::encoding::Context) -> usize {
19132            4
19133        }
19134    }
19135
19136    unsafe impl
19137        fidl::encoding::Encode<
19138            FileGetBackingMemoryResponse,
19139            fdomain_client::fidl::FDomainResourceDialect,
19140        > for &mut FileGetBackingMemoryResponse
19141    {
19142        #[inline]
19143        unsafe fn encode(
19144            self,
19145            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19146            offset: usize,
19147            _depth: fidl::encoding::Depth,
19148        ) -> fidl::Result<()> {
19149            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19150            // Delegate to tuple encoding.
19151            fidl::encoding::Encode::<
19152                FileGetBackingMemoryResponse,
19153                fdomain_client::fidl::FDomainResourceDialect,
19154            >::encode(
19155                (<fidl::encoding::HandleType<
19156                    fdomain_client::Vmo,
19157                    { fidl::ObjectType::VMO.into_raw() },
19158                    2147483648,
19159                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19160                    &mut self.vmo
19161                ),),
19162                encoder,
19163                offset,
19164                _depth,
19165            )
19166        }
19167    }
19168    unsafe impl<
19169        T0: fidl::encoding::Encode<
19170                fidl::encoding::HandleType<
19171                    fdomain_client::Vmo,
19172                    { fidl::ObjectType::VMO.into_raw() },
19173                    2147483648,
19174                >,
19175                fdomain_client::fidl::FDomainResourceDialect,
19176            >,
19177    >
19178        fidl::encoding::Encode<
19179            FileGetBackingMemoryResponse,
19180            fdomain_client::fidl::FDomainResourceDialect,
19181        > for (T0,)
19182    {
19183        #[inline]
19184        unsafe fn encode(
19185            self,
19186            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19187            offset: usize,
19188            depth: fidl::encoding::Depth,
19189        ) -> fidl::Result<()> {
19190            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19191            // Zero out padding regions. There's no need to apply masks
19192            // because the unmasked parts will be overwritten by fields.
19193            // Write the fields.
19194            self.0.encode(encoder, offset + 0, depth)?;
19195            Ok(())
19196        }
19197    }
19198
19199    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19200        for FileGetBackingMemoryResponse
19201    {
19202        #[inline(always)]
19203        fn new_empty() -> Self {
19204            Self {
19205                vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19206            }
19207        }
19208
19209        #[inline]
19210        unsafe fn decode(
19211            &mut self,
19212            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19213            offset: usize,
19214            _depth: fidl::encoding::Depth,
19215        ) -> fidl::Result<()> {
19216            decoder.debug_check_bounds::<Self>(offset);
19217            // Verify that padding bytes are zero.
19218            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)?;
19219            Ok(())
19220        }
19221    }
19222
19223    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
19224        type Borrowed<'a> = &'a mut Self;
19225        fn take_or_borrow<'a>(
19226            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19227        ) -> Self::Borrowed<'a> {
19228            value
19229        }
19230    }
19231
19232    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
19233        type Owned = Self;
19234
19235        #[inline(always)]
19236        fn inline_align(_context: fidl::encoding::Context) -> usize {
19237            8
19238        }
19239
19240        #[inline(always)]
19241        fn inline_size(_context: fidl::encoding::Context) -> usize {
19242            24
19243        }
19244    }
19245
19246    unsafe impl
19247        fidl::encoding::Encode<
19248            LinkableLinkIntoRequest,
19249            fdomain_client::fidl::FDomainResourceDialect,
19250        > for &mut LinkableLinkIntoRequest
19251    {
19252        #[inline]
19253        unsafe fn encode(
19254            self,
19255            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19256            offset: usize,
19257            _depth: fidl::encoding::Depth,
19258        ) -> fidl::Result<()> {
19259            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19260            // Delegate to tuple encoding.
19261            fidl::encoding::Encode::<
19262                LinkableLinkIntoRequest,
19263                fdomain_client::fidl::FDomainResourceDialect,
19264            >::encode(
19265                (
19266                    <fidl::encoding::HandleType<
19267                        fdomain_client::Event,
19268                        { fidl::ObjectType::EVENT.into_raw() },
19269                        2147483648,
19270                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19271                        &mut self.dst_parent_token,
19272                    ),
19273                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
19274                        &self.dst,
19275                    ),
19276                ),
19277                encoder,
19278                offset,
19279                _depth,
19280            )
19281        }
19282    }
19283    unsafe impl<
19284        T0: fidl::encoding::Encode<
19285                fidl::encoding::HandleType<
19286                    fdomain_client::Event,
19287                    { fidl::ObjectType::EVENT.into_raw() },
19288                    2147483648,
19289                >,
19290                fdomain_client::fidl::FDomainResourceDialect,
19291            >,
19292        T1: fidl::encoding::Encode<
19293                fidl::encoding::BoundedString<255>,
19294                fdomain_client::fidl::FDomainResourceDialect,
19295            >,
19296    >
19297        fidl::encoding::Encode<
19298            LinkableLinkIntoRequest,
19299            fdomain_client::fidl::FDomainResourceDialect,
19300        > for (T0, T1)
19301    {
19302        #[inline]
19303        unsafe fn encode(
19304            self,
19305            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19306            offset: usize,
19307            depth: fidl::encoding::Depth,
19308        ) -> fidl::Result<()> {
19309            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19310            // Zero out padding regions. There's no need to apply masks
19311            // because the unmasked parts will be overwritten by fields.
19312            unsafe {
19313                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19314                (ptr as *mut u64).write_unaligned(0);
19315            }
19316            // Write the fields.
19317            self.0.encode(encoder, offset + 0, depth)?;
19318            self.1.encode(encoder, offset + 8, depth)?;
19319            Ok(())
19320        }
19321    }
19322
19323    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19324        for LinkableLinkIntoRequest
19325    {
19326        #[inline(always)]
19327        fn new_empty() -> Self {
19328            Self {
19329                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19330                dst: fidl::new_empty!(
19331                    fidl::encoding::BoundedString<255>,
19332                    fdomain_client::fidl::FDomainResourceDialect
19333                ),
19334            }
19335        }
19336
19337        #[inline]
19338        unsafe fn decode(
19339            &mut self,
19340            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19341            offset: usize,
19342            _depth: fidl::encoding::Depth,
19343        ) -> fidl::Result<()> {
19344            decoder.debug_check_bounds::<Self>(offset);
19345            // Verify that padding bytes are zero.
19346            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19347            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19348            let mask = 0xffffffff00000000u64;
19349            let maskedval = padval & mask;
19350            if maskedval != 0 {
19351                return Err(fidl::Error::NonZeroPadding {
19352                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19353                });
19354            }
19355            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)?;
19356            fidl::decode!(
19357                fidl::encoding::BoundedString<255>,
19358                fdomain_client::fidl::FDomainResourceDialect,
19359                &mut self.dst,
19360                decoder,
19361                offset + 8,
19362                _depth
19363            )?;
19364            Ok(())
19365        }
19366    }
19367
19368    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
19369        type Borrowed<'a> = &'a mut Self;
19370        fn take_or_borrow<'a>(
19371            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19372        ) -> Self::Borrowed<'a> {
19373            value
19374        }
19375    }
19376
19377    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
19378        type Owned = Self;
19379
19380        #[inline(always)]
19381        fn inline_align(_context: fidl::encoding::Context) -> usize {
19382            4
19383        }
19384
19385        #[inline(always)]
19386        fn inline_size(_context: fidl::encoding::Context) -> usize {
19387            8
19388        }
19389    }
19390
19391    unsafe impl
19392        fidl::encoding::Encode<
19393            NodeDeprecatedCloneRequest,
19394            fdomain_client::fidl::FDomainResourceDialect,
19395        > for &mut NodeDeprecatedCloneRequest
19396    {
19397        #[inline]
19398        unsafe fn encode(
19399            self,
19400            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19401            offset: usize,
19402            _depth: fidl::encoding::Depth,
19403        ) -> fidl::Result<()> {
19404            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19405            // Delegate to tuple encoding.
19406            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19407                (
19408                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
19409                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
19410                ),
19411                encoder, offset, _depth
19412            )
19413        }
19414    }
19415    unsafe impl<
19416        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
19417        T1: fidl::encoding::Encode<
19418                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19419                fdomain_client::fidl::FDomainResourceDialect,
19420            >,
19421    >
19422        fidl::encoding::Encode<
19423            NodeDeprecatedCloneRequest,
19424            fdomain_client::fidl::FDomainResourceDialect,
19425        > for (T0, T1)
19426    {
19427        #[inline]
19428        unsafe fn encode(
19429            self,
19430            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19431            offset: usize,
19432            depth: fidl::encoding::Depth,
19433        ) -> fidl::Result<()> {
19434            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19435            // Zero out padding regions. There's no need to apply masks
19436            // because the unmasked parts will be overwritten by fields.
19437            // Write the fields.
19438            self.0.encode(encoder, offset + 0, depth)?;
19439            self.1.encode(encoder, offset + 4, depth)?;
19440            Ok(())
19441        }
19442    }
19443
19444    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19445        for NodeDeprecatedCloneRequest
19446    {
19447        #[inline(always)]
19448        fn new_empty() -> Self {
19449            Self {
19450                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
19451                object: fidl::new_empty!(
19452                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19453                    fdomain_client::fidl::FDomainResourceDialect
19454                ),
19455            }
19456        }
19457
19458        #[inline]
19459        unsafe fn decode(
19460            &mut self,
19461            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19462            offset: usize,
19463            _depth: fidl::encoding::Depth,
19464        ) -> fidl::Result<()> {
19465            decoder.debug_check_bounds::<Self>(offset);
19466            // Verify that padding bytes are zero.
19467            fidl::decode!(
19468                OpenFlags,
19469                fdomain_client::fidl::FDomainResourceDialect,
19470                &mut self.flags,
19471                decoder,
19472                offset + 0,
19473                _depth
19474            )?;
19475            fidl::decode!(
19476                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19477                fdomain_client::fidl::FDomainResourceDialect,
19478                &mut self.object,
19479                decoder,
19480                offset + 4,
19481                _depth
19482            )?;
19483            Ok(())
19484        }
19485    }
19486
19487    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
19488        type Borrowed<'a> = &'a mut Self;
19489        fn take_or_borrow<'a>(
19490            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19491        ) -> Self::Borrowed<'a> {
19492            value
19493        }
19494    }
19495
19496    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
19497        type Owned = Self;
19498
19499        #[inline(always)]
19500        fn inline_align(_context: fidl::encoding::Context) -> usize {
19501            4
19502        }
19503
19504        #[inline(always)]
19505        fn inline_size(_context: fidl::encoding::Context) -> usize {
19506            4
19507        }
19508    }
19509
19510    unsafe impl
19511        fidl::encoding::Encode<
19512            NodeListExtendedAttributesRequest,
19513            fdomain_client::fidl::FDomainResourceDialect,
19514        > for &mut NodeListExtendedAttributesRequest
19515    {
19516        #[inline]
19517        unsafe fn encode(
19518            self,
19519            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19520            offset: usize,
19521            _depth: fidl::encoding::Depth,
19522        ) -> fidl::Result<()> {
19523            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19524            // Delegate to tuple encoding.
19525            fidl::encoding::Encode::<
19526                NodeListExtendedAttributesRequest,
19527                fdomain_client::fidl::FDomainResourceDialect,
19528            >::encode(
19529                (<fidl::encoding::Endpoint<
19530                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19531                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19532                    &mut self.iterator
19533                ),),
19534                encoder,
19535                offset,
19536                _depth,
19537            )
19538        }
19539    }
19540    unsafe impl<
19541        T0: fidl::encoding::Encode<
19542                fidl::encoding::Endpoint<
19543                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19544                >,
19545                fdomain_client::fidl::FDomainResourceDialect,
19546            >,
19547    >
19548        fidl::encoding::Encode<
19549            NodeListExtendedAttributesRequest,
19550            fdomain_client::fidl::FDomainResourceDialect,
19551        > for (T0,)
19552    {
19553        #[inline]
19554        unsafe fn encode(
19555            self,
19556            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19557            offset: usize,
19558            depth: fidl::encoding::Depth,
19559        ) -> fidl::Result<()> {
19560            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19561            // Zero out padding regions. There's no need to apply masks
19562            // because the unmasked parts will be overwritten by fields.
19563            // Write the fields.
19564            self.0.encode(encoder, offset + 0, depth)?;
19565            Ok(())
19566        }
19567    }
19568
19569    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19570        for NodeListExtendedAttributesRequest
19571    {
19572        #[inline(always)]
19573        fn new_empty() -> Self {
19574            Self {
19575                iterator: fidl::new_empty!(
19576                    fidl::encoding::Endpoint<
19577                        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19578                    >,
19579                    fdomain_client::fidl::FDomainResourceDialect
19580                ),
19581            }
19582        }
19583
19584        #[inline]
19585        unsafe fn decode(
19586            &mut self,
19587            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19588            offset: usize,
19589            _depth: fidl::encoding::Depth,
19590        ) -> fidl::Result<()> {
19591            decoder.debug_check_bounds::<Self>(offset);
19592            // Verify that padding bytes are zero.
19593            fidl::decode!(
19594                fidl::encoding::Endpoint<
19595                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19596                >,
19597                fdomain_client::fidl::FDomainResourceDialect,
19598                &mut self.iterator,
19599                decoder,
19600                offset + 0,
19601                _depth
19602            )?;
19603            Ok(())
19604        }
19605    }
19606
19607    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
19608        type Borrowed<'a> = &'a mut Self;
19609        fn take_or_borrow<'a>(
19610            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19611        ) -> Self::Borrowed<'a> {
19612            value
19613        }
19614    }
19615
19616    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
19617        type Owned = Self;
19618
19619        #[inline(always)]
19620        fn inline_align(_context: fidl::encoding::Context) -> usize {
19621            8
19622        }
19623
19624        #[inline(always)]
19625        fn inline_size(_context: fidl::encoding::Context) -> usize {
19626            24
19627        }
19628    }
19629
19630    unsafe impl
19631        fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19632        for &mut NodeOnOpenRequest
19633    {
19634        #[inline]
19635        unsafe fn encode(
19636            self,
19637            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19638            offset: usize,
19639            _depth: fidl::encoding::Depth,
19640        ) -> fidl::Result<()> {
19641            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19642            // Delegate to tuple encoding.
19643            fidl::encoding::Encode::<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19644                (
19645                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
19646                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
19647                ),
19648                encoder, offset, _depth
19649            )
19650        }
19651    }
19652    unsafe impl<
19653        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
19654        T1: fidl::encoding::Encode<
19655                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19656                fdomain_client::fidl::FDomainResourceDialect,
19657            >,
19658    > fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19659        for (T0, T1)
19660    {
19661        #[inline]
19662        unsafe fn encode(
19663            self,
19664            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19665            offset: usize,
19666            depth: fidl::encoding::Depth,
19667        ) -> fidl::Result<()> {
19668            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19669            // Zero out padding regions. There's no need to apply masks
19670            // because the unmasked parts will be overwritten by fields.
19671            unsafe {
19672                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19673                (ptr as *mut u64).write_unaligned(0);
19674            }
19675            // Write the fields.
19676            self.0.encode(encoder, offset + 0, depth)?;
19677            self.1.encode(encoder, offset + 8, depth)?;
19678            Ok(())
19679        }
19680    }
19681
19682    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19683        for NodeOnOpenRequest
19684    {
19685        #[inline(always)]
19686        fn new_empty() -> Self {
19687            Self {
19688                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
19689                info: fidl::new_empty!(
19690                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19691                    fdomain_client::fidl::FDomainResourceDialect
19692                ),
19693            }
19694        }
19695
19696        #[inline]
19697        unsafe fn decode(
19698            &mut self,
19699            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19700            offset: usize,
19701            _depth: fidl::encoding::Depth,
19702        ) -> fidl::Result<()> {
19703            decoder.debug_check_bounds::<Self>(offset);
19704            // Verify that padding bytes are zero.
19705            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19706            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19707            let mask = 0xffffffff00000000u64;
19708            let maskedval = padval & mask;
19709            if maskedval != 0 {
19710                return Err(fidl::Error::NonZeroPadding {
19711                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19712                });
19713            }
19714            fidl::decode!(
19715                i32,
19716                fdomain_client::fidl::FDomainResourceDialect,
19717                &mut self.s,
19718                decoder,
19719                offset + 0,
19720                _depth
19721            )?;
19722            fidl::decode!(
19723                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19724                fdomain_client::fidl::FDomainResourceDialect,
19725                &mut self.info,
19726                decoder,
19727                offset + 8,
19728                _depth
19729            )?;
19730            Ok(())
19731        }
19732    }
19733
19734    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
19735        type Borrowed<'a> = &'a mut Self;
19736        fn take_or_borrow<'a>(
19737            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19738        ) -> Self::Borrowed<'a> {
19739            value
19740        }
19741    }
19742
19743    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
19744        type Owned = Self;
19745
19746        #[inline(always)]
19747        fn inline_align(_context: fidl::encoding::Context) -> usize {
19748            8
19749        }
19750
19751        #[inline(always)]
19752        fn inline_size(_context: fidl::encoding::Context) -> usize {
19753            40
19754        }
19755    }
19756
19757    unsafe impl
19758        fidl::encoding::Encode<
19759            NodeSetExtendedAttributeRequest,
19760            fdomain_client::fidl::FDomainResourceDialect,
19761        > for &mut NodeSetExtendedAttributeRequest
19762    {
19763        #[inline]
19764        unsafe fn encode(
19765            self,
19766            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19767            offset: usize,
19768            _depth: fidl::encoding::Depth,
19769        ) -> fidl::Result<()> {
19770            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19771            // Delegate to tuple encoding.
19772            fidl::encoding::Encode::<
19773                NodeSetExtendedAttributeRequest,
19774                fdomain_client::fidl::FDomainResourceDialect,
19775            >::encode(
19776                (
19777                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
19778                        &self.name,
19779                    ),
19780                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19781                        &mut self.value,
19782                    ),
19783                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
19784                        &self.mode,
19785                    ),
19786                ),
19787                encoder,
19788                offset,
19789                _depth,
19790            )
19791        }
19792    }
19793    unsafe impl<
19794        T0: fidl::encoding::Encode<
19795                fidl::encoding::Vector<u8, 255>,
19796                fdomain_client::fidl::FDomainResourceDialect,
19797            >,
19798        T1: fidl::encoding::Encode<
19799                ExtendedAttributeValue,
19800                fdomain_client::fidl::FDomainResourceDialect,
19801            >,
19802        T2: fidl::encoding::Encode<
19803                SetExtendedAttributeMode,
19804                fdomain_client::fidl::FDomainResourceDialect,
19805            >,
19806    >
19807        fidl::encoding::Encode<
19808            NodeSetExtendedAttributeRequest,
19809            fdomain_client::fidl::FDomainResourceDialect,
19810        > for (T0, T1, T2)
19811    {
19812        #[inline]
19813        unsafe fn encode(
19814            self,
19815            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19816            offset: usize,
19817            depth: fidl::encoding::Depth,
19818        ) -> fidl::Result<()> {
19819            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19820            // Zero out padding regions. There's no need to apply masks
19821            // because the unmasked parts will be overwritten by fields.
19822            unsafe {
19823                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
19824                (ptr as *mut u64).write_unaligned(0);
19825            }
19826            // Write the fields.
19827            self.0.encode(encoder, offset + 0, depth)?;
19828            self.1.encode(encoder, offset + 16, depth)?;
19829            self.2.encode(encoder, offset + 32, depth)?;
19830            Ok(())
19831        }
19832    }
19833
19834    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19835        for NodeSetExtendedAttributeRequest
19836    {
19837        #[inline(always)]
19838        fn new_empty() -> Self {
19839            Self {
19840                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect),
19841                value: fidl::new_empty!(
19842                    ExtendedAttributeValue,
19843                    fdomain_client::fidl::FDomainResourceDialect
19844                ),
19845                mode: fidl::new_empty!(
19846                    SetExtendedAttributeMode,
19847                    fdomain_client::fidl::FDomainResourceDialect
19848                ),
19849            }
19850        }
19851
19852        #[inline]
19853        unsafe fn decode(
19854            &mut self,
19855            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19856            offset: usize,
19857            _depth: fidl::encoding::Depth,
19858        ) -> fidl::Result<()> {
19859            decoder.debug_check_bounds::<Self>(offset);
19860            // Verify that padding bytes are zero.
19861            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
19862            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19863            let mask = 0xffffffff00000000u64;
19864            let maskedval = padval & mask;
19865            if maskedval != 0 {
19866                return Err(fidl::Error::NonZeroPadding {
19867                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
19868                });
19869            }
19870            fidl::decode!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
19871            fidl::decode!(
19872                ExtendedAttributeValue,
19873                fdomain_client::fidl::FDomainResourceDialect,
19874                &mut self.value,
19875                decoder,
19876                offset + 16,
19877                _depth
19878            )?;
19879            fidl::decode!(
19880                SetExtendedAttributeMode,
19881                fdomain_client::fidl::FDomainResourceDialect,
19882                &mut self.mode,
19883                decoder,
19884                offset + 32,
19885                _depth
19886            )?;
19887            Ok(())
19888        }
19889    }
19890
19891    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
19892        type Borrowed<'a> = &'a mut Self;
19893        fn take_or_borrow<'a>(
19894            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19895        ) -> Self::Borrowed<'a> {
19896            value
19897        }
19898    }
19899
19900    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
19901        type Owned = Self;
19902
19903        #[inline(always)]
19904        fn inline_align(_context: fidl::encoding::Context) -> usize {
19905            8
19906        }
19907
19908        #[inline(always)]
19909        fn inline_size(_context: fidl::encoding::Context) -> usize {
19910            48
19911        }
19912    }
19913
19914    unsafe impl
19915        fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19916        for &mut OpenableOpenRequest
19917    {
19918        #[inline]
19919        unsafe fn encode(
19920            self,
19921            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19922            offset: usize,
19923            _depth: fidl::encoding::Depth,
19924        ) -> fidl::Result<()> {
19925            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
19926            // Delegate to tuple encoding.
19927            fidl::encoding::Encode::<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19928                (
19929                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
19930                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
19931                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
19932                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
19933                ),
19934                encoder, offset, _depth
19935            )
19936        }
19937    }
19938    unsafe impl<
19939        T0: fidl::encoding::Encode<
19940                fidl::encoding::BoundedString<4095>,
19941                fdomain_client::fidl::FDomainResourceDialect,
19942            >,
19943        T1: fidl::encoding::Encode<Flags, fdomain_client::fidl::FDomainResourceDialect>,
19944        T2: fidl::encoding::Encode<Options, fdomain_client::fidl::FDomainResourceDialect>,
19945        T3: fidl::encoding::Encode<
19946                fidl::encoding::HandleType<
19947                    fdomain_client::Channel,
19948                    { fidl::ObjectType::CHANNEL.into_raw() },
19949                    2147483648,
19950                >,
19951                fdomain_client::fidl::FDomainResourceDialect,
19952            >,
19953    > fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19954        for (T0, T1, T2, T3)
19955    {
19956        #[inline]
19957        unsafe fn encode(
19958            self,
19959            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19960            offset: usize,
19961            depth: fidl::encoding::Depth,
19962        ) -> fidl::Result<()> {
19963            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
19964            // Zero out padding regions. There's no need to apply masks
19965            // because the unmasked parts will be overwritten by fields.
19966            unsafe {
19967                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
19968                (ptr as *mut u64).write_unaligned(0);
19969            }
19970            // Write the fields.
19971            self.0.encode(encoder, offset + 0, depth)?;
19972            self.1.encode(encoder, offset + 16, depth)?;
19973            self.2.encode(encoder, offset + 24, depth)?;
19974            self.3.encode(encoder, offset + 40, depth)?;
19975            Ok(())
19976        }
19977    }
19978
19979    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19980        for OpenableOpenRequest
19981    {
19982        #[inline(always)]
19983        fn new_empty() -> Self {
19984            Self {
19985                path: fidl::new_empty!(
19986                    fidl::encoding::BoundedString<4095>,
19987                    fdomain_client::fidl::FDomainResourceDialect
19988                ),
19989                flags: fidl::new_empty!(Flags, fdomain_client::fidl::FDomainResourceDialect),
19990                options: fidl::new_empty!(Options, fdomain_client::fidl::FDomainResourceDialect),
19991                object: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19992            }
19993        }
19994
19995        #[inline]
19996        unsafe fn decode(
19997            &mut self,
19998            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19999            offset: usize,
20000            _depth: fidl::encoding::Depth,
20001        ) -> fidl::Result<()> {
20002            decoder.debug_check_bounds::<Self>(offset);
20003            // Verify that padding bytes are zero.
20004            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
20005            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20006            let mask = 0xffffffff00000000u64;
20007            let maskedval = padval & mask;
20008            if maskedval != 0 {
20009                return Err(fidl::Error::NonZeroPadding {
20010                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
20011                });
20012            }
20013            fidl::decode!(
20014                fidl::encoding::BoundedString<4095>,
20015                fdomain_client::fidl::FDomainResourceDialect,
20016                &mut self.path,
20017                decoder,
20018                offset + 0,
20019                _depth
20020            )?;
20021            fidl::decode!(
20022                Flags,
20023                fdomain_client::fidl::FDomainResourceDialect,
20024                &mut self.flags,
20025                decoder,
20026                offset + 16,
20027                _depth
20028            )?;
20029            fidl::decode!(
20030                Options,
20031                fdomain_client::fidl::FDomainResourceDialect,
20032                &mut self.options,
20033                decoder,
20034                offset + 24,
20035                _depth
20036            )?;
20037            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)?;
20038            Ok(())
20039        }
20040    }
20041
20042    impl ConnectionInfo {
20043        #[inline(always)]
20044        fn max_ordinal_present(&self) -> u64 {
20045            if let Some(_) = self.rights {
20046                return 1;
20047            }
20048            0
20049        }
20050    }
20051
20052    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
20053        type Borrowed<'a> = &'a mut Self;
20054        fn take_or_borrow<'a>(
20055            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20056        ) -> Self::Borrowed<'a> {
20057            value
20058        }
20059    }
20060
20061    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
20062        type Owned = Self;
20063
20064        #[inline(always)]
20065        fn inline_align(_context: fidl::encoding::Context) -> usize {
20066            8
20067        }
20068
20069        #[inline(always)]
20070        fn inline_size(_context: fidl::encoding::Context) -> usize {
20071            16
20072        }
20073    }
20074
20075    unsafe impl fidl::encoding::Encode<ConnectionInfo, fdomain_client::fidl::FDomainResourceDialect>
20076        for &mut ConnectionInfo
20077    {
20078        unsafe fn encode(
20079            self,
20080            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20081            offset: usize,
20082            mut depth: fidl::encoding::Depth,
20083        ) -> fidl::Result<()> {
20084            encoder.debug_check_bounds::<ConnectionInfo>(offset);
20085            // Vector header
20086            let max_ordinal: u64 = self.max_ordinal_present();
20087            encoder.write_num(max_ordinal, offset);
20088            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20089            // Calling encoder.out_of_line_offset(0) is not allowed.
20090            if max_ordinal == 0 {
20091                return Ok(());
20092            }
20093            depth.increment()?;
20094            let envelope_size = 8;
20095            let bytes_len = max_ordinal as usize * envelope_size;
20096            #[allow(unused_variables)]
20097            let offset = encoder.out_of_line_offset(bytes_len);
20098            let mut _prev_end_offset: usize = 0;
20099            if 1 > max_ordinal {
20100                return Ok(());
20101            }
20102
20103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20104            // are envelope_size bytes.
20105            let cur_offset: usize = (1 - 1) * envelope_size;
20106
20107            // Zero reserved fields.
20108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20109
20110            // Safety:
20111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20113            //   envelope_size bytes, there is always sufficient room.
20114            fidl::encoding::encode_in_envelope_optional::<
20115                Operations,
20116                fdomain_client::fidl::FDomainResourceDialect,
20117            >(
20118                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
20119                encoder,
20120                offset + cur_offset,
20121                depth,
20122            )?;
20123
20124            _prev_end_offset = cur_offset + envelope_size;
20125
20126            Ok(())
20127        }
20128    }
20129
20130    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {
20131        #[inline(always)]
20132        fn new_empty() -> Self {
20133            Self::default()
20134        }
20135
20136        unsafe fn decode(
20137            &mut self,
20138            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20139            offset: usize,
20140            mut depth: fidl::encoding::Depth,
20141        ) -> fidl::Result<()> {
20142            decoder.debug_check_bounds::<Self>(offset);
20143            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20144                None => return Err(fidl::Error::NotNullable),
20145                Some(len) => len,
20146            };
20147            // Calling decoder.out_of_line_offset(0) is not allowed.
20148            if len == 0 {
20149                return Ok(());
20150            };
20151            depth.increment()?;
20152            let envelope_size = 8;
20153            let bytes_len = len * envelope_size;
20154            let offset = decoder.out_of_line_offset(bytes_len)?;
20155            // Decode the envelope for each type.
20156            let mut _next_ordinal_to_read = 0;
20157            let mut next_offset = offset;
20158            let end_offset = offset + bytes_len;
20159            _next_ordinal_to_read += 1;
20160            if next_offset >= end_offset {
20161                return Ok(());
20162            }
20163
20164            // Decode unknown envelopes for gaps in ordinals.
20165            while _next_ordinal_to_read < 1 {
20166                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20167                _next_ordinal_to_read += 1;
20168                next_offset += envelope_size;
20169            }
20170
20171            let next_out_of_line = decoder.next_out_of_line();
20172            let handles_before = decoder.remaining_handles();
20173            if let Some((inlined, num_bytes, num_handles)) =
20174                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20175            {
20176                let member_inline_size =
20177                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20178                if inlined != (member_inline_size <= 4) {
20179                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20180                }
20181                let inner_offset;
20182                let mut inner_depth = depth.clone();
20183                if inlined {
20184                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20185                    inner_offset = next_offset;
20186                } else {
20187                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20188                    inner_depth.increment()?;
20189                }
20190                let val_ref = self.rights.get_or_insert_with(|| {
20191                    fidl::new_empty!(Operations, fdomain_client::fidl::FDomainResourceDialect)
20192                });
20193                fidl::decode!(
20194                    Operations,
20195                    fdomain_client::fidl::FDomainResourceDialect,
20196                    val_ref,
20197                    decoder,
20198                    inner_offset,
20199                    inner_depth
20200                )?;
20201                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20202                {
20203                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20204                }
20205                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20206                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20207                }
20208            }
20209
20210            next_offset += envelope_size;
20211
20212            // Decode the remaining unknown envelopes.
20213            while next_offset < end_offset {
20214                _next_ordinal_to_read += 1;
20215                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20216                next_offset += envelope_size;
20217            }
20218
20219            Ok(())
20220        }
20221    }
20222
20223    impl FileInfo {
20224        #[inline(always)]
20225        fn max_ordinal_present(&self) -> u64 {
20226            if let Some(_) = self.attributes {
20227                return 4;
20228            }
20229            if let Some(_) = self.stream {
20230                return 3;
20231            }
20232            if let Some(_) = self.observer {
20233                return 2;
20234            }
20235            if let Some(_) = self.is_append {
20236                return 1;
20237            }
20238            0
20239        }
20240    }
20241
20242    impl fidl::encoding::ResourceTypeMarker for FileInfo {
20243        type Borrowed<'a> = &'a mut Self;
20244        fn take_or_borrow<'a>(
20245            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20246        ) -> Self::Borrowed<'a> {
20247            value
20248        }
20249    }
20250
20251    unsafe impl fidl::encoding::TypeMarker for FileInfo {
20252        type Owned = Self;
20253
20254        #[inline(always)]
20255        fn inline_align(_context: fidl::encoding::Context) -> usize {
20256            8
20257        }
20258
20259        #[inline(always)]
20260        fn inline_size(_context: fidl::encoding::Context) -> usize {
20261            16
20262        }
20263    }
20264
20265    unsafe impl fidl::encoding::Encode<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
20266        for &mut FileInfo
20267    {
20268        unsafe fn encode(
20269            self,
20270            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20271            offset: usize,
20272            mut depth: fidl::encoding::Depth,
20273        ) -> fidl::Result<()> {
20274            encoder.debug_check_bounds::<FileInfo>(offset);
20275            // Vector header
20276            let max_ordinal: u64 = self.max_ordinal_present();
20277            encoder.write_num(max_ordinal, offset);
20278            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20279            // Calling encoder.out_of_line_offset(0) is not allowed.
20280            if max_ordinal == 0 {
20281                return Ok(());
20282            }
20283            depth.increment()?;
20284            let envelope_size = 8;
20285            let bytes_len = max_ordinal as usize * envelope_size;
20286            #[allow(unused_variables)]
20287            let offset = encoder.out_of_line_offset(bytes_len);
20288            let mut _prev_end_offset: usize = 0;
20289            if 1 > max_ordinal {
20290                return Ok(());
20291            }
20292
20293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20294            // are envelope_size bytes.
20295            let cur_offset: usize = (1 - 1) * envelope_size;
20296
20297            // Zero reserved fields.
20298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20299
20300            // Safety:
20301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20303            //   envelope_size bytes, there is always sufficient room.
20304            fidl::encoding::encode_in_envelope_optional::<
20305                bool,
20306                fdomain_client::fidl::FDomainResourceDialect,
20307            >(
20308                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20309                encoder,
20310                offset + cur_offset,
20311                depth,
20312            )?;
20313
20314            _prev_end_offset = cur_offset + envelope_size;
20315            if 2 > max_ordinal {
20316                return Ok(());
20317            }
20318
20319            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20320            // are envelope_size bytes.
20321            let cur_offset: usize = (2 - 1) * envelope_size;
20322
20323            // Zero reserved fields.
20324            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20325
20326            // Safety:
20327            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20328            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20329            //   envelope_size bytes, there is always sufficient room.
20330            fidl::encoding::encode_in_envelope_optional::<
20331                fidl::encoding::HandleType<
20332                    fdomain_client::Event,
20333                    { fidl::ObjectType::EVENT.into_raw() },
20334                    2147483648,
20335                >,
20336                fdomain_client::fidl::FDomainResourceDialect,
20337            >(
20338                self.observer.as_mut().map(
20339                    <fidl::encoding::HandleType<
20340                        fdomain_client::Event,
20341                        { fidl::ObjectType::EVENT.into_raw() },
20342                        2147483648,
20343                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20344                ),
20345                encoder,
20346                offset + cur_offset,
20347                depth,
20348            )?;
20349
20350            _prev_end_offset = cur_offset + envelope_size;
20351            if 3 > max_ordinal {
20352                return Ok(());
20353            }
20354
20355            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20356            // are envelope_size bytes.
20357            let cur_offset: usize = (3 - 1) * envelope_size;
20358
20359            // Zero reserved fields.
20360            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20361
20362            // Safety:
20363            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20364            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20365            //   envelope_size bytes, there is always sufficient room.
20366            fidl::encoding::encode_in_envelope_optional::<
20367                fidl::encoding::HandleType<
20368                    fdomain_client::Stream,
20369                    { fidl::ObjectType::STREAM.into_raw() },
20370                    2147483648,
20371                >,
20372                fdomain_client::fidl::FDomainResourceDialect,
20373            >(
20374                self.stream.as_mut().map(
20375                    <fidl::encoding::HandleType<
20376                        fdomain_client::Stream,
20377                        { fidl::ObjectType::STREAM.into_raw() },
20378                        2147483648,
20379                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20380                ),
20381                encoder,
20382                offset + cur_offset,
20383                depth,
20384            )?;
20385
20386            _prev_end_offset = cur_offset + envelope_size;
20387            if 4 > max_ordinal {
20388                return Ok(());
20389            }
20390
20391            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20392            // are envelope_size bytes.
20393            let cur_offset: usize = (4 - 1) * envelope_size;
20394
20395            // Zero reserved fields.
20396            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20397
20398            // Safety:
20399            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20400            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20401            //   envelope_size bytes, there is always sufficient room.
20402            fidl::encoding::encode_in_envelope_optional::<
20403                NodeAttributes2,
20404                fdomain_client::fidl::FDomainResourceDialect,
20405            >(
20406                self.attributes
20407                    .as_ref()
20408                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
20409                encoder,
20410                offset + cur_offset,
20411                depth,
20412            )?;
20413
20414            _prev_end_offset = cur_offset + envelope_size;
20415
20416            Ok(())
20417        }
20418    }
20419
20420    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileInfo {
20421        #[inline(always)]
20422        fn new_empty() -> Self {
20423            Self::default()
20424        }
20425
20426        unsafe fn decode(
20427            &mut self,
20428            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20429            offset: usize,
20430            mut depth: fidl::encoding::Depth,
20431        ) -> fidl::Result<()> {
20432            decoder.debug_check_bounds::<Self>(offset);
20433            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20434                None => return Err(fidl::Error::NotNullable),
20435                Some(len) => len,
20436            };
20437            // Calling decoder.out_of_line_offset(0) is not allowed.
20438            if len == 0 {
20439                return Ok(());
20440            };
20441            depth.increment()?;
20442            let envelope_size = 8;
20443            let bytes_len = len * envelope_size;
20444            let offset = decoder.out_of_line_offset(bytes_len)?;
20445            // Decode the envelope for each type.
20446            let mut _next_ordinal_to_read = 0;
20447            let mut next_offset = offset;
20448            let end_offset = offset + bytes_len;
20449            _next_ordinal_to_read += 1;
20450            if next_offset >= end_offset {
20451                return Ok(());
20452            }
20453
20454            // Decode unknown envelopes for gaps in ordinals.
20455            while _next_ordinal_to_read < 1 {
20456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20457                _next_ordinal_to_read += 1;
20458                next_offset += envelope_size;
20459            }
20460
20461            let next_out_of_line = decoder.next_out_of_line();
20462            let handles_before = decoder.remaining_handles();
20463            if let Some((inlined, num_bytes, num_handles)) =
20464                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20465            {
20466                let member_inline_size =
20467                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20468                if inlined != (member_inline_size <= 4) {
20469                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20470                }
20471                let inner_offset;
20472                let mut inner_depth = depth.clone();
20473                if inlined {
20474                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20475                    inner_offset = next_offset;
20476                } else {
20477                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20478                    inner_depth.increment()?;
20479                }
20480                let val_ref = self.is_append.get_or_insert_with(|| {
20481                    fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect)
20482                });
20483                fidl::decode!(
20484                    bool,
20485                    fdomain_client::fidl::FDomainResourceDialect,
20486                    val_ref,
20487                    decoder,
20488                    inner_offset,
20489                    inner_depth
20490                )?;
20491                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20492                {
20493                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20494                }
20495                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20496                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20497                }
20498            }
20499
20500            next_offset += envelope_size;
20501            _next_ordinal_to_read += 1;
20502            if next_offset >= end_offset {
20503                return Ok(());
20504            }
20505
20506            // Decode unknown envelopes for gaps in ordinals.
20507            while _next_ordinal_to_read < 2 {
20508                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20509                _next_ordinal_to_read += 1;
20510                next_offset += envelope_size;
20511            }
20512
20513            let next_out_of_line = decoder.next_out_of_line();
20514            let handles_before = decoder.remaining_handles();
20515            if let Some((inlined, num_bytes, num_handles)) =
20516                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20517            {
20518                let member_inline_size = <fidl::encoding::HandleType<
20519                    fdomain_client::Event,
20520                    { fidl::ObjectType::EVENT.into_raw() },
20521                    2147483648,
20522                > as fidl::encoding::TypeMarker>::inline_size(
20523                    decoder.context
20524                );
20525                if inlined != (member_inline_size <= 4) {
20526                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20527                }
20528                let inner_offset;
20529                let mut inner_depth = depth.clone();
20530                if inlined {
20531                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20532                    inner_offset = next_offset;
20533                } else {
20534                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20535                    inner_depth.increment()?;
20536                }
20537                let val_ref =
20538                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));
20539                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)?;
20540                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20541                {
20542                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20543                }
20544                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20545                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20546                }
20547            }
20548
20549            next_offset += envelope_size;
20550            _next_ordinal_to_read += 1;
20551            if next_offset >= end_offset {
20552                return Ok(());
20553            }
20554
20555            // Decode unknown envelopes for gaps in ordinals.
20556            while _next_ordinal_to_read < 3 {
20557                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20558                _next_ordinal_to_read += 1;
20559                next_offset += envelope_size;
20560            }
20561
20562            let next_out_of_line = decoder.next_out_of_line();
20563            let handles_before = decoder.remaining_handles();
20564            if let Some((inlined, num_bytes, num_handles)) =
20565                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20566            {
20567                let member_inline_size = <fidl::encoding::HandleType<
20568                    fdomain_client::Stream,
20569                    { fidl::ObjectType::STREAM.into_raw() },
20570                    2147483648,
20571                > as fidl::encoding::TypeMarker>::inline_size(
20572                    decoder.context
20573                );
20574                if inlined != (member_inline_size <= 4) {
20575                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20576                }
20577                let inner_offset;
20578                let mut inner_depth = depth.clone();
20579                if inlined {
20580                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20581                    inner_offset = next_offset;
20582                } else {
20583                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20584                    inner_depth.increment()?;
20585                }
20586                let val_ref =
20587                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));
20588                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)?;
20589                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20590                {
20591                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20592                }
20593                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20594                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20595                }
20596            }
20597
20598            next_offset += envelope_size;
20599            _next_ordinal_to_read += 1;
20600            if next_offset >= end_offset {
20601                return Ok(());
20602            }
20603
20604            // Decode unknown envelopes for gaps in ordinals.
20605            while _next_ordinal_to_read < 4 {
20606                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20607                _next_ordinal_to_read += 1;
20608                next_offset += envelope_size;
20609            }
20610
20611            let next_out_of_line = decoder.next_out_of_line();
20612            let handles_before = decoder.remaining_handles();
20613            if let Some((inlined, num_bytes, num_handles)) =
20614                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20615            {
20616                let member_inline_size =
20617                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20618                if inlined != (member_inline_size <= 4) {
20619                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20620                }
20621                let inner_offset;
20622                let mut inner_depth = depth.clone();
20623                if inlined {
20624                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20625                    inner_offset = next_offset;
20626                } else {
20627                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20628                    inner_depth.increment()?;
20629                }
20630                let val_ref = self.attributes.get_or_insert_with(|| {
20631                    fidl::new_empty!(NodeAttributes2, fdomain_client::fidl::FDomainResourceDialect)
20632                });
20633                fidl::decode!(
20634                    NodeAttributes2,
20635                    fdomain_client::fidl::FDomainResourceDialect,
20636                    val_ref,
20637                    decoder,
20638                    inner_offset,
20639                    inner_depth
20640                )?;
20641                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20642                {
20643                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20644                }
20645                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20646                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20647                }
20648            }
20649
20650            next_offset += envelope_size;
20651
20652            // Decode the remaining unknown envelopes.
20653            while next_offset < end_offset {
20654                _next_ordinal_to_read += 1;
20655                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20656                next_offset += envelope_size;
20657            }
20658
20659            Ok(())
20660        }
20661    }
20662
20663    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
20664        type Borrowed<'a> = &'a mut Self;
20665        fn take_or_borrow<'a>(
20666            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20667        ) -> Self::Borrowed<'a> {
20668            value
20669        }
20670    }
20671
20672    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
20673        type Owned = Self;
20674
20675        #[inline(always)]
20676        fn inline_align(_context: fidl::encoding::Context) -> usize {
20677            8
20678        }
20679
20680        #[inline(always)]
20681        fn inline_size(_context: fidl::encoding::Context) -> usize {
20682            16
20683        }
20684    }
20685
20686    unsafe impl
20687        fidl::encoding::Encode<ExtendedAttributeValue, fdomain_client::fidl::FDomainResourceDialect>
20688        for &mut ExtendedAttributeValue
20689    {
20690        #[inline]
20691        unsafe fn encode(
20692            self,
20693            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20694            offset: usize,
20695            _depth: fidl::encoding::Depth,
20696        ) -> fidl::Result<()> {
20697            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
20698            encoder.write_num::<u64>(self.ordinal(), offset);
20699            match self {
20700                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
20701                    fidl::encoding::Vector<u8, 32768>,
20702                    fdomain_client::fidl::FDomainResourceDialect,
20703                >(
20704                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
20705                        val,
20706                    ),
20707                    encoder,
20708                    offset + 8,
20709                    _depth,
20710                ),
20711                ExtendedAttributeValue::Buffer(ref mut val) => {
20712                    fidl::encoding::encode_in_envelope::<
20713                        fidl::encoding::HandleType<
20714                            fdomain_client::Vmo,
20715                            { fidl::ObjectType::VMO.into_raw() },
20716                            2147483648,
20717                        >,
20718                        fdomain_client::fidl::FDomainResourceDialect,
20719                    >(
20720                        <fidl::encoding::HandleType<
20721                            fdomain_client::Vmo,
20722                            { fidl::ObjectType::VMO.into_raw() },
20723                            2147483648,
20724                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20725                            val
20726                        ),
20727                        encoder,
20728                        offset + 8,
20729                        _depth,
20730                    )
20731                }
20732                ExtendedAttributeValue::__SourceBreaking { .. } => {
20733                    Err(fidl::Error::UnknownUnionTag)
20734                }
20735            }
20736        }
20737    }
20738
20739    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20740        for ExtendedAttributeValue
20741    {
20742        #[inline(always)]
20743        fn new_empty() -> Self {
20744            Self::__SourceBreaking { unknown_ordinal: 0 }
20745        }
20746
20747        #[inline]
20748        unsafe fn decode(
20749            &mut self,
20750            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20751            offset: usize,
20752            mut depth: fidl::encoding::Depth,
20753        ) -> fidl::Result<()> {
20754            decoder.debug_check_bounds::<Self>(offset);
20755            #[allow(unused_variables)]
20756            let next_out_of_line = decoder.next_out_of_line();
20757            let handles_before = decoder.remaining_handles();
20758            let (ordinal, inlined, num_bytes, num_handles) =
20759                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20760
20761            let member_inline_size = match ordinal {
20762                1 => {
20763                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
20764                        decoder.context,
20765                    )
20766                }
20767                2 => <fidl::encoding::HandleType<
20768                    fdomain_client::Vmo,
20769                    { fidl::ObjectType::VMO.into_raw() },
20770                    2147483648,
20771                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20772                0 => return Err(fidl::Error::UnknownUnionTag),
20773                _ => num_bytes as usize,
20774            };
20775
20776            if inlined != (member_inline_size <= 4) {
20777                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20778            }
20779            let _inner_offset;
20780            if inlined {
20781                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20782                _inner_offset = offset + 8;
20783            } else {
20784                depth.increment()?;
20785                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20786            }
20787            match ordinal {
20788                1 => {
20789                    #[allow(irrefutable_let_patterns)]
20790                    if let ExtendedAttributeValue::Bytes(_) = self {
20791                        // Do nothing, read the value into the object
20792                    } else {
20793                        // Initialize `self` to the right variant
20794                        *self = ExtendedAttributeValue::Bytes(
20795                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect),
20796                        );
20797                    }
20798                    #[allow(irrefutable_let_patterns)]
20799                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
20800                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20801                    } else {
20802                        unreachable!()
20803                    }
20804                }
20805                2 => {
20806                    #[allow(irrefutable_let_patterns)]
20807                    if let ExtendedAttributeValue::Buffer(_) = self {
20808                        // Do nothing, read the value into the object
20809                    } else {
20810                        // Initialize `self` to the right variant
20811                        *self = ExtendedAttributeValue::Buffer(
20812                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20813                        );
20814                    }
20815                    #[allow(irrefutable_let_patterns)]
20816                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
20817                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20818                    } else {
20819                        unreachable!()
20820                    }
20821                }
20822                #[allow(deprecated)]
20823                ordinal => {
20824                    for _ in 0..num_handles {
20825                        decoder.drop_next_handle()?;
20826                    }
20827                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
20828                }
20829            }
20830            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20831                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20832            }
20833            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20834                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20835            }
20836            Ok(())
20837        }
20838    }
20839
20840    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
20841        type Borrowed<'a> = &'a mut Self;
20842        fn take_or_borrow<'a>(
20843            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20844        ) -> Self::Borrowed<'a> {
20845            value
20846        }
20847    }
20848
20849    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
20850        type Owned = Self;
20851
20852        #[inline(always)]
20853        fn inline_align(_context: fidl::encoding::Context) -> usize {
20854            8
20855        }
20856
20857        #[inline(always)]
20858        fn inline_size(_context: fidl::encoding::Context) -> usize {
20859            16
20860        }
20861    }
20862
20863    unsafe impl
20864        fidl::encoding::Encode<NodeInfoDeprecated, fdomain_client::fidl::FDomainResourceDialect>
20865        for &mut NodeInfoDeprecated
20866    {
20867        #[inline]
20868        unsafe fn encode(
20869            self,
20870            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20871            offset: usize,
20872            _depth: fidl::encoding::Depth,
20873        ) -> fidl::Result<()> {
20874            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
20875            encoder.write_num::<u64>(self.ordinal(), offset);
20876            match self {
20877                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
20878                    Service,
20879                    fdomain_client::fidl::FDomainResourceDialect,
20880                >(
20881                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
20882                    encoder,
20883                    offset + 8,
20884                    _depth,
20885                ),
20886                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20887                    FileObject,
20888                    fdomain_client::fidl::FDomainResourceDialect,
20889                >(
20890                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20891                    encoder,
20892                    offset + 8,
20893                    _depth,
20894                ),
20895                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20896                    DirectoryObject,
20897                    fdomain_client::fidl::FDomainResourceDialect,
20898                >(
20899                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20900                    encoder,
20901                    offset + 8,
20902                    _depth,
20903                ),
20904                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20905                    SymlinkObject,
20906                    fdomain_client::fidl::FDomainResourceDialect,
20907                >(
20908                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20909                    encoder,
20910                    offset + 8,
20911                    _depth,
20912                ),
20913            }
20914        }
20915    }
20916
20917    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20918        for NodeInfoDeprecated
20919    {
20920        #[inline(always)]
20921        fn new_empty() -> Self {
20922            Self::Service(fidl::new_empty!(Service, fdomain_client::fidl::FDomainResourceDialect))
20923        }
20924
20925        #[inline]
20926        unsafe fn decode(
20927            &mut self,
20928            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20929            offset: usize,
20930            mut depth: fidl::encoding::Depth,
20931        ) -> fidl::Result<()> {
20932            decoder.debug_check_bounds::<Self>(offset);
20933            #[allow(unused_variables)]
20934            let next_out_of_line = decoder.next_out_of_line();
20935            let handles_before = decoder.remaining_handles();
20936            let (ordinal, inlined, num_bytes, num_handles) =
20937                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20938
20939            let member_inline_size = match ordinal {
20940                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20941                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20942                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20943                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20944                _ => return Err(fidl::Error::UnknownUnionTag),
20945            };
20946
20947            if inlined != (member_inline_size <= 4) {
20948                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20949            }
20950            let _inner_offset;
20951            if inlined {
20952                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20953                _inner_offset = offset + 8;
20954            } else {
20955                depth.increment()?;
20956                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20957            }
20958            match ordinal {
20959                1 => {
20960                    #[allow(irrefutable_let_patterns)]
20961                    if let NodeInfoDeprecated::Service(_) = self {
20962                        // Do nothing, read the value into the object
20963                    } else {
20964                        // Initialize `self` to the right variant
20965                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
20966                            Service,
20967                            fdomain_client::fidl::FDomainResourceDialect
20968                        ));
20969                    }
20970                    #[allow(irrefutable_let_patterns)]
20971                    if let NodeInfoDeprecated::Service(ref mut val) = self {
20972                        fidl::decode!(
20973                            Service,
20974                            fdomain_client::fidl::FDomainResourceDialect,
20975                            val,
20976                            decoder,
20977                            _inner_offset,
20978                            depth
20979                        )?;
20980                    } else {
20981                        unreachable!()
20982                    }
20983                }
20984                2 => {
20985                    #[allow(irrefutable_let_patterns)]
20986                    if let NodeInfoDeprecated::File(_) = self {
20987                        // Do nothing, read the value into the object
20988                    } else {
20989                        // Initialize `self` to the right variant
20990                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
20991                            FileObject,
20992                            fdomain_client::fidl::FDomainResourceDialect
20993                        ));
20994                    }
20995                    #[allow(irrefutable_let_patterns)]
20996                    if let NodeInfoDeprecated::File(ref mut val) = self {
20997                        fidl::decode!(
20998                            FileObject,
20999                            fdomain_client::fidl::FDomainResourceDialect,
21000                            val,
21001                            decoder,
21002                            _inner_offset,
21003                            depth
21004                        )?;
21005                    } else {
21006                        unreachable!()
21007                    }
21008                }
21009                3 => {
21010                    #[allow(irrefutable_let_patterns)]
21011                    if let NodeInfoDeprecated::Directory(_) = self {
21012                        // Do nothing, read the value into the object
21013                    } else {
21014                        // Initialize `self` to the right variant
21015                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
21016                            DirectoryObject,
21017                            fdomain_client::fidl::FDomainResourceDialect
21018                        ));
21019                    }
21020                    #[allow(irrefutable_let_patterns)]
21021                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
21022                        fidl::decode!(
21023                            DirectoryObject,
21024                            fdomain_client::fidl::FDomainResourceDialect,
21025                            val,
21026                            decoder,
21027                            _inner_offset,
21028                            depth
21029                        )?;
21030                    } else {
21031                        unreachable!()
21032                    }
21033                }
21034                4 => {
21035                    #[allow(irrefutable_let_patterns)]
21036                    if let NodeInfoDeprecated::Symlink(_) = self {
21037                        // Do nothing, read the value into the object
21038                    } else {
21039                        // Initialize `self` to the right variant
21040                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
21041                            SymlinkObject,
21042                            fdomain_client::fidl::FDomainResourceDialect
21043                        ));
21044                    }
21045                    #[allow(irrefutable_let_patterns)]
21046                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
21047                        fidl::decode!(
21048                            SymlinkObject,
21049                            fdomain_client::fidl::FDomainResourceDialect,
21050                            val,
21051                            decoder,
21052                            _inner_offset,
21053                            depth
21054                        )?;
21055                    } else {
21056                        unreachable!()
21057                    }
21058                }
21059                ordinal => panic!("unexpected ordinal {:?}", ordinal),
21060            }
21061            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21062                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21063            }
21064            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21065                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21066            }
21067            Ok(())
21068        }
21069    }
21070
21071    impl fidl::encoding::ResourceTypeMarker for Representation {
21072        type Borrowed<'a> = &'a mut Self;
21073        fn take_or_borrow<'a>(
21074            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21075        ) -> Self::Borrowed<'a> {
21076            value
21077        }
21078    }
21079
21080    unsafe impl fidl::encoding::TypeMarker for Representation {
21081        type Owned = Self;
21082
21083        #[inline(always)]
21084        fn inline_align(_context: fidl::encoding::Context) -> usize {
21085            8
21086        }
21087
21088        #[inline(always)]
21089        fn inline_size(_context: fidl::encoding::Context) -> usize {
21090            16
21091        }
21092    }
21093
21094    unsafe impl fidl::encoding::Encode<Representation, fdomain_client::fidl::FDomainResourceDialect>
21095        for &mut Representation
21096    {
21097        #[inline]
21098        unsafe fn encode(
21099            self,
21100            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21101            offset: usize,
21102            _depth: fidl::encoding::Depth,
21103        ) -> fidl::Result<()> {
21104            encoder.debug_check_bounds::<Representation>(offset);
21105            encoder.write_num::<u64>(self.ordinal(), offset);
21106            match self {
21107                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
21108                    NodeInfo,
21109                    fdomain_client::fidl::FDomainResourceDialect,
21110                >(
21111                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21112                    encoder,
21113                    offset + 8,
21114                    _depth,
21115                ),
21116                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
21117                    DirectoryInfo,
21118                    fdomain_client::fidl::FDomainResourceDialect,
21119                >(
21120                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21121                    encoder,
21122                    offset + 8,
21123                    _depth,
21124                ),
21125                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
21126                    FileInfo,
21127                    fdomain_client::fidl::FDomainResourceDialect,
21128                >(
21129                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
21130                    encoder,
21131                    offset + 8,
21132                    _depth,
21133                ),
21134                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
21135                    SymlinkInfo,
21136                    fdomain_client::fidl::FDomainResourceDialect,
21137                >(
21138                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21139                    encoder,
21140                    offset + 8,
21141                    _depth,
21142                ),
21143                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
21144            }
21145        }
21146    }
21147
21148    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Representation {
21149        #[inline(always)]
21150        fn new_empty() -> Self {
21151            Self::__SourceBreaking { unknown_ordinal: 0 }
21152        }
21153
21154        #[inline]
21155        unsafe fn decode(
21156            &mut self,
21157            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21158            offset: usize,
21159            mut depth: fidl::encoding::Depth,
21160        ) -> fidl::Result<()> {
21161            decoder.debug_check_bounds::<Self>(offset);
21162            #[allow(unused_variables)]
21163            let next_out_of_line = decoder.next_out_of_line();
21164            let handles_before = decoder.remaining_handles();
21165            let (ordinal, inlined, num_bytes, num_handles) =
21166                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
21167
21168            let member_inline_size = match ordinal {
21169                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21170                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21171                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21172                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21173                0 => return Err(fidl::Error::UnknownUnionTag),
21174                _ => num_bytes as usize,
21175            };
21176
21177            if inlined != (member_inline_size <= 4) {
21178                return Err(fidl::Error::InvalidInlineBitInEnvelope);
21179            }
21180            let _inner_offset;
21181            if inlined {
21182                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
21183                _inner_offset = offset + 8;
21184            } else {
21185                depth.increment()?;
21186                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21187            }
21188            match ordinal {
21189                1 => {
21190                    #[allow(irrefutable_let_patterns)]
21191                    if let Representation::Node(_) = self {
21192                        // Do nothing, read the value into the object
21193                    } else {
21194                        // Initialize `self` to the right variant
21195                        *self = Representation::Node(fidl::new_empty!(
21196                            NodeInfo,
21197                            fdomain_client::fidl::FDomainResourceDialect
21198                        ));
21199                    }
21200                    #[allow(irrefutable_let_patterns)]
21201                    if let Representation::Node(ref mut val) = self {
21202                        fidl::decode!(
21203                            NodeInfo,
21204                            fdomain_client::fidl::FDomainResourceDialect,
21205                            val,
21206                            decoder,
21207                            _inner_offset,
21208                            depth
21209                        )?;
21210                    } else {
21211                        unreachable!()
21212                    }
21213                }
21214                2 => {
21215                    #[allow(irrefutable_let_patterns)]
21216                    if let Representation::Directory(_) = self {
21217                        // Do nothing, read the value into the object
21218                    } else {
21219                        // Initialize `self` to the right variant
21220                        *self = Representation::Directory(fidl::new_empty!(
21221                            DirectoryInfo,
21222                            fdomain_client::fidl::FDomainResourceDialect
21223                        ));
21224                    }
21225                    #[allow(irrefutable_let_patterns)]
21226                    if let Representation::Directory(ref mut val) = self {
21227                        fidl::decode!(
21228                            DirectoryInfo,
21229                            fdomain_client::fidl::FDomainResourceDialect,
21230                            val,
21231                            decoder,
21232                            _inner_offset,
21233                            depth
21234                        )?;
21235                    } else {
21236                        unreachable!()
21237                    }
21238                }
21239                3 => {
21240                    #[allow(irrefutable_let_patterns)]
21241                    if let Representation::File(_) = self {
21242                        // Do nothing, read the value into the object
21243                    } else {
21244                        // Initialize `self` to the right variant
21245                        *self = Representation::File(fidl::new_empty!(
21246                            FileInfo,
21247                            fdomain_client::fidl::FDomainResourceDialect
21248                        ));
21249                    }
21250                    #[allow(irrefutable_let_patterns)]
21251                    if let Representation::File(ref mut val) = self {
21252                        fidl::decode!(
21253                            FileInfo,
21254                            fdomain_client::fidl::FDomainResourceDialect,
21255                            val,
21256                            decoder,
21257                            _inner_offset,
21258                            depth
21259                        )?;
21260                    } else {
21261                        unreachable!()
21262                    }
21263                }
21264                4 => {
21265                    #[allow(irrefutable_let_patterns)]
21266                    if let Representation::Symlink(_) = self {
21267                        // Do nothing, read the value into the object
21268                    } else {
21269                        // Initialize `self` to the right variant
21270                        *self = Representation::Symlink(fidl::new_empty!(
21271                            SymlinkInfo,
21272                            fdomain_client::fidl::FDomainResourceDialect
21273                        ));
21274                    }
21275                    #[allow(irrefutable_let_patterns)]
21276                    if let Representation::Symlink(ref mut val) = self {
21277                        fidl::decode!(
21278                            SymlinkInfo,
21279                            fdomain_client::fidl::FDomainResourceDialect,
21280                            val,
21281                            decoder,
21282                            _inner_offset,
21283                            depth
21284                        )?;
21285                    } else {
21286                        unreachable!()
21287                    }
21288                }
21289                #[allow(deprecated)]
21290                ordinal => {
21291                    for _ in 0..num_handles {
21292                        decoder.drop_next_handle()?;
21293                    }
21294                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
21295                }
21296            }
21297            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21298                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21299            }
21300            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21301                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21302            }
21303            Ok(())
21304        }
21305    }
21306}