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 requires the following rights:
1316    ///
1317    /// * [`Rights.ENUMERATE`]
1318    pub fn r#read_dirents(
1319        &self,
1320        mut max_bytes: u64,
1321    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fdomain_client::fidl::FDomainResourceDialect>
1322    {
1323        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
1324    }
1325
1326    /// Resets the directory seek offset.
1327    ///
1328    /// This method requires the following rights:
1329    ///
1330    /// * [`Rights.ENUMERATE`]
1331    pub fn r#rewind(
1332        &self,
1333    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1334        DirectoryProxyInterface::r#rewind(self)
1335    }
1336
1337    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1338    /// in time. The token will remain valid for as long as the connection requesting the token
1339    /// remains open.
1340    ///
1341    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1342    /// `ZX_ERR_BAD_HANDLE`.
1343    pub fn r#get_token(
1344        &self,
1345    ) -> fidl::client::QueryResponseFut<
1346        (i32, Option<fdomain_client::NullableHandle>),
1347        fdomain_client::fidl::FDomainResourceDialect,
1348    > {
1349        DirectoryProxyInterface::r#get_token(self)
1350    }
1351
1352    /// Creates a link to an object named src by the name dst, within a directory represented by
1353    /// token.
1354    ///
1355    /// `src` must be a resolved object name. Including "/" in the string will
1356    /// return `ZX_ERR_INVALID_ARGS`.
1357    ///
1358    /// `dst` must be a resolved object name. Including "/" in the string will
1359    /// return `ZX_ERR_INVALID_ARGS`.
1360    ///
1361    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1362    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1363    ///
1364    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1365    /// there are two actors operating concurrently, and one actor performs a rename that affects
1366    /// the source within this directory, and the other does a link, each will appear to occur
1367    /// atomically in an unspecified order.
1368    pub fn r#link(
1369        &self,
1370        mut src: &str,
1371        mut dst_parent_token: fdomain_client::NullableHandle,
1372        mut dst: &str,
1373    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1374        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
1375    }
1376
1377    /// Removes a child node from the this directory's list of entries.
1378    ///
1379    /// Note: this does not guarantee that the underlying object is destroyed.
1380    /// Although the link will be removed from the containing directory,
1381    /// objects with multiple references (such as files which are still open)
1382    /// will not actually be destroyed until all references are closed.
1383    ///
1384    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1385    ///   [`Rights.WRITE_BYTES`].
1386    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1387    ///   support writing.
1388    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1389    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1390    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1391    ///   containing a remote channel.
1392    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1393    ///     something other than a directory was found.
1394    ///
1395    /// Other errors may be returned for filesystem-specific reasons.
1396    ///
1397    /// This method requires the following rights:
1398    ///
1399    /// * [`Rights.ENUMERATE`]
1400    /// * [`Rights.MODIFY_DIRECTORY`]
1401    pub fn r#unlink(
1402        &self,
1403        mut name: &str,
1404        mut options: &UnlinkOptions,
1405    ) -> fidl::client::QueryResponseFut<
1406        DirectoryUnlinkResult,
1407        fdomain_client::fidl::FDomainResourceDialect,
1408    > {
1409        DirectoryProxyInterface::r#unlink(self, name, options)
1410    }
1411
1412    /// Renames a node named `src` to the name `dst`, in a directory represented
1413    /// by `dst_parent_token`.
1414    ///
1415    /// `src` and `dst` must be valid node names.
1416    /// See [`Name`] for what constitutes a valid name.
1417    ///
1418    /// This method requires the following rights on both the current connection, and the connection
1419    /// identified by `dst_parent_token`:
1420    ///
1421    /// * [`Rights.ENUMERATE`]
1422    /// * [`Rights.MODIFY_DIRECTORY`]
1423    ///
1424    /// The following requirements are necessary to avoid rights escalations.
1425    ///
1426    /// If the source and destination directory differ, the source directory must also have the
1427    /// maximal set of abilities supported for files, which would typically be
1428    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1429    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1430    /// right.
1431    ///
1432    /// If `src` refers to a directory, and differs from the destination directory, then the source
1433    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1434    ///
1435    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1436    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1437    pub fn r#rename(
1438        &self,
1439        mut src: &str,
1440        mut dst_parent_token: fdomain_client::Event,
1441        mut dst: &str,
1442    ) -> fidl::client::QueryResponseFut<
1443        DirectoryRenameResult,
1444        fdomain_client::fidl::FDomainResourceDialect,
1445    > {
1446        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
1447    }
1448
1449    /// Creates a symbolic link.
1450    ///
1451    /// `name` is the name to be given to the created symbolic link.
1452    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1453    /// will perform no validation of `target` except for a server chosen maximum length.
1454    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1455    /// on the successfully created node.
1456    ///
1457    /// * [`Rights.MODIFY_DIRECTORY`]
1458    ///
1459    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1460    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1461    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1462    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1463    pub fn r#create_symlink(
1464        &self,
1465        mut name: &str,
1466        mut target: &[u8],
1467        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
1468    ) -> fidl::client::QueryResponseFut<
1469        DirectoryCreateSymlinkResult,
1470        fdomain_client::fidl::FDomainResourceDialect,
1471    > {
1472        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
1473    }
1474
1475    /// Watches a directory, receiving events of added messages on the
1476    /// watcher request channel.
1477    ///
1478    /// Options must be zero; it is reserved.
1479    ///
1480    /// This method requires the following rights:
1481    ///
1482    /// * [`Rights.ENUMERATE`]
1483    pub fn r#watch(
1484        &self,
1485        mut mask: WatchMask,
1486        mut options: u32,
1487        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
1488    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1489        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
1490    }
1491}
1492
1493impl DirectoryProxyInterface for DirectoryProxy {
1494    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
1495        AdvisoryLockingAdvisoryLockResult,
1496        fdomain_client::fidl::FDomainResourceDialect,
1497    >;
1498    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
1499        fn _decode(
1500            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1501        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1502            let _response = fidl::client::decode_transaction_body::<
1503                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1504                fdomain_client::fidl::FDomainResourceDialect,
1505                0x6ee9c0ad53ec87aa,
1506            >(_buf?)?;
1507            Ok(_response.map(|x| x))
1508        }
1509        self.client.send_query_and_decode::<
1510            AdvisoryLockingAdvisoryLockRequest,
1511            AdvisoryLockingAdvisoryLockResult,
1512        >(
1513            (request,),
1514            0x6ee9c0ad53ec87aa,
1515            fidl::encoding::DynamicFlags::empty(),
1516            _decode,
1517        )
1518    }
1519
1520    fn r#clone(
1521        &self,
1522        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1523    ) -> Result<(), fidl::Error> {
1524        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
1525            (request,),
1526            0x20d8a7aba2168a79,
1527            fidl::encoding::DynamicFlags::empty(),
1528        )
1529    }
1530
1531    type CloseResponseFut = fidl::client::QueryResponseFut<
1532        fdomain_fuchsia_unknown::CloseableCloseResult,
1533        fdomain_client::fidl::FDomainResourceDialect,
1534    >;
1535    fn r#close(&self) -> Self::CloseResponseFut {
1536        fn _decode(
1537            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1538        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1539            let _response = fidl::client::decode_transaction_body::<
1540                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1541                fdomain_client::fidl::FDomainResourceDialect,
1542                0x5ac5d459ad7f657e,
1543            >(_buf?)?;
1544            Ok(_response.map(|x| x))
1545        }
1546        self.client.send_query_and_decode::<
1547            fidl::encoding::EmptyPayload,
1548            fdomain_fuchsia_unknown::CloseableCloseResult,
1549        >(
1550            (),
1551            0x5ac5d459ad7f657e,
1552            fidl::encoding::DynamicFlags::empty(),
1553            _decode,
1554        )
1555    }
1556
1557    type QueryResponseFut =
1558        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
1559    fn r#query(&self) -> Self::QueryResponseFut {
1560        fn _decode(
1561            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1562        ) -> Result<Vec<u8>, fidl::Error> {
1563            let _response = fidl::client::decode_transaction_body::<
1564                fdomain_fuchsia_unknown::QueryableQueryResponse,
1565                fdomain_client::fidl::FDomainResourceDialect,
1566                0x2658edee9decfc06,
1567            >(_buf?)?;
1568            Ok(_response.protocol)
1569        }
1570        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
1571            (),
1572            0x2658edee9decfc06,
1573            fidl::encoding::DynamicFlags::empty(),
1574            _decode,
1575        )
1576    }
1577
1578    fn r#deprecated_clone(
1579        &self,
1580        mut flags: OpenFlags,
1581        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1582    ) -> Result<(), fidl::Error> {
1583        self.client.send::<NodeDeprecatedCloneRequest>(
1584            (flags, object),
1585            0x5a61678f293ce16f,
1586            fidl::encoding::DynamicFlags::FLEXIBLE,
1587        )
1588    }
1589
1590    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
1591        (i32, NodeAttributes),
1592        fdomain_client::fidl::FDomainResourceDialect,
1593    >;
1594    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
1595        fn _decode(
1596            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1597        ) -> Result<(i32, NodeAttributes), fidl::Error> {
1598            let _response = fidl::client::decode_transaction_body::<
1599                NodeDeprecatedGetAttrResponse,
1600                fdomain_client::fidl::FDomainResourceDialect,
1601                0x78985e216314dafd,
1602            >(_buf?)?;
1603            Ok((_response.s, _response.attributes))
1604        }
1605        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
1606            (),
1607            0x78985e216314dafd,
1608            fidl::encoding::DynamicFlags::empty(),
1609            _decode,
1610        )
1611    }
1612
1613    type DeprecatedSetAttrResponseFut =
1614        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1615    fn r#deprecated_set_attr(
1616        &self,
1617        mut flags: NodeAttributeFlags,
1618        mut attributes: &NodeAttributes,
1619    ) -> Self::DeprecatedSetAttrResponseFut {
1620        fn _decode(
1621            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1622        ) -> Result<i32, fidl::Error> {
1623            let _response = fidl::client::decode_transaction_body::<
1624                NodeDeprecatedSetAttrResponse,
1625                fdomain_client::fidl::FDomainResourceDialect,
1626                0x4186c0f40d938f46,
1627            >(_buf?)?;
1628            Ok(_response.s)
1629        }
1630        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
1631            (flags, attributes),
1632            0x4186c0f40d938f46,
1633            fidl::encoding::DynamicFlags::empty(),
1634            _decode,
1635        )
1636    }
1637
1638    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
1639        (i32, OpenFlags),
1640        fdomain_client::fidl::FDomainResourceDialect,
1641    >;
1642    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
1643        fn _decode(
1644            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1645        ) -> Result<(i32, OpenFlags), fidl::Error> {
1646            let _response = fidl::client::decode_transaction_body::<
1647                NodeDeprecatedGetFlagsResponse,
1648                fdomain_client::fidl::FDomainResourceDialect,
1649                0x5b88fffb8eda3aa1,
1650            >(_buf?)?;
1651            Ok((_response.s, _response.flags))
1652        }
1653        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
1654            (),
1655            0x5b88fffb8eda3aa1,
1656            fidl::encoding::DynamicFlags::empty(),
1657            _decode,
1658        )
1659    }
1660
1661    type DeprecatedSetFlagsResponseFut =
1662        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1663    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
1664        fn _decode(
1665            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1666        ) -> Result<i32, fidl::Error> {
1667            let _response = fidl::client::decode_transaction_body::<
1668                NodeDeprecatedSetFlagsResponse,
1669                fdomain_client::fidl::FDomainResourceDialect,
1670                0x5295b76c71fde733,
1671            >(_buf?)?;
1672            Ok(_response.s)
1673        }
1674        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
1675            (flags,),
1676            0x5295b76c71fde733,
1677            fidl::encoding::DynamicFlags::empty(),
1678            _decode,
1679        )
1680    }
1681
1682    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
1683        NodeGetFlagsResult,
1684        fdomain_client::fidl::FDomainResourceDialect,
1685    >;
1686    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
1687        fn _decode(
1688            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1689        ) -> Result<NodeGetFlagsResult, fidl::Error> {
1690            let _response = fidl::client::decode_transaction_body::<
1691                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1692                fdomain_client::fidl::FDomainResourceDialect,
1693                0x176eb318f64ec23,
1694            >(_buf?)?
1695            .into_result_fdomain::<DirectoryMarker>("get_flags")?;
1696            Ok(_response.map(|x| x.flags))
1697        }
1698        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
1699            (),
1700            0x176eb318f64ec23,
1701            fidl::encoding::DynamicFlags::FLEXIBLE,
1702            _decode,
1703        )
1704    }
1705
1706    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
1707        NodeSetFlagsResult,
1708        fdomain_client::fidl::FDomainResourceDialect,
1709    >;
1710    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
1711        fn _decode(
1712            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1713        ) -> Result<NodeSetFlagsResult, fidl::Error> {
1714            let _response = fidl::client::decode_transaction_body::<
1715                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1716                fdomain_client::fidl::FDomainResourceDialect,
1717                0x55a8028685791ea8,
1718            >(_buf?)?
1719            .into_result_fdomain::<DirectoryMarker>("set_flags")?;
1720            Ok(_response.map(|x| x))
1721        }
1722        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
1723            (flags,),
1724            0x55a8028685791ea8,
1725            fidl::encoding::DynamicFlags::FLEXIBLE,
1726            _decode,
1727        )
1728    }
1729
1730    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
1731        (i32, Option<Box<FilesystemInfo>>),
1732        fdomain_client::fidl::FDomainResourceDialect,
1733    >;
1734    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
1735        fn _decode(
1736            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1737        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1738            let _response = fidl::client::decode_transaction_body::<
1739                NodeQueryFilesystemResponse,
1740                fdomain_client::fidl::FDomainResourceDialect,
1741                0x6f344a1c6b0a0610,
1742            >(_buf?)?;
1743            Ok((_response.s, _response.info))
1744        }
1745        self.client.send_query_and_decode::<
1746            fidl::encoding::EmptyPayload,
1747            (i32, Option<Box<FilesystemInfo>>),
1748        >(
1749            (),
1750            0x6f344a1c6b0a0610,
1751            fidl::encoding::DynamicFlags::empty(),
1752            _decode,
1753        )
1754    }
1755
1756    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
1757        NodeGetAttributesResult,
1758        fdomain_client::fidl::FDomainResourceDialect,
1759    >;
1760    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
1761        fn _decode(
1762            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1763        ) -> Result<NodeGetAttributesResult, fidl::Error> {
1764            let _response = fidl::client::decode_transaction_body::<
1765                fidl::encoding::ResultType<NodeAttributes2, i32>,
1766                fdomain_client::fidl::FDomainResourceDialect,
1767                0x3d4396a638ea053b,
1768            >(_buf?)?;
1769            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1770        }
1771        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
1772            (query,),
1773            0x3d4396a638ea053b,
1774            fidl::encoding::DynamicFlags::empty(),
1775            _decode,
1776        )
1777    }
1778
1779    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
1780        NodeUpdateAttributesResult,
1781        fdomain_client::fidl::FDomainResourceDialect,
1782    >;
1783    fn r#update_attributes(
1784        &self,
1785        mut payload: &MutableNodeAttributes,
1786    ) -> Self::UpdateAttributesResponseFut {
1787        fn _decode(
1788            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1789        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1790            let _response = fidl::client::decode_transaction_body::<
1791                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1792                fdomain_client::fidl::FDomainResourceDialect,
1793                0x3308c1da5a89bf08,
1794            >(_buf?)?;
1795            Ok(_response.map(|x| x))
1796        }
1797        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
1798            payload,
1799            0x3308c1da5a89bf08,
1800            fidl::encoding::DynamicFlags::empty(),
1801            _decode,
1802        )
1803    }
1804
1805    type SyncResponseFut = fidl::client::QueryResponseFut<
1806        NodeSyncResult,
1807        fdomain_client::fidl::FDomainResourceDialect,
1808    >;
1809    fn r#sync(&self) -> Self::SyncResponseFut {
1810        fn _decode(
1811            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1812        ) -> Result<NodeSyncResult, fidl::Error> {
1813            let _response = fidl::client::decode_transaction_body::<
1814                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1815                fdomain_client::fidl::FDomainResourceDialect,
1816                0x2c5c27ca0ab5dc49,
1817            >(_buf?)?;
1818            Ok(_response.map(|x| x))
1819        }
1820        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
1821            (),
1822            0x2c5c27ca0ab5dc49,
1823            fidl::encoding::DynamicFlags::empty(),
1824            _decode,
1825        )
1826    }
1827
1828    fn r#list_extended_attributes(
1829        &self,
1830        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1831    ) -> Result<(), fidl::Error> {
1832        self.client.send::<NodeListExtendedAttributesRequest>(
1833            (iterator,),
1834            0x4b61033de007fcd0,
1835            fidl::encoding::DynamicFlags::empty(),
1836        )
1837    }
1838
1839    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1840        NodeGetExtendedAttributeResult,
1841        fdomain_client::fidl::FDomainResourceDialect,
1842    >;
1843    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
1844        fn _decode(
1845            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1846        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1847            let _response = fidl::client::decode_transaction_body::<
1848                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1849                fdomain_client::fidl::FDomainResourceDialect,
1850                0x45ffa3ccfdeb76db,
1851            >(_buf?)?;
1852            Ok(_response.map(|x| x))
1853        }
1854        self.client.send_query_and_decode::<
1855            NodeGetExtendedAttributeRequest,
1856            NodeGetExtendedAttributeResult,
1857        >(
1858            (name,),
1859            0x45ffa3ccfdeb76db,
1860            fidl::encoding::DynamicFlags::empty(),
1861            _decode,
1862        )
1863    }
1864
1865    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1866        NodeSetExtendedAttributeResult,
1867        fdomain_client::fidl::FDomainResourceDialect,
1868    >;
1869    fn r#set_extended_attribute(
1870        &self,
1871        mut name: &[u8],
1872        mut value: ExtendedAttributeValue,
1873        mut mode: SetExtendedAttributeMode,
1874    ) -> Self::SetExtendedAttributeResponseFut {
1875        fn _decode(
1876            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1877        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1878            let _response = fidl::client::decode_transaction_body::<
1879                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1880                fdomain_client::fidl::FDomainResourceDialect,
1881                0x4a951362f681f23c,
1882            >(_buf?)?;
1883            Ok(_response.map(|x| x))
1884        }
1885        self.client.send_query_and_decode::<
1886            NodeSetExtendedAttributeRequest,
1887            NodeSetExtendedAttributeResult,
1888        >(
1889            (name, &mut value, mode,),
1890            0x4a951362f681f23c,
1891            fidl::encoding::DynamicFlags::empty(),
1892            _decode,
1893        )
1894    }
1895
1896    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1897        NodeRemoveExtendedAttributeResult,
1898        fdomain_client::fidl::FDomainResourceDialect,
1899    >;
1900    fn r#remove_extended_attribute(
1901        &self,
1902        mut name: &[u8],
1903    ) -> Self::RemoveExtendedAttributeResponseFut {
1904        fn _decode(
1905            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1906        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1907            let _response = fidl::client::decode_transaction_body::<
1908                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1909                fdomain_client::fidl::FDomainResourceDialect,
1910                0x7a0b9f3a9bf9032d,
1911            >(_buf?)?;
1912            Ok(_response.map(|x| x))
1913        }
1914        self.client.send_query_and_decode::<
1915            NodeRemoveExtendedAttributeRequest,
1916            NodeRemoveExtendedAttributeResult,
1917        >(
1918            (name,),
1919            0x7a0b9f3a9bf9032d,
1920            fidl::encoding::DynamicFlags::empty(),
1921            _decode,
1922        )
1923    }
1924
1925    fn r#open(
1926        &self,
1927        mut path: &str,
1928        mut flags: Flags,
1929        mut options: &Options,
1930        mut object: fdomain_client::Channel,
1931    ) -> Result<(), fidl::Error> {
1932        self.client.send::<OpenableOpenRequest>(
1933            (path, flags, options, object),
1934            0x568ddcb9a9cbb6d9,
1935            fidl::encoding::DynamicFlags::FLEXIBLE,
1936        )
1937    }
1938
1939    fn r#deprecated_open(
1940        &self,
1941        mut flags: OpenFlags,
1942        mut mode: ModeType,
1943        mut path: &str,
1944        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1945    ) -> Result<(), fidl::Error> {
1946        self.client.send::<DirectoryDeprecatedOpenRequest>(
1947            (flags, mode, path, object),
1948            0x2c5044561d685ec0,
1949            fidl::encoding::DynamicFlags::FLEXIBLE,
1950        )
1951    }
1952
1953    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
1954        (i32, Vec<u8>),
1955        fdomain_client::fidl::FDomainResourceDialect,
1956    >;
1957    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
1958        fn _decode(
1959            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1960        ) -> Result<(i32, Vec<u8>), fidl::Error> {
1961            let _response = fidl::client::decode_transaction_body::<
1962                DirectoryReadDirentsResponse,
1963                fdomain_client::fidl::FDomainResourceDialect,
1964                0x3582806bf27faa0a,
1965            >(_buf?)?;
1966            Ok((_response.s, _response.dirents))
1967        }
1968        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
1969            (max_bytes,),
1970            0x3582806bf27faa0a,
1971            fidl::encoding::DynamicFlags::empty(),
1972            _decode,
1973        )
1974    }
1975
1976    type RewindResponseFut =
1977        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1978    fn r#rewind(&self) -> Self::RewindResponseFut {
1979        fn _decode(
1980            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1981        ) -> Result<i32, fidl::Error> {
1982            let _response = fidl::client::decode_transaction_body::<
1983                DirectoryRewindResponse,
1984                fdomain_client::fidl::FDomainResourceDialect,
1985                0x16b1202af0f34c71,
1986            >(_buf?)?;
1987            Ok(_response.s)
1988        }
1989        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1990            (),
1991            0x16b1202af0f34c71,
1992            fidl::encoding::DynamicFlags::empty(),
1993            _decode,
1994        )
1995    }
1996
1997    type GetTokenResponseFut = fidl::client::QueryResponseFut<
1998        (i32, Option<fdomain_client::NullableHandle>),
1999        fdomain_client::fidl::FDomainResourceDialect,
2000    >;
2001    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2002        fn _decode(
2003            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2004        ) -> Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error> {
2005            let _response = fidl::client::decode_transaction_body::<
2006                DirectoryGetTokenResponse,
2007                fdomain_client::fidl::FDomainResourceDialect,
2008                0x26ae9d18763c8655,
2009            >(_buf?)?;
2010            Ok((_response.s, _response.token))
2011        }
2012        self.client.send_query_and_decode::<
2013            fidl::encoding::EmptyPayload,
2014            (i32, Option<fdomain_client::NullableHandle>),
2015        >(
2016            (),
2017            0x26ae9d18763c8655,
2018            fidl::encoding::DynamicFlags::empty(),
2019            _decode,
2020        )
2021    }
2022
2023    type LinkResponseFut =
2024        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2025    fn r#link(
2026        &self,
2027        mut src: &str,
2028        mut dst_parent_token: fdomain_client::NullableHandle,
2029        mut dst: &str,
2030    ) -> Self::LinkResponseFut {
2031        fn _decode(
2032            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2033        ) -> Result<i32, fidl::Error> {
2034            let _response = fidl::client::decode_transaction_body::<
2035                DirectoryLinkResponse,
2036                fdomain_client::fidl::FDomainResourceDialect,
2037                0x740604c0c7c930e7,
2038            >(_buf?)?;
2039            Ok(_response.s)
2040        }
2041        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2042            (src, dst_parent_token, dst),
2043            0x740604c0c7c930e7,
2044            fidl::encoding::DynamicFlags::empty(),
2045            _decode,
2046        )
2047    }
2048
2049    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2050        DirectoryUnlinkResult,
2051        fdomain_client::fidl::FDomainResourceDialect,
2052    >;
2053    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2054        fn _decode(
2055            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2056        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2057            let _response = fidl::client::decode_transaction_body::<
2058                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2059                fdomain_client::fidl::FDomainResourceDialect,
2060                0x750a0326a78d7bed,
2061            >(_buf?)?;
2062            Ok(_response.map(|x| x))
2063        }
2064        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2065            (name, options),
2066            0x750a0326a78d7bed,
2067            fidl::encoding::DynamicFlags::empty(),
2068            _decode,
2069        )
2070    }
2071
2072    type RenameResponseFut = fidl::client::QueryResponseFut<
2073        DirectoryRenameResult,
2074        fdomain_client::fidl::FDomainResourceDialect,
2075    >;
2076    fn r#rename(
2077        &self,
2078        mut src: &str,
2079        mut dst_parent_token: fdomain_client::Event,
2080        mut dst: &str,
2081    ) -> Self::RenameResponseFut {
2082        fn _decode(
2083            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2084        ) -> Result<DirectoryRenameResult, fidl::Error> {
2085            let _response = fidl::client::decode_transaction_body::<
2086                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2087                fdomain_client::fidl::FDomainResourceDialect,
2088                0x7060e7723b9928de,
2089            >(_buf?)?;
2090            Ok(_response.map(|x| x))
2091        }
2092        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2093            (src, dst_parent_token, dst),
2094            0x7060e7723b9928de,
2095            fidl::encoding::DynamicFlags::empty(),
2096            _decode,
2097        )
2098    }
2099
2100    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2101        DirectoryCreateSymlinkResult,
2102        fdomain_client::fidl::FDomainResourceDialect,
2103    >;
2104    fn r#create_symlink(
2105        &self,
2106        mut name: &str,
2107        mut target: &[u8],
2108        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
2109    ) -> Self::CreateSymlinkResponseFut {
2110        fn _decode(
2111            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2112        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2113            let _response = fidl::client::decode_transaction_body::<
2114                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2115                fdomain_client::fidl::FDomainResourceDialect,
2116                0x21ce0f19ec043889,
2117            >(_buf?)?;
2118            Ok(_response.map(|x| x))
2119        }
2120        self.client
2121            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2122                (name, target, connection),
2123                0x21ce0f19ec043889,
2124                fidl::encoding::DynamicFlags::empty(),
2125                _decode,
2126            )
2127    }
2128
2129    type WatchResponseFut =
2130        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2131    fn r#watch(
2132        &self,
2133        mut mask: WatchMask,
2134        mut options: u32,
2135        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
2136    ) -> Self::WatchResponseFut {
2137        fn _decode(
2138            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2139        ) -> Result<i32, fidl::Error> {
2140            let _response = fidl::client::decode_transaction_body::<
2141                DirectoryWatchResponse,
2142                fdomain_client::fidl::FDomainResourceDialect,
2143                0x5717193a59d66d91,
2144            >(_buf?)?;
2145            Ok(_response.s)
2146        }
2147        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2148            (mask, options, watcher),
2149            0x5717193a59d66d91,
2150            fidl::encoding::DynamicFlags::empty(),
2151            _decode,
2152        )
2153    }
2154}
2155
2156pub struct DirectoryEventStream {
2157    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2158}
2159
2160impl std::marker::Unpin for DirectoryEventStream {}
2161
2162impl futures::stream::FusedStream for DirectoryEventStream {
2163    fn is_terminated(&self) -> bool {
2164        self.event_receiver.is_terminated()
2165    }
2166}
2167
2168impl futures::Stream for DirectoryEventStream {
2169    type Item = Result<DirectoryEvent, fidl::Error>;
2170
2171    fn poll_next(
2172        mut self: std::pin::Pin<&mut Self>,
2173        cx: &mut std::task::Context<'_>,
2174    ) -> std::task::Poll<Option<Self::Item>> {
2175        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2176            &mut self.event_receiver,
2177            cx
2178        )?) {
2179            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
2180            None => std::task::Poll::Ready(None),
2181        }
2182    }
2183}
2184
2185#[derive(Debug)]
2186pub enum DirectoryEvent {
2187    OnOpen_ {
2188        s: i32,
2189        info: Option<Box<NodeInfoDeprecated>>,
2190    },
2191    OnRepresentation {
2192        payload: Representation,
2193    },
2194    #[non_exhaustive]
2195    _UnknownEvent {
2196        /// Ordinal of the event that was sent.
2197        ordinal: u64,
2198    },
2199}
2200
2201impl DirectoryEvent {
2202    #[allow(irrefutable_let_patterns)]
2203    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
2204        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
2205    }
2206    #[allow(irrefutable_let_patterns)]
2207    pub fn into_on_representation(self) -> Option<Representation> {
2208        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
2209    }
2210
2211    /// Decodes a message buffer as a [`DirectoryEvent`].
2212    fn decode(
2213        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2214    ) -> Result<DirectoryEvent, fidl::Error> {
2215        let (bytes, _handles) = buf.split_mut();
2216        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2217        debug_assert_eq!(tx_header.tx_id, 0);
2218        match tx_header.ordinal {
2219            0x7fc7bbb1dbfd1972 => {
2220                let mut out = fidl::new_empty!(
2221                    NodeOnOpenRequest,
2222                    fdomain_client::fidl::FDomainResourceDialect
2223                );
2224                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2225                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
2226            }
2227            0x5cb40567d80a510c => {
2228                let mut out =
2229                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
2230                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
2231                Ok((DirectoryEvent::OnRepresentation { payload: out }))
2232            }
2233            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2234                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2235            }
2236            _ => Err(fidl::Error::UnknownOrdinal {
2237                ordinal: tx_header.ordinal,
2238                protocol_name:
2239                    <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2240            }),
2241        }
2242    }
2243}
2244
2245/// A Stream of incoming requests for fuchsia.io/Directory.
2246pub struct DirectoryRequestStream {
2247    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2248    is_terminated: bool,
2249}
2250
2251impl std::marker::Unpin for DirectoryRequestStream {}
2252
2253impl futures::stream::FusedStream for DirectoryRequestStream {
2254    fn is_terminated(&self) -> bool {
2255        self.is_terminated
2256    }
2257}
2258
2259impl fdomain_client::fidl::RequestStream for DirectoryRequestStream {
2260    type Protocol = DirectoryMarker;
2261    type ControlHandle = DirectoryControlHandle;
2262
2263    fn from_channel(channel: fdomain_client::Channel) -> Self {
2264        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2265    }
2266
2267    fn control_handle(&self) -> Self::ControlHandle {
2268        DirectoryControlHandle { inner: self.inner.clone() }
2269    }
2270
2271    fn into_inner(
2272        self,
2273    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2274    {
2275        (self.inner, self.is_terminated)
2276    }
2277
2278    fn from_inner(
2279        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2280        is_terminated: bool,
2281    ) -> Self {
2282        Self { inner, is_terminated }
2283    }
2284}
2285
2286impl futures::Stream for DirectoryRequestStream {
2287    type Item = Result<DirectoryRequest, fidl::Error>;
2288
2289    fn poll_next(
2290        mut self: std::pin::Pin<&mut Self>,
2291        cx: &mut std::task::Context<'_>,
2292    ) -> std::task::Poll<Option<Self::Item>> {
2293        let this = &mut *self;
2294        if this.inner.check_shutdown(cx) {
2295            this.is_terminated = true;
2296            return std::task::Poll::Ready(None);
2297        }
2298        if this.is_terminated {
2299            panic!("polled DirectoryRequestStream after completion");
2300        }
2301        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2302            |bytes, handles| {
2303                match this.inner.channel().read_etc(cx, bytes, handles) {
2304                    std::task::Poll::Ready(Ok(())) => {}
2305                    std::task::Poll::Pending => return std::task::Poll::Pending,
2306                    std::task::Poll::Ready(Err(None)) => {
2307                        this.is_terminated = true;
2308                        return std::task::Poll::Ready(None);
2309                    }
2310                    std::task::Poll::Ready(Err(Some(e))) => {
2311                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2312                            e.into(),
2313                        ))));
2314                    }
2315                }
2316
2317                // A message has been received from the channel
2318                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2319
2320                std::task::Poll::Ready(Some(match header.ordinal {
2321                    0x6ee9c0ad53ec87aa => {
2322                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2323                        let mut req = fidl::new_empty!(
2324                            AdvisoryLockingAdvisoryLockRequest,
2325                            fdomain_client::fidl::FDomainResourceDialect
2326                        );
2327                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
2328                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2329                        Ok(DirectoryRequest::AdvisoryLock {
2330                            request: req.request,
2331
2332                            responder: DirectoryAdvisoryLockResponder {
2333                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2334                                tx_id: header.tx_id,
2335                            },
2336                        })
2337                    }
2338                    0x20d8a7aba2168a79 => {
2339                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2340                        let mut req = fidl::new_empty!(
2341                            fdomain_fuchsia_unknown::CloneableCloneRequest,
2342                            fdomain_client::fidl::FDomainResourceDialect
2343                        );
2344                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2345                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2346                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
2347                    }
2348                    0x5ac5d459ad7f657e => {
2349                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2350                        let mut req = fidl::new_empty!(
2351                            fidl::encoding::EmptyPayload,
2352                            fdomain_client::fidl::FDomainResourceDialect
2353                        );
2354                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2355                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2356                        Ok(DirectoryRequest::Close {
2357                            responder: DirectoryCloseResponder {
2358                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2359                                tx_id: header.tx_id,
2360                            },
2361                        })
2362                    }
2363                    0x2658edee9decfc06 => {
2364                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2365                        let mut req = fidl::new_empty!(
2366                            fidl::encoding::EmptyPayload,
2367                            fdomain_client::fidl::FDomainResourceDialect
2368                        );
2369                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2370                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2371                        Ok(DirectoryRequest::Query {
2372                            responder: DirectoryQueryResponder {
2373                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2374                                tx_id: header.tx_id,
2375                            },
2376                        })
2377                    }
2378                    0x5a61678f293ce16f => {
2379                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2380                        let mut req = fidl::new_empty!(
2381                            NodeDeprecatedCloneRequest,
2382                            fdomain_client::fidl::FDomainResourceDialect
2383                        );
2384                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2385                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2386                        Ok(DirectoryRequest::DeprecatedClone {
2387                            flags: req.flags,
2388                            object: req.object,
2389
2390                            control_handle,
2391                        })
2392                    }
2393                    0x78985e216314dafd => {
2394                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2395                        let mut req = fidl::new_empty!(
2396                            fidl::encoding::EmptyPayload,
2397                            fdomain_client::fidl::FDomainResourceDialect
2398                        );
2399                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2400                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2401                        Ok(DirectoryRequest::DeprecatedGetAttr {
2402                            responder: DirectoryDeprecatedGetAttrResponder {
2403                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2404                                tx_id: header.tx_id,
2405                            },
2406                        })
2407                    }
2408                    0x4186c0f40d938f46 => {
2409                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2410                        let mut req = fidl::new_empty!(
2411                            NodeDeprecatedSetAttrRequest,
2412                            fdomain_client::fidl::FDomainResourceDialect
2413                        );
2414                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
2415                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2416                        Ok(DirectoryRequest::DeprecatedSetAttr {
2417                            flags: req.flags,
2418                            attributes: req.attributes,
2419
2420                            responder: DirectoryDeprecatedSetAttrResponder {
2421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2422                                tx_id: header.tx_id,
2423                            },
2424                        })
2425                    }
2426                    0x5b88fffb8eda3aa1 => {
2427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2428                        let mut req = fidl::new_empty!(
2429                            fidl::encoding::EmptyPayload,
2430                            fdomain_client::fidl::FDomainResourceDialect
2431                        );
2432                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2433                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2434                        Ok(DirectoryRequest::DeprecatedGetFlags {
2435                            responder: DirectoryDeprecatedGetFlagsResponder {
2436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2437                                tx_id: header.tx_id,
2438                            },
2439                        })
2440                    }
2441                    0x5295b76c71fde733 => {
2442                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2443                        let mut req = fidl::new_empty!(
2444                            NodeDeprecatedSetFlagsRequest,
2445                            fdomain_client::fidl::FDomainResourceDialect
2446                        );
2447                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2448                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2449                        Ok(DirectoryRequest::DeprecatedSetFlags {
2450                            flags: req.flags,
2451
2452                            responder: DirectoryDeprecatedSetFlagsResponder {
2453                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2454                                tx_id: header.tx_id,
2455                            },
2456                        })
2457                    }
2458                    0x176eb318f64ec23 => {
2459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2460                        let mut req = fidl::new_empty!(
2461                            fidl::encoding::EmptyPayload,
2462                            fdomain_client::fidl::FDomainResourceDialect
2463                        );
2464                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2465                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2466                        Ok(DirectoryRequest::GetFlags {
2467                            responder: DirectoryGetFlagsResponder {
2468                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2469                                tx_id: header.tx_id,
2470                            },
2471                        })
2472                    }
2473                    0x55a8028685791ea8 => {
2474                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2475                        let mut req = fidl::new_empty!(
2476                            NodeSetFlagsRequest,
2477                            fdomain_client::fidl::FDomainResourceDialect
2478                        );
2479                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2480                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2481                        Ok(DirectoryRequest::SetFlags {
2482                            flags: req.flags,
2483
2484                            responder: DirectorySetFlagsResponder {
2485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2486                                tx_id: header.tx_id,
2487                            },
2488                        })
2489                    }
2490                    0x6f344a1c6b0a0610 => {
2491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2492                        let mut req = fidl::new_empty!(
2493                            fidl::encoding::EmptyPayload,
2494                            fdomain_client::fidl::FDomainResourceDialect
2495                        );
2496                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2497                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2498                        Ok(DirectoryRequest::QueryFilesystem {
2499                            responder: DirectoryQueryFilesystemResponder {
2500                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2501                                tx_id: header.tx_id,
2502                            },
2503                        })
2504                    }
2505                    0x3d4396a638ea053b => {
2506                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2507                        let mut req = fidl::new_empty!(
2508                            NodeGetAttributesRequest,
2509                            fdomain_client::fidl::FDomainResourceDialect
2510                        );
2511                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2512                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2513                        Ok(DirectoryRequest::GetAttributes {
2514                            query: req.query,
2515
2516                            responder: DirectoryGetAttributesResponder {
2517                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2518                                tx_id: header.tx_id,
2519                            },
2520                        })
2521                    }
2522                    0x3308c1da5a89bf08 => {
2523                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2524                        let mut req = fidl::new_empty!(
2525                            MutableNodeAttributes,
2526                            fdomain_client::fidl::FDomainResourceDialect
2527                        );
2528                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
2529                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2530                        Ok(DirectoryRequest::UpdateAttributes {
2531                            payload: req,
2532                            responder: DirectoryUpdateAttributesResponder {
2533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2534                                tx_id: header.tx_id,
2535                            },
2536                        })
2537                    }
2538                    0x2c5c27ca0ab5dc49 => {
2539                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2540                        let mut req = fidl::new_empty!(
2541                            fidl::encoding::EmptyPayload,
2542                            fdomain_client::fidl::FDomainResourceDialect
2543                        );
2544                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2545                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2546                        Ok(DirectoryRequest::Sync {
2547                            responder: DirectorySyncResponder {
2548                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2549                                tx_id: header.tx_id,
2550                            },
2551                        })
2552                    }
2553                    0x4b61033de007fcd0 => {
2554                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2555                        let mut req = fidl::new_empty!(
2556                            NodeListExtendedAttributesRequest,
2557                            fdomain_client::fidl::FDomainResourceDialect
2558                        );
2559                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2560                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2561                        Ok(DirectoryRequest::ListExtendedAttributes {
2562                            iterator: req.iterator,
2563
2564                            control_handle,
2565                        })
2566                    }
2567                    0x45ffa3ccfdeb76db => {
2568                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2569                        let mut req = fidl::new_empty!(
2570                            NodeGetExtendedAttributeRequest,
2571                            fdomain_client::fidl::FDomainResourceDialect
2572                        );
2573                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2574                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2575                        Ok(DirectoryRequest::GetExtendedAttribute {
2576                            name: req.name,
2577
2578                            responder: DirectoryGetExtendedAttributeResponder {
2579                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2580                                tx_id: header.tx_id,
2581                            },
2582                        })
2583                    }
2584                    0x4a951362f681f23c => {
2585                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2586                        let mut req = fidl::new_empty!(
2587                            NodeSetExtendedAttributeRequest,
2588                            fdomain_client::fidl::FDomainResourceDialect
2589                        );
2590                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2591                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2592                        Ok(DirectoryRequest::SetExtendedAttribute {
2593                            name: req.name,
2594                            value: req.value,
2595                            mode: req.mode,
2596
2597                            responder: DirectorySetExtendedAttributeResponder {
2598                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2599                                tx_id: header.tx_id,
2600                            },
2601                        })
2602                    }
2603                    0x7a0b9f3a9bf9032d => {
2604                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2605                        let mut req = fidl::new_empty!(
2606                            NodeRemoveExtendedAttributeRequest,
2607                            fdomain_client::fidl::FDomainResourceDialect
2608                        );
2609                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2610                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2611                        Ok(DirectoryRequest::RemoveExtendedAttribute {
2612                            name: req.name,
2613
2614                            responder: DirectoryRemoveExtendedAttributeResponder {
2615                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2616                                tx_id: header.tx_id,
2617                            },
2618                        })
2619                    }
2620                    0x568ddcb9a9cbb6d9 => {
2621                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2622                        let mut req = fidl::new_empty!(
2623                            OpenableOpenRequest,
2624                            fdomain_client::fidl::FDomainResourceDialect
2625                        );
2626                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2627                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2628                        Ok(DirectoryRequest::Open {
2629                            path: req.path,
2630                            flags: req.flags,
2631                            options: req.options,
2632                            object: req.object,
2633
2634                            control_handle,
2635                        })
2636                    }
2637                    0x2c5044561d685ec0 => {
2638                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2639                        let mut req = fidl::new_empty!(
2640                            DirectoryDeprecatedOpenRequest,
2641                            fdomain_client::fidl::FDomainResourceDialect
2642                        );
2643                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2644                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2645                        Ok(DirectoryRequest::DeprecatedOpen {
2646                            flags: req.flags,
2647                            mode: req.mode,
2648                            path: req.path,
2649                            object: req.object,
2650
2651                            control_handle,
2652                        })
2653                    }
2654                    0x3582806bf27faa0a => {
2655                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2656                        let mut req = fidl::new_empty!(
2657                            DirectoryReadDirentsRequest,
2658                            fdomain_client::fidl::FDomainResourceDialect
2659                        );
2660                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
2661                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2662                        Ok(DirectoryRequest::ReadDirents {
2663                            max_bytes: req.max_bytes,
2664
2665                            responder: DirectoryReadDirentsResponder {
2666                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2667                                tx_id: header.tx_id,
2668                            },
2669                        })
2670                    }
2671                    0x16b1202af0f34c71 => {
2672                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2673                        let mut req = fidl::new_empty!(
2674                            fidl::encoding::EmptyPayload,
2675                            fdomain_client::fidl::FDomainResourceDialect
2676                        );
2677                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2678                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2679                        Ok(DirectoryRequest::Rewind {
2680                            responder: DirectoryRewindResponder {
2681                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2682                                tx_id: header.tx_id,
2683                            },
2684                        })
2685                    }
2686                    0x26ae9d18763c8655 => {
2687                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2688                        let mut req = fidl::new_empty!(
2689                            fidl::encoding::EmptyPayload,
2690                            fdomain_client::fidl::FDomainResourceDialect
2691                        );
2692                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2693                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2694                        Ok(DirectoryRequest::GetToken {
2695                            responder: DirectoryGetTokenResponder {
2696                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2697                                tx_id: header.tx_id,
2698                            },
2699                        })
2700                    }
2701                    0x740604c0c7c930e7 => {
2702                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2703                        let mut req = fidl::new_empty!(
2704                            DirectoryLinkRequest,
2705                            fdomain_client::fidl::FDomainResourceDialect
2706                        );
2707                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
2708                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2709                        Ok(DirectoryRequest::Link {
2710                            src: req.src,
2711                            dst_parent_token: req.dst_parent_token,
2712                            dst: req.dst,
2713
2714                            responder: DirectoryLinkResponder {
2715                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2716                                tx_id: header.tx_id,
2717                            },
2718                        })
2719                    }
2720                    0x750a0326a78d7bed => {
2721                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2722                        let mut req = fidl::new_empty!(
2723                            DirectoryUnlinkRequest,
2724                            fdomain_client::fidl::FDomainResourceDialect
2725                        );
2726                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2727                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2728                        Ok(DirectoryRequest::Unlink {
2729                            name: req.name,
2730                            options: req.options,
2731
2732                            responder: DirectoryUnlinkResponder {
2733                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2734                                tx_id: header.tx_id,
2735                            },
2736                        })
2737                    }
2738                    0x7060e7723b9928de => {
2739                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2740                        let mut req = fidl::new_empty!(
2741                            DirectoryRenameRequest,
2742                            fdomain_client::fidl::FDomainResourceDialect
2743                        );
2744                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
2745                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2746                        Ok(DirectoryRequest::Rename {
2747                            src: req.src,
2748                            dst_parent_token: req.dst_parent_token,
2749                            dst: req.dst,
2750
2751                            responder: DirectoryRenameResponder {
2752                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2753                                tx_id: header.tx_id,
2754                            },
2755                        })
2756                    }
2757                    0x21ce0f19ec043889 => {
2758                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2759                        let mut req = fidl::new_empty!(
2760                            DirectoryCreateSymlinkRequest,
2761                            fdomain_client::fidl::FDomainResourceDialect
2762                        );
2763                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2764                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2765                        Ok(DirectoryRequest::CreateSymlink {
2766                            name: req.name,
2767                            target: req.target,
2768                            connection: req.connection,
2769
2770                            responder: DirectoryCreateSymlinkResponder {
2771                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2772                                tx_id: header.tx_id,
2773                            },
2774                        })
2775                    }
2776                    0x5717193a59d66d91 => {
2777                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2778                        let mut req = fidl::new_empty!(
2779                            DirectoryWatchRequest,
2780                            fdomain_client::fidl::FDomainResourceDialect
2781                        );
2782                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2783                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2784                        Ok(DirectoryRequest::Watch {
2785                            mask: req.mask,
2786                            options: req.options,
2787                            watcher: req.watcher,
2788
2789                            responder: DirectoryWatchResponder {
2790                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2791                                tx_id: header.tx_id,
2792                            },
2793                        })
2794                    }
2795                    _ if header.tx_id == 0
2796                        && header
2797                            .dynamic_flags()
2798                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2799                    {
2800                        Ok(DirectoryRequest::_UnknownMethod {
2801                            ordinal: header.ordinal,
2802                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2803                            method_type: fidl::MethodType::OneWay,
2804                        })
2805                    }
2806                    _ if header
2807                        .dynamic_flags()
2808                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2809                    {
2810                        this.inner.send_framework_err(
2811                            fidl::encoding::FrameworkErr::UnknownMethod,
2812                            header.tx_id,
2813                            header.ordinal,
2814                            header.dynamic_flags(),
2815                            (bytes, handles),
2816                        )?;
2817                        Ok(DirectoryRequest::_UnknownMethod {
2818                            ordinal: header.ordinal,
2819                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2820                            method_type: fidl::MethodType::TwoWay,
2821                        })
2822                    }
2823                    _ => Err(fidl::Error::UnknownOrdinal {
2824                        ordinal: header.ordinal,
2825                        protocol_name:
2826                            <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2827                    }),
2828                }))
2829            },
2830        )
2831    }
2832}
2833
2834/// Directory defines a node which is capable of containing other Objects.
2835#[derive(Debug)]
2836pub enum DirectoryRequest {
2837    /// Acquires an advisory lock on the underlying file.
2838    ///
2839    /// The lock lasts until either this connection is closed or
2840    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
2841    /// explicitly.
2842    ///
2843    /// Advisory locks are purely advisory. They do not prevent actual read or
2844    /// write operations from occurring on the file, either through this
2845    /// connection or through other connections.
2846    ///
2847    /// This method requires the following rights:
2848    ///
2849    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
2850    /// * [`Rights.WRITE_BYTES`] if `request.type` is
2851    ///   [`AdvisoryLockType.WRITE`].
2852    ///
2853    /// # Errors
2854    ///
2855    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
2856    ///   example, another connection might hold a conflicting lock type.
2857    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
2858    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
2859    ///   to acquire the given type of lock.
2860    AdvisoryLock {
2861        request: AdvisoryLockRequest,
2862        responder: DirectoryAdvisoryLockResponder,
2863    },
2864    Clone {
2865        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
2866        control_handle: DirectoryControlHandle,
2867    },
2868    /// Terminates the connection.
2869    ///
2870    /// After calling `Close`, the client must not send any other requests.
2871    ///
2872    /// Servers, after sending the status response, should close the connection
2873    /// regardless of status and without sending an epitaph.
2874    ///
2875    /// Closing the client end of the channel should be semantically equivalent
2876    /// to calling `Close` without knowing when the close has completed or its
2877    /// status.
2878    Close {
2879        responder: DirectoryCloseResponder,
2880    },
2881    Query {
2882        responder: DirectoryQueryResponder,
2883    },
2884    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
2885    DeprecatedClone {
2886        flags: OpenFlags,
2887        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
2888        control_handle: DirectoryControlHandle,
2889    },
2890    /// DEPRECATED - Use `Node.GetAttributes` instead.
2891    ///
2892    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2893    DeprecatedGetAttr {
2894        responder: DirectoryDeprecatedGetAttrResponder,
2895    },
2896    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
2897    DeprecatedSetAttr {
2898        flags: NodeAttributeFlags,
2899        attributes: NodeAttributes,
2900        responder: DirectoryDeprecatedSetAttrResponder,
2901    },
2902    /// [DEPRECATED - Use new GetFlags method instead.]
2903    DeprecatedGetFlags {
2904        responder: DirectoryDeprecatedGetFlagsResponder,
2905    },
2906    /// [DEPRECATED - Use new SetFlags method instead.]
2907    DeprecatedSetFlags {
2908        flags: OpenFlags,
2909        responder: DirectoryDeprecatedSetFlagsResponder,
2910    },
2911    /// Queries the flags that apply to this node after it has been opened/created. This method does
2912    /// not require any rights.
2913    ///
2914    /// Note that the final set of flags that apply to the connection may differ from those
2915    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2916    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2917    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2918    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2919    GetFlags {
2920        responder: DirectoryGetFlagsResponder,
2921    },
2922    /// Sets the flags that apply to this node after it has been opened. This method does not
2923    /// require any rights.
2924    ///
2925    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2926    /// clear append mode.
2927    ///
2928    /// Errors:
2929    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2930    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2931    SetFlags {
2932        flags: Flags,
2933        responder: DirectorySetFlagsResponder,
2934    },
2935    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2936    /// volume has different settings or the storage is accounted seperately from the rest of the
2937    /// filesystem that may be reported instead of filesystem-wide details.
2938    QueryFilesystem {
2939        responder: DirectoryQueryFilesystemResponder,
2940    },
2941    /// Acquires information about the node.
2942    ///
2943    /// The attributes of a node should be stable, independent of the
2944    /// specific protocol used to access it.
2945    ///
2946    /// If a particular attribute is not applicable or not supported,
2947    /// filesystems should leave the corresponding field absent.
2948    ///
2949    /// + `query` a bit-mask specifying which attributes to fetch. The server
2950    ///   should not return more than necessary.
2951    /// - `attributes` the returned attributes.
2952    ///
2953    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2954    GetAttributes {
2955        query: NodeAttributesQuery,
2956        responder: DirectoryGetAttributesResponder,
2957    },
2958    /// Updates information about the node.
2959    ///
2960    /// + `attributes` the presence of a table field in `attributes` indicates
2961    /// the intent to update the corresponding attribute.
2962    ///
2963    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2964    ///
2965    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2966    UpdateAttributes {
2967        payload: MutableNodeAttributes,
2968        responder: DirectoryUpdateAttributesResponder,
2969    },
2970    /// Synchronizes updates to the node to the underlying media, if it exists.
2971    ///
2972    /// This method will return when the filesystem server has flushed the
2973    /// relevant updates to the underlying media, but does not guarantee the
2974    /// underlying media has persisted the information, nor that any information
2975    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2976    /// between operations.
2977    ///
2978    /// This method does not require any rights.
2979    Sync {
2980        responder: DirectorySyncResponder,
2981    },
2982    /// Creates an iterator over all the extended attribute names associated
2983    /// with this node. If an error occurs it is returned as an epitaph on the
2984    /// iterator request channel, and then the channel is closed.
2985    ///
2986    /// GetExtendedAttributes can be used with any of these names to retrieve
2987    /// the associated value.
2988    ///
2989    /// This method requires the [`Rights.READ_BYTES`] right.
2990    ListExtendedAttributes {
2991        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
2992        control_handle: DirectoryControlHandle,
2993    },
2994    /// Get the value associated with the given attribute `name` for this node.
2995    ///
2996    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2997    /// particular structure is imposed on them.
2998    ///
2999    /// This method requires the [`Rights.READ_BYTES`] right.
3000    GetExtendedAttribute {
3001        name: Vec<u8>,
3002        responder: DirectoryGetExtendedAttributeResponder,
3003    },
3004    /// Set the value for the given attribute `name` to `value` for this node.
3005    ///
3006    /// The attribute name may exist, in which case the attribute is updated.
3007    /// If the attribute doesn't exist, it is created. The name should have no
3008    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3009    ///
3010    /// This method requires the [`Rights.WRITE_BYTES`] right.
3011    SetExtendedAttribute {
3012        name: Vec<u8>,
3013        value: ExtendedAttributeValue,
3014        mode: SetExtendedAttributeMode,
3015        responder: DirectorySetExtendedAttributeResponder,
3016    },
3017    /// Remove the specified extended attribute.
3018    ///
3019    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3020    ///
3021    /// This method requires the [`Rights.WRITE_BYTES`] right.
3022    RemoveExtendedAttribute {
3023        name: Vec<u8>,
3024        responder: DirectoryRemoveExtendedAttributeResponder,
3025    },
3026    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3027    /// epitaph sent on the `object` channel.
3028    ///
3029    /// Errors:
3030    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3031    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3032    Open {
3033        path: String,
3034        flags: Flags,
3035        options: Options,
3036        object: fdomain_client::Channel,
3037        control_handle: DirectoryControlHandle,
3038    },
3039    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3040    DeprecatedOpen {
3041        flags: OpenFlags,
3042        mode: ModeType,
3043        path: String,
3044        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
3045        control_handle: DirectoryControlHandle,
3046    },
3047    /// Reads a collection of variably sized dirents into a buffer.
3048    /// The number of dirents in a directory may be very large: akin to
3049    /// calling read multiple times on a file, directories have a seek
3050    /// offset which is updated on subsequent calls to ReadDirents.
3051    /// Each call to ReadDirents will only return whole dirent structures,
3052    /// they will not get split across ReadDirent calls. When the seek
3053    /// offset reaches the end, `dirents` will be empty.
3054    ///
3055    /// These dirents are of the form:
3056    /// ```
3057    /// struct dirent {
3058    ///   // Describes the inode of the entry.
3059    ///   uint64 ino;
3060    ///   // Describes the length of the dirent name in bytes.
3061    ///   uint8 size;
3062    ///   // Describes the type of the entry. Aligned with the
3063    ///   // POSIX d_type values. Use `DirentType` constants.
3064    ///   uint8 type;
3065    ///   // Unterminated name of entry.
3066    ///   char name[0];
3067    /// }
3068    /// ```
3069    ///
3070    /// This method requires the following rights:
3071    ///
3072    /// * [`Rights.ENUMERATE`]
3073    ReadDirents {
3074        max_bytes: u64,
3075        responder: DirectoryReadDirentsResponder,
3076    },
3077    /// Resets the directory seek offset.
3078    ///
3079    /// This method requires the following rights:
3080    ///
3081    /// * [`Rights.ENUMERATE`]
3082    Rewind {
3083        responder: DirectoryRewindResponder,
3084    },
3085    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3086    /// in time. The token will remain valid for as long as the connection requesting the token
3087    /// remains open.
3088    ///
3089    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3090    /// `ZX_ERR_BAD_HANDLE`.
3091    GetToken {
3092        responder: DirectoryGetTokenResponder,
3093    },
3094    /// Creates a link to an object named src by the name dst, within a directory represented by
3095    /// token.
3096    ///
3097    /// `src` must be a resolved object name. Including "/" in the string will
3098    /// return `ZX_ERR_INVALID_ARGS`.
3099    ///
3100    /// `dst` must be a resolved object name. Including "/" in the string will
3101    /// return `ZX_ERR_INVALID_ARGS`.
3102    ///
3103    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3104    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3105    ///
3106    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3107    /// there are two actors operating concurrently, and one actor performs a rename that affects
3108    /// the source within this directory, and the other does a link, each will appear to occur
3109    /// atomically in an unspecified order.
3110    Link {
3111        src: String,
3112        dst_parent_token: fdomain_client::NullableHandle,
3113        dst: String,
3114        responder: DirectoryLinkResponder,
3115    },
3116    /// Removes a child node from the this directory's list of entries.
3117    ///
3118    /// Note: this does not guarantee that the underlying object is destroyed.
3119    /// Although the link will be removed from the containing directory,
3120    /// objects with multiple references (such as files which are still open)
3121    /// will not actually be destroyed until all references are closed.
3122    ///
3123    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3124    ///   [`Rights.WRITE_BYTES`].
3125    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3126    ///   support writing.
3127    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3128    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3129    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3130    ///   containing a remote channel.
3131    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3132    ///     something other than a directory was found.
3133    ///
3134    /// Other errors may be returned for filesystem-specific reasons.
3135    ///
3136    /// This method requires the following rights:
3137    ///
3138    /// * [`Rights.ENUMERATE`]
3139    /// * [`Rights.MODIFY_DIRECTORY`]
3140    Unlink {
3141        name: String,
3142        options: UnlinkOptions,
3143        responder: DirectoryUnlinkResponder,
3144    },
3145    /// Renames a node named `src` to the name `dst`, in a directory represented
3146    /// by `dst_parent_token`.
3147    ///
3148    /// `src` and `dst` must be valid node names.
3149    /// See [`Name`] for what constitutes a valid name.
3150    ///
3151    /// This method requires the following rights on both the current connection, and the connection
3152    /// identified by `dst_parent_token`:
3153    ///
3154    /// * [`Rights.ENUMERATE`]
3155    /// * [`Rights.MODIFY_DIRECTORY`]
3156    ///
3157    /// The following requirements are necessary to avoid rights escalations.
3158    ///
3159    /// If the source and destination directory differ, the source directory must also have the
3160    /// maximal set of abilities supported for files, which would typically be
3161    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
3162    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
3163    /// right.
3164    ///
3165    /// If `src` refers to a directory, and differs from the destination directory, then the source
3166    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
3167    ///
3168    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
3169    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
3170    Rename {
3171        src: String,
3172        dst_parent_token: fdomain_client::Event,
3173        dst: String,
3174        responder: DirectoryRenameResponder,
3175    },
3176    /// Creates a symbolic link.
3177    ///
3178    /// `name` is the name to be given to the created symbolic link.
3179    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
3180    /// will perform no validation of `target` except for a server chosen maximum length.
3181    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
3182    /// on the successfully created node.
3183    ///
3184    /// * [`Rights.MODIFY_DIRECTORY`]
3185    ///
3186    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
3187    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
3188    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
3189    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
3190    CreateSymlink {
3191        name: String,
3192        target: Vec<u8>,
3193        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3194        responder: DirectoryCreateSymlinkResponder,
3195    },
3196    /// Watches a directory, receiving events of added messages on the
3197    /// watcher request channel.
3198    ///
3199    /// Options must be zero; it is reserved.
3200    ///
3201    /// This method requires the following rights:
3202    ///
3203    /// * [`Rights.ENUMERATE`]
3204    Watch {
3205        mask: WatchMask,
3206        options: u32,
3207        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3208        responder: DirectoryWatchResponder,
3209    },
3210    /// An interaction was received which does not match any known method.
3211    #[non_exhaustive]
3212    _UnknownMethod {
3213        /// Ordinal of the method that was called.
3214        ordinal: u64,
3215        control_handle: DirectoryControlHandle,
3216        method_type: fidl::MethodType,
3217    },
3218}
3219
3220impl DirectoryRequest {
3221    #[allow(irrefutable_let_patterns)]
3222    pub fn into_advisory_lock(
3223        self,
3224    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
3225        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
3226            Some((request, responder))
3227        } else {
3228            None
3229        }
3230    }
3231
3232    #[allow(irrefutable_let_patterns)]
3233    pub fn into_clone(
3234        self,
3235    ) -> Option<(
3236        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
3237        DirectoryControlHandle,
3238    )> {
3239        if let DirectoryRequest::Clone { request, control_handle } = self {
3240            Some((request, control_handle))
3241        } else {
3242            None
3243        }
3244    }
3245
3246    #[allow(irrefutable_let_patterns)]
3247    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
3248        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
3249    }
3250
3251    #[allow(irrefutable_let_patterns)]
3252    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
3253        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
3254    }
3255
3256    #[allow(irrefutable_let_patterns)]
3257    pub fn into_deprecated_clone(
3258        self,
3259    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, DirectoryControlHandle)>
3260    {
3261        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
3262            Some((flags, object, control_handle))
3263        } else {
3264            None
3265        }
3266    }
3267
3268    #[allow(irrefutable_let_patterns)]
3269    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
3270        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
3271            Some((responder))
3272        } else {
3273            None
3274        }
3275    }
3276
3277    #[allow(irrefutable_let_patterns)]
3278    pub fn into_deprecated_set_attr(
3279        self,
3280    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
3281        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
3282            Some((flags, attributes, responder))
3283        } else {
3284            None
3285        }
3286    }
3287
3288    #[allow(irrefutable_let_patterns)]
3289    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
3290        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
3291            Some((responder))
3292        } else {
3293            None
3294        }
3295    }
3296
3297    #[allow(irrefutable_let_patterns)]
3298    pub fn into_deprecated_set_flags(
3299        self,
3300    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
3301        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
3302            Some((flags, responder))
3303        } else {
3304            None
3305        }
3306    }
3307
3308    #[allow(irrefutable_let_patterns)]
3309    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
3310        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
3311    }
3312
3313    #[allow(irrefutable_let_patterns)]
3314    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
3315        if let DirectoryRequest::SetFlags { flags, responder } = self {
3316            Some((flags, responder))
3317        } else {
3318            None
3319        }
3320    }
3321
3322    #[allow(irrefutable_let_patterns)]
3323    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
3324        if let DirectoryRequest::QueryFilesystem { responder } = self {
3325            Some((responder))
3326        } else {
3327            None
3328        }
3329    }
3330
3331    #[allow(irrefutable_let_patterns)]
3332    pub fn into_get_attributes(
3333        self,
3334    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
3335        if let DirectoryRequest::GetAttributes { query, responder } = self {
3336            Some((query, responder))
3337        } else {
3338            None
3339        }
3340    }
3341
3342    #[allow(irrefutable_let_patterns)]
3343    pub fn into_update_attributes(
3344        self,
3345    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
3346        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
3347            Some((payload, responder))
3348        } else {
3349            None
3350        }
3351    }
3352
3353    #[allow(irrefutable_let_patterns)]
3354    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
3355        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
3356    }
3357
3358    #[allow(irrefutable_let_patterns)]
3359    pub fn into_list_extended_attributes(
3360        self,
3361    ) -> Option<(
3362        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3363        DirectoryControlHandle,
3364    )> {
3365        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
3366            Some((iterator, control_handle))
3367        } else {
3368            None
3369        }
3370    }
3371
3372    #[allow(irrefutable_let_patterns)]
3373    pub fn into_get_extended_attribute(
3374        self,
3375    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
3376        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
3377            Some((name, responder))
3378        } else {
3379            None
3380        }
3381    }
3382
3383    #[allow(irrefutable_let_patterns)]
3384    pub fn into_set_extended_attribute(
3385        self,
3386    ) -> Option<(
3387        Vec<u8>,
3388        ExtendedAttributeValue,
3389        SetExtendedAttributeMode,
3390        DirectorySetExtendedAttributeResponder,
3391    )> {
3392        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
3393            Some((name, value, mode, responder))
3394        } else {
3395            None
3396        }
3397    }
3398
3399    #[allow(irrefutable_let_patterns)]
3400    pub fn into_remove_extended_attribute(
3401        self,
3402    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
3403        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
3404            Some((name, responder))
3405        } else {
3406            None
3407        }
3408    }
3409
3410    #[allow(irrefutable_let_patterns)]
3411    pub fn into_open(
3412        self,
3413    ) -> Option<(String, Flags, Options, fdomain_client::Channel, DirectoryControlHandle)> {
3414        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
3415            Some((path, flags, options, object, control_handle))
3416        } else {
3417            None
3418        }
3419    }
3420
3421    #[allow(irrefutable_let_patterns)]
3422    pub fn into_deprecated_open(
3423        self,
3424    ) -> Option<(
3425        OpenFlags,
3426        ModeType,
3427        String,
3428        fdomain_client::fidl::ServerEnd<NodeMarker>,
3429        DirectoryControlHandle,
3430    )> {
3431        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
3432        {
3433            Some((flags, mode, path, object, control_handle))
3434        } else {
3435            None
3436        }
3437    }
3438
3439    #[allow(irrefutable_let_patterns)]
3440    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
3441        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
3442            Some((max_bytes, responder))
3443        } else {
3444            None
3445        }
3446    }
3447
3448    #[allow(irrefutable_let_patterns)]
3449    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
3450        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
3451    }
3452
3453    #[allow(irrefutable_let_patterns)]
3454    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
3455        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
3456    }
3457
3458    #[allow(irrefutable_let_patterns)]
3459    pub fn into_link(
3460        self,
3461    ) -> Option<(String, fdomain_client::NullableHandle, String, DirectoryLinkResponder)> {
3462        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
3463            Some((src, dst_parent_token, dst, responder))
3464        } else {
3465            None
3466        }
3467    }
3468
3469    #[allow(irrefutable_let_patterns)]
3470    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
3471        if let DirectoryRequest::Unlink { name, options, responder } = self {
3472            Some((name, options, responder))
3473        } else {
3474            None
3475        }
3476    }
3477
3478    #[allow(irrefutable_let_patterns)]
3479    pub fn into_rename(
3480        self,
3481    ) -> Option<(String, fdomain_client::Event, String, DirectoryRenameResponder)> {
3482        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
3483            Some((src, dst_parent_token, dst, responder))
3484        } else {
3485            None
3486        }
3487    }
3488
3489    #[allow(irrefutable_let_patterns)]
3490    pub fn into_create_symlink(
3491        self,
3492    ) -> Option<(
3493        String,
3494        Vec<u8>,
3495        Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3496        DirectoryCreateSymlinkResponder,
3497    )> {
3498        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
3499            Some((name, target, connection, responder))
3500        } else {
3501            None
3502        }
3503    }
3504
3505    #[allow(irrefutable_let_patterns)]
3506    pub fn into_watch(
3507        self,
3508    ) -> Option<(
3509        WatchMask,
3510        u32,
3511        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3512        DirectoryWatchResponder,
3513    )> {
3514        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
3515            Some((mask, options, watcher, responder))
3516        } else {
3517            None
3518        }
3519    }
3520
3521    /// Name of the method defined in FIDL
3522    pub fn method_name(&self) -> &'static str {
3523        match *self {
3524            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
3525            DirectoryRequest::Clone { .. } => "clone",
3526            DirectoryRequest::Close { .. } => "close",
3527            DirectoryRequest::Query { .. } => "query",
3528            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
3529            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
3530            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
3531            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
3532            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
3533            DirectoryRequest::GetFlags { .. } => "get_flags",
3534            DirectoryRequest::SetFlags { .. } => "set_flags",
3535            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
3536            DirectoryRequest::GetAttributes { .. } => "get_attributes",
3537            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
3538            DirectoryRequest::Sync { .. } => "sync",
3539            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
3540            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
3541            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
3542            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
3543            DirectoryRequest::Open { .. } => "open",
3544            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
3545            DirectoryRequest::ReadDirents { .. } => "read_dirents",
3546            DirectoryRequest::Rewind { .. } => "rewind",
3547            DirectoryRequest::GetToken { .. } => "get_token",
3548            DirectoryRequest::Link { .. } => "link",
3549            DirectoryRequest::Unlink { .. } => "unlink",
3550            DirectoryRequest::Rename { .. } => "rename",
3551            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
3552            DirectoryRequest::Watch { .. } => "watch",
3553            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3554                "unknown one-way method"
3555            }
3556            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3557                "unknown two-way method"
3558            }
3559        }
3560    }
3561}
3562
3563#[derive(Debug, Clone)]
3564pub struct DirectoryControlHandle {
3565    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3566}
3567
3568impl DirectoryControlHandle {
3569    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3570        self.inner.shutdown_with_epitaph(status.into())
3571    }
3572}
3573
3574impl fdomain_client::fidl::ControlHandle for DirectoryControlHandle {
3575    fn shutdown(&self) {
3576        self.inner.shutdown()
3577    }
3578
3579    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3580        self.inner.shutdown_with_epitaph(status)
3581    }
3582
3583    fn is_closed(&self) -> bool {
3584        self.inner.channel().is_closed()
3585    }
3586    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3587        self.inner.channel().on_closed()
3588    }
3589}
3590
3591impl DirectoryControlHandle {
3592    pub fn send_on_open_(
3593        &self,
3594        mut s: i32,
3595        mut info: Option<NodeInfoDeprecated>,
3596    ) -> Result<(), fidl::Error> {
3597        self.inner.send::<NodeOnOpenRequest>(
3598            (s, info.as_mut()),
3599            0,
3600            0x7fc7bbb1dbfd1972,
3601            fidl::encoding::DynamicFlags::FLEXIBLE,
3602        )
3603    }
3604
3605    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
3606        self.inner.send::<Representation>(
3607            &mut payload,
3608            0,
3609            0x5cb40567d80a510c,
3610            fidl::encoding::DynamicFlags::empty(),
3611        )
3612    }
3613}
3614
3615#[must_use = "FIDL methods require a response to be sent"]
3616#[derive(Debug)]
3617pub struct DirectoryAdvisoryLockResponder {
3618    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3619    tx_id: u32,
3620}
3621
3622/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3623/// if the responder is dropped without sending a response, so that the client
3624/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3625impl std::ops::Drop for DirectoryAdvisoryLockResponder {
3626    fn drop(&mut self) {
3627        self.control_handle.shutdown();
3628        // Safety: drops once, never accessed again
3629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3630    }
3631}
3632
3633impl fdomain_client::fidl::Responder for DirectoryAdvisoryLockResponder {
3634    type ControlHandle = DirectoryControlHandle;
3635
3636    fn control_handle(&self) -> &DirectoryControlHandle {
3637        &self.control_handle
3638    }
3639
3640    fn drop_without_shutdown(mut self) {
3641        // Safety: drops once, never accessed again due to mem::forget
3642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3643        // Prevent Drop from running (which would shut down the channel)
3644        std::mem::forget(self);
3645    }
3646}
3647
3648impl DirectoryAdvisoryLockResponder {
3649    /// Sends a response to the FIDL transaction.
3650    ///
3651    /// Sets the channel to shutdown if an error occurs.
3652    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3653        let _result = self.send_raw(result);
3654        if _result.is_err() {
3655            self.control_handle.shutdown();
3656        }
3657        self.drop_without_shutdown();
3658        _result
3659    }
3660
3661    /// Similar to "send" but does not shutdown the channel if an error occurs.
3662    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3663        let _result = self.send_raw(result);
3664        self.drop_without_shutdown();
3665        _result
3666    }
3667
3668    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3669        self.control_handle
3670            .inner
3671            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3672                result,
3673                self.tx_id,
3674                0x6ee9c0ad53ec87aa,
3675                fidl::encoding::DynamicFlags::empty(),
3676            )
3677    }
3678}
3679
3680#[must_use = "FIDL methods require a response to be sent"]
3681#[derive(Debug)]
3682pub struct DirectoryCloseResponder {
3683    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3684    tx_id: u32,
3685}
3686
3687/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3688/// if the responder is dropped without sending a response, so that the client
3689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3690impl std::ops::Drop for DirectoryCloseResponder {
3691    fn drop(&mut self) {
3692        self.control_handle.shutdown();
3693        // Safety: drops once, never accessed again
3694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3695    }
3696}
3697
3698impl fdomain_client::fidl::Responder for DirectoryCloseResponder {
3699    type ControlHandle = DirectoryControlHandle;
3700
3701    fn control_handle(&self) -> &DirectoryControlHandle {
3702        &self.control_handle
3703    }
3704
3705    fn drop_without_shutdown(mut self) {
3706        // Safety: drops once, never accessed again due to mem::forget
3707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3708        // Prevent Drop from running (which would shut down the channel)
3709        std::mem::forget(self);
3710    }
3711}
3712
3713impl DirectoryCloseResponder {
3714    /// Sends a response to the FIDL transaction.
3715    ///
3716    /// Sets the channel to shutdown if an error occurs.
3717    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3718        let _result = self.send_raw(result);
3719        if _result.is_err() {
3720            self.control_handle.shutdown();
3721        }
3722        self.drop_without_shutdown();
3723        _result
3724    }
3725
3726    /// Similar to "send" but does not shutdown the channel if an error occurs.
3727    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3728        let _result = self.send_raw(result);
3729        self.drop_without_shutdown();
3730        _result
3731    }
3732
3733    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3734        self.control_handle
3735            .inner
3736            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3737                result,
3738                self.tx_id,
3739                0x5ac5d459ad7f657e,
3740                fidl::encoding::DynamicFlags::empty(),
3741            )
3742    }
3743}
3744
3745#[must_use = "FIDL methods require a response to be sent"]
3746#[derive(Debug)]
3747pub struct DirectoryQueryResponder {
3748    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3749    tx_id: u32,
3750}
3751
3752/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3753/// if the responder is dropped without sending a response, so that the client
3754/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3755impl std::ops::Drop for DirectoryQueryResponder {
3756    fn drop(&mut self) {
3757        self.control_handle.shutdown();
3758        // Safety: drops once, never accessed again
3759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3760    }
3761}
3762
3763impl fdomain_client::fidl::Responder for DirectoryQueryResponder {
3764    type ControlHandle = DirectoryControlHandle;
3765
3766    fn control_handle(&self) -> &DirectoryControlHandle {
3767        &self.control_handle
3768    }
3769
3770    fn drop_without_shutdown(mut self) {
3771        // Safety: drops once, never accessed again due to mem::forget
3772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3773        // Prevent Drop from running (which would shut down the channel)
3774        std::mem::forget(self);
3775    }
3776}
3777
3778impl DirectoryQueryResponder {
3779    /// Sends a response to the FIDL transaction.
3780    ///
3781    /// Sets the channel to shutdown if an error occurs.
3782    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3783        let _result = self.send_raw(protocol);
3784        if _result.is_err() {
3785            self.control_handle.shutdown();
3786        }
3787        self.drop_without_shutdown();
3788        _result
3789    }
3790
3791    /// Similar to "send" but does not shutdown the channel if an error occurs.
3792    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3793        let _result = self.send_raw(protocol);
3794        self.drop_without_shutdown();
3795        _result
3796    }
3797
3798    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3799        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
3800            (protocol,),
3801            self.tx_id,
3802            0x2658edee9decfc06,
3803            fidl::encoding::DynamicFlags::empty(),
3804        )
3805    }
3806}
3807
3808#[must_use = "FIDL methods require a response to be sent"]
3809#[derive(Debug)]
3810pub struct DirectoryDeprecatedGetAttrResponder {
3811    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3812    tx_id: u32,
3813}
3814
3815/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3816/// if the responder is dropped without sending a response, so that the client
3817/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3818impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
3819    fn drop(&mut self) {
3820        self.control_handle.shutdown();
3821        // Safety: drops once, never accessed again
3822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3823    }
3824}
3825
3826impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetAttrResponder {
3827    type ControlHandle = DirectoryControlHandle;
3828
3829    fn control_handle(&self) -> &DirectoryControlHandle {
3830        &self.control_handle
3831    }
3832
3833    fn drop_without_shutdown(mut self) {
3834        // Safety: drops once, never accessed again due to mem::forget
3835        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3836        // Prevent Drop from running (which would shut down the channel)
3837        std::mem::forget(self);
3838    }
3839}
3840
3841impl DirectoryDeprecatedGetAttrResponder {
3842    /// Sends a response to the FIDL transaction.
3843    ///
3844    /// Sets the channel to shutdown if an error occurs.
3845    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3846        let _result = self.send_raw(s, attributes);
3847        if _result.is_err() {
3848            self.control_handle.shutdown();
3849        }
3850        self.drop_without_shutdown();
3851        _result
3852    }
3853
3854    /// Similar to "send" but does not shutdown the channel if an error occurs.
3855    pub fn send_no_shutdown_on_err(
3856        self,
3857        mut s: i32,
3858        mut attributes: &NodeAttributes,
3859    ) -> Result<(), fidl::Error> {
3860        let _result = self.send_raw(s, attributes);
3861        self.drop_without_shutdown();
3862        _result
3863    }
3864
3865    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3866        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
3867            (s, attributes),
3868            self.tx_id,
3869            0x78985e216314dafd,
3870            fidl::encoding::DynamicFlags::empty(),
3871        )
3872    }
3873}
3874
3875#[must_use = "FIDL methods require a response to be sent"]
3876#[derive(Debug)]
3877pub struct DirectoryDeprecatedSetAttrResponder {
3878    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3879    tx_id: u32,
3880}
3881
3882/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3883/// if the responder is dropped without sending a response, so that the client
3884/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3885impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
3886    fn drop(&mut self) {
3887        self.control_handle.shutdown();
3888        // Safety: drops once, never accessed again
3889        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3890    }
3891}
3892
3893impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetAttrResponder {
3894    type ControlHandle = DirectoryControlHandle;
3895
3896    fn control_handle(&self) -> &DirectoryControlHandle {
3897        &self.control_handle
3898    }
3899
3900    fn drop_without_shutdown(mut self) {
3901        // Safety: drops once, never accessed again due to mem::forget
3902        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3903        // Prevent Drop from running (which would shut down the channel)
3904        std::mem::forget(self);
3905    }
3906}
3907
3908impl DirectoryDeprecatedSetAttrResponder {
3909    /// Sends a response to the FIDL transaction.
3910    ///
3911    /// Sets the channel to shutdown if an error occurs.
3912    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
3913        let _result = self.send_raw(s);
3914        if _result.is_err() {
3915            self.control_handle.shutdown();
3916        }
3917        self.drop_without_shutdown();
3918        _result
3919    }
3920
3921    /// Similar to "send" but does not shutdown the channel if an error occurs.
3922    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
3923        let _result = self.send_raw(s);
3924        self.drop_without_shutdown();
3925        _result
3926    }
3927
3928    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
3929        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
3930            (s,),
3931            self.tx_id,
3932            0x4186c0f40d938f46,
3933            fidl::encoding::DynamicFlags::empty(),
3934        )
3935    }
3936}
3937
3938#[must_use = "FIDL methods require a response to be sent"]
3939#[derive(Debug)]
3940pub struct DirectoryDeprecatedGetFlagsResponder {
3941    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3942    tx_id: u32,
3943}
3944
3945/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3946/// if the responder is dropped without sending a response, so that the client
3947/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3948impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
3949    fn drop(&mut self) {
3950        self.control_handle.shutdown();
3951        // Safety: drops once, never accessed again
3952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3953    }
3954}
3955
3956impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetFlagsResponder {
3957    type ControlHandle = DirectoryControlHandle;
3958
3959    fn control_handle(&self) -> &DirectoryControlHandle {
3960        &self.control_handle
3961    }
3962
3963    fn drop_without_shutdown(mut self) {
3964        // Safety: drops once, never accessed again due to mem::forget
3965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3966        // Prevent Drop from running (which would shut down the channel)
3967        std::mem::forget(self);
3968    }
3969}
3970
3971impl DirectoryDeprecatedGetFlagsResponder {
3972    /// Sends a response to the FIDL transaction.
3973    ///
3974    /// Sets the channel to shutdown if an error occurs.
3975    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3976        let _result = self.send_raw(s, flags);
3977        if _result.is_err() {
3978            self.control_handle.shutdown();
3979        }
3980        self.drop_without_shutdown();
3981        _result
3982    }
3983
3984    /// Similar to "send" but does not shutdown the channel if an error occurs.
3985    pub fn send_no_shutdown_on_err(
3986        self,
3987        mut s: i32,
3988        mut flags: OpenFlags,
3989    ) -> Result<(), fidl::Error> {
3990        let _result = self.send_raw(s, flags);
3991        self.drop_without_shutdown();
3992        _result
3993    }
3994
3995    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3996        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
3997            (s, flags),
3998            self.tx_id,
3999            0x5b88fffb8eda3aa1,
4000            fidl::encoding::DynamicFlags::empty(),
4001        )
4002    }
4003}
4004
4005#[must_use = "FIDL methods require a response to be sent"]
4006#[derive(Debug)]
4007pub struct DirectoryDeprecatedSetFlagsResponder {
4008    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4009    tx_id: u32,
4010}
4011
4012/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4013/// if the responder is dropped without sending a response, so that the client
4014/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4015impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4016    fn drop(&mut self) {
4017        self.control_handle.shutdown();
4018        // Safety: drops once, never accessed again
4019        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4020    }
4021}
4022
4023impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetFlagsResponder {
4024    type ControlHandle = DirectoryControlHandle;
4025
4026    fn control_handle(&self) -> &DirectoryControlHandle {
4027        &self.control_handle
4028    }
4029
4030    fn drop_without_shutdown(mut self) {
4031        // Safety: drops once, never accessed again due to mem::forget
4032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4033        // Prevent Drop from running (which would shut down the channel)
4034        std::mem::forget(self);
4035    }
4036}
4037
4038impl DirectoryDeprecatedSetFlagsResponder {
4039    /// Sends a response to the FIDL transaction.
4040    ///
4041    /// Sets the channel to shutdown if an error occurs.
4042    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4043        let _result = self.send_raw(s);
4044        if _result.is_err() {
4045            self.control_handle.shutdown();
4046        }
4047        self.drop_without_shutdown();
4048        _result
4049    }
4050
4051    /// Similar to "send" but does not shutdown the channel if an error occurs.
4052    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4053        let _result = self.send_raw(s);
4054        self.drop_without_shutdown();
4055        _result
4056    }
4057
4058    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4059        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4060            (s,),
4061            self.tx_id,
4062            0x5295b76c71fde733,
4063            fidl::encoding::DynamicFlags::empty(),
4064        )
4065    }
4066}
4067
4068#[must_use = "FIDL methods require a response to be sent"]
4069#[derive(Debug)]
4070pub struct DirectoryGetFlagsResponder {
4071    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4072    tx_id: u32,
4073}
4074
4075/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4076/// if the responder is dropped without sending a response, so that the client
4077/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4078impl std::ops::Drop for DirectoryGetFlagsResponder {
4079    fn drop(&mut self) {
4080        self.control_handle.shutdown();
4081        // Safety: drops once, never accessed again
4082        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4083    }
4084}
4085
4086impl fdomain_client::fidl::Responder for DirectoryGetFlagsResponder {
4087    type ControlHandle = DirectoryControlHandle;
4088
4089    fn control_handle(&self) -> &DirectoryControlHandle {
4090        &self.control_handle
4091    }
4092
4093    fn drop_without_shutdown(mut self) {
4094        // Safety: drops once, never accessed again due to mem::forget
4095        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4096        // Prevent Drop from running (which would shut down the channel)
4097        std::mem::forget(self);
4098    }
4099}
4100
4101impl DirectoryGetFlagsResponder {
4102    /// Sends a response to the FIDL transaction.
4103    ///
4104    /// Sets the channel to shutdown if an error occurs.
4105    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4106        let _result = self.send_raw(result);
4107        if _result.is_err() {
4108            self.control_handle.shutdown();
4109        }
4110        self.drop_without_shutdown();
4111        _result
4112    }
4113
4114    /// Similar to "send" but does not shutdown the channel if an error occurs.
4115    pub fn send_no_shutdown_on_err(
4116        self,
4117        mut result: Result<Flags, i32>,
4118    ) -> Result<(), fidl::Error> {
4119        let _result = self.send_raw(result);
4120        self.drop_without_shutdown();
4121        _result
4122    }
4123
4124    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4125        self.control_handle
4126            .inner
4127            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4128                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4129                self.tx_id,
4130                0x176eb318f64ec23,
4131                fidl::encoding::DynamicFlags::FLEXIBLE,
4132            )
4133    }
4134}
4135
4136#[must_use = "FIDL methods require a response to be sent"]
4137#[derive(Debug)]
4138pub struct DirectorySetFlagsResponder {
4139    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4140    tx_id: u32,
4141}
4142
4143/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4144/// if the responder is dropped without sending a response, so that the client
4145/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4146impl std::ops::Drop for DirectorySetFlagsResponder {
4147    fn drop(&mut self) {
4148        self.control_handle.shutdown();
4149        // Safety: drops once, never accessed again
4150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4151    }
4152}
4153
4154impl fdomain_client::fidl::Responder for DirectorySetFlagsResponder {
4155    type ControlHandle = DirectoryControlHandle;
4156
4157    fn control_handle(&self) -> &DirectoryControlHandle {
4158        &self.control_handle
4159    }
4160
4161    fn drop_without_shutdown(mut self) {
4162        // Safety: drops once, never accessed again due to mem::forget
4163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4164        // Prevent Drop from running (which would shut down the channel)
4165        std::mem::forget(self);
4166    }
4167}
4168
4169impl DirectorySetFlagsResponder {
4170    /// Sends a response to the FIDL transaction.
4171    ///
4172    /// Sets the channel to shutdown if an error occurs.
4173    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4174        let _result = self.send_raw(result);
4175        if _result.is_err() {
4176            self.control_handle.shutdown();
4177        }
4178        self.drop_without_shutdown();
4179        _result
4180    }
4181
4182    /// Similar to "send" but does not shutdown the channel if an error occurs.
4183    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4184        let _result = self.send_raw(result);
4185        self.drop_without_shutdown();
4186        _result
4187    }
4188
4189    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4190        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4191            fidl::encoding::EmptyStruct,
4192            i32,
4193        >>(
4194            fidl::encoding::FlexibleResult::new(result),
4195            self.tx_id,
4196            0x55a8028685791ea8,
4197            fidl::encoding::DynamicFlags::FLEXIBLE,
4198        )
4199    }
4200}
4201
4202#[must_use = "FIDL methods require a response to be sent"]
4203#[derive(Debug)]
4204pub struct DirectoryQueryFilesystemResponder {
4205    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4206    tx_id: u32,
4207}
4208
4209/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4210/// if the responder is dropped without sending a response, so that the client
4211/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4212impl std::ops::Drop for DirectoryQueryFilesystemResponder {
4213    fn drop(&mut self) {
4214        self.control_handle.shutdown();
4215        // Safety: drops once, never accessed again
4216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4217    }
4218}
4219
4220impl fdomain_client::fidl::Responder for DirectoryQueryFilesystemResponder {
4221    type ControlHandle = DirectoryControlHandle;
4222
4223    fn control_handle(&self) -> &DirectoryControlHandle {
4224        &self.control_handle
4225    }
4226
4227    fn drop_without_shutdown(mut self) {
4228        // Safety: drops once, never accessed again due to mem::forget
4229        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4230        // Prevent Drop from running (which would shut down the channel)
4231        std::mem::forget(self);
4232    }
4233}
4234
4235impl DirectoryQueryFilesystemResponder {
4236    /// Sends a response to the FIDL transaction.
4237    ///
4238    /// Sets the channel to shutdown if an error occurs.
4239    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4240        let _result = self.send_raw(s, info);
4241        if _result.is_err() {
4242            self.control_handle.shutdown();
4243        }
4244        self.drop_without_shutdown();
4245        _result
4246    }
4247
4248    /// Similar to "send" but does not shutdown the channel if an error occurs.
4249    pub fn send_no_shutdown_on_err(
4250        self,
4251        mut s: i32,
4252        mut info: Option<&FilesystemInfo>,
4253    ) -> Result<(), fidl::Error> {
4254        let _result = self.send_raw(s, info);
4255        self.drop_without_shutdown();
4256        _result
4257    }
4258
4259    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4260        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
4261            (s, info),
4262            self.tx_id,
4263            0x6f344a1c6b0a0610,
4264            fidl::encoding::DynamicFlags::empty(),
4265        )
4266    }
4267}
4268
4269#[must_use = "FIDL methods require a response to be sent"]
4270#[derive(Debug)]
4271pub struct DirectoryGetAttributesResponder {
4272    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4273    tx_id: u32,
4274}
4275
4276/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4277/// if the responder is dropped without sending a response, so that the client
4278/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4279impl std::ops::Drop for DirectoryGetAttributesResponder {
4280    fn drop(&mut self) {
4281        self.control_handle.shutdown();
4282        // Safety: drops once, never accessed again
4283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4284    }
4285}
4286
4287impl fdomain_client::fidl::Responder for DirectoryGetAttributesResponder {
4288    type ControlHandle = DirectoryControlHandle;
4289
4290    fn control_handle(&self) -> &DirectoryControlHandle {
4291        &self.control_handle
4292    }
4293
4294    fn drop_without_shutdown(mut self) {
4295        // Safety: drops once, never accessed again due to mem::forget
4296        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4297        // Prevent Drop from running (which would shut down the channel)
4298        std::mem::forget(self);
4299    }
4300}
4301
4302impl DirectoryGetAttributesResponder {
4303    /// Sends a response to the FIDL transaction.
4304    ///
4305    /// Sets the channel to shutdown if an error occurs.
4306    pub fn send(
4307        self,
4308        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4309    ) -> Result<(), fidl::Error> {
4310        let _result = self.send_raw(result);
4311        if _result.is_err() {
4312            self.control_handle.shutdown();
4313        }
4314        self.drop_without_shutdown();
4315        _result
4316    }
4317
4318    /// Similar to "send" but does not shutdown the channel if an error occurs.
4319    pub fn send_no_shutdown_on_err(
4320        self,
4321        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4322    ) -> Result<(), fidl::Error> {
4323        let _result = self.send_raw(result);
4324        self.drop_without_shutdown();
4325        _result
4326    }
4327
4328    fn send_raw(
4329        &self,
4330        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4331    ) -> Result<(), fidl::Error> {
4332        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
4333            result,
4334            self.tx_id,
4335            0x3d4396a638ea053b,
4336            fidl::encoding::DynamicFlags::empty(),
4337        )
4338    }
4339}
4340
4341#[must_use = "FIDL methods require a response to be sent"]
4342#[derive(Debug)]
4343pub struct DirectoryUpdateAttributesResponder {
4344    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4345    tx_id: u32,
4346}
4347
4348/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4349/// if the responder is dropped without sending a response, so that the client
4350/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4351impl std::ops::Drop for DirectoryUpdateAttributesResponder {
4352    fn drop(&mut self) {
4353        self.control_handle.shutdown();
4354        // Safety: drops once, never accessed again
4355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4356    }
4357}
4358
4359impl fdomain_client::fidl::Responder for DirectoryUpdateAttributesResponder {
4360    type ControlHandle = DirectoryControlHandle;
4361
4362    fn control_handle(&self) -> &DirectoryControlHandle {
4363        &self.control_handle
4364    }
4365
4366    fn drop_without_shutdown(mut self) {
4367        // Safety: drops once, never accessed again due to mem::forget
4368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4369        // Prevent Drop from running (which would shut down the channel)
4370        std::mem::forget(self);
4371    }
4372}
4373
4374impl DirectoryUpdateAttributesResponder {
4375    /// Sends a response to the FIDL transaction.
4376    ///
4377    /// Sets the channel to shutdown if an error occurs.
4378    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4379        let _result = self.send_raw(result);
4380        if _result.is_err() {
4381            self.control_handle.shutdown();
4382        }
4383        self.drop_without_shutdown();
4384        _result
4385    }
4386
4387    /// Similar to "send" but does not shutdown the channel if an error occurs.
4388    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4389        let _result = self.send_raw(result);
4390        self.drop_without_shutdown();
4391        _result
4392    }
4393
4394    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4395        self.control_handle
4396            .inner
4397            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4398                result,
4399                self.tx_id,
4400                0x3308c1da5a89bf08,
4401                fidl::encoding::DynamicFlags::empty(),
4402            )
4403    }
4404}
4405
4406#[must_use = "FIDL methods require a response to be sent"]
4407#[derive(Debug)]
4408pub struct DirectorySyncResponder {
4409    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4410    tx_id: u32,
4411}
4412
4413/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4414/// if the responder is dropped without sending a response, so that the client
4415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4416impl std::ops::Drop for DirectorySyncResponder {
4417    fn drop(&mut self) {
4418        self.control_handle.shutdown();
4419        // Safety: drops once, never accessed again
4420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4421    }
4422}
4423
4424impl fdomain_client::fidl::Responder for DirectorySyncResponder {
4425    type ControlHandle = DirectoryControlHandle;
4426
4427    fn control_handle(&self) -> &DirectoryControlHandle {
4428        &self.control_handle
4429    }
4430
4431    fn drop_without_shutdown(mut self) {
4432        // Safety: drops once, never accessed again due to mem::forget
4433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4434        // Prevent Drop from running (which would shut down the channel)
4435        std::mem::forget(self);
4436    }
4437}
4438
4439impl DirectorySyncResponder {
4440    /// Sends a response to the FIDL transaction.
4441    ///
4442    /// Sets the channel to shutdown if an error occurs.
4443    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4444        let _result = self.send_raw(result);
4445        if _result.is_err() {
4446            self.control_handle.shutdown();
4447        }
4448        self.drop_without_shutdown();
4449        _result
4450    }
4451
4452    /// Similar to "send" but does not shutdown the channel if an error occurs.
4453    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4454        let _result = self.send_raw(result);
4455        self.drop_without_shutdown();
4456        _result
4457    }
4458
4459    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4460        self.control_handle
4461            .inner
4462            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4463                result,
4464                self.tx_id,
4465                0x2c5c27ca0ab5dc49,
4466                fidl::encoding::DynamicFlags::empty(),
4467            )
4468    }
4469}
4470
4471#[must_use = "FIDL methods require a response to be sent"]
4472#[derive(Debug)]
4473pub struct DirectoryGetExtendedAttributeResponder {
4474    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4475    tx_id: u32,
4476}
4477
4478/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4479/// if the responder is dropped without sending a response, so that the client
4480/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4481impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
4482    fn drop(&mut self) {
4483        self.control_handle.shutdown();
4484        // Safety: drops once, never accessed again
4485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4486    }
4487}
4488
4489impl fdomain_client::fidl::Responder for DirectoryGetExtendedAttributeResponder {
4490    type ControlHandle = DirectoryControlHandle;
4491
4492    fn control_handle(&self) -> &DirectoryControlHandle {
4493        &self.control_handle
4494    }
4495
4496    fn drop_without_shutdown(mut self) {
4497        // Safety: drops once, never accessed again due to mem::forget
4498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4499        // Prevent Drop from running (which would shut down the channel)
4500        std::mem::forget(self);
4501    }
4502}
4503
4504impl DirectoryGetExtendedAttributeResponder {
4505    /// Sends a response to the FIDL transaction.
4506    ///
4507    /// Sets the channel to shutdown if an error occurs.
4508    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4509        let _result = self.send_raw(result);
4510        if _result.is_err() {
4511            self.control_handle.shutdown();
4512        }
4513        self.drop_without_shutdown();
4514        _result
4515    }
4516
4517    /// Similar to "send" but does not shutdown the channel if an error occurs.
4518    pub fn send_no_shutdown_on_err(
4519        self,
4520        mut result: Result<ExtendedAttributeValue, i32>,
4521    ) -> Result<(), fidl::Error> {
4522        let _result = self.send_raw(result);
4523        self.drop_without_shutdown();
4524        _result
4525    }
4526
4527    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4528        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
4529            result.as_mut().map_err(|e| *e),
4530            self.tx_id,
4531            0x45ffa3ccfdeb76db,
4532            fidl::encoding::DynamicFlags::empty(),
4533        )
4534    }
4535}
4536
4537#[must_use = "FIDL methods require a response to be sent"]
4538#[derive(Debug)]
4539pub struct DirectorySetExtendedAttributeResponder {
4540    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4541    tx_id: u32,
4542}
4543
4544/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4545/// if the responder is dropped without sending a response, so that the client
4546/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4547impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
4548    fn drop(&mut self) {
4549        self.control_handle.shutdown();
4550        // Safety: drops once, never accessed again
4551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4552    }
4553}
4554
4555impl fdomain_client::fidl::Responder for DirectorySetExtendedAttributeResponder {
4556    type ControlHandle = DirectoryControlHandle;
4557
4558    fn control_handle(&self) -> &DirectoryControlHandle {
4559        &self.control_handle
4560    }
4561
4562    fn drop_without_shutdown(mut self) {
4563        // Safety: drops once, never accessed again due to mem::forget
4564        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4565        // Prevent Drop from running (which would shut down the channel)
4566        std::mem::forget(self);
4567    }
4568}
4569
4570impl DirectorySetExtendedAttributeResponder {
4571    /// Sends a response to the FIDL transaction.
4572    ///
4573    /// Sets the channel to shutdown if an error occurs.
4574    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4575        let _result = self.send_raw(result);
4576        if _result.is_err() {
4577            self.control_handle.shutdown();
4578        }
4579        self.drop_without_shutdown();
4580        _result
4581    }
4582
4583    /// Similar to "send" but does not shutdown the channel if an error occurs.
4584    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4585        let _result = self.send_raw(result);
4586        self.drop_without_shutdown();
4587        _result
4588    }
4589
4590    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4591        self.control_handle
4592            .inner
4593            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4594                result,
4595                self.tx_id,
4596                0x4a951362f681f23c,
4597                fidl::encoding::DynamicFlags::empty(),
4598            )
4599    }
4600}
4601
4602#[must_use = "FIDL methods require a response to be sent"]
4603#[derive(Debug)]
4604pub struct DirectoryRemoveExtendedAttributeResponder {
4605    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4606    tx_id: u32,
4607}
4608
4609/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4610/// if the responder is dropped without sending a response, so that the client
4611/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4612impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
4613    fn drop(&mut self) {
4614        self.control_handle.shutdown();
4615        // Safety: drops once, never accessed again
4616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4617    }
4618}
4619
4620impl fdomain_client::fidl::Responder for DirectoryRemoveExtendedAttributeResponder {
4621    type ControlHandle = DirectoryControlHandle;
4622
4623    fn control_handle(&self) -> &DirectoryControlHandle {
4624        &self.control_handle
4625    }
4626
4627    fn drop_without_shutdown(mut self) {
4628        // Safety: drops once, never accessed again due to mem::forget
4629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4630        // Prevent Drop from running (which would shut down the channel)
4631        std::mem::forget(self);
4632    }
4633}
4634
4635impl DirectoryRemoveExtendedAttributeResponder {
4636    /// Sends a response to the FIDL transaction.
4637    ///
4638    /// Sets the channel to shutdown if an error occurs.
4639    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4640        let _result = self.send_raw(result);
4641        if _result.is_err() {
4642            self.control_handle.shutdown();
4643        }
4644        self.drop_without_shutdown();
4645        _result
4646    }
4647
4648    /// Similar to "send" but does not shutdown the channel if an error occurs.
4649    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4650        let _result = self.send_raw(result);
4651        self.drop_without_shutdown();
4652        _result
4653    }
4654
4655    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4656        self.control_handle
4657            .inner
4658            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4659                result,
4660                self.tx_id,
4661                0x7a0b9f3a9bf9032d,
4662                fidl::encoding::DynamicFlags::empty(),
4663            )
4664    }
4665}
4666
4667#[must_use = "FIDL methods require a response to be sent"]
4668#[derive(Debug)]
4669pub struct DirectoryReadDirentsResponder {
4670    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4671    tx_id: u32,
4672}
4673
4674/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4675/// if the responder is dropped without sending a response, so that the client
4676/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4677impl std::ops::Drop for DirectoryReadDirentsResponder {
4678    fn drop(&mut self) {
4679        self.control_handle.shutdown();
4680        // Safety: drops once, never accessed again
4681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4682    }
4683}
4684
4685impl fdomain_client::fidl::Responder for DirectoryReadDirentsResponder {
4686    type ControlHandle = DirectoryControlHandle;
4687
4688    fn control_handle(&self) -> &DirectoryControlHandle {
4689        &self.control_handle
4690    }
4691
4692    fn drop_without_shutdown(mut self) {
4693        // Safety: drops once, never accessed again due to mem::forget
4694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4695        // Prevent Drop from running (which would shut down the channel)
4696        std::mem::forget(self);
4697    }
4698}
4699
4700impl DirectoryReadDirentsResponder {
4701    /// Sends a response to the FIDL transaction.
4702    ///
4703    /// Sets the channel to shutdown if an error occurs.
4704    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4705        let _result = self.send_raw(s, dirents);
4706        if _result.is_err() {
4707            self.control_handle.shutdown();
4708        }
4709        self.drop_without_shutdown();
4710        _result
4711    }
4712
4713    /// Similar to "send" but does not shutdown the channel if an error occurs.
4714    pub fn send_no_shutdown_on_err(
4715        self,
4716        mut s: i32,
4717        mut dirents: &[u8],
4718    ) -> Result<(), fidl::Error> {
4719        let _result = self.send_raw(s, dirents);
4720        self.drop_without_shutdown();
4721        _result
4722    }
4723
4724    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4725        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
4726            (s, dirents),
4727            self.tx_id,
4728            0x3582806bf27faa0a,
4729            fidl::encoding::DynamicFlags::empty(),
4730        )
4731    }
4732}
4733
4734#[must_use = "FIDL methods require a response to be sent"]
4735#[derive(Debug)]
4736pub struct DirectoryRewindResponder {
4737    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4738    tx_id: u32,
4739}
4740
4741/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4742/// if the responder is dropped without sending a response, so that the client
4743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4744impl std::ops::Drop for DirectoryRewindResponder {
4745    fn drop(&mut self) {
4746        self.control_handle.shutdown();
4747        // Safety: drops once, never accessed again
4748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4749    }
4750}
4751
4752impl fdomain_client::fidl::Responder for DirectoryRewindResponder {
4753    type ControlHandle = DirectoryControlHandle;
4754
4755    fn control_handle(&self) -> &DirectoryControlHandle {
4756        &self.control_handle
4757    }
4758
4759    fn drop_without_shutdown(mut self) {
4760        // Safety: drops once, never accessed again due to mem::forget
4761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4762        // Prevent Drop from running (which would shut down the channel)
4763        std::mem::forget(self);
4764    }
4765}
4766
4767impl DirectoryRewindResponder {
4768    /// Sends a response to the FIDL transaction.
4769    ///
4770    /// Sets the channel to shutdown if an error occurs.
4771    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4772        let _result = self.send_raw(s);
4773        if _result.is_err() {
4774            self.control_handle.shutdown();
4775        }
4776        self.drop_without_shutdown();
4777        _result
4778    }
4779
4780    /// Similar to "send" but does not shutdown the channel if an error occurs.
4781    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4782        let _result = self.send_raw(s);
4783        self.drop_without_shutdown();
4784        _result
4785    }
4786
4787    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4788        self.control_handle.inner.send::<DirectoryRewindResponse>(
4789            (s,),
4790            self.tx_id,
4791            0x16b1202af0f34c71,
4792            fidl::encoding::DynamicFlags::empty(),
4793        )
4794    }
4795}
4796
4797#[must_use = "FIDL methods require a response to be sent"]
4798#[derive(Debug)]
4799pub struct DirectoryGetTokenResponder {
4800    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4801    tx_id: u32,
4802}
4803
4804/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4805/// if the responder is dropped without sending a response, so that the client
4806/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4807impl std::ops::Drop for DirectoryGetTokenResponder {
4808    fn drop(&mut self) {
4809        self.control_handle.shutdown();
4810        // Safety: drops once, never accessed again
4811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4812    }
4813}
4814
4815impl fdomain_client::fidl::Responder for DirectoryGetTokenResponder {
4816    type ControlHandle = DirectoryControlHandle;
4817
4818    fn control_handle(&self) -> &DirectoryControlHandle {
4819        &self.control_handle
4820    }
4821
4822    fn drop_without_shutdown(mut self) {
4823        // Safety: drops once, never accessed again due to mem::forget
4824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4825        // Prevent Drop from running (which would shut down the channel)
4826        std::mem::forget(self);
4827    }
4828}
4829
4830impl DirectoryGetTokenResponder {
4831    /// Sends a response to the FIDL transaction.
4832    ///
4833    /// Sets the channel to shutdown if an error occurs.
4834    pub fn send(
4835        self,
4836        mut s: i32,
4837        mut token: Option<fdomain_client::NullableHandle>,
4838    ) -> Result<(), fidl::Error> {
4839        let _result = self.send_raw(s, token);
4840        if _result.is_err() {
4841            self.control_handle.shutdown();
4842        }
4843        self.drop_without_shutdown();
4844        _result
4845    }
4846
4847    /// Similar to "send" but does not shutdown the channel if an error occurs.
4848    pub fn send_no_shutdown_on_err(
4849        self,
4850        mut s: i32,
4851        mut token: Option<fdomain_client::NullableHandle>,
4852    ) -> Result<(), fidl::Error> {
4853        let _result = self.send_raw(s, token);
4854        self.drop_without_shutdown();
4855        _result
4856    }
4857
4858    fn send_raw(
4859        &self,
4860        mut s: i32,
4861        mut token: Option<fdomain_client::NullableHandle>,
4862    ) -> Result<(), fidl::Error> {
4863        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
4864            (s, token),
4865            self.tx_id,
4866            0x26ae9d18763c8655,
4867            fidl::encoding::DynamicFlags::empty(),
4868        )
4869    }
4870}
4871
4872#[must_use = "FIDL methods require a response to be sent"]
4873#[derive(Debug)]
4874pub struct DirectoryLinkResponder {
4875    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4876    tx_id: u32,
4877}
4878
4879/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4880/// if the responder is dropped without sending a response, so that the client
4881/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4882impl std::ops::Drop for DirectoryLinkResponder {
4883    fn drop(&mut self) {
4884        self.control_handle.shutdown();
4885        // Safety: drops once, never accessed again
4886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4887    }
4888}
4889
4890impl fdomain_client::fidl::Responder for DirectoryLinkResponder {
4891    type ControlHandle = DirectoryControlHandle;
4892
4893    fn control_handle(&self) -> &DirectoryControlHandle {
4894        &self.control_handle
4895    }
4896
4897    fn drop_without_shutdown(mut self) {
4898        // Safety: drops once, never accessed again due to mem::forget
4899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4900        // Prevent Drop from running (which would shut down the channel)
4901        std::mem::forget(self);
4902    }
4903}
4904
4905impl DirectoryLinkResponder {
4906    /// Sends a response to the FIDL transaction.
4907    ///
4908    /// Sets the channel to shutdown if an error occurs.
4909    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4910        let _result = self.send_raw(s);
4911        if _result.is_err() {
4912            self.control_handle.shutdown();
4913        }
4914        self.drop_without_shutdown();
4915        _result
4916    }
4917
4918    /// Similar to "send" but does not shutdown the channel if an error occurs.
4919    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4920        let _result = self.send_raw(s);
4921        self.drop_without_shutdown();
4922        _result
4923    }
4924
4925    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4926        self.control_handle.inner.send::<DirectoryLinkResponse>(
4927            (s,),
4928            self.tx_id,
4929            0x740604c0c7c930e7,
4930            fidl::encoding::DynamicFlags::empty(),
4931        )
4932    }
4933}
4934
4935#[must_use = "FIDL methods require a response to be sent"]
4936#[derive(Debug)]
4937pub struct DirectoryUnlinkResponder {
4938    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4939    tx_id: u32,
4940}
4941
4942/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4943/// if the responder is dropped without sending a response, so that the client
4944/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4945impl std::ops::Drop for DirectoryUnlinkResponder {
4946    fn drop(&mut self) {
4947        self.control_handle.shutdown();
4948        // Safety: drops once, never accessed again
4949        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4950    }
4951}
4952
4953impl fdomain_client::fidl::Responder for DirectoryUnlinkResponder {
4954    type ControlHandle = DirectoryControlHandle;
4955
4956    fn control_handle(&self) -> &DirectoryControlHandle {
4957        &self.control_handle
4958    }
4959
4960    fn drop_without_shutdown(mut self) {
4961        // Safety: drops once, never accessed again due to mem::forget
4962        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4963        // Prevent Drop from running (which would shut down the channel)
4964        std::mem::forget(self);
4965    }
4966}
4967
4968impl DirectoryUnlinkResponder {
4969    /// Sends a response to the FIDL transaction.
4970    ///
4971    /// Sets the channel to shutdown if an error occurs.
4972    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4973        let _result = self.send_raw(result);
4974        if _result.is_err() {
4975            self.control_handle.shutdown();
4976        }
4977        self.drop_without_shutdown();
4978        _result
4979    }
4980
4981    /// Similar to "send" but does not shutdown the channel if an error occurs.
4982    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4983        let _result = self.send_raw(result);
4984        self.drop_without_shutdown();
4985        _result
4986    }
4987
4988    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4989        self.control_handle
4990            .inner
4991            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4992                result,
4993                self.tx_id,
4994                0x750a0326a78d7bed,
4995                fidl::encoding::DynamicFlags::empty(),
4996            )
4997    }
4998}
4999
5000#[must_use = "FIDL methods require a response to be sent"]
5001#[derive(Debug)]
5002pub struct DirectoryRenameResponder {
5003    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5004    tx_id: u32,
5005}
5006
5007/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5008/// if the responder is dropped without sending a response, so that the client
5009/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5010impl std::ops::Drop for DirectoryRenameResponder {
5011    fn drop(&mut self) {
5012        self.control_handle.shutdown();
5013        // Safety: drops once, never accessed again
5014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5015    }
5016}
5017
5018impl fdomain_client::fidl::Responder for DirectoryRenameResponder {
5019    type ControlHandle = DirectoryControlHandle;
5020
5021    fn control_handle(&self) -> &DirectoryControlHandle {
5022        &self.control_handle
5023    }
5024
5025    fn drop_without_shutdown(mut self) {
5026        // Safety: drops once, never accessed again due to mem::forget
5027        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5028        // Prevent Drop from running (which would shut down the channel)
5029        std::mem::forget(self);
5030    }
5031}
5032
5033impl DirectoryRenameResponder {
5034    /// Sends a response to the FIDL transaction.
5035    ///
5036    /// Sets the channel to shutdown if an error occurs.
5037    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5038        let _result = self.send_raw(result);
5039        if _result.is_err() {
5040            self.control_handle.shutdown();
5041        }
5042        self.drop_without_shutdown();
5043        _result
5044    }
5045
5046    /// Similar to "send" but does not shutdown the channel if an error occurs.
5047    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5048        let _result = self.send_raw(result);
5049        self.drop_without_shutdown();
5050        _result
5051    }
5052
5053    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5054        self.control_handle
5055            .inner
5056            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5057                result,
5058                self.tx_id,
5059                0x7060e7723b9928de,
5060                fidl::encoding::DynamicFlags::empty(),
5061            )
5062    }
5063}
5064
5065#[must_use = "FIDL methods require a response to be sent"]
5066#[derive(Debug)]
5067pub struct DirectoryCreateSymlinkResponder {
5068    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5069    tx_id: u32,
5070}
5071
5072/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5073/// if the responder is dropped without sending a response, so that the client
5074/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5075impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5076    fn drop(&mut self) {
5077        self.control_handle.shutdown();
5078        // Safety: drops once, never accessed again
5079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5080    }
5081}
5082
5083impl fdomain_client::fidl::Responder for DirectoryCreateSymlinkResponder {
5084    type ControlHandle = DirectoryControlHandle;
5085
5086    fn control_handle(&self) -> &DirectoryControlHandle {
5087        &self.control_handle
5088    }
5089
5090    fn drop_without_shutdown(mut self) {
5091        // Safety: drops once, never accessed again due to mem::forget
5092        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5093        // Prevent Drop from running (which would shut down the channel)
5094        std::mem::forget(self);
5095    }
5096}
5097
5098impl DirectoryCreateSymlinkResponder {
5099    /// Sends a response to the FIDL transaction.
5100    ///
5101    /// Sets the channel to shutdown if an error occurs.
5102    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5103        let _result = self.send_raw(result);
5104        if _result.is_err() {
5105            self.control_handle.shutdown();
5106        }
5107        self.drop_without_shutdown();
5108        _result
5109    }
5110
5111    /// Similar to "send" but does not shutdown the channel if an error occurs.
5112    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5113        let _result = self.send_raw(result);
5114        self.drop_without_shutdown();
5115        _result
5116    }
5117
5118    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5119        self.control_handle
5120            .inner
5121            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5122                result,
5123                self.tx_id,
5124                0x21ce0f19ec043889,
5125                fidl::encoding::DynamicFlags::empty(),
5126            )
5127    }
5128}
5129
5130#[must_use = "FIDL methods require a response to be sent"]
5131#[derive(Debug)]
5132pub struct DirectoryWatchResponder {
5133    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5134    tx_id: u32,
5135}
5136
5137/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5138/// if the responder is dropped without sending a response, so that the client
5139/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5140impl std::ops::Drop for DirectoryWatchResponder {
5141    fn drop(&mut self) {
5142        self.control_handle.shutdown();
5143        // Safety: drops once, never accessed again
5144        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5145    }
5146}
5147
5148impl fdomain_client::fidl::Responder for DirectoryWatchResponder {
5149    type ControlHandle = DirectoryControlHandle;
5150
5151    fn control_handle(&self) -> &DirectoryControlHandle {
5152        &self.control_handle
5153    }
5154
5155    fn drop_without_shutdown(mut self) {
5156        // Safety: drops once, never accessed again due to mem::forget
5157        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5158        // Prevent Drop from running (which would shut down the channel)
5159        std::mem::forget(self);
5160    }
5161}
5162
5163impl DirectoryWatchResponder {
5164    /// Sends a response to the FIDL transaction.
5165    ///
5166    /// Sets the channel to shutdown if an error occurs.
5167    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5168        let _result = self.send_raw(s);
5169        if _result.is_err() {
5170            self.control_handle.shutdown();
5171        }
5172        self.drop_without_shutdown();
5173        _result
5174    }
5175
5176    /// Similar to "send" but does not shutdown the channel if an error occurs.
5177    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5178        let _result = self.send_raw(s);
5179        self.drop_without_shutdown();
5180        _result
5181    }
5182
5183    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5184        self.control_handle.inner.send::<DirectoryWatchResponse>(
5185            (s,),
5186            self.tx_id,
5187            0x5717193a59d66d91,
5188            fidl::encoding::DynamicFlags::empty(),
5189        )
5190    }
5191}
5192
5193#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5194pub struct DirectoryWatcherMarker;
5195
5196impl fdomain_client::fidl::ProtocolMarker for DirectoryWatcherMarker {
5197    type Proxy = DirectoryWatcherProxy;
5198    type RequestStream = DirectoryWatcherRequestStream;
5199
5200    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
5201}
5202
5203pub trait DirectoryWatcherProxyInterface: Send + Sync {}
5204
5205#[derive(Debug, Clone)]
5206pub struct DirectoryWatcherProxy {
5207    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5208}
5209
5210impl fdomain_client::fidl::Proxy for DirectoryWatcherProxy {
5211    type Protocol = DirectoryWatcherMarker;
5212
5213    fn from_channel(inner: fdomain_client::Channel) -> Self {
5214        Self::new(inner)
5215    }
5216
5217    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5218        self.client.into_channel().map_err(|client| Self { client })
5219    }
5220
5221    fn as_channel(&self) -> &fdomain_client::Channel {
5222        self.client.as_channel()
5223    }
5224}
5225
5226impl DirectoryWatcherProxy {
5227    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
5228    pub fn new(channel: fdomain_client::Channel) -> Self {
5229        let protocol_name =
5230            <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5231        Self { client: fidl::client::Client::new(channel, protocol_name) }
5232    }
5233
5234    /// Get a Stream of events from the remote end of the protocol.
5235    ///
5236    /// # Panics
5237    ///
5238    /// Panics if the event stream was already taken.
5239    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
5240        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
5241    }
5242}
5243
5244impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
5245
5246pub struct DirectoryWatcherEventStream {
5247    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5248}
5249
5250impl std::marker::Unpin for DirectoryWatcherEventStream {}
5251
5252impl futures::stream::FusedStream for DirectoryWatcherEventStream {
5253    fn is_terminated(&self) -> bool {
5254        self.event_receiver.is_terminated()
5255    }
5256}
5257
5258impl futures::Stream for DirectoryWatcherEventStream {
5259    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
5260
5261    fn poll_next(
5262        mut self: std::pin::Pin<&mut Self>,
5263        cx: &mut std::task::Context<'_>,
5264    ) -> std::task::Poll<Option<Self::Item>> {
5265        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5266            &mut self.event_receiver,
5267            cx
5268        )?) {
5269            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
5270            None => std::task::Poll::Ready(None),
5271        }
5272    }
5273}
5274
5275#[derive(Debug)]
5276pub enum DirectoryWatcherEvent {}
5277
5278impl DirectoryWatcherEvent {
5279    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
5280    fn decode(
5281        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5282    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
5283        let (bytes, _handles) = buf.split_mut();
5284        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5285        debug_assert_eq!(tx_header.tx_id, 0);
5286        match tx_header.ordinal {
5287            _ => Err(fidl::Error::UnknownOrdinal {
5288                ordinal: tx_header.ordinal,
5289                protocol_name:
5290                    <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5291            }),
5292        }
5293    }
5294}
5295
5296/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
5297pub struct DirectoryWatcherRequestStream {
5298    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5299    is_terminated: bool,
5300}
5301
5302impl std::marker::Unpin for DirectoryWatcherRequestStream {}
5303
5304impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
5305    fn is_terminated(&self) -> bool {
5306        self.is_terminated
5307    }
5308}
5309
5310impl fdomain_client::fidl::RequestStream for DirectoryWatcherRequestStream {
5311    type Protocol = DirectoryWatcherMarker;
5312    type ControlHandle = DirectoryWatcherControlHandle;
5313
5314    fn from_channel(channel: fdomain_client::Channel) -> Self {
5315        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5316    }
5317
5318    fn control_handle(&self) -> Self::ControlHandle {
5319        DirectoryWatcherControlHandle { inner: self.inner.clone() }
5320    }
5321
5322    fn into_inner(
5323        self,
5324    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5325    {
5326        (self.inner, self.is_terminated)
5327    }
5328
5329    fn from_inner(
5330        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5331        is_terminated: bool,
5332    ) -> Self {
5333        Self { inner, is_terminated }
5334    }
5335}
5336
5337impl futures::Stream for DirectoryWatcherRequestStream {
5338    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
5339
5340    fn poll_next(
5341        mut self: std::pin::Pin<&mut Self>,
5342        cx: &mut std::task::Context<'_>,
5343    ) -> std::task::Poll<Option<Self::Item>> {
5344        let this = &mut *self;
5345        if this.inner.check_shutdown(cx) {
5346            this.is_terminated = true;
5347            return std::task::Poll::Ready(None);
5348        }
5349        if this.is_terminated {
5350            panic!("polled DirectoryWatcherRequestStream after completion");
5351        }
5352        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5353            |bytes, handles| {
5354                match this.inner.channel().read_etc(cx, bytes, handles) {
5355                    std::task::Poll::Ready(Ok(())) => {}
5356                    std::task::Poll::Pending => return std::task::Poll::Pending,
5357                    std::task::Poll::Ready(Err(None)) => {
5358                        this.is_terminated = true;
5359                        return std::task::Poll::Ready(None);
5360                    }
5361                    std::task::Poll::Ready(Err(Some(e))) => {
5362                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5363                            e.into(),
5364                        ))));
5365                    }
5366                }
5367
5368                // A message has been received from the channel
5369                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5370
5371                std::task::Poll::Ready(Some(match header.ordinal {
5372                _ => Err(fidl::Error::UnknownOrdinal {
5373                    ordinal: header.ordinal,
5374                    protocol_name: <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5375                }),
5376            }))
5377            },
5378        )
5379    }
5380}
5381
5382/// DirectoryWatcher transmits messages from a filesystem server
5383/// about events happening in the filesystem. Clients can register
5384/// new watchers using the `Directory.Watch` method, where they can
5385/// filter which events they want to receive notifications for.
5386///
5387/// The DirectoryWatcher will send messages of the form:
5388/// ```
5389/// struct {
5390///   uint8 event;
5391///   uint8 len;
5392///   char name[];
5393/// };
5394/// ```
5395/// Where names are NOT null-terminated. The name is the relative
5396/// path to the entry the event is refering to. It will be empty if
5397/// the event isn't referencing a particular entry (e.g. for the
5398/// `IDLE` event).
5399#[derive(Debug)]
5400pub enum DirectoryWatcherRequest {}
5401
5402impl DirectoryWatcherRequest {
5403    /// Name of the method defined in FIDL
5404    pub fn method_name(&self) -> &'static str {
5405        match *self {}
5406    }
5407}
5408
5409#[derive(Debug, Clone)]
5410pub struct DirectoryWatcherControlHandle {
5411    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5412}
5413
5414impl DirectoryWatcherControlHandle {
5415    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5416        self.inner.shutdown_with_epitaph(status.into())
5417    }
5418}
5419
5420impl fdomain_client::fidl::ControlHandle for DirectoryWatcherControlHandle {
5421    fn shutdown(&self) {
5422        self.inner.shutdown()
5423    }
5424
5425    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5426        self.inner.shutdown_with_epitaph(status)
5427    }
5428
5429    fn is_closed(&self) -> bool {
5430        self.inner.channel().is_closed()
5431    }
5432    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5433        self.inner.channel().on_closed()
5434    }
5435}
5436
5437impl DirectoryWatcherControlHandle {}
5438
5439#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5440pub struct ExtendedAttributeIteratorMarker;
5441
5442impl fdomain_client::fidl::ProtocolMarker for ExtendedAttributeIteratorMarker {
5443    type Proxy = ExtendedAttributeIteratorProxy;
5444    type RequestStream = ExtendedAttributeIteratorRequestStream;
5445
5446    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
5447}
5448pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
5449
5450pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
5451    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
5452        + Send;
5453    fn r#get_next(&self) -> Self::GetNextResponseFut;
5454}
5455
5456#[derive(Debug, Clone)]
5457pub struct ExtendedAttributeIteratorProxy {
5458    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5459}
5460
5461impl fdomain_client::fidl::Proxy for ExtendedAttributeIteratorProxy {
5462    type Protocol = ExtendedAttributeIteratorMarker;
5463
5464    fn from_channel(inner: fdomain_client::Channel) -> Self {
5465        Self::new(inner)
5466    }
5467
5468    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5469        self.client.into_channel().map_err(|client| Self { client })
5470    }
5471
5472    fn as_channel(&self) -> &fdomain_client::Channel {
5473        self.client.as_channel()
5474    }
5475}
5476
5477impl ExtendedAttributeIteratorProxy {
5478    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
5479    pub fn new(channel: fdomain_client::Channel) -> Self {
5480        let protocol_name =
5481            <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5482        Self { client: fidl::client::Client::new(channel, protocol_name) }
5483    }
5484
5485    /// Get a Stream of events from the remote end of the protocol.
5486    ///
5487    /// # Panics
5488    ///
5489    /// Panics if the event stream was already taken.
5490    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
5491        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5492    }
5493
5494    /// Get the next chunk of extended attribute names. If this is the last
5495    /// chunk, last will be true, and the channel will be closed after the
5496    /// call.
5497    pub fn r#get_next(
5498        &self,
5499    ) -> fidl::client::QueryResponseFut<
5500        ExtendedAttributeIteratorGetNextResult,
5501        fdomain_client::fidl::FDomainResourceDialect,
5502    > {
5503        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
5504    }
5505}
5506
5507impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
5508    type GetNextResponseFut = fidl::client::QueryResponseFut<
5509        ExtendedAttributeIteratorGetNextResult,
5510        fdomain_client::fidl::FDomainResourceDialect,
5511    >;
5512    fn r#get_next(&self) -> Self::GetNextResponseFut {
5513        fn _decode(
5514            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5515        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
5516            let _response = fidl::client::decode_transaction_body::<
5517                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
5518                fdomain_client::fidl::FDomainResourceDialect,
5519                0x3ba664a1c2e45a7,
5520            >(_buf?)?;
5521            Ok(_response.map(|x| (x.attributes, x.last)))
5522        }
5523        self.client.send_query_and_decode::<
5524            fidl::encoding::EmptyPayload,
5525            ExtendedAttributeIteratorGetNextResult,
5526        >(
5527            (),
5528            0x3ba664a1c2e45a7,
5529            fidl::encoding::DynamicFlags::empty(),
5530            _decode,
5531        )
5532    }
5533}
5534
5535pub struct ExtendedAttributeIteratorEventStream {
5536    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5537}
5538
5539impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
5540
5541impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
5542    fn is_terminated(&self) -> bool {
5543        self.event_receiver.is_terminated()
5544    }
5545}
5546
5547impl futures::Stream for ExtendedAttributeIteratorEventStream {
5548    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
5549
5550    fn poll_next(
5551        mut self: std::pin::Pin<&mut Self>,
5552        cx: &mut std::task::Context<'_>,
5553    ) -> std::task::Poll<Option<Self::Item>> {
5554        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5555            &mut self.event_receiver,
5556            cx
5557        )?) {
5558            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
5559            None => std::task::Poll::Ready(None),
5560        }
5561    }
5562}
5563
5564#[derive(Debug)]
5565pub enum ExtendedAttributeIteratorEvent {}
5566
5567impl ExtendedAttributeIteratorEvent {
5568    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
5569    fn decode(
5570        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5571    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
5572        let (bytes, _handles) = buf.split_mut();
5573        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5574        debug_assert_eq!(tx_header.tx_id, 0);
5575        match tx_header.ordinal {
5576            _ => Err(fidl::Error::UnknownOrdinal {
5577                ordinal: tx_header.ordinal,
5578                protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5579            })
5580        }
5581    }
5582}
5583
5584/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
5585pub struct ExtendedAttributeIteratorRequestStream {
5586    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5587    is_terminated: bool,
5588}
5589
5590impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
5591
5592impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
5593    fn is_terminated(&self) -> bool {
5594        self.is_terminated
5595    }
5596}
5597
5598impl fdomain_client::fidl::RequestStream for ExtendedAttributeIteratorRequestStream {
5599    type Protocol = ExtendedAttributeIteratorMarker;
5600    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5601
5602    fn from_channel(channel: fdomain_client::Channel) -> Self {
5603        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5604    }
5605
5606    fn control_handle(&self) -> Self::ControlHandle {
5607        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
5608    }
5609
5610    fn into_inner(
5611        self,
5612    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5613    {
5614        (self.inner, self.is_terminated)
5615    }
5616
5617    fn from_inner(
5618        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5619        is_terminated: bool,
5620    ) -> Self {
5621        Self { inner, is_terminated }
5622    }
5623}
5624
5625impl futures::Stream for ExtendedAttributeIteratorRequestStream {
5626    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
5627
5628    fn poll_next(
5629        mut self: std::pin::Pin<&mut Self>,
5630        cx: &mut std::task::Context<'_>,
5631    ) -> std::task::Poll<Option<Self::Item>> {
5632        let this = &mut *self;
5633        if this.inner.check_shutdown(cx) {
5634            this.is_terminated = true;
5635            return std::task::Poll::Ready(None);
5636        }
5637        if this.is_terminated {
5638            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
5639        }
5640        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5641            |bytes, handles| {
5642                match this.inner.channel().read_etc(cx, bytes, handles) {
5643                    std::task::Poll::Ready(Ok(())) => {}
5644                    std::task::Poll::Pending => return std::task::Poll::Pending,
5645                    std::task::Poll::Ready(Err(None)) => {
5646                        this.is_terminated = true;
5647                        return std::task::Poll::Ready(None);
5648                    }
5649                    std::task::Poll::Ready(Err(Some(e))) => {
5650                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5651                            e.into(),
5652                        ))));
5653                    }
5654                }
5655
5656                // A message has been received from the channel
5657                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5658
5659                std::task::Poll::Ready(Some(match header.ordinal {
5660                0x3ba664a1c2e45a7 => {
5661                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5662                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
5663                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5664                    let control_handle = ExtendedAttributeIteratorControlHandle {
5665                        inner: this.inner.clone(),
5666                    };
5667                    Ok(ExtendedAttributeIteratorRequest::GetNext {
5668                        responder: ExtendedAttributeIteratorGetNextResponder {
5669                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5670                            tx_id: header.tx_id,
5671                        },
5672                    })
5673                }
5674                _ => Err(fidl::Error::UnknownOrdinal {
5675                    ordinal: header.ordinal,
5676                    protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5677                }),
5678            }))
5679            },
5680        )
5681    }
5682}
5683
5684#[derive(Debug)]
5685pub enum ExtendedAttributeIteratorRequest {
5686    /// Get the next chunk of extended attribute names. If this is the last
5687    /// chunk, last will be true, and the channel will be closed after the
5688    /// call.
5689    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
5690}
5691
5692impl ExtendedAttributeIteratorRequest {
5693    #[allow(irrefutable_let_patterns)]
5694    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
5695        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
5696            Some((responder))
5697        } else {
5698            None
5699        }
5700    }
5701
5702    /// Name of the method defined in FIDL
5703    pub fn method_name(&self) -> &'static str {
5704        match *self {
5705            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
5706        }
5707    }
5708}
5709
5710#[derive(Debug, Clone)]
5711pub struct ExtendedAttributeIteratorControlHandle {
5712    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5713}
5714
5715impl ExtendedAttributeIteratorControlHandle {
5716    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5717        self.inner.shutdown_with_epitaph(status.into())
5718    }
5719}
5720
5721impl fdomain_client::fidl::ControlHandle for ExtendedAttributeIteratorControlHandle {
5722    fn shutdown(&self) {
5723        self.inner.shutdown()
5724    }
5725
5726    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5727        self.inner.shutdown_with_epitaph(status)
5728    }
5729
5730    fn is_closed(&self) -> bool {
5731        self.inner.channel().is_closed()
5732    }
5733    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5734        self.inner.channel().on_closed()
5735    }
5736}
5737
5738impl ExtendedAttributeIteratorControlHandle {}
5739
5740#[must_use = "FIDL methods require a response to be sent"]
5741#[derive(Debug)]
5742pub struct ExtendedAttributeIteratorGetNextResponder {
5743    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
5744    tx_id: u32,
5745}
5746
5747/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
5748/// if the responder is dropped without sending a response, so that the client
5749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5750impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
5751    fn drop(&mut self) {
5752        self.control_handle.shutdown();
5753        // Safety: drops once, never accessed again
5754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5755    }
5756}
5757
5758impl fdomain_client::fidl::Responder for ExtendedAttributeIteratorGetNextResponder {
5759    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5760
5761    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
5762        &self.control_handle
5763    }
5764
5765    fn drop_without_shutdown(mut self) {
5766        // Safety: drops once, never accessed again due to mem::forget
5767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5768        // Prevent Drop from running (which would shut down the channel)
5769        std::mem::forget(self);
5770    }
5771}
5772
5773impl ExtendedAttributeIteratorGetNextResponder {
5774    /// Sends a response to the FIDL transaction.
5775    ///
5776    /// Sets the channel to shutdown if an error occurs.
5777    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5778        let _result = self.send_raw(result);
5779        if _result.is_err() {
5780            self.control_handle.shutdown();
5781        }
5782        self.drop_without_shutdown();
5783        _result
5784    }
5785
5786    /// Similar to "send" but does not shutdown the channel if an error occurs.
5787    pub fn send_no_shutdown_on_err(
5788        self,
5789        mut result: Result<(&[Vec<u8>], bool), i32>,
5790    ) -> Result<(), fidl::Error> {
5791        let _result = self.send_raw(result);
5792        self.drop_without_shutdown();
5793        _result
5794    }
5795
5796    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5797        self.control_handle.inner.send::<fidl::encoding::ResultType<
5798            ExtendedAttributeIteratorGetNextResponse,
5799            i32,
5800        >>(
5801            result,
5802            self.tx_id,
5803            0x3ba664a1c2e45a7,
5804            fidl::encoding::DynamicFlags::empty(),
5805        )
5806    }
5807}
5808
5809#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5810pub struct FileMarker;
5811
5812impl fdomain_client::fidl::ProtocolMarker for FileMarker {
5813    type Proxy = FileProxy;
5814    type RequestStream = FileRequestStream;
5815
5816    const DEBUG_NAME: &'static str = "fuchsia.io.File";
5817}
5818impl fdomain_client::fidl::DiscoverableProtocolMarker for FileMarker {}
5819pub type FileSeekResult = Result<u64, i32>;
5820pub type FileReadAtResult = Result<Vec<u8>, i32>;
5821pub type FileWriteAtResult = Result<u64, i32>;
5822pub type FileResizeResult = Result<(), i32>;
5823pub type FileGetBackingMemoryResult = Result<fdomain_client::Vmo, i32>;
5824pub type FileAllocateResult = Result<(), i32>;
5825pub type FileEnableVerityResult = Result<(), i32>;
5826
5827pub trait FileProxyInterface: Send + Sync {
5828    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
5829        + Send;
5830    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
5831    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
5832        + Send;
5833    fn r#link_into(
5834        &self,
5835        dst_parent_token: fdomain_client::Event,
5836        dst: &str,
5837    ) -> Self::LinkIntoResponseFut;
5838    fn r#clone(
5839        &self,
5840        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5841    ) -> Result<(), fidl::Error>;
5842    type CloseResponseFut: std::future::Future<
5843            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
5844        > + Send;
5845    fn r#close(&self) -> Self::CloseResponseFut;
5846    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
5847    fn r#query(&self) -> Self::QueryResponseFut;
5848    fn r#deprecated_clone(
5849        &self,
5850        flags: OpenFlags,
5851        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
5852    ) -> Result<(), fidl::Error>;
5853    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
5854        + Send;
5855    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
5856    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
5857    fn r#deprecated_set_attr(
5858        &self,
5859        flags: NodeAttributeFlags,
5860        attributes: &NodeAttributes,
5861    ) -> Self::DeprecatedSetAttrResponseFut;
5862    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
5863        + Send;
5864    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
5865    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
5866        + Send;
5867    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
5868    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
5869        + Send;
5870    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
5871    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
5872        + Send;
5873    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
5874    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
5875        + Send;
5876    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
5877    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
5878        + Send;
5879    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
5880    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
5881        + Send;
5882    fn r#update_attributes(
5883        &self,
5884        payload: &MutableNodeAttributes,
5885    ) -> Self::UpdateAttributesResponseFut;
5886    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
5887    fn r#sync(&self) -> Self::SyncResponseFut;
5888    fn r#list_extended_attributes(
5889        &self,
5890        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
5891    ) -> Result<(), fidl::Error>;
5892    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
5893        + Send;
5894    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
5895    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
5896        + Send;
5897    fn r#set_extended_attribute(
5898        &self,
5899        name: &[u8],
5900        value: ExtendedAttributeValue,
5901        mode: SetExtendedAttributeMode,
5902    ) -> Self::SetExtendedAttributeResponseFut;
5903    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
5904        + Send;
5905    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
5906    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
5907        + Send;
5908    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
5909    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
5910        + Send;
5911    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
5912    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
5913    fn r#describe(&self) -> Self::DescribeResponseFut;
5914    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
5915    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
5916    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
5917        + Send;
5918    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
5919    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
5920        + Send;
5921    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
5922    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
5923        + Send;
5924    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
5925    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
5926        + Send;
5927    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
5928    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
5929        + Send;
5930    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
5931    -> Self::AllocateResponseFut;
5932    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
5933        + Send;
5934    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
5935}
5936
5937#[derive(Debug, Clone)]
5938pub struct FileProxy {
5939    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5940}
5941
5942impl fdomain_client::fidl::Proxy for FileProxy {
5943    type Protocol = FileMarker;
5944
5945    fn from_channel(inner: fdomain_client::Channel) -> Self {
5946        Self::new(inner)
5947    }
5948
5949    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5950        self.client.into_channel().map_err(|client| Self { client })
5951    }
5952
5953    fn as_channel(&self) -> &fdomain_client::Channel {
5954        self.client.as_channel()
5955    }
5956}
5957
5958impl FileProxy {
5959    /// Create a new Proxy for fuchsia.io/File.
5960    pub fn new(channel: fdomain_client::Channel) -> Self {
5961        let protocol_name = <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5962        Self { client: fidl::client::Client::new(channel, protocol_name) }
5963    }
5964
5965    /// Get a Stream of events from the remote end of the protocol.
5966    ///
5967    /// # Panics
5968    ///
5969    /// Panics if the event stream was already taken.
5970    pub fn take_event_stream(&self) -> FileEventStream {
5971        FileEventStream { event_receiver: self.client.take_event_receiver() }
5972    }
5973
5974    /// Acquires an advisory lock on the underlying file.
5975    ///
5976    /// The lock lasts until either this connection is closed or
5977    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
5978    /// explicitly.
5979    ///
5980    /// Advisory locks are purely advisory. They do not prevent actual read or
5981    /// write operations from occurring on the file, either through this
5982    /// connection or through other connections.
5983    ///
5984    /// This method requires the following rights:
5985    ///
5986    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
5987    /// * [`Rights.WRITE_BYTES`] if `request.type` is
5988    ///   [`AdvisoryLockType.WRITE`].
5989    ///
5990    /// # Errors
5991    ///
5992    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
5993    ///   example, another connection might hold a conflicting lock type.
5994    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
5995    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
5996    ///   to acquire the given type of lock.
5997    pub fn r#advisory_lock(
5998        &self,
5999        mut request: &AdvisoryLockRequest,
6000    ) -> fidl::client::QueryResponseFut<
6001        AdvisoryLockingAdvisoryLockResult,
6002        fdomain_client::fidl::FDomainResourceDialect,
6003    > {
6004        FileProxyInterface::r#advisory_lock(self, request)
6005    }
6006
6007    /// Creates a link to this this object with name `dst` in the directory represented by
6008    /// `dst_parent_token`.
6009    ///
6010    /// `dst` must be a resolved object name. Including "/" in the string will return
6011    /// `ZX_ERR_INVALID_ARGS`.
6012    ///
6013    /// This method requires the maximal set of rights supported by the filesystem for this object.
6014    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
6015    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
6016    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
6017    /// `ZX_ERR_ACCESS_DENIED`.
6018    ///
6019    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
6020    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
6021    ///
6022    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
6023    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
6024    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
6025    ///
6026    /// This method does not have the same atomicity properties has the `Directory::Link` method,
6027    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
6028    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
6029    pub fn r#link_into(
6030        &self,
6031        mut dst_parent_token: fdomain_client::Event,
6032        mut dst: &str,
6033    ) -> fidl::client::QueryResponseFut<
6034        LinkableLinkIntoResult,
6035        fdomain_client::fidl::FDomainResourceDialect,
6036    > {
6037        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
6038    }
6039
6040    pub fn r#clone(
6041        &self,
6042        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6043    ) -> Result<(), fidl::Error> {
6044        FileProxyInterface::r#clone(self, request)
6045    }
6046
6047    /// Terminates the connection.
6048    ///
6049    /// After calling `Close`, the client must not send any other requests.
6050    ///
6051    /// Servers, after sending the status response, should close the connection
6052    /// regardless of status and without sending an epitaph.
6053    ///
6054    /// Closing the client end of the channel should be semantically equivalent
6055    /// to calling `Close` without knowing when the close has completed or its
6056    /// status.
6057    pub fn r#close(
6058        &self,
6059    ) -> fidl::client::QueryResponseFut<
6060        fdomain_fuchsia_unknown::CloseableCloseResult,
6061        fdomain_client::fidl::FDomainResourceDialect,
6062    > {
6063        FileProxyInterface::r#close(self)
6064    }
6065
6066    pub fn r#query(
6067        &self,
6068    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
6069        FileProxyInterface::r#query(self)
6070    }
6071
6072    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
6073    pub fn r#deprecated_clone(
6074        &self,
6075        mut flags: OpenFlags,
6076        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6077    ) -> Result<(), fidl::Error> {
6078        FileProxyInterface::r#deprecated_clone(self, flags, object)
6079    }
6080
6081    /// DEPRECATED - Use `Node.GetAttributes` instead.
6082    ///
6083    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6084    pub fn r#deprecated_get_attr(
6085        &self,
6086    ) -> fidl::client::QueryResponseFut<
6087        (i32, NodeAttributes),
6088        fdomain_client::fidl::FDomainResourceDialect,
6089    > {
6090        FileProxyInterface::r#deprecated_get_attr(self)
6091    }
6092
6093    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
6094    pub fn r#deprecated_set_attr(
6095        &self,
6096        mut flags: NodeAttributeFlags,
6097        mut attributes: &NodeAttributes,
6098    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6099        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
6100    }
6101
6102    /// [DEPRECATED - Use new GetFlags method instead.]
6103    pub fn r#deprecated_get_flags(
6104        &self,
6105    ) -> fidl::client::QueryResponseFut<
6106        (i32, OpenFlags),
6107        fdomain_client::fidl::FDomainResourceDialect,
6108    > {
6109        FileProxyInterface::r#deprecated_get_flags(self)
6110    }
6111
6112    /// [DEPRECATED - Use new SetFlags method instead.]
6113    pub fn r#deprecated_set_flags(
6114        &self,
6115        mut flags: OpenFlags,
6116    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6117        FileProxyInterface::r#deprecated_set_flags(self, flags)
6118    }
6119
6120    /// Queries the flags that apply to this node after it has been opened/created. This method does
6121    /// not require any rights.
6122    ///
6123    /// Note that the final set of flags that apply to the connection may differ from those
6124    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
6125    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
6126    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
6127    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
6128    pub fn r#get_flags(
6129        &self,
6130    ) -> fidl::client::QueryResponseFut<
6131        NodeGetFlagsResult,
6132        fdomain_client::fidl::FDomainResourceDialect,
6133    > {
6134        FileProxyInterface::r#get_flags(self)
6135    }
6136
6137    /// Sets the flags that apply to this node after it has been opened. This method does not
6138    /// require any rights.
6139    ///
6140    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
6141    /// clear append mode.
6142    ///
6143    /// Errors:
6144    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
6145    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
6146    pub fn r#set_flags(
6147        &self,
6148        mut flags: Flags,
6149    ) -> fidl::client::QueryResponseFut<
6150        NodeSetFlagsResult,
6151        fdomain_client::fidl::FDomainResourceDialect,
6152    > {
6153        FileProxyInterface::r#set_flags(self, flags)
6154    }
6155
6156    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
6157    /// volume has different settings or the storage is accounted seperately from the rest of the
6158    /// filesystem that may be reported instead of filesystem-wide details.
6159    pub fn r#query_filesystem(
6160        &self,
6161    ) -> fidl::client::QueryResponseFut<
6162        (i32, Option<Box<FilesystemInfo>>),
6163        fdomain_client::fidl::FDomainResourceDialect,
6164    > {
6165        FileProxyInterface::r#query_filesystem(self)
6166    }
6167
6168    /// Acquires information about the node.
6169    ///
6170    /// The attributes of a node should be stable, independent of the
6171    /// specific protocol used to access it.
6172    ///
6173    /// If a particular attribute is not applicable or not supported,
6174    /// filesystems should leave the corresponding field absent.
6175    ///
6176    /// + `query` a bit-mask specifying which attributes to fetch. The server
6177    ///   should not return more than necessary.
6178    /// - `attributes` the returned attributes.
6179    ///
6180    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6181    pub fn r#get_attributes(
6182        &self,
6183        mut query: NodeAttributesQuery,
6184    ) -> fidl::client::QueryResponseFut<
6185        NodeGetAttributesResult,
6186        fdomain_client::fidl::FDomainResourceDialect,
6187    > {
6188        FileProxyInterface::r#get_attributes(self, query)
6189    }
6190
6191    /// Updates information about the node.
6192    ///
6193    /// + `attributes` the presence of a table field in `attributes` indicates
6194    /// the intent to update the corresponding attribute.
6195    ///
6196    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
6197    ///
6198    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6199    pub fn r#update_attributes(
6200        &self,
6201        mut payload: &MutableNodeAttributes,
6202    ) -> fidl::client::QueryResponseFut<
6203        NodeUpdateAttributesResult,
6204        fdomain_client::fidl::FDomainResourceDialect,
6205    > {
6206        FileProxyInterface::r#update_attributes(self, payload)
6207    }
6208
6209    /// Synchronizes updates to the node to the underlying media, if it exists.
6210    ///
6211    /// This method will return when the filesystem server has flushed the
6212    /// relevant updates to the underlying media, but does not guarantee the
6213    /// underlying media has persisted the information, nor that any information
6214    /// is committed to hardware. Clients may use `Sync` to ensure ordering
6215    /// between operations.
6216    ///
6217    /// This method does not require any rights.
6218    pub fn r#sync(
6219        &self,
6220    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
6221    {
6222        FileProxyInterface::r#sync(self)
6223    }
6224
6225    /// Creates an iterator over all the extended attribute names associated
6226    /// with this node. If an error occurs it is returned as an epitaph on the
6227    /// iterator request channel, and then the channel is closed.
6228    ///
6229    /// GetExtendedAttributes can be used with any of these names to retrieve
6230    /// the associated value.
6231    ///
6232    /// This method requires the [`Rights.READ_BYTES`] right.
6233    pub fn r#list_extended_attributes(
6234        &self,
6235        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6236    ) -> Result<(), fidl::Error> {
6237        FileProxyInterface::r#list_extended_attributes(self, iterator)
6238    }
6239
6240    /// Get the value associated with the given attribute `name` for this node.
6241    ///
6242    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
6243    /// particular structure is imposed on them.
6244    ///
6245    /// This method requires the [`Rights.READ_BYTES`] right.
6246    pub fn r#get_extended_attribute(
6247        &self,
6248        mut name: &[u8],
6249    ) -> fidl::client::QueryResponseFut<
6250        NodeGetExtendedAttributeResult,
6251        fdomain_client::fidl::FDomainResourceDialect,
6252    > {
6253        FileProxyInterface::r#get_extended_attribute(self, name)
6254    }
6255
6256    /// Set the value for the given attribute `name` to `value` for this node.
6257    ///
6258    /// The attribute name may exist, in which case the attribute is updated.
6259    /// If the attribute doesn't exist, it is created. The name should have no
6260    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
6261    ///
6262    /// This method requires the [`Rights.WRITE_BYTES`] right.
6263    pub fn r#set_extended_attribute(
6264        &self,
6265        mut name: &[u8],
6266        mut value: ExtendedAttributeValue,
6267        mut mode: SetExtendedAttributeMode,
6268    ) -> fidl::client::QueryResponseFut<
6269        NodeSetExtendedAttributeResult,
6270        fdomain_client::fidl::FDomainResourceDialect,
6271    > {
6272        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
6273    }
6274
6275    /// Remove the specified extended attribute.
6276    ///
6277    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
6278    ///
6279    /// This method requires the [`Rights.WRITE_BYTES`] right.
6280    pub fn r#remove_extended_attribute(
6281        &self,
6282        mut name: &[u8],
6283    ) -> fidl::client::QueryResponseFut<
6284        NodeRemoveExtendedAttributeResult,
6285        fdomain_client::fidl::FDomainResourceDialect,
6286    > {
6287        FileProxyInterface::r#remove_extended_attribute(self, name)
6288    }
6289
6290    /// Reads up to 'count' bytes at the seek offset.
6291    /// The seek offset is moved forward by the number of bytes read.
6292    ///
6293    /// ## Invariants
6294    ///
6295    /// * The returned `data.length` will never be greater than `count`.
6296    /// * If `data.length` is less than `count`, it means that the seek offset
6297    ///   has reached the end of file as part of this operation.
6298    /// * If `data.length` is zero while `count` is not, it means that the
6299    ///   seek offset is already at or beyond the end of file, and no data could
6300    ///   be read.
6301    /// * If `count` is zero, the server should perform all the checks ensuring
6302    ///   read access without actually read anything, and return an empty
6303    ///   `data` vector.
6304    ///
6305    /// This method requires the [`Rights.READ_BYTES`] right.
6306    ///
6307    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6308    pub fn r#read(
6309        &self,
6310        mut count: u64,
6311    ) -> fidl::client::QueryResponseFut<
6312        ReadableReadResult,
6313        fdomain_client::fidl::FDomainResourceDialect,
6314    > {
6315        FileProxyInterface::r#read(self, count)
6316    }
6317
6318    /// Writes data at the seek offset.
6319    /// The seek offset is moved forward by the number of bytes written.
6320    /// If the file is in append mode, the seek offset is first set to the end
6321    /// of the file, followed by the write, in one atomic step.
6322    ///
6323    /// The file size may grow if the seek offset plus `data.length` is beyond
6324    /// the current end of file.
6325    ///
6326    /// + request `data` the byte buffer to write to the file.
6327    /// - response `actual_count` the number of bytes written.
6328    ///
6329    /// ## Invariants
6330    ///
6331    /// * The returned `actual_count` will never be greater than `data.length`.
6332    /// * If the server is unable to write all the data due to e.g. not enough
6333    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6334    ///   could be written, an error is returned.
6335    /// * If `data.length` is zero, the server should perform all the checks
6336    ///   ensuring write access without mutating the file and return a
6337    ///   successful write of zero bytes.  The seek offset is still updated if
6338    ///   in append mode.
6339    ///
6340    /// This method requires the [`Rights.WRITE_BYTES`] right.
6341    pub fn r#write(
6342        &self,
6343        mut data: &[u8],
6344    ) -> fidl::client::QueryResponseFut<
6345        WritableWriteResult,
6346        fdomain_client::fidl::FDomainResourceDialect,
6347    > {
6348        FileProxyInterface::r#write(self, data)
6349    }
6350
6351    pub fn r#describe(
6352        &self,
6353    ) -> fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
6354    {
6355        FileProxyInterface::r#describe(self)
6356    }
6357
6358    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
6359    /// will occur. The seek offset is specific to each file connection.
6360    ///
6361    /// + request `origin` the reference point where `offset` will be based on.
6362    /// + request `offset` the number of bytes to seek.
6363    /// - response `offset_from_start` the adjusted seek offset, from the start
6364    ///   of the file.
6365    ///
6366    /// This method does not require any rights.
6367    pub fn r#seek(
6368        &self,
6369        mut origin: SeekOrigin,
6370        mut offset: i64,
6371    ) -> fidl::client::QueryResponseFut<FileSeekResult, fdomain_client::fidl::FDomainResourceDialect>
6372    {
6373        FileProxyInterface::r#seek(self, origin, offset)
6374    }
6375
6376    /// Reads up to 'count' bytes at the provided offset.
6377    /// Does not affect the seek offset.
6378    ///
6379    /// ## Invariants
6380    ///
6381    /// * The returned `data.length` will never be greater than `count`.
6382    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
6383    ///   the end of file as part of this operation.
6384    /// * If `data.length` is zero while `count` is not, it means that `offset`
6385    ///   is at or past the end of file, and no data can be read.
6386    /// * If `count` is zero, the server should perform all the checks ensuring
6387    ///   read access without actually reading anything, and return an empty
6388    ///   `data` vector.
6389    ///
6390    /// This method requires the [`Rights.READ_BYTES`] right.
6391    ///
6392    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6393    pub fn r#read_at(
6394        &self,
6395        mut count: u64,
6396        mut offset: u64,
6397    ) -> fidl::client::QueryResponseFut<
6398        FileReadAtResult,
6399        fdomain_client::fidl::FDomainResourceDialect,
6400    > {
6401        FileProxyInterface::r#read_at(self, count, offset)
6402    }
6403
6404    /// Writes data at the provided offset.
6405    /// Does not affect the seek offset.
6406    ///
6407    /// The file size may grow if `offset` plus `data.length` is past the
6408    /// current end of file.
6409    ///
6410    /// + request `data` the byte buffer to write to the file.
6411    /// + request `offset` the offset from start of the file to begin writing.
6412    /// - response `actual_count` the number of bytes written.
6413    ///
6414    /// ## Invariants
6415    ///
6416    /// * The returned `actual_count` will never be greater than `data.length`.
6417    /// * If the server is unable to write all the data due to e.g. not enough
6418    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6419    ///   could be written, an error is returned.
6420    /// * If `data.length` is zero, the server should perform all the checks
6421    ///   ensuring write access without mutating the file, and will return a
6422    ///   successful write of zero bytes.
6423    ///
6424    /// This method requires the [`Rights.WRITE_BYTES`] right.
6425    pub fn r#write_at(
6426        &self,
6427        mut data: &[u8],
6428        mut offset: u64,
6429    ) -> fidl::client::QueryResponseFut<
6430        FileWriteAtResult,
6431        fdomain_client::fidl::FDomainResourceDialect,
6432    > {
6433        FileProxyInterface::r#write_at(self, data, offset)
6434    }
6435
6436    /// Shrinks or grows the file size to 'length' bytes.
6437    ///
6438    /// If file size is reduced by this operation, the extra trailing data'
6439    /// is discarded.
6440    /// If file size is increased by this operation, the extended area appears
6441    /// as if it was zeroed.
6442    ///
6443    /// This method requires the [`Rights.WRITE_BYTES`] right.
6444    pub fn r#resize(
6445        &self,
6446        mut length: u64,
6447    ) -> fidl::client::QueryResponseFut<
6448        FileResizeResult,
6449        fdomain_client::fidl::FDomainResourceDialect,
6450    > {
6451        FileProxyInterface::r#resize(self, length)
6452    }
6453
6454    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
6455    /// with the requested access rights.
6456    ///
6457    /// Implementations are not required to implement files backed by VMOs so
6458    /// this request may fail. Additionally, implementations may only support
6459    /// a certain subset of the flags. Clients should be prepared with fallback
6460    /// behavior if this request fails.
6461    ///
6462    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
6463    /// implementation is free to choose the semantics of the returned VMO.
6464    ///
6465    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
6466    /// - response `vmo` the requested [`zx.Handle:VMO`].
6467    /// * error a [`zx.Status`] value indicating the failure.
6468    ///
6469    /// This method requires the following rights:
6470    ///
6471    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
6472    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
6473    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
6474    pub fn r#get_backing_memory(
6475        &self,
6476        mut flags: VmoFlags,
6477    ) -> fidl::client::QueryResponseFut<
6478        FileGetBackingMemoryResult,
6479        fdomain_client::fidl::FDomainResourceDialect,
6480    > {
6481        FileProxyInterface::r#get_backing_memory(self, flags)
6482    }
6483
6484    /// Pre-allocate on-disk space for this file.
6485    pub fn r#allocate(
6486        &self,
6487        mut offset: u64,
6488        mut length: u64,
6489        mut mode: AllocateMode,
6490    ) -> fidl::client::QueryResponseFut<
6491        FileAllocateResult,
6492        fdomain_client::fidl::FDomainResourceDialect,
6493    > {
6494        FileProxyInterface::r#allocate(self, offset, length, mode)
6495    }
6496
6497    /// Enables verification for the file (permanently) which involves computing a merkle tree for
6498    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
6499    /// captured. Future reads will be verified against the computed merkle tree and writes will be
6500    /// rejected. This method can take some time to complete as it depends on the size of the file.
6501    /// This method can be aborted by closing the connection that this method was issued on.
6502    ///
6503    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6504    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
6505    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
6506    /// Also returns any error that might arise from reading the file, or from flushing the file,
6507    /// such as `ZX_ERR_IO`.
6508    pub fn r#enable_verity(
6509        &self,
6510        mut options: &VerificationOptions,
6511    ) -> fidl::client::QueryResponseFut<
6512        FileEnableVerityResult,
6513        fdomain_client::fidl::FDomainResourceDialect,
6514    > {
6515        FileProxyInterface::r#enable_verity(self, options)
6516    }
6517}
6518
6519impl FileProxyInterface for FileProxy {
6520    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
6521        AdvisoryLockingAdvisoryLockResult,
6522        fdomain_client::fidl::FDomainResourceDialect,
6523    >;
6524    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
6525        fn _decode(
6526            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6527        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
6528            let _response = fidl::client::decode_transaction_body::<
6529                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6530                fdomain_client::fidl::FDomainResourceDialect,
6531                0x6ee9c0ad53ec87aa,
6532            >(_buf?)?;
6533            Ok(_response.map(|x| x))
6534        }
6535        self.client.send_query_and_decode::<
6536            AdvisoryLockingAdvisoryLockRequest,
6537            AdvisoryLockingAdvisoryLockResult,
6538        >(
6539            (request,),
6540            0x6ee9c0ad53ec87aa,
6541            fidl::encoding::DynamicFlags::empty(),
6542            _decode,
6543        )
6544    }
6545
6546    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
6547        LinkableLinkIntoResult,
6548        fdomain_client::fidl::FDomainResourceDialect,
6549    >;
6550    fn r#link_into(
6551        &self,
6552        mut dst_parent_token: fdomain_client::Event,
6553        mut dst: &str,
6554    ) -> Self::LinkIntoResponseFut {
6555        fn _decode(
6556            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6557        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
6558            let _response = fidl::client::decode_transaction_body::<
6559                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6560                fdomain_client::fidl::FDomainResourceDialect,
6561                0x54f3949246a03e74,
6562            >(_buf?)?;
6563            Ok(_response.map(|x| x))
6564        }
6565        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
6566            (dst_parent_token, dst),
6567            0x54f3949246a03e74,
6568            fidl::encoding::DynamicFlags::empty(),
6569            _decode,
6570        )
6571    }
6572
6573    fn r#clone(
6574        &self,
6575        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6576    ) -> Result<(), fidl::Error> {
6577        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
6578            (request,),
6579            0x20d8a7aba2168a79,
6580            fidl::encoding::DynamicFlags::empty(),
6581        )
6582    }
6583
6584    type CloseResponseFut = fidl::client::QueryResponseFut<
6585        fdomain_fuchsia_unknown::CloseableCloseResult,
6586        fdomain_client::fidl::FDomainResourceDialect,
6587    >;
6588    fn r#close(&self) -> Self::CloseResponseFut {
6589        fn _decode(
6590            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6591        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
6592            let _response = fidl::client::decode_transaction_body::<
6593                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6594                fdomain_client::fidl::FDomainResourceDialect,
6595                0x5ac5d459ad7f657e,
6596            >(_buf?)?;
6597            Ok(_response.map(|x| x))
6598        }
6599        self.client.send_query_and_decode::<
6600            fidl::encoding::EmptyPayload,
6601            fdomain_fuchsia_unknown::CloseableCloseResult,
6602        >(
6603            (),
6604            0x5ac5d459ad7f657e,
6605            fidl::encoding::DynamicFlags::empty(),
6606            _decode,
6607        )
6608    }
6609
6610    type QueryResponseFut =
6611        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
6612    fn r#query(&self) -> Self::QueryResponseFut {
6613        fn _decode(
6614            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6615        ) -> Result<Vec<u8>, fidl::Error> {
6616            let _response = fidl::client::decode_transaction_body::<
6617                fdomain_fuchsia_unknown::QueryableQueryResponse,
6618                fdomain_client::fidl::FDomainResourceDialect,
6619                0x2658edee9decfc06,
6620            >(_buf?)?;
6621            Ok(_response.protocol)
6622        }
6623        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
6624            (),
6625            0x2658edee9decfc06,
6626            fidl::encoding::DynamicFlags::empty(),
6627            _decode,
6628        )
6629    }
6630
6631    fn r#deprecated_clone(
6632        &self,
6633        mut flags: OpenFlags,
6634        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6635    ) -> Result<(), fidl::Error> {
6636        self.client.send::<NodeDeprecatedCloneRequest>(
6637            (flags, object),
6638            0x5a61678f293ce16f,
6639            fidl::encoding::DynamicFlags::FLEXIBLE,
6640        )
6641    }
6642
6643    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
6644        (i32, NodeAttributes),
6645        fdomain_client::fidl::FDomainResourceDialect,
6646    >;
6647    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
6648        fn _decode(
6649            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6650        ) -> Result<(i32, NodeAttributes), fidl::Error> {
6651            let _response = fidl::client::decode_transaction_body::<
6652                NodeDeprecatedGetAttrResponse,
6653                fdomain_client::fidl::FDomainResourceDialect,
6654                0x78985e216314dafd,
6655            >(_buf?)?;
6656            Ok((_response.s, _response.attributes))
6657        }
6658        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
6659            (),
6660            0x78985e216314dafd,
6661            fidl::encoding::DynamicFlags::empty(),
6662            _decode,
6663        )
6664    }
6665
6666    type DeprecatedSetAttrResponseFut =
6667        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6668    fn r#deprecated_set_attr(
6669        &self,
6670        mut flags: NodeAttributeFlags,
6671        mut attributes: &NodeAttributes,
6672    ) -> Self::DeprecatedSetAttrResponseFut {
6673        fn _decode(
6674            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6675        ) -> Result<i32, fidl::Error> {
6676            let _response = fidl::client::decode_transaction_body::<
6677                NodeDeprecatedSetAttrResponse,
6678                fdomain_client::fidl::FDomainResourceDialect,
6679                0x4186c0f40d938f46,
6680            >(_buf?)?;
6681            Ok(_response.s)
6682        }
6683        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
6684            (flags, attributes),
6685            0x4186c0f40d938f46,
6686            fidl::encoding::DynamicFlags::empty(),
6687            _decode,
6688        )
6689    }
6690
6691    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
6692        (i32, OpenFlags),
6693        fdomain_client::fidl::FDomainResourceDialect,
6694    >;
6695    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
6696        fn _decode(
6697            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6698        ) -> Result<(i32, OpenFlags), fidl::Error> {
6699            let _response = fidl::client::decode_transaction_body::<
6700                NodeDeprecatedGetFlagsResponse,
6701                fdomain_client::fidl::FDomainResourceDialect,
6702                0x5b88fffb8eda3aa1,
6703            >(_buf?)?;
6704            Ok((_response.s, _response.flags))
6705        }
6706        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
6707            (),
6708            0x5b88fffb8eda3aa1,
6709            fidl::encoding::DynamicFlags::empty(),
6710            _decode,
6711        )
6712    }
6713
6714    type DeprecatedSetFlagsResponseFut =
6715        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6716    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
6717        fn _decode(
6718            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6719        ) -> Result<i32, fidl::Error> {
6720            let _response = fidl::client::decode_transaction_body::<
6721                NodeDeprecatedSetFlagsResponse,
6722                fdomain_client::fidl::FDomainResourceDialect,
6723                0x5295b76c71fde733,
6724            >(_buf?)?;
6725            Ok(_response.s)
6726        }
6727        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
6728            (flags,),
6729            0x5295b76c71fde733,
6730            fidl::encoding::DynamicFlags::empty(),
6731            _decode,
6732        )
6733    }
6734
6735    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
6736        NodeGetFlagsResult,
6737        fdomain_client::fidl::FDomainResourceDialect,
6738    >;
6739    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
6740        fn _decode(
6741            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6742        ) -> Result<NodeGetFlagsResult, fidl::Error> {
6743            let _response = fidl::client::decode_transaction_body::<
6744                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
6745                fdomain_client::fidl::FDomainResourceDialect,
6746                0x176eb318f64ec23,
6747            >(_buf?)?
6748            .into_result_fdomain::<FileMarker>("get_flags")?;
6749            Ok(_response.map(|x| x.flags))
6750        }
6751        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
6752            (),
6753            0x176eb318f64ec23,
6754            fidl::encoding::DynamicFlags::FLEXIBLE,
6755            _decode,
6756        )
6757    }
6758
6759    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
6760        NodeSetFlagsResult,
6761        fdomain_client::fidl::FDomainResourceDialect,
6762    >;
6763    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
6764        fn _decode(
6765            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6766        ) -> Result<NodeSetFlagsResult, fidl::Error> {
6767            let _response = fidl::client::decode_transaction_body::<
6768                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6769                fdomain_client::fidl::FDomainResourceDialect,
6770                0x55a8028685791ea8,
6771            >(_buf?)?
6772            .into_result_fdomain::<FileMarker>("set_flags")?;
6773            Ok(_response.map(|x| x))
6774        }
6775        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
6776            (flags,),
6777            0x55a8028685791ea8,
6778            fidl::encoding::DynamicFlags::FLEXIBLE,
6779            _decode,
6780        )
6781    }
6782
6783    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
6784        (i32, Option<Box<FilesystemInfo>>),
6785        fdomain_client::fidl::FDomainResourceDialect,
6786    >;
6787    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
6788        fn _decode(
6789            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6790        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
6791            let _response = fidl::client::decode_transaction_body::<
6792                NodeQueryFilesystemResponse,
6793                fdomain_client::fidl::FDomainResourceDialect,
6794                0x6f344a1c6b0a0610,
6795            >(_buf?)?;
6796            Ok((_response.s, _response.info))
6797        }
6798        self.client.send_query_and_decode::<
6799            fidl::encoding::EmptyPayload,
6800            (i32, Option<Box<FilesystemInfo>>),
6801        >(
6802            (),
6803            0x6f344a1c6b0a0610,
6804            fidl::encoding::DynamicFlags::empty(),
6805            _decode,
6806        )
6807    }
6808
6809    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
6810        NodeGetAttributesResult,
6811        fdomain_client::fidl::FDomainResourceDialect,
6812    >;
6813    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
6814        fn _decode(
6815            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6816        ) -> Result<NodeGetAttributesResult, fidl::Error> {
6817            let _response = fidl::client::decode_transaction_body::<
6818                fidl::encoding::ResultType<NodeAttributes2, i32>,
6819                fdomain_client::fidl::FDomainResourceDialect,
6820                0x3d4396a638ea053b,
6821            >(_buf?)?;
6822            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
6823        }
6824        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
6825            (query,),
6826            0x3d4396a638ea053b,
6827            fidl::encoding::DynamicFlags::empty(),
6828            _decode,
6829        )
6830    }
6831
6832    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
6833        NodeUpdateAttributesResult,
6834        fdomain_client::fidl::FDomainResourceDialect,
6835    >;
6836    fn r#update_attributes(
6837        &self,
6838        mut payload: &MutableNodeAttributes,
6839    ) -> Self::UpdateAttributesResponseFut {
6840        fn _decode(
6841            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6842        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
6843            let _response = fidl::client::decode_transaction_body::<
6844                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6845                fdomain_client::fidl::FDomainResourceDialect,
6846                0x3308c1da5a89bf08,
6847            >(_buf?)?;
6848            Ok(_response.map(|x| x))
6849        }
6850        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
6851            payload,
6852            0x3308c1da5a89bf08,
6853            fidl::encoding::DynamicFlags::empty(),
6854            _decode,
6855        )
6856    }
6857
6858    type SyncResponseFut = fidl::client::QueryResponseFut<
6859        NodeSyncResult,
6860        fdomain_client::fidl::FDomainResourceDialect,
6861    >;
6862    fn r#sync(&self) -> Self::SyncResponseFut {
6863        fn _decode(
6864            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6865        ) -> Result<NodeSyncResult, fidl::Error> {
6866            let _response = fidl::client::decode_transaction_body::<
6867                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6868                fdomain_client::fidl::FDomainResourceDialect,
6869                0x2c5c27ca0ab5dc49,
6870            >(_buf?)?;
6871            Ok(_response.map(|x| x))
6872        }
6873        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
6874            (),
6875            0x2c5c27ca0ab5dc49,
6876            fidl::encoding::DynamicFlags::empty(),
6877            _decode,
6878        )
6879    }
6880
6881    fn r#list_extended_attributes(
6882        &self,
6883        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6884    ) -> Result<(), fidl::Error> {
6885        self.client.send::<NodeListExtendedAttributesRequest>(
6886            (iterator,),
6887            0x4b61033de007fcd0,
6888            fidl::encoding::DynamicFlags::empty(),
6889        )
6890    }
6891
6892    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6893        NodeGetExtendedAttributeResult,
6894        fdomain_client::fidl::FDomainResourceDialect,
6895    >;
6896    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
6897        fn _decode(
6898            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6899        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
6900            let _response = fidl::client::decode_transaction_body::<
6901                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
6902                fdomain_client::fidl::FDomainResourceDialect,
6903                0x45ffa3ccfdeb76db,
6904            >(_buf?)?;
6905            Ok(_response.map(|x| x))
6906        }
6907        self.client.send_query_and_decode::<
6908            NodeGetExtendedAttributeRequest,
6909            NodeGetExtendedAttributeResult,
6910        >(
6911            (name,),
6912            0x45ffa3ccfdeb76db,
6913            fidl::encoding::DynamicFlags::empty(),
6914            _decode,
6915        )
6916    }
6917
6918    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6919        NodeSetExtendedAttributeResult,
6920        fdomain_client::fidl::FDomainResourceDialect,
6921    >;
6922    fn r#set_extended_attribute(
6923        &self,
6924        mut name: &[u8],
6925        mut value: ExtendedAttributeValue,
6926        mut mode: SetExtendedAttributeMode,
6927    ) -> Self::SetExtendedAttributeResponseFut {
6928        fn _decode(
6929            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6930        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
6931            let _response = fidl::client::decode_transaction_body::<
6932                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6933                fdomain_client::fidl::FDomainResourceDialect,
6934                0x4a951362f681f23c,
6935            >(_buf?)?;
6936            Ok(_response.map(|x| x))
6937        }
6938        self.client.send_query_and_decode::<
6939            NodeSetExtendedAttributeRequest,
6940            NodeSetExtendedAttributeResult,
6941        >(
6942            (name, &mut value, mode,),
6943            0x4a951362f681f23c,
6944            fidl::encoding::DynamicFlags::empty(),
6945            _decode,
6946        )
6947    }
6948
6949    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6950        NodeRemoveExtendedAttributeResult,
6951        fdomain_client::fidl::FDomainResourceDialect,
6952    >;
6953    fn r#remove_extended_attribute(
6954        &self,
6955        mut name: &[u8],
6956    ) -> Self::RemoveExtendedAttributeResponseFut {
6957        fn _decode(
6958            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6959        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
6960            let _response = fidl::client::decode_transaction_body::<
6961                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6962                fdomain_client::fidl::FDomainResourceDialect,
6963                0x7a0b9f3a9bf9032d,
6964            >(_buf?)?;
6965            Ok(_response.map(|x| x))
6966        }
6967        self.client.send_query_and_decode::<
6968            NodeRemoveExtendedAttributeRequest,
6969            NodeRemoveExtendedAttributeResult,
6970        >(
6971            (name,),
6972            0x7a0b9f3a9bf9032d,
6973            fidl::encoding::DynamicFlags::empty(),
6974            _decode,
6975        )
6976    }
6977
6978    type ReadResponseFut = fidl::client::QueryResponseFut<
6979        ReadableReadResult,
6980        fdomain_client::fidl::FDomainResourceDialect,
6981    >;
6982    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
6983        fn _decode(
6984            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6985        ) -> Result<ReadableReadResult, fidl::Error> {
6986            let _response = fidl::client::decode_transaction_body::<
6987                fidl::encoding::ResultType<ReadableReadResponse, i32>,
6988                fdomain_client::fidl::FDomainResourceDialect,
6989                0x57e419a298c8ede,
6990            >(_buf?)?;
6991            Ok(_response.map(|x| x.data))
6992        }
6993        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
6994            (count,),
6995            0x57e419a298c8ede,
6996            fidl::encoding::DynamicFlags::empty(),
6997            _decode,
6998        )
6999    }
7000
7001    type WriteResponseFut = fidl::client::QueryResponseFut<
7002        WritableWriteResult,
7003        fdomain_client::fidl::FDomainResourceDialect,
7004    >;
7005    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
7006        fn _decode(
7007            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7008        ) -> Result<WritableWriteResult, fidl::Error> {
7009            let _response = fidl::client::decode_transaction_body::<
7010                fidl::encoding::ResultType<WritableWriteResponse, i32>,
7011                fdomain_client::fidl::FDomainResourceDialect,
7012                0x6a31437832469f82,
7013            >(_buf?)?;
7014            Ok(_response.map(|x| x.actual_count))
7015        }
7016        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
7017            (data,),
7018            0x6a31437832469f82,
7019            fidl::encoding::DynamicFlags::empty(),
7020            _decode,
7021        )
7022    }
7023
7024    type DescribeResponseFut =
7025        fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>;
7026    fn r#describe(&self) -> Self::DescribeResponseFut {
7027        fn _decode(
7028            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7029        ) -> Result<FileInfo, fidl::Error> {
7030            let _response = fidl::client::decode_transaction_body::<
7031                FileInfo,
7032                fdomain_client::fidl::FDomainResourceDialect,
7033                0x68b5ac00c62906bc,
7034            >(_buf?)?;
7035            Ok(_response)
7036        }
7037        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
7038            (),
7039            0x68b5ac00c62906bc,
7040            fidl::encoding::DynamicFlags::empty(),
7041            _decode,
7042        )
7043    }
7044
7045    type SeekResponseFut = fidl::client::QueryResponseFut<
7046        FileSeekResult,
7047        fdomain_client::fidl::FDomainResourceDialect,
7048    >;
7049    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
7050        fn _decode(
7051            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7052        ) -> Result<FileSeekResult, fidl::Error> {
7053            let _response = fidl::client::decode_transaction_body::<
7054                fidl::encoding::ResultType<FileSeekResponse, i32>,
7055                fdomain_client::fidl::FDomainResourceDialect,
7056                0x78079168162c5207,
7057            >(_buf?)?;
7058            Ok(_response.map(|x| x.offset_from_start))
7059        }
7060        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
7061            (origin, offset),
7062            0x78079168162c5207,
7063            fidl::encoding::DynamicFlags::empty(),
7064            _decode,
7065        )
7066    }
7067
7068    type ReadAtResponseFut = fidl::client::QueryResponseFut<
7069        FileReadAtResult,
7070        fdomain_client::fidl::FDomainResourceDialect,
7071    >;
7072    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
7073        fn _decode(
7074            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7075        ) -> Result<FileReadAtResult, fidl::Error> {
7076            let _response = fidl::client::decode_transaction_body::<
7077                fidl::encoding::ResultType<FileReadAtResponse, i32>,
7078                fdomain_client::fidl::FDomainResourceDialect,
7079                0x1607a293a60d723e,
7080            >(_buf?)?;
7081            Ok(_response.map(|x| x.data))
7082        }
7083        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
7084            (count, offset),
7085            0x1607a293a60d723e,
7086            fidl::encoding::DynamicFlags::empty(),
7087            _decode,
7088        )
7089    }
7090
7091    type WriteAtResponseFut = fidl::client::QueryResponseFut<
7092        FileWriteAtResult,
7093        fdomain_client::fidl::FDomainResourceDialect,
7094    >;
7095    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
7096        fn _decode(
7097            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7098        ) -> Result<FileWriteAtResult, fidl::Error> {
7099            let _response = fidl::client::decode_transaction_body::<
7100                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7101                fdomain_client::fidl::FDomainResourceDialect,
7102                0x793eefc0045e792b,
7103            >(_buf?)?;
7104            Ok(_response.map(|x| x.actual_count))
7105        }
7106        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
7107            (data, offset),
7108            0x793eefc0045e792b,
7109            fidl::encoding::DynamicFlags::empty(),
7110            _decode,
7111        )
7112    }
7113
7114    type ResizeResponseFut = fidl::client::QueryResponseFut<
7115        FileResizeResult,
7116        fdomain_client::fidl::FDomainResourceDialect,
7117    >;
7118    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
7119        fn _decode(
7120            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7121        ) -> Result<FileResizeResult, fidl::Error> {
7122            let _response = fidl::client::decode_transaction_body::<
7123                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7124                fdomain_client::fidl::FDomainResourceDialect,
7125                0x2b80825f0535743a,
7126            >(_buf?)?;
7127            Ok(_response.map(|x| x))
7128        }
7129        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
7130            (length,),
7131            0x2b80825f0535743a,
7132            fidl::encoding::DynamicFlags::empty(),
7133            _decode,
7134        )
7135    }
7136
7137    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
7138        FileGetBackingMemoryResult,
7139        fdomain_client::fidl::FDomainResourceDialect,
7140    >;
7141    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
7142        fn _decode(
7143            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7144        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7145            let _response = fidl::client::decode_transaction_body::<
7146                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7147                fdomain_client::fidl::FDomainResourceDialect,
7148                0xa6a9e654cbf62b,
7149            >(_buf?)?;
7150            Ok(_response.map(|x| x.vmo))
7151        }
7152        self.client
7153            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
7154                (flags,),
7155                0xa6a9e654cbf62b,
7156                fidl::encoding::DynamicFlags::empty(),
7157                _decode,
7158            )
7159    }
7160
7161    type AllocateResponseFut = fidl::client::QueryResponseFut<
7162        FileAllocateResult,
7163        fdomain_client::fidl::FDomainResourceDialect,
7164    >;
7165    fn r#allocate(
7166        &self,
7167        mut offset: u64,
7168        mut length: u64,
7169        mut mode: AllocateMode,
7170    ) -> Self::AllocateResponseFut {
7171        fn _decode(
7172            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7173        ) -> Result<FileAllocateResult, fidl::Error> {
7174            let _response = fidl::client::decode_transaction_body::<
7175                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7176                fdomain_client::fidl::FDomainResourceDialect,
7177                0x77fa0c330b57fd2e,
7178            >(_buf?)?
7179            .into_result_fdomain::<FileMarker>("allocate")?;
7180            Ok(_response.map(|x| x))
7181        }
7182        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
7183            (offset, length, mode),
7184            0x77fa0c330b57fd2e,
7185            fidl::encoding::DynamicFlags::FLEXIBLE,
7186            _decode,
7187        )
7188    }
7189
7190    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
7191        FileEnableVerityResult,
7192        fdomain_client::fidl::FDomainResourceDialect,
7193    >;
7194    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
7195        fn _decode(
7196            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7197        ) -> Result<FileEnableVerityResult, fidl::Error> {
7198            let _response = fidl::client::decode_transaction_body::<
7199                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7200                fdomain_client::fidl::FDomainResourceDialect,
7201                0x2c421ec3faaeb8bb,
7202            >(_buf?)?
7203            .into_result_fdomain::<FileMarker>("enable_verity")?;
7204            Ok(_response.map(|x| x))
7205        }
7206        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
7207            (options,),
7208            0x2c421ec3faaeb8bb,
7209            fidl::encoding::DynamicFlags::FLEXIBLE,
7210            _decode,
7211        )
7212    }
7213}
7214
7215pub struct FileEventStream {
7216    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7217}
7218
7219impl std::marker::Unpin for FileEventStream {}
7220
7221impl futures::stream::FusedStream for FileEventStream {
7222    fn is_terminated(&self) -> bool {
7223        self.event_receiver.is_terminated()
7224    }
7225}
7226
7227impl futures::Stream for FileEventStream {
7228    type Item = Result<FileEvent, fidl::Error>;
7229
7230    fn poll_next(
7231        mut self: std::pin::Pin<&mut Self>,
7232        cx: &mut std::task::Context<'_>,
7233    ) -> std::task::Poll<Option<Self::Item>> {
7234        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7235            &mut self.event_receiver,
7236            cx
7237        )?) {
7238            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
7239            None => std::task::Poll::Ready(None),
7240        }
7241    }
7242}
7243
7244#[derive(Debug)]
7245pub enum FileEvent {
7246    OnOpen_ {
7247        s: i32,
7248        info: Option<Box<NodeInfoDeprecated>>,
7249    },
7250    OnRepresentation {
7251        payload: Representation,
7252    },
7253    #[non_exhaustive]
7254    _UnknownEvent {
7255        /// Ordinal of the event that was sent.
7256        ordinal: u64,
7257    },
7258}
7259
7260impl FileEvent {
7261    #[allow(irrefutable_let_patterns)]
7262    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
7263        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
7264    }
7265    #[allow(irrefutable_let_patterns)]
7266    pub fn into_on_representation(self) -> Option<Representation> {
7267        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
7268    }
7269
7270    /// Decodes a message buffer as a [`FileEvent`].
7271    fn decode(
7272        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7273    ) -> Result<FileEvent, fidl::Error> {
7274        let (bytes, _handles) = buf.split_mut();
7275        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7276        debug_assert_eq!(tx_header.tx_id, 0);
7277        match tx_header.ordinal {
7278            0x7fc7bbb1dbfd1972 => {
7279                let mut out = fidl::new_empty!(
7280                    NodeOnOpenRequest,
7281                    fdomain_client::fidl::FDomainResourceDialect
7282                );
7283                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
7284                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
7285            }
7286            0x5cb40567d80a510c => {
7287                let mut out =
7288                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
7289                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
7290                Ok((FileEvent::OnRepresentation { payload: out }))
7291            }
7292            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7293                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7294            }
7295            _ => Err(fidl::Error::UnknownOrdinal {
7296                ordinal: tx_header.ordinal,
7297                protocol_name: <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7298            }),
7299        }
7300    }
7301}
7302
7303/// A Stream of incoming requests for fuchsia.io/File.
7304pub struct FileRequestStream {
7305    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7306    is_terminated: bool,
7307}
7308
7309impl std::marker::Unpin for FileRequestStream {}
7310
7311impl futures::stream::FusedStream for FileRequestStream {
7312    fn is_terminated(&self) -> bool {
7313        self.is_terminated
7314    }
7315}
7316
7317impl fdomain_client::fidl::RequestStream for FileRequestStream {
7318    type Protocol = FileMarker;
7319    type ControlHandle = FileControlHandle;
7320
7321    fn from_channel(channel: fdomain_client::Channel) -> Self {
7322        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7323    }
7324
7325    fn control_handle(&self) -> Self::ControlHandle {
7326        FileControlHandle { inner: self.inner.clone() }
7327    }
7328
7329    fn into_inner(
7330        self,
7331    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7332    {
7333        (self.inner, self.is_terminated)
7334    }
7335
7336    fn from_inner(
7337        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7338        is_terminated: bool,
7339    ) -> Self {
7340        Self { inner, is_terminated }
7341    }
7342}
7343
7344impl futures::Stream for FileRequestStream {
7345    type Item = Result<FileRequest, fidl::Error>;
7346
7347    fn poll_next(
7348        mut self: std::pin::Pin<&mut Self>,
7349        cx: &mut std::task::Context<'_>,
7350    ) -> std::task::Poll<Option<Self::Item>> {
7351        let this = &mut *self;
7352        if this.inner.check_shutdown(cx) {
7353            this.is_terminated = true;
7354            return std::task::Poll::Ready(None);
7355        }
7356        if this.is_terminated {
7357            panic!("polled FileRequestStream after completion");
7358        }
7359        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7360            |bytes, handles| {
7361                match this.inner.channel().read_etc(cx, bytes, handles) {
7362                    std::task::Poll::Ready(Ok(())) => {}
7363                    std::task::Poll::Pending => return std::task::Poll::Pending,
7364                    std::task::Poll::Ready(Err(None)) => {
7365                        this.is_terminated = true;
7366                        return std::task::Poll::Ready(None);
7367                    }
7368                    std::task::Poll::Ready(Err(Some(e))) => {
7369                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7370                            e.into(),
7371                        ))));
7372                    }
7373                }
7374
7375                // A message has been received from the channel
7376                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7377
7378                std::task::Poll::Ready(Some(match header.ordinal {
7379                    0x6ee9c0ad53ec87aa => {
7380                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7381                        let mut req = fidl::new_empty!(
7382                            AdvisoryLockingAdvisoryLockRequest,
7383                            fdomain_client::fidl::FDomainResourceDialect
7384                        );
7385                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
7386                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7387                        Ok(FileRequest::AdvisoryLock {
7388                            request: req.request,
7389
7390                            responder: FileAdvisoryLockResponder {
7391                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7392                                tx_id: header.tx_id,
7393                            },
7394                        })
7395                    }
7396                    0x54f3949246a03e74 => {
7397                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7398                        let mut req = fidl::new_empty!(
7399                            LinkableLinkIntoRequest,
7400                            fdomain_client::fidl::FDomainResourceDialect
7401                        );
7402                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
7403                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7404                        Ok(FileRequest::LinkInto {
7405                            dst_parent_token: req.dst_parent_token,
7406                            dst: req.dst,
7407
7408                            responder: FileLinkIntoResponder {
7409                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7410                                tx_id: header.tx_id,
7411                            },
7412                        })
7413                    }
7414                    0x20d8a7aba2168a79 => {
7415                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7416                        let mut req = fidl::new_empty!(
7417                            fdomain_fuchsia_unknown::CloneableCloneRequest,
7418                            fdomain_client::fidl::FDomainResourceDialect
7419                        );
7420                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7421                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7422                        Ok(FileRequest::Clone { request: req.request, control_handle })
7423                    }
7424                    0x5ac5d459ad7f657e => {
7425                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7426                        let mut req = fidl::new_empty!(
7427                            fidl::encoding::EmptyPayload,
7428                            fdomain_client::fidl::FDomainResourceDialect
7429                        );
7430                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7431                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7432                        Ok(FileRequest::Close {
7433                            responder: FileCloseResponder {
7434                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7435                                tx_id: header.tx_id,
7436                            },
7437                        })
7438                    }
7439                    0x2658edee9decfc06 => {
7440                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7441                        let mut req = fidl::new_empty!(
7442                            fidl::encoding::EmptyPayload,
7443                            fdomain_client::fidl::FDomainResourceDialect
7444                        );
7445                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7446                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7447                        Ok(FileRequest::Query {
7448                            responder: FileQueryResponder {
7449                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7450                                tx_id: header.tx_id,
7451                            },
7452                        })
7453                    }
7454                    0x5a61678f293ce16f => {
7455                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7456                        let mut req = fidl::new_empty!(
7457                            NodeDeprecatedCloneRequest,
7458                            fdomain_client::fidl::FDomainResourceDialect
7459                        );
7460                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7461                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7462                        Ok(FileRequest::DeprecatedClone {
7463                            flags: req.flags,
7464                            object: req.object,
7465
7466                            control_handle,
7467                        })
7468                    }
7469                    0x78985e216314dafd => {
7470                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7471                        let mut req = fidl::new_empty!(
7472                            fidl::encoding::EmptyPayload,
7473                            fdomain_client::fidl::FDomainResourceDialect
7474                        );
7475                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7476                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7477                        Ok(FileRequest::DeprecatedGetAttr {
7478                            responder: FileDeprecatedGetAttrResponder {
7479                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7480                                tx_id: header.tx_id,
7481                            },
7482                        })
7483                    }
7484                    0x4186c0f40d938f46 => {
7485                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7486                        let mut req = fidl::new_empty!(
7487                            NodeDeprecatedSetAttrRequest,
7488                            fdomain_client::fidl::FDomainResourceDialect
7489                        );
7490                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
7491                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7492                        Ok(FileRequest::DeprecatedSetAttr {
7493                            flags: req.flags,
7494                            attributes: req.attributes,
7495
7496                            responder: FileDeprecatedSetAttrResponder {
7497                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7498                                tx_id: header.tx_id,
7499                            },
7500                        })
7501                    }
7502                    0x5b88fffb8eda3aa1 => {
7503                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7504                        let mut req = fidl::new_empty!(
7505                            fidl::encoding::EmptyPayload,
7506                            fdomain_client::fidl::FDomainResourceDialect
7507                        );
7508                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7509                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7510                        Ok(FileRequest::DeprecatedGetFlags {
7511                            responder: FileDeprecatedGetFlagsResponder {
7512                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7513                                tx_id: header.tx_id,
7514                            },
7515                        })
7516                    }
7517                    0x5295b76c71fde733 => {
7518                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7519                        let mut req = fidl::new_empty!(
7520                            NodeDeprecatedSetFlagsRequest,
7521                            fdomain_client::fidl::FDomainResourceDialect
7522                        );
7523                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7524                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7525                        Ok(FileRequest::DeprecatedSetFlags {
7526                            flags: req.flags,
7527
7528                            responder: FileDeprecatedSetFlagsResponder {
7529                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7530                                tx_id: header.tx_id,
7531                            },
7532                        })
7533                    }
7534                    0x176eb318f64ec23 => {
7535                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7536                        let mut req = fidl::new_empty!(
7537                            fidl::encoding::EmptyPayload,
7538                            fdomain_client::fidl::FDomainResourceDialect
7539                        );
7540                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7541                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7542                        Ok(FileRequest::GetFlags {
7543                            responder: FileGetFlagsResponder {
7544                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7545                                tx_id: header.tx_id,
7546                            },
7547                        })
7548                    }
7549                    0x55a8028685791ea8 => {
7550                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7551                        let mut req = fidl::new_empty!(
7552                            NodeSetFlagsRequest,
7553                            fdomain_client::fidl::FDomainResourceDialect
7554                        );
7555                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7556                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7557                        Ok(FileRequest::SetFlags {
7558                            flags: req.flags,
7559
7560                            responder: FileSetFlagsResponder {
7561                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7562                                tx_id: header.tx_id,
7563                            },
7564                        })
7565                    }
7566                    0x6f344a1c6b0a0610 => {
7567                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7568                        let mut req = fidl::new_empty!(
7569                            fidl::encoding::EmptyPayload,
7570                            fdomain_client::fidl::FDomainResourceDialect
7571                        );
7572                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7573                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7574                        Ok(FileRequest::QueryFilesystem {
7575                            responder: FileQueryFilesystemResponder {
7576                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7577                                tx_id: header.tx_id,
7578                            },
7579                        })
7580                    }
7581                    0x3d4396a638ea053b => {
7582                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7583                        let mut req = fidl::new_empty!(
7584                            NodeGetAttributesRequest,
7585                            fdomain_client::fidl::FDomainResourceDialect
7586                        );
7587                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7588                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7589                        Ok(FileRequest::GetAttributes {
7590                            query: req.query,
7591
7592                            responder: FileGetAttributesResponder {
7593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7594                                tx_id: header.tx_id,
7595                            },
7596                        })
7597                    }
7598                    0x3308c1da5a89bf08 => {
7599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7600                        let mut req = fidl::new_empty!(
7601                            MutableNodeAttributes,
7602                            fdomain_client::fidl::FDomainResourceDialect
7603                        );
7604                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
7605                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7606                        Ok(FileRequest::UpdateAttributes {
7607                            payload: req,
7608                            responder: FileUpdateAttributesResponder {
7609                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7610                                tx_id: header.tx_id,
7611                            },
7612                        })
7613                    }
7614                    0x2c5c27ca0ab5dc49 => {
7615                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7616                        let mut req = fidl::new_empty!(
7617                            fidl::encoding::EmptyPayload,
7618                            fdomain_client::fidl::FDomainResourceDialect
7619                        );
7620                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7621                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7622                        Ok(FileRequest::Sync {
7623                            responder: FileSyncResponder {
7624                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7625                                tx_id: header.tx_id,
7626                            },
7627                        })
7628                    }
7629                    0x4b61033de007fcd0 => {
7630                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7631                        let mut req = fidl::new_empty!(
7632                            NodeListExtendedAttributesRequest,
7633                            fdomain_client::fidl::FDomainResourceDialect
7634                        );
7635                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7636                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7637                        Ok(FileRequest::ListExtendedAttributes {
7638                            iterator: req.iterator,
7639
7640                            control_handle,
7641                        })
7642                    }
7643                    0x45ffa3ccfdeb76db => {
7644                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7645                        let mut req = fidl::new_empty!(
7646                            NodeGetExtendedAttributeRequest,
7647                            fdomain_client::fidl::FDomainResourceDialect
7648                        );
7649                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7650                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7651                        Ok(FileRequest::GetExtendedAttribute {
7652                            name: req.name,
7653
7654                            responder: FileGetExtendedAttributeResponder {
7655                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7656                                tx_id: header.tx_id,
7657                            },
7658                        })
7659                    }
7660                    0x4a951362f681f23c => {
7661                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7662                        let mut req = fidl::new_empty!(
7663                            NodeSetExtendedAttributeRequest,
7664                            fdomain_client::fidl::FDomainResourceDialect
7665                        );
7666                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7667                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7668                        Ok(FileRequest::SetExtendedAttribute {
7669                            name: req.name,
7670                            value: req.value,
7671                            mode: req.mode,
7672
7673                            responder: FileSetExtendedAttributeResponder {
7674                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7675                                tx_id: header.tx_id,
7676                            },
7677                        })
7678                    }
7679                    0x7a0b9f3a9bf9032d => {
7680                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7681                        let mut req = fidl::new_empty!(
7682                            NodeRemoveExtendedAttributeRequest,
7683                            fdomain_client::fidl::FDomainResourceDialect
7684                        );
7685                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7686                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7687                        Ok(FileRequest::RemoveExtendedAttribute {
7688                            name: req.name,
7689
7690                            responder: FileRemoveExtendedAttributeResponder {
7691                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7692                                tx_id: header.tx_id,
7693                            },
7694                        })
7695                    }
7696                    0x57e419a298c8ede => {
7697                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7698                        let mut req = fidl::new_empty!(
7699                            ReadableReadRequest,
7700                            fdomain_client::fidl::FDomainResourceDialect
7701                        );
7702                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
7703                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7704                        Ok(FileRequest::Read {
7705                            count: req.count,
7706
7707                            responder: FileReadResponder {
7708                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7709                                tx_id: header.tx_id,
7710                            },
7711                        })
7712                    }
7713                    0x6a31437832469f82 => {
7714                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7715                        let mut req = fidl::new_empty!(
7716                            WritableWriteRequest,
7717                            fdomain_client::fidl::FDomainResourceDialect
7718                        );
7719                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
7720                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7721                        Ok(FileRequest::Write {
7722                            data: req.data,
7723
7724                            responder: FileWriteResponder {
7725                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7726                                tx_id: header.tx_id,
7727                            },
7728                        })
7729                    }
7730                    0x68b5ac00c62906bc => {
7731                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7732                        let mut req = fidl::new_empty!(
7733                            fidl::encoding::EmptyPayload,
7734                            fdomain_client::fidl::FDomainResourceDialect
7735                        );
7736                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7737                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7738                        Ok(FileRequest::Describe {
7739                            responder: FileDescribeResponder {
7740                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7741                                tx_id: header.tx_id,
7742                            },
7743                        })
7744                    }
7745                    0x78079168162c5207 => {
7746                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7747                        let mut req = fidl::new_empty!(
7748                            FileSeekRequest,
7749                            fdomain_client::fidl::FDomainResourceDialect
7750                        );
7751                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
7752                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7753                        Ok(FileRequest::Seek {
7754                            origin: req.origin,
7755                            offset: req.offset,
7756
7757                            responder: FileSeekResponder {
7758                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7759                                tx_id: header.tx_id,
7760                            },
7761                        })
7762                    }
7763                    0x1607a293a60d723e => {
7764                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7765                        let mut req = fidl::new_empty!(
7766                            FileReadAtRequest,
7767                            fdomain_client::fidl::FDomainResourceDialect
7768                        );
7769                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
7770                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7771                        Ok(FileRequest::ReadAt {
7772                            count: req.count,
7773                            offset: req.offset,
7774
7775                            responder: FileReadAtResponder {
7776                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7777                                tx_id: header.tx_id,
7778                            },
7779                        })
7780                    }
7781                    0x793eefc0045e792b => {
7782                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7783                        let mut req = fidl::new_empty!(
7784                            FileWriteAtRequest,
7785                            fdomain_client::fidl::FDomainResourceDialect
7786                        );
7787                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
7788                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7789                        Ok(FileRequest::WriteAt {
7790                            data: req.data,
7791                            offset: req.offset,
7792
7793                            responder: FileWriteAtResponder {
7794                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7795                                tx_id: header.tx_id,
7796                            },
7797                        })
7798                    }
7799                    0x2b80825f0535743a => {
7800                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7801                        let mut req = fidl::new_empty!(
7802                            FileResizeRequest,
7803                            fdomain_client::fidl::FDomainResourceDialect
7804                        );
7805                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
7806                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7807                        Ok(FileRequest::Resize {
7808                            length: req.length,
7809
7810                            responder: FileResizeResponder {
7811                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7812                                tx_id: header.tx_id,
7813                            },
7814                        })
7815                    }
7816                    0xa6a9e654cbf62b => {
7817                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7818                        let mut req = fidl::new_empty!(
7819                            FileGetBackingMemoryRequest,
7820                            fdomain_client::fidl::FDomainResourceDialect
7821                        );
7822                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
7823                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7824                        Ok(FileRequest::GetBackingMemory {
7825                            flags: req.flags,
7826
7827                            responder: FileGetBackingMemoryResponder {
7828                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7829                                tx_id: header.tx_id,
7830                            },
7831                        })
7832                    }
7833                    0x77fa0c330b57fd2e => {
7834                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7835                        let mut req = fidl::new_empty!(
7836                            FileAllocateRequest,
7837                            fdomain_client::fidl::FDomainResourceDialect
7838                        );
7839                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
7840                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7841                        Ok(FileRequest::Allocate {
7842                            offset: req.offset,
7843                            length: req.length,
7844                            mode: req.mode,
7845
7846                            responder: FileAllocateResponder {
7847                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7848                                tx_id: header.tx_id,
7849                            },
7850                        })
7851                    }
7852                    0x2c421ec3faaeb8bb => {
7853                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7854                        let mut req = fidl::new_empty!(
7855                            FileEnableVerityRequest,
7856                            fdomain_client::fidl::FDomainResourceDialect
7857                        );
7858                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
7859                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7860                        Ok(FileRequest::EnableVerity {
7861                            options: req.options,
7862
7863                            responder: FileEnableVerityResponder {
7864                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7865                                tx_id: header.tx_id,
7866                            },
7867                        })
7868                    }
7869                    _ if header.tx_id == 0
7870                        && header
7871                            .dynamic_flags()
7872                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7873                    {
7874                        Ok(FileRequest::_UnknownMethod {
7875                            ordinal: header.ordinal,
7876                            control_handle: FileControlHandle { inner: this.inner.clone() },
7877                            method_type: fidl::MethodType::OneWay,
7878                        })
7879                    }
7880                    _ if header
7881                        .dynamic_flags()
7882                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7883                    {
7884                        this.inner.send_framework_err(
7885                            fidl::encoding::FrameworkErr::UnknownMethod,
7886                            header.tx_id,
7887                            header.ordinal,
7888                            header.dynamic_flags(),
7889                            (bytes, handles),
7890                        )?;
7891                        Ok(FileRequest::_UnknownMethod {
7892                            ordinal: header.ordinal,
7893                            control_handle: FileControlHandle { inner: this.inner.clone() },
7894                            method_type: fidl::MethodType::TwoWay,
7895                        })
7896                    }
7897                    _ => Err(fidl::Error::UnknownOrdinal {
7898                        ordinal: header.ordinal,
7899                        protocol_name:
7900                            <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7901                    }),
7902                }))
7903            },
7904        )
7905    }
7906}
7907
7908/// A [`Node`] which contains a sequence of bytes of definite length.
7909///
7910/// NOTE: cloned connections do not share their seek offset with their source
7911/// connection.
7912#[derive(Debug)]
7913pub enum FileRequest {
7914    /// Acquires an advisory lock on the underlying file.
7915    ///
7916    /// The lock lasts until either this connection is closed or
7917    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7918    /// explicitly.
7919    ///
7920    /// Advisory locks are purely advisory. They do not prevent actual read or
7921    /// write operations from occurring on the file, either through this
7922    /// connection or through other connections.
7923    ///
7924    /// This method requires the following rights:
7925    ///
7926    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7927    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7928    ///   [`AdvisoryLockType.WRITE`].
7929    ///
7930    /// # Errors
7931    ///
7932    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7933    ///   example, another connection might hold a conflicting lock type.
7934    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7935    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7936    ///   to acquire the given type of lock.
7937    AdvisoryLock {
7938        request: AdvisoryLockRequest,
7939        responder: FileAdvisoryLockResponder,
7940    },
7941    /// Creates a link to this this object with name `dst` in the directory represented by
7942    /// `dst_parent_token`.
7943    ///
7944    /// `dst` must be a resolved object name. Including "/" in the string will return
7945    /// `ZX_ERR_INVALID_ARGS`.
7946    ///
7947    /// This method requires the maximal set of rights supported by the filesystem for this object.
7948    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7949    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7950    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7951    /// `ZX_ERR_ACCESS_DENIED`.
7952    ///
7953    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7954    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7955    ///
7956    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7957    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7958    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7959    ///
7960    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7961    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7962    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7963    LinkInto {
7964        dst_parent_token: fdomain_client::Event,
7965        dst: String,
7966        responder: FileLinkIntoResponder,
7967    },
7968    Clone {
7969        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
7970        control_handle: FileControlHandle,
7971    },
7972    /// Terminates the connection.
7973    ///
7974    /// After calling `Close`, the client must not send any other requests.
7975    ///
7976    /// Servers, after sending the status response, should close the connection
7977    /// regardless of status and without sending an epitaph.
7978    ///
7979    /// Closing the client end of the channel should be semantically equivalent
7980    /// to calling `Close` without knowing when the close has completed or its
7981    /// status.
7982    Close {
7983        responder: FileCloseResponder,
7984    },
7985    Query {
7986        responder: FileQueryResponder,
7987    },
7988    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7989    DeprecatedClone {
7990        flags: OpenFlags,
7991        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
7992        control_handle: FileControlHandle,
7993    },
7994    /// DEPRECATED - Use `Node.GetAttributes` instead.
7995    ///
7996    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7997    DeprecatedGetAttr {
7998        responder: FileDeprecatedGetAttrResponder,
7999    },
8000    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
8001    DeprecatedSetAttr {
8002        flags: NodeAttributeFlags,
8003        attributes: NodeAttributes,
8004        responder: FileDeprecatedSetAttrResponder,
8005    },
8006    /// [DEPRECATED - Use new GetFlags method instead.]
8007    DeprecatedGetFlags {
8008        responder: FileDeprecatedGetFlagsResponder,
8009    },
8010    /// [DEPRECATED - Use new SetFlags method instead.]
8011    DeprecatedSetFlags {
8012        flags: OpenFlags,
8013        responder: FileDeprecatedSetFlagsResponder,
8014    },
8015    /// Queries the flags that apply to this node after it has been opened/created. This method does
8016    /// not require any rights.
8017    ///
8018    /// Note that the final set of flags that apply to the connection may differ from those
8019    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8020    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8021    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8022    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8023    GetFlags {
8024        responder: FileGetFlagsResponder,
8025    },
8026    /// Sets the flags that apply to this node after it has been opened. This method does not
8027    /// require any rights.
8028    ///
8029    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8030    /// clear append mode.
8031    ///
8032    /// Errors:
8033    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8034    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8035    SetFlags {
8036        flags: Flags,
8037        responder: FileSetFlagsResponder,
8038    },
8039    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8040    /// volume has different settings or the storage is accounted seperately from the rest of the
8041    /// filesystem that may be reported instead of filesystem-wide details.
8042    QueryFilesystem {
8043        responder: FileQueryFilesystemResponder,
8044    },
8045    /// Acquires information about the node.
8046    ///
8047    /// The attributes of a node should be stable, independent of the
8048    /// specific protocol used to access it.
8049    ///
8050    /// If a particular attribute is not applicable or not supported,
8051    /// filesystems should leave the corresponding field absent.
8052    ///
8053    /// + `query` a bit-mask specifying which attributes to fetch. The server
8054    ///   should not return more than necessary.
8055    /// - `attributes` the returned attributes.
8056    ///
8057    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8058    GetAttributes {
8059        query: NodeAttributesQuery,
8060        responder: FileGetAttributesResponder,
8061    },
8062    /// Updates information about the node.
8063    ///
8064    /// + `attributes` the presence of a table field in `attributes` indicates
8065    /// the intent to update the corresponding attribute.
8066    ///
8067    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8068    ///
8069    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8070    UpdateAttributes {
8071        payload: MutableNodeAttributes,
8072        responder: FileUpdateAttributesResponder,
8073    },
8074    /// Synchronizes updates to the node to the underlying media, if it exists.
8075    ///
8076    /// This method will return when the filesystem server has flushed the
8077    /// relevant updates to the underlying media, but does not guarantee the
8078    /// underlying media has persisted the information, nor that any information
8079    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8080    /// between operations.
8081    ///
8082    /// This method does not require any rights.
8083    Sync {
8084        responder: FileSyncResponder,
8085    },
8086    /// Creates an iterator over all the extended attribute names associated
8087    /// with this node. If an error occurs it is returned as an epitaph on the
8088    /// iterator request channel, and then the channel is closed.
8089    ///
8090    /// GetExtendedAttributes can be used with any of these names to retrieve
8091    /// the associated value.
8092    ///
8093    /// This method requires the [`Rights.READ_BYTES`] right.
8094    ListExtendedAttributes {
8095        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
8096        control_handle: FileControlHandle,
8097    },
8098    /// Get the value associated with the given attribute `name` for this node.
8099    ///
8100    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8101    /// particular structure is imposed on them.
8102    ///
8103    /// This method requires the [`Rights.READ_BYTES`] right.
8104    GetExtendedAttribute {
8105        name: Vec<u8>,
8106        responder: FileGetExtendedAttributeResponder,
8107    },
8108    /// Set the value for the given attribute `name` to `value` for this node.
8109    ///
8110    /// The attribute name may exist, in which case the attribute is updated.
8111    /// If the attribute doesn't exist, it is created. The name should have no
8112    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8113    ///
8114    /// This method requires the [`Rights.WRITE_BYTES`] right.
8115    SetExtendedAttribute {
8116        name: Vec<u8>,
8117        value: ExtendedAttributeValue,
8118        mode: SetExtendedAttributeMode,
8119        responder: FileSetExtendedAttributeResponder,
8120    },
8121    /// Remove the specified extended attribute.
8122    ///
8123    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8124    ///
8125    /// This method requires the [`Rights.WRITE_BYTES`] right.
8126    RemoveExtendedAttribute {
8127        name: Vec<u8>,
8128        responder: FileRemoveExtendedAttributeResponder,
8129    },
8130    /// Reads up to 'count' bytes at the seek offset.
8131    /// The seek offset is moved forward by the number of bytes read.
8132    ///
8133    /// ## Invariants
8134    ///
8135    /// * The returned `data.length` will never be greater than `count`.
8136    /// * If `data.length` is less than `count`, it means that the seek offset
8137    ///   has reached the end of file as part of this operation.
8138    /// * If `data.length` is zero while `count` is not, it means that the
8139    ///   seek offset is already at or beyond the end of file, and no data could
8140    ///   be read.
8141    /// * If `count` is zero, the server should perform all the checks ensuring
8142    ///   read access without actually read anything, and return an empty
8143    ///   `data` vector.
8144    ///
8145    /// This method requires the [`Rights.READ_BYTES`] right.
8146    ///
8147    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8148    Read {
8149        count: u64,
8150        responder: FileReadResponder,
8151    },
8152    /// Writes data at the seek offset.
8153    /// The seek offset is moved forward by the number of bytes written.
8154    /// If the file is in append mode, the seek offset is first set to the end
8155    /// of the file, followed by the write, in one atomic step.
8156    ///
8157    /// The file size may grow if the seek offset plus `data.length` is beyond
8158    /// the current end of file.
8159    ///
8160    /// + request `data` the byte buffer to write to the file.
8161    /// - response `actual_count` the number of bytes written.
8162    ///
8163    /// ## Invariants
8164    ///
8165    /// * The returned `actual_count` will never be greater than `data.length`.
8166    /// * If the server is unable to write all the data due to e.g. not enough
8167    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8168    ///   could be written, an error is returned.
8169    /// * If `data.length` is zero, the server should perform all the checks
8170    ///   ensuring write access without mutating the file and return a
8171    ///   successful write of zero bytes.  The seek offset is still updated if
8172    ///   in append mode.
8173    ///
8174    /// This method requires the [`Rights.WRITE_BYTES`] right.
8175    Write {
8176        data: Vec<u8>,
8177        responder: FileWriteResponder,
8178    },
8179    Describe {
8180        responder: FileDescribeResponder,
8181    },
8182    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8183    /// will occur. The seek offset is specific to each file connection.
8184    ///
8185    /// + request `origin` the reference point where `offset` will be based on.
8186    /// + request `offset` the number of bytes to seek.
8187    /// - response `offset_from_start` the adjusted seek offset, from the start
8188    ///   of the file.
8189    ///
8190    /// This method does not require any rights.
8191    Seek {
8192        origin: SeekOrigin,
8193        offset: i64,
8194        responder: FileSeekResponder,
8195    },
8196    /// Reads up to 'count' bytes at the provided offset.
8197    /// Does not affect the seek offset.
8198    ///
8199    /// ## Invariants
8200    ///
8201    /// * The returned `data.length` will never be greater than `count`.
8202    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8203    ///   the end of file as part of this operation.
8204    /// * If `data.length` is zero while `count` is not, it means that `offset`
8205    ///   is at or past the end of file, and no data can be read.
8206    /// * If `count` is zero, the server should perform all the checks ensuring
8207    ///   read access without actually reading anything, and return an empty
8208    ///   `data` vector.
8209    ///
8210    /// This method requires the [`Rights.READ_BYTES`] right.
8211    ///
8212    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8213    ReadAt {
8214        count: u64,
8215        offset: u64,
8216        responder: FileReadAtResponder,
8217    },
8218    /// Writes data at the provided offset.
8219    /// Does not affect the seek offset.
8220    ///
8221    /// The file size may grow if `offset` plus `data.length` is past the
8222    /// current end of file.
8223    ///
8224    /// + request `data` the byte buffer to write to the file.
8225    /// + request `offset` the offset from start of the file to begin writing.
8226    /// - response `actual_count` the number of bytes written.
8227    ///
8228    /// ## Invariants
8229    ///
8230    /// * The returned `actual_count` will never be greater than `data.length`.
8231    /// * If the server is unable to write all the data due to e.g. not enough
8232    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8233    ///   could be written, an error is returned.
8234    /// * If `data.length` is zero, the server should perform all the checks
8235    ///   ensuring write access without mutating the file, and will return a
8236    ///   successful write of zero bytes.
8237    ///
8238    /// This method requires the [`Rights.WRITE_BYTES`] right.
8239    WriteAt {
8240        data: Vec<u8>,
8241        offset: u64,
8242        responder: FileWriteAtResponder,
8243    },
8244    /// Shrinks or grows the file size to 'length' bytes.
8245    ///
8246    /// If file size is reduced by this operation, the extra trailing data'
8247    /// is discarded.
8248    /// If file size is increased by this operation, the extended area appears
8249    /// as if it was zeroed.
8250    ///
8251    /// This method requires the [`Rights.WRITE_BYTES`] right.
8252    Resize {
8253        length: u64,
8254        responder: FileResizeResponder,
8255    },
8256    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8257    /// with the requested access rights.
8258    ///
8259    /// Implementations are not required to implement files backed by VMOs so
8260    /// this request may fail. Additionally, implementations may only support
8261    /// a certain subset of the flags. Clients should be prepared with fallback
8262    /// behavior if this request fails.
8263    ///
8264    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8265    /// implementation is free to choose the semantics of the returned VMO.
8266    ///
8267    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8268    /// - response `vmo` the requested [`zx.Handle:VMO`].
8269    /// * error a [`zx.Status`] value indicating the failure.
8270    ///
8271    /// This method requires the following rights:
8272    ///
8273    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8274    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8275    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8276    GetBackingMemory {
8277        flags: VmoFlags,
8278        responder: FileGetBackingMemoryResponder,
8279    },
8280    /// Pre-allocate on-disk space for this file.
8281    Allocate {
8282        offset: u64,
8283        length: u64,
8284        mode: AllocateMode,
8285        responder: FileAllocateResponder,
8286    },
8287    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8288    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8289    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8290    /// rejected. This method can take some time to complete as it depends on the size of the file.
8291    /// This method can be aborted by closing the connection that this method was issued on.
8292    ///
8293    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8294    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8295    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8296    /// Also returns any error that might arise from reading the file, or from flushing the file,
8297    /// such as `ZX_ERR_IO`.
8298    EnableVerity {
8299        options: VerificationOptions,
8300        responder: FileEnableVerityResponder,
8301    },
8302    /// An interaction was received which does not match any known method.
8303    #[non_exhaustive]
8304    _UnknownMethod {
8305        /// Ordinal of the method that was called.
8306        ordinal: u64,
8307        control_handle: FileControlHandle,
8308        method_type: fidl::MethodType,
8309    },
8310}
8311
8312impl FileRequest {
8313    #[allow(irrefutable_let_patterns)]
8314    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
8315        if let FileRequest::AdvisoryLock { request, responder } = self {
8316            Some((request, responder))
8317        } else {
8318            None
8319        }
8320    }
8321
8322    #[allow(irrefutable_let_patterns)]
8323    pub fn into_link_into(self) -> Option<(fdomain_client::Event, String, FileLinkIntoResponder)> {
8324        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
8325            Some((dst_parent_token, dst, responder))
8326        } else {
8327            None
8328        }
8329    }
8330
8331    #[allow(irrefutable_let_patterns)]
8332    pub fn into_clone(
8333        self,
8334    ) -> Option<(
8335        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8336        FileControlHandle,
8337    )> {
8338        if let FileRequest::Clone { request, control_handle } = self {
8339            Some((request, control_handle))
8340        } else {
8341            None
8342        }
8343    }
8344
8345    #[allow(irrefutable_let_patterns)]
8346    pub fn into_close(self) -> Option<(FileCloseResponder)> {
8347        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
8348    }
8349
8350    #[allow(irrefutable_let_patterns)]
8351    pub fn into_query(self) -> Option<(FileQueryResponder)> {
8352        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
8353    }
8354
8355    #[allow(irrefutable_let_patterns)]
8356    pub fn into_deprecated_clone(
8357        self,
8358    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, FileControlHandle)> {
8359        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
8360            Some((flags, object, control_handle))
8361        } else {
8362            None
8363        }
8364    }
8365
8366    #[allow(irrefutable_let_patterns)]
8367    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
8368        if let FileRequest::DeprecatedGetAttr { responder } = self {
8369            Some((responder))
8370        } else {
8371            None
8372        }
8373    }
8374
8375    #[allow(irrefutable_let_patterns)]
8376    pub fn into_deprecated_set_attr(
8377        self,
8378    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
8379        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
8380            Some((flags, attributes, responder))
8381        } else {
8382            None
8383        }
8384    }
8385
8386    #[allow(irrefutable_let_patterns)]
8387    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
8388        if let FileRequest::DeprecatedGetFlags { responder } = self {
8389            Some((responder))
8390        } else {
8391            None
8392        }
8393    }
8394
8395    #[allow(irrefutable_let_patterns)]
8396    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
8397        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
8398            Some((flags, responder))
8399        } else {
8400            None
8401        }
8402    }
8403
8404    #[allow(irrefutable_let_patterns)]
8405    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
8406        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
8407    }
8408
8409    #[allow(irrefutable_let_patterns)]
8410    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
8411        if let FileRequest::SetFlags { flags, responder } = self {
8412            Some((flags, responder))
8413        } else {
8414            None
8415        }
8416    }
8417
8418    #[allow(irrefutable_let_patterns)]
8419    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
8420        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
8421    }
8422
8423    #[allow(irrefutable_let_patterns)]
8424    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
8425        if let FileRequest::GetAttributes { query, responder } = self {
8426            Some((query, responder))
8427        } else {
8428            None
8429        }
8430    }
8431
8432    #[allow(irrefutable_let_patterns)]
8433    pub fn into_update_attributes(
8434        self,
8435    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
8436        if let FileRequest::UpdateAttributes { payload, responder } = self {
8437            Some((payload, responder))
8438        } else {
8439            None
8440        }
8441    }
8442
8443    #[allow(irrefutable_let_patterns)]
8444    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
8445        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
8446    }
8447
8448    #[allow(irrefutable_let_patterns)]
8449    pub fn into_list_extended_attributes(
8450        self,
8451    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
8452    {
8453        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
8454            Some((iterator, control_handle))
8455        } else {
8456            None
8457        }
8458    }
8459
8460    #[allow(irrefutable_let_patterns)]
8461    pub fn into_get_extended_attribute(
8462        self,
8463    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
8464        if let FileRequest::GetExtendedAttribute { name, responder } = self {
8465            Some((name, responder))
8466        } else {
8467            None
8468        }
8469    }
8470
8471    #[allow(irrefutable_let_patterns)]
8472    pub fn into_set_extended_attribute(
8473        self,
8474    ) -> Option<(
8475        Vec<u8>,
8476        ExtendedAttributeValue,
8477        SetExtendedAttributeMode,
8478        FileSetExtendedAttributeResponder,
8479    )> {
8480        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
8481            Some((name, value, mode, responder))
8482        } else {
8483            None
8484        }
8485    }
8486
8487    #[allow(irrefutable_let_patterns)]
8488    pub fn into_remove_extended_attribute(
8489        self,
8490    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
8491        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
8492            Some((name, responder))
8493        } else {
8494            None
8495        }
8496    }
8497
8498    #[allow(irrefutable_let_patterns)]
8499    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
8500        if let FileRequest::Read { count, responder } = self {
8501            Some((count, responder))
8502        } else {
8503            None
8504        }
8505    }
8506
8507    #[allow(irrefutable_let_patterns)]
8508    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
8509        if let FileRequest::Write { data, responder } = self {
8510            Some((data, responder))
8511        } else {
8512            None
8513        }
8514    }
8515
8516    #[allow(irrefutable_let_patterns)]
8517    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
8518        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
8519    }
8520
8521    #[allow(irrefutable_let_patterns)]
8522    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
8523        if let FileRequest::Seek { origin, offset, responder } = self {
8524            Some((origin, offset, responder))
8525        } else {
8526            None
8527        }
8528    }
8529
8530    #[allow(irrefutable_let_patterns)]
8531    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
8532        if let FileRequest::ReadAt { count, offset, responder } = self {
8533            Some((count, offset, responder))
8534        } else {
8535            None
8536        }
8537    }
8538
8539    #[allow(irrefutable_let_patterns)]
8540    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
8541        if let FileRequest::WriteAt { data, offset, responder } = self {
8542            Some((data, offset, responder))
8543        } else {
8544            None
8545        }
8546    }
8547
8548    #[allow(irrefutable_let_patterns)]
8549    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
8550        if let FileRequest::Resize { length, responder } = self {
8551            Some((length, responder))
8552        } else {
8553            None
8554        }
8555    }
8556
8557    #[allow(irrefutable_let_patterns)]
8558    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
8559        if let FileRequest::GetBackingMemory { flags, responder } = self {
8560            Some((flags, responder))
8561        } else {
8562            None
8563        }
8564    }
8565
8566    #[allow(irrefutable_let_patterns)]
8567    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
8568        if let FileRequest::Allocate { offset, length, mode, responder } = self {
8569            Some((offset, length, mode, responder))
8570        } else {
8571            None
8572        }
8573    }
8574
8575    #[allow(irrefutable_let_patterns)]
8576    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
8577        if let FileRequest::EnableVerity { options, responder } = self {
8578            Some((options, responder))
8579        } else {
8580            None
8581        }
8582    }
8583
8584    /// Name of the method defined in FIDL
8585    pub fn method_name(&self) -> &'static str {
8586        match *self {
8587            FileRequest::AdvisoryLock { .. } => "advisory_lock",
8588            FileRequest::LinkInto { .. } => "link_into",
8589            FileRequest::Clone { .. } => "clone",
8590            FileRequest::Close { .. } => "close",
8591            FileRequest::Query { .. } => "query",
8592            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
8593            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
8594            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
8595            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
8596            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
8597            FileRequest::GetFlags { .. } => "get_flags",
8598            FileRequest::SetFlags { .. } => "set_flags",
8599            FileRequest::QueryFilesystem { .. } => "query_filesystem",
8600            FileRequest::GetAttributes { .. } => "get_attributes",
8601            FileRequest::UpdateAttributes { .. } => "update_attributes",
8602            FileRequest::Sync { .. } => "sync",
8603            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
8604            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
8605            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
8606            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
8607            FileRequest::Read { .. } => "read",
8608            FileRequest::Write { .. } => "write",
8609            FileRequest::Describe { .. } => "describe",
8610            FileRequest::Seek { .. } => "seek",
8611            FileRequest::ReadAt { .. } => "read_at",
8612            FileRequest::WriteAt { .. } => "write_at",
8613            FileRequest::Resize { .. } => "resize",
8614            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
8615            FileRequest::Allocate { .. } => "allocate",
8616            FileRequest::EnableVerity { .. } => "enable_verity",
8617            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8618                "unknown one-way method"
8619            }
8620            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8621                "unknown two-way method"
8622            }
8623        }
8624    }
8625}
8626
8627#[derive(Debug, Clone)]
8628pub struct FileControlHandle {
8629    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8630}
8631
8632impl FileControlHandle {
8633    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8634        self.inner.shutdown_with_epitaph(status.into())
8635    }
8636}
8637
8638impl fdomain_client::fidl::ControlHandle for FileControlHandle {
8639    fn shutdown(&self) {
8640        self.inner.shutdown()
8641    }
8642
8643    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8644        self.inner.shutdown_with_epitaph(status)
8645    }
8646
8647    fn is_closed(&self) -> bool {
8648        self.inner.channel().is_closed()
8649    }
8650    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8651        self.inner.channel().on_closed()
8652    }
8653}
8654
8655impl FileControlHandle {
8656    pub fn send_on_open_(
8657        &self,
8658        mut s: i32,
8659        mut info: Option<NodeInfoDeprecated>,
8660    ) -> Result<(), fidl::Error> {
8661        self.inner.send::<NodeOnOpenRequest>(
8662            (s, info.as_mut()),
8663            0,
8664            0x7fc7bbb1dbfd1972,
8665            fidl::encoding::DynamicFlags::FLEXIBLE,
8666        )
8667    }
8668
8669    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
8670        self.inner.send::<Representation>(
8671            &mut payload,
8672            0,
8673            0x5cb40567d80a510c,
8674            fidl::encoding::DynamicFlags::empty(),
8675        )
8676    }
8677}
8678
8679#[must_use = "FIDL methods require a response to be sent"]
8680#[derive(Debug)]
8681pub struct FileAdvisoryLockResponder {
8682    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8683    tx_id: u32,
8684}
8685
8686/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8687/// if the responder is dropped without sending a response, so that the client
8688/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8689impl std::ops::Drop for FileAdvisoryLockResponder {
8690    fn drop(&mut self) {
8691        self.control_handle.shutdown();
8692        // Safety: drops once, never accessed again
8693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8694    }
8695}
8696
8697impl fdomain_client::fidl::Responder for FileAdvisoryLockResponder {
8698    type ControlHandle = FileControlHandle;
8699
8700    fn control_handle(&self) -> &FileControlHandle {
8701        &self.control_handle
8702    }
8703
8704    fn drop_without_shutdown(mut self) {
8705        // Safety: drops once, never accessed again due to mem::forget
8706        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8707        // Prevent Drop from running (which would shut down the channel)
8708        std::mem::forget(self);
8709    }
8710}
8711
8712impl FileAdvisoryLockResponder {
8713    /// Sends a response to the FIDL transaction.
8714    ///
8715    /// Sets the channel to shutdown if an error occurs.
8716    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8717        let _result = self.send_raw(result);
8718        if _result.is_err() {
8719            self.control_handle.shutdown();
8720        }
8721        self.drop_without_shutdown();
8722        _result
8723    }
8724
8725    /// Similar to "send" but does not shutdown the channel if an error occurs.
8726    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8727        let _result = self.send_raw(result);
8728        self.drop_without_shutdown();
8729        _result
8730    }
8731
8732    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8733        self.control_handle
8734            .inner
8735            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8736                result,
8737                self.tx_id,
8738                0x6ee9c0ad53ec87aa,
8739                fidl::encoding::DynamicFlags::empty(),
8740            )
8741    }
8742}
8743
8744#[must_use = "FIDL methods require a response to be sent"]
8745#[derive(Debug)]
8746pub struct FileLinkIntoResponder {
8747    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8748    tx_id: u32,
8749}
8750
8751/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8752/// if the responder is dropped without sending a response, so that the client
8753/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8754impl std::ops::Drop for FileLinkIntoResponder {
8755    fn drop(&mut self) {
8756        self.control_handle.shutdown();
8757        // Safety: drops once, never accessed again
8758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8759    }
8760}
8761
8762impl fdomain_client::fidl::Responder for FileLinkIntoResponder {
8763    type ControlHandle = FileControlHandle;
8764
8765    fn control_handle(&self) -> &FileControlHandle {
8766        &self.control_handle
8767    }
8768
8769    fn drop_without_shutdown(mut self) {
8770        // Safety: drops once, never accessed again due to mem::forget
8771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8772        // Prevent Drop from running (which would shut down the channel)
8773        std::mem::forget(self);
8774    }
8775}
8776
8777impl FileLinkIntoResponder {
8778    /// Sends a response to the FIDL transaction.
8779    ///
8780    /// Sets the channel to shutdown if an error occurs.
8781    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8782        let _result = self.send_raw(result);
8783        if _result.is_err() {
8784            self.control_handle.shutdown();
8785        }
8786        self.drop_without_shutdown();
8787        _result
8788    }
8789
8790    /// Similar to "send" but does not shutdown the channel if an error occurs.
8791    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8792        let _result = self.send_raw(result);
8793        self.drop_without_shutdown();
8794        _result
8795    }
8796
8797    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8798        self.control_handle
8799            .inner
8800            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8801                result,
8802                self.tx_id,
8803                0x54f3949246a03e74,
8804                fidl::encoding::DynamicFlags::empty(),
8805            )
8806    }
8807}
8808
8809#[must_use = "FIDL methods require a response to be sent"]
8810#[derive(Debug)]
8811pub struct FileCloseResponder {
8812    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8813    tx_id: u32,
8814}
8815
8816/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8817/// if the responder is dropped without sending a response, so that the client
8818/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8819impl std::ops::Drop for FileCloseResponder {
8820    fn drop(&mut self) {
8821        self.control_handle.shutdown();
8822        // Safety: drops once, never accessed again
8823        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8824    }
8825}
8826
8827impl fdomain_client::fidl::Responder for FileCloseResponder {
8828    type ControlHandle = FileControlHandle;
8829
8830    fn control_handle(&self) -> &FileControlHandle {
8831        &self.control_handle
8832    }
8833
8834    fn drop_without_shutdown(mut self) {
8835        // Safety: drops once, never accessed again due to mem::forget
8836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8837        // Prevent Drop from running (which would shut down the channel)
8838        std::mem::forget(self);
8839    }
8840}
8841
8842impl FileCloseResponder {
8843    /// Sends a response to the FIDL transaction.
8844    ///
8845    /// Sets the channel to shutdown if an error occurs.
8846    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8847        let _result = self.send_raw(result);
8848        if _result.is_err() {
8849            self.control_handle.shutdown();
8850        }
8851        self.drop_without_shutdown();
8852        _result
8853    }
8854
8855    /// Similar to "send" but does not shutdown the channel if an error occurs.
8856    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8857        let _result = self.send_raw(result);
8858        self.drop_without_shutdown();
8859        _result
8860    }
8861
8862    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8863        self.control_handle
8864            .inner
8865            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8866                result,
8867                self.tx_id,
8868                0x5ac5d459ad7f657e,
8869                fidl::encoding::DynamicFlags::empty(),
8870            )
8871    }
8872}
8873
8874#[must_use = "FIDL methods require a response to be sent"]
8875#[derive(Debug)]
8876pub struct FileQueryResponder {
8877    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8878    tx_id: u32,
8879}
8880
8881/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8882/// if the responder is dropped without sending a response, so that the client
8883/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8884impl std::ops::Drop for FileQueryResponder {
8885    fn drop(&mut self) {
8886        self.control_handle.shutdown();
8887        // Safety: drops once, never accessed again
8888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8889    }
8890}
8891
8892impl fdomain_client::fidl::Responder for FileQueryResponder {
8893    type ControlHandle = FileControlHandle;
8894
8895    fn control_handle(&self) -> &FileControlHandle {
8896        &self.control_handle
8897    }
8898
8899    fn drop_without_shutdown(mut self) {
8900        // Safety: drops once, never accessed again due to mem::forget
8901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8902        // Prevent Drop from running (which would shut down the channel)
8903        std::mem::forget(self);
8904    }
8905}
8906
8907impl FileQueryResponder {
8908    /// Sends a response to the FIDL transaction.
8909    ///
8910    /// Sets the channel to shutdown if an error occurs.
8911    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8912        let _result = self.send_raw(protocol);
8913        if _result.is_err() {
8914            self.control_handle.shutdown();
8915        }
8916        self.drop_without_shutdown();
8917        _result
8918    }
8919
8920    /// Similar to "send" but does not shutdown the channel if an error occurs.
8921    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8922        let _result = self.send_raw(protocol);
8923        self.drop_without_shutdown();
8924        _result
8925    }
8926
8927    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8928        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
8929            (protocol,),
8930            self.tx_id,
8931            0x2658edee9decfc06,
8932            fidl::encoding::DynamicFlags::empty(),
8933        )
8934    }
8935}
8936
8937#[must_use = "FIDL methods require a response to be sent"]
8938#[derive(Debug)]
8939pub struct FileDeprecatedGetAttrResponder {
8940    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8941    tx_id: u32,
8942}
8943
8944/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8945/// if the responder is dropped without sending a response, so that the client
8946/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8947impl std::ops::Drop for FileDeprecatedGetAttrResponder {
8948    fn drop(&mut self) {
8949        self.control_handle.shutdown();
8950        // Safety: drops once, never accessed again
8951        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8952    }
8953}
8954
8955impl fdomain_client::fidl::Responder for FileDeprecatedGetAttrResponder {
8956    type ControlHandle = FileControlHandle;
8957
8958    fn control_handle(&self) -> &FileControlHandle {
8959        &self.control_handle
8960    }
8961
8962    fn drop_without_shutdown(mut self) {
8963        // Safety: drops once, never accessed again due to mem::forget
8964        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8965        // Prevent Drop from running (which would shut down the channel)
8966        std::mem::forget(self);
8967    }
8968}
8969
8970impl FileDeprecatedGetAttrResponder {
8971    /// Sends a response to the FIDL transaction.
8972    ///
8973    /// Sets the channel to shutdown if an error occurs.
8974    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8975        let _result = self.send_raw(s, attributes);
8976        if _result.is_err() {
8977            self.control_handle.shutdown();
8978        }
8979        self.drop_without_shutdown();
8980        _result
8981    }
8982
8983    /// Similar to "send" but does not shutdown the channel if an error occurs.
8984    pub fn send_no_shutdown_on_err(
8985        self,
8986        mut s: i32,
8987        mut attributes: &NodeAttributes,
8988    ) -> Result<(), fidl::Error> {
8989        let _result = self.send_raw(s, attributes);
8990        self.drop_without_shutdown();
8991        _result
8992    }
8993
8994    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8995        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
8996            (s, attributes),
8997            self.tx_id,
8998            0x78985e216314dafd,
8999            fidl::encoding::DynamicFlags::empty(),
9000        )
9001    }
9002}
9003
9004#[must_use = "FIDL methods require a response to be sent"]
9005#[derive(Debug)]
9006pub struct FileDeprecatedSetAttrResponder {
9007    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9008    tx_id: u32,
9009}
9010
9011/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9012/// if the responder is dropped without sending a response, so that the client
9013/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9014impl std::ops::Drop for FileDeprecatedSetAttrResponder {
9015    fn drop(&mut self) {
9016        self.control_handle.shutdown();
9017        // Safety: drops once, never accessed again
9018        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9019    }
9020}
9021
9022impl fdomain_client::fidl::Responder for FileDeprecatedSetAttrResponder {
9023    type ControlHandle = FileControlHandle;
9024
9025    fn control_handle(&self) -> &FileControlHandle {
9026        &self.control_handle
9027    }
9028
9029    fn drop_without_shutdown(mut self) {
9030        // Safety: drops once, never accessed again due to mem::forget
9031        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9032        // Prevent Drop from running (which would shut down the channel)
9033        std::mem::forget(self);
9034    }
9035}
9036
9037impl FileDeprecatedSetAttrResponder {
9038    /// Sends a response to the FIDL transaction.
9039    ///
9040    /// Sets the channel to shutdown if an error occurs.
9041    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9042        let _result = self.send_raw(s);
9043        if _result.is_err() {
9044            self.control_handle.shutdown();
9045        }
9046        self.drop_without_shutdown();
9047        _result
9048    }
9049
9050    /// Similar to "send" but does not shutdown the channel if an error occurs.
9051    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9052        let _result = self.send_raw(s);
9053        self.drop_without_shutdown();
9054        _result
9055    }
9056
9057    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9058        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
9059            (s,),
9060            self.tx_id,
9061            0x4186c0f40d938f46,
9062            fidl::encoding::DynamicFlags::empty(),
9063        )
9064    }
9065}
9066
9067#[must_use = "FIDL methods require a response to be sent"]
9068#[derive(Debug)]
9069pub struct FileDeprecatedGetFlagsResponder {
9070    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9071    tx_id: u32,
9072}
9073
9074/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9075/// if the responder is dropped without sending a response, so that the client
9076/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9077impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
9078    fn drop(&mut self) {
9079        self.control_handle.shutdown();
9080        // Safety: drops once, never accessed again
9081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9082    }
9083}
9084
9085impl fdomain_client::fidl::Responder for FileDeprecatedGetFlagsResponder {
9086    type ControlHandle = FileControlHandle;
9087
9088    fn control_handle(&self) -> &FileControlHandle {
9089        &self.control_handle
9090    }
9091
9092    fn drop_without_shutdown(mut self) {
9093        // Safety: drops once, never accessed again due to mem::forget
9094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9095        // Prevent Drop from running (which would shut down the channel)
9096        std::mem::forget(self);
9097    }
9098}
9099
9100impl FileDeprecatedGetFlagsResponder {
9101    /// Sends a response to the FIDL transaction.
9102    ///
9103    /// Sets the channel to shutdown if an error occurs.
9104    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9105        let _result = self.send_raw(s, flags);
9106        if _result.is_err() {
9107            self.control_handle.shutdown();
9108        }
9109        self.drop_without_shutdown();
9110        _result
9111    }
9112
9113    /// Similar to "send" but does not shutdown the channel if an error occurs.
9114    pub fn send_no_shutdown_on_err(
9115        self,
9116        mut s: i32,
9117        mut flags: OpenFlags,
9118    ) -> Result<(), fidl::Error> {
9119        let _result = self.send_raw(s, flags);
9120        self.drop_without_shutdown();
9121        _result
9122    }
9123
9124    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9125        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
9126            (s, flags),
9127            self.tx_id,
9128            0x5b88fffb8eda3aa1,
9129            fidl::encoding::DynamicFlags::empty(),
9130        )
9131    }
9132}
9133
9134#[must_use = "FIDL methods require a response to be sent"]
9135#[derive(Debug)]
9136pub struct FileDeprecatedSetFlagsResponder {
9137    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9138    tx_id: u32,
9139}
9140
9141/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9142/// if the responder is dropped without sending a response, so that the client
9143/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9144impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
9145    fn drop(&mut self) {
9146        self.control_handle.shutdown();
9147        // Safety: drops once, never accessed again
9148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9149    }
9150}
9151
9152impl fdomain_client::fidl::Responder for FileDeprecatedSetFlagsResponder {
9153    type ControlHandle = FileControlHandle;
9154
9155    fn control_handle(&self) -> &FileControlHandle {
9156        &self.control_handle
9157    }
9158
9159    fn drop_without_shutdown(mut self) {
9160        // Safety: drops once, never accessed again due to mem::forget
9161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9162        // Prevent Drop from running (which would shut down the channel)
9163        std::mem::forget(self);
9164    }
9165}
9166
9167impl FileDeprecatedSetFlagsResponder {
9168    /// Sends a response to the FIDL transaction.
9169    ///
9170    /// Sets the channel to shutdown if an error occurs.
9171    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9172        let _result = self.send_raw(s);
9173        if _result.is_err() {
9174            self.control_handle.shutdown();
9175        }
9176        self.drop_without_shutdown();
9177        _result
9178    }
9179
9180    /// Similar to "send" but does not shutdown the channel if an error occurs.
9181    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9182        let _result = self.send_raw(s);
9183        self.drop_without_shutdown();
9184        _result
9185    }
9186
9187    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9188        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
9189            (s,),
9190            self.tx_id,
9191            0x5295b76c71fde733,
9192            fidl::encoding::DynamicFlags::empty(),
9193        )
9194    }
9195}
9196
9197#[must_use = "FIDL methods require a response to be sent"]
9198#[derive(Debug)]
9199pub struct FileGetFlagsResponder {
9200    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9201    tx_id: u32,
9202}
9203
9204/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9205/// if the responder is dropped without sending a response, so that the client
9206/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9207impl std::ops::Drop for FileGetFlagsResponder {
9208    fn drop(&mut self) {
9209        self.control_handle.shutdown();
9210        // Safety: drops once, never accessed again
9211        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9212    }
9213}
9214
9215impl fdomain_client::fidl::Responder for FileGetFlagsResponder {
9216    type ControlHandle = FileControlHandle;
9217
9218    fn control_handle(&self) -> &FileControlHandle {
9219        &self.control_handle
9220    }
9221
9222    fn drop_without_shutdown(mut self) {
9223        // Safety: drops once, never accessed again due to mem::forget
9224        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9225        // Prevent Drop from running (which would shut down the channel)
9226        std::mem::forget(self);
9227    }
9228}
9229
9230impl FileGetFlagsResponder {
9231    /// Sends a response to the FIDL transaction.
9232    ///
9233    /// Sets the channel to shutdown if an error occurs.
9234    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9235        let _result = self.send_raw(result);
9236        if _result.is_err() {
9237            self.control_handle.shutdown();
9238        }
9239        self.drop_without_shutdown();
9240        _result
9241    }
9242
9243    /// Similar to "send" but does not shutdown the channel if an error occurs.
9244    pub fn send_no_shutdown_on_err(
9245        self,
9246        mut result: Result<Flags, i32>,
9247    ) -> Result<(), fidl::Error> {
9248        let _result = self.send_raw(result);
9249        self.drop_without_shutdown();
9250        _result
9251    }
9252
9253    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9254        self.control_handle
9255            .inner
9256            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
9257                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
9258                self.tx_id,
9259                0x176eb318f64ec23,
9260                fidl::encoding::DynamicFlags::FLEXIBLE,
9261            )
9262    }
9263}
9264
9265#[must_use = "FIDL methods require a response to be sent"]
9266#[derive(Debug)]
9267pub struct FileSetFlagsResponder {
9268    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9269    tx_id: u32,
9270}
9271
9272/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9273/// if the responder is dropped without sending a response, so that the client
9274/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9275impl std::ops::Drop for FileSetFlagsResponder {
9276    fn drop(&mut self) {
9277        self.control_handle.shutdown();
9278        // Safety: drops once, never accessed again
9279        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9280    }
9281}
9282
9283impl fdomain_client::fidl::Responder for FileSetFlagsResponder {
9284    type ControlHandle = FileControlHandle;
9285
9286    fn control_handle(&self) -> &FileControlHandle {
9287        &self.control_handle
9288    }
9289
9290    fn drop_without_shutdown(mut self) {
9291        // Safety: drops once, never accessed again due to mem::forget
9292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9293        // Prevent Drop from running (which would shut down the channel)
9294        std::mem::forget(self);
9295    }
9296}
9297
9298impl FileSetFlagsResponder {
9299    /// Sends a response to the FIDL transaction.
9300    ///
9301    /// Sets the channel to shutdown if an error occurs.
9302    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9303        let _result = self.send_raw(result);
9304        if _result.is_err() {
9305            self.control_handle.shutdown();
9306        }
9307        self.drop_without_shutdown();
9308        _result
9309    }
9310
9311    /// Similar to "send" but does not shutdown the channel if an error occurs.
9312    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9313        let _result = self.send_raw(result);
9314        self.drop_without_shutdown();
9315        _result
9316    }
9317
9318    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9319        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9320            fidl::encoding::EmptyStruct,
9321            i32,
9322        >>(
9323            fidl::encoding::FlexibleResult::new(result),
9324            self.tx_id,
9325            0x55a8028685791ea8,
9326            fidl::encoding::DynamicFlags::FLEXIBLE,
9327        )
9328    }
9329}
9330
9331#[must_use = "FIDL methods require a response to be sent"]
9332#[derive(Debug)]
9333pub struct FileQueryFilesystemResponder {
9334    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9335    tx_id: u32,
9336}
9337
9338/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9339/// if the responder is dropped without sending a response, so that the client
9340/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9341impl std::ops::Drop for FileQueryFilesystemResponder {
9342    fn drop(&mut self) {
9343        self.control_handle.shutdown();
9344        // Safety: drops once, never accessed again
9345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9346    }
9347}
9348
9349impl fdomain_client::fidl::Responder for FileQueryFilesystemResponder {
9350    type ControlHandle = FileControlHandle;
9351
9352    fn control_handle(&self) -> &FileControlHandle {
9353        &self.control_handle
9354    }
9355
9356    fn drop_without_shutdown(mut self) {
9357        // Safety: drops once, never accessed again due to mem::forget
9358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9359        // Prevent Drop from running (which would shut down the channel)
9360        std::mem::forget(self);
9361    }
9362}
9363
9364impl FileQueryFilesystemResponder {
9365    /// Sends a response to the FIDL transaction.
9366    ///
9367    /// Sets the channel to shutdown if an error occurs.
9368    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9369        let _result = self.send_raw(s, info);
9370        if _result.is_err() {
9371            self.control_handle.shutdown();
9372        }
9373        self.drop_without_shutdown();
9374        _result
9375    }
9376
9377    /// Similar to "send" but does not shutdown the channel if an error occurs.
9378    pub fn send_no_shutdown_on_err(
9379        self,
9380        mut s: i32,
9381        mut info: Option<&FilesystemInfo>,
9382    ) -> Result<(), fidl::Error> {
9383        let _result = self.send_raw(s, info);
9384        self.drop_without_shutdown();
9385        _result
9386    }
9387
9388    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9389        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
9390            (s, info),
9391            self.tx_id,
9392            0x6f344a1c6b0a0610,
9393            fidl::encoding::DynamicFlags::empty(),
9394        )
9395    }
9396}
9397
9398#[must_use = "FIDL methods require a response to be sent"]
9399#[derive(Debug)]
9400pub struct FileGetAttributesResponder {
9401    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9402    tx_id: u32,
9403}
9404
9405/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9406/// if the responder is dropped without sending a response, so that the client
9407/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9408impl std::ops::Drop for FileGetAttributesResponder {
9409    fn drop(&mut self) {
9410        self.control_handle.shutdown();
9411        // Safety: drops once, never accessed again
9412        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9413    }
9414}
9415
9416impl fdomain_client::fidl::Responder for FileGetAttributesResponder {
9417    type ControlHandle = FileControlHandle;
9418
9419    fn control_handle(&self) -> &FileControlHandle {
9420        &self.control_handle
9421    }
9422
9423    fn drop_without_shutdown(mut self) {
9424        // Safety: drops once, never accessed again due to mem::forget
9425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9426        // Prevent Drop from running (which would shut down the channel)
9427        std::mem::forget(self);
9428    }
9429}
9430
9431impl FileGetAttributesResponder {
9432    /// Sends a response to the FIDL transaction.
9433    ///
9434    /// Sets the channel to shutdown if an error occurs.
9435    pub fn send(
9436        self,
9437        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9438    ) -> Result<(), fidl::Error> {
9439        let _result = self.send_raw(result);
9440        if _result.is_err() {
9441            self.control_handle.shutdown();
9442        }
9443        self.drop_without_shutdown();
9444        _result
9445    }
9446
9447    /// Similar to "send" but does not shutdown the channel if an error occurs.
9448    pub fn send_no_shutdown_on_err(
9449        self,
9450        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9451    ) -> Result<(), fidl::Error> {
9452        let _result = self.send_raw(result);
9453        self.drop_without_shutdown();
9454        _result
9455    }
9456
9457    fn send_raw(
9458        &self,
9459        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9460    ) -> Result<(), fidl::Error> {
9461        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
9462            result,
9463            self.tx_id,
9464            0x3d4396a638ea053b,
9465            fidl::encoding::DynamicFlags::empty(),
9466        )
9467    }
9468}
9469
9470#[must_use = "FIDL methods require a response to be sent"]
9471#[derive(Debug)]
9472pub struct FileUpdateAttributesResponder {
9473    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9474    tx_id: u32,
9475}
9476
9477/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9478/// if the responder is dropped without sending a response, so that the client
9479/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9480impl std::ops::Drop for FileUpdateAttributesResponder {
9481    fn drop(&mut self) {
9482        self.control_handle.shutdown();
9483        // Safety: drops once, never accessed again
9484        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9485    }
9486}
9487
9488impl fdomain_client::fidl::Responder for FileUpdateAttributesResponder {
9489    type ControlHandle = FileControlHandle;
9490
9491    fn control_handle(&self) -> &FileControlHandle {
9492        &self.control_handle
9493    }
9494
9495    fn drop_without_shutdown(mut self) {
9496        // Safety: drops once, never accessed again due to mem::forget
9497        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9498        // Prevent Drop from running (which would shut down the channel)
9499        std::mem::forget(self);
9500    }
9501}
9502
9503impl FileUpdateAttributesResponder {
9504    /// Sends a response to the FIDL transaction.
9505    ///
9506    /// Sets the channel to shutdown if an error occurs.
9507    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9508        let _result = self.send_raw(result);
9509        if _result.is_err() {
9510            self.control_handle.shutdown();
9511        }
9512        self.drop_without_shutdown();
9513        _result
9514    }
9515
9516    /// Similar to "send" but does not shutdown the channel if an error occurs.
9517    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9518        let _result = self.send_raw(result);
9519        self.drop_without_shutdown();
9520        _result
9521    }
9522
9523    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9524        self.control_handle
9525            .inner
9526            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9527                result,
9528                self.tx_id,
9529                0x3308c1da5a89bf08,
9530                fidl::encoding::DynamicFlags::empty(),
9531            )
9532    }
9533}
9534
9535#[must_use = "FIDL methods require a response to be sent"]
9536#[derive(Debug)]
9537pub struct FileSyncResponder {
9538    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9539    tx_id: u32,
9540}
9541
9542/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9543/// if the responder is dropped without sending a response, so that the client
9544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9545impl std::ops::Drop for FileSyncResponder {
9546    fn drop(&mut self) {
9547        self.control_handle.shutdown();
9548        // Safety: drops once, never accessed again
9549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9550    }
9551}
9552
9553impl fdomain_client::fidl::Responder for FileSyncResponder {
9554    type ControlHandle = FileControlHandle;
9555
9556    fn control_handle(&self) -> &FileControlHandle {
9557        &self.control_handle
9558    }
9559
9560    fn drop_without_shutdown(mut self) {
9561        // Safety: drops once, never accessed again due to mem::forget
9562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9563        // Prevent Drop from running (which would shut down the channel)
9564        std::mem::forget(self);
9565    }
9566}
9567
9568impl FileSyncResponder {
9569    /// Sends a response to the FIDL transaction.
9570    ///
9571    /// Sets the channel to shutdown if an error occurs.
9572    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9573        let _result = self.send_raw(result);
9574        if _result.is_err() {
9575            self.control_handle.shutdown();
9576        }
9577        self.drop_without_shutdown();
9578        _result
9579    }
9580
9581    /// Similar to "send" but does not shutdown the channel if an error occurs.
9582    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9583        let _result = self.send_raw(result);
9584        self.drop_without_shutdown();
9585        _result
9586    }
9587
9588    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9589        self.control_handle
9590            .inner
9591            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9592                result,
9593                self.tx_id,
9594                0x2c5c27ca0ab5dc49,
9595                fidl::encoding::DynamicFlags::empty(),
9596            )
9597    }
9598}
9599
9600#[must_use = "FIDL methods require a response to be sent"]
9601#[derive(Debug)]
9602pub struct FileGetExtendedAttributeResponder {
9603    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9604    tx_id: u32,
9605}
9606
9607/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9608/// if the responder is dropped without sending a response, so that the client
9609/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9610impl std::ops::Drop for FileGetExtendedAttributeResponder {
9611    fn drop(&mut self) {
9612        self.control_handle.shutdown();
9613        // Safety: drops once, never accessed again
9614        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9615    }
9616}
9617
9618impl fdomain_client::fidl::Responder for FileGetExtendedAttributeResponder {
9619    type ControlHandle = FileControlHandle;
9620
9621    fn control_handle(&self) -> &FileControlHandle {
9622        &self.control_handle
9623    }
9624
9625    fn drop_without_shutdown(mut self) {
9626        // Safety: drops once, never accessed again due to mem::forget
9627        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9628        // Prevent Drop from running (which would shut down the channel)
9629        std::mem::forget(self);
9630    }
9631}
9632
9633impl FileGetExtendedAttributeResponder {
9634    /// Sends a response to the FIDL transaction.
9635    ///
9636    /// Sets the channel to shutdown if an error occurs.
9637    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9638        let _result = self.send_raw(result);
9639        if _result.is_err() {
9640            self.control_handle.shutdown();
9641        }
9642        self.drop_without_shutdown();
9643        _result
9644    }
9645
9646    /// Similar to "send" but does not shutdown the channel if an error occurs.
9647    pub fn send_no_shutdown_on_err(
9648        self,
9649        mut result: Result<ExtendedAttributeValue, i32>,
9650    ) -> Result<(), fidl::Error> {
9651        let _result = self.send_raw(result);
9652        self.drop_without_shutdown();
9653        _result
9654    }
9655
9656    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9657        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
9658            result.as_mut().map_err(|e| *e),
9659            self.tx_id,
9660            0x45ffa3ccfdeb76db,
9661            fidl::encoding::DynamicFlags::empty(),
9662        )
9663    }
9664}
9665
9666#[must_use = "FIDL methods require a response to be sent"]
9667#[derive(Debug)]
9668pub struct FileSetExtendedAttributeResponder {
9669    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9670    tx_id: u32,
9671}
9672
9673/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9674/// if the responder is dropped without sending a response, so that the client
9675/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9676impl std::ops::Drop for FileSetExtendedAttributeResponder {
9677    fn drop(&mut self) {
9678        self.control_handle.shutdown();
9679        // Safety: drops once, never accessed again
9680        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9681    }
9682}
9683
9684impl fdomain_client::fidl::Responder for FileSetExtendedAttributeResponder {
9685    type ControlHandle = FileControlHandle;
9686
9687    fn control_handle(&self) -> &FileControlHandle {
9688        &self.control_handle
9689    }
9690
9691    fn drop_without_shutdown(mut self) {
9692        // Safety: drops once, never accessed again due to mem::forget
9693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9694        // Prevent Drop from running (which would shut down the channel)
9695        std::mem::forget(self);
9696    }
9697}
9698
9699impl FileSetExtendedAttributeResponder {
9700    /// Sends a response to the FIDL transaction.
9701    ///
9702    /// Sets the channel to shutdown if an error occurs.
9703    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9704        let _result = self.send_raw(result);
9705        if _result.is_err() {
9706            self.control_handle.shutdown();
9707        }
9708        self.drop_without_shutdown();
9709        _result
9710    }
9711
9712    /// Similar to "send" but does not shutdown the channel if an error occurs.
9713    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9714        let _result = self.send_raw(result);
9715        self.drop_without_shutdown();
9716        _result
9717    }
9718
9719    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9720        self.control_handle
9721            .inner
9722            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9723                result,
9724                self.tx_id,
9725                0x4a951362f681f23c,
9726                fidl::encoding::DynamicFlags::empty(),
9727            )
9728    }
9729}
9730
9731#[must_use = "FIDL methods require a response to be sent"]
9732#[derive(Debug)]
9733pub struct FileRemoveExtendedAttributeResponder {
9734    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9735    tx_id: u32,
9736}
9737
9738/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9739/// if the responder is dropped without sending a response, so that the client
9740/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9741impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
9742    fn drop(&mut self) {
9743        self.control_handle.shutdown();
9744        // Safety: drops once, never accessed again
9745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9746    }
9747}
9748
9749impl fdomain_client::fidl::Responder for FileRemoveExtendedAttributeResponder {
9750    type ControlHandle = FileControlHandle;
9751
9752    fn control_handle(&self) -> &FileControlHandle {
9753        &self.control_handle
9754    }
9755
9756    fn drop_without_shutdown(mut self) {
9757        // Safety: drops once, never accessed again due to mem::forget
9758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9759        // Prevent Drop from running (which would shut down the channel)
9760        std::mem::forget(self);
9761    }
9762}
9763
9764impl FileRemoveExtendedAttributeResponder {
9765    /// Sends a response to the FIDL transaction.
9766    ///
9767    /// Sets the channel to shutdown if an error occurs.
9768    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9769        let _result = self.send_raw(result);
9770        if _result.is_err() {
9771            self.control_handle.shutdown();
9772        }
9773        self.drop_without_shutdown();
9774        _result
9775    }
9776
9777    /// Similar to "send" but does not shutdown the channel if an error occurs.
9778    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9779        let _result = self.send_raw(result);
9780        self.drop_without_shutdown();
9781        _result
9782    }
9783
9784    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9785        self.control_handle
9786            .inner
9787            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9788                result,
9789                self.tx_id,
9790                0x7a0b9f3a9bf9032d,
9791                fidl::encoding::DynamicFlags::empty(),
9792            )
9793    }
9794}
9795
9796#[must_use = "FIDL methods require a response to be sent"]
9797#[derive(Debug)]
9798pub struct FileReadResponder {
9799    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9800    tx_id: u32,
9801}
9802
9803/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9804/// if the responder is dropped without sending a response, so that the client
9805/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9806impl std::ops::Drop for FileReadResponder {
9807    fn drop(&mut self) {
9808        self.control_handle.shutdown();
9809        // Safety: drops once, never accessed again
9810        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9811    }
9812}
9813
9814impl fdomain_client::fidl::Responder for FileReadResponder {
9815    type ControlHandle = FileControlHandle;
9816
9817    fn control_handle(&self) -> &FileControlHandle {
9818        &self.control_handle
9819    }
9820
9821    fn drop_without_shutdown(mut self) {
9822        // Safety: drops once, never accessed again due to mem::forget
9823        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9824        // Prevent Drop from running (which would shut down the channel)
9825        std::mem::forget(self);
9826    }
9827}
9828
9829impl FileReadResponder {
9830    /// Sends a response to the FIDL transaction.
9831    ///
9832    /// Sets the channel to shutdown if an error occurs.
9833    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9834        let _result = self.send_raw(result);
9835        if _result.is_err() {
9836            self.control_handle.shutdown();
9837        }
9838        self.drop_without_shutdown();
9839        _result
9840    }
9841
9842    /// Similar to "send" but does not shutdown the channel if an error occurs.
9843    pub fn send_no_shutdown_on_err(
9844        self,
9845        mut result: Result<&[u8], i32>,
9846    ) -> Result<(), fidl::Error> {
9847        let _result = self.send_raw(result);
9848        self.drop_without_shutdown();
9849        _result
9850    }
9851
9852    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9853        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
9854            result.map(|data| (data,)),
9855            self.tx_id,
9856            0x57e419a298c8ede,
9857            fidl::encoding::DynamicFlags::empty(),
9858        )
9859    }
9860}
9861
9862#[must_use = "FIDL methods require a response to be sent"]
9863#[derive(Debug)]
9864pub struct FileWriteResponder {
9865    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9866    tx_id: u32,
9867}
9868
9869/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9870/// if the responder is dropped without sending a response, so that the client
9871/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9872impl std::ops::Drop for FileWriteResponder {
9873    fn drop(&mut self) {
9874        self.control_handle.shutdown();
9875        // Safety: drops once, never accessed again
9876        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9877    }
9878}
9879
9880impl fdomain_client::fidl::Responder for FileWriteResponder {
9881    type ControlHandle = FileControlHandle;
9882
9883    fn control_handle(&self) -> &FileControlHandle {
9884        &self.control_handle
9885    }
9886
9887    fn drop_without_shutdown(mut self) {
9888        // Safety: drops once, never accessed again due to mem::forget
9889        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9890        // Prevent Drop from running (which would shut down the channel)
9891        std::mem::forget(self);
9892    }
9893}
9894
9895impl FileWriteResponder {
9896    /// Sends a response to the FIDL transaction.
9897    ///
9898    /// Sets the channel to shutdown if an error occurs.
9899    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9900        let _result = self.send_raw(result);
9901        if _result.is_err() {
9902            self.control_handle.shutdown();
9903        }
9904        self.drop_without_shutdown();
9905        _result
9906    }
9907
9908    /// Similar to "send" but does not shutdown the channel if an error occurs.
9909    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9910        let _result = self.send_raw(result);
9911        self.drop_without_shutdown();
9912        _result
9913    }
9914
9915    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9916        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
9917            result.map(|actual_count| (actual_count,)),
9918            self.tx_id,
9919            0x6a31437832469f82,
9920            fidl::encoding::DynamicFlags::empty(),
9921        )
9922    }
9923}
9924
9925#[must_use = "FIDL methods require a response to be sent"]
9926#[derive(Debug)]
9927pub struct FileDescribeResponder {
9928    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9929    tx_id: u32,
9930}
9931
9932/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9933/// if the responder is dropped without sending a response, so that the client
9934/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9935impl std::ops::Drop for FileDescribeResponder {
9936    fn drop(&mut self) {
9937        self.control_handle.shutdown();
9938        // Safety: drops once, never accessed again
9939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9940    }
9941}
9942
9943impl fdomain_client::fidl::Responder for FileDescribeResponder {
9944    type ControlHandle = FileControlHandle;
9945
9946    fn control_handle(&self) -> &FileControlHandle {
9947        &self.control_handle
9948    }
9949
9950    fn drop_without_shutdown(mut self) {
9951        // Safety: drops once, never accessed again due to mem::forget
9952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9953        // Prevent Drop from running (which would shut down the channel)
9954        std::mem::forget(self);
9955    }
9956}
9957
9958impl FileDescribeResponder {
9959    /// Sends a response to the FIDL transaction.
9960    ///
9961    /// Sets the channel to shutdown if an error occurs.
9962    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9963        let _result = self.send_raw(payload);
9964        if _result.is_err() {
9965            self.control_handle.shutdown();
9966        }
9967        self.drop_without_shutdown();
9968        _result
9969    }
9970
9971    /// Similar to "send" but does not shutdown the channel if an error occurs.
9972    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9973        let _result = self.send_raw(payload);
9974        self.drop_without_shutdown();
9975        _result
9976    }
9977
9978    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9979        self.control_handle.inner.send::<FileInfo>(
9980            &mut payload,
9981            self.tx_id,
9982            0x68b5ac00c62906bc,
9983            fidl::encoding::DynamicFlags::empty(),
9984        )
9985    }
9986}
9987
9988#[must_use = "FIDL methods require a response to be sent"]
9989#[derive(Debug)]
9990pub struct FileSeekResponder {
9991    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9992    tx_id: u32,
9993}
9994
9995/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9996/// if the responder is dropped without sending a response, so that the client
9997/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9998impl std::ops::Drop for FileSeekResponder {
9999    fn drop(&mut self) {
10000        self.control_handle.shutdown();
10001        // Safety: drops once, never accessed again
10002        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10003    }
10004}
10005
10006impl fdomain_client::fidl::Responder for FileSeekResponder {
10007    type ControlHandle = FileControlHandle;
10008
10009    fn control_handle(&self) -> &FileControlHandle {
10010        &self.control_handle
10011    }
10012
10013    fn drop_without_shutdown(mut self) {
10014        // Safety: drops once, never accessed again due to mem::forget
10015        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10016        // Prevent Drop from running (which would shut down the channel)
10017        std::mem::forget(self);
10018    }
10019}
10020
10021impl FileSeekResponder {
10022    /// Sends a response to the FIDL transaction.
10023    ///
10024    /// Sets the channel to shutdown if an error occurs.
10025    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10026        let _result = self.send_raw(result);
10027        if _result.is_err() {
10028            self.control_handle.shutdown();
10029        }
10030        self.drop_without_shutdown();
10031        _result
10032    }
10033
10034    /// Similar to "send" but does not shutdown the channel if an error occurs.
10035    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10036        let _result = self.send_raw(result);
10037        self.drop_without_shutdown();
10038        _result
10039    }
10040
10041    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10042        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
10043            result.map(|offset_from_start| (offset_from_start,)),
10044            self.tx_id,
10045            0x78079168162c5207,
10046            fidl::encoding::DynamicFlags::empty(),
10047        )
10048    }
10049}
10050
10051#[must_use = "FIDL methods require a response to be sent"]
10052#[derive(Debug)]
10053pub struct FileReadAtResponder {
10054    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10055    tx_id: u32,
10056}
10057
10058/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10059/// if the responder is dropped without sending a response, so that the client
10060/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10061impl std::ops::Drop for FileReadAtResponder {
10062    fn drop(&mut self) {
10063        self.control_handle.shutdown();
10064        // Safety: drops once, never accessed again
10065        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10066    }
10067}
10068
10069impl fdomain_client::fidl::Responder for FileReadAtResponder {
10070    type ControlHandle = FileControlHandle;
10071
10072    fn control_handle(&self) -> &FileControlHandle {
10073        &self.control_handle
10074    }
10075
10076    fn drop_without_shutdown(mut self) {
10077        // Safety: drops once, never accessed again due to mem::forget
10078        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10079        // Prevent Drop from running (which would shut down the channel)
10080        std::mem::forget(self);
10081    }
10082}
10083
10084impl FileReadAtResponder {
10085    /// Sends a response to the FIDL transaction.
10086    ///
10087    /// Sets the channel to shutdown if an error occurs.
10088    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10089        let _result = self.send_raw(result);
10090        if _result.is_err() {
10091            self.control_handle.shutdown();
10092        }
10093        self.drop_without_shutdown();
10094        _result
10095    }
10096
10097    /// Similar to "send" but does not shutdown the channel if an error occurs.
10098    pub fn send_no_shutdown_on_err(
10099        self,
10100        mut result: Result<&[u8], i32>,
10101    ) -> Result<(), fidl::Error> {
10102        let _result = self.send_raw(result);
10103        self.drop_without_shutdown();
10104        _result
10105    }
10106
10107    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10108        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
10109            result.map(|data| (data,)),
10110            self.tx_id,
10111            0x1607a293a60d723e,
10112            fidl::encoding::DynamicFlags::empty(),
10113        )
10114    }
10115}
10116
10117#[must_use = "FIDL methods require a response to be sent"]
10118#[derive(Debug)]
10119pub struct FileWriteAtResponder {
10120    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10121    tx_id: u32,
10122}
10123
10124/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10125/// if the responder is dropped without sending a response, so that the client
10126/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10127impl std::ops::Drop for FileWriteAtResponder {
10128    fn drop(&mut self) {
10129        self.control_handle.shutdown();
10130        // Safety: drops once, never accessed again
10131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10132    }
10133}
10134
10135impl fdomain_client::fidl::Responder for FileWriteAtResponder {
10136    type ControlHandle = FileControlHandle;
10137
10138    fn control_handle(&self) -> &FileControlHandle {
10139        &self.control_handle
10140    }
10141
10142    fn drop_without_shutdown(mut self) {
10143        // Safety: drops once, never accessed again due to mem::forget
10144        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10145        // Prevent Drop from running (which would shut down the channel)
10146        std::mem::forget(self);
10147    }
10148}
10149
10150impl FileWriteAtResponder {
10151    /// Sends a response to the FIDL transaction.
10152    ///
10153    /// Sets the channel to shutdown if an error occurs.
10154    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10155        let _result = self.send_raw(result);
10156        if _result.is_err() {
10157            self.control_handle.shutdown();
10158        }
10159        self.drop_without_shutdown();
10160        _result
10161    }
10162
10163    /// Similar to "send" but does not shutdown the channel if an error occurs.
10164    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10165        let _result = self.send_raw(result);
10166        self.drop_without_shutdown();
10167        _result
10168    }
10169
10170    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10171        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
10172            result.map(|actual_count| (actual_count,)),
10173            self.tx_id,
10174            0x793eefc0045e792b,
10175            fidl::encoding::DynamicFlags::empty(),
10176        )
10177    }
10178}
10179
10180#[must_use = "FIDL methods require a response to be sent"]
10181#[derive(Debug)]
10182pub struct FileResizeResponder {
10183    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10184    tx_id: u32,
10185}
10186
10187/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10188/// if the responder is dropped without sending a response, so that the client
10189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10190impl std::ops::Drop for FileResizeResponder {
10191    fn drop(&mut self) {
10192        self.control_handle.shutdown();
10193        // Safety: drops once, never accessed again
10194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10195    }
10196}
10197
10198impl fdomain_client::fidl::Responder for FileResizeResponder {
10199    type ControlHandle = FileControlHandle;
10200
10201    fn control_handle(&self) -> &FileControlHandle {
10202        &self.control_handle
10203    }
10204
10205    fn drop_without_shutdown(mut self) {
10206        // Safety: drops once, never accessed again due to mem::forget
10207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10208        // Prevent Drop from running (which would shut down the channel)
10209        std::mem::forget(self);
10210    }
10211}
10212
10213impl FileResizeResponder {
10214    /// Sends a response to the FIDL transaction.
10215    ///
10216    /// Sets the channel to shutdown if an error occurs.
10217    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10218        let _result = self.send_raw(result);
10219        if _result.is_err() {
10220            self.control_handle.shutdown();
10221        }
10222        self.drop_without_shutdown();
10223        _result
10224    }
10225
10226    /// Similar to "send" but does not shutdown the channel if an error occurs.
10227    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10228        let _result = self.send_raw(result);
10229        self.drop_without_shutdown();
10230        _result
10231    }
10232
10233    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10234        self.control_handle
10235            .inner
10236            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10237                result,
10238                self.tx_id,
10239                0x2b80825f0535743a,
10240                fidl::encoding::DynamicFlags::empty(),
10241            )
10242    }
10243}
10244
10245#[must_use = "FIDL methods require a response to be sent"]
10246#[derive(Debug)]
10247pub struct FileGetBackingMemoryResponder {
10248    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10249    tx_id: u32,
10250}
10251
10252/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10253/// if the responder is dropped without sending a response, so that the client
10254/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10255impl std::ops::Drop for FileGetBackingMemoryResponder {
10256    fn drop(&mut self) {
10257        self.control_handle.shutdown();
10258        // Safety: drops once, never accessed again
10259        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10260    }
10261}
10262
10263impl fdomain_client::fidl::Responder for FileGetBackingMemoryResponder {
10264    type ControlHandle = FileControlHandle;
10265
10266    fn control_handle(&self) -> &FileControlHandle {
10267        &self.control_handle
10268    }
10269
10270    fn drop_without_shutdown(mut self) {
10271        // Safety: drops once, never accessed again due to mem::forget
10272        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10273        // Prevent Drop from running (which would shut down the channel)
10274        std::mem::forget(self);
10275    }
10276}
10277
10278impl FileGetBackingMemoryResponder {
10279    /// Sends a response to the FIDL transaction.
10280    ///
10281    /// Sets the channel to shutdown if an error occurs.
10282    pub fn send(self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10283        let _result = self.send_raw(result);
10284        if _result.is_err() {
10285            self.control_handle.shutdown();
10286        }
10287        self.drop_without_shutdown();
10288        _result
10289    }
10290
10291    /// Similar to "send" but does not shutdown the channel if an error occurs.
10292    pub fn send_no_shutdown_on_err(
10293        self,
10294        mut result: Result<fdomain_client::Vmo, i32>,
10295    ) -> Result<(), fidl::Error> {
10296        let _result = self.send_raw(result);
10297        self.drop_without_shutdown();
10298        _result
10299    }
10300
10301    fn send_raw(&self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10302        self.control_handle
10303            .inner
10304            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
10305                result.map(|vmo| (vmo,)),
10306                self.tx_id,
10307                0xa6a9e654cbf62b,
10308                fidl::encoding::DynamicFlags::empty(),
10309            )
10310    }
10311}
10312
10313#[must_use = "FIDL methods require a response to be sent"]
10314#[derive(Debug)]
10315pub struct FileAllocateResponder {
10316    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10317    tx_id: u32,
10318}
10319
10320/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10321/// if the responder is dropped without sending a response, so that the client
10322/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10323impl std::ops::Drop for FileAllocateResponder {
10324    fn drop(&mut self) {
10325        self.control_handle.shutdown();
10326        // Safety: drops once, never accessed again
10327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10328    }
10329}
10330
10331impl fdomain_client::fidl::Responder for FileAllocateResponder {
10332    type ControlHandle = FileControlHandle;
10333
10334    fn control_handle(&self) -> &FileControlHandle {
10335        &self.control_handle
10336    }
10337
10338    fn drop_without_shutdown(mut self) {
10339        // Safety: drops once, never accessed again due to mem::forget
10340        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10341        // Prevent Drop from running (which would shut down the channel)
10342        std::mem::forget(self);
10343    }
10344}
10345
10346impl FileAllocateResponder {
10347    /// Sends a response to the FIDL transaction.
10348    ///
10349    /// Sets the channel to shutdown if an error occurs.
10350    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10351        let _result = self.send_raw(result);
10352        if _result.is_err() {
10353            self.control_handle.shutdown();
10354        }
10355        self.drop_without_shutdown();
10356        _result
10357    }
10358
10359    /// Similar to "send" but does not shutdown the channel if an error occurs.
10360    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10361        let _result = self.send_raw(result);
10362        self.drop_without_shutdown();
10363        _result
10364    }
10365
10366    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10367        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10368            fidl::encoding::EmptyStruct,
10369            i32,
10370        >>(
10371            fidl::encoding::FlexibleResult::new(result),
10372            self.tx_id,
10373            0x77fa0c330b57fd2e,
10374            fidl::encoding::DynamicFlags::FLEXIBLE,
10375        )
10376    }
10377}
10378
10379#[must_use = "FIDL methods require a response to be sent"]
10380#[derive(Debug)]
10381pub struct FileEnableVerityResponder {
10382    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10383    tx_id: u32,
10384}
10385
10386/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10387/// if the responder is dropped without sending a response, so that the client
10388/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10389impl std::ops::Drop for FileEnableVerityResponder {
10390    fn drop(&mut self) {
10391        self.control_handle.shutdown();
10392        // Safety: drops once, never accessed again
10393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10394    }
10395}
10396
10397impl fdomain_client::fidl::Responder for FileEnableVerityResponder {
10398    type ControlHandle = FileControlHandle;
10399
10400    fn control_handle(&self) -> &FileControlHandle {
10401        &self.control_handle
10402    }
10403
10404    fn drop_without_shutdown(mut self) {
10405        // Safety: drops once, never accessed again due to mem::forget
10406        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10407        // Prevent Drop from running (which would shut down the channel)
10408        std::mem::forget(self);
10409    }
10410}
10411
10412impl FileEnableVerityResponder {
10413    /// Sends a response to the FIDL transaction.
10414    ///
10415    /// Sets the channel to shutdown if an error occurs.
10416    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10417        let _result = self.send_raw(result);
10418        if _result.is_err() {
10419            self.control_handle.shutdown();
10420        }
10421        self.drop_without_shutdown();
10422        _result
10423    }
10424
10425    /// Similar to "send" but does not shutdown the channel if an error occurs.
10426    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10427        let _result = self.send_raw(result);
10428        self.drop_without_shutdown();
10429        _result
10430    }
10431
10432    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10433        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10434            fidl::encoding::EmptyStruct,
10435            i32,
10436        >>(
10437            fidl::encoding::FlexibleResult::new(result),
10438            self.tx_id,
10439            0x2c421ec3faaeb8bb,
10440            fidl::encoding::DynamicFlags::FLEXIBLE,
10441        )
10442    }
10443}
10444
10445#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10446pub struct LinkableMarker;
10447
10448impl fdomain_client::fidl::ProtocolMarker for LinkableMarker {
10449    type Proxy = LinkableProxy;
10450    type RequestStream = LinkableRequestStream;
10451
10452    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
10453}
10454pub type LinkableLinkIntoResult = Result<(), i32>;
10455
10456pub trait LinkableProxyInterface: Send + Sync {
10457    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
10458        + Send;
10459    fn r#link_into(
10460        &self,
10461        dst_parent_token: fdomain_client::Event,
10462        dst: &str,
10463    ) -> Self::LinkIntoResponseFut;
10464}
10465
10466#[derive(Debug, Clone)]
10467pub struct LinkableProxy {
10468    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10469}
10470
10471impl fdomain_client::fidl::Proxy for LinkableProxy {
10472    type Protocol = LinkableMarker;
10473
10474    fn from_channel(inner: fdomain_client::Channel) -> Self {
10475        Self::new(inner)
10476    }
10477
10478    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10479        self.client.into_channel().map_err(|client| Self { client })
10480    }
10481
10482    fn as_channel(&self) -> &fdomain_client::Channel {
10483        self.client.as_channel()
10484    }
10485}
10486
10487impl LinkableProxy {
10488    /// Create a new Proxy for fuchsia.io/Linkable.
10489    pub fn new(channel: fdomain_client::Channel) -> Self {
10490        let protocol_name = <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10491        Self { client: fidl::client::Client::new(channel, protocol_name) }
10492    }
10493
10494    /// Get a Stream of events from the remote end of the protocol.
10495    ///
10496    /// # Panics
10497    ///
10498    /// Panics if the event stream was already taken.
10499    pub fn take_event_stream(&self) -> LinkableEventStream {
10500        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
10501    }
10502
10503    /// Creates a link to this this object with name `dst` in the directory represented by
10504    /// `dst_parent_token`.
10505    ///
10506    /// `dst` must be a resolved object name. Including "/" in the string will return
10507    /// `ZX_ERR_INVALID_ARGS`.
10508    ///
10509    /// This method requires the maximal set of rights supported by the filesystem for this object.
10510    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10511    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10512    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10513    /// `ZX_ERR_ACCESS_DENIED`.
10514    ///
10515    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10516    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10517    ///
10518    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10519    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10520    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10521    ///
10522    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10523    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10524    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10525    pub fn r#link_into(
10526        &self,
10527        mut dst_parent_token: fdomain_client::Event,
10528        mut dst: &str,
10529    ) -> fidl::client::QueryResponseFut<
10530        LinkableLinkIntoResult,
10531        fdomain_client::fidl::FDomainResourceDialect,
10532    > {
10533        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
10534    }
10535}
10536
10537impl LinkableProxyInterface for LinkableProxy {
10538    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
10539        LinkableLinkIntoResult,
10540        fdomain_client::fidl::FDomainResourceDialect,
10541    >;
10542    fn r#link_into(
10543        &self,
10544        mut dst_parent_token: fdomain_client::Event,
10545        mut dst: &str,
10546    ) -> Self::LinkIntoResponseFut {
10547        fn _decode(
10548            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10549        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
10550            let _response = fidl::client::decode_transaction_body::<
10551                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10552                fdomain_client::fidl::FDomainResourceDialect,
10553                0x54f3949246a03e74,
10554            >(_buf?)?;
10555            Ok(_response.map(|x| x))
10556        }
10557        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
10558            (dst_parent_token, dst),
10559            0x54f3949246a03e74,
10560            fidl::encoding::DynamicFlags::empty(),
10561            _decode,
10562        )
10563    }
10564}
10565
10566pub struct LinkableEventStream {
10567    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
10568}
10569
10570impl std::marker::Unpin for LinkableEventStream {}
10571
10572impl futures::stream::FusedStream for LinkableEventStream {
10573    fn is_terminated(&self) -> bool {
10574        self.event_receiver.is_terminated()
10575    }
10576}
10577
10578impl futures::Stream for LinkableEventStream {
10579    type Item = Result<LinkableEvent, fidl::Error>;
10580
10581    fn poll_next(
10582        mut self: std::pin::Pin<&mut Self>,
10583        cx: &mut std::task::Context<'_>,
10584    ) -> std::task::Poll<Option<Self::Item>> {
10585        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10586            &mut self.event_receiver,
10587            cx
10588        )?) {
10589            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
10590            None => std::task::Poll::Ready(None),
10591        }
10592    }
10593}
10594
10595#[derive(Debug)]
10596pub enum LinkableEvent {}
10597
10598impl LinkableEvent {
10599    /// Decodes a message buffer as a [`LinkableEvent`].
10600    fn decode(
10601        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10602    ) -> Result<LinkableEvent, fidl::Error> {
10603        let (bytes, _handles) = buf.split_mut();
10604        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10605        debug_assert_eq!(tx_header.tx_id, 0);
10606        match tx_header.ordinal {
10607            _ => Err(fidl::Error::UnknownOrdinal {
10608                ordinal: tx_header.ordinal,
10609                protocol_name: <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10610            }),
10611        }
10612    }
10613}
10614
10615/// A Stream of incoming requests for fuchsia.io/Linkable.
10616pub struct LinkableRequestStream {
10617    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10618    is_terminated: bool,
10619}
10620
10621impl std::marker::Unpin for LinkableRequestStream {}
10622
10623impl futures::stream::FusedStream for LinkableRequestStream {
10624    fn is_terminated(&self) -> bool {
10625        self.is_terminated
10626    }
10627}
10628
10629impl fdomain_client::fidl::RequestStream for LinkableRequestStream {
10630    type Protocol = LinkableMarker;
10631    type ControlHandle = LinkableControlHandle;
10632
10633    fn from_channel(channel: fdomain_client::Channel) -> Self {
10634        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10635    }
10636
10637    fn control_handle(&self) -> Self::ControlHandle {
10638        LinkableControlHandle { inner: self.inner.clone() }
10639    }
10640
10641    fn into_inner(
10642        self,
10643    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
10644    {
10645        (self.inner, self.is_terminated)
10646    }
10647
10648    fn from_inner(
10649        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10650        is_terminated: bool,
10651    ) -> Self {
10652        Self { inner, is_terminated }
10653    }
10654}
10655
10656impl futures::Stream for LinkableRequestStream {
10657    type Item = Result<LinkableRequest, fidl::Error>;
10658
10659    fn poll_next(
10660        mut self: std::pin::Pin<&mut Self>,
10661        cx: &mut std::task::Context<'_>,
10662    ) -> std::task::Poll<Option<Self::Item>> {
10663        let this = &mut *self;
10664        if this.inner.check_shutdown(cx) {
10665            this.is_terminated = true;
10666            return std::task::Poll::Ready(None);
10667        }
10668        if this.is_terminated {
10669            panic!("polled LinkableRequestStream after completion");
10670        }
10671        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
10672            |bytes, handles| {
10673                match this.inner.channel().read_etc(cx, bytes, handles) {
10674                    std::task::Poll::Ready(Ok(())) => {}
10675                    std::task::Poll::Pending => return std::task::Poll::Pending,
10676                    std::task::Poll::Ready(Err(None)) => {
10677                        this.is_terminated = true;
10678                        return std::task::Poll::Ready(None);
10679                    }
10680                    std::task::Poll::Ready(Err(Some(e))) => {
10681                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10682                            e.into(),
10683                        ))));
10684                    }
10685                }
10686
10687                // A message has been received from the channel
10688                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10689
10690                std::task::Poll::Ready(Some(match header.ordinal {
10691                    0x54f3949246a03e74 => {
10692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10693                        let mut req = fidl::new_empty!(
10694                            LinkableLinkIntoRequest,
10695                            fdomain_client::fidl::FDomainResourceDialect
10696                        );
10697                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
10698                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
10699                        Ok(LinkableRequest::LinkInto {
10700                            dst_parent_token: req.dst_parent_token,
10701                            dst: req.dst,
10702
10703                            responder: LinkableLinkIntoResponder {
10704                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10705                                tx_id: header.tx_id,
10706                            },
10707                        })
10708                    }
10709                    _ => Err(fidl::Error::UnknownOrdinal {
10710                        ordinal: header.ordinal,
10711                        protocol_name:
10712                            <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10713                    }),
10714                }))
10715            },
10716        )
10717    }
10718}
10719
10720#[derive(Debug)]
10721pub enum LinkableRequest {
10722    /// Creates a link to this this object with name `dst` in the directory represented by
10723    /// `dst_parent_token`.
10724    ///
10725    /// `dst` must be a resolved object name. Including "/" in the string will return
10726    /// `ZX_ERR_INVALID_ARGS`.
10727    ///
10728    /// This method requires the maximal set of rights supported by the filesystem for this object.
10729    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10730    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10731    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10732    /// `ZX_ERR_ACCESS_DENIED`.
10733    ///
10734    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10735    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10736    ///
10737    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10738    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10739    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10740    ///
10741    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10742    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10743    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10744    LinkInto {
10745        dst_parent_token: fdomain_client::Event,
10746        dst: String,
10747        responder: LinkableLinkIntoResponder,
10748    },
10749}
10750
10751impl LinkableRequest {
10752    #[allow(irrefutable_let_patterns)]
10753    pub fn into_link_into(
10754        self,
10755    ) -> Option<(fdomain_client::Event, String, LinkableLinkIntoResponder)> {
10756        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
10757            Some((dst_parent_token, dst, responder))
10758        } else {
10759            None
10760        }
10761    }
10762
10763    /// Name of the method defined in FIDL
10764    pub fn method_name(&self) -> &'static str {
10765        match *self {
10766            LinkableRequest::LinkInto { .. } => "link_into",
10767        }
10768    }
10769}
10770
10771#[derive(Debug, Clone)]
10772pub struct LinkableControlHandle {
10773    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10774}
10775
10776impl LinkableControlHandle {
10777    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10778        self.inner.shutdown_with_epitaph(status.into())
10779    }
10780}
10781
10782impl fdomain_client::fidl::ControlHandle for LinkableControlHandle {
10783    fn shutdown(&self) {
10784        self.inner.shutdown()
10785    }
10786
10787    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10788        self.inner.shutdown_with_epitaph(status)
10789    }
10790
10791    fn is_closed(&self) -> bool {
10792        self.inner.channel().is_closed()
10793    }
10794    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
10795        self.inner.channel().on_closed()
10796    }
10797}
10798
10799impl LinkableControlHandle {}
10800
10801#[must_use = "FIDL methods require a response to be sent"]
10802#[derive(Debug)]
10803pub struct LinkableLinkIntoResponder {
10804    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
10805    tx_id: u32,
10806}
10807
10808/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
10809/// if the responder is dropped without sending a response, so that the client
10810/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10811impl std::ops::Drop for LinkableLinkIntoResponder {
10812    fn drop(&mut self) {
10813        self.control_handle.shutdown();
10814        // Safety: drops once, never accessed again
10815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10816    }
10817}
10818
10819impl fdomain_client::fidl::Responder for LinkableLinkIntoResponder {
10820    type ControlHandle = LinkableControlHandle;
10821
10822    fn control_handle(&self) -> &LinkableControlHandle {
10823        &self.control_handle
10824    }
10825
10826    fn drop_without_shutdown(mut self) {
10827        // Safety: drops once, never accessed again due to mem::forget
10828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10829        // Prevent Drop from running (which would shut down the channel)
10830        std::mem::forget(self);
10831    }
10832}
10833
10834impl LinkableLinkIntoResponder {
10835    /// Sends a response to the FIDL transaction.
10836    ///
10837    /// Sets the channel to shutdown if an error occurs.
10838    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10839        let _result = self.send_raw(result);
10840        if _result.is_err() {
10841            self.control_handle.shutdown();
10842        }
10843        self.drop_without_shutdown();
10844        _result
10845    }
10846
10847    /// Similar to "send" but does not shutdown the channel if an error occurs.
10848    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10849        let _result = self.send_raw(result);
10850        self.drop_without_shutdown();
10851        _result
10852    }
10853
10854    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10855        self.control_handle
10856            .inner
10857            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10858                result,
10859                self.tx_id,
10860                0x54f3949246a03e74,
10861                fidl::encoding::DynamicFlags::empty(),
10862            )
10863    }
10864}
10865
10866#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10867pub struct NodeMarker;
10868
10869impl fdomain_client::fidl::ProtocolMarker for NodeMarker {
10870    type Proxy = NodeProxy;
10871    type RequestStream = NodeRequestStream;
10872
10873    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
10874}
10875impl fdomain_client::fidl::DiscoverableProtocolMarker for NodeMarker {}
10876pub type NodeGetFlagsResult = Result<Flags, i32>;
10877pub type NodeSetFlagsResult = Result<(), i32>;
10878pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
10879pub type NodeUpdateAttributesResult = Result<(), i32>;
10880pub type NodeSyncResult = Result<(), i32>;
10881pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
10882pub type NodeSetExtendedAttributeResult = Result<(), i32>;
10883pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
10884
10885pub trait NodeProxyInterface: Send + Sync {
10886    fn r#clone(
10887        &self,
10888        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10889    ) -> Result<(), fidl::Error>;
10890    type CloseResponseFut: std::future::Future<
10891            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
10892        > + Send;
10893    fn r#close(&self) -> Self::CloseResponseFut;
10894    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
10895    fn r#query(&self) -> Self::QueryResponseFut;
10896    fn r#deprecated_clone(
10897        &self,
10898        flags: OpenFlags,
10899        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10900    ) -> Result<(), fidl::Error>;
10901    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
10902        + Send;
10903    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
10904    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
10905    fn r#deprecated_set_attr(
10906        &self,
10907        flags: NodeAttributeFlags,
10908        attributes: &NodeAttributes,
10909    ) -> Self::DeprecatedSetAttrResponseFut;
10910    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
10911        + Send;
10912    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
10913    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
10914        + Send;
10915    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
10916    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
10917        + Send;
10918    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
10919    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
10920        + Send;
10921    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
10922    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
10923        + Send;
10924    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
10925    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
10926        + Send;
10927    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
10928    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
10929        + Send;
10930    fn r#update_attributes(
10931        &self,
10932        payload: &MutableNodeAttributes,
10933    ) -> Self::UpdateAttributesResponseFut;
10934    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
10935    fn r#sync(&self) -> Self::SyncResponseFut;
10936    fn r#list_extended_attributes(
10937        &self,
10938        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
10939    ) -> Result<(), fidl::Error>;
10940    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
10941        + Send;
10942    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
10943    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
10944        + Send;
10945    fn r#set_extended_attribute(
10946        &self,
10947        name: &[u8],
10948        value: ExtendedAttributeValue,
10949        mode: SetExtendedAttributeMode,
10950    ) -> Self::SetExtendedAttributeResponseFut;
10951    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
10952        + Send;
10953    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
10954}
10955
10956#[derive(Debug, Clone)]
10957pub struct NodeProxy {
10958    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10959}
10960
10961impl fdomain_client::fidl::Proxy for NodeProxy {
10962    type Protocol = NodeMarker;
10963
10964    fn from_channel(inner: fdomain_client::Channel) -> Self {
10965        Self::new(inner)
10966    }
10967
10968    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10969        self.client.into_channel().map_err(|client| Self { client })
10970    }
10971
10972    fn as_channel(&self) -> &fdomain_client::Channel {
10973        self.client.as_channel()
10974    }
10975}
10976
10977impl NodeProxy {
10978    /// Create a new Proxy for fuchsia.io/Node.
10979    pub fn new(channel: fdomain_client::Channel) -> Self {
10980        let protocol_name = <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10981        Self { client: fidl::client::Client::new(channel, protocol_name) }
10982    }
10983
10984    /// Get a Stream of events from the remote end of the protocol.
10985    ///
10986    /// # Panics
10987    ///
10988    /// Panics if the event stream was already taken.
10989    pub fn take_event_stream(&self) -> NodeEventStream {
10990        NodeEventStream { event_receiver: self.client.take_event_receiver() }
10991    }
10992
10993    pub fn r#clone(
10994        &self,
10995        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10996    ) -> Result<(), fidl::Error> {
10997        NodeProxyInterface::r#clone(self, request)
10998    }
10999
11000    /// Terminates the connection.
11001    ///
11002    /// After calling `Close`, the client must not send any other requests.
11003    ///
11004    /// Servers, after sending the status response, should close the connection
11005    /// regardless of status and without sending an epitaph.
11006    ///
11007    /// Closing the client end of the channel should be semantically equivalent
11008    /// to calling `Close` without knowing when the close has completed or its
11009    /// status.
11010    pub fn r#close(
11011        &self,
11012    ) -> fidl::client::QueryResponseFut<
11013        fdomain_fuchsia_unknown::CloseableCloseResult,
11014        fdomain_client::fidl::FDomainResourceDialect,
11015    > {
11016        NodeProxyInterface::r#close(self)
11017    }
11018
11019    pub fn r#query(
11020        &self,
11021    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
11022        NodeProxyInterface::r#query(self)
11023    }
11024
11025    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
11026    pub fn r#deprecated_clone(
11027        &self,
11028        mut flags: OpenFlags,
11029        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11030    ) -> Result<(), fidl::Error> {
11031        NodeProxyInterface::r#deprecated_clone(self, flags, object)
11032    }
11033
11034    /// DEPRECATED - Use `Node.GetAttributes` instead.
11035    ///
11036    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11037    pub fn r#deprecated_get_attr(
11038        &self,
11039    ) -> fidl::client::QueryResponseFut<
11040        (i32, NodeAttributes),
11041        fdomain_client::fidl::FDomainResourceDialect,
11042    > {
11043        NodeProxyInterface::r#deprecated_get_attr(self)
11044    }
11045
11046    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
11047    pub fn r#deprecated_set_attr(
11048        &self,
11049        mut flags: NodeAttributeFlags,
11050        mut attributes: &NodeAttributes,
11051    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11052        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
11053    }
11054
11055    /// [DEPRECATED - Use new GetFlags method instead.]
11056    pub fn r#deprecated_get_flags(
11057        &self,
11058    ) -> fidl::client::QueryResponseFut<
11059        (i32, OpenFlags),
11060        fdomain_client::fidl::FDomainResourceDialect,
11061    > {
11062        NodeProxyInterface::r#deprecated_get_flags(self)
11063    }
11064
11065    /// [DEPRECATED - Use new SetFlags method instead.]
11066    pub fn r#deprecated_set_flags(
11067        &self,
11068        mut flags: OpenFlags,
11069    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11070        NodeProxyInterface::r#deprecated_set_flags(self, flags)
11071    }
11072
11073    /// Queries the flags that apply to this node after it has been opened/created. This method does
11074    /// not require any rights.
11075    ///
11076    /// Note that the final set of flags that apply to the connection may differ from those
11077    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
11078    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
11079    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
11080    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
11081    pub fn r#get_flags(
11082        &self,
11083    ) -> fidl::client::QueryResponseFut<
11084        NodeGetFlagsResult,
11085        fdomain_client::fidl::FDomainResourceDialect,
11086    > {
11087        NodeProxyInterface::r#get_flags(self)
11088    }
11089
11090    /// Sets the flags that apply to this node after it has been opened. This method does not
11091    /// require any rights.
11092    ///
11093    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
11094    /// clear append mode.
11095    ///
11096    /// Errors:
11097    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
11098    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
11099    pub fn r#set_flags(
11100        &self,
11101        mut flags: Flags,
11102    ) -> fidl::client::QueryResponseFut<
11103        NodeSetFlagsResult,
11104        fdomain_client::fidl::FDomainResourceDialect,
11105    > {
11106        NodeProxyInterface::r#set_flags(self, flags)
11107    }
11108
11109    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
11110    /// volume has different settings or the storage is accounted seperately from the rest of the
11111    /// filesystem that may be reported instead of filesystem-wide details.
11112    pub fn r#query_filesystem(
11113        &self,
11114    ) -> fidl::client::QueryResponseFut<
11115        (i32, Option<Box<FilesystemInfo>>),
11116        fdomain_client::fidl::FDomainResourceDialect,
11117    > {
11118        NodeProxyInterface::r#query_filesystem(self)
11119    }
11120
11121    /// Acquires information about the node.
11122    ///
11123    /// The attributes of a node should be stable, independent of the
11124    /// specific protocol used to access it.
11125    ///
11126    /// If a particular attribute is not applicable or not supported,
11127    /// filesystems should leave the corresponding field absent.
11128    ///
11129    /// + `query` a bit-mask specifying which attributes to fetch. The server
11130    ///   should not return more than necessary.
11131    /// - `attributes` the returned attributes.
11132    ///
11133    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11134    pub fn r#get_attributes(
11135        &self,
11136        mut query: NodeAttributesQuery,
11137    ) -> fidl::client::QueryResponseFut<
11138        NodeGetAttributesResult,
11139        fdomain_client::fidl::FDomainResourceDialect,
11140    > {
11141        NodeProxyInterface::r#get_attributes(self, query)
11142    }
11143
11144    /// Updates information about the node.
11145    ///
11146    /// + `attributes` the presence of a table field in `attributes` indicates
11147    /// the intent to update the corresponding attribute.
11148    ///
11149    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
11150    ///
11151    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11152    pub fn r#update_attributes(
11153        &self,
11154        mut payload: &MutableNodeAttributes,
11155    ) -> fidl::client::QueryResponseFut<
11156        NodeUpdateAttributesResult,
11157        fdomain_client::fidl::FDomainResourceDialect,
11158    > {
11159        NodeProxyInterface::r#update_attributes(self, payload)
11160    }
11161
11162    /// Synchronizes updates to the node to the underlying media, if it exists.
11163    ///
11164    /// This method will return when the filesystem server has flushed the
11165    /// relevant updates to the underlying media, but does not guarantee the
11166    /// underlying media has persisted the information, nor that any information
11167    /// is committed to hardware. Clients may use `Sync` to ensure ordering
11168    /// between operations.
11169    ///
11170    /// This method does not require any rights.
11171    pub fn r#sync(
11172        &self,
11173    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
11174    {
11175        NodeProxyInterface::r#sync(self)
11176    }
11177
11178    /// Creates an iterator over all the extended attribute names associated
11179    /// with this node. If an error occurs it is returned as an epitaph on the
11180    /// iterator request channel, and then the channel is closed.
11181    ///
11182    /// GetExtendedAttributes can be used with any of these names to retrieve
11183    /// the associated value.
11184    ///
11185    /// This method requires the [`Rights.READ_BYTES`] right.
11186    pub fn r#list_extended_attributes(
11187        &self,
11188        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11189    ) -> Result<(), fidl::Error> {
11190        NodeProxyInterface::r#list_extended_attributes(self, iterator)
11191    }
11192
11193    /// Get the value associated with the given attribute `name` for this node.
11194    ///
11195    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
11196    /// particular structure is imposed on them.
11197    ///
11198    /// This method requires the [`Rights.READ_BYTES`] right.
11199    pub fn r#get_extended_attribute(
11200        &self,
11201        mut name: &[u8],
11202    ) -> fidl::client::QueryResponseFut<
11203        NodeGetExtendedAttributeResult,
11204        fdomain_client::fidl::FDomainResourceDialect,
11205    > {
11206        NodeProxyInterface::r#get_extended_attribute(self, name)
11207    }
11208
11209    /// Set the value for the given attribute `name` to `value` for this node.
11210    ///
11211    /// The attribute name may exist, in which case the attribute is updated.
11212    /// If the attribute doesn't exist, it is created. The name should have no
11213    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
11214    ///
11215    /// This method requires the [`Rights.WRITE_BYTES`] right.
11216    pub fn r#set_extended_attribute(
11217        &self,
11218        mut name: &[u8],
11219        mut value: ExtendedAttributeValue,
11220        mut mode: SetExtendedAttributeMode,
11221    ) -> fidl::client::QueryResponseFut<
11222        NodeSetExtendedAttributeResult,
11223        fdomain_client::fidl::FDomainResourceDialect,
11224    > {
11225        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
11226    }
11227
11228    /// Remove the specified extended attribute.
11229    ///
11230    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
11231    ///
11232    /// This method requires the [`Rights.WRITE_BYTES`] right.
11233    pub fn r#remove_extended_attribute(
11234        &self,
11235        mut name: &[u8],
11236    ) -> fidl::client::QueryResponseFut<
11237        NodeRemoveExtendedAttributeResult,
11238        fdomain_client::fidl::FDomainResourceDialect,
11239    > {
11240        NodeProxyInterface::r#remove_extended_attribute(self, name)
11241    }
11242}
11243
11244impl NodeProxyInterface for NodeProxy {
11245    fn r#clone(
11246        &self,
11247        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11248    ) -> Result<(), fidl::Error> {
11249        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
11250            (request,),
11251            0x20d8a7aba2168a79,
11252            fidl::encoding::DynamicFlags::empty(),
11253        )
11254    }
11255
11256    type CloseResponseFut = fidl::client::QueryResponseFut<
11257        fdomain_fuchsia_unknown::CloseableCloseResult,
11258        fdomain_client::fidl::FDomainResourceDialect,
11259    >;
11260    fn r#close(&self) -> Self::CloseResponseFut {
11261        fn _decode(
11262            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11263        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
11264            let _response = fidl::client::decode_transaction_body::<
11265                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11266                fdomain_client::fidl::FDomainResourceDialect,
11267                0x5ac5d459ad7f657e,
11268            >(_buf?)?;
11269            Ok(_response.map(|x| x))
11270        }
11271        self.client.send_query_and_decode::<
11272            fidl::encoding::EmptyPayload,
11273            fdomain_fuchsia_unknown::CloseableCloseResult,
11274        >(
11275            (),
11276            0x5ac5d459ad7f657e,
11277            fidl::encoding::DynamicFlags::empty(),
11278            _decode,
11279        )
11280    }
11281
11282    type QueryResponseFut =
11283        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
11284    fn r#query(&self) -> Self::QueryResponseFut {
11285        fn _decode(
11286            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11287        ) -> Result<Vec<u8>, fidl::Error> {
11288            let _response = fidl::client::decode_transaction_body::<
11289                fdomain_fuchsia_unknown::QueryableQueryResponse,
11290                fdomain_client::fidl::FDomainResourceDialect,
11291                0x2658edee9decfc06,
11292            >(_buf?)?;
11293            Ok(_response.protocol)
11294        }
11295        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
11296            (),
11297            0x2658edee9decfc06,
11298            fidl::encoding::DynamicFlags::empty(),
11299            _decode,
11300        )
11301    }
11302
11303    fn r#deprecated_clone(
11304        &self,
11305        mut flags: OpenFlags,
11306        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11307    ) -> Result<(), fidl::Error> {
11308        self.client.send::<NodeDeprecatedCloneRequest>(
11309            (flags, object),
11310            0x5a61678f293ce16f,
11311            fidl::encoding::DynamicFlags::FLEXIBLE,
11312        )
11313    }
11314
11315    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
11316        (i32, NodeAttributes),
11317        fdomain_client::fidl::FDomainResourceDialect,
11318    >;
11319    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
11320        fn _decode(
11321            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11322        ) -> Result<(i32, NodeAttributes), fidl::Error> {
11323            let _response = fidl::client::decode_transaction_body::<
11324                NodeDeprecatedGetAttrResponse,
11325                fdomain_client::fidl::FDomainResourceDialect,
11326                0x78985e216314dafd,
11327            >(_buf?)?;
11328            Ok((_response.s, _response.attributes))
11329        }
11330        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
11331            (),
11332            0x78985e216314dafd,
11333            fidl::encoding::DynamicFlags::empty(),
11334            _decode,
11335        )
11336    }
11337
11338    type DeprecatedSetAttrResponseFut =
11339        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11340    fn r#deprecated_set_attr(
11341        &self,
11342        mut flags: NodeAttributeFlags,
11343        mut attributes: &NodeAttributes,
11344    ) -> Self::DeprecatedSetAttrResponseFut {
11345        fn _decode(
11346            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11347        ) -> Result<i32, fidl::Error> {
11348            let _response = fidl::client::decode_transaction_body::<
11349                NodeDeprecatedSetAttrResponse,
11350                fdomain_client::fidl::FDomainResourceDialect,
11351                0x4186c0f40d938f46,
11352            >(_buf?)?;
11353            Ok(_response.s)
11354        }
11355        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
11356            (flags, attributes),
11357            0x4186c0f40d938f46,
11358            fidl::encoding::DynamicFlags::empty(),
11359            _decode,
11360        )
11361    }
11362
11363    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
11364        (i32, OpenFlags),
11365        fdomain_client::fidl::FDomainResourceDialect,
11366    >;
11367    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
11368        fn _decode(
11369            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11370        ) -> Result<(i32, OpenFlags), fidl::Error> {
11371            let _response = fidl::client::decode_transaction_body::<
11372                NodeDeprecatedGetFlagsResponse,
11373                fdomain_client::fidl::FDomainResourceDialect,
11374                0x5b88fffb8eda3aa1,
11375            >(_buf?)?;
11376            Ok((_response.s, _response.flags))
11377        }
11378        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
11379            (),
11380            0x5b88fffb8eda3aa1,
11381            fidl::encoding::DynamicFlags::empty(),
11382            _decode,
11383        )
11384    }
11385
11386    type DeprecatedSetFlagsResponseFut =
11387        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11388    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
11389        fn _decode(
11390            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11391        ) -> Result<i32, fidl::Error> {
11392            let _response = fidl::client::decode_transaction_body::<
11393                NodeDeprecatedSetFlagsResponse,
11394                fdomain_client::fidl::FDomainResourceDialect,
11395                0x5295b76c71fde733,
11396            >(_buf?)?;
11397            Ok(_response.s)
11398        }
11399        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
11400            (flags,),
11401            0x5295b76c71fde733,
11402            fidl::encoding::DynamicFlags::empty(),
11403            _decode,
11404        )
11405    }
11406
11407    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
11408        NodeGetFlagsResult,
11409        fdomain_client::fidl::FDomainResourceDialect,
11410    >;
11411    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
11412        fn _decode(
11413            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11414        ) -> Result<NodeGetFlagsResult, fidl::Error> {
11415            let _response = fidl::client::decode_transaction_body::<
11416                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
11417                fdomain_client::fidl::FDomainResourceDialect,
11418                0x176eb318f64ec23,
11419            >(_buf?)?
11420            .into_result_fdomain::<NodeMarker>("get_flags")?;
11421            Ok(_response.map(|x| x.flags))
11422        }
11423        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
11424            (),
11425            0x176eb318f64ec23,
11426            fidl::encoding::DynamicFlags::FLEXIBLE,
11427            _decode,
11428        )
11429    }
11430
11431    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
11432        NodeSetFlagsResult,
11433        fdomain_client::fidl::FDomainResourceDialect,
11434    >;
11435    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
11436        fn _decode(
11437            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11438        ) -> Result<NodeSetFlagsResult, fidl::Error> {
11439            let _response = fidl::client::decode_transaction_body::<
11440                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
11441                fdomain_client::fidl::FDomainResourceDialect,
11442                0x55a8028685791ea8,
11443            >(_buf?)?
11444            .into_result_fdomain::<NodeMarker>("set_flags")?;
11445            Ok(_response.map(|x| x))
11446        }
11447        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
11448            (flags,),
11449            0x55a8028685791ea8,
11450            fidl::encoding::DynamicFlags::FLEXIBLE,
11451            _decode,
11452        )
11453    }
11454
11455    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
11456        (i32, Option<Box<FilesystemInfo>>),
11457        fdomain_client::fidl::FDomainResourceDialect,
11458    >;
11459    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
11460        fn _decode(
11461            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11462        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
11463            let _response = fidl::client::decode_transaction_body::<
11464                NodeQueryFilesystemResponse,
11465                fdomain_client::fidl::FDomainResourceDialect,
11466                0x6f344a1c6b0a0610,
11467            >(_buf?)?;
11468            Ok((_response.s, _response.info))
11469        }
11470        self.client.send_query_and_decode::<
11471            fidl::encoding::EmptyPayload,
11472            (i32, Option<Box<FilesystemInfo>>),
11473        >(
11474            (),
11475            0x6f344a1c6b0a0610,
11476            fidl::encoding::DynamicFlags::empty(),
11477            _decode,
11478        )
11479    }
11480
11481    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
11482        NodeGetAttributesResult,
11483        fdomain_client::fidl::FDomainResourceDialect,
11484    >;
11485    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
11486        fn _decode(
11487            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11488        ) -> Result<NodeGetAttributesResult, fidl::Error> {
11489            let _response = fidl::client::decode_transaction_body::<
11490                fidl::encoding::ResultType<NodeAttributes2, i32>,
11491                fdomain_client::fidl::FDomainResourceDialect,
11492                0x3d4396a638ea053b,
11493            >(_buf?)?;
11494            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
11495        }
11496        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
11497            (query,),
11498            0x3d4396a638ea053b,
11499            fidl::encoding::DynamicFlags::empty(),
11500            _decode,
11501        )
11502    }
11503
11504    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
11505        NodeUpdateAttributesResult,
11506        fdomain_client::fidl::FDomainResourceDialect,
11507    >;
11508    fn r#update_attributes(
11509        &self,
11510        mut payload: &MutableNodeAttributes,
11511    ) -> Self::UpdateAttributesResponseFut {
11512        fn _decode(
11513            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11514        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
11515            let _response = fidl::client::decode_transaction_body::<
11516                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11517                fdomain_client::fidl::FDomainResourceDialect,
11518                0x3308c1da5a89bf08,
11519            >(_buf?)?;
11520            Ok(_response.map(|x| x))
11521        }
11522        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
11523            payload,
11524            0x3308c1da5a89bf08,
11525            fidl::encoding::DynamicFlags::empty(),
11526            _decode,
11527        )
11528    }
11529
11530    type SyncResponseFut = fidl::client::QueryResponseFut<
11531        NodeSyncResult,
11532        fdomain_client::fidl::FDomainResourceDialect,
11533    >;
11534    fn r#sync(&self) -> Self::SyncResponseFut {
11535        fn _decode(
11536            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11537        ) -> Result<NodeSyncResult, fidl::Error> {
11538            let _response = fidl::client::decode_transaction_body::<
11539                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11540                fdomain_client::fidl::FDomainResourceDialect,
11541                0x2c5c27ca0ab5dc49,
11542            >(_buf?)?;
11543            Ok(_response.map(|x| x))
11544        }
11545        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
11546            (),
11547            0x2c5c27ca0ab5dc49,
11548            fidl::encoding::DynamicFlags::empty(),
11549            _decode,
11550        )
11551    }
11552
11553    fn r#list_extended_attributes(
11554        &self,
11555        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11556    ) -> Result<(), fidl::Error> {
11557        self.client.send::<NodeListExtendedAttributesRequest>(
11558            (iterator,),
11559            0x4b61033de007fcd0,
11560            fidl::encoding::DynamicFlags::empty(),
11561        )
11562    }
11563
11564    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11565        NodeGetExtendedAttributeResult,
11566        fdomain_client::fidl::FDomainResourceDialect,
11567    >;
11568    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
11569        fn _decode(
11570            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11571        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
11572            let _response = fidl::client::decode_transaction_body::<
11573                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
11574                fdomain_client::fidl::FDomainResourceDialect,
11575                0x45ffa3ccfdeb76db,
11576            >(_buf?)?;
11577            Ok(_response.map(|x| x))
11578        }
11579        self.client.send_query_and_decode::<
11580            NodeGetExtendedAttributeRequest,
11581            NodeGetExtendedAttributeResult,
11582        >(
11583            (name,),
11584            0x45ffa3ccfdeb76db,
11585            fidl::encoding::DynamicFlags::empty(),
11586            _decode,
11587        )
11588    }
11589
11590    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11591        NodeSetExtendedAttributeResult,
11592        fdomain_client::fidl::FDomainResourceDialect,
11593    >;
11594    fn r#set_extended_attribute(
11595        &self,
11596        mut name: &[u8],
11597        mut value: ExtendedAttributeValue,
11598        mut mode: SetExtendedAttributeMode,
11599    ) -> Self::SetExtendedAttributeResponseFut {
11600        fn _decode(
11601            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11602        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
11603            let _response = fidl::client::decode_transaction_body::<
11604                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11605                fdomain_client::fidl::FDomainResourceDialect,
11606                0x4a951362f681f23c,
11607            >(_buf?)?;
11608            Ok(_response.map(|x| x))
11609        }
11610        self.client.send_query_and_decode::<
11611            NodeSetExtendedAttributeRequest,
11612            NodeSetExtendedAttributeResult,
11613        >(
11614            (name, &mut value, mode,),
11615            0x4a951362f681f23c,
11616            fidl::encoding::DynamicFlags::empty(),
11617            _decode,
11618        )
11619    }
11620
11621    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11622        NodeRemoveExtendedAttributeResult,
11623        fdomain_client::fidl::FDomainResourceDialect,
11624    >;
11625    fn r#remove_extended_attribute(
11626        &self,
11627        mut name: &[u8],
11628    ) -> Self::RemoveExtendedAttributeResponseFut {
11629        fn _decode(
11630            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11631        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
11632            let _response = fidl::client::decode_transaction_body::<
11633                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11634                fdomain_client::fidl::FDomainResourceDialect,
11635                0x7a0b9f3a9bf9032d,
11636            >(_buf?)?;
11637            Ok(_response.map(|x| x))
11638        }
11639        self.client.send_query_and_decode::<
11640            NodeRemoveExtendedAttributeRequest,
11641            NodeRemoveExtendedAttributeResult,
11642        >(
11643            (name,),
11644            0x7a0b9f3a9bf9032d,
11645            fidl::encoding::DynamicFlags::empty(),
11646            _decode,
11647        )
11648    }
11649}
11650
11651pub struct NodeEventStream {
11652    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
11653}
11654
11655impl std::marker::Unpin for NodeEventStream {}
11656
11657impl futures::stream::FusedStream for NodeEventStream {
11658    fn is_terminated(&self) -> bool {
11659        self.event_receiver.is_terminated()
11660    }
11661}
11662
11663impl futures::Stream for NodeEventStream {
11664    type Item = Result<NodeEvent, fidl::Error>;
11665
11666    fn poll_next(
11667        mut self: std::pin::Pin<&mut Self>,
11668        cx: &mut std::task::Context<'_>,
11669    ) -> std::task::Poll<Option<Self::Item>> {
11670        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11671            &mut self.event_receiver,
11672            cx
11673        )?) {
11674            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
11675            None => std::task::Poll::Ready(None),
11676        }
11677    }
11678}
11679
11680#[derive(Debug)]
11681pub enum NodeEvent {
11682    OnOpen_ {
11683        s: i32,
11684        info: Option<Box<NodeInfoDeprecated>>,
11685    },
11686    OnRepresentation {
11687        payload: Representation,
11688    },
11689    #[non_exhaustive]
11690    _UnknownEvent {
11691        /// Ordinal of the event that was sent.
11692        ordinal: u64,
11693    },
11694}
11695
11696impl NodeEvent {
11697    #[allow(irrefutable_let_patterns)]
11698    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
11699        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
11700    }
11701    #[allow(irrefutable_let_patterns)]
11702    pub fn into_on_representation(self) -> Option<Representation> {
11703        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
11704    }
11705
11706    /// Decodes a message buffer as a [`NodeEvent`].
11707    fn decode(
11708        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11709    ) -> Result<NodeEvent, fidl::Error> {
11710        let (bytes, _handles) = buf.split_mut();
11711        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11712        debug_assert_eq!(tx_header.tx_id, 0);
11713        match tx_header.ordinal {
11714            0x7fc7bbb1dbfd1972 => {
11715                let mut out = fidl::new_empty!(
11716                    NodeOnOpenRequest,
11717                    fdomain_client::fidl::FDomainResourceDialect
11718                );
11719                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
11720                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
11721            }
11722            0x5cb40567d80a510c => {
11723                let mut out =
11724                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
11725                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
11726                Ok((NodeEvent::OnRepresentation { payload: out }))
11727            }
11728            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11729                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11730            }
11731            _ => Err(fidl::Error::UnknownOrdinal {
11732                ordinal: tx_header.ordinal,
11733                protocol_name: <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
11734            }),
11735        }
11736    }
11737}
11738
11739/// A Stream of incoming requests for fuchsia.io/Node.
11740pub struct NodeRequestStream {
11741    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11742    is_terminated: bool,
11743}
11744
11745impl std::marker::Unpin for NodeRequestStream {}
11746
11747impl futures::stream::FusedStream for NodeRequestStream {
11748    fn is_terminated(&self) -> bool {
11749        self.is_terminated
11750    }
11751}
11752
11753impl fdomain_client::fidl::RequestStream for NodeRequestStream {
11754    type Protocol = NodeMarker;
11755    type ControlHandle = NodeControlHandle;
11756
11757    fn from_channel(channel: fdomain_client::Channel) -> Self {
11758        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11759    }
11760
11761    fn control_handle(&self) -> Self::ControlHandle {
11762        NodeControlHandle { inner: self.inner.clone() }
11763    }
11764
11765    fn into_inner(
11766        self,
11767    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
11768    {
11769        (self.inner, self.is_terminated)
11770    }
11771
11772    fn from_inner(
11773        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11774        is_terminated: bool,
11775    ) -> Self {
11776        Self { inner, is_terminated }
11777    }
11778}
11779
11780impl futures::Stream for NodeRequestStream {
11781    type Item = Result<NodeRequest, fidl::Error>;
11782
11783    fn poll_next(
11784        mut self: std::pin::Pin<&mut Self>,
11785        cx: &mut std::task::Context<'_>,
11786    ) -> std::task::Poll<Option<Self::Item>> {
11787        let this = &mut *self;
11788        if this.inner.check_shutdown(cx) {
11789            this.is_terminated = true;
11790            return std::task::Poll::Ready(None);
11791        }
11792        if this.is_terminated {
11793            panic!("polled NodeRequestStream after completion");
11794        }
11795        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
11796            |bytes, handles| {
11797                match this.inner.channel().read_etc(cx, bytes, handles) {
11798                    std::task::Poll::Ready(Ok(())) => {}
11799                    std::task::Poll::Pending => return std::task::Poll::Pending,
11800                    std::task::Poll::Ready(Err(None)) => {
11801                        this.is_terminated = true;
11802                        return std::task::Poll::Ready(None);
11803                    }
11804                    std::task::Poll::Ready(Err(Some(e))) => {
11805                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11806                            e.into(),
11807                        ))));
11808                    }
11809                }
11810
11811                // A message has been received from the channel
11812                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11813
11814                std::task::Poll::Ready(Some(match header.ordinal {
11815                    0x20d8a7aba2168a79 => {
11816                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11817                        let mut req = fidl::new_empty!(
11818                            fdomain_fuchsia_unknown::CloneableCloneRequest,
11819                            fdomain_client::fidl::FDomainResourceDialect
11820                        );
11821                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11822                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11823                        Ok(NodeRequest::Clone { request: req.request, control_handle })
11824                    }
11825                    0x5ac5d459ad7f657e => {
11826                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11827                        let mut req = fidl::new_empty!(
11828                            fidl::encoding::EmptyPayload,
11829                            fdomain_client::fidl::FDomainResourceDialect
11830                        );
11831                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11832                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11833                        Ok(NodeRequest::Close {
11834                            responder: NodeCloseResponder {
11835                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11836                                tx_id: header.tx_id,
11837                            },
11838                        })
11839                    }
11840                    0x2658edee9decfc06 => {
11841                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11842                        let mut req = fidl::new_empty!(
11843                            fidl::encoding::EmptyPayload,
11844                            fdomain_client::fidl::FDomainResourceDialect
11845                        );
11846                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11847                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11848                        Ok(NodeRequest::Query {
11849                            responder: NodeQueryResponder {
11850                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11851                                tx_id: header.tx_id,
11852                            },
11853                        })
11854                    }
11855                    0x5a61678f293ce16f => {
11856                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11857                        let mut req = fidl::new_empty!(
11858                            NodeDeprecatedCloneRequest,
11859                            fdomain_client::fidl::FDomainResourceDialect
11860                        );
11861                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11862                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11863                        Ok(NodeRequest::DeprecatedClone {
11864                            flags: req.flags,
11865                            object: req.object,
11866
11867                            control_handle,
11868                        })
11869                    }
11870                    0x78985e216314dafd => {
11871                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11872                        let mut req = fidl::new_empty!(
11873                            fidl::encoding::EmptyPayload,
11874                            fdomain_client::fidl::FDomainResourceDialect
11875                        );
11876                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11877                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11878                        Ok(NodeRequest::DeprecatedGetAttr {
11879                            responder: NodeDeprecatedGetAttrResponder {
11880                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11881                                tx_id: header.tx_id,
11882                            },
11883                        })
11884                    }
11885                    0x4186c0f40d938f46 => {
11886                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11887                        let mut req = fidl::new_empty!(
11888                            NodeDeprecatedSetAttrRequest,
11889                            fdomain_client::fidl::FDomainResourceDialect
11890                        );
11891                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
11892                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11893                        Ok(NodeRequest::DeprecatedSetAttr {
11894                            flags: req.flags,
11895                            attributes: req.attributes,
11896
11897                            responder: NodeDeprecatedSetAttrResponder {
11898                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11899                                tx_id: header.tx_id,
11900                            },
11901                        })
11902                    }
11903                    0x5b88fffb8eda3aa1 => {
11904                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11905                        let mut req = fidl::new_empty!(
11906                            fidl::encoding::EmptyPayload,
11907                            fdomain_client::fidl::FDomainResourceDialect
11908                        );
11909                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11910                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11911                        Ok(NodeRequest::DeprecatedGetFlags {
11912                            responder: NodeDeprecatedGetFlagsResponder {
11913                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11914                                tx_id: header.tx_id,
11915                            },
11916                        })
11917                    }
11918                    0x5295b76c71fde733 => {
11919                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11920                        let mut req = fidl::new_empty!(
11921                            NodeDeprecatedSetFlagsRequest,
11922                            fdomain_client::fidl::FDomainResourceDialect
11923                        );
11924                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11925                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11926                        Ok(NodeRequest::DeprecatedSetFlags {
11927                            flags: req.flags,
11928
11929                            responder: NodeDeprecatedSetFlagsResponder {
11930                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11931                                tx_id: header.tx_id,
11932                            },
11933                        })
11934                    }
11935                    0x176eb318f64ec23 => {
11936                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11937                        let mut req = fidl::new_empty!(
11938                            fidl::encoding::EmptyPayload,
11939                            fdomain_client::fidl::FDomainResourceDialect
11940                        );
11941                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11942                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11943                        Ok(NodeRequest::GetFlags {
11944                            responder: NodeGetFlagsResponder {
11945                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11946                                tx_id: header.tx_id,
11947                            },
11948                        })
11949                    }
11950                    0x55a8028685791ea8 => {
11951                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11952                        let mut req = fidl::new_empty!(
11953                            NodeSetFlagsRequest,
11954                            fdomain_client::fidl::FDomainResourceDialect
11955                        );
11956                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11957                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11958                        Ok(NodeRequest::SetFlags {
11959                            flags: req.flags,
11960
11961                            responder: NodeSetFlagsResponder {
11962                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11963                                tx_id: header.tx_id,
11964                            },
11965                        })
11966                    }
11967                    0x6f344a1c6b0a0610 => {
11968                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11969                        let mut req = fidl::new_empty!(
11970                            fidl::encoding::EmptyPayload,
11971                            fdomain_client::fidl::FDomainResourceDialect
11972                        );
11973                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11974                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11975                        Ok(NodeRequest::QueryFilesystem {
11976                            responder: NodeQueryFilesystemResponder {
11977                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11978                                tx_id: header.tx_id,
11979                            },
11980                        })
11981                    }
11982                    0x3d4396a638ea053b => {
11983                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11984                        let mut req = fidl::new_empty!(
11985                            NodeGetAttributesRequest,
11986                            fdomain_client::fidl::FDomainResourceDialect
11987                        );
11988                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11989                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11990                        Ok(NodeRequest::GetAttributes {
11991                            query: req.query,
11992
11993                            responder: NodeGetAttributesResponder {
11994                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11995                                tx_id: header.tx_id,
11996                            },
11997                        })
11998                    }
11999                    0x3308c1da5a89bf08 => {
12000                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12001                        let mut req = fidl::new_empty!(
12002                            MutableNodeAttributes,
12003                            fdomain_client::fidl::FDomainResourceDialect
12004                        );
12005                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
12006                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12007                        Ok(NodeRequest::UpdateAttributes {
12008                            payload: req,
12009                            responder: NodeUpdateAttributesResponder {
12010                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12011                                tx_id: header.tx_id,
12012                            },
12013                        })
12014                    }
12015                    0x2c5c27ca0ab5dc49 => {
12016                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12017                        let mut req = fidl::new_empty!(
12018                            fidl::encoding::EmptyPayload,
12019                            fdomain_client::fidl::FDomainResourceDialect
12020                        );
12021                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
12022                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12023                        Ok(NodeRequest::Sync {
12024                            responder: NodeSyncResponder {
12025                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12026                                tx_id: header.tx_id,
12027                            },
12028                        })
12029                    }
12030                    0x4b61033de007fcd0 => {
12031                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12032                        let mut req = fidl::new_empty!(
12033                            NodeListExtendedAttributesRequest,
12034                            fdomain_client::fidl::FDomainResourceDialect
12035                        );
12036                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
12037                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12038                        Ok(NodeRequest::ListExtendedAttributes {
12039                            iterator: req.iterator,
12040
12041                            control_handle,
12042                        })
12043                    }
12044                    0x45ffa3ccfdeb76db => {
12045                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12046                        let mut req = fidl::new_empty!(
12047                            NodeGetExtendedAttributeRequest,
12048                            fdomain_client::fidl::FDomainResourceDialect
12049                        );
12050                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12051                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12052                        Ok(NodeRequest::GetExtendedAttribute {
12053                            name: req.name,
12054
12055                            responder: NodeGetExtendedAttributeResponder {
12056                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12057                                tx_id: header.tx_id,
12058                            },
12059                        })
12060                    }
12061                    0x4a951362f681f23c => {
12062                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12063                        let mut req = fidl::new_empty!(
12064                            NodeSetExtendedAttributeRequest,
12065                            fdomain_client::fidl::FDomainResourceDialect
12066                        );
12067                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12068                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12069                        Ok(NodeRequest::SetExtendedAttribute {
12070                            name: req.name,
12071                            value: req.value,
12072                            mode: req.mode,
12073
12074                            responder: NodeSetExtendedAttributeResponder {
12075                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12076                                tx_id: header.tx_id,
12077                            },
12078                        })
12079                    }
12080                    0x7a0b9f3a9bf9032d => {
12081                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12082                        let mut req = fidl::new_empty!(
12083                            NodeRemoveExtendedAttributeRequest,
12084                            fdomain_client::fidl::FDomainResourceDialect
12085                        );
12086                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12087                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12088                        Ok(NodeRequest::RemoveExtendedAttribute {
12089                            name: req.name,
12090
12091                            responder: NodeRemoveExtendedAttributeResponder {
12092                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12093                                tx_id: header.tx_id,
12094                            },
12095                        })
12096                    }
12097                    _ if header.tx_id == 0
12098                        && header
12099                            .dynamic_flags()
12100                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12101                    {
12102                        Ok(NodeRequest::_UnknownMethod {
12103                            ordinal: header.ordinal,
12104                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12105                            method_type: fidl::MethodType::OneWay,
12106                        })
12107                    }
12108                    _ if header
12109                        .dynamic_flags()
12110                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12111                    {
12112                        this.inner.send_framework_err(
12113                            fidl::encoding::FrameworkErr::UnknownMethod,
12114                            header.tx_id,
12115                            header.ordinal,
12116                            header.dynamic_flags(),
12117                            (bytes, handles),
12118                        )?;
12119                        Ok(NodeRequest::_UnknownMethod {
12120                            ordinal: header.ordinal,
12121                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12122                            method_type: fidl::MethodType::TwoWay,
12123                        })
12124                    }
12125                    _ => Err(fidl::Error::UnknownOrdinal {
12126                        ordinal: header.ordinal,
12127                        protocol_name:
12128                            <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
12129                    }),
12130                }))
12131            },
12132        )
12133    }
12134}
12135
12136/// Node defines the minimal interface for entities which can be accessed in a filesystem.
12137#[derive(Debug)]
12138pub enum NodeRequest {
12139    Clone {
12140        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12141        control_handle: NodeControlHandle,
12142    },
12143    /// Terminates the connection.
12144    ///
12145    /// After calling `Close`, the client must not send any other requests.
12146    ///
12147    /// Servers, after sending the status response, should close the connection
12148    /// regardless of status and without sending an epitaph.
12149    ///
12150    /// Closing the client end of the channel should be semantically equivalent
12151    /// to calling `Close` without knowing when the close has completed or its
12152    /// status.
12153    Close {
12154        responder: NodeCloseResponder,
12155    },
12156    Query {
12157        responder: NodeQueryResponder,
12158    },
12159    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12160    DeprecatedClone {
12161        flags: OpenFlags,
12162        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
12163        control_handle: NodeControlHandle,
12164    },
12165    /// DEPRECATED - Use `Node.GetAttributes` instead.
12166    ///
12167    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12168    DeprecatedGetAttr {
12169        responder: NodeDeprecatedGetAttrResponder,
12170    },
12171    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12172    DeprecatedSetAttr {
12173        flags: NodeAttributeFlags,
12174        attributes: NodeAttributes,
12175        responder: NodeDeprecatedSetAttrResponder,
12176    },
12177    /// [DEPRECATED - Use new GetFlags method instead.]
12178    DeprecatedGetFlags {
12179        responder: NodeDeprecatedGetFlagsResponder,
12180    },
12181    /// [DEPRECATED - Use new SetFlags method instead.]
12182    DeprecatedSetFlags {
12183        flags: OpenFlags,
12184        responder: NodeDeprecatedSetFlagsResponder,
12185    },
12186    /// Queries the flags that apply to this node after it has been opened/created. This method does
12187    /// not require any rights.
12188    ///
12189    /// Note that the final set of flags that apply to the connection may differ from those
12190    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
12191    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
12192    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
12193    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
12194    GetFlags {
12195        responder: NodeGetFlagsResponder,
12196    },
12197    /// Sets the flags that apply to this node after it has been opened. This method does not
12198    /// require any rights.
12199    ///
12200    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
12201    /// clear append mode.
12202    ///
12203    /// Errors:
12204    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
12205    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
12206    SetFlags {
12207        flags: Flags,
12208        responder: NodeSetFlagsResponder,
12209    },
12210    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
12211    /// volume has different settings or the storage is accounted seperately from the rest of the
12212    /// filesystem that may be reported instead of filesystem-wide details.
12213    QueryFilesystem {
12214        responder: NodeQueryFilesystemResponder,
12215    },
12216    /// Acquires information about the node.
12217    ///
12218    /// The attributes of a node should be stable, independent of the
12219    /// specific protocol used to access it.
12220    ///
12221    /// If a particular attribute is not applicable or not supported,
12222    /// filesystems should leave the corresponding field absent.
12223    ///
12224    /// + `query` a bit-mask specifying which attributes to fetch. The server
12225    ///   should not return more than necessary.
12226    /// - `attributes` the returned attributes.
12227    ///
12228    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12229    GetAttributes {
12230        query: NodeAttributesQuery,
12231        responder: NodeGetAttributesResponder,
12232    },
12233    /// Updates information about the node.
12234    ///
12235    /// + `attributes` the presence of a table field in `attributes` indicates
12236    /// the intent to update the corresponding attribute.
12237    ///
12238    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
12239    ///
12240    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12241    UpdateAttributes {
12242        payload: MutableNodeAttributes,
12243        responder: NodeUpdateAttributesResponder,
12244    },
12245    /// Synchronizes updates to the node to the underlying media, if it exists.
12246    ///
12247    /// This method will return when the filesystem server has flushed the
12248    /// relevant updates to the underlying media, but does not guarantee the
12249    /// underlying media has persisted the information, nor that any information
12250    /// is committed to hardware. Clients may use `Sync` to ensure ordering
12251    /// between operations.
12252    ///
12253    /// This method does not require any rights.
12254    Sync {
12255        responder: NodeSyncResponder,
12256    },
12257    /// Creates an iterator over all the extended attribute names associated
12258    /// with this node. If an error occurs it is returned as an epitaph on the
12259    /// iterator request channel, and then the channel is closed.
12260    ///
12261    /// GetExtendedAttributes can be used with any of these names to retrieve
12262    /// the associated value.
12263    ///
12264    /// This method requires the [`Rights.READ_BYTES`] right.
12265    ListExtendedAttributes {
12266        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
12267        control_handle: NodeControlHandle,
12268    },
12269    /// Get the value associated with the given attribute `name` for this node.
12270    ///
12271    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
12272    /// particular structure is imposed on them.
12273    ///
12274    /// This method requires the [`Rights.READ_BYTES`] right.
12275    GetExtendedAttribute {
12276        name: Vec<u8>,
12277        responder: NodeGetExtendedAttributeResponder,
12278    },
12279    /// Set the value for the given attribute `name` to `value` for this node.
12280    ///
12281    /// The attribute name may exist, in which case the attribute is updated.
12282    /// If the attribute doesn't exist, it is created. The name should have no
12283    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
12284    ///
12285    /// This method requires the [`Rights.WRITE_BYTES`] right.
12286    SetExtendedAttribute {
12287        name: Vec<u8>,
12288        value: ExtendedAttributeValue,
12289        mode: SetExtendedAttributeMode,
12290        responder: NodeSetExtendedAttributeResponder,
12291    },
12292    /// Remove the specified extended attribute.
12293    ///
12294    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
12295    ///
12296    /// This method requires the [`Rights.WRITE_BYTES`] right.
12297    RemoveExtendedAttribute {
12298        name: Vec<u8>,
12299        responder: NodeRemoveExtendedAttributeResponder,
12300    },
12301    /// An interaction was received which does not match any known method.
12302    #[non_exhaustive]
12303    _UnknownMethod {
12304        /// Ordinal of the method that was called.
12305        ordinal: u64,
12306        control_handle: NodeControlHandle,
12307        method_type: fidl::MethodType,
12308    },
12309}
12310
12311impl NodeRequest {
12312    #[allow(irrefutable_let_patterns)]
12313    pub fn into_clone(
12314        self,
12315    ) -> Option<(
12316        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12317        NodeControlHandle,
12318    )> {
12319        if let NodeRequest::Clone { request, control_handle } = self {
12320            Some((request, control_handle))
12321        } else {
12322            None
12323        }
12324    }
12325
12326    #[allow(irrefutable_let_patterns)]
12327    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
12328        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
12329    }
12330
12331    #[allow(irrefutable_let_patterns)]
12332    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
12333        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
12334    }
12335
12336    #[allow(irrefutable_let_patterns)]
12337    pub fn into_deprecated_clone(
12338        self,
12339    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, NodeControlHandle)> {
12340        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
12341            Some((flags, object, control_handle))
12342        } else {
12343            None
12344        }
12345    }
12346
12347    #[allow(irrefutable_let_patterns)]
12348    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
12349        if let NodeRequest::DeprecatedGetAttr { responder } = self {
12350            Some((responder))
12351        } else {
12352            None
12353        }
12354    }
12355
12356    #[allow(irrefutable_let_patterns)]
12357    pub fn into_deprecated_set_attr(
12358        self,
12359    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
12360        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
12361            Some((flags, attributes, responder))
12362        } else {
12363            None
12364        }
12365    }
12366
12367    #[allow(irrefutable_let_patterns)]
12368    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
12369        if let NodeRequest::DeprecatedGetFlags { responder } = self {
12370            Some((responder))
12371        } else {
12372            None
12373        }
12374    }
12375
12376    #[allow(irrefutable_let_patterns)]
12377    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
12378        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
12379            Some((flags, responder))
12380        } else {
12381            None
12382        }
12383    }
12384
12385    #[allow(irrefutable_let_patterns)]
12386    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
12387        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
12388    }
12389
12390    #[allow(irrefutable_let_patterns)]
12391    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
12392        if let NodeRequest::SetFlags { flags, responder } = self {
12393            Some((flags, responder))
12394        } else {
12395            None
12396        }
12397    }
12398
12399    #[allow(irrefutable_let_patterns)]
12400    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
12401        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
12402    }
12403
12404    #[allow(irrefutable_let_patterns)]
12405    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
12406        if let NodeRequest::GetAttributes { query, responder } = self {
12407            Some((query, responder))
12408        } else {
12409            None
12410        }
12411    }
12412
12413    #[allow(irrefutable_let_patterns)]
12414    pub fn into_update_attributes(
12415        self,
12416    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
12417        if let NodeRequest::UpdateAttributes { payload, responder } = self {
12418            Some((payload, responder))
12419        } else {
12420            None
12421        }
12422    }
12423
12424    #[allow(irrefutable_let_patterns)]
12425    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
12426        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
12427    }
12428
12429    #[allow(irrefutable_let_patterns)]
12430    pub fn into_list_extended_attributes(
12431        self,
12432    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
12433    {
12434        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
12435            Some((iterator, control_handle))
12436        } else {
12437            None
12438        }
12439    }
12440
12441    #[allow(irrefutable_let_patterns)]
12442    pub fn into_get_extended_attribute(
12443        self,
12444    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
12445        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
12446            Some((name, responder))
12447        } else {
12448            None
12449        }
12450    }
12451
12452    #[allow(irrefutable_let_patterns)]
12453    pub fn into_set_extended_attribute(
12454        self,
12455    ) -> Option<(
12456        Vec<u8>,
12457        ExtendedAttributeValue,
12458        SetExtendedAttributeMode,
12459        NodeSetExtendedAttributeResponder,
12460    )> {
12461        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
12462            Some((name, value, mode, responder))
12463        } else {
12464            None
12465        }
12466    }
12467
12468    #[allow(irrefutable_let_patterns)]
12469    pub fn into_remove_extended_attribute(
12470        self,
12471    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
12472        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
12473            Some((name, responder))
12474        } else {
12475            None
12476        }
12477    }
12478
12479    /// Name of the method defined in FIDL
12480    pub fn method_name(&self) -> &'static str {
12481        match *self {
12482            NodeRequest::Clone { .. } => "clone",
12483            NodeRequest::Close { .. } => "close",
12484            NodeRequest::Query { .. } => "query",
12485            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
12486            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
12487            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
12488            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
12489            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
12490            NodeRequest::GetFlags { .. } => "get_flags",
12491            NodeRequest::SetFlags { .. } => "set_flags",
12492            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
12493            NodeRequest::GetAttributes { .. } => "get_attributes",
12494            NodeRequest::UpdateAttributes { .. } => "update_attributes",
12495            NodeRequest::Sync { .. } => "sync",
12496            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
12497            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
12498            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
12499            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
12500            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12501                "unknown one-way method"
12502            }
12503            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12504                "unknown two-way method"
12505            }
12506        }
12507    }
12508}
12509
12510#[derive(Debug, Clone)]
12511pub struct NodeControlHandle {
12512    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
12513}
12514
12515impl NodeControlHandle {
12516    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12517        self.inner.shutdown_with_epitaph(status.into())
12518    }
12519}
12520
12521impl fdomain_client::fidl::ControlHandle for NodeControlHandle {
12522    fn shutdown(&self) {
12523        self.inner.shutdown()
12524    }
12525
12526    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12527        self.inner.shutdown_with_epitaph(status)
12528    }
12529
12530    fn is_closed(&self) -> bool {
12531        self.inner.channel().is_closed()
12532    }
12533    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
12534        self.inner.channel().on_closed()
12535    }
12536}
12537
12538impl NodeControlHandle {
12539    pub fn send_on_open_(
12540        &self,
12541        mut s: i32,
12542        mut info: Option<NodeInfoDeprecated>,
12543    ) -> Result<(), fidl::Error> {
12544        self.inner.send::<NodeOnOpenRequest>(
12545            (s, info.as_mut()),
12546            0,
12547            0x7fc7bbb1dbfd1972,
12548            fidl::encoding::DynamicFlags::FLEXIBLE,
12549        )
12550    }
12551
12552    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
12553        self.inner.send::<Representation>(
12554            &mut payload,
12555            0,
12556            0x5cb40567d80a510c,
12557            fidl::encoding::DynamicFlags::empty(),
12558        )
12559    }
12560}
12561
12562#[must_use = "FIDL methods require a response to be sent"]
12563#[derive(Debug)]
12564pub struct NodeCloseResponder {
12565    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12566    tx_id: u32,
12567}
12568
12569/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12570/// if the responder is dropped without sending a response, so that the client
12571/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12572impl std::ops::Drop for NodeCloseResponder {
12573    fn drop(&mut self) {
12574        self.control_handle.shutdown();
12575        // Safety: drops once, never accessed again
12576        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12577    }
12578}
12579
12580impl fdomain_client::fidl::Responder for NodeCloseResponder {
12581    type ControlHandle = NodeControlHandle;
12582
12583    fn control_handle(&self) -> &NodeControlHandle {
12584        &self.control_handle
12585    }
12586
12587    fn drop_without_shutdown(mut self) {
12588        // Safety: drops once, never accessed again due to mem::forget
12589        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12590        // Prevent Drop from running (which would shut down the channel)
12591        std::mem::forget(self);
12592    }
12593}
12594
12595impl NodeCloseResponder {
12596    /// Sends a response to the FIDL transaction.
12597    ///
12598    /// Sets the channel to shutdown if an error occurs.
12599    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12600        let _result = self.send_raw(result);
12601        if _result.is_err() {
12602            self.control_handle.shutdown();
12603        }
12604        self.drop_without_shutdown();
12605        _result
12606    }
12607
12608    /// Similar to "send" but does not shutdown the channel if an error occurs.
12609    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12610        let _result = self.send_raw(result);
12611        self.drop_without_shutdown();
12612        _result
12613    }
12614
12615    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12616        self.control_handle
12617            .inner
12618            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12619                result,
12620                self.tx_id,
12621                0x5ac5d459ad7f657e,
12622                fidl::encoding::DynamicFlags::empty(),
12623            )
12624    }
12625}
12626
12627#[must_use = "FIDL methods require a response to be sent"]
12628#[derive(Debug)]
12629pub struct NodeQueryResponder {
12630    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12631    tx_id: u32,
12632}
12633
12634/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12635/// if the responder is dropped without sending a response, so that the client
12636/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12637impl std::ops::Drop for NodeQueryResponder {
12638    fn drop(&mut self) {
12639        self.control_handle.shutdown();
12640        // Safety: drops once, never accessed again
12641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12642    }
12643}
12644
12645impl fdomain_client::fidl::Responder for NodeQueryResponder {
12646    type ControlHandle = NodeControlHandle;
12647
12648    fn control_handle(&self) -> &NodeControlHandle {
12649        &self.control_handle
12650    }
12651
12652    fn drop_without_shutdown(mut self) {
12653        // Safety: drops once, never accessed again due to mem::forget
12654        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12655        // Prevent Drop from running (which would shut down the channel)
12656        std::mem::forget(self);
12657    }
12658}
12659
12660impl NodeQueryResponder {
12661    /// Sends a response to the FIDL transaction.
12662    ///
12663    /// Sets the channel to shutdown if an error occurs.
12664    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12665        let _result = self.send_raw(protocol);
12666        if _result.is_err() {
12667            self.control_handle.shutdown();
12668        }
12669        self.drop_without_shutdown();
12670        _result
12671    }
12672
12673    /// Similar to "send" but does not shutdown the channel if an error occurs.
12674    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12675        let _result = self.send_raw(protocol);
12676        self.drop_without_shutdown();
12677        _result
12678    }
12679
12680    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12681        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
12682            (protocol,),
12683            self.tx_id,
12684            0x2658edee9decfc06,
12685            fidl::encoding::DynamicFlags::empty(),
12686        )
12687    }
12688}
12689
12690#[must_use = "FIDL methods require a response to be sent"]
12691#[derive(Debug)]
12692pub struct NodeDeprecatedGetAttrResponder {
12693    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12694    tx_id: u32,
12695}
12696
12697/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12698/// if the responder is dropped without sending a response, so that the client
12699/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12700impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
12701    fn drop(&mut self) {
12702        self.control_handle.shutdown();
12703        // Safety: drops once, never accessed again
12704        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12705    }
12706}
12707
12708impl fdomain_client::fidl::Responder for NodeDeprecatedGetAttrResponder {
12709    type ControlHandle = NodeControlHandle;
12710
12711    fn control_handle(&self) -> &NodeControlHandle {
12712        &self.control_handle
12713    }
12714
12715    fn drop_without_shutdown(mut self) {
12716        // Safety: drops once, never accessed again due to mem::forget
12717        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12718        // Prevent Drop from running (which would shut down the channel)
12719        std::mem::forget(self);
12720    }
12721}
12722
12723impl NodeDeprecatedGetAttrResponder {
12724    /// Sends a response to the FIDL transaction.
12725    ///
12726    /// Sets the channel to shutdown if an error occurs.
12727    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12728        let _result = self.send_raw(s, attributes);
12729        if _result.is_err() {
12730            self.control_handle.shutdown();
12731        }
12732        self.drop_without_shutdown();
12733        _result
12734    }
12735
12736    /// Similar to "send" but does not shutdown the channel if an error occurs.
12737    pub fn send_no_shutdown_on_err(
12738        self,
12739        mut s: i32,
12740        mut attributes: &NodeAttributes,
12741    ) -> Result<(), fidl::Error> {
12742        let _result = self.send_raw(s, attributes);
12743        self.drop_without_shutdown();
12744        _result
12745    }
12746
12747    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12748        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
12749            (s, attributes),
12750            self.tx_id,
12751            0x78985e216314dafd,
12752            fidl::encoding::DynamicFlags::empty(),
12753        )
12754    }
12755}
12756
12757#[must_use = "FIDL methods require a response to be sent"]
12758#[derive(Debug)]
12759pub struct NodeDeprecatedSetAttrResponder {
12760    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12761    tx_id: u32,
12762}
12763
12764/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12765/// if the responder is dropped without sending a response, so that the client
12766/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12767impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
12768    fn drop(&mut self) {
12769        self.control_handle.shutdown();
12770        // Safety: drops once, never accessed again
12771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12772    }
12773}
12774
12775impl fdomain_client::fidl::Responder for NodeDeprecatedSetAttrResponder {
12776    type ControlHandle = NodeControlHandle;
12777
12778    fn control_handle(&self) -> &NodeControlHandle {
12779        &self.control_handle
12780    }
12781
12782    fn drop_without_shutdown(mut self) {
12783        // Safety: drops once, never accessed again due to mem::forget
12784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12785        // Prevent Drop from running (which would shut down the channel)
12786        std::mem::forget(self);
12787    }
12788}
12789
12790impl NodeDeprecatedSetAttrResponder {
12791    /// Sends a response to the FIDL transaction.
12792    ///
12793    /// Sets the channel to shutdown if an error occurs.
12794    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12795        let _result = self.send_raw(s);
12796        if _result.is_err() {
12797            self.control_handle.shutdown();
12798        }
12799        self.drop_without_shutdown();
12800        _result
12801    }
12802
12803    /// Similar to "send" but does not shutdown the channel if an error occurs.
12804    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12805        let _result = self.send_raw(s);
12806        self.drop_without_shutdown();
12807        _result
12808    }
12809
12810    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12811        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
12812            (s,),
12813            self.tx_id,
12814            0x4186c0f40d938f46,
12815            fidl::encoding::DynamicFlags::empty(),
12816        )
12817    }
12818}
12819
12820#[must_use = "FIDL methods require a response to be sent"]
12821#[derive(Debug)]
12822pub struct NodeDeprecatedGetFlagsResponder {
12823    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12824    tx_id: u32,
12825}
12826
12827/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12828/// if the responder is dropped without sending a response, so that the client
12829/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12830impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
12831    fn drop(&mut self) {
12832        self.control_handle.shutdown();
12833        // Safety: drops once, never accessed again
12834        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12835    }
12836}
12837
12838impl fdomain_client::fidl::Responder for NodeDeprecatedGetFlagsResponder {
12839    type ControlHandle = NodeControlHandle;
12840
12841    fn control_handle(&self) -> &NodeControlHandle {
12842        &self.control_handle
12843    }
12844
12845    fn drop_without_shutdown(mut self) {
12846        // Safety: drops once, never accessed again due to mem::forget
12847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12848        // Prevent Drop from running (which would shut down the channel)
12849        std::mem::forget(self);
12850    }
12851}
12852
12853impl NodeDeprecatedGetFlagsResponder {
12854    /// Sends a response to the FIDL transaction.
12855    ///
12856    /// Sets the channel to shutdown if an error occurs.
12857    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12858        let _result = self.send_raw(s, flags);
12859        if _result.is_err() {
12860            self.control_handle.shutdown();
12861        }
12862        self.drop_without_shutdown();
12863        _result
12864    }
12865
12866    /// Similar to "send" but does not shutdown the channel if an error occurs.
12867    pub fn send_no_shutdown_on_err(
12868        self,
12869        mut s: i32,
12870        mut flags: OpenFlags,
12871    ) -> Result<(), fidl::Error> {
12872        let _result = self.send_raw(s, flags);
12873        self.drop_without_shutdown();
12874        _result
12875    }
12876
12877    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12878        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
12879            (s, flags),
12880            self.tx_id,
12881            0x5b88fffb8eda3aa1,
12882            fidl::encoding::DynamicFlags::empty(),
12883        )
12884    }
12885}
12886
12887#[must_use = "FIDL methods require a response to be sent"]
12888#[derive(Debug)]
12889pub struct NodeDeprecatedSetFlagsResponder {
12890    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12891    tx_id: u32,
12892}
12893
12894/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12895/// if the responder is dropped without sending a response, so that the client
12896/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12897impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
12898    fn drop(&mut self) {
12899        self.control_handle.shutdown();
12900        // Safety: drops once, never accessed again
12901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12902    }
12903}
12904
12905impl fdomain_client::fidl::Responder for NodeDeprecatedSetFlagsResponder {
12906    type ControlHandle = NodeControlHandle;
12907
12908    fn control_handle(&self) -> &NodeControlHandle {
12909        &self.control_handle
12910    }
12911
12912    fn drop_without_shutdown(mut self) {
12913        // Safety: drops once, never accessed again due to mem::forget
12914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12915        // Prevent Drop from running (which would shut down the channel)
12916        std::mem::forget(self);
12917    }
12918}
12919
12920impl NodeDeprecatedSetFlagsResponder {
12921    /// Sends a response to the FIDL transaction.
12922    ///
12923    /// Sets the channel to shutdown if an error occurs.
12924    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12925        let _result = self.send_raw(s);
12926        if _result.is_err() {
12927            self.control_handle.shutdown();
12928        }
12929        self.drop_without_shutdown();
12930        _result
12931    }
12932
12933    /// Similar to "send" but does not shutdown the channel if an error occurs.
12934    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12935        let _result = self.send_raw(s);
12936        self.drop_without_shutdown();
12937        _result
12938    }
12939
12940    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12941        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
12942            (s,),
12943            self.tx_id,
12944            0x5295b76c71fde733,
12945            fidl::encoding::DynamicFlags::empty(),
12946        )
12947    }
12948}
12949
12950#[must_use = "FIDL methods require a response to be sent"]
12951#[derive(Debug)]
12952pub struct NodeGetFlagsResponder {
12953    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12954    tx_id: u32,
12955}
12956
12957/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12958/// if the responder is dropped without sending a response, so that the client
12959/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12960impl std::ops::Drop for NodeGetFlagsResponder {
12961    fn drop(&mut self) {
12962        self.control_handle.shutdown();
12963        // Safety: drops once, never accessed again
12964        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12965    }
12966}
12967
12968impl fdomain_client::fidl::Responder for NodeGetFlagsResponder {
12969    type ControlHandle = NodeControlHandle;
12970
12971    fn control_handle(&self) -> &NodeControlHandle {
12972        &self.control_handle
12973    }
12974
12975    fn drop_without_shutdown(mut self) {
12976        // Safety: drops once, never accessed again due to mem::forget
12977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12978        // Prevent Drop from running (which would shut down the channel)
12979        std::mem::forget(self);
12980    }
12981}
12982
12983impl NodeGetFlagsResponder {
12984    /// Sends a response to the FIDL transaction.
12985    ///
12986    /// Sets the channel to shutdown if an error occurs.
12987    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12988        let _result = self.send_raw(result);
12989        if _result.is_err() {
12990            self.control_handle.shutdown();
12991        }
12992        self.drop_without_shutdown();
12993        _result
12994    }
12995
12996    /// Similar to "send" but does not shutdown the channel if an error occurs.
12997    pub fn send_no_shutdown_on_err(
12998        self,
12999        mut result: Result<Flags, i32>,
13000    ) -> Result<(), fidl::Error> {
13001        let _result = self.send_raw(result);
13002        self.drop_without_shutdown();
13003        _result
13004    }
13005
13006    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
13007        self.control_handle
13008            .inner
13009            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
13010                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
13011                self.tx_id,
13012                0x176eb318f64ec23,
13013                fidl::encoding::DynamicFlags::FLEXIBLE,
13014            )
13015    }
13016}
13017
13018#[must_use = "FIDL methods require a response to be sent"]
13019#[derive(Debug)]
13020pub struct NodeSetFlagsResponder {
13021    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13022    tx_id: u32,
13023}
13024
13025/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13026/// if the responder is dropped without sending a response, so that the client
13027/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13028impl std::ops::Drop for NodeSetFlagsResponder {
13029    fn drop(&mut self) {
13030        self.control_handle.shutdown();
13031        // Safety: drops once, never accessed again
13032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13033    }
13034}
13035
13036impl fdomain_client::fidl::Responder for NodeSetFlagsResponder {
13037    type ControlHandle = NodeControlHandle;
13038
13039    fn control_handle(&self) -> &NodeControlHandle {
13040        &self.control_handle
13041    }
13042
13043    fn drop_without_shutdown(mut self) {
13044        // Safety: drops once, never accessed again due to mem::forget
13045        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13046        // Prevent Drop from running (which would shut down the channel)
13047        std::mem::forget(self);
13048    }
13049}
13050
13051impl NodeSetFlagsResponder {
13052    /// Sends a response to the FIDL transaction.
13053    ///
13054    /// Sets the channel to shutdown if an error occurs.
13055    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13056        let _result = self.send_raw(result);
13057        if _result.is_err() {
13058            self.control_handle.shutdown();
13059        }
13060        self.drop_without_shutdown();
13061        _result
13062    }
13063
13064    /// Similar to "send" but does not shutdown the channel if an error occurs.
13065    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13066        let _result = self.send_raw(result);
13067        self.drop_without_shutdown();
13068        _result
13069    }
13070
13071    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13072        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
13073            fidl::encoding::EmptyStruct,
13074            i32,
13075        >>(
13076            fidl::encoding::FlexibleResult::new(result),
13077            self.tx_id,
13078            0x55a8028685791ea8,
13079            fidl::encoding::DynamicFlags::FLEXIBLE,
13080        )
13081    }
13082}
13083
13084#[must_use = "FIDL methods require a response to be sent"]
13085#[derive(Debug)]
13086pub struct NodeQueryFilesystemResponder {
13087    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13088    tx_id: u32,
13089}
13090
13091/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13092/// if the responder is dropped without sending a response, so that the client
13093/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13094impl std::ops::Drop for NodeQueryFilesystemResponder {
13095    fn drop(&mut self) {
13096        self.control_handle.shutdown();
13097        // Safety: drops once, never accessed again
13098        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13099    }
13100}
13101
13102impl fdomain_client::fidl::Responder for NodeQueryFilesystemResponder {
13103    type ControlHandle = NodeControlHandle;
13104
13105    fn control_handle(&self) -> &NodeControlHandle {
13106        &self.control_handle
13107    }
13108
13109    fn drop_without_shutdown(mut self) {
13110        // Safety: drops once, never accessed again due to mem::forget
13111        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13112        // Prevent Drop from running (which would shut down the channel)
13113        std::mem::forget(self);
13114    }
13115}
13116
13117impl NodeQueryFilesystemResponder {
13118    /// Sends a response to the FIDL transaction.
13119    ///
13120    /// Sets the channel to shutdown if an error occurs.
13121    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13122        let _result = self.send_raw(s, info);
13123        if _result.is_err() {
13124            self.control_handle.shutdown();
13125        }
13126        self.drop_without_shutdown();
13127        _result
13128    }
13129
13130    /// Similar to "send" but does not shutdown the channel if an error occurs.
13131    pub fn send_no_shutdown_on_err(
13132        self,
13133        mut s: i32,
13134        mut info: Option<&FilesystemInfo>,
13135    ) -> Result<(), fidl::Error> {
13136        let _result = self.send_raw(s, info);
13137        self.drop_without_shutdown();
13138        _result
13139    }
13140
13141    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13142        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
13143            (s, info),
13144            self.tx_id,
13145            0x6f344a1c6b0a0610,
13146            fidl::encoding::DynamicFlags::empty(),
13147        )
13148    }
13149}
13150
13151#[must_use = "FIDL methods require a response to be sent"]
13152#[derive(Debug)]
13153pub struct NodeGetAttributesResponder {
13154    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13155    tx_id: u32,
13156}
13157
13158/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13159/// if the responder is dropped without sending a response, so that the client
13160/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13161impl std::ops::Drop for NodeGetAttributesResponder {
13162    fn drop(&mut self) {
13163        self.control_handle.shutdown();
13164        // Safety: drops once, never accessed again
13165        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13166    }
13167}
13168
13169impl fdomain_client::fidl::Responder for NodeGetAttributesResponder {
13170    type ControlHandle = NodeControlHandle;
13171
13172    fn control_handle(&self) -> &NodeControlHandle {
13173        &self.control_handle
13174    }
13175
13176    fn drop_without_shutdown(mut self) {
13177        // Safety: drops once, never accessed again due to mem::forget
13178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13179        // Prevent Drop from running (which would shut down the channel)
13180        std::mem::forget(self);
13181    }
13182}
13183
13184impl NodeGetAttributesResponder {
13185    /// Sends a response to the FIDL transaction.
13186    ///
13187    /// Sets the channel to shutdown if an error occurs.
13188    pub fn send(
13189        self,
13190        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13191    ) -> Result<(), fidl::Error> {
13192        let _result = self.send_raw(result);
13193        if _result.is_err() {
13194            self.control_handle.shutdown();
13195        }
13196        self.drop_without_shutdown();
13197        _result
13198    }
13199
13200    /// Similar to "send" but does not shutdown the channel if an error occurs.
13201    pub fn send_no_shutdown_on_err(
13202        self,
13203        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13204    ) -> Result<(), fidl::Error> {
13205        let _result = self.send_raw(result);
13206        self.drop_without_shutdown();
13207        _result
13208    }
13209
13210    fn send_raw(
13211        &self,
13212        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13213    ) -> Result<(), fidl::Error> {
13214        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
13215            result,
13216            self.tx_id,
13217            0x3d4396a638ea053b,
13218            fidl::encoding::DynamicFlags::empty(),
13219        )
13220    }
13221}
13222
13223#[must_use = "FIDL methods require a response to be sent"]
13224#[derive(Debug)]
13225pub struct NodeUpdateAttributesResponder {
13226    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13227    tx_id: u32,
13228}
13229
13230/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13231/// if the responder is dropped without sending a response, so that the client
13232/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13233impl std::ops::Drop for NodeUpdateAttributesResponder {
13234    fn drop(&mut self) {
13235        self.control_handle.shutdown();
13236        // Safety: drops once, never accessed again
13237        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13238    }
13239}
13240
13241impl fdomain_client::fidl::Responder for NodeUpdateAttributesResponder {
13242    type ControlHandle = NodeControlHandle;
13243
13244    fn control_handle(&self) -> &NodeControlHandle {
13245        &self.control_handle
13246    }
13247
13248    fn drop_without_shutdown(mut self) {
13249        // Safety: drops once, never accessed again due to mem::forget
13250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13251        // Prevent Drop from running (which would shut down the channel)
13252        std::mem::forget(self);
13253    }
13254}
13255
13256impl NodeUpdateAttributesResponder {
13257    /// Sends a response to the FIDL transaction.
13258    ///
13259    /// Sets the channel to shutdown if an error occurs.
13260    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13261        let _result = self.send_raw(result);
13262        if _result.is_err() {
13263            self.control_handle.shutdown();
13264        }
13265        self.drop_without_shutdown();
13266        _result
13267    }
13268
13269    /// Similar to "send" but does not shutdown the channel if an error occurs.
13270    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13271        let _result = self.send_raw(result);
13272        self.drop_without_shutdown();
13273        _result
13274    }
13275
13276    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13277        self.control_handle
13278            .inner
13279            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13280                result,
13281                self.tx_id,
13282                0x3308c1da5a89bf08,
13283                fidl::encoding::DynamicFlags::empty(),
13284            )
13285    }
13286}
13287
13288#[must_use = "FIDL methods require a response to be sent"]
13289#[derive(Debug)]
13290pub struct NodeSyncResponder {
13291    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13292    tx_id: u32,
13293}
13294
13295/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13296/// if the responder is dropped without sending a response, so that the client
13297/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13298impl std::ops::Drop for NodeSyncResponder {
13299    fn drop(&mut self) {
13300        self.control_handle.shutdown();
13301        // Safety: drops once, never accessed again
13302        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13303    }
13304}
13305
13306impl fdomain_client::fidl::Responder for NodeSyncResponder {
13307    type ControlHandle = NodeControlHandle;
13308
13309    fn control_handle(&self) -> &NodeControlHandle {
13310        &self.control_handle
13311    }
13312
13313    fn drop_without_shutdown(mut self) {
13314        // Safety: drops once, never accessed again due to mem::forget
13315        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13316        // Prevent Drop from running (which would shut down the channel)
13317        std::mem::forget(self);
13318    }
13319}
13320
13321impl NodeSyncResponder {
13322    /// Sends a response to the FIDL transaction.
13323    ///
13324    /// Sets the channel to shutdown if an error occurs.
13325    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13326        let _result = self.send_raw(result);
13327        if _result.is_err() {
13328            self.control_handle.shutdown();
13329        }
13330        self.drop_without_shutdown();
13331        _result
13332    }
13333
13334    /// Similar to "send" but does not shutdown the channel if an error occurs.
13335    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13336        let _result = self.send_raw(result);
13337        self.drop_without_shutdown();
13338        _result
13339    }
13340
13341    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13342        self.control_handle
13343            .inner
13344            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13345                result,
13346                self.tx_id,
13347                0x2c5c27ca0ab5dc49,
13348                fidl::encoding::DynamicFlags::empty(),
13349            )
13350    }
13351}
13352
13353#[must_use = "FIDL methods require a response to be sent"]
13354#[derive(Debug)]
13355pub struct NodeGetExtendedAttributeResponder {
13356    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13357    tx_id: u32,
13358}
13359
13360/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13361/// if the responder is dropped without sending a response, so that the client
13362/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13363impl std::ops::Drop for NodeGetExtendedAttributeResponder {
13364    fn drop(&mut self) {
13365        self.control_handle.shutdown();
13366        // Safety: drops once, never accessed again
13367        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13368    }
13369}
13370
13371impl fdomain_client::fidl::Responder for NodeGetExtendedAttributeResponder {
13372    type ControlHandle = NodeControlHandle;
13373
13374    fn control_handle(&self) -> &NodeControlHandle {
13375        &self.control_handle
13376    }
13377
13378    fn drop_without_shutdown(mut self) {
13379        // Safety: drops once, never accessed again due to mem::forget
13380        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13381        // Prevent Drop from running (which would shut down the channel)
13382        std::mem::forget(self);
13383    }
13384}
13385
13386impl NodeGetExtendedAttributeResponder {
13387    /// Sends a response to the FIDL transaction.
13388    ///
13389    /// Sets the channel to shutdown if an error occurs.
13390    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13391        let _result = self.send_raw(result);
13392        if _result.is_err() {
13393            self.control_handle.shutdown();
13394        }
13395        self.drop_without_shutdown();
13396        _result
13397    }
13398
13399    /// Similar to "send" but does not shutdown the channel if an error occurs.
13400    pub fn send_no_shutdown_on_err(
13401        self,
13402        mut result: Result<ExtendedAttributeValue, i32>,
13403    ) -> Result<(), fidl::Error> {
13404        let _result = self.send_raw(result);
13405        self.drop_without_shutdown();
13406        _result
13407    }
13408
13409    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13410        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
13411            result.as_mut().map_err(|e| *e),
13412            self.tx_id,
13413            0x45ffa3ccfdeb76db,
13414            fidl::encoding::DynamicFlags::empty(),
13415        )
13416    }
13417}
13418
13419#[must_use = "FIDL methods require a response to be sent"]
13420#[derive(Debug)]
13421pub struct NodeSetExtendedAttributeResponder {
13422    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13423    tx_id: u32,
13424}
13425
13426/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13427/// if the responder is dropped without sending a response, so that the client
13428/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13429impl std::ops::Drop for NodeSetExtendedAttributeResponder {
13430    fn drop(&mut self) {
13431        self.control_handle.shutdown();
13432        // Safety: drops once, never accessed again
13433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13434    }
13435}
13436
13437impl fdomain_client::fidl::Responder for NodeSetExtendedAttributeResponder {
13438    type ControlHandle = NodeControlHandle;
13439
13440    fn control_handle(&self) -> &NodeControlHandle {
13441        &self.control_handle
13442    }
13443
13444    fn drop_without_shutdown(mut self) {
13445        // Safety: drops once, never accessed again due to mem::forget
13446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13447        // Prevent Drop from running (which would shut down the channel)
13448        std::mem::forget(self);
13449    }
13450}
13451
13452impl NodeSetExtendedAttributeResponder {
13453    /// Sends a response to the FIDL transaction.
13454    ///
13455    /// Sets the channel to shutdown if an error occurs.
13456    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13457        let _result = self.send_raw(result);
13458        if _result.is_err() {
13459            self.control_handle.shutdown();
13460        }
13461        self.drop_without_shutdown();
13462        _result
13463    }
13464
13465    /// Similar to "send" but does not shutdown the channel if an error occurs.
13466    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13467        let _result = self.send_raw(result);
13468        self.drop_without_shutdown();
13469        _result
13470    }
13471
13472    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13473        self.control_handle
13474            .inner
13475            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13476                result,
13477                self.tx_id,
13478                0x4a951362f681f23c,
13479                fidl::encoding::DynamicFlags::empty(),
13480            )
13481    }
13482}
13483
13484#[must_use = "FIDL methods require a response to be sent"]
13485#[derive(Debug)]
13486pub struct NodeRemoveExtendedAttributeResponder {
13487    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13488    tx_id: u32,
13489}
13490
13491/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13492/// if the responder is dropped without sending a response, so that the client
13493/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13494impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
13495    fn drop(&mut self) {
13496        self.control_handle.shutdown();
13497        // Safety: drops once, never accessed again
13498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13499    }
13500}
13501
13502impl fdomain_client::fidl::Responder for NodeRemoveExtendedAttributeResponder {
13503    type ControlHandle = NodeControlHandle;
13504
13505    fn control_handle(&self) -> &NodeControlHandle {
13506        &self.control_handle
13507    }
13508
13509    fn drop_without_shutdown(mut self) {
13510        // Safety: drops once, never accessed again due to mem::forget
13511        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13512        // Prevent Drop from running (which would shut down the channel)
13513        std::mem::forget(self);
13514    }
13515}
13516
13517impl NodeRemoveExtendedAttributeResponder {
13518    /// Sends a response to the FIDL transaction.
13519    ///
13520    /// Sets the channel to shutdown if an error occurs.
13521    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13522        let _result = self.send_raw(result);
13523        if _result.is_err() {
13524            self.control_handle.shutdown();
13525        }
13526        self.drop_without_shutdown();
13527        _result
13528    }
13529
13530    /// Similar to "send" but does not shutdown the channel if an error occurs.
13531    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13532        let _result = self.send_raw(result);
13533        self.drop_without_shutdown();
13534        _result
13535    }
13536
13537    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13538        self.control_handle
13539            .inner
13540            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13541                result,
13542                self.tx_id,
13543                0x7a0b9f3a9bf9032d,
13544                fidl::encoding::DynamicFlags::empty(),
13545            )
13546    }
13547}
13548
13549#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13550pub struct OpenableMarker;
13551
13552impl fdomain_client::fidl::ProtocolMarker for OpenableMarker {
13553    type Proxy = OpenableProxy;
13554    type RequestStream = OpenableRequestStream;
13555
13556    const DEBUG_NAME: &'static str = "(anonymous) Openable";
13557}
13558
13559pub trait OpenableProxyInterface: Send + Sync {
13560    fn r#open(
13561        &self,
13562        path: &str,
13563        flags: Flags,
13564        options: &Options,
13565        object: fdomain_client::Channel,
13566    ) -> Result<(), fidl::Error>;
13567}
13568
13569#[derive(Debug, Clone)]
13570pub struct OpenableProxy {
13571    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13572}
13573
13574impl fdomain_client::fidl::Proxy for OpenableProxy {
13575    type Protocol = OpenableMarker;
13576
13577    fn from_channel(inner: fdomain_client::Channel) -> Self {
13578        Self::new(inner)
13579    }
13580
13581    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13582        self.client.into_channel().map_err(|client| Self { client })
13583    }
13584
13585    fn as_channel(&self) -> &fdomain_client::Channel {
13586        self.client.as_channel()
13587    }
13588}
13589
13590impl OpenableProxy {
13591    /// Create a new Proxy for fuchsia.io/Openable.
13592    pub fn new(channel: fdomain_client::Channel) -> Self {
13593        let protocol_name = <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13594        Self { client: fidl::client::Client::new(channel, protocol_name) }
13595    }
13596
13597    /// Get a Stream of events from the remote end of the protocol.
13598    ///
13599    /// # Panics
13600    ///
13601    /// Panics if the event stream was already taken.
13602    pub fn take_event_stream(&self) -> OpenableEventStream {
13603        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
13604    }
13605
13606    /// Open (or create) a node relative to this directory. Any errors are communicated via an
13607    /// epitaph sent on the `object` channel.
13608    ///
13609    /// Errors:
13610    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
13611    /// * See [`Flags`] for other errors which may be communicated based on `flags`
13612    pub fn r#open(
13613        &self,
13614        mut path: &str,
13615        mut flags: Flags,
13616        mut options: &Options,
13617        mut object: fdomain_client::Channel,
13618    ) -> Result<(), fidl::Error> {
13619        OpenableProxyInterface::r#open(self, path, flags, options, object)
13620    }
13621}
13622
13623impl OpenableProxyInterface for OpenableProxy {
13624    fn r#open(
13625        &self,
13626        mut path: &str,
13627        mut flags: Flags,
13628        mut options: &Options,
13629        mut object: fdomain_client::Channel,
13630    ) -> Result<(), fidl::Error> {
13631        self.client.send::<OpenableOpenRequest>(
13632            (path, flags, options, object),
13633            0x568ddcb9a9cbb6d9,
13634            fidl::encoding::DynamicFlags::FLEXIBLE,
13635        )
13636    }
13637}
13638
13639pub struct OpenableEventStream {
13640    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
13641}
13642
13643impl std::marker::Unpin for OpenableEventStream {}
13644
13645impl futures::stream::FusedStream for OpenableEventStream {
13646    fn is_terminated(&self) -> bool {
13647        self.event_receiver.is_terminated()
13648    }
13649}
13650
13651impl futures::Stream for OpenableEventStream {
13652    type Item = Result<OpenableEvent, fidl::Error>;
13653
13654    fn poll_next(
13655        mut self: std::pin::Pin<&mut Self>,
13656        cx: &mut std::task::Context<'_>,
13657    ) -> std::task::Poll<Option<Self::Item>> {
13658        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13659            &mut self.event_receiver,
13660            cx
13661        )?) {
13662            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
13663            None => std::task::Poll::Ready(None),
13664        }
13665    }
13666}
13667
13668#[derive(Debug)]
13669pub enum OpenableEvent {
13670    #[non_exhaustive]
13671    _UnknownEvent {
13672        /// Ordinal of the event that was sent.
13673        ordinal: u64,
13674    },
13675}
13676
13677impl OpenableEvent {
13678    /// Decodes a message buffer as a [`OpenableEvent`].
13679    fn decode(
13680        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13681    ) -> Result<OpenableEvent, fidl::Error> {
13682        let (bytes, _handles) = buf.split_mut();
13683        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13684        debug_assert_eq!(tx_header.tx_id, 0);
13685        match tx_header.ordinal {
13686            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13687                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
13688            }
13689            _ => Err(fidl::Error::UnknownOrdinal {
13690                ordinal: tx_header.ordinal,
13691                protocol_name: <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13692            }),
13693        }
13694    }
13695}
13696
13697/// A Stream of incoming requests for fuchsia.io/Openable.
13698pub struct OpenableRequestStream {
13699    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13700    is_terminated: bool,
13701}
13702
13703impl std::marker::Unpin for OpenableRequestStream {}
13704
13705impl futures::stream::FusedStream for OpenableRequestStream {
13706    fn is_terminated(&self) -> bool {
13707        self.is_terminated
13708    }
13709}
13710
13711impl fdomain_client::fidl::RequestStream for OpenableRequestStream {
13712    type Protocol = OpenableMarker;
13713    type ControlHandle = OpenableControlHandle;
13714
13715    fn from_channel(channel: fdomain_client::Channel) -> Self {
13716        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13717    }
13718
13719    fn control_handle(&self) -> Self::ControlHandle {
13720        OpenableControlHandle { inner: self.inner.clone() }
13721    }
13722
13723    fn into_inner(
13724        self,
13725    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
13726    {
13727        (self.inner, self.is_terminated)
13728    }
13729
13730    fn from_inner(
13731        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13732        is_terminated: bool,
13733    ) -> Self {
13734        Self { inner, is_terminated }
13735    }
13736}
13737
13738impl futures::Stream for OpenableRequestStream {
13739    type Item = Result<OpenableRequest, fidl::Error>;
13740
13741    fn poll_next(
13742        mut self: std::pin::Pin<&mut Self>,
13743        cx: &mut std::task::Context<'_>,
13744    ) -> std::task::Poll<Option<Self::Item>> {
13745        let this = &mut *self;
13746        if this.inner.check_shutdown(cx) {
13747            this.is_terminated = true;
13748            return std::task::Poll::Ready(None);
13749        }
13750        if this.is_terminated {
13751            panic!("polled OpenableRequestStream after completion");
13752        }
13753        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
13754            |bytes, handles| {
13755                match this.inner.channel().read_etc(cx, bytes, handles) {
13756                    std::task::Poll::Ready(Ok(())) => {}
13757                    std::task::Poll::Pending => return std::task::Poll::Pending,
13758                    std::task::Poll::Ready(Err(None)) => {
13759                        this.is_terminated = true;
13760                        return std::task::Poll::Ready(None);
13761                    }
13762                    std::task::Poll::Ready(Err(Some(e))) => {
13763                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13764                            e.into(),
13765                        ))));
13766                    }
13767                }
13768
13769                // A message has been received from the channel
13770                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13771
13772                std::task::Poll::Ready(Some(match header.ordinal {
13773                    0x568ddcb9a9cbb6d9 => {
13774                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
13775                        let mut req = fidl::new_empty!(
13776                            OpenableOpenRequest,
13777                            fdomain_client::fidl::FDomainResourceDialect
13778                        );
13779                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
13780                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
13781                        Ok(OpenableRequest::Open {
13782                            path: req.path,
13783                            flags: req.flags,
13784                            options: req.options,
13785                            object: req.object,
13786
13787                            control_handle,
13788                        })
13789                    }
13790                    _ if header.tx_id == 0
13791                        && header
13792                            .dynamic_flags()
13793                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
13794                    {
13795                        Ok(OpenableRequest::_UnknownMethod {
13796                            ordinal: header.ordinal,
13797                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
13798                            method_type: fidl::MethodType::OneWay,
13799                        })
13800                    }
13801                    _ if header
13802                        .dynamic_flags()
13803                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
13804                    {
13805                        this.inner.send_framework_err(
13806                            fidl::encoding::FrameworkErr::UnknownMethod,
13807                            header.tx_id,
13808                            header.ordinal,
13809                            header.dynamic_flags(),
13810                            (bytes, handles),
13811                        )?;
13812                        Ok(OpenableRequest::_UnknownMethod {
13813                            ordinal: header.ordinal,
13814                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
13815                            method_type: fidl::MethodType::TwoWay,
13816                        })
13817                    }
13818                    _ => Err(fidl::Error::UnknownOrdinal {
13819                        ordinal: header.ordinal,
13820                        protocol_name:
13821                            <OpenableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13822                    }),
13823                }))
13824            },
13825        )
13826    }
13827}
13828
13829/// Openable defines a node which is capable of opening other objects.
13830#[derive(Debug)]
13831pub enum OpenableRequest {
13832    /// Open (or create) a node relative to this directory. Any errors are communicated via an
13833    /// epitaph sent on the `object` channel.
13834    ///
13835    /// Errors:
13836    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
13837    /// * See [`Flags`] for other errors which may be communicated based on `flags`
13838    Open {
13839        path: String,
13840        flags: Flags,
13841        options: Options,
13842        object: fdomain_client::Channel,
13843        control_handle: OpenableControlHandle,
13844    },
13845    /// An interaction was received which does not match any known method.
13846    #[non_exhaustive]
13847    _UnknownMethod {
13848        /// Ordinal of the method that was called.
13849        ordinal: u64,
13850        control_handle: OpenableControlHandle,
13851        method_type: fidl::MethodType,
13852    },
13853}
13854
13855impl OpenableRequest {
13856    #[allow(irrefutable_let_patterns)]
13857    pub fn into_open(
13858        self,
13859    ) -> Option<(String, Flags, Options, fdomain_client::Channel, OpenableControlHandle)> {
13860        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
13861            Some((path, flags, options, object, control_handle))
13862        } else {
13863            None
13864        }
13865    }
13866
13867    /// Name of the method defined in FIDL
13868    pub fn method_name(&self) -> &'static str {
13869        match *self {
13870            OpenableRequest::Open { .. } => "open",
13871            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
13872                "unknown one-way method"
13873            }
13874            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
13875                "unknown two-way method"
13876            }
13877        }
13878    }
13879}
13880
13881#[derive(Debug, Clone)]
13882pub struct OpenableControlHandle {
13883    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13884}
13885
13886impl OpenableControlHandle {
13887    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
13888        self.inner.shutdown_with_epitaph(status.into())
13889    }
13890}
13891
13892impl fdomain_client::fidl::ControlHandle for OpenableControlHandle {
13893    fn shutdown(&self) {
13894        self.inner.shutdown()
13895    }
13896
13897    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
13898        self.inner.shutdown_with_epitaph(status)
13899    }
13900
13901    fn is_closed(&self) -> bool {
13902        self.inner.channel().is_closed()
13903    }
13904    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
13905        self.inner.channel().on_closed()
13906    }
13907}
13908
13909impl OpenableControlHandle {}
13910
13911#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13912pub struct ReadableMarker;
13913
13914impl fdomain_client::fidl::ProtocolMarker for ReadableMarker {
13915    type Proxy = ReadableProxy;
13916    type RequestStream = ReadableRequestStream;
13917
13918    const DEBUG_NAME: &'static str = "(anonymous) Readable";
13919}
13920pub type ReadableReadResult = Result<Vec<u8>, i32>;
13921
13922pub trait ReadableProxyInterface: Send + Sync {
13923    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
13924        + Send;
13925    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
13926}
13927
13928#[derive(Debug, Clone)]
13929pub struct ReadableProxy {
13930    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13931}
13932
13933impl fdomain_client::fidl::Proxy for ReadableProxy {
13934    type Protocol = ReadableMarker;
13935
13936    fn from_channel(inner: fdomain_client::Channel) -> Self {
13937        Self::new(inner)
13938    }
13939
13940    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13941        self.client.into_channel().map_err(|client| Self { client })
13942    }
13943
13944    fn as_channel(&self) -> &fdomain_client::Channel {
13945        self.client.as_channel()
13946    }
13947}
13948
13949impl ReadableProxy {
13950    /// Create a new Proxy for fuchsia.io/Readable.
13951    pub fn new(channel: fdomain_client::Channel) -> Self {
13952        let protocol_name = <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13953        Self { client: fidl::client::Client::new(channel, protocol_name) }
13954    }
13955
13956    /// Get a Stream of events from the remote end of the protocol.
13957    ///
13958    /// # Panics
13959    ///
13960    /// Panics if the event stream was already taken.
13961    pub fn take_event_stream(&self) -> ReadableEventStream {
13962        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
13963    }
13964
13965    /// Reads up to 'count' bytes at the seek offset.
13966    /// The seek offset is moved forward by the number of bytes read.
13967    ///
13968    /// ## Invariants
13969    ///
13970    /// * The returned `data.length` will never be greater than `count`.
13971    /// * If `data.length` is less than `count`, it means that the seek offset
13972    ///   has reached the end of file as part of this operation.
13973    /// * If `data.length` is zero while `count` is not, it means that the
13974    ///   seek offset is already at or beyond the end of file, and no data could
13975    ///   be read.
13976    /// * If `count` is zero, the server should perform all the checks ensuring
13977    ///   read access without actually read anything, and return an empty
13978    ///   `data` vector.
13979    ///
13980    /// This method requires the [`Rights.READ_BYTES`] right.
13981    ///
13982    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13983    pub fn r#read(
13984        &self,
13985        mut count: u64,
13986    ) -> fidl::client::QueryResponseFut<
13987        ReadableReadResult,
13988        fdomain_client::fidl::FDomainResourceDialect,
13989    > {
13990        ReadableProxyInterface::r#read(self, count)
13991    }
13992}
13993
13994impl ReadableProxyInterface for ReadableProxy {
13995    type ReadResponseFut = fidl::client::QueryResponseFut<
13996        ReadableReadResult,
13997        fdomain_client::fidl::FDomainResourceDialect,
13998    >;
13999    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
14000        fn _decode(
14001            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14002        ) -> Result<ReadableReadResult, fidl::Error> {
14003            let _response = fidl::client::decode_transaction_body::<
14004                fidl::encoding::ResultType<ReadableReadResponse, i32>,
14005                fdomain_client::fidl::FDomainResourceDialect,
14006                0x57e419a298c8ede,
14007            >(_buf?)?;
14008            Ok(_response.map(|x| x.data))
14009        }
14010        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
14011            (count,),
14012            0x57e419a298c8ede,
14013            fidl::encoding::DynamicFlags::empty(),
14014            _decode,
14015        )
14016    }
14017}
14018
14019pub struct ReadableEventStream {
14020    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
14021}
14022
14023impl std::marker::Unpin for ReadableEventStream {}
14024
14025impl futures::stream::FusedStream for ReadableEventStream {
14026    fn is_terminated(&self) -> bool {
14027        self.event_receiver.is_terminated()
14028    }
14029}
14030
14031impl futures::Stream for ReadableEventStream {
14032    type Item = Result<ReadableEvent, fidl::Error>;
14033
14034    fn poll_next(
14035        mut self: std::pin::Pin<&mut Self>,
14036        cx: &mut std::task::Context<'_>,
14037    ) -> std::task::Poll<Option<Self::Item>> {
14038        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14039            &mut self.event_receiver,
14040            cx
14041        )?) {
14042            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
14043            None => std::task::Poll::Ready(None),
14044        }
14045    }
14046}
14047
14048#[derive(Debug)]
14049pub enum ReadableEvent {}
14050
14051impl ReadableEvent {
14052    /// Decodes a message buffer as a [`ReadableEvent`].
14053    fn decode(
14054        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14055    ) -> Result<ReadableEvent, fidl::Error> {
14056        let (bytes, _handles) = buf.split_mut();
14057        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14058        debug_assert_eq!(tx_header.tx_id, 0);
14059        match tx_header.ordinal {
14060            _ => Err(fidl::Error::UnknownOrdinal {
14061                ordinal: tx_header.ordinal,
14062                protocol_name: <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14063            }),
14064        }
14065    }
14066}
14067
14068/// A Stream of incoming requests for fuchsia.io/Readable.
14069pub struct ReadableRequestStream {
14070    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14071    is_terminated: bool,
14072}
14073
14074impl std::marker::Unpin for ReadableRequestStream {}
14075
14076impl futures::stream::FusedStream for ReadableRequestStream {
14077    fn is_terminated(&self) -> bool {
14078        self.is_terminated
14079    }
14080}
14081
14082impl fdomain_client::fidl::RequestStream for ReadableRequestStream {
14083    type Protocol = ReadableMarker;
14084    type ControlHandle = ReadableControlHandle;
14085
14086    fn from_channel(channel: fdomain_client::Channel) -> Self {
14087        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14088    }
14089
14090    fn control_handle(&self) -> Self::ControlHandle {
14091        ReadableControlHandle { inner: self.inner.clone() }
14092    }
14093
14094    fn into_inner(
14095        self,
14096    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
14097    {
14098        (self.inner, self.is_terminated)
14099    }
14100
14101    fn from_inner(
14102        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14103        is_terminated: bool,
14104    ) -> Self {
14105        Self { inner, is_terminated }
14106    }
14107}
14108
14109impl futures::Stream for ReadableRequestStream {
14110    type Item = Result<ReadableRequest, fidl::Error>;
14111
14112    fn poll_next(
14113        mut self: std::pin::Pin<&mut Self>,
14114        cx: &mut std::task::Context<'_>,
14115    ) -> std::task::Poll<Option<Self::Item>> {
14116        let this = &mut *self;
14117        if this.inner.check_shutdown(cx) {
14118            this.is_terminated = true;
14119            return std::task::Poll::Ready(None);
14120        }
14121        if this.is_terminated {
14122            panic!("polled ReadableRequestStream after completion");
14123        }
14124        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14125            |bytes, handles| {
14126                match this.inner.channel().read_etc(cx, bytes, handles) {
14127                    std::task::Poll::Ready(Ok(())) => {}
14128                    std::task::Poll::Pending => return std::task::Poll::Pending,
14129                    std::task::Poll::Ready(Err(None)) => {
14130                        this.is_terminated = true;
14131                        return std::task::Poll::Ready(None);
14132                    }
14133                    std::task::Poll::Ready(Err(Some(e))) => {
14134                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14135                            e.into(),
14136                        ))));
14137                    }
14138                }
14139
14140                // A message has been received from the channel
14141                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14142
14143                std::task::Poll::Ready(Some(match header.ordinal {
14144                    0x57e419a298c8ede => {
14145                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14146                        let mut req = fidl::new_empty!(
14147                            ReadableReadRequest,
14148                            fdomain_client::fidl::FDomainResourceDialect
14149                        );
14150                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
14151                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
14152                        Ok(ReadableRequest::Read {
14153                            count: req.count,
14154
14155                            responder: ReadableReadResponder {
14156                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14157                                tx_id: header.tx_id,
14158                            },
14159                        })
14160                    }
14161                    _ => Err(fidl::Error::UnknownOrdinal {
14162                        ordinal: header.ordinal,
14163                        protocol_name:
14164                            <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14165                    }),
14166                }))
14167            },
14168        )
14169    }
14170}
14171
14172#[derive(Debug)]
14173pub enum ReadableRequest {
14174    /// Reads up to 'count' bytes at the seek offset.
14175    /// The seek offset is moved forward by the number of bytes read.
14176    ///
14177    /// ## Invariants
14178    ///
14179    /// * The returned `data.length` will never be greater than `count`.
14180    /// * If `data.length` is less than `count`, it means that the seek offset
14181    ///   has reached the end of file as part of this operation.
14182    /// * If `data.length` is zero while `count` is not, it means that the
14183    ///   seek offset is already at or beyond the end of file, and no data could
14184    ///   be read.
14185    /// * If `count` is zero, the server should perform all the checks ensuring
14186    ///   read access without actually read anything, and return an empty
14187    ///   `data` vector.
14188    ///
14189    /// This method requires the [`Rights.READ_BYTES`] right.
14190    ///
14191    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
14192    Read { count: u64, responder: ReadableReadResponder },
14193}
14194
14195impl ReadableRequest {
14196    #[allow(irrefutable_let_patterns)]
14197    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
14198        if let ReadableRequest::Read { count, responder } = self {
14199            Some((count, responder))
14200        } else {
14201            None
14202        }
14203    }
14204
14205    /// Name of the method defined in FIDL
14206    pub fn method_name(&self) -> &'static str {
14207        match *self {
14208            ReadableRequest::Read { .. } => "read",
14209        }
14210    }
14211}
14212
14213#[derive(Debug, Clone)]
14214pub struct ReadableControlHandle {
14215    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14216}
14217
14218impl ReadableControlHandle {
14219    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
14220        self.inner.shutdown_with_epitaph(status.into())
14221    }
14222}
14223
14224impl fdomain_client::fidl::ControlHandle for ReadableControlHandle {
14225    fn shutdown(&self) {
14226        self.inner.shutdown()
14227    }
14228
14229    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
14230        self.inner.shutdown_with_epitaph(status)
14231    }
14232
14233    fn is_closed(&self) -> bool {
14234        self.inner.channel().is_closed()
14235    }
14236    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
14237        self.inner.channel().on_closed()
14238    }
14239}
14240
14241impl ReadableControlHandle {}
14242
14243#[must_use = "FIDL methods require a response to be sent"]
14244#[derive(Debug)]
14245pub struct ReadableReadResponder {
14246    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
14247    tx_id: u32,
14248}
14249
14250/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
14251/// if the responder is dropped without sending a response, so that the client
14252/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
14253impl std::ops::Drop for ReadableReadResponder {
14254    fn drop(&mut self) {
14255        self.control_handle.shutdown();
14256        // Safety: drops once, never accessed again
14257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14258    }
14259}
14260
14261impl fdomain_client::fidl::Responder for ReadableReadResponder {
14262    type ControlHandle = ReadableControlHandle;
14263
14264    fn control_handle(&self) -> &ReadableControlHandle {
14265        &self.control_handle
14266    }
14267
14268    fn drop_without_shutdown(mut self) {
14269        // Safety: drops once, never accessed again due to mem::forget
14270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
14271        // Prevent Drop from running (which would shut down the channel)
14272        std::mem::forget(self);
14273    }
14274}
14275
14276impl ReadableReadResponder {
14277    /// Sends a response to the FIDL transaction.
14278    ///
14279    /// Sets the channel to shutdown if an error occurs.
14280    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14281        let _result = self.send_raw(result);
14282        if _result.is_err() {
14283            self.control_handle.shutdown();
14284        }
14285        self.drop_without_shutdown();
14286        _result
14287    }
14288
14289    /// Similar to "send" but does not shutdown the channel if an error occurs.
14290    pub fn send_no_shutdown_on_err(
14291        self,
14292        mut result: Result<&[u8], i32>,
14293    ) -> Result<(), fidl::Error> {
14294        let _result = self.send_raw(result);
14295        self.drop_without_shutdown();
14296        _result
14297    }
14298
14299    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
14300        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
14301            result.map(|data| (data,)),
14302            self.tx_id,
14303            0x57e419a298c8ede,
14304            fidl::encoding::DynamicFlags::empty(),
14305        )
14306    }
14307}
14308
14309#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
14310pub struct SymlinkMarker;
14311
14312impl fdomain_client::fidl::ProtocolMarker for SymlinkMarker {
14313    type Proxy = SymlinkProxy;
14314    type RequestStream = SymlinkRequestStream;
14315
14316    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
14317}
14318impl fdomain_client::fidl::DiscoverableProtocolMarker for SymlinkMarker {}
14319
14320pub trait SymlinkProxyInterface: Send + Sync {
14321    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
14322        + Send;
14323    fn r#link_into(
14324        &self,
14325        dst_parent_token: fdomain_client::Event,
14326        dst: &str,
14327    ) -> Self::LinkIntoResponseFut;
14328    fn r#clone(
14329        &self,
14330        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14331    ) -> Result<(), fidl::Error>;
14332    type CloseResponseFut: std::future::Future<
14333            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
14334        > + Send;
14335    fn r#close(&self) -> Self::CloseResponseFut;
14336    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
14337    fn r#query(&self) -> Self::QueryResponseFut;
14338    fn r#deprecated_clone(
14339        &self,
14340        flags: OpenFlags,
14341        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14342    ) -> Result<(), fidl::Error>;
14343    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
14344        + Send;
14345    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
14346    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
14347    fn r#deprecated_set_attr(
14348        &self,
14349        flags: NodeAttributeFlags,
14350        attributes: &NodeAttributes,
14351    ) -> Self::DeprecatedSetAttrResponseFut;
14352    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
14353        + Send;
14354    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
14355    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
14356        + Send;
14357    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
14358    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
14359        + Send;
14360    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
14361    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
14362        + Send;
14363    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
14364    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
14365        + Send;
14366    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
14367    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
14368        + Send;
14369    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
14370    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
14371        + Send;
14372    fn r#update_attributes(
14373        &self,
14374        payload: &MutableNodeAttributes,
14375    ) -> Self::UpdateAttributesResponseFut;
14376    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
14377    fn r#sync(&self) -> Self::SyncResponseFut;
14378    fn r#list_extended_attributes(
14379        &self,
14380        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14381    ) -> Result<(), fidl::Error>;
14382    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
14383        + Send;
14384    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
14385    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
14386        + Send;
14387    fn r#set_extended_attribute(
14388        &self,
14389        name: &[u8],
14390        value: ExtendedAttributeValue,
14391        mode: SetExtendedAttributeMode,
14392    ) -> Self::SetExtendedAttributeResponseFut;
14393    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
14394        + Send;
14395    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
14396    fn r#open(
14397        &self,
14398        path: &str,
14399        flags: Flags,
14400        options: &Options,
14401        object: fdomain_client::Channel,
14402    ) -> Result<(), fidl::Error>;
14403    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
14404    fn r#describe(&self) -> Self::DescribeResponseFut;
14405}
14406
14407#[derive(Debug, Clone)]
14408pub struct SymlinkProxy {
14409    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
14410}
14411
14412impl fdomain_client::fidl::Proxy for SymlinkProxy {
14413    type Protocol = SymlinkMarker;
14414
14415    fn from_channel(inner: fdomain_client::Channel) -> Self {
14416        Self::new(inner)
14417    }
14418
14419    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
14420        self.client.into_channel().map_err(|client| Self { client })
14421    }
14422
14423    fn as_channel(&self) -> &fdomain_client::Channel {
14424        self.client.as_channel()
14425    }
14426}
14427
14428impl SymlinkProxy {
14429    /// Create a new Proxy for fuchsia.io/Symlink.
14430    pub fn new(channel: fdomain_client::Channel) -> Self {
14431        let protocol_name = <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
14432        Self { client: fidl::client::Client::new(channel, protocol_name) }
14433    }
14434
14435    /// Get a Stream of events from the remote end of the protocol.
14436    ///
14437    /// # Panics
14438    ///
14439    /// Panics if the event stream was already taken.
14440    pub fn take_event_stream(&self) -> SymlinkEventStream {
14441        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
14442    }
14443
14444    /// Creates a link to this this object with name `dst` in the directory represented by
14445    /// `dst_parent_token`.
14446    ///
14447    /// `dst` must be a resolved object name. Including "/" in the string will return
14448    /// `ZX_ERR_INVALID_ARGS`.
14449    ///
14450    /// This method requires the maximal set of rights supported by the filesystem for this object.
14451    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
14452    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
14453    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
14454    /// `ZX_ERR_ACCESS_DENIED`.
14455    ///
14456    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
14457    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
14458    ///
14459    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
14460    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
14461    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
14462    ///
14463    /// This method does not have the same atomicity properties has the `Directory::Link` method,
14464    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
14465    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
14466    pub fn r#link_into(
14467        &self,
14468        mut dst_parent_token: fdomain_client::Event,
14469        mut dst: &str,
14470    ) -> fidl::client::QueryResponseFut<
14471        LinkableLinkIntoResult,
14472        fdomain_client::fidl::FDomainResourceDialect,
14473    > {
14474        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
14475    }
14476
14477    pub fn r#clone(
14478        &self,
14479        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14480    ) -> Result<(), fidl::Error> {
14481        SymlinkProxyInterface::r#clone(self, request)
14482    }
14483
14484    /// Terminates the connection.
14485    ///
14486    /// After calling `Close`, the client must not send any other requests.
14487    ///
14488    /// Servers, after sending the status response, should close the connection
14489    /// regardless of status and without sending an epitaph.
14490    ///
14491    /// Closing the client end of the channel should be semantically equivalent
14492    /// to calling `Close` without knowing when the close has completed or its
14493    /// status.
14494    pub fn r#close(
14495        &self,
14496    ) -> fidl::client::QueryResponseFut<
14497        fdomain_fuchsia_unknown::CloseableCloseResult,
14498        fdomain_client::fidl::FDomainResourceDialect,
14499    > {
14500        SymlinkProxyInterface::r#close(self)
14501    }
14502
14503    pub fn r#query(
14504        &self,
14505    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
14506        SymlinkProxyInterface::r#query(self)
14507    }
14508
14509    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14510    pub fn r#deprecated_clone(
14511        &self,
14512        mut flags: OpenFlags,
14513        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14514    ) -> Result<(), fidl::Error> {
14515        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
14516    }
14517
14518    /// DEPRECATED - Use `Node.GetAttributes` instead.
14519    ///
14520    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14521    pub fn r#deprecated_get_attr(
14522        &self,
14523    ) -> fidl::client::QueryResponseFut<
14524        (i32, NodeAttributes),
14525        fdomain_client::fidl::FDomainResourceDialect,
14526    > {
14527        SymlinkProxyInterface::r#deprecated_get_attr(self)
14528    }
14529
14530    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14531    pub fn r#deprecated_set_attr(
14532        &self,
14533        mut flags: NodeAttributeFlags,
14534        mut attributes: &NodeAttributes,
14535    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14536        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
14537    }
14538
14539    /// [DEPRECATED - Use new GetFlags method instead.]
14540    pub fn r#deprecated_get_flags(
14541        &self,
14542    ) -> fidl::client::QueryResponseFut<
14543        (i32, OpenFlags),
14544        fdomain_client::fidl::FDomainResourceDialect,
14545    > {
14546        SymlinkProxyInterface::r#deprecated_get_flags(self)
14547    }
14548
14549    /// [DEPRECATED - Use new SetFlags method instead.]
14550    pub fn r#deprecated_set_flags(
14551        &self,
14552        mut flags: OpenFlags,
14553    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14554        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
14555    }
14556
14557    /// Queries the flags that apply to this node after it has been opened/created. This method does
14558    /// not require any rights.
14559    ///
14560    /// Note that the final set of flags that apply to the connection may differ from those
14561    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14562    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14563    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14564    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14565    pub fn r#get_flags(
14566        &self,
14567    ) -> fidl::client::QueryResponseFut<
14568        NodeGetFlagsResult,
14569        fdomain_client::fidl::FDomainResourceDialect,
14570    > {
14571        SymlinkProxyInterface::r#get_flags(self)
14572    }
14573
14574    /// Sets the flags that apply to this node after it has been opened. This method does not
14575    /// require any rights.
14576    ///
14577    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14578    /// clear append mode.
14579    ///
14580    /// Errors:
14581    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14582    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14583    pub fn r#set_flags(
14584        &self,
14585        mut flags: Flags,
14586    ) -> fidl::client::QueryResponseFut<
14587        NodeSetFlagsResult,
14588        fdomain_client::fidl::FDomainResourceDialect,
14589    > {
14590        SymlinkProxyInterface::r#set_flags(self, flags)
14591    }
14592
14593    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14594    /// volume has different settings or the storage is accounted seperately from the rest of the
14595    /// filesystem that may be reported instead of filesystem-wide details.
14596    pub fn r#query_filesystem(
14597        &self,
14598    ) -> fidl::client::QueryResponseFut<
14599        (i32, Option<Box<FilesystemInfo>>),
14600        fdomain_client::fidl::FDomainResourceDialect,
14601    > {
14602        SymlinkProxyInterface::r#query_filesystem(self)
14603    }
14604
14605    /// Acquires information about the node.
14606    ///
14607    /// The attributes of a node should be stable, independent of the
14608    /// specific protocol used to access it.
14609    ///
14610    /// If a particular attribute is not applicable or not supported,
14611    /// filesystems should leave the corresponding field absent.
14612    ///
14613    /// + `query` a bit-mask specifying which attributes to fetch. The server
14614    ///   should not return more than necessary.
14615    /// - `attributes` the returned attributes.
14616    ///
14617    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14618    pub fn r#get_attributes(
14619        &self,
14620        mut query: NodeAttributesQuery,
14621    ) -> fidl::client::QueryResponseFut<
14622        NodeGetAttributesResult,
14623        fdomain_client::fidl::FDomainResourceDialect,
14624    > {
14625        SymlinkProxyInterface::r#get_attributes(self, query)
14626    }
14627
14628    /// Updates information about the node.
14629    ///
14630    /// + `attributes` the presence of a table field in `attributes` indicates
14631    /// the intent to update the corresponding attribute.
14632    ///
14633    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14634    ///
14635    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14636    pub fn r#update_attributes(
14637        &self,
14638        mut payload: &MutableNodeAttributes,
14639    ) -> fidl::client::QueryResponseFut<
14640        NodeUpdateAttributesResult,
14641        fdomain_client::fidl::FDomainResourceDialect,
14642    > {
14643        SymlinkProxyInterface::r#update_attributes(self, payload)
14644    }
14645
14646    /// Synchronizes updates to the node to the underlying media, if it exists.
14647    ///
14648    /// This method will return when the filesystem server has flushed the
14649    /// relevant updates to the underlying media, but does not guarantee the
14650    /// underlying media has persisted the information, nor that any information
14651    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14652    /// between operations.
14653    ///
14654    /// This method does not require any rights.
14655    pub fn r#sync(
14656        &self,
14657    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
14658    {
14659        SymlinkProxyInterface::r#sync(self)
14660    }
14661
14662    /// Creates an iterator over all the extended attribute names associated
14663    /// with this node. If an error occurs it is returned as an epitaph on the
14664    /// iterator request channel, and then the channel is closed.
14665    ///
14666    /// GetExtendedAttributes can be used with any of these names to retrieve
14667    /// the associated value.
14668    ///
14669    /// This method requires the [`Rights.READ_BYTES`] right.
14670    pub fn r#list_extended_attributes(
14671        &self,
14672        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14673    ) -> Result<(), fidl::Error> {
14674        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
14675    }
14676
14677    /// Get the value associated with the given attribute `name` for this node.
14678    ///
14679    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14680    /// particular structure is imposed on them.
14681    ///
14682    /// This method requires the [`Rights.READ_BYTES`] right.
14683    pub fn r#get_extended_attribute(
14684        &self,
14685        mut name: &[u8],
14686    ) -> fidl::client::QueryResponseFut<
14687        NodeGetExtendedAttributeResult,
14688        fdomain_client::fidl::FDomainResourceDialect,
14689    > {
14690        SymlinkProxyInterface::r#get_extended_attribute(self, name)
14691    }
14692
14693    /// Set the value for the given attribute `name` to `value` for this node.
14694    ///
14695    /// The attribute name may exist, in which case the attribute is updated.
14696    /// If the attribute doesn't exist, it is created. The name should have no
14697    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14698    ///
14699    /// This method requires the [`Rights.WRITE_BYTES`] right.
14700    pub fn r#set_extended_attribute(
14701        &self,
14702        mut name: &[u8],
14703        mut value: ExtendedAttributeValue,
14704        mut mode: SetExtendedAttributeMode,
14705    ) -> fidl::client::QueryResponseFut<
14706        NodeSetExtendedAttributeResult,
14707        fdomain_client::fidl::FDomainResourceDialect,
14708    > {
14709        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
14710    }
14711
14712    /// Remove the specified extended attribute.
14713    ///
14714    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14715    ///
14716    /// This method requires the [`Rights.WRITE_BYTES`] right.
14717    pub fn r#remove_extended_attribute(
14718        &self,
14719        mut name: &[u8],
14720    ) -> fidl::client::QueryResponseFut<
14721        NodeRemoveExtendedAttributeResult,
14722        fdomain_client::fidl::FDomainResourceDialect,
14723    > {
14724        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
14725    }
14726
14727    /// Open (or create) a node relative to this directory. Any errors are communicated via an
14728    /// epitaph sent on the `object` channel.
14729    ///
14730    /// Errors:
14731    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
14732    /// * See [`Flags`] for other errors which may be communicated based on `flags`
14733    pub fn r#open(
14734        &self,
14735        mut path: &str,
14736        mut flags: Flags,
14737        mut options: &Options,
14738        mut object: fdomain_client::Channel,
14739    ) -> Result<(), fidl::Error> {
14740        SymlinkProxyInterface::r#open(self, path, flags, options, object)
14741    }
14742
14743    pub fn r#describe(
14744        &self,
14745    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>
14746    {
14747        SymlinkProxyInterface::r#describe(self)
14748    }
14749}
14750
14751impl SymlinkProxyInterface for SymlinkProxy {
14752    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
14753        LinkableLinkIntoResult,
14754        fdomain_client::fidl::FDomainResourceDialect,
14755    >;
14756    fn r#link_into(
14757        &self,
14758        mut dst_parent_token: fdomain_client::Event,
14759        mut dst: &str,
14760    ) -> Self::LinkIntoResponseFut {
14761        fn _decode(
14762            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14763        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
14764            let _response = fidl::client::decode_transaction_body::<
14765                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14766                fdomain_client::fidl::FDomainResourceDialect,
14767                0x54f3949246a03e74,
14768            >(_buf?)?;
14769            Ok(_response.map(|x| x))
14770        }
14771        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
14772            (dst_parent_token, dst),
14773            0x54f3949246a03e74,
14774            fidl::encoding::DynamicFlags::empty(),
14775            _decode,
14776        )
14777    }
14778
14779    fn r#clone(
14780        &self,
14781        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14782    ) -> Result<(), fidl::Error> {
14783        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
14784            (request,),
14785            0x20d8a7aba2168a79,
14786            fidl::encoding::DynamicFlags::empty(),
14787        )
14788    }
14789
14790    type CloseResponseFut = fidl::client::QueryResponseFut<
14791        fdomain_fuchsia_unknown::CloseableCloseResult,
14792        fdomain_client::fidl::FDomainResourceDialect,
14793    >;
14794    fn r#close(&self) -> Self::CloseResponseFut {
14795        fn _decode(
14796            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14797        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
14798            let _response = fidl::client::decode_transaction_body::<
14799                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14800                fdomain_client::fidl::FDomainResourceDialect,
14801                0x5ac5d459ad7f657e,
14802            >(_buf?)?;
14803            Ok(_response.map(|x| x))
14804        }
14805        self.client.send_query_and_decode::<
14806            fidl::encoding::EmptyPayload,
14807            fdomain_fuchsia_unknown::CloseableCloseResult,
14808        >(
14809            (),
14810            0x5ac5d459ad7f657e,
14811            fidl::encoding::DynamicFlags::empty(),
14812            _decode,
14813        )
14814    }
14815
14816    type QueryResponseFut =
14817        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
14818    fn r#query(&self) -> Self::QueryResponseFut {
14819        fn _decode(
14820            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14821        ) -> Result<Vec<u8>, fidl::Error> {
14822            let _response = fidl::client::decode_transaction_body::<
14823                fdomain_fuchsia_unknown::QueryableQueryResponse,
14824                fdomain_client::fidl::FDomainResourceDialect,
14825                0x2658edee9decfc06,
14826            >(_buf?)?;
14827            Ok(_response.protocol)
14828        }
14829        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
14830            (),
14831            0x2658edee9decfc06,
14832            fidl::encoding::DynamicFlags::empty(),
14833            _decode,
14834        )
14835    }
14836
14837    fn r#deprecated_clone(
14838        &self,
14839        mut flags: OpenFlags,
14840        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14841    ) -> Result<(), fidl::Error> {
14842        self.client.send::<NodeDeprecatedCloneRequest>(
14843            (flags, object),
14844            0x5a61678f293ce16f,
14845            fidl::encoding::DynamicFlags::FLEXIBLE,
14846        )
14847    }
14848
14849    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
14850        (i32, NodeAttributes),
14851        fdomain_client::fidl::FDomainResourceDialect,
14852    >;
14853    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
14854        fn _decode(
14855            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14856        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14857            let _response = fidl::client::decode_transaction_body::<
14858                NodeDeprecatedGetAttrResponse,
14859                fdomain_client::fidl::FDomainResourceDialect,
14860                0x78985e216314dafd,
14861            >(_buf?)?;
14862            Ok((_response.s, _response.attributes))
14863        }
14864        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14865            (),
14866            0x78985e216314dafd,
14867            fidl::encoding::DynamicFlags::empty(),
14868            _decode,
14869        )
14870    }
14871
14872    type DeprecatedSetAttrResponseFut =
14873        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14874    fn r#deprecated_set_attr(
14875        &self,
14876        mut flags: NodeAttributeFlags,
14877        mut attributes: &NodeAttributes,
14878    ) -> Self::DeprecatedSetAttrResponseFut {
14879        fn _decode(
14880            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14881        ) -> Result<i32, fidl::Error> {
14882            let _response = fidl::client::decode_transaction_body::<
14883                NodeDeprecatedSetAttrResponse,
14884                fdomain_client::fidl::FDomainResourceDialect,
14885                0x4186c0f40d938f46,
14886            >(_buf?)?;
14887            Ok(_response.s)
14888        }
14889        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
14890            (flags, attributes),
14891            0x4186c0f40d938f46,
14892            fidl::encoding::DynamicFlags::empty(),
14893            _decode,
14894        )
14895    }
14896
14897    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14898        (i32, OpenFlags),
14899        fdomain_client::fidl::FDomainResourceDialect,
14900    >;
14901    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14902        fn _decode(
14903            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14904        ) -> Result<(i32, OpenFlags), fidl::Error> {
14905            let _response = fidl::client::decode_transaction_body::<
14906                NodeDeprecatedGetFlagsResponse,
14907                fdomain_client::fidl::FDomainResourceDialect,
14908                0x5b88fffb8eda3aa1,
14909            >(_buf?)?;
14910            Ok((_response.s, _response.flags))
14911        }
14912        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14913            (),
14914            0x5b88fffb8eda3aa1,
14915            fidl::encoding::DynamicFlags::empty(),
14916            _decode,
14917        )
14918    }
14919
14920    type DeprecatedSetFlagsResponseFut =
14921        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14922    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14923        fn _decode(
14924            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14925        ) -> Result<i32, fidl::Error> {
14926            let _response = fidl::client::decode_transaction_body::<
14927                NodeDeprecatedSetFlagsResponse,
14928                fdomain_client::fidl::FDomainResourceDialect,
14929                0x5295b76c71fde733,
14930            >(_buf?)?;
14931            Ok(_response.s)
14932        }
14933        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14934            (flags,),
14935            0x5295b76c71fde733,
14936            fidl::encoding::DynamicFlags::empty(),
14937            _decode,
14938        )
14939    }
14940
14941    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14942        NodeGetFlagsResult,
14943        fdomain_client::fidl::FDomainResourceDialect,
14944    >;
14945    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14946        fn _decode(
14947            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14948        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14949            let _response = fidl::client::decode_transaction_body::<
14950                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14951                fdomain_client::fidl::FDomainResourceDialect,
14952                0x176eb318f64ec23,
14953            >(_buf?)?
14954            .into_result_fdomain::<SymlinkMarker>("get_flags")?;
14955            Ok(_response.map(|x| x.flags))
14956        }
14957        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14958            (),
14959            0x176eb318f64ec23,
14960            fidl::encoding::DynamicFlags::FLEXIBLE,
14961            _decode,
14962        )
14963    }
14964
14965    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14966        NodeSetFlagsResult,
14967        fdomain_client::fidl::FDomainResourceDialect,
14968    >;
14969    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14970        fn _decode(
14971            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14972        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14973            let _response = fidl::client::decode_transaction_body::<
14974                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14975                fdomain_client::fidl::FDomainResourceDialect,
14976                0x55a8028685791ea8,
14977            >(_buf?)?
14978            .into_result_fdomain::<SymlinkMarker>("set_flags")?;
14979            Ok(_response.map(|x| x))
14980        }
14981        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14982            (flags,),
14983            0x55a8028685791ea8,
14984            fidl::encoding::DynamicFlags::FLEXIBLE,
14985            _decode,
14986        )
14987    }
14988
14989    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14990        (i32, Option<Box<FilesystemInfo>>),
14991        fdomain_client::fidl::FDomainResourceDialect,
14992    >;
14993    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14994        fn _decode(
14995            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14996        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14997            let _response = fidl::client::decode_transaction_body::<
14998                NodeQueryFilesystemResponse,
14999                fdomain_client::fidl::FDomainResourceDialect,
15000                0x6f344a1c6b0a0610,
15001            >(_buf?)?;
15002            Ok((_response.s, _response.info))
15003        }
15004        self.client.send_query_and_decode::<
15005            fidl::encoding::EmptyPayload,
15006            (i32, Option<Box<FilesystemInfo>>),
15007        >(
15008            (),
15009            0x6f344a1c6b0a0610,
15010            fidl::encoding::DynamicFlags::empty(),
15011            _decode,
15012        )
15013    }
15014
15015    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
15016        NodeGetAttributesResult,
15017        fdomain_client::fidl::FDomainResourceDialect,
15018    >;
15019    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
15020        fn _decode(
15021            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15022        ) -> Result<NodeGetAttributesResult, fidl::Error> {
15023            let _response = fidl::client::decode_transaction_body::<
15024                fidl::encoding::ResultType<NodeAttributes2, i32>,
15025                fdomain_client::fidl::FDomainResourceDialect,
15026                0x3d4396a638ea053b,
15027            >(_buf?)?;
15028            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
15029        }
15030        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
15031            (query,),
15032            0x3d4396a638ea053b,
15033            fidl::encoding::DynamicFlags::empty(),
15034            _decode,
15035        )
15036    }
15037
15038    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
15039        NodeUpdateAttributesResult,
15040        fdomain_client::fidl::FDomainResourceDialect,
15041    >;
15042    fn r#update_attributes(
15043        &self,
15044        mut payload: &MutableNodeAttributes,
15045    ) -> Self::UpdateAttributesResponseFut {
15046        fn _decode(
15047            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15048        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
15049            let _response = fidl::client::decode_transaction_body::<
15050                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15051                fdomain_client::fidl::FDomainResourceDialect,
15052                0x3308c1da5a89bf08,
15053            >(_buf?)?;
15054            Ok(_response.map(|x| x))
15055        }
15056        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
15057            payload,
15058            0x3308c1da5a89bf08,
15059            fidl::encoding::DynamicFlags::empty(),
15060            _decode,
15061        )
15062    }
15063
15064    type SyncResponseFut = fidl::client::QueryResponseFut<
15065        NodeSyncResult,
15066        fdomain_client::fidl::FDomainResourceDialect,
15067    >;
15068    fn r#sync(&self) -> Self::SyncResponseFut {
15069        fn _decode(
15070            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15071        ) -> Result<NodeSyncResult, fidl::Error> {
15072            let _response = fidl::client::decode_transaction_body::<
15073                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15074                fdomain_client::fidl::FDomainResourceDialect,
15075                0x2c5c27ca0ab5dc49,
15076            >(_buf?)?;
15077            Ok(_response.map(|x| x))
15078        }
15079        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
15080            (),
15081            0x2c5c27ca0ab5dc49,
15082            fidl::encoding::DynamicFlags::empty(),
15083            _decode,
15084        )
15085    }
15086
15087    fn r#list_extended_attributes(
15088        &self,
15089        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15090    ) -> Result<(), fidl::Error> {
15091        self.client.send::<NodeListExtendedAttributesRequest>(
15092            (iterator,),
15093            0x4b61033de007fcd0,
15094            fidl::encoding::DynamicFlags::empty(),
15095        )
15096    }
15097
15098    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15099        NodeGetExtendedAttributeResult,
15100        fdomain_client::fidl::FDomainResourceDialect,
15101    >;
15102    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
15103        fn _decode(
15104            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15105        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
15106            let _response = fidl::client::decode_transaction_body::<
15107                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
15108                fdomain_client::fidl::FDomainResourceDialect,
15109                0x45ffa3ccfdeb76db,
15110            >(_buf?)?;
15111            Ok(_response.map(|x| x))
15112        }
15113        self.client.send_query_and_decode::<
15114            NodeGetExtendedAttributeRequest,
15115            NodeGetExtendedAttributeResult,
15116        >(
15117            (name,),
15118            0x45ffa3ccfdeb76db,
15119            fidl::encoding::DynamicFlags::empty(),
15120            _decode,
15121        )
15122    }
15123
15124    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15125        NodeSetExtendedAttributeResult,
15126        fdomain_client::fidl::FDomainResourceDialect,
15127    >;
15128    fn r#set_extended_attribute(
15129        &self,
15130        mut name: &[u8],
15131        mut value: ExtendedAttributeValue,
15132        mut mode: SetExtendedAttributeMode,
15133    ) -> Self::SetExtendedAttributeResponseFut {
15134        fn _decode(
15135            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15136        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
15137            let _response = fidl::client::decode_transaction_body::<
15138                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15139                fdomain_client::fidl::FDomainResourceDialect,
15140                0x4a951362f681f23c,
15141            >(_buf?)?;
15142            Ok(_response.map(|x| x))
15143        }
15144        self.client.send_query_and_decode::<
15145            NodeSetExtendedAttributeRequest,
15146            NodeSetExtendedAttributeResult,
15147        >(
15148            (name, &mut value, mode,),
15149            0x4a951362f681f23c,
15150            fidl::encoding::DynamicFlags::empty(),
15151            _decode,
15152        )
15153    }
15154
15155    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
15156        NodeRemoveExtendedAttributeResult,
15157        fdomain_client::fidl::FDomainResourceDialect,
15158    >;
15159    fn r#remove_extended_attribute(
15160        &self,
15161        mut name: &[u8],
15162    ) -> Self::RemoveExtendedAttributeResponseFut {
15163        fn _decode(
15164            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15165        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
15166            let _response = fidl::client::decode_transaction_body::<
15167                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
15168                fdomain_client::fidl::FDomainResourceDialect,
15169                0x7a0b9f3a9bf9032d,
15170            >(_buf?)?;
15171            Ok(_response.map(|x| x))
15172        }
15173        self.client.send_query_and_decode::<
15174            NodeRemoveExtendedAttributeRequest,
15175            NodeRemoveExtendedAttributeResult,
15176        >(
15177            (name,),
15178            0x7a0b9f3a9bf9032d,
15179            fidl::encoding::DynamicFlags::empty(),
15180            _decode,
15181        )
15182    }
15183
15184    fn r#open(
15185        &self,
15186        mut path: &str,
15187        mut flags: Flags,
15188        mut options: &Options,
15189        mut object: fdomain_client::Channel,
15190    ) -> Result<(), fidl::Error> {
15191        self.client.send::<OpenableOpenRequest>(
15192            (path, flags, options, object),
15193            0x568ddcb9a9cbb6d9,
15194            fidl::encoding::DynamicFlags::FLEXIBLE,
15195        )
15196    }
15197
15198    type DescribeResponseFut =
15199        fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>;
15200    fn r#describe(&self) -> Self::DescribeResponseFut {
15201        fn _decode(
15202            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
15203        ) -> Result<SymlinkInfo, fidl::Error> {
15204            let _response = fidl::client::decode_transaction_body::<
15205                fidl::encoding::FlexibleType<SymlinkInfo>,
15206                fdomain_client::fidl::FDomainResourceDialect,
15207                0x742c2ea5e89831f3,
15208            >(_buf?)?
15209            .into_result_fdomain::<SymlinkMarker>("describe")?;
15210            Ok(_response)
15211        }
15212        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
15213            (),
15214            0x742c2ea5e89831f3,
15215            fidl::encoding::DynamicFlags::FLEXIBLE,
15216            _decode,
15217        )
15218    }
15219}
15220
15221pub struct SymlinkEventStream {
15222    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
15223}
15224
15225impl std::marker::Unpin for SymlinkEventStream {}
15226
15227impl futures::stream::FusedStream for SymlinkEventStream {
15228    fn is_terminated(&self) -> bool {
15229        self.event_receiver.is_terminated()
15230    }
15231}
15232
15233impl futures::Stream for SymlinkEventStream {
15234    type Item = Result<SymlinkEvent, fidl::Error>;
15235
15236    fn poll_next(
15237        mut self: std::pin::Pin<&mut Self>,
15238        cx: &mut std::task::Context<'_>,
15239    ) -> std::task::Poll<Option<Self::Item>> {
15240        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
15241            &mut self.event_receiver,
15242            cx
15243        )?) {
15244            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
15245            None => std::task::Poll::Ready(None),
15246        }
15247    }
15248}
15249
15250#[derive(Debug)]
15251pub enum SymlinkEvent {
15252    OnOpen_ {
15253        s: i32,
15254        info: Option<Box<NodeInfoDeprecated>>,
15255    },
15256    OnRepresentation {
15257        payload: Representation,
15258    },
15259    #[non_exhaustive]
15260    _UnknownEvent {
15261        /// Ordinal of the event that was sent.
15262        ordinal: u64,
15263    },
15264}
15265
15266impl SymlinkEvent {
15267    #[allow(irrefutable_let_patterns)]
15268    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
15269        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
15270    }
15271    #[allow(irrefutable_let_patterns)]
15272    pub fn into_on_representation(self) -> Option<Representation> {
15273        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
15274    }
15275
15276    /// Decodes a message buffer as a [`SymlinkEvent`].
15277    fn decode(
15278        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
15279    ) -> Result<SymlinkEvent, fidl::Error> {
15280        let (bytes, _handles) = buf.split_mut();
15281        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15282        debug_assert_eq!(tx_header.tx_id, 0);
15283        match tx_header.ordinal {
15284            0x7fc7bbb1dbfd1972 => {
15285                let mut out = fidl::new_empty!(
15286                    NodeOnOpenRequest,
15287                    fdomain_client::fidl::FDomainResourceDialect
15288                );
15289                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
15290                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
15291            }
15292            0x5cb40567d80a510c => {
15293                let mut out =
15294                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
15295                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
15296                Ok((SymlinkEvent::OnRepresentation { payload: out }))
15297            }
15298            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
15299                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
15300            }
15301            _ => Err(fidl::Error::UnknownOrdinal {
15302                ordinal: tx_header.ordinal,
15303                protocol_name: <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15304            }),
15305        }
15306    }
15307}
15308
15309/// A Stream of incoming requests for fuchsia.io/Symlink.
15310pub struct SymlinkRequestStream {
15311    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15312    is_terminated: bool,
15313}
15314
15315impl std::marker::Unpin for SymlinkRequestStream {}
15316
15317impl futures::stream::FusedStream for SymlinkRequestStream {
15318    fn is_terminated(&self) -> bool {
15319        self.is_terminated
15320    }
15321}
15322
15323impl fdomain_client::fidl::RequestStream for SymlinkRequestStream {
15324    type Protocol = SymlinkMarker;
15325    type ControlHandle = SymlinkControlHandle;
15326
15327    fn from_channel(channel: fdomain_client::Channel) -> Self {
15328        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
15329    }
15330
15331    fn control_handle(&self) -> Self::ControlHandle {
15332        SymlinkControlHandle { inner: self.inner.clone() }
15333    }
15334
15335    fn into_inner(
15336        self,
15337    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
15338    {
15339        (self.inner, self.is_terminated)
15340    }
15341
15342    fn from_inner(
15343        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15344        is_terminated: bool,
15345    ) -> Self {
15346        Self { inner, is_terminated }
15347    }
15348}
15349
15350impl futures::Stream for SymlinkRequestStream {
15351    type Item = Result<SymlinkRequest, fidl::Error>;
15352
15353    fn poll_next(
15354        mut self: std::pin::Pin<&mut Self>,
15355        cx: &mut std::task::Context<'_>,
15356    ) -> std::task::Poll<Option<Self::Item>> {
15357        let this = &mut *self;
15358        if this.inner.check_shutdown(cx) {
15359            this.is_terminated = true;
15360            return std::task::Poll::Ready(None);
15361        }
15362        if this.is_terminated {
15363            panic!("polled SymlinkRequestStream after completion");
15364        }
15365        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
15366            |bytes, handles| {
15367                match this.inner.channel().read_etc(cx, bytes, handles) {
15368                    std::task::Poll::Ready(Ok(())) => {}
15369                    std::task::Poll::Pending => return std::task::Poll::Pending,
15370                    std::task::Poll::Ready(Err(None)) => {
15371                        this.is_terminated = true;
15372                        return std::task::Poll::Ready(None);
15373                    }
15374                    std::task::Poll::Ready(Err(Some(e))) => {
15375                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
15376                            e.into(),
15377                        ))));
15378                    }
15379                }
15380
15381                // A message has been received from the channel
15382                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
15383
15384                std::task::Poll::Ready(Some(match header.ordinal {
15385                    0x54f3949246a03e74 => {
15386                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15387                        let mut req = fidl::new_empty!(
15388                            LinkableLinkIntoRequest,
15389                            fdomain_client::fidl::FDomainResourceDialect
15390                        );
15391                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
15392                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15393                        Ok(SymlinkRequest::LinkInto {
15394                            dst_parent_token: req.dst_parent_token,
15395                            dst: req.dst,
15396
15397                            responder: SymlinkLinkIntoResponder {
15398                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15399                                tx_id: header.tx_id,
15400                            },
15401                        })
15402                    }
15403                    0x20d8a7aba2168a79 => {
15404                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15405                        let mut req = fidl::new_empty!(
15406                            fdomain_fuchsia_unknown::CloneableCloneRequest,
15407                            fdomain_client::fidl::FDomainResourceDialect
15408                        );
15409                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
15410                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15411                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
15412                    }
15413                    0x5ac5d459ad7f657e => {
15414                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15415                        let mut req = fidl::new_empty!(
15416                            fidl::encoding::EmptyPayload,
15417                            fdomain_client::fidl::FDomainResourceDialect
15418                        );
15419                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15420                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15421                        Ok(SymlinkRequest::Close {
15422                            responder: SymlinkCloseResponder {
15423                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15424                                tx_id: header.tx_id,
15425                            },
15426                        })
15427                    }
15428                    0x2658edee9decfc06 => {
15429                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15430                        let mut req = fidl::new_empty!(
15431                            fidl::encoding::EmptyPayload,
15432                            fdomain_client::fidl::FDomainResourceDialect
15433                        );
15434                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15435                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15436                        Ok(SymlinkRequest::Query {
15437                            responder: SymlinkQueryResponder {
15438                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15439                                tx_id: header.tx_id,
15440                            },
15441                        })
15442                    }
15443                    0x5a61678f293ce16f => {
15444                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15445                        let mut req = fidl::new_empty!(
15446                            NodeDeprecatedCloneRequest,
15447                            fdomain_client::fidl::FDomainResourceDialect
15448                        );
15449                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
15450                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15451                        Ok(SymlinkRequest::DeprecatedClone {
15452                            flags: req.flags,
15453                            object: req.object,
15454
15455                            control_handle,
15456                        })
15457                    }
15458                    0x78985e216314dafd => {
15459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15460                        let mut req = fidl::new_empty!(
15461                            fidl::encoding::EmptyPayload,
15462                            fdomain_client::fidl::FDomainResourceDialect
15463                        );
15464                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15465                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15466                        Ok(SymlinkRequest::DeprecatedGetAttr {
15467                            responder: SymlinkDeprecatedGetAttrResponder {
15468                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15469                                tx_id: header.tx_id,
15470                            },
15471                        })
15472                    }
15473                    0x4186c0f40d938f46 => {
15474                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15475                        let mut req = fidl::new_empty!(
15476                            NodeDeprecatedSetAttrRequest,
15477                            fdomain_client::fidl::FDomainResourceDialect
15478                        );
15479                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
15480                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15481                        Ok(SymlinkRequest::DeprecatedSetAttr {
15482                            flags: req.flags,
15483                            attributes: req.attributes,
15484
15485                            responder: SymlinkDeprecatedSetAttrResponder {
15486                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15487                                tx_id: header.tx_id,
15488                            },
15489                        })
15490                    }
15491                    0x5b88fffb8eda3aa1 => {
15492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15493                        let mut req = fidl::new_empty!(
15494                            fidl::encoding::EmptyPayload,
15495                            fdomain_client::fidl::FDomainResourceDialect
15496                        );
15497                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15498                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15499                        Ok(SymlinkRequest::DeprecatedGetFlags {
15500                            responder: SymlinkDeprecatedGetFlagsResponder {
15501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15502                                tx_id: header.tx_id,
15503                            },
15504                        })
15505                    }
15506                    0x5295b76c71fde733 => {
15507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15508                        let mut req = fidl::new_empty!(
15509                            NodeDeprecatedSetFlagsRequest,
15510                            fdomain_client::fidl::FDomainResourceDialect
15511                        );
15512                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15513                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15514                        Ok(SymlinkRequest::DeprecatedSetFlags {
15515                            flags: req.flags,
15516
15517                            responder: SymlinkDeprecatedSetFlagsResponder {
15518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15519                                tx_id: header.tx_id,
15520                            },
15521                        })
15522                    }
15523                    0x176eb318f64ec23 => {
15524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15525                        let mut req = fidl::new_empty!(
15526                            fidl::encoding::EmptyPayload,
15527                            fdomain_client::fidl::FDomainResourceDialect
15528                        );
15529                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15530                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15531                        Ok(SymlinkRequest::GetFlags {
15532                            responder: SymlinkGetFlagsResponder {
15533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15534                                tx_id: header.tx_id,
15535                            },
15536                        })
15537                    }
15538                    0x55a8028685791ea8 => {
15539                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15540                        let mut req = fidl::new_empty!(
15541                            NodeSetFlagsRequest,
15542                            fdomain_client::fidl::FDomainResourceDialect
15543                        );
15544                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15545                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15546                        Ok(SymlinkRequest::SetFlags {
15547                            flags: req.flags,
15548
15549                            responder: SymlinkSetFlagsResponder {
15550                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15551                                tx_id: header.tx_id,
15552                            },
15553                        })
15554                    }
15555                    0x6f344a1c6b0a0610 => {
15556                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15557                        let mut req = fidl::new_empty!(
15558                            fidl::encoding::EmptyPayload,
15559                            fdomain_client::fidl::FDomainResourceDialect
15560                        );
15561                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15562                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15563                        Ok(SymlinkRequest::QueryFilesystem {
15564                            responder: SymlinkQueryFilesystemResponder {
15565                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15566                                tx_id: header.tx_id,
15567                            },
15568                        })
15569                    }
15570                    0x3d4396a638ea053b => {
15571                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15572                        let mut req = fidl::new_empty!(
15573                            NodeGetAttributesRequest,
15574                            fdomain_client::fidl::FDomainResourceDialect
15575                        );
15576                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15577                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15578                        Ok(SymlinkRequest::GetAttributes {
15579                            query: req.query,
15580
15581                            responder: SymlinkGetAttributesResponder {
15582                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15583                                tx_id: header.tx_id,
15584                            },
15585                        })
15586                    }
15587                    0x3308c1da5a89bf08 => {
15588                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15589                        let mut req = fidl::new_empty!(
15590                            MutableNodeAttributes,
15591                            fdomain_client::fidl::FDomainResourceDialect
15592                        );
15593                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
15594                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15595                        Ok(SymlinkRequest::UpdateAttributes {
15596                            payload: req,
15597                            responder: SymlinkUpdateAttributesResponder {
15598                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15599                                tx_id: header.tx_id,
15600                            },
15601                        })
15602                    }
15603                    0x2c5c27ca0ab5dc49 => {
15604                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15605                        let mut req = fidl::new_empty!(
15606                            fidl::encoding::EmptyPayload,
15607                            fdomain_client::fidl::FDomainResourceDialect
15608                        );
15609                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15610                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15611                        Ok(SymlinkRequest::Sync {
15612                            responder: SymlinkSyncResponder {
15613                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15614                                tx_id: header.tx_id,
15615                            },
15616                        })
15617                    }
15618                    0x4b61033de007fcd0 => {
15619                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15620                        let mut req = fidl::new_empty!(
15621                            NodeListExtendedAttributesRequest,
15622                            fdomain_client::fidl::FDomainResourceDialect
15623                        );
15624                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15625                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15626                        Ok(SymlinkRequest::ListExtendedAttributes {
15627                            iterator: req.iterator,
15628
15629                            control_handle,
15630                        })
15631                    }
15632                    0x45ffa3ccfdeb76db => {
15633                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15634                        let mut req = fidl::new_empty!(
15635                            NodeGetExtendedAttributeRequest,
15636                            fdomain_client::fidl::FDomainResourceDialect
15637                        );
15638                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15639                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15640                        Ok(SymlinkRequest::GetExtendedAttribute {
15641                            name: req.name,
15642
15643                            responder: SymlinkGetExtendedAttributeResponder {
15644                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15645                                tx_id: header.tx_id,
15646                            },
15647                        })
15648                    }
15649                    0x4a951362f681f23c => {
15650                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15651                        let mut req = fidl::new_empty!(
15652                            NodeSetExtendedAttributeRequest,
15653                            fdomain_client::fidl::FDomainResourceDialect
15654                        );
15655                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15656                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15657                        Ok(SymlinkRequest::SetExtendedAttribute {
15658                            name: req.name,
15659                            value: req.value,
15660                            mode: req.mode,
15661
15662                            responder: SymlinkSetExtendedAttributeResponder {
15663                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15664                                tx_id: header.tx_id,
15665                            },
15666                        })
15667                    }
15668                    0x7a0b9f3a9bf9032d => {
15669                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15670                        let mut req = fidl::new_empty!(
15671                            NodeRemoveExtendedAttributeRequest,
15672                            fdomain_client::fidl::FDomainResourceDialect
15673                        );
15674                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15675                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15676                        Ok(SymlinkRequest::RemoveExtendedAttribute {
15677                            name: req.name,
15678
15679                            responder: SymlinkRemoveExtendedAttributeResponder {
15680                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15681                                tx_id: header.tx_id,
15682                            },
15683                        })
15684                    }
15685                    0x568ddcb9a9cbb6d9 => {
15686                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15687                        let mut req = fidl::new_empty!(
15688                            OpenableOpenRequest,
15689                            fdomain_client::fidl::FDomainResourceDialect
15690                        );
15691                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
15692                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15693                        Ok(SymlinkRequest::Open {
15694                            path: req.path,
15695                            flags: req.flags,
15696                            options: req.options,
15697                            object: req.object,
15698
15699                            control_handle,
15700                        })
15701                    }
15702                    0x742c2ea5e89831f3 => {
15703                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15704                        let mut req = fidl::new_empty!(
15705                            fidl::encoding::EmptyPayload,
15706                            fdomain_client::fidl::FDomainResourceDialect
15707                        );
15708                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15709                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15710                        Ok(SymlinkRequest::Describe {
15711                            responder: SymlinkDescribeResponder {
15712                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15713                                tx_id: header.tx_id,
15714                            },
15715                        })
15716                    }
15717                    _ if header.tx_id == 0
15718                        && header
15719                            .dynamic_flags()
15720                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15721                    {
15722                        Ok(SymlinkRequest::_UnknownMethod {
15723                            ordinal: header.ordinal,
15724                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15725                            method_type: fidl::MethodType::OneWay,
15726                        })
15727                    }
15728                    _ if header
15729                        .dynamic_flags()
15730                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15731                    {
15732                        this.inner.send_framework_err(
15733                            fidl::encoding::FrameworkErr::UnknownMethod,
15734                            header.tx_id,
15735                            header.ordinal,
15736                            header.dynamic_flags(),
15737                            (bytes, handles),
15738                        )?;
15739                        Ok(SymlinkRequest::_UnknownMethod {
15740                            ordinal: header.ordinal,
15741                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15742                            method_type: fidl::MethodType::TwoWay,
15743                        })
15744                    }
15745                    _ => Err(fidl::Error::UnknownOrdinal {
15746                        ordinal: header.ordinal,
15747                        protocol_name:
15748                            <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15749                    }),
15750                }))
15751            },
15752        )
15753    }
15754}
15755
15756/// A ['Node'] which contains a symbolic link.
15757#[derive(Debug)]
15758pub enum SymlinkRequest {
15759    /// Creates a link to this this object with name `dst` in the directory represented by
15760    /// `dst_parent_token`.
15761    ///
15762    /// `dst` must be a resolved object name. Including "/" in the string will return
15763    /// `ZX_ERR_INVALID_ARGS`.
15764    ///
15765    /// This method requires the maximal set of rights supported by the filesystem for this object.
15766    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
15767    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
15768    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
15769    /// `ZX_ERR_ACCESS_DENIED`.
15770    ///
15771    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
15772    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
15773    ///
15774    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
15775    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
15776    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
15777    ///
15778    /// This method does not have the same atomicity properties has the `Directory::Link` method,
15779    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
15780    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
15781    LinkInto {
15782        dst_parent_token: fdomain_client::Event,
15783        dst: String,
15784        responder: SymlinkLinkIntoResponder,
15785    },
15786    Clone {
15787        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15788        control_handle: SymlinkControlHandle,
15789    },
15790    /// Terminates the connection.
15791    ///
15792    /// After calling `Close`, the client must not send any other requests.
15793    ///
15794    /// Servers, after sending the status response, should close the connection
15795    /// regardless of status and without sending an epitaph.
15796    ///
15797    /// Closing the client end of the channel should be semantically equivalent
15798    /// to calling `Close` without knowing when the close has completed or its
15799    /// status.
15800    Close {
15801        responder: SymlinkCloseResponder,
15802    },
15803    Query {
15804        responder: SymlinkQueryResponder,
15805    },
15806    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
15807    DeprecatedClone {
15808        flags: OpenFlags,
15809        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
15810        control_handle: SymlinkControlHandle,
15811    },
15812    /// DEPRECATED - Use `Node.GetAttributes` instead.
15813    ///
15814    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15815    DeprecatedGetAttr {
15816        responder: SymlinkDeprecatedGetAttrResponder,
15817    },
15818    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
15819    DeprecatedSetAttr {
15820        flags: NodeAttributeFlags,
15821        attributes: NodeAttributes,
15822        responder: SymlinkDeprecatedSetAttrResponder,
15823    },
15824    /// [DEPRECATED - Use new GetFlags method instead.]
15825    DeprecatedGetFlags {
15826        responder: SymlinkDeprecatedGetFlagsResponder,
15827    },
15828    /// [DEPRECATED - Use new SetFlags method instead.]
15829    DeprecatedSetFlags {
15830        flags: OpenFlags,
15831        responder: SymlinkDeprecatedSetFlagsResponder,
15832    },
15833    /// Queries the flags that apply to this node after it has been opened/created. This method does
15834    /// not require any rights.
15835    ///
15836    /// Note that the final set of flags that apply to the connection may differ from those
15837    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
15838    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
15839    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
15840    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
15841    GetFlags {
15842        responder: SymlinkGetFlagsResponder,
15843    },
15844    /// Sets the flags that apply to this node after it has been opened. This method does not
15845    /// require any rights.
15846    ///
15847    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
15848    /// clear append mode.
15849    ///
15850    /// Errors:
15851    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
15852    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
15853    SetFlags {
15854        flags: Flags,
15855        responder: SymlinkSetFlagsResponder,
15856    },
15857    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
15858    /// volume has different settings or the storage is accounted seperately from the rest of the
15859    /// filesystem that may be reported instead of filesystem-wide details.
15860    QueryFilesystem {
15861        responder: SymlinkQueryFilesystemResponder,
15862    },
15863    /// Acquires information about the node.
15864    ///
15865    /// The attributes of a node should be stable, independent of the
15866    /// specific protocol used to access it.
15867    ///
15868    /// If a particular attribute is not applicable or not supported,
15869    /// filesystems should leave the corresponding field absent.
15870    ///
15871    /// + `query` a bit-mask specifying which attributes to fetch. The server
15872    ///   should not return more than necessary.
15873    /// - `attributes` the returned attributes.
15874    ///
15875    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15876    GetAttributes {
15877        query: NodeAttributesQuery,
15878        responder: SymlinkGetAttributesResponder,
15879    },
15880    /// Updates information about the node.
15881    ///
15882    /// + `attributes` the presence of a table field in `attributes` indicates
15883    /// the intent to update the corresponding attribute.
15884    ///
15885    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
15886    ///
15887    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15888    UpdateAttributes {
15889        payload: MutableNodeAttributes,
15890        responder: SymlinkUpdateAttributesResponder,
15891    },
15892    /// Synchronizes updates to the node to the underlying media, if it exists.
15893    ///
15894    /// This method will return when the filesystem server has flushed the
15895    /// relevant updates to the underlying media, but does not guarantee the
15896    /// underlying media has persisted the information, nor that any information
15897    /// is committed to hardware. Clients may use `Sync` to ensure ordering
15898    /// between operations.
15899    ///
15900    /// This method does not require any rights.
15901    Sync {
15902        responder: SymlinkSyncResponder,
15903    },
15904    /// Creates an iterator over all the extended attribute names associated
15905    /// with this node. If an error occurs it is returned as an epitaph on the
15906    /// iterator request channel, and then the channel is closed.
15907    ///
15908    /// GetExtendedAttributes can be used with any of these names to retrieve
15909    /// the associated value.
15910    ///
15911    /// This method requires the [`Rights.READ_BYTES`] right.
15912    ListExtendedAttributes {
15913        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15914        control_handle: SymlinkControlHandle,
15915    },
15916    /// Get the value associated with the given attribute `name` for this node.
15917    ///
15918    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15919    /// particular structure is imposed on them.
15920    ///
15921    /// This method requires the [`Rights.READ_BYTES`] right.
15922    GetExtendedAttribute {
15923        name: Vec<u8>,
15924        responder: SymlinkGetExtendedAttributeResponder,
15925    },
15926    /// Set the value for the given attribute `name` to `value` for this node.
15927    ///
15928    /// The attribute name may exist, in which case the attribute is updated.
15929    /// If the attribute doesn't exist, it is created. The name should have no
15930    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15931    ///
15932    /// This method requires the [`Rights.WRITE_BYTES`] right.
15933    SetExtendedAttribute {
15934        name: Vec<u8>,
15935        value: ExtendedAttributeValue,
15936        mode: SetExtendedAttributeMode,
15937        responder: SymlinkSetExtendedAttributeResponder,
15938    },
15939    /// Remove the specified extended attribute.
15940    ///
15941    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15942    ///
15943    /// This method requires the [`Rights.WRITE_BYTES`] right.
15944    RemoveExtendedAttribute {
15945        name: Vec<u8>,
15946        responder: SymlinkRemoveExtendedAttributeResponder,
15947    },
15948    /// Open (or create) a node relative to this directory. Any errors are communicated via an
15949    /// epitaph sent on the `object` channel.
15950    ///
15951    /// Errors:
15952    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
15953    /// * See [`Flags`] for other errors which may be communicated based on `flags`
15954    Open {
15955        path: String,
15956        flags: Flags,
15957        options: Options,
15958        object: fdomain_client::Channel,
15959        control_handle: SymlinkControlHandle,
15960    },
15961    Describe {
15962        responder: SymlinkDescribeResponder,
15963    },
15964    /// An interaction was received which does not match any known method.
15965    #[non_exhaustive]
15966    _UnknownMethod {
15967        /// Ordinal of the method that was called.
15968        ordinal: u64,
15969        control_handle: SymlinkControlHandle,
15970        method_type: fidl::MethodType,
15971    },
15972}
15973
15974impl SymlinkRequest {
15975    #[allow(irrefutable_let_patterns)]
15976    pub fn into_link_into(
15977        self,
15978    ) -> Option<(fdomain_client::Event, String, SymlinkLinkIntoResponder)> {
15979        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
15980            Some((dst_parent_token, dst, responder))
15981        } else {
15982            None
15983        }
15984    }
15985
15986    #[allow(irrefutable_let_patterns)]
15987    pub fn into_clone(
15988        self,
15989    ) -> Option<(
15990        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15991        SymlinkControlHandle,
15992    )> {
15993        if let SymlinkRequest::Clone { request, control_handle } = self {
15994            Some((request, control_handle))
15995        } else {
15996            None
15997        }
15998    }
15999
16000    #[allow(irrefutable_let_patterns)]
16001    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
16002        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
16003    }
16004
16005    #[allow(irrefutable_let_patterns)]
16006    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
16007        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
16008    }
16009
16010    #[allow(irrefutable_let_patterns)]
16011    pub fn into_deprecated_clone(
16012        self,
16013    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, SymlinkControlHandle)>
16014    {
16015        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
16016            Some((flags, object, control_handle))
16017        } else {
16018            None
16019        }
16020    }
16021
16022    #[allow(irrefutable_let_patterns)]
16023    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
16024        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
16025            Some((responder))
16026        } else {
16027            None
16028        }
16029    }
16030
16031    #[allow(irrefutable_let_patterns)]
16032    pub fn into_deprecated_set_attr(
16033        self,
16034    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
16035        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
16036            Some((flags, attributes, responder))
16037        } else {
16038            None
16039        }
16040    }
16041
16042    #[allow(irrefutable_let_patterns)]
16043    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
16044        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
16045            Some((responder))
16046        } else {
16047            None
16048        }
16049    }
16050
16051    #[allow(irrefutable_let_patterns)]
16052    pub fn into_deprecated_set_flags(
16053        self,
16054    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
16055        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
16056            Some((flags, responder))
16057        } else {
16058            None
16059        }
16060    }
16061
16062    #[allow(irrefutable_let_patterns)]
16063    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
16064        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
16065    }
16066
16067    #[allow(irrefutable_let_patterns)]
16068    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
16069        if let SymlinkRequest::SetFlags { flags, responder } = self {
16070            Some((flags, responder))
16071        } else {
16072            None
16073        }
16074    }
16075
16076    #[allow(irrefutable_let_patterns)]
16077    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
16078        if let SymlinkRequest::QueryFilesystem { responder } = self {
16079            Some((responder))
16080        } else {
16081            None
16082        }
16083    }
16084
16085    #[allow(irrefutable_let_patterns)]
16086    pub fn into_get_attributes(
16087        self,
16088    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
16089        if let SymlinkRequest::GetAttributes { query, responder } = self {
16090            Some((query, responder))
16091        } else {
16092            None
16093        }
16094    }
16095
16096    #[allow(irrefutable_let_patterns)]
16097    pub fn into_update_attributes(
16098        self,
16099    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
16100        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
16101            Some((payload, responder))
16102        } else {
16103            None
16104        }
16105    }
16106
16107    #[allow(irrefutable_let_patterns)]
16108    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
16109        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
16110    }
16111
16112    #[allow(irrefutable_let_patterns)]
16113    pub fn into_list_extended_attributes(
16114        self,
16115    ) -> Option<(
16116        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
16117        SymlinkControlHandle,
16118    )> {
16119        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
16120            Some((iterator, control_handle))
16121        } else {
16122            None
16123        }
16124    }
16125
16126    #[allow(irrefutable_let_patterns)]
16127    pub fn into_get_extended_attribute(
16128        self,
16129    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
16130        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
16131            Some((name, responder))
16132        } else {
16133            None
16134        }
16135    }
16136
16137    #[allow(irrefutable_let_patterns)]
16138    pub fn into_set_extended_attribute(
16139        self,
16140    ) -> Option<(
16141        Vec<u8>,
16142        ExtendedAttributeValue,
16143        SetExtendedAttributeMode,
16144        SymlinkSetExtendedAttributeResponder,
16145    )> {
16146        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
16147            Some((name, value, mode, responder))
16148        } else {
16149            None
16150        }
16151    }
16152
16153    #[allow(irrefutable_let_patterns)]
16154    pub fn into_remove_extended_attribute(
16155        self,
16156    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
16157        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
16158            Some((name, responder))
16159        } else {
16160            None
16161        }
16162    }
16163
16164    #[allow(irrefutable_let_patterns)]
16165    pub fn into_open(
16166        self,
16167    ) -> Option<(String, Flags, Options, fdomain_client::Channel, SymlinkControlHandle)> {
16168        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
16169            Some((path, flags, options, object, control_handle))
16170        } else {
16171            None
16172        }
16173    }
16174
16175    #[allow(irrefutable_let_patterns)]
16176    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
16177        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
16178    }
16179
16180    /// Name of the method defined in FIDL
16181    pub fn method_name(&self) -> &'static str {
16182        match *self {
16183            SymlinkRequest::LinkInto { .. } => "link_into",
16184            SymlinkRequest::Clone { .. } => "clone",
16185            SymlinkRequest::Close { .. } => "close",
16186            SymlinkRequest::Query { .. } => "query",
16187            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
16188            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
16189            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
16190            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
16191            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
16192            SymlinkRequest::GetFlags { .. } => "get_flags",
16193            SymlinkRequest::SetFlags { .. } => "set_flags",
16194            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
16195            SymlinkRequest::GetAttributes { .. } => "get_attributes",
16196            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
16197            SymlinkRequest::Sync { .. } => "sync",
16198            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
16199            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
16200            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
16201            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
16202            SymlinkRequest::Open { .. } => "open",
16203            SymlinkRequest::Describe { .. } => "describe",
16204            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16205                "unknown one-way method"
16206            }
16207            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16208                "unknown two-way method"
16209            }
16210        }
16211    }
16212}
16213
16214#[derive(Debug, Clone)]
16215pub struct SymlinkControlHandle {
16216    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
16217}
16218
16219impl SymlinkControlHandle {
16220    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
16221        self.inner.shutdown_with_epitaph(status.into())
16222    }
16223}
16224
16225impl fdomain_client::fidl::ControlHandle for SymlinkControlHandle {
16226    fn shutdown(&self) {
16227        self.inner.shutdown()
16228    }
16229
16230    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
16231        self.inner.shutdown_with_epitaph(status)
16232    }
16233
16234    fn is_closed(&self) -> bool {
16235        self.inner.channel().is_closed()
16236    }
16237    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
16238        self.inner.channel().on_closed()
16239    }
16240}
16241
16242impl SymlinkControlHandle {
16243    pub fn send_on_open_(
16244        &self,
16245        mut s: i32,
16246        mut info: Option<NodeInfoDeprecated>,
16247    ) -> Result<(), fidl::Error> {
16248        self.inner.send::<NodeOnOpenRequest>(
16249            (s, info.as_mut()),
16250            0,
16251            0x7fc7bbb1dbfd1972,
16252            fidl::encoding::DynamicFlags::FLEXIBLE,
16253        )
16254    }
16255
16256    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
16257        self.inner.send::<Representation>(
16258            &mut payload,
16259            0,
16260            0x5cb40567d80a510c,
16261            fidl::encoding::DynamicFlags::empty(),
16262        )
16263    }
16264}
16265
16266#[must_use = "FIDL methods require a response to be sent"]
16267#[derive(Debug)]
16268pub struct SymlinkLinkIntoResponder {
16269    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16270    tx_id: u32,
16271}
16272
16273/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16274/// if the responder is dropped without sending a response, so that the client
16275/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16276impl std::ops::Drop for SymlinkLinkIntoResponder {
16277    fn drop(&mut self) {
16278        self.control_handle.shutdown();
16279        // Safety: drops once, never accessed again
16280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16281    }
16282}
16283
16284impl fdomain_client::fidl::Responder for SymlinkLinkIntoResponder {
16285    type ControlHandle = SymlinkControlHandle;
16286
16287    fn control_handle(&self) -> &SymlinkControlHandle {
16288        &self.control_handle
16289    }
16290
16291    fn drop_without_shutdown(mut self) {
16292        // Safety: drops once, never accessed again due to mem::forget
16293        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16294        // Prevent Drop from running (which would shut down the channel)
16295        std::mem::forget(self);
16296    }
16297}
16298
16299impl SymlinkLinkIntoResponder {
16300    /// Sends a response to the FIDL transaction.
16301    ///
16302    /// Sets the channel to shutdown if an error occurs.
16303    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16304        let _result = self.send_raw(result);
16305        if _result.is_err() {
16306            self.control_handle.shutdown();
16307        }
16308        self.drop_without_shutdown();
16309        _result
16310    }
16311
16312    /// Similar to "send" but does not shutdown the channel if an error occurs.
16313    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16314        let _result = self.send_raw(result);
16315        self.drop_without_shutdown();
16316        _result
16317    }
16318
16319    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16320        self.control_handle
16321            .inner
16322            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16323                result,
16324                self.tx_id,
16325                0x54f3949246a03e74,
16326                fidl::encoding::DynamicFlags::empty(),
16327            )
16328    }
16329}
16330
16331#[must_use = "FIDL methods require a response to be sent"]
16332#[derive(Debug)]
16333pub struct SymlinkCloseResponder {
16334    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16335    tx_id: u32,
16336}
16337
16338/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16339/// if the responder is dropped without sending a response, so that the client
16340/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16341impl std::ops::Drop for SymlinkCloseResponder {
16342    fn drop(&mut self) {
16343        self.control_handle.shutdown();
16344        // Safety: drops once, never accessed again
16345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16346    }
16347}
16348
16349impl fdomain_client::fidl::Responder for SymlinkCloseResponder {
16350    type ControlHandle = SymlinkControlHandle;
16351
16352    fn control_handle(&self) -> &SymlinkControlHandle {
16353        &self.control_handle
16354    }
16355
16356    fn drop_without_shutdown(mut self) {
16357        // Safety: drops once, never accessed again due to mem::forget
16358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16359        // Prevent Drop from running (which would shut down the channel)
16360        std::mem::forget(self);
16361    }
16362}
16363
16364impl SymlinkCloseResponder {
16365    /// Sends a response to the FIDL transaction.
16366    ///
16367    /// Sets the channel to shutdown if an error occurs.
16368    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16369        let _result = self.send_raw(result);
16370        if _result.is_err() {
16371            self.control_handle.shutdown();
16372        }
16373        self.drop_without_shutdown();
16374        _result
16375    }
16376
16377    /// Similar to "send" but does not shutdown the channel if an error occurs.
16378    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16379        let _result = self.send_raw(result);
16380        self.drop_without_shutdown();
16381        _result
16382    }
16383
16384    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16385        self.control_handle
16386            .inner
16387            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16388                result,
16389                self.tx_id,
16390                0x5ac5d459ad7f657e,
16391                fidl::encoding::DynamicFlags::empty(),
16392            )
16393    }
16394}
16395
16396#[must_use = "FIDL methods require a response to be sent"]
16397#[derive(Debug)]
16398pub struct SymlinkQueryResponder {
16399    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16400    tx_id: u32,
16401}
16402
16403/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16404/// if the responder is dropped without sending a response, so that the client
16405/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16406impl std::ops::Drop for SymlinkQueryResponder {
16407    fn drop(&mut self) {
16408        self.control_handle.shutdown();
16409        // Safety: drops once, never accessed again
16410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16411    }
16412}
16413
16414impl fdomain_client::fidl::Responder for SymlinkQueryResponder {
16415    type ControlHandle = SymlinkControlHandle;
16416
16417    fn control_handle(&self) -> &SymlinkControlHandle {
16418        &self.control_handle
16419    }
16420
16421    fn drop_without_shutdown(mut self) {
16422        // Safety: drops once, never accessed again due to mem::forget
16423        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16424        // Prevent Drop from running (which would shut down the channel)
16425        std::mem::forget(self);
16426    }
16427}
16428
16429impl SymlinkQueryResponder {
16430    /// Sends a response to the FIDL transaction.
16431    ///
16432    /// Sets the channel to shutdown if an error occurs.
16433    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16434        let _result = self.send_raw(protocol);
16435        if _result.is_err() {
16436            self.control_handle.shutdown();
16437        }
16438        self.drop_without_shutdown();
16439        _result
16440    }
16441
16442    /// Similar to "send" but does not shutdown the channel if an error occurs.
16443    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16444        let _result = self.send_raw(protocol);
16445        self.drop_without_shutdown();
16446        _result
16447    }
16448
16449    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
16450        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
16451            (protocol,),
16452            self.tx_id,
16453            0x2658edee9decfc06,
16454            fidl::encoding::DynamicFlags::empty(),
16455        )
16456    }
16457}
16458
16459#[must_use = "FIDL methods require a response to be sent"]
16460#[derive(Debug)]
16461pub struct SymlinkDeprecatedGetAttrResponder {
16462    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16463    tx_id: u32,
16464}
16465
16466/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16467/// if the responder is dropped without sending a response, so that the client
16468/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16469impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
16470    fn drop(&mut self) {
16471        self.control_handle.shutdown();
16472        // Safety: drops once, never accessed again
16473        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16474    }
16475}
16476
16477impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetAttrResponder {
16478    type ControlHandle = SymlinkControlHandle;
16479
16480    fn control_handle(&self) -> &SymlinkControlHandle {
16481        &self.control_handle
16482    }
16483
16484    fn drop_without_shutdown(mut self) {
16485        // Safety: drops once, never accessed again due to mem::forget
16486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16487        // Prevent Drop from running (which would shut down the channel)
16488        std::mem::forget(self);
16489    }
16490}
16491
16492impl SymlinkDeprecatedGetAttrResponder {
16493    /// Sends a response to the FIDL transaction.
16494    ///
16495    /// Sets the channel to shutdown if an error occurs.
16496    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16497        let _result = self.send_raw(s, attributes);
16498        if _result.is_err() {
16499            self.control_handle.shutdown();
16500        }
16501        self.drop_without_shutdown();
16502        _result
16503    }
16504
16505    /// Similar to "send" but does not shutdown the channel if an error occurs.
16506    pub fn send_no_shutdown_on_err(
16507        self,
16508        mut s: i32,
16509        mut attributes: &NodeAttributes,
16510    ) -> Result<(), fidl::Error> {
16511        let _result = self.send_raw(s, attributes);
16512        self.drop_without_shutdown();
16513        _result
16514    }
16515
16516    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
16517        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
16518            (s, attributes),
16519            self.tx_id,
16520            0x78985e216314dafd,
16521            fidl::encoding::DynamicFlags::empty(),
16522        )
16523    }
16524}
16525
16526#[must_use = "FIDL methods require a response to be sent"]
16527#[derive(Debug)]
16528pub struct SymlinkDeprecatedSetAttrResponder {
16529    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16530    tx_id: u32,
16531}
16532
16533/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16534/// if the responder is dropped without sending a response, so that the client
16535/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16536impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
16537    fn drop(&mut self) {
16538        self.control_handle.shutdown();
16539        // Safety: drops once, never accessed again
16540        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16541    }
16542}
16543
16544impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetAttrResponder {
16545    type ControlHandle = SymlinkControlHandle;
16546
16547    fn control_handle(&self) -> &SymlinkControlHandle {
16548        &self.control_handle
16549    }
16550
16551    fn drop_without_shutdown(mut self) {
16552        // Safety: drops once, never accessed again due to mem::forget
16553        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16554        // Prevent Drop from running (which would shut down the channel)
16555        std::mem::forget(self);
16556    }
16557}
16558
16559impl SymlinkDeprecatedSetAttrResponder {
16560    /// Sends a response to the FIDL transaction.
16561    ///
16562    /// Sets the channel to shutdown if an error occurs.
16563    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16564        let _result = self.send_raw(s);
16565        if _result.is_err() {
16566            self.control_handle.shutdown();
16567        }
16568        self.drop_without_shutdown();
16569        _result
16570    }
16571
16572    /// Similar to "send" but does not shutdown the channel if an error occurs.
16573    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16574        let _result = self.send_raw(s);
16575        self.drop_without_shutdown();
16576        _result
16577    }
16578
16579    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16580        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
16581            (s,),
16582            self.tx_id,
16583            0x4186c0f40d938f46,
16584            fidl::encoding::DynamicFlags::empty(),
16585        )
16586    }
16587}
16588
16589#[must_use = "FIDL methods require a response to be sent"]
16590#[derive(Debug)]
16591pub struct SymlinkDeprecatedGetFlagsResponder {
16592    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16593    tx_id: u32,
16594}
16595
16596/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16597/// if the responder is dropped without sending a response, so that the client
16598/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16599impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
16600    fn drop(&mut self) {
16601        self.control_handle.shutdown();
16602        // Safety: drops once, never accessed again
16603        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16604    }
16605}
16606
16607impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetFlagsResponder {
16608    type ControlHandle = SymlinkControlHandle;
16609
16610    fn control_handle(&self) -> &SymlinkControlHandle {
16611        &self.control_handle
16612    }
16613
16614    fn drop_without_shutdown(mut self) {
16615        // Safety: drops once, never accessed again due to mem::forget
16616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16617        // Prevent Drop from running (which would shut down the channel)
16618        std::mem::forget(self);
16619    }
16620}
16621
16622impl SymlinkDeprecatedGetFlagsResponder {
16623    /// Sends a response to the FIDL transaction.
16624    ///
16625    /// Sets the channel to shutdown if an error occurs.
16626    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16627        let _result = self.send_raw(s, flags);
16628        if _result.is_err() {
16629            self.control_handle.shutdown();
16630        }
16631        self.drop_without_shutdown();
16632        _result
16633    }
16634
16635    /// Similar to "send" but does not shutdown the channel if an error occurs.
16636    pub fn send_no_shutdown_on_err(
16637        self,
16638        mut s: i32,
16639        mut flags: OpenFlags,
16640    ) -> Result<(), fidl::Error> {
16641        let _result = self.send_raw(s, flags);
16642        self.drop_without_shutdown();
16643        _result
16644    }
16645
16646    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16647        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
16648            (s, flags),
16649            self.tx_id,
16650            0x5b88fffb8eda3aa1,
16651            fidl::encoding::DynamicFlags::empty(),
16652        )
16653    }
16654}
16655
16656#[must_use = "FIDL methods require a response to be sent"]
16657#[derive(Debug)]
16658pub struct SymlinkDeprecatedSetFlagsResponder {
16659    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16660    tx_id: u32,
16661}
16662
16663/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16664/// if the responder is dropped without sending a response, so that the client
16665/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16666impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
16667    fn drop(&mut self) {
16668        self.control_handle.shutdown();
16669        // Safety: drops once, never accessed again
16670        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16671    }
16672}
16673
16674impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetFlagsResponder {
16675    type ControlHandle = SymlinkControlHandle;
16676
16677    fn control_handle(&self) -> &SymlinkControlHandle {
16678        &self.control_handle
16679    }
16680
16681    fn drop_without_shutdown(mut self) {
16682        // Safety: drops once, never accessed again due to mem::forget
16683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16684        // Prevent Drop from running (which would shut down the channel)
16685        std::mem::forget(self);
16686    }
16687}
16688
16689impl SymlinkDeprecatedSetFlagsResponder {
16690    /// Sends a response to the FIDL transaction.
16691    ///
16692    /// Sets the channel to shutdown if an error occurs.
16693    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16694        let _result = self.send_raw(s);
16695        if _result.is_err() {
16696            self.control_handle.shutdown();
16697        }
16698        self.drop_without_shutdown();
16699        _result
16700    }
16701
16702    /// Similar to "send" but does not shutdown the channel if an error occurs.
16703    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16704        let _result = self.send_raw(s);
16705        self.drop_without_shutdown();
16706        _result
16707    }
16708
16709    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16710        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
16711            (s,),
16712            self.tx_id,
16713            0x5295b76c71fde733,
16714            fidl::encoding::DynamicFlags::empty(),
16715        )
16716    }
16717}
16718
16719#[must_use = "FIDL methods require a response to be sent"]
16720#[derive(Debug)]
16721pub struct SymlinkGetFlagsResponder {
16722    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16723    tx_id: u32,
16724}
16725
16726/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16727/// if the responder is dropped without sending a response, so that the client
16728/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16729impl std::ops::Drop for SymlinkGetFlagsResponder {
16730    fn drop(&mut self) {
16731        self.control_handle.shutdown();
16732        // Safety: drops once, never accessed again
16733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16734    }
16735}
16736
16737impl fdomain_client::fidl::Responder for SymlinkGetFlagsResponder {
16738    type ControlHandle = SymlinkControlHandle;
16739
16740    fn control_handle(&self) -> &SymlinkControlHandle {
16741        &self.control_handle
16742    }
16743
16744    fn drop_without_shutdown(mut self) {
16745        // Safety: drops once, never accessed again due to mem::forget
16746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16747        // Prevent Drop from running (which would shut down the channel)
16748        std::mem::forget(self);
16749    }
16750}
16751
16752impl SymlinkGetFlagsResponder {
16753    /// Sends a response to the FIDL transaction.
16754    ///
16755    /// Sets the channel to shutdown if an error occurs.
16756    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16757        let _result = self.send_raw(result);
16758        if _result.is_err() {
16759            self.control_handle.shutdown();
16760        }
16761        self.drop_without_shutdown();
16762        _result
16763    }
16764
16765    /// Similar to "send" but does not shutdown the channel if an error occurs.
16766    pub fn send_no_shutdown_on_err(
16767        self,
16768        mut result: Result<Flags, i32>,
16769    ) -> Result<(), fidl::Error> {
16770        let _result = self.send_raw(result);
16771        self.drop_without_shutdown();
16772        _result
16773    }
16774
16775    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16776        self.control_handle
16777            .inner
16778            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
16779                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
16780                self.tx_id,
16781                0x176eb318f64ec23,
16782                fidl::encoding::DynamicFlags::FLEXIBLE,
16783            )
16784    }
16785}
16786
16787#[must_use = "FIDL methods require a response to be sent"]
16788#[derive(Debug)]
16789pub struct SymlinkSetFlagsResponder {
16790    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16791    tx_id: u32,
16792}
16793
16794/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16795/// if the responder is dropped without sending a response, so that the client
16796/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16797impl std::ops::Drop for SymlinkSetFlagsResponder {
16798    fn drop(&mut self) {
16799        self.control_handle.shutdown();
16800        // Safety: drops once, never accessed again
16801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16802    }
16803}
16804
16805impl fdomain_client::fidl::Responder for SymlinkSetFlagsResponder {
16806    type ControlHandle = SymlinkControlHandle;
16807
16808    fn control_handle(&self) -> &SymlinkControlHandle {
16809        &self.control_handle
16810    }
16811
16812    fn drop_without_shutdown(mut self) {
16813        // Safety: drops once, never accessed again due to mem::forget
16814        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16815        // Prevent Drop from running (which would shut down the channel)
16816        std::mem::forget(self);
16817    }
16818}
16819
16820impl SymlinkSetFlagsResponder {
16821    /// Sends a response to the FIDL transaction.
16822    ///
16823    /// Sets the channel to shutdown if an error occurs.
16824    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16825        let _result = self.send_raw(result);
16826        if _result.is_err() {
16827            self.control_handle.shutdown();
16828        }
16829        self.drop_without_shutdown();
16830        _result
16831    }
16832
16833    /// Similar to "send" but does not shutdown the channel if an error occurs.
16834    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16835        let _result = self.send_raw(result);
16836        self.drop_without_shutdown();
16837        _result
16838    }
16839
16840    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16841        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
16842            fidl::encoding::EmptyStruct,
16843            i32,
16844        >>(
16845            fidl::encoding::FlexibleResult::new(result),
16846            self.tx_id,
16847            0x55a8028685791ea8,
16848            fidl::encoding::DynamicFlags::FLEXIBLE,
16849        )
16850    }
16851}
16852
16853#[must_use = "FIDL methods require a response to be sent"]
16854#[derive(Debug)]
16855pub struct SymlinkQueryFilesystemResponder {
16856    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16857    tx_id: u32,
16858}
16859
16860/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16861/// if the responder is dropped without sending a response, so that the client
16862/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16863impl std::ops::Drop for SymlinkQueryFilesystemResponder {
16864    fn drop(&mut self) {
16865        self.control_handle.shutdown();
16866        // Safety: drops once, never accessed again
16867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16868    }
16869}
16870
16871impl fdomain_client::fidl::Responder for SymlinkQueryFilesystemResponder {
16872    type ControlHandle = SymlinkControlHandle;
16873
16874    fn control_handle(&self) -> &SymlinkControlHandle {
16875        &self.control_handle
16876    }
16877
16878    fn drop_without_shutdown(mut self) {
16879        // Safety: drops once, never accessed again due to mem::forget
16880        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16881        // Prevent Drop from running (which would shut down the channel)
16882        std::mem::forget(self);
16883    }
16884}
16885
16886impl SymlinkQueryFilesystemResponder {
16887    /// Sends a response to the FIDL transaction.
16888    ///
16889    /// Sets the channel to shutdown if an error occurs.
16890    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16891        let _result = self.send_raw(s, info);
16892        if _result.is_err() {
16893            self.control_handle.shutdown();
16894        }
16895        self.drop_without_shutdown();
16896        _result
16897    }
16898
16899    /// Similar to "send" but does not shutdown the channel if an error occurs.
16900    pub fn send_no_shutdown_on_err(
16901        self,
16902        mut s: i32,
16903        mut info: Option<&FilesystemInfo>,
16904    ) -> Result<(), fidl::Error> {
16905        let _result = self.send_raw(s, info);
16906        self.drop_without_shutdown();
16907        _result
16908    }
16909
16910    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16911        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
16912            (s, info),
16913            self.tx_id,
16914            0x6f344a1c6b0a0610,
16915            fidl::encoding::DynamicFlags::empty(),
16916        )
16917    }
16918}
16919
16920#[must_use = "FIDL methods require a response to be sent"]
16921#[derive(Debug)]
16922pub struct SymlinkGetAttributesResponder {
16923    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16924    tx_id: u32,
16925}
16926
16927/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16928/// if the responder is dropped without sending a response, so that the client
16929/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16930impl std::ops::Drop for SymlinkGetAttributesResponder {
16931    fn drop(&mut self) {
16932        self.control_handle.shutdown();
16933        // Safety: drops once, never accessed again
16934        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16935    }
16936}
16937
16938impl fdomain_client::fidl::Responder for SymlinkGetAttributesResponder {
16939    type ControlHandle = SymlinkControlHandle;
16940
16941    fn control_handle(&self) -> &SymlinkControlHandle {
16942        &self.control_handle
16943    }
16944
16945    fn drop_without_shutdown(mut self) {
16946        // Safety: drops once, never accessed again due to mem::forget
16947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16948        // Prevent Drop from running (which would shut down the channel)
16949        std::mem::forget(self);
16950    }
16951}
16952
16953impl SymlinkGetAttributesResponder {
16954    /// Sends a response to the FIDL transaction.
16955    ///
16956    /// Sets the channel to shutdown if an error occurs.
16957    pub fn send(
16958        self,
16959        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16960    ) -> Result<(), fidl::Error> {
16961        let _result = self.send_raw(result);
16962        if _result.is_err() {
16963            self.control_handle.shutdown();
16964        }
16965        self.drop_without_shutdown();
16966        _result
16967    }
16968
16969    /// Similar to "send" but does not shutdown the channel if an error occurs.
16970    pub fn send_no_shutdown_on_err(
16971        self,
16972        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16973    ) -> Result<(), fidl::Error> {
16974        let _result = self.send_raw(result);
16975        self.drop_without_shutdown();
16976        _result
16977    }
16978
16979    fn send_raw(
16980        &self,
16981        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16982    ) -> Result<(), fidl::Error> {
16983        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16984            result,
16985            self.tx_id,
16986            0x3d4396a638ea053b,
16987            fidl::encoding::DynamicFlags::empty(),
16988        )
16989    }
16990}
16991
16992#[must_use = "FIDL methods require a response to be sent"]
16993#[derive(Debug)]
16994pub struct SymlinkUpdateAttributesResponder {
16995    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16996    tx_id: u32,
16997}
16998
16999/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17000/// if the responder is dropped without sending a response, so that the client
17001/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17002impl std::ops::Drop for SymlinkUpdateAttributesResponder {
17003    fn drop(&mut self) {
17004        self.control_handle.shutdown();
17005        // Safety: drops once, never accessed again
17006        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17007    }
17008}
17009
17010impl fdomain_client::fidl::Responder for SymlinkUpdateAttributesResponder {
17011    type ControlHandle = SymlinkControlHandle;
17012
17013    fn control_handle(&self) -> &SymlinkControlHandle {
17014        &self.control_handle
17015    }
17016
17017    fn drop_without_shutdown(mut self) {
17018        // Safety: drops once, never accessed again due to mem::forget
17019        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17020        // Prevent Drop from running (which would shut down the channel)
17021        std::mem::forget(self);
17022    }
17023}
17024
17025impl SymlinkUpdateAttributesResponder {
17026    /// Sends a response to the FIDL transaction.
17027    ///
17028    /// Sets the channel to shutdown if an error occurs.
17029    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17030        let _result = self.send_raw(result);
17031        if _result.is_err() {
17032            self.control_handle.shutdown();
17033        }
17034        self.drop_without_shutdown();
17035        _result
17036    }
17037
17038    /// Similar to "send" but does not shutdown the channel if an error occurs.
17039    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17040        let _result = self.send_raw(result);
17041        self.drop_without_shutdown();
17042        _result
17043    }
17044
17045    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17046        self.control_handle
17047            .inner
17048            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17049                result,
17050                self.tx_id,
17051                0x3308c1da5a89bf08,
17052                fidl::encoding::DynamicFlags::empty(),
17053            )
17054    }
17055}
17056
17057#[must_use = "FIDL methods require a response to be sent"]
17058#[derive(Debug)]
17059pub struct SymlinkSyncResponder {
17060    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17061    tx_id: u32,
17062}
17063
17064/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17065/// if the responder is dropped without sending a response, so that the client
17066/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17067impl std::ops::Drop for SymlinkSyncResponder {
17068    fn drop(&mut self) {
17069        self.control_handle.shutdown();
17070        // Safety: drops once, never accessed again
17071        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17072    }
17073}
17074
17075impl fdomain_client::fidl::Responder for SymlinkSyncResponder {
17076    type ControlHandle = SymlinkControlHandle;
17077
17078    fn control_handle(&self) -> &SymlinkControlHandle {
17079        &self.control_handle
17080    }
17081
17082    fn drop_without_shutdown(mut self) {
17083        // Safety: drops once, never accessed again due to mem::forget
17084        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17085        // Prevent Drop from running (which would shut down the channel)
17086        std::mem::forget(self);
17087    }
17088}
17089
17090impl SymlinkSyncResponder {
17091    /// Sends a response to the FIDL transaction.
17092    ///
17093    /// Sets the channel to shutdown if an error occurs.
17094    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17095        let _result = self.send_raw(result);
17096        if _result.is_err() {
17097            self.control_handle.shutdown();
17098        }
17099        self.drop_without_shutdown();
17100        _result
17101    }
17102
17103    /// Similar to "send" but does not shutdown the channel if an error occurs.
17104    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17105        let _result = self.send_raw(result);
17106        self.drop_without_shutdown();
17107        _result
17108    }
17109
17110    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17111        self.control_handle
17112            .inner
17113            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17114                result,
17115                self.tx_id,
17116                0x2c5c27ca0ab5dc49,
17117                fidl::encoding::DynamicFlags::empty(),
17118            )
17119    }
17120}
17121
17122#[must_use = "FIDL methods require a response to be sent"]
17123#[derive(Debug)]
17124pub struct SymlinkGetExtendedAttributeResponder {
17125    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17126    tx_id: u32,
17127}
17128
17129/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17130/// if the responder is dropped without sending a response, so that the client
17131/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17132impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
17133    fn drop(&mut self) {
17134        self.control_handle.shutdown();
17135        // Safety: drops once, never accessed again
17136        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17137    }
17138}
17139
17140impl fdomain_client::fidl::Responder for SymlinkGetExtendedAttributeResponder {
17141    type ControlHandle = SymlinkControlHandle;
17142
17143    fn control_handle(&self) -> &SymlinkControlHandle {
17144        &self.control_handle
17145    }
17146
17147    fn drop_without_shutdown(mut self) {
17148        // Safety: drops once, never accessed again due to mem::forget
17149        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17150        // Prevent Drop from running (which would shut down the channel)
17151        std::mem::forget(self);
17152    }
17153}
17154
17155impl SymlinkGetExtendedAttributeResponder {
17156    /// Sends a response to the FIDL transaction.
17157    ///
17158    /// Sets the channel to shutdown if an error occurs.
17159    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17160        let _result = self.send_raw(result);
17161        if _result.is_err() {
17162            self.control_handle.shutdown();
17163        }
17164        self.drop_without_shutdown();
17165        _result
17166    }
17167
17168    /// Similar to "send" but does not shutdown the channel if an error occurs.
17169    pub fn send_no_shutdown_on_err(
17170        self,
17171        mut result: Result<ExtendedAttributeValue, i32>,
17172    ) -> Result<(), fidl::Error> {
17173        let _result = self.send_raw(result);
17174        self.drop_without_shutdown();
17175        _result
17176    }
17177
17178    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
17179        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
17180            result.as_mut().map_err(|e| *e),
17181            self.tx_id,
17182            0x45ffa3ccfdeb76db,
17183            fidl::encoding::DynamicFlags::empty(),
17184        )
17185    }
17186}
17187
17188#[must_use = "FIDL methods require a response to be sent"]
17189#[derive(Debug)]
17190pub struct SymlinkSetExtendedAttributeResponder {
17191    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17192    tx_id: u32,
17193}
17194
17195/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17196/// if the responder is dropped without sending a response, so that the client
17197/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17198impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
17199    fn drop(&mut self) {
17200        self.control_handle.shutdown();
17201        // Safety: drops once, never accessed again
17202        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17203    }
17204}
17205
17206impl fdomain_client::fidl::Responder for SymlinkSetExtendedAttributeResponder {
17207    type ControlHandle = SymlinkControlHandle;
17208
17209    fn control_handle(&self) -> &SymlinkControlHandle {
17210        &self.control_handle
17211    }
17212
17213    fn drop_without_shutdown(mut self) {
17214        // Safety: drops once, never accessed again due to mem::forget
17215        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17216        // Prevent Drop from running (which would shut down the channel)
17217        std::mem::forget(self);
17218    }
17219}
17220
17221impl SymlinkSetExtendedAttributeResponder {
17222    /// Sends a response to the FIDL transaction.
17223    ///
17224    /// Sets the channel to shutdown if an error occurs.
17225    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17226        let _result = self.send_raw(result);
17227        if _result.is_err() {
17228            self.control_handle.shutdown();
17229        }
17230        self.drop_without_shutdown();
17231        _result
17232    }
17233
17234    /// Similar to "send" but does not shutdown the channel if an error occurs.
17235    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17236        let _result = self.send_raw(result);
17237        self.drop_without_shutdown();
17238        _result
17239    }
17240
17241    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17242        self.control_handle
17243            .inner
17244            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17245                result,
17246                self.tx_id,
17247                0x4a951362f681f23c,
17248                fidl::encoding::DynamicFlags::empty(),
17249            )
17250    }
17251}
17252
17253#[must_use = "FIDL methods require a response to be sent"]
17254#[derive(Debug)]
17255pub struct SymlinkRemoveExtendedAttributeResponder {
17256    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17257    tx_id: u32,
17258}
17259
17260/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17261/// if the responder is dropped without sending a response, so that the client
17262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17263impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
17264    fn drop(&mut self) {
17265        self.control_handle.shutdown();
17266        // Safety: drops once, never accessed again
17267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17268    }
17269}
17270
17271impl fdomain_client::fidl::Responder for SymlinkRemoveExtendedAttributeResponder {
17272    type ControlHandle = SymlinkControlHandle;
17273
17274    fn control_handle(&self) -> &SymlinkControlHandle {
17275        &self.control_handle
17276    }
17277
17278    fn drop_without_shutdown(mut self) {
17279        // Safety: drops once, never accessed again due to mem::forget
17280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17281        // Prevent Drop from running (which would shut down the channel)
17282        std::mem::forget(self);
17283    }
17284}
17285
17286impl SymlinkRemoveExtendedAttributeResponder {
17287    /// Sends a response to the FIDL transaction.
17288    ///
17289    /// Sets the channel to shutdown if an error occurs.
17290    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17291        let _result = self.send_raw(result);
17292        if _result.is_err() {
17293            self.control_handle.shutdown();
17294        }
17295        self.drop_without_shutdown();
17296        _result
17297    }
17298
17299    /// Similar to "send" but does not shutdown the channel if an error occurs.
17300    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17301        let _result = self.send_raw(result);
17302        self.drop_without_shutdown();
17303        _result
17304    }
17305
17306    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
17307        self.control_handle
17308            .inner
17309            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
17310                result,
17311                self.tx_id,
17312                0x7a0b9f3a9bf9032d,
17313                fidl::encoding::DynamicFlags::empty(),
17314            )
17315    }
17316}
17317
17318#[must_use = "FIDL methods require a response to be sent"]
17319#[derive(Debug)]
17320pub struct SymlinkDescribeResponder {
17321    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
17322    tx_id: u32,
17323}
17324
17325/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
17326/// if the responder is dropped without sending a response, so that the client
17327/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17328impl std::ops::Drop for SymlinkDescribeResponder {
17329    fn drop(&mut self) {
17330        self.control_handle.shutdown();
17331        // Safety: drops once, never accessed again
17332        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17333    }
17334}
17335
17336impl fdomain_client::fidl::Responder for SymlinkDescribeResponder {
17337    type ControlHandle = SymlinkControlHandle;
17338
17339    fn control_handle(&self) -> &SymlinkControlHandle {
17340        &self.control_handle
17341    }
17342
17343    fn drop_without_shutdown(mut self) {
17344        // Safety: drops once, never accessed again due to mem::forget
17345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17346        // Prevent Drop from running (which would shut down the channel)
17347        std::mem::forget(self);
17348    }
17349}
17350
17351impl SymlinkDescribeResponder {
17352    /// Sends a response to the FIDL transaction.
17353    ///
17354    /// Sets the channel to shutdown if an error occurs.
17355    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17356        let _result = self.send_raw(payload);
17357        if _result.is_err() {
17358            self.control_handle.shutdown();
17359        }
17360        self.drop_without_shutdown();
17361        _result
17362    }
17363
17364    /// Similar to "send" but does not shutdown the channel if an error occurs.
17365    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17366        let _result = self.send_raw(payload);
17367        self.drop_without_shutdown();
17368        _result
17369    }
17370
17371    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
17372        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
17373            fidl::encoding::Flexible::new(payload),
17374            self.tx_id,
17375            0x742c2ea5e89831f3,
17376            fidl::encoding::DynamicFlags::FLEXIBLE,
17377        )
17378    }
17379}
17380
17381#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17382pub struct WritableMarker;
17383
17384impl fdomain_client::fidl::ProtocolMarker for WritableMarker {
17385    type Proxy = WritableProxy;
17386    type RequestStream = WritableRequestStream;
17387
17388    const DEBUG_NAME: &'static str = "(anonymous) Writable";
17389}
17390pub type WritableWriteResult = Result<u64, i32>;
17391
17392pub trait WritableProxyInterface: Send + Sync {
17393    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
17394        + Send;
17395    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
17396}
17397
17398#[derive(Debug, Clone)]
17399pub struct WritableProxy {
17400    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
17401}
17402
17403impl fdomain_client::fidl::Proxy for WritableProxy {
17404    type Protocol = WritableMarker;
17405
17406    fn from_channel(inner: fdomain_client::Channel) -> Self {
17407        Self::new(inner)
17408    }
17409
17410    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
17411        self.client.into_channel().map_err(|client| Self { client })
17412    }
17413
17414    fn as_channel(&self) -> &fdomain_client::Channel {
17415        self.client.as_channel()
17416    }
17417}
17418
17419impl WritableProxy {
17420    /// Create a new Proxy for fuchsia.io/Writable.
17421    pub fn new(channel: fdomain_client::Channel) -> Self {
17422        let protocol_name = <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
17423        Self { client: fidl::client::Client::new(channel, protocol_name) }
17424    }
17425
17426    /// Get a Stream of events from the remote end of the protocol.
17427    ///
17428    /// # Panics
17429    ///
17430    /// Panics if the event stream was already taken.
17431    pub fn take_event_stream(&self) -> WritableEventStream {
17432        WritableEventStream { event_receiver: self.client.take_event_receiver() }
17433    }
17434
17435    /// Writes data at the seek offset.
17436    /// The seek offset is moved forward by the number of bytes written.
17437    /// If the file is in append mode, the seek offset is first set to the end
17438    /// of the file, followed by the write, in one atomic step.
17439    ///
17440    /// The file size may grow if the seek offset plus `data.length` is beyond
17441    /// the current end of file.
17442    ///
17443    /// + request `data` the byte buffer to write to the file.
17444    /// - response `actual_count` the number of bytes written.
17445    ///
17446    /// ## Invariants
17447    ///
17448    /// * The returned `actual_count` will never be greater than `data.length`.
17449    /// * If the server is unable to write all the data due to e.g. not enough
17450    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17451    ///   could be written, an error is returned.
17452    /// * If `data.length` is zero, the server should perform all the checks
17453    ///   ensuring write access without mutating the file and return a
17454    ///   successful write of zero bytes.  The seek offset is still updated if
17455    ///   in append mode.
17456    ///
17457    /// This method requires the [`Rights.WRITE_BYTES`] right.
17458    pub fn r#write(
17459        &self,
17460        mut data: &[u8],
17461    ) -> fidl::client::QueryResponseFut<
17462        WritableWriteResult,
17463        fdomain_client::fidl::FDomainResourceDialect,
17464    > {
17465        WritableProxyInterface::r#write(self, data)
17466    }
17467}
17468
17469impl WritableProxyInterface for WritableProxy {
17470    type WriteResponseFut = fidl::client::QueryResponseFut<
17471        WritableWriteResult,
17472        fdomain_client::fidl::FDomainResourceDialect,
17473    >;
17474    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
17475        fn _decode(
17476            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17477        ) -> Result<WritableWriteResult, fidl::Error> {
17478            let _response = fidl::client::decode_transaction_body::<
17479                fidl::encoding::ResultType<WritableWriteResponse, i32>,
17480                fdomain_client::fidl::FDomainResourceDialect,
17481                0x6a31437832469f82,
17482            >(_buf?)?;
17483            Ok(_response.map(|x| x.actual_count))
17484        }
17485        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
17486            (data,),
17487            0x6a31437832469f82,
17488            fidl::encoding::DynamicFlags::empty(),
17489            _decode,
17490        )
17491    }
17492}
17493
17494pub struct WritableEventStream {
17495    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
17496}
17497
17498impl std::marker::Unpin for WritableEventStream {}
17499
17500impl futures::stream::FusedStream for WritableEventStream {
17501    fn is_terminated(&self) -> bool {
17502        self.event_receiver.is_terminated()
17503    }
17504}
17505
17506impl futures::Stream for WritableEventStream {
17507    type Item = Result<WritableEvent, fidl::Error>;
17508
17509    fn poll_next(
17510        mut self: std::pin::Pin<&mut Self>,
17511        cx: &mut std::task::Context<'_>,
17512    ) -> std::task::Poll<Option<Self::Item>> {
17513        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
17514            &mut self.event_receiver,
17515            cx
17516        )?) {
17517            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
17518            None => std::task::Poll::Ready(None),
17519        }
17520    }
17521}
17522
17523#[derive(Debug)]
17524pub enum WritableEvent {}
17525
17526impl WritableEvent {
17527    /// Decodes a message buffer as a [`WritableEvent`].
17528    fn decode(
17529        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
17530    ) -> Result<WritableEvent, fidl::Error> {
17531        let (bytes, _handles) = buf.split_mut();
17532        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17533        debug_assert_eq!(tx_header.tx_id, 0);
17534        match tx_header.ordinal {
17535            _ => Err(fidl::Error::UnknownOrdinal {
17536                ordinal: tx_header.ordinal,
17537                protocol_name: <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17538            }),
17539        }
17540    }
17541}
17542
17543/// A Stream of incoming requests for fuchsia.io/Writable.
17544pub struct WritableRequestStream {
17545    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17546    is_terminated: bool,
17547}
17548
17549impl std::marker::Unpin for WritableRequestStream {}
17550
17551impl futures::stream::FusedStream for WritableRequestStream {
17552    fn is_terminated(&self) -> bool {
17553        self.is_terminated
17554    }
17555}
17556
17557impl fdomain_client::fidl::RequestStream for WritableRequestStream {
17558    type Protocol = WritableMarker;
17559    type ControlHandle = WritableControlHandle;
17560
17561    fn from_channel(channel: fdomain_client::Channel) -> Self {
17562        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17563    }
17564
17565    fn control_handle(&self) -> Self::ControlHandle {
17566        WritableControlHandle { inner: self.inner.clone() }
17567    }
17568
17569    fn into_inner(
17570        self,
17571    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
17572    {
17573        (self.inner, self.is_terminated)
17574    }
17575
17576    fn from_inner(
17577        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17578        is_terminated: bool,
17579    ) -> Self {
17580        Self { inner, is_terminated }
17581    }
17582}
17583
17584impl futures::Stream for WritableRequestStream {
17585    type Item = Result<WritableRequest, fidl::Error>;
17586
17587    fn poll_next(
17588        mut self: std::pin::Pin<&mut Self>,
17589        cx: &mut std::task::Context<'_>,
17590    ) -> std::task::Poll<Option<Self::Item>> {
17591        let this = &mut *self;
17592        if this.inner.check_shutdown(cx) {
17593            this.is_terminated = true;
17594            return std::task::Poll::Ready(None);
17595        }
17596        if this.is_terminated {
17597            panic!("polled WritableRequestStream after completion");
17598        }
17599        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
17600            |bytes, handles| {
17601                match this.inner.channel().read_etc(cx, bytes, handles) {
17602                    std::task::Poll::Ready(Ok(())) => {}
17603                    std::task::Poll::Pending => return std::task::Poll::Pending,
17604                    std::task::Poll::Ready(Err(None)) => {
17605                        this.is_terminated = true;
17606                        return std::task::Poll::Ready(None);
17607                    }
17608                    std::task::Poll::Ready(Err(Some(e))) => {
17609                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17610                            e.into(),
17611                        ))));
17612                    }
17613                }
17614
17615                // A message has been received from the channel
17616                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17617
17618                std::task::Poll::Ready(Some(match header.ordinal {
17619                    0x6a31437832469f82 => {
17620                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17621                        let mut req = fidl::new_empty!(
17622                            WritableWriteRequest,
17623                            fdomain_client::fidl::FDomainResourceDialect
17624                        );
17625                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
17626                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
17627                        Ok(WritableRequest::Write {
17628                            data: req.data,
17629
17630                            responder: WritableWriteResponder {
17631                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17632                                tx_id: header.tx_id,
17633                            },
17634                        })
17635                    }
17636                    _ => Err(fidl::Error::UnknownOrdinal {
17637                        ordinal: header.ordinal,
17638                        protocol_name:
17639                            <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17640                    }),
17641                }))
17642            },
17643        )
17644    }
17645}
17646
17647#[derive(Debug)]
17648pub enum WritableRequest {
17649    /// Writes data at the seek offset.
17650    /// The seek offset is moved forward by the number of bytes written.
17651    /// If the file is in append mode, the seek offset is first set to the end
17652    /// of the file, followed by the write, in one atomic step.
17653    ///
17654    /// The file size may grow if the seek offset plus `data.length` is beyond
17655    /// the current end of file.
17656    ///
17657    /// + request `data` the byte buffer to write to the file.
17658    /// - response `actual_count` the number of bytes written.
17659    ///
17660    /// ## Invariants
17661    ///
17662    /// * The returned `actual_count` will never be greater than `data.length`.
17663    /// * If the server is unable to write all the data due to e.g. not enough
17664    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17665    ///   could be written, an error is returned.
17666    /// * If `data.length` is zero, the server should perform all the checks
17667    ///   ensuring write access without mutating the file and return a
17668    ///   successful write of zero bytes.  The seek offset is still updated if
17669    ///   in append mode.
17670    ///
17671    /// This method requires the [`Rights.WRITE_BYTES`] right.
17672    Write { data: Vec<u8>, responder: WritableWriteResponder },
17673}
17674
17675impl WritableRequest {
17676    #[allow(irrefutable_let_patterns)]
17677    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
17678        if let WritableRequest::Write { data, responder } = self {
17679            Some((data, responder))
17680        } else {
17681            None
17682        }
17683    }
17684
17685    /// Name of the method defined in FIDL
17686    pub fn method_name(&self) -> &'static str {
17687        match *self {
17688            WritableRequest::Write { .. } => "write",
17689        }
17690    }
17691}
17692
17693#[derive(Debug, Clone)]
17694pub struct WritableControlHandle {
17695    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17696}
17697
17698impl WritableControlHandle {
17699    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
17700        self.inner.shutdown_with_epitaph(status.into())
17701    }
17702}
17703
17704impl fdomain_client::fidl::ControlHandle for WritableControlHandle {
17705    fn shutdown(&self) {
17706        self.inner.shutdown()
17707    }
17708
17709    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
17710        self.inner.shutdown_with_epitaph(status)
17711    }
17712
17713    fn is_closed(&self) -> bool {
17714        self.inner.channel().is_closed()
17715    }
17716    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
17717        self.inner.channel().on_closed()
17718    }
17719}
17720
17721impl WritableControlHandle {}
17722
17723#[must_use = "FIDL methods require a response to be sent"]
17724#[derive(Debug)]
17725pub struct WritableWriteResponder {
17726    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
17727    tx_id: u32,
17728}
17729
17730/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
17731/// if the responder is dropped without sending a response, so that the client
17732/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17733impl std::ops::Drop for WritableWriteResponder {
17734    fn drop(&mut self) {
17735        self.control_handle.shutdown();
17736        // Safety: drops once, never accessed again
17737        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17738    }
17739}
17740
17741impl fdomain_client::fidl::Responder for WritableWriteResponder {
17742    type ControlHandle = WritableControlHandle;
17743
17744    fn control_handle(&self) -> &WritableControlHandle {
17745        &self.control_handle
17746    }
17747
17748    fn drop_without_shutdown(mut self) {
17749        // Safety: drops once, never accessed again due to mem::forget
17750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17751        // Prevent Drop from running (which would shut down the channel)
17752        std::mem::forget(self);
17753    }
17754}
17755
17756impl WritableWriteResponder {
17757    /// Sends a response to the FIDL transaction.
17758    ///
17759    /// Sets the channel to shutdown if an error occurs.
17760    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17761        let _result = self.send_raw(result);
17762        if _result.is_err() {
17763            self.control_handle.shutdown();
17764        }
17765        self.drop_without_shutdown();
17766        _result
17767    }
17768
17769    /// Similar to "send" but does not shutdown the channel if an error occurs.
17770    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17771        let _result = self.send_raw(result);
17772        self.drop_without_shutdown();
17773        _result
17774    }
17775
17776    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17777        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
17778            result.map(|actual_count| (actual_count,)),
17779            self.tx_id,
17780            0x6a31437832469f82,
17781            fidl::encoding::DynamicFlags::empty(),
17782        )
17783    }
17784}
17785
17786mod internal {
17787    use super::*;
17788
17789    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
17790        type Borrowed<'a> = &'a mut Self;
17791        fn take_or_borrow<'a>(
17792            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17793        ) -> Self::Borrowed<'a> {
17794            value
17795        }
17796    }
17797
17798    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
17799        type Owned = Self;
17800
17801        #[inline(always)]
17802        fn inline_align(_context: fidl::encoding::Context) -> usize {
17803            8
17804        }
17805
17806        #[inline(always)]
17807        fn inline_size(_context: fidl::encoding::Context) -> usize {
17808            40
17809        }
17810    }
17811
17812    unsafe impl
17813        fidl::encoding::Encode<
17814            DirectoryCreateSymlinkRequest,
17815            fdomain_client::fidl::FDomainResourceDialect,
17816        > for &mut DirectoryCreateSymlinkRequest
17817    {
17818        #[inline]
17819        unsafe fn encode(
17820            self,
17821            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17822            offset: usize,
17823            _depth: fidl::encoding::Depth,
17824        ) -> fidl::Result<()> {
17825            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17826            // Delegate to tuple encoding.
17827            fidl::encoding::Encode::<
17828                DirectoryCreateSymlinkRequest,
17829                fdomain_client::fidl::FDomainResourceDialect,
17830            >::encode(
17831                (
17832                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17833                        &self.name,
17834                    ),
17835                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
17836                        &self.target,
17837                    ),
17838                    <fidl::encoding::Optional<
17839                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17840                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17841                        &mut self.connection
17842                    ),
17843                ),
17844                encoder,
17845                offset,
17846                _depth,
17847            )
17848        }
17849    }
17850    unsafe impl<
17851        T0: fidl::encoding::Encode<
17852                fidl::encoding::BoundedString<255>,
17853                fdomain_client::fidl::FDomainResourceDialect,
17854            >,
17855        T1: fidl::encoding::Encode<
17856                fidl::encoding::Vector<u8, 4095>,
17857                fdomain_client::fidl::FDomainResourceDialect,
17858            >,
17859        T2: fidl::encoding::Encode<
17860                fidl::encoding::Optional<
17861                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17862                >,
17863                fdomain_client::fidl::FDomainResourceDialect,
17864            >,
17865    >
17866        fidl::encoding::Encode<
17867            DirectoryCreateSymlinkRequest,
17868            fdomain_client::fidl::FDomainResourceDialect,
17869        > for (T0, T1, T2)
17870    {
17871        #[inline]
17872        unsafe fn encode(
17873            self,
17874            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17875            offset: usize,
17876            depth: fidl::encoding::Depth,
17877        ) -> fidl::Result<()> {
17878            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17879            // Zero out padding regions. There's no need to apply masks
17880            // because the unmasked parts will be overwritten by fields.
17881            unsafe {
17882                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
17883                (ptr as *mut u64).write_unaligned(0);
17884            }
17885            // Write the fields.
17886            self.0.encode(encoder, offset + 0, depth)?;
17887            self.1.encode(encoder, offset + 16, depth)?;
17888            self.2.encode(encoder, offset + 32, depth)?;
17889            Ok(())
17890        }
17891    }
17892
17893    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17894        for DirectoryCreateSymlinkRequest
17895    {
17896        #[inline(always)]
17897        fn new_empty() -> Self {
17898            Self {
17899                name: fidl::new_empty!(
17900                    fidl::encoding::BoundedString<255>,
17901                    fdomain_client::fidl::FDomainResourceDialect
17902                ),
17903                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect),
17904                connection: fidl::new_empty!(
17905                    fidl::encoding::Optional<
17906                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17907                    >,
17908                    fdomain_client::fidl::FDomainResourceDialect
17909                ),
17910            }
17911        }
17912
17913        #[inline]
17914        unsafe fn decode(
17915            &mut self,
17916            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17917            offset: usize,
17918            _depth: fidl::encoding::Depth,
17919        ) -> fidl::Result<()> {
17920            decoder.debug_check_bounds::<Self>(offset);
17921            // Verify that padding bytes are zero.
17922            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
17923            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17924            let mask = 0xffffffff00000000u64;
17925            let maskedval = padval & mask;
17926            if maskedval != 0 {
17927                return Err(fidl::Error::NonZeroPadding {
17928                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
17929                });
17930            }
17931            fidl::decode!(
17932                fidl::encoding::BoundedString<255>,
17933                fdomain_client::fidl::FDomainResourceDialect,
17934                &mut self.name,
17935                decoder,
17936                offset + 0,
17937                _depth
17938            )?;
17939            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
17940            fidl::decode!(
17941                fidl::encoding::Optional<
17942                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17943                >,
17944                fdomain_client::fidl::FDomainResourceDialect,
17945                &mut self.connection,
17946                decoder,
17947                offset + 32,
17948                _depth
17949            )?;
17950            Ok(())
17951        }
17952    }
17953
17954    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
17955        type Borrowed<'a> = &'a mut Self;
17956        fn take_or_borrow<'a>(
17957            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17958        ) -> Self::Borrowed<'a> {
17959            value
17960        }
17961    }
17962
17963    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
17964        type Owned = Self;
17965
17966        #[inline(always)]
17967        fn inline_align(_context: fidl::encoding::Context) -> usize {
17968            8
17969        }
17970
17971        #[inline(always)]
17972        fn inline_size(_context: fidl::encoding::Context) -> usize {
17973            32
17974        }
17975    }
17976
17977    unsafe impl
17978        fidl::encoding::Encode<
17979            DirectoryDeprecatedOpenRequest,
17980            fdomain_client::fidl::FDomainResourceDialect,
17981        > for &mut DirectoryDeprecatedOpenRequest
17982    {
17983        #[inline]
17984        unsafe fn encode(
17985            self,
17986            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17987            offset: usize,
17988            _depth: fidl::encoding::Depth,
17989        ) -> fidl::Result<()> {
17990            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17991            // Delegate to tuple encoding.
17992            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17993                (
17994                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17995                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
17996                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17997                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17998                ),
17999                encoder, offset, _depth
18000            )
18001        }
18002    }
18003    unsafe impl<
18004        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
18005        T1: fidl::encoding::Encode<ModeType, fdomain_client::fidl::FDomainResourceDialect>,
18006        T2: fidl::encoding::Encode<
18007                fidl::encoding::BoundedString<4095>,
18008                fdomain_client::fidl::FDomainResourceDialect,
18009            >,
18010        T3: fidl::encoding::Encode<
18011                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18012                fdomain_client::fidl::FDomainResourceDialect,
18013            >,
18014    >
18015        fidl::encoding::Encode<
18016            DirectoryDeprecatedOpenRequest,
18017            fdomain_client::fidl::FDomainResourceDialect,
18018        > for (T0, T1, T2, T3)
18019    {
18020        #[inline]
18021        unsafe fn encode(
18022            self,
18023            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18024            offset: usize,
18025            depth: fidl::encoding::Depth,
18026        ) -> fidl::Result<()> {
18027            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
18028            // Zero out padding regions. There's no need to apply masks
18029            // because the unmasked parts will be overwritten by fields.
18030            unsafe {
18031                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
18032                (ptr as *mut u64).write_unaligned(0);
18033            }
18034            // Write the fields.
18035            self.0.encode(encoder, offset + 0, depth)?;
18036            self.1.encode(encoder, offset + 4, depth)?;
18037            self.2.encode(encoder, offset + 8, depth)?;
18038            self.3.encode(encoder, offset + 24, depth)?;
18039            Ok(())
18040        }
18041    }
18042
18043    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18044        for DirectoryDeprecatedOpenRequest
18045    {
18046        #[inline(always)]
18047        fn new_empty() -> Self {
18048            Self {
18049                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
18050                mode: fidl::new_empty!(ModeType, fdomain_client::fidl::FDomainResourceDialect),
18051                path: fidl::new_empty!(
18052                    fidl::encoding::BoundedString<4095>,
18053                    fdomain_client::fidl::FDomainResourceDialect
18054                ),
18055                object: fidl::new_empty!(
18056                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18057                    fdomain_client::fidl::FDomainResourceDialect
18058                ),
18059            }
18060        }
18061
18062        #[inline]
18063        unsafe fn decode(
18064            &mut self,
18065            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18066            offset: usize,
18067            _depth: fidl::encoding::Depth,
18068        ) -> fidl::Result<()> {
18069            decoder.debug_check_bounds::<Self>(offset);
18070            // Verify that padding bytes are zero.
18071            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
18072            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18073            let mask = 0xffffffff00000000u64;
18074            let maskedval = padval & mask;
18075            if maskedval != 0 {
18076                return Err(fidl::Error::NonZeroPadding {
18077                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
18078                });
18079            }
18080            fidl::decode!(
18081                OpenFlags,
18082                fdomain_client::fidl::FDomainResourceDialect,
18083                &mut self.flags,
18084                decoder,
18085                offset + 0,
18086                _depth
18087            )?;
18088            fidl::decode!(
18089                ModeType,
18090                fdomain_client::fidl::FDomainResourceDialect,
18091                &mut self.mode,
18092                decoder,
18093                offset + 4,
18094                _depth
18095            )?;
18096            fidl::decode!(
18097                fidl::encoding::BoundedString<4095>,
18098                fdomain_client::fidl::FDomainResourceDialect,
18099                &mut self.path,
18100                decoder,
18101                offset + 8,
18102                _depth
18103            )?;
18104            fidl::decode!(
18105                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18106                fdomain_client::fidl::FDomainResourceDialect,
18107                &mut self.object,
18108                decoder,
18109                offset + 24,
18110                _depth
18111            )?;
18112            Ok(())
18113        }
18114    }
18115
18116    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
18117        type Borrowed<'a> = &'a mut Self;
18118        fn take_or_borrow<'a>(
18119            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18120        ) -> Self::Borrowed<'a> {
18121            value
18122        }
18123    }
18124
18125    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
18126        type Owned = Self;
18127
18128        #[inline(always)]
18129        fn inline_align(_context: fidl::encoding::Context) -> usize {
18130            4
18131        }
18132
18133        #[inline(always)]
18134        fn inline_size(_context: fidl::encoding::Context) -> usize {
18135            8
18136        }
18137    }
18138
18139    unsafe impl
18140        fidl::encoding::Encode<
18141            DirectoryGetTokenResponse,
18142            fdomain_client::fidl::FDomainResourceDialect,
18143        > for &mut DirectoryGetTokenResponse
18144    {
18145        #[inline]
18146        unsafe fn encode(
18147            self,
18148            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18149            offset: usize,
18150            _depth: fidl::encoding::Depth,
18151        ) -> fidl::Result<()> {
18152            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
18153            // Delegate to tuple encoding.
18154            fidl::encoding::Encode::<
18155                DirectoryGetTokenResponse,
18156                fdomain_client::fidl::FDomainResourceDialect,
18157            >::encode(
18158                (
18159                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
18160                    <fidl::encoding::Optional<
18161                        fidl::encoding::HandleType<
18162                            fdomain_client::NullableHandle,
18163                            { fidl::ObjectType::NONE.into_raw() },
18164                            2147483648,
18165                        >,
18166                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18167                        &mut self.token
18168                    ),
18169                ),
18170                encoder,
18171                offset,
18172                _depth,
18173            )
18174        }
18175    }
18176    unsafe impl<
18177        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
18178        T1: fidl::encoding::Encode<
18179                fidl::encoding::Optional<
18180                    fidl::encoding::HandleType<
18181                        fdomain_client::NullableHandle,
18182                        { fidl::ObjectType::NONE.into_raw() },
18183                        2147483648,
18184                    >,
18185                >,
18186                fdomain_client::fidl::FDomainResourceDialect,
18187            >,
18188    >
18189        fidl::encoding::Encode<
18190            DirectoryGetTokenResponse,
18191            fdomain_client::fidl::FDomainResourceDialect,
18192        > for (T0, T1)
18193    {
18194        #[inline]
18195        unsafe fn encode(
18196            self,
18197            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18198            offset: usize,
18199            depth: fidl::encoding::Depth,
18200        ) -> fidl::Result<()> {
18201            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
18202            // Zero out padding regions. There's no need to apply masks
18203            // because the unmasked parts will be overwritten by fields.
18204            // Write the fields.
18205            self.0.encode(encoder, offset + 0, depth)?;
18206            self.1.encode(encoder, offset + 4, depth)?;
18207            Ok(())
18208        }
18209    }
18210
18211    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18212        for DirectoryGetTokenResponse
18213    {
18214        #[inline(always)]
18215        fn new_empty() -> Self {
18216            Self {
18217                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
18218                token: fidl::new_empty!(
18219                    fidl::encoding::Optional<
18220                        fidl::encoding::HandleType<
18221                            fdomain_client::NullableHandle,
18222                            { fidl::ObjectType::NONE.into_raw() },
18223                            2147483648,
18224                        >,
18225                    >,
18226                    fdomain_client::fidl::FDomainResourceDialect
18227                ),
18228            }
18229        }
18230
18231        #[inline]
18232        unsafe fn decode(
18233            &mut self,
18234            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18235            offset: usize,
18236            _depth: fidl::encoding::Depth,
18237        ) -> fidl::Result<()> {
18238            decoder.debug_check_bounds::<Self>(offset);
18239            // Verify that padding bytes are zero.
18240            fidl::decode!(
18241                i32,
18242                fdomain_client::fidl::FDomainResourceDialect,
18243                &mut self.s,
18244                decoder,
18245                offset + 0,
18246                _depth
18247            )?;
18248            fidl::decode!(
18249                fidl::encoding::Optional<
18250                    fidl::encoding::HandleType<
18251                        fdomain_client::NullableHandle,
18252                        { fidl::ObjectType::NONE.into_raw() },
18253                        2147483648,
18254                    >,
18255                >,
18256                fdomain_client::fidl::FDomainResourceDialect,
18257                &mut self.token,
18258                decoder,
18259                offset + 4,
18260                _depth
18261            )?;
18262            Ok(())
18263        }
18264    }
18265
18266    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
18267        type Borrowed<'a> = &'a mut Self;
18268        fn take_or_borrow<'a>(
18269            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18270        ) -> Self::Borrowed<'a> {
18271            value
18272        }
18273    }
18274
18275    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
18276        type Owned = Self;
18277
18278        #[inline(always)]
18279        fn inline_align(_context: fidl::encoding::Context) -> usize {
18280            8
18281        }
18282
18283        #[inline(always)]
18284        fn inline_size(_context: fidl::encoding::Context) -> usize {
18285            40
18286        }
18287    }
18288
18289    unsafe impl
18290        fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18291        for &mut DirectoryLinkRequest
18292    {
18293        #[inline]
18294        unsafe fn encode(
18295            self,
18296            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18297            offset: usize,
18298            _depth: fidl::encoding::Depth,
18299        ) -> fidl::Result<()> {
18300            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18301            // Delegate to tuple encoding.
18302            fidl::encoding::Encode::<
18303                DirectoryLinkRequest,
18304                fdomain_client::fidl::FDomainResourceDialect,
18305            >::encode(
18306                (
18307                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18308                        &self.src,
18309                    ),
18310                    <fidl::encoding::HandleType<
18311                        fdomain_client::NullableHandle,
18312                        { fidl::ObjectType::NONE.into_raw() },
18313                        2147483648,
18314                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18315                        &mut self.dst_parent_token,
18316                    ),
18317                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18318                        &self.dst,
18319                    ),
18320                ),
18321                encoder,
18322                offset,
18323                _depth,
18324            )
18325        }
18326    }
18327    unsafe impl<
18328        T0: fidl::encoding::Encode<
18329                fidl::encoding::BoundedString<255>,
18330                fdomain_client::fidl::FDomainResourceDialect,
18331            >,
18332        T1: fidl::encoding::Encode<
18333                fidl::encoding::HandleType<
18334                    fdomain_client::NullableHandle,
18335                    { fidl::ObjectType::NONE.into_raw() },
18336                    2147483648,
18337                >,
18338                fdomain_client::fidl::FDomainResourceDialect,
18339            >,
18340        T2: fidl::encoding::Encode<
18341                fidl::encoding::BoundedString<255>,
18342                fdomain_client::fidl::FDomainResourceDialect,
18343            >,
18344    > fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
18345        for (T0, T1, T2)
18346    {
18347        #[inline]
18348        unsafe fn encode(
18349            self,
18350            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18351            offset: usize,
18352            depth: fidl::encoding::Depth,
18353        ) -> fidl::Result<()> {
18354            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
18355            // Zero out padding regions. There's no need to apply masks
18356            // because the unmasked parts will be overwritten by fields.
18357            unsafe {
18358                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18359                (ptr as *mut u64).write_unaligned(0);
18360            }
18361            // Write the fields.
18362            self.0.encode(encoder, offset + 0, depth)?;
18363            self.1.encode(encoder, offset + 16, depth)?;
18364            self.2.encode(encoder, offset + 24, depth)?;
18365            Ok(())
18366        }
18367    }
18368
18369    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18370        for DirectoryLinkRequest
18371    {
18372        #[inline(always)]
18373        fn new_empty() -> Self {
18374            Self {
18375                src: fidl::new_empty!(
18376                    fidl::encoding::BoundedString<255>,
18377                    fdomain_client::fidl::FDomainResourceDialect
18378                ),
18379                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18380                dst: fidl::new_empty!(
18381                    fidl::encoding::BoundedString<255>,
18382                    fdomain_client::fidl::FDomainResourceDialect
18383                ),
18384            }
18385        }
18386
18387        #[inline]
18388        unsafe fn decode(
18389            &mut self,
18390            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18391            offset: usize,
18392            _depth: fidl::encoding::Depth,
18393        ) -> fidl::Result<()> {
18394            decoder.debug_check_bounds::<Self>(offset);
18395            // Verify that padding bytes are zero.
18396            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18397            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18398            let mask = 0xffffffff00000000u64;
18399            let maskedval = padval & mask;
18400            if maskedval != 0 {
18401                return Err(fidl::Error::NonZeroPadding {
18402                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18403                });
18404            }
18405            fidl::decode!(
18406                fidl::encoding::BoundedString<255>,
18407                fdomain_client::fidl::FDomainResourceDialect,
18408                &mut self.src,
18409                decoder,
18410                offset + 0,
18411                _depth
18412            )?;
18413            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)?;
18414            fidl::decode!(
18415                fidl::encoding::BoundedString<255>,
18416                fdomain_client::fidl::FDomainResourceDialect,
18417                &mut self.dst,
18418                decoder,
18419                offset + 24,
18420                _depth
18421            )?;
18422            Ok(())
18423        }
18424    }
18425
18426    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
18427        type Borrowed<'a> = &'a mut Self;
18428        fn take_or_borrow<'a>(
18429            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18430        ) -> Self::Borrowed<'a> {
18431            value
18432        }
18433    }
18434
18435    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
18436        type Owned = Self;
18437
18438        #[inline(always)]
18439        fn inline_align(_context: fidl::encoding::Context) -> usize {
18440            8
18441        }
18442
18443        #[inline(always)]
18444        fn inline_size(_context: fidl::encoding::Context) -> usize {
18445            40
18446        }
18447    }
18448
18449    unsafe impl
18450        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18451        for &mut DirectoryRenameRequest
18452    {
18453        #[inline]
18454        unsafe fn encode(
18455            self,
18456            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18457            offset: usize,
18458            _depth: fidl::encoding::Depth,
18459        ) -> fidl::Result<()> {
18460            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18461            // Delegate to tuple encoding.
18462            fidl::encoding::Encode::<
18463                DirectoryRenameRequest,
18464                fdomain_client::fidl::FDomainResourceDialect,
18465            >::encode(
18466                (
18467                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18468                        &self.src,
18469                    ),
18470                    <fidl::encoding::HandleType<
18471                        fdomain_client::Event,
18472                        { fidl::ObjectType::EVENT.into_raw() },
18473                        2147483648,
18474                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18475                        &mut self.dst_parent_token,
18476                    ),
18477                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18478                        &self.dst,
18479                    ),
18480                ),
18481                encoder,
18482                offset,
18483                _depth,
18484            )
18485        }
18486    }
18487    unsafe impl<
18488        T0: fidl::encoding::Encode<
18489                fidl::encoding::BoundedString<255>,
18490                fdomain_client::fidl::FDomainResourceDialect,
18491            >,
18492        T1: fidl::encoding::Encode<
18493                fidl::encoding::HandleType<
18494                    fdomain_client::Event,
18495                    { fidl::ObjectType::EVENT.into_raw() },
18496                    2147483648,
18497                >,
18498                fdomain_client::fidl::FDomainResourceDialect,
18499            >,
18500        T2: fidl::encoding::Encode<
18501                fidl::encoding::BoundedString<255>,
18502                fdomain_client::fidl::FDomainResourceDialect,
18503            >,
18504    >
18505        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18506        for (T0, T1, T2)
18507    {
18508        #[inline]
18509        unsafe fn encode(
18510            self,
18511            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18512            offset: usize,
18513            depth: fidl::encoding::Depth,
18514        ) -> fidl::Result<()> {
18515            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18516            // Zero out padding regions. There's no need to apply masks
18517            // because the unmasked parts will be overwritten by fields.
18518            unsafe {
18519                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18520                (ptr as *mut u64).write_unaligned(0);
18521            }
18522            // Write the fields.
18523            self.0.encode(encoder, offset + 0, depth)?;
18524            self.1.encode(encoder, offset + 16, depth)?;
18525            self.2.encode(encoder, offset + 24, depth)?;
18526            Ok(())
18527        }
18528    }
18529
18530    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18531        for DirectoryRenameRequest
18532    {
18533        #[inline(always)]
18534        fn new_empty() -> Self {
18535            Self {
18536                src: fidl::new_empty!(
18537                    fidl::encoding::BoundedString<255>,
18538                    fdomain_client::fidl::FDomainResourceDialect
18539                ),
18540                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18541                dst: fidl::new_empty!(
18542                    fidl::encoding::BoundedString<255>,
18543                    fdomain_client::fidl::FDomainResourceDialect
18544                ),
18545            }
18546        }
18547
18548        #[inline]
18549        unsafe fn decode(
18550            &mut self,
18551            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18552            offset: usize,
18553            _depth: fidl::encoding::Depth,
18554        ) -> fidl::Result<()> {
18555            decoder.debug_check_bounds::<Self>(offset);
18556            // Verify that padding bytes are zero.
18557            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18558            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18559            let mask = 0xffffffff00000000u64;
18560            let maskedval = padval & mask;
18561            if maskedval != 0 {
18562                return Err(fidl::Error::NonZeroPadding {
18563                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18564                });
18565            }
18566            fidl::decode!(
18567                fidl::encoding::BoundedString<255>,
18568                fdomain_client::fidl::FDomainResourceDialect,
18569                &mut self.src,
18570                decoder,
18571                offset + 0,
18572                _depth
18573            )?;
18574            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)?;
18575            fidl::decode!(
18576                fidl::encoding::BoundedString<255>,
18577                fdomain_client::fidl::FDomainResourceDialect,
18578                &mut self.dst,
18579                decoder,
18580                offset + 24,
18581                _depth
18582            )?;
18583            Ok(())
18584        }
18585    }
18586
18587    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
18588        type Borrowed<'a> = &'a mut Self;
18589        fn take_or_borrow<'a>(
18590            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18591        ) -> Self::Borrowed<'a> {
18592            value
18593        }
18594    }
18595
18596    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
18597        type Owned = Self;
18598
18599        #[inline(always)]
18600        fn inline_align(_context: fidl::encoding::Context) -> usize {
18601            4
18602        }
18603
18604        #[inline(always)]
18605        fn inline_size(_context: fidl::encoding::Context) -> usize {
18606            12
18607        }
18608    }
18609
18610    unsafe impl
18611        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18612        for &mut DirectoryWatchRequest
18613    {
18614        #[inline]
18615        unsafe fn encode(
18616            self,
18617            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18618            offset: usize,
18619            _depth: fidl::encoding::Depth,
18620        ) -> fidl::Result<()> {
18621            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18622            // Delegate to tuple encoding.
18623            fidl::encoding::Encode::<
18624                DirectoryWatchRequest,
18625                fdomain_client::fidl::FDomainResourceDialect,
18626            >::encode(
18627                (
18628                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
18629                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
18630                    <fidl::encoding::Endpoint<
18631                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18632                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18633                        &mut self.watcher
18634                    ),
18635                ),
18636                encoder,
18637                offset,
18638                _depth,
18639            )
18640        }
18641    }
18642    unsafe impl<
18643        T0: fidl::encoding::Encode<WatchMask, fdomain_client::fidl::FDomainResourceDialect>,
18644        T1: fidl::encoding::Encode<u32, fdomain_client::fidl::FDomainResourceDialect>,
18645        T2: fidl::encoding::Encode<
18646                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18647                fdomain_client::fidl::FDomainResourceDialect,
18648            >,
18649    >
18650        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18651        for (T0, T1, T2)
18652    {
18653        #[inline]
18654        unsafe fn encode(
18655            self,
18656            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18657            offset: usize,
18658            depth: fidl::encoding::Depth,
18659        ) -> fidl::Result<()> {
18660            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18661            // Zero out padding regions. There's no need to apply masks
18662            // because the unmasked parts will be overwritten by fields.
18663            // Write the fields.
18664            self.0.encode(encoder, offset + 0, depth)?;
18665            self.1.encode(encoder, offset + 4, depth)?;
18666            self.2.encode(encoder, offset + 8, depth)?;
18667            Ok(())
18668        }
18669    }
18670
18671    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18672        for DirectoryWatchRequest
18673    {
18674        #[inline(always)]
18675        fn new_empty() -> Self {
18676            Self {
18677                mask: fidl::new_empty!(WatchMask, fdomain_client::fidl::FDomainResourceDialect),
18678                options: fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect),
18679                watcher: fidl::new_empty!(
18680                    fidl::encoding::Endpoint<
18681                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18682                    >,
18683                    fdomain_client::fidl::FDomainResourceDialect
18684                ),
18685            }
18686        }
18687
18688        #[inline]
18689        unsafe fn decode(
18690            &mut self,
18691            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18692            offset: usize,
18693            _depth: fidl::encoding::Depth,
18694        ) -> fidl::Result<()> {
18695            decoder.debug_check_bounds::<Self>(offset);
18696            // Verify that padding bytes are zero.
18697            fidl::decode!(
18698                WatchMask,
18699                fdomain_client::fidl::FDomainResourceDialect,
18700                &mut self.mask,
18701                decoder,
18702                offset + 0,
18703                _depth
18704            )?;
18705            fidl::decode!(
18706                u32,
18707                fdomain_client::fidl::FDomainResourceDialect,
18708                &mut self.options,
18709                decoder,
18710                offset + 4,
18711                _depth
18712            )?;
18713            fidl::decode!(
18714                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18715                fdomain_client::fidl::FDomainResourceDialect,
18716                &mut self.watcher,
18717                decoder,
18718                offset + 8,
18719                _depth
18720            )?;
18721            Ok(())
18722        }
18723    }
18724
18725    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
18726        type Borrowed<'a> = &'a mut Self;
18727        fn take_or_borrow<'a>(
18728            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18729        ) -> Self::Borrowed<'a> {
18730            value
18731        }
18732    }
18733
18734    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
18735        type Owned = Self;
18736
18737        #[inline(always)]
18738        fn inline_align(_context: fidl::encoding::Context) -> usize {
18739            8
18740        }
18741
18742        #[inline(always)]
18743        fn inline_size(_context: fidl::encoding::Context) -> usize {
18744            24
18745        }
18746    }
18747
18748    unsafe impl
18749        fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18750        for &mut FileAllocateRequest
18751    {
18752        #[inline]
18753        unsafe fn encode(
18754            self,
18755            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18756            offset: usize,
18757            _depth: fidl::encoding::Depth,
18758        ) -> fidl::Result<()> {
18759            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18760            // Delegate to tuple encoding.
18761            fidl::encoding::Encode::<
18762                FileAllocateRequest,
18763                fdomain_client::fidl::FDomainResourceDialect,
18764            >::encode(
18765                (
18766                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
18767                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
18768                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
18769                ),
18770                encoder,
18771                offset,
18772                _depth,
18773            )
18774        }
18775    }
18776    unsafe impl<
18777        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18778        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18779        T2: fidl::encoding::Encode<AllocateMode, fdomain_client::fidl::FDomainResourceDialect>,
18780    > fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18781        for (T0, T1, T2)
18782    {
18783        #[inline]
18784        unsafe fn encode(
18785            self,
18786            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18787            offset: usize,
18788            depth: fidl::encoding::Depth,
18789        ) -> fidl::Result<()> {
18790            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18791            // Zero out padding regions. There's no need to apply masks
18792            // because the unmasked parts will be overwritten by fields.
18793            unsafe {
18794                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18795                (ptr as *mut u64).write_unaligned(0);
18796            }
18797            // Write the fields.
18798            self.0.encode(encoder, offset + 0, depth)?;
18799            self.1.encode(encoder, offset + 8, depth)?;
18800            self.2.encode(encoder, offset + 16, depth)?;
18801            Ok(())
18802        }
18803    }
18804
18805    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18806        for FileAllocateRequest
18807    {
18808        #[inline(always)]
18809        fn new_empty() -> Self {
18810            Self {
18811                offset: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18812                length: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18813                mode: fidl::new_empty!(AllocateMode, fdomain_client::fidl::FDomainResourceDialect),
18814            }
18815        }
18816
18817        #[inline]
18818        unsafe fn decode(
18819            &mut self,
18820            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18821            offset: usize,
18822            _depth: fidl::encoding::Depth,
18823        ) -> fidl::Result<()> {
18824            decoder.debug_check_bounds::<Self>(offset);
18825            // Verify that padding bytes are zero.
18826            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18827            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18828            let mask = 0xffffffff00000000u64;
18829            let maskedval = padval & mask;
18830            if maskedval != 0 {
18831                return Err(fidl::Error::NonZeroPadding {
18832                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18833                });
18834            }
18835            fidl::decode!(
18836                u64,
18837                fdomain_client::fidl::FDomainResourceDialect,
18838                &mut self.offset,
18839                decoder,
18840                offset + 0,
18841                _depth
18842            )?;
18843            fidl::decode!(
18844                u64,
18845                fdomain_client::fidl::FDomainResourceDialect,
18846                &mut self.length,
18847                decoder,
18848                offset + 8,
18849                _depth
18850            )?;
18851            fidl::decode!(
18852                AllocateMode,
18853                fdomain_client::fidl::FDomainResourceDialect,
18854                &mut self.mode,
18855                decoder,
18856                offset + 16,
18857                _depth
18858            )?;
18859            Ok(())
18860        }
18861    }
18862
18863    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
18864        type Borrowed<'a> = &'a mut Self;
18865        fn take_or_borrow<'a>(
18866            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18867        ) -> Self::Borrowed<'a> {
18868            value
18869        }
18870    }
18871
18872    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
18873        type Owned = Self;
18874
18875        #[inline(always)]
18876        fn inline_align(_context: fidl::encoding::Context) -> usize {
18877            8
18878        }
18879
18880        #[inline(always)]
18881        fn inline_size(_context: fidl::encoding::Context) -> usize {
18882            16
18883        }
18884    }
18885
18886    unsafe impl
18887        fidl::encoding::Encode<
18888            FileEnableVerityRequest,
18889            fdomain_client::fidl::FDomainResourceDialect,
18890        > for &mut FileEnableVerityRequest
18891    {
18892        #[inline]
18893        unsafe fn encode(
18894            self,
18895            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18896            offset: usize,
18897            _depth: fidl::encoding::Depth,
18898        ) -> fidl::Result<()> {
18899            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18900            // Delegate to tuple encoding.
18901            fidl::encoding::Encode::<
18902                FileEnableVerityRequest,
18903                fdomain_client::fidl::FDomainResourceDialect,
18904            >::encode(
18905                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
18906                encoder,
18907                offset,
18908                _depth,
18909            )
18910        }
18911    }
18912    unsafe impl<
18913        T0: fidl::encoding::Encode<VerificationOptions, fdomain_client::fidl::FDomainResourceDialect>,
18914    >
18915        fidl::encoding::Encode<
18916            FileEnableVerityRequest,
18917            fdomain_client::fidl::FDomainResourceDialect,
18918        > for (T0,)
18919    {
18920        #[inline]
18921        unsafe fn encode(
18922            self,
18923            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18924            offset: usize,
18925            depth: fidl::encoding::Depth,
18926        ) -> fidl::Result<()> {
18927            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18928            // Zero out padding regions. There's no need to apply masks
18929            // because the unmasked parts will be overwritten by fields.
18930            // Write the fields.
18931            self.0.encode(encoder, offset + 0, depth)?;
18932            Ok(())
18933        }
18934    }
18935
18936    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18937        for FileEnableVerityRequest
18938    {
18939        #[inline(always)]
18940        fn new_empty() -> Self {
18941            Self {
18942                options: fidl::new_empty!(
18943                    VerificationOptions,
18944                    fdomain_client::fidl::FDomainResourceDialect
18945                ),
18946            }
18947        }
18948
18949        #[inline]
18950        unsafe fn decode(
18951            &mut self,
18952            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18953            offset: usize,
18954            _depth: fidl::encoding::Depth,
18955        ) -> fidl::Result<()> {
18956            decoder.debug_check_bounds::<Self>(offset);
18957            // Verify that padding bytes are zero.
18958            fidl::decode!(
18959                VerificationOptions,
18960                fdomain_client::fidl::FDomainResourceDialect,
18961                &mut self.options,
18962                decoder,
18963                offset + 0,
18964                _depth
18965            )?;
18966            Ok(())
18967        }
18968    }
18969
18970    impl fidl::encoding::ResourceTypeMarker for FileObject {
18971        type Borrowed<'a> = &'a mut Self;
18972        fn take_or_borrow<'a>(
18973            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18974        ) -> Self::Borrowed<'a> {
18975            value
18976        }
18977    }
18978
18979    unsafe impl fidl::encoding::TypeMarker for FileObject {
18980        type Owned = Self;
18981
18982        #[inline(always)]
18983        fn inline_align(_context: fidl::encoding::Context) -> usize {
18984            4
18985        }
18986
18987        #[inline(always)]
18988        fn inline_size(_context: fidl::encoding::Context) -> usize {
18989            8
18990        }
18991    }
18992
18993    unsafe impl fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18994        for &mut FileObject
18995    {
18996        #[inline]
18997        unsafe fn encode(
18998            self,
18999            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19000            offset: usize,
19001            _depth: fidl::encoding::Depth,
19002        ) -> fidl::Result<()> {
19003            encoder.debug_check_bounds::<FileObject>(offset);
19004            // Delegate to tuple encoding.
19005            fidl::encoding::Encode::<FileObject, fdomain_client::fidl::FDomainResourceDialect>::encode(
19006                (
19007                    <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),
19008                    <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),
19009                ),
19010                encoder, offset, _depth
19011            )
19012        }
19013    }
19014    unsafe impl<
19015        T0: fidl::encoding::Encode<
19016                fidl::encoding::Optional<
19017                    fidl::encoding::HandleType<
19018                        fdomain_client::Event,
19019                        { fidl::ObjectType::EVENT.into_raw() },
19020                        2147483648,
19021                    >,
19022                >,
19023                fdomain_client::fidl::FDomainResourceDialect,
19024            >,
19025        T1: fidl::encoding::Encode<
19026                fidl::encoding::Optional<
19027                    fidl::encoding::HandleType<
19028                        fdomain_client::Stream,
19029                        { fidl::ObjectType::STREAM.into_raw() },
19030                        2147483648,
19031                    >,
19032                >,
19033                fdomain_client::fidl::FDomainResourceDialect,
19034            >,
19035    > fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
19036        for (T0, T1)
19037    {
19038        #[inline]
19039        unsafe fn encode(
19040            self,
19041            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19042            offset: usize,
19043            depth: fidl::encoding::Depth,
19044        ) -> fidl::Result<()> {
19045            encoder.debug_check_bounds::<FileObject>(offset);
19046            // Zero out padding regions. There's no need to apply masks
19047            // because the unmasked parts will be overwritten by fields.
19048            // Write the fields.
19049            self.0.encode(encoder, offset + 0, depth)?;
19050            self.1.encode(encoder, offset + 4, depth)?;
19051            Ok(())
19052        }
19053    }
19054
19055    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileObject {
19056        #[inline(always)]
19057        fn new_empty() -> Self {
19058            Self {
19059                event: fidl::new_empty!(
19060                    fidl::encoding::Optional<
19061                        fidl::encoding::HandleType<
19062                            fdomain_client::Event,
19063                            { fidl::ObjectType::EVENT.into_raw() },
19064                            2147483648,
19065                        >,
19066                    >,
19067                    fdomain_client::fidl::FDomainResourceDialect
19068                ),
19069                stream: fidl::new_empty!(
19070                    fidl::encoding::Optional<
19071                        fidl::encoding::HandleType<
19072                            fdomain_client::Stream,
19073                            { fidl::ObjectType::STREAM.into_raw() },
19074                            2147483648,
19075                        >,
19076                    >,
19077                    fdomain_client::fidl::FDomainResourceDialect
19078                ),
19079            }
19080        }
19081
19082        #[inline]
19083        unsafe fn decode(
19084            &mut self,
19085            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19086            offset: usize,
19087            _depth: fidl::encoding::Depth,
19088        ) -> fidl::Result<()> {
19089            decoder.debug_check_bounds::<Self>(offset);
19090            // Verify that padding bytes are zero.
19091            fidl::decode!(
19092                fidl::encoding::Optional<
19093                    fidl::encoding::HandleType<
19094                        fdomain_client::Event,
19095                        { fidl::ObjectType::EVENT.into_raw() },
19096                        2147483648,
19097                    >,
19098                >,
19099                fdomain_client::fidl::FDomainResourceDialect,
19100                &mut self.event,
19101                decoder,
19102                offset + 0,
19103                _depth
19104            )?;
19105            fidl::decode!(
19106                fidl::encoding::Optional<
19107                    fidl::encoding::HandleType<
19108                        fdomain_client::Stream,
19109                        { fidl::ObjectType::STREAM.into_raw() },
19110                        2147483648,
19111                    >,
19112                >,
19113                fdomain_client::fidl::FDomainResourceDialect,
19114                &mut self.stream,
19115                decoder,
19116                offset + 4,
19117                _depth
19118            )?;
19119            Ok(())
19120        }
19121    }
19122
19123    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
19124        type Borrowed<'a> = &'a mut Self;
19125        fn take_or_borrow<'a>(
19126            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19127        ) -> Self::Borrowed<'a> {
19128            value
19129        }
19130    }
19131
19132    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
19133        type Owned = Self;
19134
19135        #[inline(always)]
19136        fn inline_align(_context: fidl::encoding::Context) -> usize {
19137            4
19138        }
19139
19140        #[inline(always)]
19141        fn inline_size(_context: fidl::encoding::Context) -> usize {
19142            4
19143        }
19144    }
19145
19146    unsafe impl
19147        fidl::encoding::Encode<
19148            FileGetBackingMemoryResponse,
19149            fdomain_client::fidl::FDomainResourceDialect,
19150        > for &mut FileGetBackingMemoryResponse
19151    {
19152        #[inline]
19153        unsafe fn encode(
19154            self,
19155            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19156            offset: usize,
19157            _depth: fidl::encoding::Depth,
19158        ) -> fidl::Result<()> {
19159            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19160            // Delegate to tuple encoding.
19161            fidl::encoding::Encode::<
19162                FileGetBackingMemoryResponse,
19163                fdomain_client::fidl::FDomainResourceDialect,
19164            >::encode(
19165                (<fidl::encoding::HandleType<
19166                    fdomain_client::Vmo,
19167                    { fidl::ObjectType::VMO.into_raw() },
19168                    2147483648,
19169                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19170                    &mut self.vmo
19171                ),),
19172                encoder,
19173                offset,
19174                _depth,
19175            )
19176        }
19177    }
19178    unsafe impl<
19179        T0: fidl::encoding::Encode<
19180                fidl::encoding::HandleType<
19181                    fdomain_client::Vmo,
19182                    { fidl::ObjectType::VMO.into_raw() },
19183                    2147483648,
19184                >,
19185                fdomain_client::fidl::FDomainResourceDialect,
19186            >,
19187    >
19188        fidl::encoding::Encode<
19189            FileGetBackingMemoryResponse,
19190            fdomain_client::fidl::FDomainResourceDialect,
19191        > for (T0,)
19192    {
19193        #[inline]
19194        unsafe fn encode(
19195            self,
19196            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19197            offset: usize,
19198            depth: fidl::encoding::Depth,
19199        ) -> fidl::Result<()> {
19200            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
19201            // Zero out padding regions. There's no need to apply masks
19202            // because the unmasked parts will be overwritten by fields.
19203            // Write the fields.
19204            self.0.encode(encoder, offset + 0, depth)?;
19205            Ok(())
19206        }
19207    }
19208
19209    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19210        for FileGetBackingMemoryResponse
19211    {
19212        #[inline(always)]
19213        fn new_empty() -> Self {
19214            Self {
19215                vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19216            }
19217        }
19218
19219        #[inline]
19220        unsafe fn decode(
19221            &mut self,
19222            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19223            offset: usize,
19224            _depth: fidl::encoding::Depth,
19225        ) -> fidl::Result<()> {
19226            decoder.debug_check_bounds::<Self>(offset);
19227            // Verify that padding bytes are zero.
19228            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)?;
19229            Ok(())
19230        }
19231    }
19232
19233    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
19234        type Borrowed<'a> = &'a mut Self;
19235        fn take_or_borrow<'a>(
19236            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19237        ) -> Self::Borrowed<'a> {
19238            value
19239        }
19240    }
19241
19242    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
19243        type Owned = Self;
19244
19245        #[inline(always)]
19246        fn inline_align(_context: fidl::encoding::Context) -> usize {
19247            8
19248        }
19249
19250        #[inline(always)]
19251        fn inline_size(_context: fidl::encoding::Context) -> usize {
19252            24
19253        }
19254    }
19255
19256    unsafe impl
19257        fidl::encoding::Encode<
19258            LinkableLinkIntoRequest,
19259            fdomain_client::fidl::FDomainResourceDialect,
19260        > for &mut LinkableLinkIntoRequest
19261    {
19262        #[inline]
19263        unsafe fn encode(
19264            self,
19265            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19266            offset: usize,
19267            _depth: fidl::encoding::Depth,
19268        ) -> fidl::Result<()> {
19269            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19270            // Delegate to tuple encoding.
19271            fidl::encoding::Encode::<
19272                LinkableLinkIntoRequest,
19273                fdomain_client::fidl::FDomainResourceDialect,
19274            >::encode(
19275                (
19276                    <fidl::encoding::HandleType<
19277                        fdomain_client::Event,
19278                        { fidl::ObjectType::EVENT.into_raw() },
19279                        2147483648,
19280                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19281                        &mut self.dst_parent_token,
19282                    ),
19283                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
19284                        &self.dst,
19285                    ),
19286                ),
19287                encoder,
19288                offset,
19289                _depth,
19290            )
19291        }
19292    }
19293    unsafe impl<
19294        T0: fidl::encoding::Encode<
19295                fidl::encoding::HandleType<
19296                    fdomain_client::Event,
19297                    { fidl::ObjectType::EVENT.into_raw() },
19298                    2147483648,
19299                >,
19300                fdomain_client::fidl::FDomainResourceDialect,
19301            >,
19302        T1: fidl::encoding::Encode<
19303                fidl::encoding::BoundedString<255>,
19304                fdomain_client::fidl::FDomainResourceDialect,
19305            >,
19306    >
19307        fidl::encoding::Encode<
19308            LinkableLinkIntoRequest,
19309            fdomain_client::fidl::FDomainResourceDialect,
19310        > for (T0, T1)
19311    {
19312        #[inline]
19313        unsafe fn encode(
19314            self,
19315            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19316            offset: usize,
19317            depth: fidl::encoding::Depth,
19318        ) -> fidl::Result<()> {
19319            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
19320            // Zero out padding regions. There's no need to apply masks
19321            // because the unmasked parts will be overwritten by fields.
19322            unsafe {
19323                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19324                (ptr as *mut u64).write_unaligned(0);
19325            }
19326            // Write the fields.
19327            self.0.encode(encoder, offset + 0, depth)?;
19328            self.1.encode(encoder, offset + 8, depth)?;
19329            Ok(())
19330        }
19331    }
19332
19333    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19334        for LinkableLinkIntoRequest
19335    {
19336        #[inline(always)]
19337        fn new_empty() -> Self {
19338            Self {
19339                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
19340                dst: fidl::new_empty!(
19341                    fidl::encoding::BoundedString<255>,
19342                    fdomain_client::fidl::FDomainResourceDialect
19343                ),
19344            }
19345        }
19346
19347        #[inline]
19348        unsafe fn decode(
19349            &mut self,
19350            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19351            offset: usize,
19352            _depth: fidl::encoding::Depth,
19353        ) -> fidl::Result<()> {
19354            decoder.debug_check_bounds::<Self>(offset);
19355            // Verify that padding bytes are zero.
19356            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19357            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19358            let mask = 0xffffffff00000000u64;
19359            let maskedval = padval & mask;
19360            if maskedval != 0 {
19361                return Err(fidl::Error::NonZeroPadding {
19362                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19363                });
19364            }
19365            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)?;
19366            fidl::decode!(
19367                fidl::encoding::BoundedString<255>,
19368                fdomain_client::fidl::FDomainResourceDialect,
19369                &mut self.dst,
19370                decoder,
19371                offset + 8,
19372                _depth
19373            )?;
19374            Ok(())
19375        }
19376    }
19377
19378    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
19379        type Borrowed<'a> = &'a mut Self;
19380        fn take_or_borrow<'a>(
19381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19382        ) -> Self::Borrowed<'a> {
19383            value
19384        }
19385    }
19386
19387    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
19388        type Owned = Self;
19389
19390        #[inline(always)]
19391        fn inline_align(_context: fidl::encoding::Context) -> usize {
19392            4
19393        }
19394
19395        #[inline(always)]
19396        fn inline_size(_context: fidl::encoding::Context) -> usize {
19397            8
19398        }
19399    }
19400
19401    unsafe impl
19402        fidl::encoding::Encode<
19403            NodeDeprecatedCloneRequest,
19404            fdomain_client::fidl::FDomainResourceDialect,
19405        > for &mut NodeDeprecatedCloneRequest
19406    {
19407        #[inline]
19408        unsafe fn encode(
19409            self,
19410            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19411            offset: usize,
19412            _depth: fidl::encoding::Depth,
19413        ) -> fidl::Result<()> {
19414            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19415            // Delegate to tuple encoding.
19416            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19417                (
19418                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
19419                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
19420                ),
19421                encoder, offset, _depth
19422            )
19423        }
19424    }
19425    unsafe impl<
19426        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
19427        T1: fidl::encoding::Encode<
19428                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19429                fdomain_client::fidl::FDomainResourceDialect,
19430            >,
19431    >
19432        fidl::encoding::Encode<
19433            NodeDeprecatedCloneRequest,
19434            fdomain_client::fidl::FDomainResourceDialect,
19435        > for (T0, T1)
19436    {
19437        #[inline]
19438        unsafe fn encode(
19439            self,
19440            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19441            offset: usize,
19442            depth: fidl::encoding::Depth,
19443        ) -> fidl::Result<()> {
19444            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19445            // Zero out padding regions. There's no need to apply masks
19446            // because the unmasked parts will be overwritten by fields.
19447            // Write the fields.
19448            self.0.encode(encoder, offset + 0, depth)?;
19449            self.1.encode(encoder, offset + 4, depth)?;
19450            Ok(())
19451        }
19452    }
19453
19454    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19455        for NodeDeprecatedCloneRequest
19456    {
19457        #[inline(always)]
19458        fn new_empty() -> Self {
19459            Self {
19460                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
19461                object: fidl::new_empty!(
19462                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19463                    fdomain_client::fidl::FDomainResourceDialect
19464                ),
19465            }
19466        }
19467
19468        #[inline]
19469        unsafe fn decode(
19470            &mut self,
19471            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19472            offset: usize,
19473            _depth: fidl::encoding::Depth,
19474        ) -> fidl::Result<()> {
19475            decoder.debug_check_bounds::<Self>(offset);
19476            // Verify that padding bytes are zero.
19477            fidl::decode!(
19478                OpenFlags,
19479                fdomain_client::fidl::FDomainResourceDialect,
19480                &mut self.flags,
19481                decoder,
19482                offset + 0,
19483                _depth
19484            )?;
19485            fidl::decode!(
19486                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19487                fdomain_client::fidl::FDomainResourceDialect,
19488                &mut self.object,
19489                decoder,
19490                offset + 4,
19491                _depth
19492            )?;
19493            Ok(())
19494        }
19495    }
19496
19497    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
19498        type Borrowed<'a> = &'a mut Self;
19499        fn take_or_borrow<'a>(
19500            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19501        ) -> Self::Borrowed<'a> {
19502            value
19503        }
19504    }
19505
19506    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
19507        type Owned = Self;
19508
19509        #[inline(always)]
19510        fn inline_align(_context: fidl::encoding::Context) -> usize {
19511            4
19512        }
19513
19514        #[inline(always)]
19515        fn inline_size(_context: fidl::encoding::Context) -> usize {
19516            4
19517        }
19518    }
19519
19520    unsafe impl
19521        fidl::encoding::Encode<
19522            NodeListExtendedAttributesRequest,
19523            fdomain_client::fidl::FDomainResourceDialect,
19524        > for &mut NodeListExtendedAttributesRequest
19525    {
19526        #[inline]
19527        unsafe fn encode(
19528            self,
19529            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19530            offset: usize,
19531            _depth: fidl::encoding::Depth,
19532        ) -> fidl::Result<()> {
19533            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19534            // Delegate to tuple encoding.
19535            fidl::encoding::Encode::<
19536                NodeListExtendedAttributesRequest,
19537                fdomain_client::fidl::FDomainResourceDialect,
19538            >::encode(
19539                (<fidl::encoding::Endpoint<
19540                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19541                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19542                    &mut self.iterator
19543                ),),
19544                encoder,
19545                offset,
19546                _depth,
19547            )
19548        }
19549    }
19550    unsafe impl<
19551        T0: fidl::encoding::Encode<
19552                fidl::encoding::Endpoint<
19553                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19554                >,
19555                fdomain_client::fidl::FDomainResourceDialect,
19556            >,
19557    >
19558        fidl::encoding::Encode<
19559            NodeListExtendedAttributesRequest,
19560            fdomain_client::fidl::FDomainResourceDialect,
19561        > for (T0,)
19562    {
19563        #[inline]
19564        unsafe fn encode(
19565            self,
19566            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19567            offset: usize,
19568            depth: fidl::encoding::Depth,
19569        ) -> fidl::Result<()> {
19570            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19571            // Zero out padding regions. There's no need to apply masks
19572            // because the unmasked parts will be overwritten by fields.
19573            // Write the fields.
19574            self.0.encode(encoder, offset + 0, depth)?;
19575            Ok(())
19576        }
19577    }
19578
19579    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19580        for NodeListExtendedAttributesRequest
19581    {
19582        #[inline(always)]
19583        fn new_empty() -> Self {
19584            Self {
19585                iterator: fidl::new_empty!(
19586                    fidl::encoding::Endpoint<
19587                        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19588                    >,
19589                    fdomain_client::fidl::FDomainResourceDialect
19590                ),
19591            }
19592        }
19593
19594        #[inline]
19595        unsafe fn decode(
19596            &mut self,
19597            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19598            offset: usize,
19599            _depth: fidl::encoding::Depth,
19600        ) -> fidl::Result<()> {
19601            decoder.debug_check_bounds::<Self>(offset);
19602            // Verify that padding bytes are zero.
19603            fidl::decode!(
19604                fidl::encoding::Endpoint<
19605                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19606                >,
19607                fdomain_client::fidl::FDomainResourceDialect,
19608                &mut self.iterator,
19609                decoder,
19610                offset + 0,
19611                _depth
19612            )?;
19613            Ok(())
19614        }
19615    }
19616
19617    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
19618        type Borrowed<'a> = &'a mut Self;
19619        fn take_or_borrow<'a>(
19620            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19621        ) -> Self::Borrowed<'a> {
19622            value
19623        }
19624    }
19625
19626    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
19627        type Owned = Self;
19628
19629        #[inline(always)]
19630        fn inline_align(_context: fidl::encoding::Context) -> usize {
19631            8
19632        }
19633
19634        #[inline(always)]
19635        fn inline_size(_context: fidl::encoding::Context) -> usize {
19636            24
19637        }
19638    }
19639
19640    unsafe impl
19641        fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19642        for &mut NodeOnOpenRequest
19643    {
19644        #[inline]
19645        unsafe fn encode(
19646            self,
19647            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19648            offset: usize,
19649            _depth: fidl::encoding::Depth,
19650        ) -> fidl::Result<()> {
19651            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19652            // Delegate to tuple encoding.
19653            fidl::encoding::Encode::<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19654                (
19655                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
19656                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
19657                ),
19658                encoder, offset, _depth
19659            )
19660        }
19661    }
19662    unsafe impl<
19663        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
19664        T1: fidl::encoding::Encode<
19665                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19666                fdomain_client::fidl::FDomainResourceDialect,
19667            >,
19668    > fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19669        for (T0, T1)
19670    {
19671        #[inline]
19672        unsafe fn encode(
19673            self,
19674            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19675            offset: usize,
19676            depth: fidl::encoding::Depth,
19677        ) -> fidl::Result<()> {
19678            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19679            // Zero out padding regions. There's no need to apply masks
19680            // because the unmasked parts will be overwritten by fields.
19681            unsafe {
19682                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19683                (ptr as *mut u64).write_unaligned(0);
19684            }
19685            // Write the fields.
19686            self.0.encode(encoder, offset + 0, depth)?;
19687            self.1.encode(encoder, offset + 8, depth)?;
19688            Ok(())
19689        }
19690    }
19691
19692    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19693        for NodeOnOpenRequest
19694    {
19695        #[inline(always)]
19696        fn new_empty() -> Self {
19697            Self {
19698                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
19699                info: fidl::new_empty!(
19700                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19701                    fdomain_client::fidl::FDomainResourceDialect
19702                ),
19703            }
19704        }
19705
19706        #[inline]
19707        unsafe fn decode(
19708            &mut self,
19709            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19710            offset: usize,
19711            _depth: fidl::encoding::Depth,
19712        ) -> fidl::Result<()> {
19713            decoder.debug_check_bounds::<Self>(offset);
19714            // Verify that padding bytes are zero.
19715            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19716            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19717            let mask = 0xffffffff00000000u64;
19718            let maskedval = padval & mask;
19719            if maskedval != 0 {
19720                return Err(fidl::Error::NonZeroPadding {
19721                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19722                });
19723            }
19724            fidl::decode!(
19725                i32,
19726                fdomain_client::fidl::FDomainResourceDialect,
19727                &mut self.s,
19728                decoder,
19729                offset + 0,
19730                _depth
19731            )?;
19732            fidl::decode!(
19733                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19734                fdomain_client::fidl::FDomainResourceDialect,
19735                &mut self.info,
19736                decoder,
19737                offset + 8,
19738                _depth
19739            )?;
19740            Ok(())
19741        }
19742    }
19743
19744    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
19745        type Borrowed<'a> = &'a mut Self;
19746        fn take_or_borrow<'a>(
19747            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19748        ) -> Self::Borrowed<'a> {
19749            value
19750        }
19751    }
19752
19753    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
19754        type Owned = Self;
19755
19756        #[inline(always)]
19757        fn inline_align(_context: fidl::encoding::Context) -> usize {
19758            8
19759        }
19760
19761        #[inline(always)]
19762        fn inline_size(_context: fidl::encoding::Context) -> usize {
19763            40
19764        }
19765    }
19766
19767    unsafe impl
19768        fidl::encoding::Encode<
19769            NodeSetExtendedAttributeRequest,
19770            fdomain_client::fidl::FDomainResourceDialect,
19771        > for &mut NodeSetExtendedAttributeRequest
19772    {
19773        #[inline]
19774        unsafe fn encode(
19775            self,
19776            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19777            offset: usize,
19778            _depth: fidl::encoding::Depth,
19779        ) -> fidl::Result<()> {
19780            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19781            // Delegate to tuple encoding.
19782            fidl::encoding::Encode::<
19783                NodeSetExtendedAttributeRequest,
19784                fdomain_client::fidl::FDomainResourceDialect,
19785            >::encode(
19786                (
19787                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
19788                        &self.name,
19789                    ),
19790                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19791                        &mut self.value,
19792                    ),
19793                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
19794                        &self.mode,
19795                    ),
19796                ),
19797                encoder,
19798                offset,
19799                _depth,
19800            )
19801        }
19802    }
19803    unsafe impl<
19804        T0: fidl::encoding::Encode<
19805                fidl::encoding::Vector<u8, 255>,
19806                fdomain_client::fidl::FDomainResourceDialect,
19807            >,
19808        T1: fidl::encoding::Encode<
19809                ExtendedAttributeValue,
19810                fdomain_client::fidl::FDomainResourceDialect,
19811            >,
19812        T2: fidl::encoding::Encode<
19813                SetExtendedAttributeMode,
19814                fdomain_client::fidl::FDomainResourceDialect,
19815            >,
19816    >
19817        fidl::encoding::Encode<
19818            NodeSetExtendedAttributeRequest,
19819            fdomain_client::fidl::FDomainResourceDialect,
19820        > for (T0, T1, T2)
19821    {
19822        #[inline]
19823        unsafe fn encode(
19824            self,
19825            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19826            offset: usize,
19827            depth: fidl::encoding::Depth,
19828        ) -> fidl::Result<()> {
19829            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19830            // Zero out padding regions. There's no need to apply masks
19831            // because the unmasked parts will be overwritten by fields.
19832            unsafe {
19833                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
19834                (ptr as *mut u64).write_unaligned(0);
19835            }
19836            // Write the fields.
19837            self.0.encode(encoder, offset + 0, depth)?;
19838            self.1.encode(encoder, offset + 16, depth)?;
19839            self.2.encode(encoder, offset + 32, depth)?;
19840            Ok(())
19841        }
19842    }
19843
19844    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19845        for NodeSetExtendedAttributeRequest
19846    {
19847        #[inline(always)]
19848        fn new_empty() -> Self {
19849            Self {
19850                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect),
19851                value: fidl::new_empty!(
19852                    ExtendedAttributeValue,
19853                    fdomain_client::fidl::FDomainResourceDialect
19854                ),
19855                mode: fidl::new_empty!(
19856                    SetExtendedAttributeMode,
19857                    fdomain_client::fidl::FDomainResourceDialect
19858                ),
19859            }
19860        }
19861
19862        #[inline]
19863        unsafe fn decode(
19864            &mut self,
19865            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19866            offset: usize,
19867            _depth: fidl::encoding::Depth,
19868        ) -> fidl::Result<()> {
19869            decoder.debug_check_bounds::<Self>(offset);
19870            // Verify that padding bytes are zero.
19871            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
19872            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19873            let mask = 0xffffffff00000000u64;
19874            let maskedval = padval & mask;
19875            if maskedval != 0 {
19876                return Err(fidl::Error::NonZeroPadding {
19877                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
19878                });
19879            }
19880            fidl::decode!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
19881            fidl::decode!(
19882                ExtendedAttributeValue,
19883                fdomain_client::fidl::FDomainResourceDialect,
19884                &mut self.value,
19885                decoder,
19886                offset + 16,
19887                _depth
19888            )?;
19889            fidl::decode!(
19890                SetExtendedAttributeMode,
19891                fdomain_client::fidl::FDomainResourceDialect,
19892                &mut self.mode,
19893                decoder,
19894                offset + 32,
19895                _depth
19896            )?;
19897            Ok(())
19898        }
19899    }
19900
19901    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
19902        type Borrowed<'a> = &'a mut Self;
19903        fn take_or_borrow<'a>(
19904            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19905        ) -> Self::Borrowed<'a> {
19906            value
19907        }
19908    }
19909
19910    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
19911        type Owned = Self;
19912
19913        #[inline(always)]
19914        fn inline_align(_context: fidl::encoding::Context) -> usize {
19915            8
19916        }
19917
19918        #[inline(always)]
19919        fn inline_size(_context: fidl::encoding::Context) -> usize {
19920            48
19921        }
19922    }
19923
19924    unsafe impl
19925        fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19926        for &mut OpenableOpenRequest
19927    {
19928        #[inline]
19929        unsafe fn encode(
19930            self,
19931            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19932            offset: usize,
19933            _depth: fidl::encoding::Depth,
19934        ) -> fidl::Result<()> {
19935            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
19936            // Delegate to tuple encoding.
19937            fidl::encoding::Encode::<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19938                (
19939                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
19940                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
19941                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
19942                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
19943                ),
19944                encoder, offset, _depth
19945            )
19946        }
19947    }
19948    unsafe impl<
19949        T0: fidl::encoding::Encode<
19950                fidl::encoding::BoundedString<4095>,
19951                fdomain_client::fidl::FDomainResourceDialect,
19952            >,
19953        T1: fidl::encoding::Encode<Flags, fdomain_client::fidl::FDomainResourceDialect>,
19954        T2: fidl::encoding::Encode<Options, fdomain_client::fidl::FDomainResourceDialect>,
19955        T3: fidl::encoding::Encode<
19956                fidl::encoding::HandleType<
19957                    fdomain_client::Channel,
19958                    { fidl::ObjectType::CHANNEL.into_raw() },
19959                    2147483648,
19960                >,
19961                fdomain_client::fidl::FDomainResourceDialect,
19962            >,
19963    > fidl::encoding::Encode<OpenableOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19964        for (T0, T1, T2, T3)
19965    {
19966        #[inline]
19967        unsafe fn encode(
19968            self,
19969            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19970            offset: usize,
19971            depth: fidl::encoding::Depth,
19972        ) -> fidl::Result<()> {
19973            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
19974            // Zero out padding regions. There's no need to apply masks
19975            // because the unmasked parts will be overwritten by fields.
19976            unsafe {
19977                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
19978                (ptr as *mut u64).write_unaligned(0);
19979            }
19980            // Write the fields.
19981            self.0.encode(encoder, offset + 0, depth)?;
19982            self.1.encode(encoder, offset + 16, depth)?;
19983            self.2.encode(encoder, offset + 24, depth)?;
19984            self.3.encode(encoder, offset + 40, depth)?;
19985            Ok(())
19986        }
19987    }
19988
19989    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19990        for OpenableOpenRequest
19991    {
19992        #[inline(always)]
19993        fn new_empty() -> Self {
19994            Self {
19995                path: fidl::new_empty!(
19996                    fidl::encoding::BoundedString<4095>,
19997                    fdomain_client::fidl::FDomainResourceDialect
19998                ),
19999                flags: fidl::new_empty!(Flags, fdomain_client::fidl::FDomainResourceDialect),
20000                options: fidl::new_empty!(Options, fdomain_client::fidl::FDomainResourceDialect),
20001                object: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20002            }
20003        }
20004
20005        #[inline]
20006        unsafe fn decode(
20007            &mut self,
20008            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20009            offset: usize,
20010            _depth: fidl::encoding::Depth,
20011        ) -> fidl::Result<()> {
20012            decoder.debug_check_bounds::<Self>(offset);
20013            // Verify that padding bytes are zero.
20014            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
20015            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20016            let mask = 0xffffffff00000000u64;
20017            let maskedval = padval & mask;
20018            if maskedval != 0 {
20019                return Err(fidl::Error::NonZeroPadding {
20020                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
20021                });
20022            }
20023            fidl::decode!(
20024                fidl::encoding::BoundedString<4095>,
20025                fdomain_client::fidl::FDomainResourceDialect,
20026                &mut self.path,
20027                decoder,
20028                offset + 0,
20029                _depth
20030            )?;
20031            fidl::decode!(
20032                Flags,
20033                fdomain_client::fidl::FDomainResourceDialect,
20034                &mut self.flags,
20035                decoder,
20036                offset + 16,
20037                _depth
20038            )?;
20039            fidl::decode!(
20040                Options,
20041                fdomain_client::fidl::FDomainResourceDialect,
20042                &mut self.options,
20043                decoder,
20044                offset + 24,
20045                _depth
20046            )?;
20047            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)?;
20048            Ok(())
20049        }
20050    }
20051
20052    impl ConnectionInfo {
20053        #[inline(always)]
20054        fn max_ordinal_present(&self) -> u64 {
20055            if let Some(_) = self.rights {
20056                return 1;
20057            }
20058            0
20059        }
20060    }
20061
20062    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
20063        type Borrowed<'a> = &'a mut Self;
20064        fn take_or_borrow<'a>(
20065            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20066        ) -> Self::Borrowed<'a> {
20067            value
20068        }
20069    }
20070
20071    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
20072        type Owned = Self;
20073
20074        #[inline(always)]
20075        fn inline_align(_context: fidl::encoding::Context) -> usize {
20076            8
20077        }
20078
20079        #[inline(always)]
20080        fn inline_size(_context: fidl::encoding::Context) -> usize {
20081            16
20082        }
20083    }
20084
20085    unsafe impl fidl::encoding::Encode<ConnectionInfo, fdomain_client::fidl::FDomainResourceDialect>
20086        for &mut ConnectionInfo
20087    {
20088        unsafe fn encode(
20089            self,
20090            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20091            offset: usize,
20092            mut depth: fidl::encoding::Depth,
20093        ) -> fidl::Result<()> {
20094            encoder.debug_check_bounds::<ConnectionInfo>(offset);
20095            // Vector header
20096            let max_ordinal: u64 = self.max_ordinal_present();
20097            encoder.write_num(max_ordinal, offset);
20098            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20099            // Calling encoder.out_of_line_offset(0) is not allowed.
20100            if max_ordinal == 0 {
20101                return Ok(());
20102            }
20103            depth.increment()?;
20104            let envelope_size = 8;
20105            let bytes_len = max_ordinal as usize * envelope_size;
20106            #[allow(unused_variables)]
20107            let offset = encoder.out_of_line_offset(bytes_len);
20108            let mut _prev_end_offset: usize = 0;
20109            if 1 > max_ordinal {
20110                return Ok(());
20111            }
20112
20113            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20114            // are envelope_size bytes.
20115            let cur_offset: usize = (1 - 1) * envelope_size;
20116
20117            // Zero reserved fields.
20118            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20119
20120            // Safety:
20121            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20122            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20123            //   envelope_size bytes, there is always sufficient room.
20124            fidl::encoding::encode_in_envelope_optional::<
20125                Operations,
20126                fdomain_client::fidl::FDomainResourceDialect,
20127            >(
20128                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
20129                encoder,
20130                offset + cur_offset,
20131                depth,
20132            )?;
20133
20134            _prev_end_offset = cur_offset + envelope_size;
20135
20136            Ok(())
20137        }
20138    }
20139
20140    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {
20141        #[inline(always)]
20142        fn new_empty() -> Self {
20143            Self::default()
20144        }
20145
20146        unsafe fn decode(
20147            &mut self,
20148            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20149            offset: usize,
20150            mut depth: fidl::encoding::Depth,
20151        ) -> fidl::Result<()> {
20152            decoder.debug_check_bounds::<Self>(offset);
20153            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20154                None => return Err(fidl::Error::NotNullable),
20155                Some(len) => len,
20156            };
20157            // Calling decoder.out_of_line_offset(0) is not allowed.
20158            if len == 0 {
20159                return Ok(());
20160            };
20161            depth.increment()?;
20162            let envelope_size = 8;
20163            let bytes_len = len * envelope_size;
20164            let offset = decoder.out_of_line_offset(bytes_len)?;
20165            // Decode the envelope for each type.
20166            let mut _next_ordinal_to_read = 0;
20167            let mut next_offset = offset;
20168            let end_offset = offset + bytes_len;
20169            _next_ordinal_to_read += 1;
20170            if next_offset >= end_offset {
20171                return Ok(());
20172            }
20173
20174            // Decode unknown envelopes for gaps in ordinals.
20175            while _next_ordinal_to_read < 1 {
20176                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20177                _next_ordinal_to_read += 1;
20178                next_offset += envelope_size;
20179            }
20180
20181            let next_out_of_line = decoder.next_out_of_line();
20182            let handles_before = decoder.remaining_handles();
20183            if let Some((inlined, num_bytes, num_handles)) =
20184                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20185            {
20186                let member_inline_size =
20187                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20188                if inlined != (member_inline_size <= 4) {
20189                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20190                }
20191                let inner_offset;
20192                let mut inner_depth = depth.clone();
20193                if inlined {
20194                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20195                    inner_offset = next_offset;
20196                } else {
20197                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20198                    inner_depth.increment()?;
20199                }
20200                let val_ref = self.rights.get_or_insert_with(|| {
20201                    fidl::new_empty!(Operations, fdomain_client::fidl::FDomainResourceDialect)
20202                });
20203                fidl::decode!(
20204                    Operations,
20205                    fdomain_client::fidl::FDomainResourceDialect,
20206                    val_ref,
20207                    decoder,
20208                    inner_offset,
20209                    inner_depth
20210                )?;
20211                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20212                {
20213                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20214                }
20215                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20216                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20217                }
20218            }
20219
20220            next_offset += envelope_size;
20221
20222            // Decode the remaining unknown envelopes.
20223            while next_offset < end_offset {
20224                _next_ordinal_to_read += 1;
20225                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20226                next_offset += envelope_size;
20227            }
20228
20229            Ok(())
20230        }
20231    }
20232
20233    impl FileInfo {
20234        #[inline(always)]
20235        fn max_ordinal_present(&self) -> u64 {
20236            if let Some(_) = self.attributes {
20237                return 4;
20238            }
20239            if let Some(_) = self.stream {
20240                return 3;
20241            }
20242            if let Some(_) = self.observer {
20243                return 2;
20244            }
20245            if let Some(_) = self.is_append {
20246                return 1;
20247            }
20248            0
20249        }
20250    }
20251
20252    impl fidl::encoding::ResourceTypeMarker for FileInfo {
20253        type Borrowed<'a> = &'a mut Self;
20254        fn take_or_borrow<'a>(
20255            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20256        ) -> Self::Borrowed<'a> {
20257            value
20258        }
20259    }
20260
20261    unsafe impl fidl::encoding::TypeMarker for FileInfo {
20262        type Owned = Self;
20263
20264        #[inline(always)]
20265        fn inline_align(_context: fidl::encoding::Context) -> usize {
20266            8
20267        }
20268
20269        #[inline(always)]
20270        fn inline_size(_context: fidl::encoding::Context) -> usize {
20271            16
20272        }
20273    }
20274
20275    unsafe impl fidl::encoding::Encode<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
20276        for &mut FileInfo
20277    {
20278        unsafe fn encode(
20279            self,
20280            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20281            offset: usize,
20282            mut depth: fidl::encoding::Depth,
20283        ) -> fidl::Result<()> {
20284            encoder.debug_check_bounds::<FileInfo>(offset);
20285            // Vector header
20286            let max_ordinal: u64 = self.max_ordinal_present();
20287            encoder.write_num(max_ordinal, offset);
20288            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20289            // Calling encoder.out_of_line_offset(0) is not allowed.
20290            if max_ordinal == 0 {
20291                return Ok(());
20292            }
20293            depth.increment()?;
20294            let envelope_size = 8;
20295            let bytes_len = max_ordinal as usize * envelope_size;
20296            #[allow(unused_variables)]
20297            let offset = encoder.out_of_line_offset(bytes_len);
20298            let mut _prev_end_offset: usize = 0;
20299            if 1 > max_ordinal {
20300                return Ok(());
20301            }
20302
20303            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20304            // are envelope_size bytes.
20305            let cur_offset: usize = (1 - 1) * envelope_size;
20306
20307            // Zero reserved fields.
20308            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20309
20310            // Safety:
20311            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20312            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20313            //   envelope_size bytes, there is always sufficient room.
20314            fidl::encoding::encode_in_envelope_optional::<
20315                bool,
20316                fdomain_client::fidl::FDomainResourceDialect,
20317            >(
20318                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20319                encoder,
20320                offset + cur_offset,
20321                depth,
20322            )?;
20323
20324            _prev_end_offset = cur_offset + envelope_size;
20325            if 2 > max_ordinal {
20326                return Ok(());
20327            }
20328
20329            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20330            // are envelope_size bytes.
20331            let cur_offset: usize = (2 - 1) * envelope_size;
20332
20333            // Zero reserved fields.
20334            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20335
20336            // Safety:
20337            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20338            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20339            //   envelope_size bytes, there is always sufficient room.
20340            fidl::encoding::encode_in_envelope_optional::<
20341                fidl::encoding::HandleType<
20342                    fdomain_client::Event,
20343                    { fidl::ObjectType::EVENT.into_raw() },
20344                    2147483648,
20345                >,
20346                fdomain_client::fidl::FDomainResourceDialect,
20347            >(
20348                self.observer.as_mut().map(
20349                    <fidl::encoding::HandleType<
20350                        fdomain_client::Event,
20351                        { fidl::ObjectType::EVENT.into_raw() },
20352                        2147483648,
20353                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20354                ),
20355                encoder,
20356                offset + cur_offset,
20357                depth,
20358            )?;
20359
20360            _prev_end_offset = cur_offset + envelope_size;
20361            if 3 > max_ordinal {
20362                return Ok(());
20363            }
20364
20365            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20366            // are envelope_size bytes.
20367            let cur_offset: usize = (3 - 1) * envelope_size;
20368
20369            // Zero reserved fields.
20370            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20371
20372            // Safety:
20373            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20374            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20375            //   envelope_size bytes, there is always sufficient room.
20376            fidl::encoding::encode_in_envelope_optional::<
20377                fidl::encoding::HandleType<
20378                    fdomain_client::Stream,
20379                    { fidl::ObjectType::STREAM.into_raw() },
20380                    2147483648,
20381                >,
20382                fdomain_client::fidl::FDomainResourceDialect,
20383            >(
20384                self.stream.as_mut().map(
20385                    <fidl::encoding::HandleType<
20386                        fdomain_client::Stream,
20387                        { fidl::ObjectType::STREAM.into_raw() },
20388                        2147483648,
20389                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
20390                ),
20391                encoder,
20392                offset + cur_offset,
20393                depth,
20394            )?;
20395
20396            _prev_end_offset = cur_offset + envelope_size;
20397            if 4 > max_ordinal {
20398                return Ok(());
20399            }
20400
20401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
20402            // are envelope_size bytes.
20403            let cur_offset: usize = (4 - 1) * envelope_size;
20404
20405            // Zero reserved fields.
20406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20407
20408            // Safety:
20409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
20410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
20411            //   envelope_size bytes, there is always sufficient room.
20412            fidl::encoding::encode_in_envelope_optional::<
20413                NodeAttributes2,
20414                fdomain_client::fidl::FDomainResourceDialect,
20415            >(
20416                self.attributes
20417                    .as_ref()
20418                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
20419                encoder,
20420                offset + cur_offset,
20421                depth,
20422            )?;
20423
20424            _prev_end_offset = cur_offset + envelope_size;
20425
20426            Ok(())
20427        }
20428    }
20429
20430    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileInfo {
20431        #[inline(always)]
20432        fn new_empty() -> Self {
20433            Self::default()
20434        }
20435
20436        unsafe fn decode(
20437            &mut self,
20438            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20439            offset: usize,
20440            mut depth: fidl::encoding::Depth,
20441        ) -> fidl::Result<()> {
20442            decoder.debug_check_bounds::<Self>(offset);
20443            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20444                None => return Err(fidl::Error::NotNullable),
20445                Some(len) => len,
20446            };
20447            // Calling decoder.out_of_line_offset(0) is not allowed.
20448            if len == 0 {
20449                return Ok(());
20450            };
20451            depth.increment()?;
20452            let envelope_size = 8;
20453            let bytes_len = len * envelope_size;
20454            let offset = decoder.out_of_line_offset(bytes_len)?;
20455            // Decode the envelope for each type.
20456            let mut _next_ordinal_to_read = 0;
20457            let mut next_offset = offset;
20458            let end_offset = offset + bytes_len;
20459            _next_ordinal_to_read += 1;
20460            if next_offset >= end_offset {
20461                return Ok(());
20462            }
20463
20464            // Decode unknown envelopes for gaps in ordinals.
20465            while _next_ordinal_to_read < 1 {
20466                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20467                _next_ordinal_to_read += 1;
20468                next_offset += envelope_size;
20469            }
20470
20471            let next_out_of_line = decoder.next_out_of_line();
20472            let handles_before = decoder.remaining_handles();
20473            if let Some((inlined, num_bytes, num_handles)) =
20474                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20475            {
20476                let member_inline_size =
20477                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20478                if inlined != (member_inline_size <= 4) {
20479                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20480                }
20481                let inner_offset;
20482                let mut inner_depth = depth.clone();
20483                if inlined {
20484                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20485                    inner_offset = next_offset;
20486                } else {
20487                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20488                    inner_depth.increment()?;
20489                }
20490                let val_ref = self.is_append.get_or_insert_with(|| {
20491                    fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect)
20492                });
20493                fidl::decode!(
20494                    bool,
20495                    fdomain_client::fidl::FDomainResourceDialect,
20496                    val_ref,
20497                    decoder,
20498                    inner_offset,
20499                    inner_depth
20500                )?;
20501                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20502                {
20503                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20504                }
20505                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20506                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20507                }
20508            }
20509
20510            next_offset += envelope_size;
20511            _next_ordinal_to_read += 1;
20512            if next_offset >= end_offset {
20513                return Ok(());
20514            }
20515
20516            // Decode unknown envelopes for gaps in ordinals.
20517            while _next_ordinal_to_read < 2 {
20518                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20519                _next_ordinal_to_read += 1;
20520                next_offset += envelope_size;
20521            }
20522
20523            let next_out_of_line = decoder.next_out_of_line();
20524            let handles_before = decoder.remaining_handles();
20525            if let Some((inlined, num_bytes, num_handles)) =
20526                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20527            {
20528                let member_inline_size = <fidl::encoding::HandleType<
20529                    fdomain_client::Event,
20530                    { fidl::ObjectType::EVENT.into_raw() },
20531                    2147483648,
20532                > as fidl::encoding::TypeMarker>::inline_size(
20533                    decoder.context
20534                );
20535                if inlined != (member_inline_size <= 4) {
20536                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20537                }
20538                let inner_offset;
20539                let mut inner_depth = depth.clone();
20540                if inlined {
20541                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20542                    inner_offset = next_offset;
20543                } else {
20544                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20545                    inner_depth.increment()?;
20546                }
20547                let val_ref =
20548                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));
20549                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)?;
20550                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20551                {
20552                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20553                }
20554                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20555                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20556                }
20557            }
20558
20559            next_offset += envelope_size;
20560            _next_ordinal_to_read += 1;
20561            if next_offset >= end_offset {
20562                return Ok(());
20563            }
20564
20565            // Decode unknown envelopes for gaps in ordinals.
20566            while _next_ordinal_to_read < 3 {
20567                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20568                _next_ordinal_to_read += 1;
20569                next_offset += envelope_size;
20570            }
20571
20572            let next_out_of_line = decoder.next_out_of_line();
20573            let handles_before = decoder.remaining_handles();
20574            if let Some((inlined, num_bytes, num_handles)) =
20575                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20576            {
20577                let member_inline_size = <fidl::encoding::HandleType<
20578                    fdomain_client::Stream,
20579                    { fidl::ObjectType::STREAM.into_raw() },
20580                    2147483648,
20581                > as fidl::encoding::TypeMarker>::inline_size(
20582                    decoder.context
20583                );
20584                if inlined != (member_inline_size <= 4) {
20585                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20586                }
20587                let inner_offset;
20588                let mut inner_depth = depth.clone();
20589                if inlined {
20590                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20591                    inner_offset = next_offset;
20592                } else {
20593                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20594                    inner_depth.increment()?;
20595                }
20596                let val_ref =
20597                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));
20598                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)?;
20599                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20600                {
20601                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20602                }
20603                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20604                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20605                }
20606            }
20607
20608            next_offset += envelope_size;
20609            _next_ordinal_to_read += 1;
20610            if next_offset >= end_offset {
20611                return Ok(());
20612            }
20613
20614            // Decode unknown envelopes for gaps in ordinals.
20615            while _next_ordinal_to_read < 4 {
20616                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20617                _next_ordinal_to_read += 1;
20618                next_offset += envelope_size;
20619            }
20620
20621            let next_out_of_line = decoder.next_out_of_line();
20622            let handles_before = decoder.remaining_handles();
20623            if let Some((inlined, num_bytes, num_handles)) =
20624                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20625            {
20626                let member_inline_size =
20627                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20628                if inlined != (member_inline_size <= 4) {
20629                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20630                }
20631                let inner_offset;
20632                let mut inner_depth = depth.clone();
20633                if inlined {
20634                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20635                    inner_offset = next_offset;
20636                } else {
20637                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20638                    inner_depth.increment()?;
20639                }
20640                let val_ref = self.attributes.get_or_insert_with(|| {
20641                    fidl::new_empty!(NodeAttributes2, fdomain_client::fidl::FDomainResourceDialect)
20642                });
20643                fidl::decode!(
20644                    NodeAttributes2,
20645                    fdomain_client::fidl::FDomainResourceDialect,
20646                    val_ref,
20647                    decoder,
20648                    inner_offset,
20649                    inner_depth
20650                )?;
20651                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20652                {
20653                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20654                }
20655                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20656                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20657                }
20658            }
20659
20660            next_offset += envelope_size;
20661
20662            // Decode the remaining unknown envelopes.
20663            while next_offset < end_offset {
20664                _next_ordinal_to_read += 1;
20665                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20666                next_offset += envelope_size;
20667            }
20668
20669            Ok(())
20670        }
20671    }
20672
20673    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
20674        type Borrowed<'a> = &'a mut Self;
20675        fn take_or_borrow<'a>(
20676            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20677        ) -> Self::Borrowed<'a> {
20678            value
20679        }
20680    }
20681
20682    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
20683        type Owned = Self;
20684
20685        #[inline(always)]
20686        fn inline_align(_context: fidl::encoding::Context) -> usize {
20687            8
20688        }
20689
20690        #[inline(always)]
20691        fn inline_size(_context: fidl::encoding::Context) -> usize {
20692            16
20693        }
20694    }
20695
20696    unsafe impl
20697        fidl::encoding::Encode<ExtendedAttributeValue, fdomain_client::fidl::FDomainResourceDialect>
20698        for &mut ExtendedAttributeValue
20699    {
20700        #[inline]
20701        unsafe fn encode(
20702            self,
20703            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20704            offset: usize,
20705            _depth: fidl::encoding::Depth,
20706        ) -> fidl::Result<()> {
20707            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
20708            encoder.write_num::<u64>(self.ordinal(), offset);
20709            match self {
20710                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
20711                    fidl::encoding::Vector<u8, 32768>,
20712                    fdomain_client::fidl::FDomainResourceDialect,
20713                >(
20714                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
20715                        val,
20716                    ),
20717                    encoder,
20718                    offset + 8,
20719                    _depth,
20720                ),
20721                ExtendedAttributeValue::Buffer(ref mut val) => {
20722                    fidl::encoding::encode_in_envelope::<
20723                        fidl::encoding::HandleType<
20724                            fdomain_client::Vmo,
20725                            { fidl::ObjectType::VMO.into_raw() },
20726                            2147483648,
20727                        >,
20728                        fdomain_client::fidl::FDomainResourceDialect,
20729                    >(
20730                        <fidl::encoding::HandleType<
20731                            fdomain_client::Vmo,
20732                            { fidl::ObjectType::VMO.into_raw() },
20733                            2147483648,
20734                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20735                            val
20736                        ),
20737                        encoder,
20738                        offset + 8,
20739                        _depth,
20740                    )
20741                }
20742                ExtendedAttributeValue::__SourceBreaking { .. } => {
20743                    Err(fidl::Error::UnknownUnionTag)
20744                }
20745            }
20746        }
20747    }
20748
20749    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20750        for ExtendedAttributeValue
20751    {
20752        #[inline(always)]
20753        fn new_empty() -> Self {
20754            Self::__SourceBreaking { unknown_ordinal: 0 }
20755        }
20756
20757        #[inline]
20758        unsafe fn decode(
20759            &mut self,
20760            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20761            offset: usize,
20762            mut depth: fidl::encoding::Depth,
20763        ) -> fidl::Result<()> {
20764            decoder.debug_check_bounds::<Self>(offset);
20765            #[allow(unused_variables)]
20766            let next_out_of_line = decoder.next_out_of_line();
20767            let handles_before = decoder.remaining_handles();
20768            let (ordinal, inlined, num_bytes, num_handles) =
20769                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20770
20771            let member_inline_size = match ordinal {
20772                1 => {
20773                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
20774                        decoder.context,
20775                    )
20776                }
20777                2 => <fidl::encoding::HandleType<
20778                    fdomain_client::Vmo,
20779                    { fidl::ObjectType::VMO.into_raw() },
20780                    2147483648,
20781                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20782                0 => return Err(fidl::Error::UnknownUnionTag),
20783                _ => num_bytes as usize,
20784            };
20785
20786            if inlined != (member_inline_size <= 4) {
20787                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20788            }
20789            let _inner_offset;
20790            if inlined {
20791                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20792                _inner_offset = offset + 8;
20793            } else {
20794                depth.increment()?;
20795                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20796            }
20797            match ordinal {
20798                1 => {
20799                    #[allow(irrefutable_let_patterns)]
20800                    if let ExtendedAttributeValue::Bytes(_) = self {
20801                        // Do nothing, read the value into the object
20802                    } else {
20803                        // Initialize `self` to the right variant
20804                        *self = ExtendedAttributeValue::Bytes(
20805                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect),
20806                        );
20807                    }
20808                    #[allow(irrefutable_let_patterns)]
20809                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
20810                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20811                    } else {
20812                        unreachable!()
20813                    }
20814                }
20815                2 => {
20816                    #[allow(irrefutable_let_patterns)]
20817                    if let ExtendedAttributeValue::Buffer(_) = self {
20818                        // Do nothing, read the value into the object
20819                    } else {
20820                        // Initialize `self` to the right variant
20821                        *self = ExtendedAttributeValue::Buffer(
20822                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20823                        );
20824                    }
20825                    #[allow(irrefutable_let_patterns)]
20826                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
20827                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20828                    } else {
20829                        unreachable!()
20830                    }
20831                }
20832                #[allow(deprecated)]
20833                ordinal => {
20834                    for _ in 0..num_handles {
20835                        decoder.drop_next_handle()?;
20836                    }
20837                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
20838                }
20839            }
20840            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20841                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20842            }
20843            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20844                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20845            }
20846            Ok(())
20847        }
20848    }
20849
20850    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
20851        type Borrowed<'a> = &'a mut Self;
20852        fn take_or_borrow<'a>(
20853            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20854        ) -> Self::Borrowed<'a> {
20855            value
20856        }
20857    }
20858
20859    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
20860        type Owned = Self;
20861
20862        #[inline(always)]
20863        fn inline_align(_context: fidl::encoding::Context) -> usize {
20864            8
20865        }
20866
20867        #[inline(always)]
20868        fn inline_size(_context: fidl::encoding::Context) -> usize {
20869            16
20870        }
20871    }
20872
20873    unsafe impl
20874        fidl::encoding::Encode<NodeInfoDeprecated, fdomain_client::fidl::FDomainResourceDialect>
20875        for &mut NodeInfoDeprecated
20876    {
20877        #[inline]
20878        unsafe fn encode(
20879            self,
20880            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20881            offset: usize,
20882            _depth: fidl::encoding::Depth,
20883        ) -> fidl::Result<()> {
20884            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
20885            encoder.write_num::<u64>(self.ordinal(), offset);
20886            match self {
20887                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
20888                    Service,
20889                    fdomain_client::fidl::FDomainResourceDialect,
20890                >(
20891                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
20892                    encoder,
20893                    offset + 8,
20894                    _depth,
20895                ),
20896                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20897                    FileObject,
20898                    fdomain_client::fidl::FDomainResourceDialect,
20899                >(
20900                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20901                    encoder,
20902                    offset + 8,
20903                    _depth,
20904                ),
20905                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20906                    DirectoryObject,
20907                    fdomain_client::fidl::FDomainResourceDialect,
20908                >(
20909                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20910                    encoder,
20911                    offset + 8,
20912                    _depth,
20913                ),
20914                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20915                    SymlinkObject,
20916                    fdomain_client::fidl::FDomainResourceDialect,
20917                >(
20918                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20919                    encoder,
20920                    offset + 8,
20921                    _depth,
20922                ),
20923            }
20924        }
20925    }
20926
20927    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20928        for NodeInfoDeprecated
20929    {
20930        #[inline(always)]
20931        fn new_empty() -> Self {
20932            Self::Service(fidl::new_empty!(Service, fdomain_client::fidl::FDomainResourceDialect))
20933        }
20934
20935        #[inline]
20936        unsafe fn decode(
20937            &mut self,
20938            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20939            offset: usize,
20940            mut depth: fidl::encoding::Depth,
20941        ) -> fidl::Result<()> {
20942            decoder.debug_check_bounds::<Self>(offset);
20943            #[allow(unused_variables)]
20944            let next_out_of_line = decoder.next_out_of_line();
20945            let handles_before = decoder.remaining_handles();
20946            let (ordinal, inlined, num_bytes, num_handles) =
20947                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20948
20949            let member_inline_size = match ordinal {
20950                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20951                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20952                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20953                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20954                _ => return Err(fidl::Error::UnknownUnionTag),
20955            };
20956
20957            if inlined != (member_inline_size <= 4) {
20958                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20959            }
20960            let _inner_offset;
20961            if inlined {
20962                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20963                _inner_offset = offset + 8;
20964            } else {
20965                depth.increment()?;
20966                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20967            }
20968            match ordinal {
20969                1 => {
20970                    #[allow(irrefutable_let_patterns)]
20971                    if let NodeInfoDeprecated::Service(_) = self {
20972                        // Do nothing, read the value into the object
20973                    } else {
20974                        // Initialize `self` to the right variant
20975                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
20976                            Service,
20977                            fdomain_client::fidl::FDomainResourceDialect
20978                        ));
20979                    }
20980                    #[allow(irrefutable_let_patterns)]
20981                    if let NodeInfoDeprecated::Service(ref mut val) = self {
20982                        fidl::decode!(
20983                            Service,
20984                            fdomain_client::fidl::FDomainResourceDialect,
20985                            val,
20986                            decoder,
20987                            _inner_offset,
20988                            depth
20989                        )?;
20990                    } else {
20991                        unreachable!()
20992                    }
20993                }
20994                2 => {
20995                    #[allow(irrefutable_let_patterns)]
20996                    if let NodeInfoDeprecated::File(_) = self {
20997                        // Do nothing, read the value into the object
20998                    } else {
20999                        // Initialize `self` to the right variant
21000                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
21001                            FileObject,
21002                            fdomain_client::fidl::FDomainResourceDialect
21003                        ));
21004                    }
21005                    #[allow(irrefutable_let_patterns)]
21006                    if let NodeInfoDeprecated::File(ref mut val) = self {
21007                        fidl::decode!(
21008                            FileObject,
21009                            fdomain_client::fidl::FDomainResourceDialect,
21010                            val,
21011                            decoder,
21012                            _inner_offset,
21013                            depth
21014                        )?;
21015                    } else {
21016                        unreachable!()
21017                    }
21018                }
21019                3 => {
21020                    #[allow(irrefutable_let_patterns)]
21021                    if let NodeInfoDeprecated::Directory(_) = self {
21022                        // Do nothing, read the value into the object
21023                    } else {
21024                        // Initialize `self` to the right variant
21025                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
21026                            DirectoryObject,
21027                            fdomain_client::fidl::FDomainResourceDialect
21028                        ));
21029                    }
21030                    #[allow(irrefutable_let_patterns)]
21031                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
21032                        fidl::decode!(
21033                            DirectoryObject,
21034                            fdomain_client::fidl::FDomainResourceDialect,
21035                            val,
21036                            decoder,
21037                            _inner_offset,
21038                            depth
21039                        )?;
21040                    } else {
21041                        unreachable!()
21042                    }
21043                }
21044                4 => {
21045                    #[allow(irrefutable_let_patterns)]
21046                    if let NodeInfoDeprecated::Symlink(_) = self {
21047                        // Do nothing, read the value into the object
21048                    } else {
21049                        // Initialize `self` to the right variant
21050                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
21051                            SymlinkObject,
21052                            fdomain_client::fidl::FDomainResourceDialect
21053                        ));
21054                    }
21055                    #[allow(irrefutable_let_patterns)]
21056                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
21057                        fidl::decode!(
21058                            SymlinkObject,
21059                            fdomain_client::fidl::FDomainResourceDialect,
21060                            val,
21061                            decoder,
21062                            _inner_offset,
21063                            depth
21064                        )?;
21065                    } else {
21066                        unreachable!()
21067                    }
21068                }
21069                ordinal => panic!("unexpected ordinal {:?}", ordinal),
21070            }
21071            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21072                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21073            }
21074            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21075                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21076            }
21077            Ok(())
21078        }
21079    }
21080
21081    impl fidl::encoding::ResourceTypeMarker for Representation {
21082        type Borrowed<'a> = &'a mut Self;
21083        fn take_or_borrow<'a>(
21084            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21085        ) -> Self::Borrowed<'a> {
21086            value
21087        }
21088    }
21089
21090    unsafe impl fidl::encoding::TypeMarker for Representation {
21091        type Owned = Self;
21092
21093        #[inline(always)]
21094        fn inline_align(_context: fidl::encoding::Context) -> usize {
21095            8
21096        }
21097
21098        #[inline(always)]
21099        fn inline_size(_context: fidl::encoding::Context) -> usize {
21100            16
21101        }
21102    }
21103
21104    unsafe impl fidl::encoding::Encode<Representation, fdomain_client::fidl::FDomainResourceDialect>
21105        for &mut Representation
21106    {
21107        #[inline]
21108        unsafe fn encode(
21109            self,
21110            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21111            offset: usize,
21112            _depth: fidl::encoding::Depth,
21113        ) -> fidl::Result<()> {
21114            encoder.debug_check_bounds::<Representation>(offset);
21115            encoder.write_num::<u64>(self.ordinal(), offset);
21116            match self {
21117                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
21118                    NodeInfo,
21119                    fdomain_client::fidl::FDomainResourceDialect,
21120                >(
21121                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21122                    encoder,
21123                    offset + 8,
21124                    _depth,
21125                ),
21126                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
21127                    DirectoryInfo,
21128                    fdomain_client::fidl::FDomainResourceDialect,
21129                >(
21130                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21131                    encoder,
21132                    offset + 8,
21133                    _depth,
21134                ),
21135                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
21136                    FileInfo,
21137                    fdomain_client::fidl::FDomainResourceDialect,
21138                >(
21139                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
21140                    encoder,
21141                    offset + 8,
21142                    _depth,
21143                ),
21144                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
21145                    SymlinkInfo,
21146                    fdomain_client::fidl::FDomainResourceDialect,
21147                >(
21148                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
21149                    encoder,
21150                    offset + 8,
21151                    _depth,
21152                ),
21153                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
21154            }
21155        }
21156    }
21157
21158    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Representation {
21159        #[inline(always)]
21160        fn new_empty() -> Self {
21161            Self::__SourceBreaking { unknown_ordinal: 0 }
21162        }
21163
21164        #[inline]
21165        unsafe fn decode(
21166            &mut self,
21167            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
21168            offset: usize,
21169            mut depth: fidl::encoding::Depth,
21170        ) -> fidl::Result<()> {
21171            decoder.debug_check_bounds::<Self>(offset);
21172            #[allow(unused_variables)]
21173            let next_out_of_line = decoder.next_out_of_line();
21174            let handles_before = decoder.remaining_handles();
21175            let (ordinal, inlined, num_bytes, num_handles) =
21176                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
21177
21178            let member_inline_size = match ordinal {
21179                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21180                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21181                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21182                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21183                0 => return Err(fidl::Error::UnknownUnionTag),
21184                _ => num_bytes as usize,
21185            };
21186
21187            if inlined != (member_inline_size <= 4) {
21188                return Err(fidl::Error::InvalidInlineBitInEnvelope);
21189            }
21190            let _inner_offset;
21191            if inlined {
21192                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
21193                _inner_offset = offset + 8;
21194            } else {
21195                depth.increment()?;
21196                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21197            }
21198            match ordinal {
21199                1 => {
21200                    #[allow(irrefutable_let_patterns)]
21201                    if let Representation::Node(_) = self {
21202                        // Do nothing, read the value into the object
21203                    } else {
21204                        // Initialize `self` to the right variant
21205                        *self = Representation::Node(fidl::new_empty!(
21206                            NodeInfo,
21207                            fdomain_client::fidl::FDomainResourceDialect
21208                        ));
21209                    }
21210                    #[allow(irrefutable_let_patterns)]
21211                    if let Representation::Node(ref mut val) = self {
21212                        fidl::decode!(
21213                            NodeInfo,
21214                            fdomain_client::fidl::FDomainResourceDialect,
21215                            val,
21216                            decoder,
21217                            _inner_offset,
21218                            depth
21219                        )?;
21220                    } else {
21221                        unreachable!()
21222                    }
21223                }
21224                2 => {
21225                    #[allow(irrefutable_let_patterns)]
21226                    if let Representation::Directory(_) = self {
21227                        // Do nothing, read the value into the object
21228                    } else {
21229                        // Initialize `self` to the right variant
21230                        *self = Representation::Directory(fidl::new_empty!(
21231                            DirectoryInfo,
21232                            fdomain_client::fidl::FDomainResourceDialect
21233                        ));
21234                    }
21235                    #[allow(irrefutable_let_patterns)]
21236                    if let Representation::Directory(ref mut val) = self {
21237                        fidl::decode!(
21238                            DirectoryInfo,
21239                            fdomain_client::fidl::FDomainResourceDialect,
21240                            val,
21241                            decoder,
21242                            _inner_offset,
21243                            depth
21244                        )?;
21245                    } else {
21246                        unreachable!()
21247                    }
21248                }
21249                3 => {
21250                    #[allow(irrefutable_let_patterns)]
21251                    if let Representation::File(_) = self {
21252                        // Do nothing, read the value into the object
21253                    } else {
21254                        // Initialize `self` to the right variant
21255                        *self = Representation::File(fidl::new_empty!(
21256                            FileInfo,
21257                            fdomain_client::fidl::FDomainResourceDialect
21258                        ));
21259                    }
21260                    #[allow(irrefutable_let_patterns)]
21261                    if let Representation::File(ref mut val) = self {
21262                        fidl::decode!(
21263                            FileInfo,
21264                            fdomain_client::fidl::FDomainResourceDialect,
21265                            val,
21266                            decoder,
21267                            _inner_offset,
21268                            depth
21269                        )?;
21270                    } else {
21271                        unreachable!()
21272                    }
21273                }
21274                4 => {
21275                    #[allow(irrefutable_let_patterns)]
21276                    if let Representation::Symlink(_) = self {
21277                        // Do nothing, read the value into the object
21278                    } else {
21279                        // Initialize `self` to the right variant
21280                        *self = Representation::Symlink(fidl::new_empty!(
21281                            SymlinkInfo,
21282                            fdomain_client::fidl::FDomainResourceDialect
21283                        ));
21284                    }
21285                    #[allow(irrefutable_let_patterns)]
21286                    if let Representation::Symlink(ref mut val) = self {
21287                        fidl::decode!(
21288                            SymlinkInfo,
21289                            fdomain_client::fidl::FDomainResourceDialect,
21290                            val,
21291                            decoder,
21292                            _inner_offset,
21293                            depth
21294                        )?;
21295                    } else {
21296                        unreachable!()
21297                    }
21298                }
21299                #[allow(deprecated)]
21300                ordinal => {
21301                    for _ in 0..num_handles {
21302                        decoder.drop_next_handle()?;
21303                    }
21304                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
21305                }
21306            }
21307            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
21308                return Err(fidl::Error::InvalidNumBytesInEnvelope);
21309            }
21310            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21311                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21312            }
21313            Ok(())
21314        }
21315    }
21316}