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, PartialEq)]
60pub struct DirectoryOpenRequest {
61    pub path: String,
62    pub flags: Flags,
63    pub options: Options,
64    pub object: fdomain_client::Channel,
65}
66
67impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryOpenRequest {}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct DirectoryRenameRequest {
71    pub src: String,
72    pub dst_parent_token: fdomain_client::Event,
73    pub dst: String,
74}
75
76impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryRenameRequest {}
77
78#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct DirectoryWatchRequest {
80    pub mask: WatchMask,
81    pub options: u32,
82    pub watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
83}
84
85impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirectoryWatchRequest {}
86
87#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
88pub struct FileAllocateRequest {
89    pub offset: u64,
90    pub length: u64,
91    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
92    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
93    /// support a particular provided mode bit, or combination of mode bits, an error is
94    /// returned.
95    pub mode: AllocateMode,
96}
97
98impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileAllocateRequest {}
99
100#[derive(Debug, PartialEq)]
101pub struct FileEnableVerityRequest {
102    pub options: VerificationOptions,
103}
104
105impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileEnableVerityRequest {}
106
107#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108pub struct FileObject {
109    /// An optional event which transmits information about an object's readability
110    /// or writability. This event relays information about the underlying object, not
111    /// the capability granted to client: this event may be signalled "readable" on a
112    /// connection that does not have the capability to read.
113    ///
114    /// The "`FILE_SIGNAL_`" values may be observed on this event.
115    pub event: Option<fdomain_client::Event>,
116    /// A placeholder for future stream support.
117    ///
118    /// Currently, servers are required not to send a handle in this field.
119    pub stream: Option<fdomain_client::Stream>,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for FileObject {}
123
124#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct FileGetBackingMemoryResponse {
126    pub vmo: fdomain_client::Vmo,
127}
128
129impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
130    for FileGetBackingMemoryResponse
131{
132}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct LinkableLinkIntoRequest {
136    pub dst_parent_token: fdomain_client::Event,
137    pub dst: String,
138}
139
140impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for LinkableLinkIntoRequest {}
141
142#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
143pub struct NodeDeprecatedCloneRequest {
144    pub flags: OpenFlags,
145    pub object: fdomain_client::fidl::ServerEnd<NodeMarker>,
146}
147
148impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeDeprecatedCloneRequest {}
149
150#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151pub struct NodeListExtendedAttributesRequest {
152    pub iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
153}
154
155impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
156    for NodeListExtendedAttributesRequest
157{
158}
159
160#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
161pub struct NodeOnOpenRequest {
162    pub s: i32,
163    pub info: Option<Box<NodeInfoDeprecated>>,
164}
165
166impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NodeOnOpenRequest {}
167
168#[derive(Debug, PartialEq)]
169pub struct NodeSetExtendedAttributeRequest {
170    pub name: Vec<u8>,
171    pub value: ExtendedAttributeValue,
172    /// Specifies the behavior based on the current state of the attribute.
173    pub mode: SetExtendedAttributeMode,
174}
175
176impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
177    for NodeSetExtendedAttributeRequest
178{
179}
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.
218    ///
219    /// Reading and writing the file using the stream object can be up to 20x
220    /// faster than reading and writing the file using the Read and Write
221    /// operations in the [`File`] protocol.
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 fdomain_client::fidl::ControlHandle for AdvisoryLockingControlHandle {
712    fn shutdown(&self) {
713        self.inner.shutdown()
714    }
715
716    fn is_closed(&self) -> bool {
717        self.inner.channel().is_closed()
718    }
719    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
720        self.inner.channel().on_closed()
721    }
722}
723
724impl AdvisoryLockingControlHandle {}
725
726#[must_use = "FIDL methods require a response to be sent"]
727#[derive(Debug)]
728pub struct AdvisoryLockingAdvisoryLockResponder {
729    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
730    tx_id: u32,
731}
732
733/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
734/// if the responder is dropped without sending a response, so that the client
735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
736impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
737    fn drop(&mut self) {
738        self.control_handle.shutdown();
739        // Safety: drops once, never accessed again
740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
741    }
742}
743
744impl fdomain_client::fidl::Responder for AdvisoryLockingAdvisoryLockResponder {
745    type ControlHandle = AdvisoryLockingControlHandle;
746
747    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
748        &self.control_handle
749    }
750
751    fn drop_without_shutdown(mut self) {
752        // Safety: drops once, never accessed again due to mem::forget
753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
754        // Prevent Drop from running (which would shut down the channel)
755        std::mem::forget(self);
756    }
757}
758
759impl AdvisoryLockingAdvisoryLockResponder {
760    /// Sends a response to the FIDL transaction.
761    ///
762    /// Sets the channel to shutdown if an error occurs.
763    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
764        let _result = self.send_raw(result);
765        if _result.is_err() {
766            self.control_handle.shutdown();
767        }
768        self.drop_without_shutdown();
769        _result
770    }
771
772    /// Similar to "send" but does not shutdown the channel if an error occurs.
773    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
774        let _result = self.send_raw(result);
775        self.drop_without_shutdown();
776        _result
777    }
778
779    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
780        self.control_handle
781            .inner
782            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
783                result,
784                self.tx_id,
785                0x6ee9c0ad53ec87aa,
786                fidl::encoding::DynamicFlags::empty(),
787            )
788    }
789}
790
791#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
792pub struct DirectoryMarker;
793
794impl fdomain_client::fidl::ProtocolMarker for DirectoryMarker {
795    type Proxy = DirectoryProxy;
796    type RequestStream = DirectoryRequestStream;
797
798    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
799}
800impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryMarker {}
801pub type DirectoryUnlinkResult = Result<(), i32>;
802pub type DirectoryRenameResult = Result<(), i32>;
803pub type DirectoryCreateSymlinkResult = Result<(), i32>;
804
805pub trait DirectoryProxyInterface: Send + Sync {
806    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
807        + Send;
808    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
809    fn r#clone(
810        &self,
811        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
812    ) -> Result<(), fidl::Error>;
813    type CloseResponseFut: std::future::Future<
814            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
815        > + Send;
816    fn r#close(&self) -> Self::CloseResponseFut;
817    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
818    fn r#query(&self) -> Self::QueryResponseFut;
819    fn r#deprecated_clone(
820        &self,
821        flags: OpenFlags,
822        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
823    ) -> Result<(), fidl::Error>;
824    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
825        + Send;
826    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
827    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
828    fn r#deprecated_set_attr(
829        &self,
830        flags: NodeAttributeFlags,
831        attributes: &NodeAttributes,
832    ) -> Self::DeprecatedSetAttrResponseFut;
833    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
834        + Send;
835    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
836    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
837        + Send;
838    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
839    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
840        + Send;
841    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
842    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
843        + Send;
844    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
845    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
846        + Send;
847    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
848    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
849        + Send;
850    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
851    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
852        + Send;
853    fn r#update_attributes(
854        &self,
855        payload: &MutableNodeAttributes,
856    ) -> Self::UpdateAttributesResponseFut;
857    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
858    fn r#sync(&self) -> Self::SyncResponseFut;
859    fn r#list_extended_attributes(
860        &self,
861        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
862    ) -> Result<(), fidl::Error>;
863    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
864        + Send;
865    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
866    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
867        + Send;
868    fn r#set_extended_attribute(
869        &self,
870        name: &[u8],
871        value: ExtendedAttributeValue,
872        mode: SetExtendedAttributeMode,
873    ) -> Self::SetExtendedAttributeResponseFut;
874    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
875        + Send;
876    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
877    fn r#deprecated_open(
878        &self,
879        flags: OpenFlags,
880        mode: ModeType,
881        path: &str,
882        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
883    ) -> Result<(), fidl::Error>;
884    fn r#open(
885        &self,
886        path: &str,
887        flags: Flags,
888        options: &Options,
889        object: fdomain_client::Channel,
890    ) -> Result<(), fidl::Error>;
891    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
892        + Send;
893    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
894    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
895    fn r#rewind(&self) -> Self::RewindResponseFut;
896    type GetTokenResponseFut: std::future::Future<
897            Output = Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error>,
898        > + Send;
899    fn r#get_token(&self) -> Self::GetTokenResponseFut;
900    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
901    fn r#link(
902        &self,
903        src: &str,
904        dst_parent_token: fdomain_client::NullableHandle,
905        dst: &str,
906    ) -> Self::LinkResponseFut;
907    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
908        + Send;
909    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
910    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
911        + Send;
912    fn r#rename(
913        &self,
914        src: &str,
915        dst_parent_token: fdomain_client::Event,
916        dst: &str,
917    ) -> Self::RenameResponseFut;
918    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
919        + Send;
920    fn r#create_symlink(
921        &self,
922        name: &str,
923        target: &[u8],
924        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
925    ) -> Self::CreateSymlinkResponseFut;
926    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
927    fn r#watch(
928        &self,
929        mask: WatchMask,
930        options: u32,
931        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
932    ) -> Self::WatchResponseFut;
933}
934
935#[derive(Debug, Clone)]
936pub struct DirectoryProxy {
937    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
938}
939
940impl fdomain_client::fidl::Proxy for DirectoryProxy {
941    type Protocol = DirectoryMarker;
942
943    fn from_channel(inner: fdomain_client::Channel) -> Self {
944        Self::new(inner)
945    }
946
947    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
948        self.client.into_channel().map_err(|client| Self { client })
949    }
950
951    fn as_channel(&self) -> &fdomain_client::Channel {
952        self.client.as_channel()
953    }
954}
955
956impl DirectoryProxy {
957    /// Create a new Proxy for fuchsia.io/Directory.
958    pub fn new(channel: fdomain_client::Channel) -> Self {
959        let protocol_name = <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
960        Self { client: fidl::client::Client::new(channel, protocol_name) }
961    }
962
963    /// Get a Stream of events from the remote end of the protocol.
964    ///
965    /// # Panics
966    ///
967    /// Panics if the event stream was already taken.
968    pub fn take_event_stream(&self) -> DirectoryEventStream {
969        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
970    }
971
972    /// Acquires an advisory lock on the underlying file.
973    ///
974    /// The lock lasts until either this connection is closed or
975    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
976    /// explicitly.
977    ///
978    /// Advisory locks are purely advisory. They do not prevent actual read or
979    /// write operations from occurring on the file, either through this
980    /// connection or through other connections.
981    ///
982    /// This method requires the following rights:
983    ///
984    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
985    /// * [`Rights.WRITE_BYTES`] if `request.type` is
986    ///   [`AdvisoryLockType.WRITE`].
987    ///
988    /// # Errors
989    ///
990    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
991    ///   example, another connection might hold a conflicting lock type.
992    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
993    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
994    ///   to acquire the given type of lock.
995    pub fn r#advisory_lock(
996        &self,
997        mut request: &AdvisoryLockRequest,
998    ) -> fidl::client::QueryResponseFut<
999        AdvisoryLockingAdvisoryLockResult,
1000        fdomain_client::fidl::FDomainResourceDialect,
1001    > {
1002        DirectoryProxyInterface::r#advisory_lock(self, request)
1003    }
1004
1005    pub fn r#clone(
1006        &self,
1007        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1008    ) -> Result<(), fidl::Error> {
1009        DirectoryProxyInterface::r#clone(self, request)
1010    }
1011
1012    /// Terminates the connection.
1013    ///
1014    /// After calling `Close`, the client must not send any other requests.
1015    ///
1016    /// Servers, after sending the status response, should close the connection
1017    /// regardless of status and without sending an epitaph.
1018    ///
1019    /// Closing the client end of the channel should be semantically equivalent
1020    /// to calling `Close` without knowing when the close has completed or its
1021    /// status.
1022    pub fn r#close(
1023        &self,
1024    ) -> fidl::client::QueryResponseFut<
1025        fdomain_fuchsia_unknown::CloseableCloseResult,
1026        fdomain_client::fidl::FDomainResourceDialect,
1027    > {
1028        DirectoryProxyInterface::r#close(self)
1029    }
1030
1031    pub fn r#query(
1032        &self,
1033    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
1034        DirectoryProxyInterface::r#query(self)
1035    }
1036
1037    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1038    pub fn r#deprecated_clone(
1039        &self,
1040        mut flags: OpenFlags,
1041        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1042    ) -> Result<(), fidl::Error> {
1043        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1044    }
1045
1046    /// DEPRECATED - Use `Node.GetAttributes` instead.
1047    pub fn r#deprecated_get_attr(
1048        &self,
1049    ) -> fidl::client::QueryResponseFut<
1050        (i32, NodeAttributes),
1051        fdomain_client::fidl::FDomainResourceDialect,
1052    > {
1053        DirectoryProxyInterface::r#deprecated_get_attr(self)
1054    }
1055
1056    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1057    pub fn r#deprecated_set_attr(
1058        &self,
1059        mut flags: NodeAttributeFlags,
1060        mut attributes: &NodeAttributes,
1061    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1062        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1063    }
1064
1065    /// [DEPRECATED - Use new GetFlags method instead.]
1066    pub fn r#deprecated_get_flags(
1067        &self,
1068    ) -> fidl::client::QueryResponseFut<
1069        (i32, OpenFlags),
1070        fdomain_client::fidl::FDomainResourceDialect,
1071    > {
1072        DirectoryProxyInterface::r#deprecated_get_flags(self)
1073    }
1074
1075    /// [DEPRECATED - Use new SetFlags method instead.]
1076    pub fn r#deprecated_set_flags(
1077        &self,
1078        mut flags: OpenFlags,
1079    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1080        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1081    }
1082
1083    /// Queries the flags that apply to this node after it has been opened/created. This method does
1084    /// not require any rights.
1085    ///
1086    /// Note that the final set of flags that apply to the connection may differ from those
1087    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1088    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1089    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1090    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1091    pub fn r#get_flags(
1092        &self,
1093    ) -> fidl::client::QueryResponseFut<
1094        NodeGetFlagsResult,
1095        fdomain_client::fidl::FDomainResourceDialect,
1096    > {
1097        DirectoryProxyInterface::r#get_flags(self)
1098    }
1099
1100    /// Sets the flags that apply to this node after it has been opened. This method does not
1101    /// require any rights.
1102    ///
1103    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1104    /// clear append mode.
1105    ///
1106    /// Errors:
1107    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1108    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1109    pub fn r#set_flags(
1110        &self,
1111        mut flags: Flags,
1112    ) -> fidl::client::QueryResponseFut<
1113        NodeSetFlagsResult,
1114        fdomain_client::fidl::FDomainResourceDialect,
1115    > {
1116        DirectoryProxyInterface::r#set_flags(self, flags)
1117    }
1118
1119    /// Query the filesystem for filesystem-specific information.
1120    pub fn r#query_filesystem(
1121        &self,
1122    ) -> fidl::client::QueryResponseFut<
1123        (i32, Option<Box<FilesystemInfo>>),
1124        fdomain_client::fidl::FDomainResourceDialect,
1125    > {
1126        DirectoryProxyInterface::r#query_filesystem(self)
1127    }
1128
1129    /// Acquires information about the node.
1130    ///
1131    /// The attributes of a node should be stable, independent of the
1132    /// specific protocol used to access it.
1133    ///
1134    /// If a particular attribute is not applicable or not supported,
1135    /// filesystems should leave the corresponding field absent.
1136    ///
1137    /// + `query` a bit-mask specifying which attributes to fetch. The server
1138    ///   should not return more than necessary.
1139    /// - `attributes` the returned attributes.
1140    ///
1141    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1142    pub fn r#get_attributes(
1143        &self,
1144        mut query: NodeAttributesQuery,
1145    ) -> fidl::client::QueryResponseFut<
1146        NodeGetAttributesResult,
1147        fdomain_client::fidl::FDomainResourceDialect,
1148    > {
1149        DirectoryProxyInterface::r#get_attributes(self, query)
1150    }
1151
1152    /// Updates information about the node.
1153    ///
1154    /// + `attributes` the presence of a table field in `attributes` indicates
1155    /// the intent to update the corresponding attribute.
1156    ///
1157    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1158    ///
1159    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1160    pub fn r#update_attributes(
1161        &self,
1162        mut payload: &MutableNodeAttributes,
1163    ) -> fidl::client::QueryResponseFut<
1164        NodeUpdateAttributesResult,
1165        fdomain_client::fidl::FDomainResourceDialect,
1166    > {
1167        DirectoryProxyInterface::r#update_attributes(self, payload)
1168    }
1169
1170    /// Synchronizes updates to the node to the underlying media, if it exists.
1171    ///
1172    /// This method will return when the filesystem server has flushed the
1173    /// relevant updates to the underlying media, but does not guarantee the
1174    /// underlying media has persisted the information, nor that any information
1175    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1176    /// between operations.
1177    ///
1178    /// This method does not require any rights.
1179    pub fn r#sync(
1180        &self,
1181    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
1182    {
1183        DirectoryProxyInterface::r#sync(self)
1184    }
1185
1186    /// Creates an iterator over all the extended attribute names associated
1187    /// with this node. If an error occurs it is returned as an epitaph on the
1188    /// iterator request channel, and then the channel is closed.
1189    ///
1190    /// GetExtendedAttributes can be used with any of these names to retrieve
1191    /// the associated value.
1192    ///
1193    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1194    pub fn r#list_extended_attributes(
1195        &self,
1196        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1197    ) -> Result<(), fidl::Error> {
1198        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
1199    }
1200
1201    /// Get the value associated with the given attribute `name` for this node.
1202    ///
1203    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1204    /// particular structure is imposed on them.
1205    ///
1206    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1207    pub fn r#get_extended_attribute(
1208        &self,
1209        mut name: &[u8],
1210    ) -> fidl::client::QueryResponseFut<
1211        NodeGetExtendedAttributeResult,
1212        fdomain_client::fidl::FDomainResourceDialect,
1213    > {
1214        DirectoryProxyInterface::r#get_extended_attribute(self, name)
1215    }
1216
1217    /// Set the value for the given attribute `name` to `value` for this node.
1218    ///
1219    /// The attribute name may exist, in which case the attribute is updated.
1220    /// If the attribute doesn't exist, it is created. The name should have no
1221    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1222    ///
1223    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1224    pub fn r#set_extended_attribute(
1225        &self,
1226        mut name: &[u8],
1227        mut value: ExtendedAttributeValue,
1228        mut mode: SetExtendedAttributeMode,
1229    ) -> fidl::client::QueryResponseFut<
1230        NodeSetExtendedAttributeResult,
1231        fdomain_client::fidl::FDomainResourceDialect,
1232    > {
1233        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
1234    }
1235
1236    /// Remove the specified extended attribute.
1237    ///
1238    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1239    ///
1240    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1241    pub fn r#remove_extended_attribute(
1242        &self,
1243        mut name: &[u8],
1244    ) -> fidl::client::QueryResponseFut<
1245        NodeRemoveExtendedAttributeResult,
1246        fdomain_client::fidl::FDomainResourceDialect,
1247    > {
1248        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
1249    }
1250
1251    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1252    pub fn r#deprecated_open(
1253        &self,
1254        mut flags: OpenFlags,
1255        mut mode: ModeType,
1256        mut path: &str,
1257        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1258    ) -> Result<(), fidl::Error> {
1259        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
1260    }
1261
1262    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1263    /// epitaph sent on the `object` channel.
1264    ///
1265    /// Errors:
1266    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1267    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1268    pub fn r#open(
1269        &self,
1270        mut path: &str,
1271        mut flags: Flags,
1272        mut options: &Options,
1273        mut object: fdomain_client::Channel,
1274    ) -> Result<(), fidl::Error> {
1275        DirectoryProxyInterface::r#open(self, path, flags, options, object)
1276    }
1277
1278    /// Reads a collection of variably sized dirents into a buffer.
1279    /// The number of dirents in a directory may be very large: akin to
1280    /// calling read multiple times on a file, directories have a seek
1281    /// offset which is updated on subsequent calls to ReadDirents.
1282    /// Each call to ReadDirents will only return whole dirent structures,
1283    /// they will not get split across ReadDirent calls. When the seek
1284    /// offset reaches the end, `dirents` will be empty.
1285    ///
1286    /// These dirents are of the form:
1287    /// ```
1288    /// struct dirent {
1289    ///   // Describes the inode of the entry.
1290    ///   uint64 ino;
1291    ///   // Describes the length of the dirent name in bytes.
1292    ///   uint8 size;
1293    ///   // Describes the type of the entry. Aligned with the
1294    ///   // POSIX d_type values. Use `DirentType` constants.
1295    ///   uint8 type;
1296    ///   // Unterminated name of entry.
1297    ///   char name[0];
1298    /// }
1299    /// ```
1300    ///
1301    /// This method does not require any rights, since one could always probe for
1302    /// directory contents by triggering name conflicts during file creation.
1303    pub fn r#read_dirents(
1304        &self,
1305        mut max_bytes: u64,
1306    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fdomain_client::fidl::FDomainResourceDialect>
1307    {
1308        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
1309    }
1310
1311    /// Resets the directory seek offset.
1312    ///
1313    /// This method does not require any rights, similar to ReadDirents.
1314    pub fn r#rewind(
1315        &self,
1316    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1317        DirectoryProxyInterface::r#rewind(self)
1318    }
1319
1320    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1321    /// in time. The token will remain valid for as long as the connection requesting the token
1322    /// remains open.
1323    ///
1324    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1325    /// `ZX_ERR_BAD_HANDLE`.
1326    pub fn r#get_token(
1327        &self,
1328    ) -> fidl::client::QueryResponseFut<
1329        (i32, Option<fdomain_client::NullableHandle>),
1330        fdomain_client::fidl::FDomainResourceDialect,
1331    > {
1332        DirectoryProxyInterface::r#get_token(self)
1333    }
1334
1335    /// Creates a link to an object named src by the name dst, within a directory represented by
1336    /// token.
1337    ///
1338    /// `src` must be a resolved object name. Including "/" in the string will
1339    /// return `ZX_ERR_INVALID_ARGS`.
1340    ///
1341    /// `dst` must be a resolved object name. Including "/" in the string will
1342    /// return `ZX_ERR_INVALID_ARGS`.
1343    ///
1344    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1345    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1346    ///
1347    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1348    /// there are two actors operating concurrently, and one actor performs a rename that affects
1349    /// the source within this directory, and the other does a link, each will appear to occur
1350    /// atomically in an unspecified order.
1351    pub fn r#link(
1352        &self,
1353        mut src: &str,
1354        mut dst_parent_token: fdomain_client::NullableHandle,
1355        mut dst: &str,
1356    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1357        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
1358    }
1359
1360    /// Removes a child node from the this directory's list of entries.
1361    ///
1362    /// Note: this does not guarantee that the underlying object is destroyed.
1363    /// Although the link will be removed from the containing directory,
1364    /// objects with multiple references (such as files which are still open)
1365    /// will not actually be destroyed until all references are closed.
1366    ///
1367    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1368    ///   [`Rights.WRITE_BYTES`].
1369    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1370    ///   support writing.
1371    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1372    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1373    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1374    ///   containing a remote channel.
1375    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1376    ///     something other than a directory was found.
1377    ///
1378    /// Other errors may be returned for filesystem-specific reasons.
1379    ///
1380    /// This method requires the following rights:
1381    ///
1382    /// * [`Rights.ENUMERATE`]
1383    /// * [`Rights.MODIFY_DIRECTORY`]
1384    pub fn r#unlink(
1385        &self,
1386        mut name: &str,
1387        mut options: &UnlinkOptions,
1388    ) -> fidl::client::QueryResponseFut<
1389        DirectoryUnlinkResult,
1390        fdomain_client::fidl::FDomainResourceDialect,
1391    > {
1392        DirectoryProxyInterface::r#unlink(self, name, options)
1393    }
1394
1395    /// Renames a node named `src` to the name `dst`, in a directory represented
1396    /// by `dst_parent_token`.
1397    ///
1398    /// `src` and `dst` must be valid node names.
1399    /// See [`Name`] for what constitutes a valid name.
1400    ///
1401    /// This method requires the following rights on both the current connection, and the connection
1402    /// identified by `dst_parent_token`:
1403    ///
1404    /// * [`Rights.ENUMERATE`]
1405    /// * [`Rights.MODIFY_DIRECTORY`]
1406    ///
1407    /// The following requirements are necessary to avoid rights escalations.
1408    ///
1409    /// If the source and destination directory differ, the source directory must also have the
1410    /// maximal set of abilities supported for files, which would typically be
1411    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1412    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1413    /// right.
1414    ///
1415    /// If `src` refers to a directory, and differs from the destination directory, then the source
1416    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1417    ///
1418    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1419    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1420    pub fn r#rename(
1421        &self,
1422        mut src: &str,
1423        mut dst_parent_token: fdomain_client::Event,
1424        mut dst: &str,
1425    ) -> fidl::client::QueryResponseFut<
1426        DirectoryRenameResult,
1427        fdomain_client::fidl::FDomainResourceDialect,
1428    > {
1429        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
1430    }
1431
1432    /// Creates a symbolic link.
1433    ///
1434    /// `name` is the name to be given to the created symbolic link.
1435    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1436    /// will perform no validation of `target` except for a server chosen maximum length.
1437    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1438    /// on the successfully created node.
1439    ///
1440    /// * [`Rights.MODIFY_DIRECTORY`]
1441    ///
1442    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1443    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1444    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1445    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1446    pub fn r#create_symlink(
1447        &self,
1448        mut name: &str,
1449        mut target: &[u8],
1450        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
1451    ) -> fidl::client::QueryResponseFut<
1452        DirectoryCreateSymlinkResult,
1453        fdomain_client::fidl::FDomainResourceDialect,
1454    > {
1455        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
1456    }
1457
1458    /// Watches a directory, receiving events of added messages on the
1459    /// watcher request channel.
1460    ///
1461    /// Options must be zero; it is reserved.
1462    ///
1463    /// This method does not require any rights, similar to ReadDirents.
1464    pub fn r#watch(
1465        &self,
1466        mut mask: WatchMask,
1467        mut options: u32,
1468        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
1469    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1470        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
1471    }
1472}
1473
1474impl DirectoryProxyInterface for DirectoryProxy {
1475    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
1476        AdvisoryLockingAdvisoryLockResult,
1477        fdomain_client::fidl::FDomainResourceDialect,
1478    >;
1479    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
1480        fn _decode(
1481            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1482        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1483            let _response = fidl::client::decode_transaction_body::<
1484                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1485                fdomain_client::fidl::FDomainResourceDialect,
1486                0x6ee9c0ad53ec87aa,
1487            >(_buf?)?;
1488            Ok(_response.map(|x| x))
1489        }
1490        self.client.send_query_and_decode::<
1491            AdvisoryLockingAdvisoryLockRequest,
1492            AdvisoryLockingAdvisoryLockResult,
1493        >(
1494            (request,),
1495            0x6ee9c0ad53ec87aa,
1496            fidl::encoding::DynamicFlags::empty(),
1497            _decode,
1498        )
1499    }
1500
1501    fn r#clone(
1502        &self,
1503        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1504    ) -> Result<(), fidl::Error> {
1505        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
1506            (request,),
1507            0x20d8a7aba2168a79,
1508            fidl::encoding::DynamicFlags::empty(),
1509        )
1510    }
1511
1512    type CloseResponseFut = fidl::client::QueryResponseFut<
1513        fdomain_fuchsia_unknown::CloseableCloseResult,
1514        fdomain_client::fidl::FDomainResourceDialect,
1515    >;
1516    fn r#close(&self) -> Self::CloseResponseFut {
1517        fn _decode(
1518            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1519        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1520            let _response = fidl::client::decode_transaction_body::<
1521                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1522                fdomain_client::fidl::FDomainResourceDialect,
1523                0x5ac5d459ad7f657e,
1524            >(_buf?)?;
1525            Ok(_response.map(|x| x))
1526        }
1527        self.client.send_query_and_decode::<
1528            fidl::encoding::EmptyPayload,
1529            fdomain_fuchsia_unknown::CloseableCloseResult,
1530        >(
1531            (),
1532            0x5ac5d459ad7f657e,
1533            fidl::encoding::DynamicFlags::empty(),
1534            _decode,
1535        )
1536    }
1537
1538    type QueryResponseFut =
1539        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
1540    fn r#query(&self) -> Self::QueryResponseFut {
1541        fn _decode(
1542            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1543        ) -> Result<Vec<u8>, fidl::Error> {
1544            let _response = fidl::client::decode_transaction_body::<
1545                fdomain_fuchsia_unknown::QueryableQueryResponse,
1546                fdomain_client::fidl::FDomainResourceDialect,
1547                0x2658edee9decfc06,
1548            >(_buf?)?;
1549            Ok(_response.protocol)
1550        }
1551        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
1552            (),
1553            0x2658edee9decfc06,
1554            fidl::encoding::DynamicFlags::empty(),
1555            _decode,
1556        )
1557    }
1558
1559    fn r#deprecated_clone(
1560        &self,
1561        mut flags: OpenFlags,
1562        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1563    ) -> Result<(), fidl::Error> {
1564        self.client.send::<NodeDeprecatedCloneRequest>(
1565            (flags, object),
1566            0x5a61678f293ce16f,
1567            fidl::encoding::DynamicFlags::FLEXIBLE,
1568        )
1569    }
1570
1571    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
1572        (i32, NodeAttributes),
1573        fdomain_client::fidl::FDomainResourceDialect,
1574    >;
1575    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
1576        fn _decode(
1577            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1578        ) -> Result<(i32, NodeAttributes), fidl::Error> {
1579            let _response = fidl::client::decode_transaction_body::<
1580                NodeDeprecatedGetAttrResponse,
1581                fdomain_client::fidl::FDomainResourceDialect,
1582                0x78985e216314dafd,
1583            >(_buf?)?;
1584            Ok((_response.s, _response.attributes))
1585        }
1586        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
1587            (),
1588            0x78985e216314dafd,
1589            fidl::encoding::DynamicFlags::empty(),
1590            _decode,
1591        )
1592    }
1593
1594    type DeprecatedSetAttrResponseFut =
1595        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1596    fn r#deprecated_set_attr(
1597        &self,
1598        mut flags: NodeAttributeFlags,
1599        mut attributes: &NodeAttributes,
1600    ) -> Self::DeprecatedSetAttrResponseFut {
1601        fn _decode(
1602            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1603        ) -> Result<i32, fidl::Error> {
1604            let _response = fidl::client::decode_transaction_body::<
1605                NodeDeprecatedSetAttrResponse,
1606                fdomain_client::fidl::FDomainResourceDialect,
1607                0x4186c0f40d938f46,
1608            >(_buf?)?;
1609            Ok(_response.s)
1610        }
1611        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
1612            (flags, attributes),
1613            0x4186c0f40d938f46,
1614            fidl::encoding::DynamicFlags::empty(),
1615            _decode,
1616        )
1617    }
1618
1619    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
1620        (i32, OpenFlags),
1621        fdomain_client::fidl::FDomainResourceDialect,
1622    >;
1623    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
1624        fn _decode(
1625            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1626        ) -> Result<(i32, OpenFlags), fidl::Error> {
1627            let _response = fidl::client::decode_transaction_body::<
1628                NodeDeprecatedGetFlagsResponse,
1629                fdomain_client::fidl::FDomainResourceDialect,
1630                0x5b88fffb8eda3aa1,
1631            >(_buf?)?;
1632            Ok((_response.s, _response.flags))
1633        }
1634        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
1635            (),
1636            0x5b88fffb8eda3aa1,
1637            fidl::encoding::DynamicFlags::empty(),
1638            _decode,
1639        )
1640    }
1641
1642    type DeprecatedSetFlagsResponseFut =
1643        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1644    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
1645        fn _decode(
1646            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1647        ) -> Result<i32, fidl::Error> {
1648            let _response = fidl::client::decode_transaction_body::<
1649                NodeDeprecatedSetFlagsResponse,
1650                fdomain_client::fidl::FDomainResourceDialect,
1651                0x5295b76c71fde733,
1652            >(_buf?)?;
1653            Ok(_response.s)
1654        }
1655        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
1656            (flags,),
1657            0x5295b76c71fde733,
1658            fidl::encoding::DynamicFlags::empty(),
1659            _decode,
1660        )
1661    }
1662
1663    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
1664        NodeGetFlagsResult,
1665        fdomain_client::fidl::FDomainResourceDialect,
1666    >;
1667    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
1668        fn _decode(
1669            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1670        ) -> Result<NodeGetFlagsResult, fidl::Error> {
1671            let _response = fidl::client::decode_transaction_body::<
1672                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1673                fdomain_client::fidl::FDomainResourceDialect,
1674                0x176eb318f64ec23,
1675            >(_buf?)?
1676            .into_result_fdomain::<DirectoryMarker>("get_flags")?;
1677            Ok(_response.map(|x| x.flags))
1678        }
1679        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
1680            (),
1681            0x176eb318f64ec23,
1682            fidl::encoding::DynamicFlags::FLEXIBLE,
1683            _decode,
1684        )
1685    }
1686
1687    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
1688        NodeSetFlagsResult,
1689        fdomain_client::fidl::FDomainResourceDialect,
1690    >;
1691    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
1692        fn _decode(
1693            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1694        ) -> Result<NodeSetFlagsResult, fidl::Error> {
1695            let _response = fidl::client::decode_transaction_body::<
1696                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1697                fdomain_client::fidl::FDomainResourceDialect,
1698                0x55a8028685791ea8,
1699            >(_buf?)?
1700            .into_result_fdomain::<DirectoryMarker>("set_flags")?;
1701            Ok(_response.map(|x| x))
1702        }
1703        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
1704            (flags,),
1705            0x55a8028685791ea8,
1706            fidl::encoding::DynamicFlags::FLEXIBLE,
1707            _decode,
1708        )
1709    }
1710
1711    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
1712        (i32, Option<Box<FilesystemInfo>>),
1713        fdomain_client::fidl::FDomainResourceDialect,
1714    >;
1715    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
1716        fn _decode(
1717            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1718        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1719            let _response = fidl::client::decode_transaction_body::<
1720                NodeQueryFilesystemResponse,
1721                fdomain_client::fidl::FDomainResourceDialect,
1722                0x6f344a1c6b0a0610,
1723            >(_buf?)?;
1724            Ok((_response.s, _response.info))
1725        }
1726        self.client.send_query_and_decode::<
1727            fidl::encoding::EmptyPayload,
1728            (i32, Option<Box<FilesystemInfo>>),
1729        >(
1730            (),
1731            0x6f344a1c6b0a0610,
1732            fidl::encoding::DynamicFlags::empty(),
1733            _decode,
1734        )
1735    }
1736
1737    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
1738        NodeGetAttributesResult,
1739        fdomain_client::fidl::FDomainResourceDialect,
1740    >;
1741    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
1742        fn _decode(
1743            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1744        ) -> Result<NodeGetAttributesResult, fidl::Error> {
1745            let _response = fidl::client::decode_transaction_body::<
1746                fidl::encoding::ResultType<NodeAttributes2, i32>,
1747                fdomain_client::fidl::FDomainResourceDialect,
1748                0x3d4396a638ea053b,
1749            >(_buf?)?;
1750            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1751        }
1752        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
1753            (query,),
1754            0x3d4396a638ea053b,
1755            fidl::encoding::DynamicFlags::empty(),
1756            _decode,
1757        )
1758    }
1759
1760    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
1761        NodeUpdateAttributesResult,
1762        fdomain_client::fidl::FDomainResourceDialect,
1763    >;
1764    fn r#update_attributes(
1765        &self,
1766        mut payload: &MutableNodeAttributes,
1767    ) -> Self::UpdateAttributesResponseFut {
1768        fn _decode(
1769            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1770        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1771            let _response = fidl::client::decode_transaction_body::<
1772                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1773                fdomain_client::fidl::FDomainResourceDialect,
1774                0x3308c1da5a89bf08,
1775            >(_buf?)?;
1776            Ok(_response.map(|x| x))
1777        }
1778        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
1779            payload,
1780            0x3308c1da5a89bf08,
1781            fidl::encoding::DynamicFlags::empty(),
1782            _decode,
1783        )
1784    }
1785
1786    type SyncResponseFut = fidl::client::QueryResponseFut<
1787        NodeSyncResult,
1788        fdomain_client::fidl::FDomainResourceDialect,
1789    >;
1790    fn r#sync(&self) -> Self::SyncResponseFut {
1791        fn _decode(
1792            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1793        ) -> Result<NodeSyncResult, fidl::Error> {
1794            let _response = fidl::client::decode_transaction_body::<
1795                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1796                fdomain_client::fidl::FDomainResourceDialect,
1797                0x2c5c27ca0ab5dc49,
1798            >(_buf?)?;
1799            Ok(_response.map(|x| x))
1800        }
1801        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
1802            (),
1803            0x2c5c27ca0ab5dc49,
1804            fidl::encoding::DynamicFlags::empty(),
1805            _decode,
1806        )
1807    }
1808
1809    fn r#list_extended_attributes(
1810        &self,
1811        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1812    ) -> Result<(), fidl::Error> {
1813        self.client.send::<NodeListExtendedAttributesRequest>(
1814            (iterator,),
1815            0x4b61033de007fcd0,
1816            fidl::encoding::DynamicFlags::empty(),
1817        )
1818    }
1819
1820    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1821        NodeGetExtendedAttributeResult,
1822        fdomain_client::fidl::FDomainResourceDialect,
1823    >;
1824    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
1825        fn _decode(
1826            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1827        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1828            let _response = fidl::client::decode_transaction_body::<
1829                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1830                fdomain_client::fidl::FDomainResourceDialect,
1831                0x45ffa3ccfdeb76db,
1832            >(_buf?)?;
1833            Ok(_response.map(|x| x))
1834        }
1835        self.client.send_query_and_decode::<
1836            NodeGetExtendedAttributeRequest,
1837            NodeGetExtendedAttributeResult,
1838        >(
1839            (name,),
1840            0x45ffa3ccfdeb76db,
1841            fidl::encoding::DynamicFlags::empty(),
1842            _decode,
1843        )
1844    }
1845
1846    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1847        NodeSetExtendedAttributeResult,
1848        fdomain_client::fidl::FDomainResourceDialect,
1849    >;
1850    fn r#set_extended_attribute(
1851        &self,
1852        mut name: &[u8],
1853        mut value: ExtendedAttributeValue,
1854        mut mode: SetExtendedAttributeMode,
1855    ) -> Self::SetExtendedAttributeResponseFut {
1856        fn _decode(
1857            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1858        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1859            let _response = fidl::client::decode_transaction_body::<
1860                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1861                fdomain_client::fidl::FDomainResourceDialect,
1862                0x4a951362f681f23c,
1863            >(_buf?)?;
1864            Ok(_response.map(|x| x))
1865        }
1866        self.client.send_query_and_decode::<
1867            NodeSetExtendedAttributeRequest,
1868            NodeSetExtendedAttributeResult,
1869        >(
1870            (name, &mut value, mode,),
1871            0x4a951362f681f23c,
1872            fidl::encoding::DynamicFlags::empty(),
1873            _decode,
1874        )
1875    }
1876
1877    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1878        NodeRemoveExtendedAttributeResult,
1879        fdomain_client::fidl::FDomainResourceDialect,
1880    >;
1881    fn r#remove_extended_attribute(
1882        &self,
1883        mut name: &[u8],
1884    ) -> Self::RemoveExtendedAttributeResponseFut {
1885        fn _decode(
1886            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1887        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1888            let _response = fidl::client::decode_transaction_body::<
1889                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1890                fdomain_client::fidl::FDomainResourceDialect,
1891                0x7a0b9f3a9bf9032d,
1892            >(_buf?)?;
1893            Ok(_response.map(|x| x))
1894        }
1895        self.client.send_query_and_decode::<
1896            NodeRemoveExtendedAttributeRequest,
1897            NodeRemoveExtendedAttributeResult,
1898        >(
1899            (name,),
1900            0x7a0b9f3a9bf9032d,
1901            fidl::encoding::DynamicFlags::empty(),
1902            _decode,
1903        )
1904    }
1905
1906    fn r#deprecated_open(
1907        &self,
1908        mut flags: OpenFlags,
1909        mut mode: ModeType,
1910        mut path: &str,
1911        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1912    ) -> Result<(), fidl::Error> {
1913        self.client.send::<DirectoryDeprecatedOpenRequest>(
1914            (flags, mode, path, object),
1915            0x2c5044561d685ec0,
1916            fidl::encoding::DynamicFlags::FLEXIBLE,
1917        )
1918    }
1919
1920    fn r#open(
1921        &self,
1922        mut path: &str,
1923        mut flags: Flags,
1924        mut options: &Options,
1925        mut object: fdomain_client::Channel,
1926    ) -> Result<(), fidl::Error> {
1927        self.client.send::<DirectoryOpenRequest>(
1928            (path, flags, options, object),
1929            0x568ddcb9a9cbb6d9,
1930            fidl::encoding::DynamicFlags::empty(),
1931        )
1932    }
1933
1934    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
1935        (i32, Vec<u8>),
1936        fdomain_client::fidl::FDomainResourceDialect,
1937    >;
1938    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
1939        fn _decode(
1940            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1941        ) -> Result<(i32, Vec<u8>), fidl::Error> {
1942            let _response = fidl::client::decode_transaction_body::<
1943                DirectoryReadDirentsResponse,
1944                fdomain_client::fidl::FDomainResourceDialect,
1945                0x3582806bf27faa0a,
1946            >(_buf?)?;
1947            Ok((_response.s, _response.dirents))
1948        }
1949        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
1950            (max_bytes,),
1951            0x3582806bf27faa0a,
1952            fidl::encoding::DynamicFlags::empty(),
1953            _decode,
1954        )
1955    }
1956
1957    type RewindResponseFut =
1958        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1959    fn r#rewind(&self) -> Self::RewindResponseFut {
1960        fn _decode(
1961            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1962        ) -> Result<i32, fidl::Error> {
1963            let _response = fidl::client::decode_transaction_body::<
1964                DirectoryRewindResponse,
1965                fdomain_client::fidl::FDomainResourceDialect,
1966                0x16b1202af0f34c71,
1967            >(_buf?)?;
1968            Ok(_response.s)
1969        }
1970        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1971            (),
1972            0x16b1202af0f34c71,
1973            fidl::encoding::DynamicFlags::empty(),
1974            _decode,
1975        )
1976    }
1977
1978    type GetTokenResponseFut = fidl::client::QueryResponseFut<
1979        (i32, Option<fdomain_client::NullableHandle>),
1980        fdomain_client::fidl::FDomainResourceDialect,
1981    >;
1982    fn r#get_token(&self) -> Self::GetTokenResponseFut {
1983        fn _decode(
1984            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1985        ) -> Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error> {
1986            let _response = fidl::client::decode_transaction_body::<
1987                DirectoryGetTokenResponse,
1988                fdomain_client::fidl::FDomainResourceDialect,
1989                0x26ae9d18763c8655,
1990            >(_buf?)?;
1991            Ok((_response.s, _response.token))
1992        }
1993        self.client.send_query_and_decode::<
1994            fidl::encoding::EmptyPayload,
1995            (i32, Option<fdomain_client::NullableHandle>),
1996        >(
1997            (),
1998            0x26ae9d18763c8655,
1999            fidl::encoding::DynamicFlags::empty(),
2000            _decode,
2001        )
2002    }
2003
2004    type LinkResponseFut =
2005        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2006    fn r#link(
2007        &self,
2008        mut src: &str,
2009        mut dst_parent_token: fdomain_client::NullableHandle,
2010        mut dst: &str,
2011    ) -> Self::LinkResponseFut {
2012        fn _decode(
2013            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2014        ) -> Result<i32, fidl::Error> {
2015            let _response = fidl::client::decode_transaction_body::<
2016                DirectoryLinkResponse,
2017                fdomain_client::fidl::FDomainResourceDialect,
2018                0x740604c0c7c930e7,
2019            >(_buf?)?;
2020            Ok(_response.s)
2021        }
2022        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2023            (src, dst_parent_token, dst),
2024            0x740604c0c7c930e7,
2025            fidl::encoding::DynamicFlags::empty(),
2026            _decode,
2027        )
2028    }
2029
2030    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2031        DirectoryUnlinkResult,
2032        fdomain_client::fidl::FDomainResourceDialect,
2033    >;
2034    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2035        fn _decode(
2036            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2037        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2038            let _response = fidl::client::decode_transaction_body::<
2039                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2040                fdomain_client::fidl::FDomainResourceDialect,
2041                0x750a0326a78d7bed,
2042            >(_buf?)?;
2043            Ok(_response.map(|x| x))
2044        }
2045        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2046            (name, options),
2047            0x750a0326a78d7bed,
2048            fidl::encoding::DynamicFlags::empty(),
2049            _decode,
2050        )
2051    }
2052
2053    type RenameResponseFut = fidl::client::QueryResponseFut<
2054        DirectoryRenameResult,
2055        fdomain_client::fidl::FDomainResourceDialect,
2056    >;
2057    fn r#rename(
2058        &self,
2059        mut src: &str,
2060        mut dst_parent_token: fdomain_client::Event,
2061        mut dst: &str,
2062    ) -> Self::RenameResponseFut {
2063        fn _decode(
2064            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2065        ) -> Result<DirectoryRenameResult, fidl::Error> {
2066            let _response = fidl::client::decode_transaction_body::<
2067                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2068                fdomain_client::fidl::FDomainResourceDialect,
2069                0x7060e7723b9928de,
2070            >(_buf?)?;
2071            Ok(_response.map(|x| x))
2072        }
2073        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2074            (src, dst_parent_token, dst),
2075            0x7060e7723b9928de,
2076            fidl::encoding::DynamicFlags::empty(),
2077            _decode,
2078        )
2079    }
2080
2081    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2082        DirectoryCreateSymlinkResult,
2083        fdomain_client::fidl::FDomainResourceDialect,
2084    >;
2085    fn r#create_symlink(
2086        &self,
2087        mut name: &str,
2088        mut target: &[u8],
2089        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
2090    ) -> Self::CreateSymlinkResponseFut {
2091        fn _decode(
2092            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2093        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2094            let _response = fidl::client::decode_transaction_body::<
2095                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2096                fdomain_client::fidl::FDomainResourceDialect,
2097                0x21ce0f19ec043889,
2098            >(_buf?)?;
2099            Ok(_response.map(|x| x))
2100        }
2101        self.client
2102            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2103                (name, target, connection),
2104                0x21ce0f19ec043889,
2105                fidl::encoding::DynamicFlags::empty(),
2106                _decode,
2107            )
2108    }
2109
2110    type WatchResponseFut =
2111        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2112    fn r#watch(
2113        &self,
2114        mut mask: WatchMask,
2115        mut options: u32,
2116        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
2117    ) -> Self::WatchResponseFut {
2118        fn _decode(
2119            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2120        ) -> Result<i32, fidl::Error> {
2121            let _response = fidl::client::decode_transaction_body::<
2122                DirectoryWatchResponse,
2123                fdomain_client::fidl::FDomainResourceDialect,
2124                0x5717193a59d66d91,
2125            >(_buf?)?;
2126            Ok(_response.s)
2127        }
2128        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2129            (mask, options, watcher),
2130            0x5717193a59d66d91,
2131            fidl::encoding::DynamicFlags::empty(),
2132            _decode,
2133        )
2134    }
2135}
2136
2137pub struct DirectoryEventStream {
2138    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2139}
2140
2141impl std::marker::Unpin for DirectoryEventStream {}
2142
2143impl futures::stream::FusedStream for DirectoryEventStream {
2144    fn is_terminated(&self) -> bool {
2145        self.event_receiver.is_terminated()
2146    }
2147}
2148
2149impl futures::Stream for DirectoryEventStream {
2150    type Item = Result<DirectoryEvent, fidl::Error>;
2151
2152    fn poll_next(
2153        mut self: std::pin::Pin<&mut Self>,
2154        cx: &mut std::task::Context<'_>,
2155    ) -> std::task::Poll<Option<Self::Item>> {
2156        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2157            &mut self.event_receiver,
2158            cx
2159        )?) {
2160            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
2161            None => std::task::Poll::Ready(None),
2162        }
2163    }
2164}
2165
2166#[derive(Debug)]
2167pub enum DirectoryEvent {
2168    OnOpen_ {
2169        s: i32,
2170        info: Option<Box<NodeInfoDeprecated>>,
2171    },
2172    OnRepresentation {
2173        payload: Representation,
2174    },
2175    #[non_exhaustive]
2176    _UnknownEvent {
2177        /// Ordinal of the event that was sent.
2178        ordinal: u64,
2179    },
2180}
2181
2182impl DirectoryEvent {
2183    #[allow(irrefutable_let_patterns)]
2184    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
2185        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
2186    }
2187    #[allow(irrefutable_let_patterns)]
2188    pub fn into_on_representation(self) -> Option<Representation> {
2189        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
2190    }
2191
2192    /// Decodes a message buffer as a [`DirectoryEvent`].
2193    fn decode(
2194        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2195    ) -> Result<DirectoryEvent, fidl::Error> {
2196        let (bytes, _handles) = buf.split_mut();
2197        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2198        debug_assert_eq!(tx_header.tx_id, 0);
2199        match tx_header.ordinal {
2200            0x7fc7bbb1dbfd1972 => {
2201                let mut out = fidl::new_empty!(
2202                    NodeOnOpenRequest,
2203                    fdomain_client::fidl::FDomainResourceDialect
2204                );
2205                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2206                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
2207            }
2208            0x5cb40567d80a510c => {
2209                let mut out =
2210                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
2211                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
2212                Ok((DirectoryEvent::OnRepresentation { payload: out }))
2213            }
2214            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2215                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2216            }
2217            _ => Err(fidl::Error::UnknownOrdinal {
2218                ordinal: tx_header.ordinal,
2219                protocol_name:
2220                    <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2221            }),
2222        }
2223    }
2224}
2225
2226/// A Stream of incoming requests for fuchsia.io/Directory.
2227pub struct DirectoryRequestStream {
2228    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2229    is_terminated: bool,
2230}
2231
2232impl std::marker::Unpin for DirectoryRequestStream {}
2233
2234impl futures::stream::FusedStream for DirectoryRequestStream {
2235    fn is_terminated(&self) -> bool {
2236        self.is_terminated
2237    }
2238}
2239
2240impl fdomain_client::fidl::RequestStream for DirectoryRequestStream {
2241    type Protocol = DirectoryMarker;
2242    type ControlHandle = DirectoryControlHandle;
2243
2244    fn from_channel(channel: fdomain_client::Channel) -> Self {
2245        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2246    }
2247
2248    fn control_handle(&self) -> Self::ControlHandle {
2249        DirectoryControlHandle { inner: self.inner.clone() }
2250    }
2251
2252    fn into_inner(
2253        self,
2254    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2255    {
2256        (self.inner, self.is_terminated)
2257    }
2258
2259    fn from_inner(
2260        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2261        is_terminated: bool,
2262    ) -> Self {
2263        Self { inner, is_terminated }
2264    }
2265}
2266
2267impl futures::Stream for DirectoryRequestStream {
2268    type Item = Result<DirectoryRequest, fidl::Error>;
2269
2270    fn poll_next(
2271        mut self: std::pin::Pin<&mut Self>,
2272        cx: &mut std::task::Context<'_>,
2273    ) -> std::task::Poll<Option<Self::Item>> {
2274        let this = &mut *self;
2275        if this.inner.check_shutdown(cx) {
2276            this.is_terminated = true;
2277            return std::task::Poll::Ready(None);
2278        }
2279        if this.is_terminated {
2280            panic!("polled DirectoryRequestStream after completion");
2281        }
2282        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2283            |bytes, handles| {
2284                match this.inner.channel().read_etc(cx, bytes, handles) {
2285                    std::task::Poll::Ready(Ok(())) => {}
2286                    std::task::Poll::Pending => return std::task::Poll::Pending,
2287                    std::task::Poll::Ready(Err(None)) => {
2288                        this.is_terminated = true;
2289                        return std::task::Poll::Ready(None);
2290                    }
2291                    std::task::Poll::Ready(Err(Some(e))) => {
2292                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2293                            e.into(),
2294                        ))));
2295                    }
2296                }
2297
2298                // A message has been received from the channel
2299                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2300
2301                std::task::Poll::Ready(Some(match header.ordinal {
2302                    0x6ee9c0ad53ec87aa => {
2303                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2304                        let mut req = fidl::new_empty!(
2305                            AdvisoryLockingAdvisoryLockRequest,
2306                            fdomain_client::fidl::FDomainResourceDialect
2307                        );
2308                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
2309                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2310                        Ok(DirectoryRequest::AdvisoryLock {
2311                            request: req.request,
2312
2313                            responder: DirectoryAdvisoryLockResponder {
2314                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2315                                tx_id: header.tx_id,
2316                            },
2317                        })
2318                    }
2319                    0x20d8a7aba2168a79 => {
2320                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2321                        let mut req = fidl::new_empty!(
2322                            fdomain_fuchsia_unknown::CloneableCloneRequest,
2323                            fdomain_client::fidl::FDomainResourceDialect
2324                        );
2325                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2326                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2327                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
2328                    }
2329                    0x5ac5d459ad7f657e => {
2330                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2331                        let mut req = fidl::new_empty!(
2332                            fidl::encoding::EmptyPayload,
2333                            fdomain_client::fidl::FDomainResourceDialect
2334                        );
2335                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2336                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2337                        Ok(DirectoryRequest::Close {
2338                            responder: DirectoryCloseResponder {
2339                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2340                                tx_id: header.tx_id,
2341                            },
2342                        })
2343                    }
2344                    0x2658edee9decfc06 => {
2345                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2346                        let mut req = fidl::new_empty!(
2347                            fidl::encoding::EmptyPayload,
2348                            fdomain_client::fidl::FDomainResourceDialect
2349                        );
2350                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2351                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2352                        Ok(DirectoryRequest::Query {
2353                            responder: DirectoryQueryResponder {
2354                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2355                                tx_id: header.tx_id,
2356                            },
2357                        })
2358                    }
2359                    0x5a61678f293ce16f => {
2360                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2361                        let mut req = fidl::new_empty!(
2362                            NodeDeprecatedCloneRequest,
2363                            fdomain_client::fidl::FDomainResourceDialect
2364                        );
2365                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2366                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2367                        Ok(DirectoryRequest::DeprecatedClone {
2368                            flags: req.flags,
2369                            object: req.object,
2370
2371                            control_handle,
2372                        })
2373                    }
2374                    0x78985e216314dafd => {
2375                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2376                        let mut req = fidl::new_empty!(
2377                            fidl::encoding::EmptyPayload,
2378                            fdomain_client::fidl::FDomainResourceDialect
2379                        );
2380                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2381                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2382                        Ok(DirectoryRequest::DeprecatedGetAttr {
2383                            responder: DirectoryDeprecatedGetAttrResponder {
2384                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2385                                tx_id: header.tx_id,
2386                            },
2387                        })
2388                    }
2389                    0x4186c0f40d938f46 => {
2390                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2391                        let mut req = fidl::new_empty!(
2392                            NodeDeprecatedSetAttrRequest,
2393                            fdomain_client::fidl::FDomainResourceDialect
2394                        );
2395                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
2396                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2397                        Ok(DirectoryRequest::DeprecatedSetAttr {
2398                            flags: req.flags,
2399                            attributes: req.attributes,
2400
2401                            responder: DirectoryDeprecatedSetAttrResponder {
2402                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2403                                tx_id: header.tx_id,
2404                            },
2405                        })
2406                    }
2407                    0x5b88fffb8eda3aa1 => {
2408                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2409                        let mut req = fidl::new_empty!(
2410                            fidl::encoding::EmptyPayload,
2411                            fdomain_client::fidl::FDomainResourceDialect
2412                        );
2413                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2414                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2415                        Ok(DirectoryRequest::DeprecatedGetFlags {
2416                            responder: DirectoryDeprecatedGetFlagsResponder {
2417                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2418                                tx_id: header.tx_id,
2419                            },
2420                        })
2421                    }
2422                    0x5295b76c71fde733 => {
2423                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2424                        let mut req = fidl::new_empty!(
2425                            NodeDeprecatedSetFlagsRequest,
2426                            fdomain_client::fidl::FDomainResourceDialect
2427                        );
2428                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2429                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2430                        Ok(DirectoryRequest::DeprecatedSetFlags {
2431                            flags: req.flags,
2432
2433                            responder: DirectoryDeprecatedSetFlagsResponder {
2434                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2435                                tx_id: header.tx_id,
2436                            },
2437                        })
2438                    }
2439                    0x176eb318f64ec23 => {
2440                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2441                        let mut req = fidl::new_empty!(
2442                            fidl::encoding::EmptyPayload,
2443                            fdomain_client::fidl::FDomainResourceDialect
2444                        );
2445                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2446                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2447                        Ok(DirectoryRequest::GetFlags {
2448                            responder: DirectoryGetFlagsResponder {
2449                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2450                                tx_id: header.tx_id,
2451                            },
2452                        })
2453                    }
2454                    0x55a8028685791ea8 => {
2455                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2456                        let mut req = fidl::new_empty!(
2457                            NodeSetFlagsRequest,
2458                            fdomain_client::fidl::FDomainResourceDialect
2459                        );
2460                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2461                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2462                        Ok(DirectoryRequest::SetFlags {
2463                            flags: req.flags,
2464
2465                            responder: DirectorySetFlagsResponder {
2466                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2467                                tx_id: header.tx_id,
2468                            },
2469                        })
2470                    }
2471                    0x6f344a1c6b0a0610 => {
2472                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2473                        let mut req = fidl::new_empty!(
2474                            fidl::encoding::EmptyPayload,
2475                            fdomain_client::fidl::FDomainResourceDialect
2476                        );
2477                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2478                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2479                        Ok(DirectoryRequest::QueryFilesystem {
2480                            responder: DirectoryQueryFilesystemResponder {
2481                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2482                                tx_id: header.tx_id,
2483                            },
2484                        })
2485                    }
2486                    0x3d4396a638ea053b => {
2487                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2488                        let mut req = fidl::new_empty!(
2489                            NodeGetAttributesRequest,
2490                            fdomain_client::fidl::FDomainResourceDialect
2491                        );
2492                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2493                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2494                        Ok(DirectoryRequest::GetAttributes {
2495                            query: req.query,
2496
2497                            responder: DirectoryGetAttributesResponder {
2498                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2499                                tx_id: header.tx_id,
2500                            },
2501                        })
2502                    }
2503                    0x3308c1da5a89bf08 => {
2504                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2505                        let mut req = fidl::new_empty!(
2506                            MutableNodeAttributes,
2507                            fdomain_client::fidl::FDomainResourceDialect
2508                        );
2509                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
2510                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2511                        Ok(DirectoryRequest::UpdateAttributes {
2512                            payload: req,
2513                            responder: DirectoryUpdateAttributesResponder {
2514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2515                                tx_id: header.tx_id,
2516                            },
2517                        })
2518                    }
2519                    0x2c5c27ca0ab5dc49 => {
2520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2521                        let mut req = fidl::new_empty!(
2522                            fidl::encoding::EmptyPayload,
2523                            fdomain_client::fidl::FDomainResourceDialect
2524                        );
2525                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2526                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2527                        Ok(DirectoryRequest::Sync {
2528                            responder: DirectorySyncResponder {
2529                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2530                                tx_id: header.tx_id,
2531                            },
2532                        })
2533                    }
2534                    0x4b61033de007fcd0 => {
2535                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2536                        let mut req = fidl::new_empty!(
2537                            NodeListExtendedAttributesRequest,
2538                            fdomain_client::fidl::FDomainResourceDialect
2539                        );
2540                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2541                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2542                        Ok(DirectoryRequest::ListExtendedAttributes {
2543                            iterator: req.iterator,
2544
2545                            control_handle,
2546                        })
2547                    }
2548                    0x45ffa3ccfdeb76db => {
2549                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2550                        let mut req = fidl::new_empty!(
2551                            NodeGetExtendedAttributeRequest,
2552                            fdomain_client::fidl::FDomainResourceDialect
2553                        );
2554                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2555                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2556                        Ok(DirectoryRequest::GetExtendedAttribute {
2557                            name: req.name,
2558
2559                            responder: DirectoryGetExtendedAttributeResponder {
2560                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2561                                tx_id: header.tx_id,
2562                            },
2563                        })
2564                    }
2565                    0x4a951362f681f23c => {
2566                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2567                        let mut req = fidl::new_empty!(
2568                            NodeSetExtendedAttributeRequest,
2569                            fdomain_client::fidl::FDomainResourceDialect
2570                        );
2571                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2572                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2573                        Ok(DirectoryRequest::SetExtendedAttribute {
2574                            name: req.name,
2575                            value: req.value,
2576                            mode: req.mode,
2577
2578                            responder: DirectorySetExtendedAttributeResponder {
2579                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2580                                tx_id: header.tx_id,
2581                            },
2582                        })
2583                    }
2584                    0x7a0b9f3a9bf9032d => {
2585                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2586                        let mut req = fidl::new_empty!(
2587                            NodeRemoveExtendedAttributeRequest,
2588                            fdomain_client::fidl::FDomainResourceDialect
2589                        );
2590                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2591                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2592                        Ok(DirectoryRequest::RemoveExtendedAttribute {
2593                            name: req.name,
2594
2595                            responder: DirectoryRemoveExtendedAttributeResponder {
2596                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2597                                tx_id: header.tx_id,
2598                            },
2599                        })
2600                    }
2601                    0x2c5044561d685ec0 => {
2602                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2603                        let mut req = fidl::new_empty!(
2604                            DirectoryDeprecatedOpenRequest,
2605                            fdomain_client::fidl::FDomainResourceDialect
2606                        );
2607                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2608                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2609                        Ok(DirectoryRequest::DeprecatedOpen {
2610                            flags: req.flags,
2611                            mode: req.mode,
2612                            path: req.path,
2613                            object: req.object,
2614
2615                            control_handle,
2616                        })
2617                    }
2618                    0x568ddcb9a9cbb6d9 => {
2619                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2620                        let mut req = fidl::new_empty!(
2621                            DirectoryOpenRequest,
2622                            fdomain_client::fidl::FDomainResourceDialect
2623                        );
2624                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2625                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2626                        Ok(DirectoryRequest::Open {
2627                            path: req.path,
2628                            flags: req.flags,
2629                            options: req.options,
2630                            object: req.object,
2631
2632                            control_handle,
2633                        })
2634                    }
2635                    0x3582806bf27faa0a => {
2636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2637                        let mut req = fidl::new_empty!(
2638                            DirectoryReadDirentsRequest,
2639                            fdomain_client::fidl::FDomainResourceDialect
2640                        );
2641                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
2642                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2643                        Ok(DirectoryRequest::ReadDirents {
2644                            max_bytes: req.max_bytes,
2645
2646                            responder: DirectoryReadDirentsResponder {
2647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2648                                tx_id: header.tx_id,
2649                            },
2650                        })
2651                    }
2652                    0x16b1202af0f34c71 => {
2653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2654                        let mut req = fidl::new_empty!(
2655                            fidl::encoding::EmptyPayload,
2656                            fdomain_client::fidl::FDomainResourceDialect
2657                        );
2658                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2659                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2660                        Ok(DirectoryRequest::Rewind {
2661                            responder: DirectoryRewindResponder {
2662                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2663                                tx_id: header.tx_id,
2664                            },
2665                        })
2666                    }
2667                    0x26ae9d18763c8655 => {
2668                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2669                        let mut req = fidl::new_empty!(
2670                            fidl::encoding::EmptyPayload,
2671                            fdomain_client::fidl::FDomainResourceDialect
2672                        );
2673                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2674                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2675                        Ok(DirectoryRequest::GetToken {
2676                            responder: DirectoryGetTokenResponder {
2677                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2678                                tx_id: header.tx_id,
2679                            },
2680                        })
2681                    }
2682                    0x740604c0c7c930e7 => {
2683                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2684                        let mut req = fidl::new_empty!(
2685                            DirectoryLinkRequest,
2686                            fdomain_client::fidl::FDomainResourceDialect
2687                        );
2688                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
2689                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2690                        Ok(DirectoryRequest::Link {
2691                            src: req.src,
2692                            dst_parent_token: req.dst_parent_token,
2693                            dst: req.dst,
2694
2695                            responder: DirectoryLinkResponder {
2696                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2697                                tx_id: header.tx_id,
2698                            },
2699                        })
2700                    }
2701                    0x750a0326a78d7bed => {
2702                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2703                        let mut req = fidl::new_empty!(
2704                            DirectoryUnlinkRequest,
2705                            fdomain_client::fidl::FDomainResourceDialect
2706                        );
2707                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2708                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2709                        Ok(DirectoryRequest::Unlink {
2710                            name: req.name,
2711                            options: req.options,
2712
2713                            responder: DirectoryUnlinkResponder {
2714                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2715                                tx_id: header.tx_id,
2716                            },
2717                        })
2718                    }
2719                    0x7060e7723b9928de => {
2720                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2721                        let mut req = fidl::new_empty!(
2722                            DirectoryRenameRequest,
2723                            fdomain_client::fidl::FDomainResourceDialect
2724                        );
2725                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
2726                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2727                        Ok(DirectoryRequest::Rename {
2728                            src: req.src,
2729                            dst_parent_token: req.dst_parent_token,
2730                            dst: req.dst,
2731
2732                            responder: DirectoryRenameResponder {
2733                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2734                                tx_id: header.tx_id,
2735                            },
2736                        })
2737                    }
2738                    0x21ce0f19ec043889 => {
2739                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2740                        let mut req = fidl::new_empty!(
2741                            DirectoryCreateSymlinkRequest,
2742                            fdomain_client::fidl::FDomainResourceDialect
2743                        );
2744                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2745                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2746                        Ok(DirectoryRequest::CreateSymlink {
2747                            name: req.name,
2748                            target: req.target,
2749                            connection: req.connection,
2750
2751                            responder: DirectoryCreateSymlinkResponder {
2752                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2753                                tx_id: header.tx_id,
2754                            },
2755                        })
2756                    }
2757                    0x5717193a59d66d91 => {
2758                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2759                        let mut req = fidl::new_empty!(
2760                            DirectoryWatchRequest,
2761                            fdomain_client::fidl::FDomainResourceDialect
2762                        );
2763                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2764                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2765                        Ok(DirectoryRequest::Watch {
2766                            mask: req.mask,
2767                            options: req.options,
2768                            watcher: req.watcher,
2769
2770                            responder: DirectoryWatchResponder {
2771                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2772                                tx_id: header.tx_id,
2773                            },
2774                        })
2775                    }
2776                    _ if header.tx_id == 0
2777                        && header
2778                            .dynamic_flags()
2779                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2780                    {
2781                        Ok(DirectoryRequest::_UnknownMethod {
2782                            ordinal: header.ordinal,
2783                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2784                            method_type: fidl::MethodType::OneWay,
2785                        })
2786                    }
2787                    _ if header
2788                        .dynamic_flags()
2789                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2790                    {
2791                        this.inner.send_framework_err(
2792                            fidl::encoding::FrameworkErr::UnknownMethod,
2793                            header.tx_id,
2794                            header.ordinal,
2795                            header.dynamic_flags(),
2796                            (bytes, handles),
2797                        )?;
2798                        Ok(DirectoryRequest::_UnknownMethod {
2799                            ordinal: header.ordinal,
2800                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2801                            method_type: fidl::MethodType::TwoWay,
2802                        })
2803                    }
2804                    _ => Err(fidl::Error::UnknownOrdinal {
2805                        ordinal: header.ordinal,
2806                        protocol_name:
2807                            <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2808                    }),
2809                }))
2810            },
2811        )
2812    }
2813}
2814
2815/// Directory defines a node which is capable of containing other Objects.
2816#[derive(Debug)]
2817pub enum DirectoryRequest {
2818    /// Acquires an advisory lock on the underlying file.
2819    ///
2820    /// The lock lasts until either this connection is closed or
2821    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
2822    /// explicitly.
2823    ///
2824    /// Advisory locks are purely advisory. They do not prevent actual read or
2825    /// write operations from occurring on the file, either through this
2826    /// connection or through other connections.
2827    ///
2828    /// This method requires the following rights:
2829    ///
2830    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
2831    /// * [`Rights.WRITE_BYTES`] if `request.type` is
2832    ///   [`AdvisoryLockType.WRITE`].
2833    ///
2834    /// # Errors
2835    ///
2836    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
2837    ///   example, another connection might hold a conflicting lock type.
2838    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
2839    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
2840    ///   to acquire the given type of lock.
2841    AdvisoryLock {
2842        request: AdvisoryLockRequest,
2843        responder: DirectoryAdvisoryLockResponder,
2844    },
2845    Clone {
2846        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
2847        control_handle: DirectoryControlHandle,
2848    },
2849    /// Terminates the connection.
2850    ///
2851    /// After calling `Close`, the client must not send any other requests.
2852    ///
2853    /// Servers, after sending the status response, should close the connection
2854    /// regardless of status and without sending an epitaph.
2855    ///
2856    /// Closing the client end of the channel should be semantically equivalent
2857    /// to calling `Close` without knowing when the close has completed or its
2858    /// status.
2859    Close {
2860        responder: DirectoryCloseResponder,
2861    },
2862    Query {
2863        responder: DirectoryQueryResponder,
2864    },
2865    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
2866    DeprecatedClone {
2867        flags: OpenFlags,
2868        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
2869        control_handle: DirectoryControlHandle,
2870    },
2871    /// DEPRECATED - Use `Node.GetAttributes` instead.
2872    DeprecatedGetAttr {
2873        responder: DirectoryDeprecatedGetAttrResponder,
2874    },
2875    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
2876    DeprecatedSetAttr {
2877        flags: NodeAttributeFlags,
2878        attributes: NodeAttributes,
2879        responder: DirectoryDeprecatedSetAttrResponder,
2880    },
2881    /// [DEPRECATED - Use new GetFlags method instead.]
2882    DeprecatedGetFlags {
2883        responder: DirectoryDeprecatedGetFlagsResponder,
2884    },
2885    /// [DEPRECATED - Use new SetFlags method instead.]
2886    DeprecatedSetFlags {
2887        flags: OpenFlags,
2888        responder: DirectoryDeprecatedSetFlagsResponder,
2889    },
2890    /// Queries the flags that apply to this node after it has been opened/created. This method does
2891    /// not require any rights.
2892    ///
2893    /// Note that the final set of flags that apply to the connection may differ from those
2894    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2895    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2896    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2897    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2898    GetFlags {
2899        responder: DirectoryGetFlagsResponder,
2900    },
2901    /// Sets the flags that apply to this node after it has been opened. This method does not
2902    /// require any rights.
2903    ///
2904    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2905    /// clear append mode.
2906    ///
2907    /// Errors:
2908    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2909    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2910    SetFlags {
2911        flags: Flags,
2912        responder: DirectorySetFlagsResponder,
2913    },
2914    /// Query the filesystem for filesystem-specific information.
2915    QueryFilesystem {
2916        responder: DirectoryQueryFilesystemResponder,
2917    },
2918    /// Acquires information about the node.
2919    ///
2920    /// The attributes of a node should be stable, independent of the
2921    /// specific protocol used to access it.
2922    ///
2923    /// If a particular attribute is not applicable or not supported,
2924    /// filesystems should leave the corresponding field absent.
2925    ///
2926    /// + `query` a bit-mask specifying which attributes to fetch. The server
2927    ///   should not return more than necessary.
2928    /// - `attributes` the returned attributes.
2929    ///
2930    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2931    GetAttributes {
2932        query: NodeAttributesQuery,
2933        responder: DirectoryGetAttributesResponder,
2934    },
2935    /// Updates information about the node.
2936    ///
2937    /// + `attributes` the presence of a table field in `attributes` indicates
2938    /// the intent to update the corresponding attribute.
2939    ///
2940    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2941    ///
2942    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2943    UpdateAttributes {
2944        payload: MutableNodeAttributes,
2945        responder: DirectoryUpdateAttributesResponder,
2946    },
2947    /// Synchronizes updates to the node to the underlying media, if it exists.
2948    ///
2949    /// This method will return when the filesystem server has flushed the
2950    /// relevant updates to the underlying media, but does not guarantee the
2951    /// underlying media has persisted the information, nor that any information
2952    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2953    /// between operations.
2954    ///
2955    /// This method does not require any rights.
2956    Sync {
2957        responder: DirectorySyncResponder,
2958    },
2959    /// Creates an iterator over all the extended attribute names associated
2960    /// with this node. If an error occurs it is returned as an epitaph on the
2961    /// iterator request channel, and then the channel is closed.
2962    ///
2963    /// GetExtendedAttributes can be used with any of these names to retrieve
2964    /// the associated value.
2965    ///
2966    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2967    ListExtendedAttributes {
2968        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
2969        control_handle: DirectoryControlHandle,
2970    },
2971    /// Get the value associated with the given attribute `name` for this node.
2972    ///
2973    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2974    /// particular structure is imposed on them.
2975    ///
2976    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2977    GetExtendedAttribute {
2978        name: Vec<u8>,
2979        responder: DirectoryGetExtendedAttributeResponder,
2980    },
2981    /// Set the value for the given attribute `name` to `value` for this node.
2982    ///
2983    /// The attribute name may exist, in which case the attribute is updated.
2984    /// If the attribute doesn't exist, it is created. The name should have no
2985    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2986    ///
2987    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2988    SetExtendedAttribute {
2989        name: Vec<u8>,
2990        value: ExtendedAttributeValue,
2991        mode: SetExtendedAttributeMode,
2992        responder: DirectorySetExtendedAttributeResponder,
2993    },
2994    /// Remove the specified extended attribute.
2995    ///
2996    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2997    ///
2998    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2999    RemoveExtendedAttribute {
3000        name: Vec<u8>,
3001        responder: DirectoryRemoveExtendedAttributeResponder,
3002    },
3003    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3004    DeprecatedOpen {
3005        flags: OpenFlags,
3006        mode: ModeType,
3007        path: String,
3008        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
3009        control_handle: DirectoryControlHandle,
3010    },
3011    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3012    /// epitaph sent on the `object` channel.
3013    ///
3014    /// Errors:
3015    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3016    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3017    Open {
3018        path: String,
3019        flags: Flags,
3020        options: Options,
3021        object: fdomain_client::Channel,
3022        control_handle: DirectoryControlHandle,
3023    },
3024    /// Reads a collection of variably sized dirents into a buffer.
3025    /// The number of dirents in a directory may be very large: akin to
3026    /// calling read multiple times on a file, directories have a seek
3027    /// offset which is updated on subsequent calls to ReadDirents.
3028    /// Each call to ReadDirents will only return whole dirent structures,
3029    /// they will not get split across ReadDirent calls. When the seek
3030    /// offset reaches the end, `dirents` will be empty.
3031    ///
3032    /// These dirents are of the form:
3033    /// ```
3034    /// struct dirent {
3035    ///   // Describes the inode of the entry.
3036    ///   uint64 ino;
3037    ///   // Describes the length of the dirent name in bytes.
3038    ///   uint8 size;
3039    ///   // Describes the type of the entry. Aligned with the
3040    ///   // POSIX d_type values. Use `DirentType` constants.
3041    ///   uint8 type;
3042    ///   // Unterminated name of entry.
3043    ///   char name[0];
3044    /// }
3045    /// ```
3046    ///
3047    /// This method does not require any rights, since one could always probe for
3048    /// directory contents by triggering name conflicts during file creation.
3049    ReadDirents {
3050        max_bytes: u64,
3051        responder: DirectoryReadDirentsResponder,
3052    },
3053    /// Resets the directory seek offset.
3054    ///
3055    /// This method does not require any rights, similar to ReadDirents.
3056    Rewind {
3057        responder: DirectoryRewindResponder,
3058    },
3059    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3060    /// in time. The token will remain valid for as long as the connection requesting the token
3061    /// remains open.
3062    ///
3063    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3064    /// `ZX_ERR_BAD_HANDLE`.
3065    GetToken {
3066        responder: DirectoryGetTokenResponder,
3067    },
3068    /// Creates a link to an object named src by the name dst, within a directory represented by
3069    /// token.
3070    ///
3071    /// `src` must be a resolved object name. Including "/" in the string will
3072    /// return `ZX_ERR_INVALID_ARGS`.
3073    ///
3074    /// `dst` must be a resolved object name. Including "/" in the string will
3075    /// return `ZX_ERR_INVALID_ARGS`.
3076    ///
3077    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3078    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3079    ///
3080    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3081    /// there are two actors operating concurrently, and one actor performs a rename that affects
3082    /// the source within this directory, and the other does a link, each will appear to occur
3083    /// atomically in an unspecified order.
3084    Link {
3085        src: String,
3086        dst_parent_token: fdomain_client::NullableHandle,
3087        dst: String,
3088        responder: DirectoryLinkResponder,
3089    },
3090    /// Removes a child node from the this directory's list of entries.
3091    ///
3092    /// Note: this does not guarantee that the underlying object is destroyed.
3093    /// Although the link will be removed from the containing directory,
3094    /// objects with multiple references (such as files which are still open)
3095    /// will not actually be destroyed until all references are closed.
3096    ///
3097    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3098    ///   [`Rights.WRITE_BYTES`].
3099    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3100    ///   support writing.
3101    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3102    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3103    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3104    ///   containing a remote channel.
3105    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3106    ///     something other than a directory was found.
3107    ///
3108    /// Other errors may be returned for filesystem-specific reasons.
3109    ///
3110    /// This method requires the following rights:
3111    ///
3112    /// * [`Rights.ENUMERATE`]
3113    /// * [`Rights.MODIFY_DIRECTORY`]
3114    Unlink {
3115        name: String,
3116        options: UnlinkOptions,
3117        responder: DirectoryUnlinkResponder,
3118    },
3119    /// Renames a node named `src` to the name `dst`, in a directory represented
3120    /// by `dst_parent_token`.
3121    ///
3122    /// `src` and `dst` must be valid node names.
3123    /// See [`Name`] for what constitutes a valid name.
3124    ///
3125    /// This method requires the following rights on both the current connection, and the connection
3126    /// identified by `dst_parent_token`:
3127    ///
3128    /// * [`Rights.ENUMERATE`]
3129    /// * [`Rights.MODIFY_DIRECTORY`]
3130    ///
3131    /// The following requirements are necessary to avoid rights escalations.
3132    ///
3133    /// If the source and destination directory differ, the source directory must also have the
3134    /// maximal set of abilities supported for files, which would typically be
3135    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
3136    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
3137    /// right.
3138    ///
3139    /// If `src` refers to a directory, and differs from the destination directory, then the source
3140    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
3141    ///
3142    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
3143    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
3144    Rename {
3145        src: String,
3146        dst_parent_token: fdomain_client::Event,
3147        dst: String,
3148        responder: DirectoryRenameResponder,
3149    },
3150    /// Creates a symbolic link.
3151    ///
3152    /// `name` is the name to be given to the created symbolic link.
3153    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
3154    /// will perform no validation of `target` except for a server chosen maximum length.
3155    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
3156    /// on the successfully created node.
3157    ///
3158    /// * [`Rights.MODIFY_DIRECTORY`]
3159    ///
3160    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
3161    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
3162    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
3163    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
3164    CreateSymlink {
3165        name: String,
3166        target: Vec<u8>,
3167        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3168        responder: DirectoryCreateSymlinkResponder,
3169    },
3170    /// Watches a directory, receiving events of added messages on the
3171    /// watcher request channel.
3172    ///
3173    /// Options must be zero; it is reserved.
3174    ///
3175    /// This method does not require any rights, similar to ReadDirents.
3176    Watch {
3177        mask: WatchMask,
3178        options: u32,
3179        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3180        responder: DirectoryWatchResponder,
3181    },
3182    /// An interaction was received which does not match any known method.
3183    #[non_exhaustive]
3184    _UnknownMethod {
3185        /// Ordinal of the method that was called.
3186        ordinal: u64,
3187        control_handle: DirectoryControlHandle,
3188        method_type: fidl::MethodType,
3189    },
3190}
3191
3192impl DirectoryRequest {
3193    #[allow(irrefutable_let_patterns)]
3194    pub fn into_advisory_lock(
3195        self,
3196    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
3197        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
3198            Some((request, responder))
3199        } else {
3200            None
3201        }
3202    }
3203
3204    #[allow(irrefutable_let_patterns)]
3205    pub fn into_clone(
3206        self,
3207    ) -> Option<(
3208        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
3209        DirectoryControlHandle,
3210    )> {
3211        if let DirectoryRequest::Clone { request, control_handle } = self {
3212            Some((request, control_handle))
3213        } else {
3214            None
3215        }
3216    }
3217
3218    #[allow(irrefutable_let_patterns)]
3219    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
3220        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
3221    }
3222
3223    #[allow(irrefutable_let_patterns)]
3224    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
3225        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
3226    }
3227
3228    #[allow(irrefutable_let_patterns)]
3229    pub fn into_deprecated_clone(
3230        self,
3231    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, DirectoryControlHandle)>
3232    {
3233        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
3234            Some((flags, object, control_handle))
3235        } else {
3236            None
3237        }
3238    }
3239
3240    #[allow(irrefutable_let_patterns)]
3241    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
3242        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
3243            Some((responder))
3244        } else {
3245            None
3246        }
3247    }
3248
3249    #[allow(irrefutable_let_patterns)]
3250    pub fn into_deprecated_set_attr(
3251        self,
3252    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
3253        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
3254            Some((flags, attributes, responder))
3255        } else {
3256            None
3257        }
3258    }
3259
3260    #[allow(irrefutable_let_patterns)]
3261    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
3262        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
3263            Some((responder))
3264        } else {
3265            None
3266        }
3267    }
3268
3269    #[allow(irrefutable_let_patterns)]
3270    pub fn into_deprecated_set_flags(
3271        self,
3272    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
3273        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
3274            Some((flags, responder))
3275        } else {
3276            None
3277        }
3278    }
3279
3280    #[allow(irrefutable_let_patterns)]
3281    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
3282        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
3283    }
3284
3285    #[allow(irrefutable_let_patterns)]
3286    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
3287        if let DirectoryRequest::SetFlags { flags, responder } = self {
3288            Some((flags, responder))
3289        } else {
3290            None
3291        }
3292    }
3293
3294    #[allow(irrefutable_let_patterns)]
3295    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
3296        if let DirectoryRequest::QueryFilesystem { responder } = self {
3297            Some((responder))
3298        } else {
3299            None
3300        }
3301    }
3302
3303    #[allow(irrefutable_let_patterns)]
3304    pub fn into_get_attributes(
3305        self,
3306    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
3307        if let DirectoryRequest::GetAttributes { query, responder } = self {
3308            Some((query, responder))
3309        } else {
3310            None
3311        }
3312    }
3313
3314    #[allow(irrefutable_let_patterns)]
3315    pub fn into_update_attributes(
3316        self,
3317    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
3318        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
3319            Some((payload, responder))
3320        } else {
3321            None
3322        }
3323    }
3324
3325    #[allow(irrefutable_let_patterns)]
3326    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
3327        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
3328    }
3329
3330    #[allow(irrefutable_let_patterns)]
3331    pub fn into_list_extended_attributes(
3332        self,
3333    ) -> Option<(
3334        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3335        DirectoryControlHandle,
3336    )> {
3337        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
3338            Some((iterator, control_handle))
3339        } else {
3340            None
3341        }
3342    }
3343
3344    #[allow(irrefutable_let_patterns)]
3345    pub fn into_get_extended_attribute(
3346        self,
3347    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
3348        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
3349            Some((name, responder))
3350        } else {
3351            None
3352        }
3353    }
3354
3355    #[allow(irrefutable_let_patterns)]
3356    pub fn into_set_extended_attribute(
3357        self,
3358    ) -> Option<(
3359        Vec<u8>,
3360        ExtendedAttributeValue,
3361        SetExtendedAttributeMode,
3362        DirectorySetExtendedAttributeResponder,
3363    )> {
3364        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
3365            Some((name, value, mode, responder))
3366        } else {
3367            None
3368        }
3369    }
3370
3371    #[allow(irrefutable_let_patterns)]
3372    pub fn into_remove_extended_attribute(
3373        self,
3374    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
3375        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
3376            Some((name, responder))
3377        } else {
3378            None
3379        }
3380    }
3381
3382    #[allow(irrefutable_let_patterns)]
3383    pub fn into_deprecated_open(
3384        self,
3385    ) -> Option<(
3386        OpenFlags,
3387        ModeType,
3388        String,
3389        fdomain_client::fidl::ServerEnd<NodeMarker>,
3390        DirectoryControlHandle,
3391    )> {
3392        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
3393        {
3394            Some((flags, mode, path, object, control_handle))
3395        } else {
3396            None
3397        }
3398    }
3399
3400    #[allow(irrefutable_let_patterns)]
3401    pub fn into_open(
3402        self,
3403    ) -> Option<(String, Flags, Options, fdomain_client::Channel, DirectoryControlHandle)> {
3404        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
3405            Some((path, flags, options, object, control_handle))
3406        } else {
3407            None
3408        }
3409    }
3410
3411    #[allow(irrefutable_let_patterns)]
3412    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
3413        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
3414            Some((max_bytes, responder))
3415        } else {
3416            None
3417        }
3418    }
3419
3420    #[allow(irrefutable_let_patterns)]
3421    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
3422        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
3423    }
3424
3425    #[allow(irrefutable_let_patterns)]
3426    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
3427        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
3428    }
3429
3430    #[allow(irrefutable_let_patterns)]
3431    pub fn into_link(
3432        self,
3433    ) -> Option<(String, fdomain_client::NullableHandle, String, DirectoryLinkResponder)> {
3434        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
3435            Some((src, dst_parent_token, dst, responder))
3436        } else {
3437            None
3438        }
3439    }
3440
3441    #[allow(irrefutable_let_patterns)]
3442    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
3443        if let DirectoryRequest::Unlink { name, options, responder } = self {
3444            Some((name, options, responder))
3445        } else {
3446            None
3447        }
3448    }
3449
3450    #[allow(irrefutable_let_patterns)]
3451    pub fn into_rename(
3452        self,
3453    ) -> Option<(String, fdomain_client::Event, String, DirectoryRenameResponder)> {
3454        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
3455            Some((src, dst_parent_token, dst, responder))
3456        } else {
3457            None
3458        }
3459    }
3460
3461    #[allow(irrefutable_let_patterns)]
3462    pub fn into_create_symlink(
3463        self,
3464    ) -> Option<(
3465        String,
3466        Vec<u8>,
3467        Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3468        DirectoryCreateSymlinkResponder,
3469    )> {
3470        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
3471            Some((name, target, connection, responder))
3472        } else {
3473            None
3474        }
3475    }
3476
3477    #[allow(irrefutable_let_patterns)]
3478    pub fn into_watch(
3479        self,
3480    ) -> Option<(
3481        WatchMask,
3482        u32,
3483        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3484        DirectoryWatchResponder,
3485    )> {
3486        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
3487            Some((mask, options, watcher, responder))
3488        } else {
3489            None
3490        }
3491    }
3492
3493    /// Name of the method defined in FIDL
3494    pub fn method_name(&self) -> &'static str {
3495        match *self {
3496            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
3497            DirectoryRequest::Clone { .. } => "clone",
3498            DirectoryRequest::Close { .. } => "close",
3499            DirectoryRequest::Query { .. } => "query",
3500            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
3501            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
3502            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
3503            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
3504            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
3505            DirectoryRequest::GetFlags { .. } => "get_flags",
3506            DirectoryRequest::SetFlags { .. } => "set_flags",
3507            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
3508            DirectoryRequest::GetAttributes { .. } => "get_attributes",
3509            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
3510            DirectoryRequest::Sync { .. } => "sync",
3511            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
3512            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
3513            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
3514            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
3515            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
3516            DirectoryRequest::Open { .. } => "open",
3517            DirectoryRequest::ReadDirents { .. } => "read_dirents",
3518            DirectoryRequest::Rewind { .. } => "rewind",
3519            DirectoryRequest::GetToken { .. } => "get_token",
3520            DirectoryRequest::Link { .. } => "link",
3521            DirectoryRequest::Unlink { .. } => "unlink",
3522            DirectoryRequest::Rename { .. } => "rename",
3523            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
3524            DirectoryRequest::Watch { .. } => "watch",
3525            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3526                "unknown one-way method"
3527            }
3528            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3529                "unknown two-way method"
3530            }
3531        }
3532    }
3533}
3534
3535#[derive(Debug, Clone)]
3536pub struct DirectoryControlHandle {
3537    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3538}
3539
3540impl fdomain_client::fidl::ControlHandle for DirectoryControlHandle {
3541    fn shutdown(&self) {
3542        self.inner.shutdown()
3543    }
3544
3545    fn is_closed(&self) -> bool {
3546        self.inner.channel().is_closed()
3547    }
3548    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3549        self.inner.channel().on_closed()
3550    }
3551}
3552
3553impl DirectoryControlHandle {
3554    pub fn send_on_open_(
3555        &self,
3556        mut s: i32,
3557        mut info: Option<NodeInfoDeprecated>,
3558    ) -> Result<(), fidl::Error> {
3559        self.inner.send::<NodeOnOpenRequest>(
3560            (s, info.as_mut()),
3561            0,
3562            0x7fc7bbb1dbfd1972,
3563            fidl::encoding::DynamicFlags::FLEXIBLE,
3564        )
3565    }
3566
3567    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
3568        self.inner.send::<Representation>(
3569            &mut payload,
3570            0,
3571            0x5cb40567d80a510c,
3572            fidl::encoding::DynamicFlags::empty(),
3573        )
3574    }
3575}
3576
3577#[must_use = "FIDL methods require a response to be sent"]
3578#[derive(Debug)]
3579pub struct DirectoryAdvisoryLockResponder {
3580    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3581    tx_id: u32,
3582}
3583
3584/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3585/// if the responder is dropped without sending a response, so that the client
3586/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3587impl std::ops::Drop for DirectoryAdvisoryLockResponder {
3588    fn drop(&mut self) {
3589        self.control_handle.shutdown();
3590        // Safety: drops once, never accessed again
3591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3592    }
3593}
3594
3595impl fdomain_client::fidl::Responder for DirectoryAdvisoryLockResponder {
3596    type ControlHandle = DirectoryControlHandle;
3597
3598    fn control_handle(&self) -> &DirectoryControlHandle {
3599        &self.control_handle
3600    }
3601
3602    fn drop_without_shutdown(mut self) {
3603        // Safety: drops once, never accessed again due to mem::forget
3604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3605        // Prevent Drop from running (which would shut down the channel)
3606        std::mem::forget(self);
3607    }
3608}
3609
3610impl DirectoryAdvisoryLockResponder {
3611    /// Sends a response to the FIDL transaction.
3612    ///
3613    /// Sets the channel to shutdown if an error occurs.
3614    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3615        let _result = self.send_raw(result);
3616        if _result.is_err() {
3617            self.control_handle.shutdown();
3618        }
3619        self.drop_without_shutdown();
3620        _result
3621    }
3622
3623    /// Similar to "send" but does not shutdown the channel if an error occurs.
3624    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3625        let _result = self.send_raw(result);
3626        self.drop_without_shutdown();
3627        _result
3628    }
3629
3630    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3631        self.control_handle
3632            .inner
3633            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3634                result,
3635                self.tx_id,
3636                0x6ee9c0ad53ec87aa,
3637                fidl::encoding::DynamicFlags::empty(),
3638            )
3639    }
3640}
3641
3642#[must_use = "FIDL methods require a response to be sent"]
3643#[derive(Debug)]
3644pub struct DirectoryCloseResponder {
3645    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3646    tx_id: u32,
3647}
3648
3649/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3650/// if the responder is dropped without sending a response, so that the client
3651/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3652impl std::ops::Drop for DirectoryCloseResponder {
3653    fn drop(&mut self) {
3654        self.control_handle.shutdown();
3655        // Safety: drops once, never accessed again
3656        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3657    }
3658}
3659
3660impl fdomain_client::fidl::Responder for DirectoryCloseResponder {
3661    type ControlHandle = DirectoryControlHandle;
3662
3663    fn control_handle(&self) -> &DirectoryControlHandle {
3664        &self.control_handle
3665    }
3666
3667    fn drop_without_shutdown(mut self) {
3668        // Safety: drops once, never accessed again due to mem::forget
3669        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3670        // Prevent Drop from running (which would shut down the channel)
3671        std::mem::forget(self);
3672    }
3673}
3674
3675impl DirectoryCloseResponder {
3676    /// Sends a response to the FIDL transaction.
3677    ///
3678    /// Sets the channel to shutdown if an error occurs.
3679    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3680        let _result = self.send_raw(result);
3681        if _result.is_err() {
3682            self.control_handle.shutdown();
3683        }
3684        self.drop_without_shutdown();
3685        _result
3686    }
3687
3688    /// Similar to "send" but does not shutdown the channel if an error occurs.
3689    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3690        let _result = self.send_raw(result);
3691        self.drop_without_shutdown();
3692        _result
3693    }
3694
3695    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3696        self.control_handle
3697            .inner
3698            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3699                result,
3700                self.tx_id,
3701                0x5ac5d459ad7f657e,
3702                fidl::encoding::DynamicFlags::empty(),
3703            )
3704    }
3705}
3706
3707#[must_use = "FIDL methods require a response to be sent"]
3708#[derive(Debug)]
3709pub struct DirectoryQueryResponder {
3710    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3711    tx_id: u32,
3712}
3713
3714/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3715/// if the responder is dropped without sending a response, so that the client
3716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3717impl std::ops::Drop for DirectoryQueryResponder {
3718    fn drop(&mut self) {
3719        self.control_handle.shutdown();
3720        // Safety: drops once, never accessed again
3721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3722    }
3723}
3724
3725impl fdomain_client::fidl::Responder for DirectoryQueryResponder {
3726    type ControlHandle = DirectoryControlHandle;
3727
3728    fn control_handle(&self) -> &DirectoryControlHandle {
3729        &self.control_handle
3730    }
3731
3732    fn drop_without_shutdown(mut self) {
3733        // Safety: drops once, never accessed again due to mem::forget
3734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3735        // Prevent Drop from running (which would shut down the channel)
3736        std::mem::forget(self);
3737    }
3738}
3739
3740impl DirectoryQueryResponder {
3741    /// Sends a response to the FIDL transaction.
3742    ///
3743    /// Sets the channel to shutdown if an error occurs.
3744    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3745        let _result = self.send_raw(protocol);
3746        if _result.is_err() {
3747            self.control_handle.shutdown();
3748        }
3749        self.drop_without_shutdown();
3750        _result
3751    }
3752
3753    /// Similar to "send" but does not shutdown the channel if an error occurs.
3754    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3755        let _result = self.send_raw(protocol);
3756        self.drop_without_shutdown();
3757        _result
3758    }
3759
3760    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3761        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
3762            (protocol,),
3763            self.tx_id,
3764            0x2658edee9decfc06,
3765            fidl::encoding::DynamicFlags::empty(),
3766        )
3767    }
3768}
3769
3770#[must_use = "FIDL methods require a response to be sent"]
3771#[derive(Debug)]
3772pub struct DirectoryDeprecatedGetAttrResponder {
3773    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3774    tx_id: u32,
3775}
3776
3777/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3778/// if the responder is dropped without sending a response, so that the client
3779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3780impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
3781    fn drop(&mut self) {
3782        self.control_handle.shutdown();
3783        // Safety: drops once, never accessed again
3784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3785    }
3786}
3787
3788impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetAttrResponder {
3789    type ControlHandle = DirectoryControlHandle;
3790
3791    fn control_handle(&self) -> &DirectoryControlHandle {
3792        &self.control_handle
3793    }
3794
3795    fn drop_without_shutdown(mut self) {
3796        // Safety: drops once, never accessed again due to mem::forget
3797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3798        // Prevent Drop from running (which would shut down the channel)
3799        std::mem::forget(self);
3800    }
3801}
3802
3803impl DirectoryDeprecatedGetAttrResponder {
3804    /// Sends a response to the FIDL transaction.
3805    ///
3806    /// Sets the channel to shutdown if an error occurs.
3807    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3808        let _result = self.send_raw(s, attributes);
3809        if _result.is_err() {
3810            self.control_handle.shutdown();
3811        }
3812        self.drop_without_shutdown();
3813        _result
3814    }
3815
3816    /// Similar to "send" but does not shutdown the channel if an error occurs.
3817    pub fn send_no_shutdown_on_err(
3818        self,
3819        mut s: i32,
3820        mut attributes: &NodeAttributes,
3821    ) -> Result<(), fidl::Error> {
3822        let _result = self.send_raw(s, attributes);
3823        self.drop_without_shutdown();
3824        _result
3825    }
3826
3827    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3828        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
3829            (s, attributes),
3830            self.tx_id,
3831            0x78985e216314dafd,
3832            fidl::encoding::DynamicFlags::empty(),
3833        )
3834    }
3835}
3836
3837#[must_use = "FIDL methods require a response to be sent"]
3838#[derive(Debug)]
3839pub struct DirectoryDeprecatedSetAttrResponder {
3840    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3841    tx_id: u32,
3842}
3843
3844/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3845/// if the responder is dropped without sending a response, so that the client
3846/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3847impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
3848    fn drop(&mut self) {
3849        self.control_handle.shutdown();
3850        // Safety: drops once, never accessed again
3851        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3852    }
3853}
3854
3855impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetAttrResponder {
3856    type ControlHandle = DirectoryControlHandle;
3857
3858    fn control_handle(&self) -> &DirectoryControlHandle {
3859        &self.control_handle
3860    }
3861
3862    fn drop_without_shutdown(mut self) {
3863        // Safety: drops once, never accessed again due to mem::forget
3864        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3865        // Prevent Drop from running (which would shut down the channel)
3866        std::mem::forget(self);
3867    }
3868}
3869
3870impl DirectoryDeprecatedSetAttrResponder {
3871    /// Sends a response to the FIDL transaction.
3872    ///
3873    /// Sets the channel to shutdown if an error occurs.
3874    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
3875        let _result = self.send_raw(s);
3876        if _result.is_err() {
3877            self.control_handle.shutdown();
3878        }
3879        self.drop_without_shutdown();
3880        _result
3881    }
3882
3883    /// Similar to "send" but does not shutdown the channel if an error occurs.
3884    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
3885        let _result = self.send_raw(s);
3886        self.drop_without_shutdown();
3887        _result
3888    }
3889
3890    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
3891        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
3892            (s,),
3893            self.tx_id,
3894            0x4186c0f40d938f46,
3895            fidl::encoding::DynamicFlags::empty(),
3896        )
3897    }
3898}
3899
3900#[must_use = "FIDL methods require a response to be sent"]
3901#[derive(Debug)]
3902pub struct DirectoryDeprecatedGetFlagsResponder {
3903    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3904    tx_id: u32,
3905}
3906
3907/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3908/// if the responder is dropped without sending a response, so that the client
3909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3910impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
3911    fn drop(&mut self) {
3912        self.control_handle.shutdown();
3913        // Safety: drops once, never accessed again
3914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3915    }
3916}
3917
3918impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetFlagsResponder {
3919    type ControlHandle = DirectoryControlHandle;
3920
3921    fn control_handle(&self) -> &DirectoryControlHandle {
3922        &self.control_handle
3923    }
3924
3925    fn drop_without_shutdown(mut self) {
3926        // Safety: drops once, never accessed again due to mem::forget
3927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3928        // Prevent Drop from running (which would shut down the channel)
3929        std::mem::forget(self);
3930    }
3931}
3932
3933impl DirectoryDeprecatedGetFlagsResponder {
3934    /// Sends a response to the FIDL transaction.
3935    ///
3936    /// Sets the channel to shutdown if an error occurs.
3937    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3938        let _result = self.send_raw(s, flags);
3939        if _result.is_err() {
3940            self.control_handle.shutdown();
3941        }
3942        self.drop_without_shutdown();
3943        _result
3944    }
3945
3946    /// Similar to "send" but does not shutdown the channel if an error occurs.
3947    pub fn send_no_shutdown_on_err(
3948        self,
3949        mut s: i32,
3950        mut flags: OpenFlags,
3951    ) -> Result<(), fidl::Error> {
3952        let _result = self.send_raw(s, flags);
3953        self.drop_without_shutdown();
3954        _result
3955    }
3956
3957    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3958        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
3959            (s, flags),
3960            self.tx_id,
3961            0x5b88fffb8eda3aa1,
3962            fidl::encoding::DynamicFlags::empty(),
3963        )
3964    }
3965}
3966
3967#[must_use = "FIDL methods require a response to be sent"]
3968#[derive(Debug)]
3969pub struct DirectoryDeprecatedSetFlagsResponder {
3970    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3971    tx_id: u32,
3972}
3973
3974/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3975/// if the responder is dropped without sending a response, so that the client
3976/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3977impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
3978    fn drop(&mut self) {
3979        self.control_handle.shutdown();
3980        // Safety: drops once, never accessed again
3981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3982    }
3983}
3984
3985impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetFlagsResponder {
3986    type ControlHandle = DirectoryControlHandle;
3987
3988    fn control_handle(&self) -> &DirectoryControlHandle {
3989        &self.control_handle
3990    }
3991
3992    fn drop_without_shutdown(mut self) {
3993        // Safety: drops once, never accessed again due to mem::forget
3994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3995        // Prevent Drop from running (which would shut down the channel)
3996        std::mem::forget(self);
3997    }
3998}
3999
4000impl DirectoryDeprecatedSetFlagsResponder {
4001    /// Sends a response to the FIDL transaction.
4002    ///
4003    /// Sets the channel to shutdown if an error occurs.
4004    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4005        let _result = self.send_raw(s);
4006        if _result.is_err() {
4007            self.control_handle.shutdown();
4008        }
4009        self.drop_without_shutdown();
4010        _result
4011    }
4012
4013    /// Similar to "send" but does not shutdown the channel if an error occurs.
4014    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4015        let _result = self.send_raw(s);
4016        self.drop_without_shutdown();
4017        _result
4018    }
4019
4020    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4021        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4022            (s,),
4023            self.tx_id,
4024            0x5295b76c71fde733,
4025            fidl::encoding::DynamicFlags::empty(),
4026        )
4027    }
4028}
4029
4030#[must_use = "FIDL methods require a response to be sent"]
4031#[derive(Debug)]
4032pub struct DirectoryGetFlagsResponder {
4033    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4034    tx_id: u32,
4035}
4036
4037/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4038/// if the responder is dropped without sending a response, so that the client
4039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4040impl std::ops::Drop for DirectoryGetFlagsResponder {
4041    fn drop(&mut self) {
4042        self.control_handle.shutdown();
4043        // Safety: drops once, never accessed again
4044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4045    }
4046}
4047
4048impl fdomain_client::fidl::Responder for DirectoryGetFlagsResponder {
4049    type ControlHandle = DirectoryControlHandle;
4050
4051    fn control_handle(&self) -> &DirectoryControlHandle {
4052        &self.control_handle
4053    }
4054
4055    fn drop_without_shutdown(mut self) {
4056        // Safety: drops once, never accessed again due to mem::forget
4057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4058        // Prevent Drop from running (which would shut down the channel)
4059        std::mem::forget(self);
4060    }
4061}
4062
4063impl DirectoryGetFlagsResponder {
4064    /// Sends a response to the FIDL transaction.
4065    ///
4066    /// Sets the channel to shutdown if an error occurs.
4067    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4068        let _result = self.send_raw(result);
4069        if _result.is_err() {
4070            self.control_handle.shutdown();
4071        }
4072        self.drop_without_shutdown();
4073        _result
4074    }
4075
4076    /// Similar to "send" but does not shutdown the channel if an error occurs.
4077    pub fn send_no_shutdown_on_err(
4078        self,
4079        mut result: Result<Flags, i32>,
4080    ) -> Result<(), fidl::Error> {
4081        let _result = self.send_raw(result);
4082        self.drop_without_shutdown();
4083        _result
4084    }
4085
4086    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4087        self.control_handle
4088            .inner
4089            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4090                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4091                self.tx_id,
4092                0x176eb318f64ec23,
4093                fidl::encoding::DynamicFlags::FLEXIBLE,
4094            )
4095    }
4096}
4097
4098#[must_use = "FIDL methods require a response to be sent"]
4099#[derive(Debug)]
4100pub struct DirectorySetFlagsResponder {
4101    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4102    tx_id: u32,
4103}
4104
4105/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4106/// if the responder is dropped without sending a response, so that the client
4107/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4108impl std::ops::Drop for DirectorySetFlagsResponder {
4109    fn drop(&mut self) {
4110        self.control_handle.shutdown();
4111        // Safety: drops once, never accessed again
4112        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4113    }
4114}
4115
4116impl fdomain_client::fidl::Responder for DirectorySetFlagsResponder {
4117    type ControlHandle = DirectoryControlHandle;
4118
4119    fn control_handle(&self) -> &DirectoryControlHandle {
4120        &self.control_handle
4121    }
4122
4123    fn drop_without_shutdown(mut self) {
4124        // Safety: drops once, never accessed again due to mem::forget
4125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4126        // Prevent Drop from running (which would shut down the channel)
4127        std::mem::forget(self);
4128    }
4129}
4130
4131impl DirectorySetFlagsResponder {
4132    /// Sends a response to the FIDL transaction.
4133    ///
4134    /// Sets the channel to shutdown if an error occurs.
4135    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4136        let _result = self.send_raw(result);
4137        if _result.is_err() {
4138            self.control_handle.shutdown();
4139        }
4140        self.drop_without_shutdown();
4141        _result
4142    }
4143
4144    /// Similar to "send" but does not shutdown the channel if an error occurs.
4145    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4146        let _result = self.send_raw(result);
4147        self.drop_without_shutdown();
4148        _result
4149    }
4150
4151    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4152        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4153            fidl::encoding::EmptyStruct,
4154            i32,
4155        >>(
4156            fidl::encoding::FlexibleResult::new(result),
4157            self.tx_id,
4158            0x55a8028685791ea8,
4159            fidl::encoding::DynamicFlags::FLEXIBLE,
4160        )
4161    }
4162}
4163
4164#[must_use = "FIDL methods require a response to be sent"]
4165#[derive(Debug)]
4166pub struct DirectoryQueryFilesystemResponder {
4167    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4168    tx_id: u32,
4169}
4170
4171/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4172/// if the responder is dropped without sending a response, so that the client
4173/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4174impl std::ops::Drop for DirectoryQueryFilesystemResponder {
4175    fn drop(&mut self) {
4176        self.control_handle.shutdown();
4177        // Safety: drops once, never accessed again
4178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4179    }
4180}
4181
4182impl fdomain_client::fidl::Responder for DirectoryQueryFilesystemResponder {
4183    type ControlHandle = DirectoryControlHandle;
4184
4185    fn control_handle(&self) -> &DirectoryControlHandle {
4186        &self.control_handle
4187    }
4188
4189    fn drop_without_shutdown(mut self) {
4190        // Safety: drops once, never accessed again due to mem::forget
4191        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4192        // Prevent Drop from running (which would shut down the channel)
4193        std::mem::forget(self);
4194    }
4195}
4196
4197impl DirectoryQueryFilesystemResponder {
4198    /// Sends a response to the FIDL transaction.
4199    ///
4200    /// Sets the channel to shutdown if an error occurs.
4201    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4202        let _result = self.send_raw(s, info);
4203        if _result.is_err() {
4204            self.control_handle.shutdown();
4205        }
4206        self.drop_without_shutdown();
4207        _result
4208    }
4209
4210    /// Similar to "send" but does not shutdown the channel if an error occurs.
4211    pub fn send_no_shutdown_on_err(
4212        self,
4213        mut s: i32,
4214        mut info: Option<&FilesystemInfo>,
4215    ) -> Result<(), fidl::Error> {
4216        let _result = self.send_raw(s, info);
4217        self.drop_without_shutdown();
4218        _result
4219    }
4220
4221    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4222        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
4223            (s, info),
4224            self.tx_id,
4225            0x6f344a1c6b0a0610,
4226            fidl::encoding::DynamicFlags::empty(),
4227        )
4228    }
4229}
4230
4231#[must_use = "FIDL methods require a response to be sent"]
4232#[derive(Debug)]
4233pub struct DirectoryGetAttributesResponder {
4234    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4235    tx_id: u32,
4236}
4237
4238/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4239/// if the responder is dropped without sending a response, so that the client
4240/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4241impl std::ops::Drop for DirectoryGetAttributesResponder {
4242    fn drop(&mut self) {
4243        self.control_handle.shutdown();
4244        // Safety: drops once, never accessed again
4245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4246    }
4247}
4248
4249impl fdomain_client::fidl::Responder for DirectoryGetAttributesResponder {
4250    type ControlHandle = DirectoryControlHandle;
4251
4252    fn control_handle(&self) -> &DirectoryControlHandle {
4253        &self.control_handle
4254    }
4255
4256    fn drop_without_shutdown(mut self) {
4257        // Safety: drops once, never accessed again due to mem::forget
4258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4259        // Prevent Drop from running (which would shut down the channel)
4260        std::mem::forget(self);
4261    }
4262}
4263
4264impl DirectoryGetAttributesResponder {
4265    /// Sends a response to the FIDL transaction.
4266    ///
4267    /// Sets the channel to shutdown if an error occurs.
4268    pub fn send(
4269        self,
4270        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4271    ) -> Result<(), fidl::Error> {
4272        let _result = self.send_raw(result);
4273        if _result.is_err() {
4274            self.control_handle.shutdown();
4275        }
4276        self.drop_without_shutdown();
4277        _result
4278    }
4279
4280    /// Similar to "send" but does not shutdown the channel if an error occurs.
4281    pub fn send_no_shutdown_on_err(
4282        self,
4283        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4284    ) -> Result<(), fidl::Error> {
4285        let _result = self.send_raw(result);
4286        self.drop_without_shutdown();
4287        _result
4288    }
4289
4290    fn send_raw(
4291        &self,
4292        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4293    ) -> Result<(), fidl::Error> {
4294        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
4295            result,
4296            self.tx_id,
4297            0x3d4396a638ea053b,
4298            fidl::encoding::DynamicFlags::empty(),
4299        )
4300    }
4301}
4302
4303#[must_use = "FIDL methods require a response to be sent"]
4304#[derive(Debug)]
4305pub struct DirectoryUpdateAttributesResponder {
4306    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4307    tx_id: u32,
4308}
4309
4310/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4311/// if the responder is dropped without sending a response, so that the client
4312/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4313impl std::ops::Drop for DirectoryUpdateAttributesResponder {
4314    fn drop(&mut self) {
4315        self.control_handle.shutdown();
4316        // Safety: drops once, never accessed again
4317        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4318    }
4319}
4320
4321impl fdomain_client::fidl::Responder for DirectoryUpdateAttributesResponder {
4322    type ControlHandle = DirectoryControlHandle;
4323
4324    fn control_handle(&self) -> &DirectoryControlHandle {
4325        &self.control_handle
4326    }
4327
4328    fn drop_without_shutdown(mut self) {
4329        // Safety: drops once, never accessed again due to mem::forget
4330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4331        // Prevent Drop from running (which would shut down the channel)
4332        std::mem::forget(self);
4333    }
4334}
4335
4336impl DirectoryUpdateAttributesResponder {
4337    /// Sends a response to the FIDL transaction.
4338    ///
4339    /// Sets the channel to shutdown if an error occurs.
4340    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4341        let _result = self.send_raw(result);
4342        if _result.is_err() {
4343            self.control_handle.shutdown();
4344        }
4345        self.drop_without_shutdown();
4346        _result
4347    }
4348
4349    /// Similar to "send" but does not shutdown the channel if an error occurs.
4350    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4351        let _result = self.send_raw(result);
4352        self.drop_without_shutdown();
4353        _result
4354    }
4355
4356    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4357        self.control_handle
4358            .inner
4359            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4360                result,
4361                self.tx_id,
4362                0x3308c1da5a89bf08,
4363                fidl::encoding::DynamicFlags::empty(),
4364            )
4365    }
4366}
4367
4368#[must_use = "FIDL methods require a response to be sent"]
4369#[derive(Debug)]
4370pub struct DirectorySyncResponder {
4371    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4372    tx_id: u32,
4373}
4374
4375/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4376/// if the responder is dropped without sending a response, so that the client
4377/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4378impl std::ops::Drop for DirectorySyncResponder {
4379    fn drop(&mut self) {
4380        self.control_handle.shutdown();
4381        // Safety: drops once, never accessed again
4382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4383    }
4384}
4385
4386impl fdomain_client::fidl::Responder for DirectorySyncResponder {
4387    type ControlHandle = DirectoryControlHandle;
4388
4389    fn control_handle(&self) -> &DirectoryControlHandle {
4390        &self.control_handle
4391    }
4392
4393    fn drop_without_shutdown(mut self) {
4394        // Safety: drops once, never accessed again due to mem::forget
4395        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4396        // Prevent Drop from running (which would shut down the channel)
4397        std::mem::forget(self);
4398    }
4399}
4400
4401impl DirectorySyncResponder {
4402    /// Sends a response to the FIDL transaction.
4403    ///
4404    /// Sets the channel to shutdown if an error occurs.
4405    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4406        let _result = self.send_raw(result);
4407        if _result.is_err() {
4408            self.control_handle.shutdown();
4409        }
4410        self.drop_without_shutdown();
4411        _result
4412    }
4413
4414    /// Similar to "send" but does not shutdown the channel if an error occurs.
4415    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4416        let _result = self.send_raw(result);
4417        self.drop_without_shutdown();
4418        _result
4419    }
4420
4421    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4422        self.control_handle
4423            .inner
4424            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4425                result,
4426                self.tx_id,
4427                0x2c5c27ca0ab5dc49,
4428                fidl::encoding::DynamicFlags::empty(),
4429            )
4430    }
4431}
4432
4433#[must_use = "FIDL methods require a response to be sent"]
4434#[derive(Debug)]
4435pub struct DirectoryGetExtendedAttributeResponder {
4436    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4437    tx_id: u32,
4438}
4439
4440/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4441/// if the responder is dropped without sending a response, so that the client
4442/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4443impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
4444    fn drop(&mut self) {
4445        self.control_handle.shutdown();
4446        // Safety: drops once, never accessed again
4447        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4448    }
4449}
4450
4451impl fdomain_client::fidl::Responder for DirectoryGetExtendedAttributeResponder {
4452    type ControlHandle = DirectoryControlHandle;
4453
4454    fn control_handle(&self) -> &DirectoryControlHandle {
4455        &self.control_handle
4456    }
4457
4458    fn drop_without_shutdown(mut self) {
4459        // Safety: drops once, never accessed again due to mem::forget
4460        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4461        // Prevent Drop from running (which would shut down the channel)
4462        std::mem::forget(self);
4463    }
4464}
4465
4466impl DirectoryGetExtendedAttributeResponder {
4467    /// Sends a response to the FIDL transaction.
4468    ///
4469    /// Sets the channel to shutdown if an error occurs.
4470    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4471        let _result = self.send_raw(result);
4472        if _result.is_err() {
4473            self.control_handle.shutdown();
4474        }
4475        self.drop_without_shutdown();
4476        _result
4477    }
4478
4479    /// Similar to "send" but does not shutdown the channel if an error occurs.
4480    pub fn send_no_shutdown_on_err(
4481        self,
4482        mut result: Result<ExtendedAttributeValue, i32>,
4483    ) -> Result<(), fidl::Error> {
4484        let _result = self.send_raw(result);
4485        self.drop_without_shutdown();
4486        _result
4487    }
4488
4489    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4490        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
4491            result.as_mut().map_err(|e| *e),
4492            self.tx_id,
4493            0x45ffa3ccfdeb76db,
4494            fidl::encoding::DynamicFlags::empty(),
4495        )
4496    }
4497}
4498
4499#[must_use = "FIDL methods require a response to be sent"]
4500#[derive(Debug)]
4501pub struct DirectorySetExtendedAttributeResponder {
4502    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4503    tx_id: u32,
4504}
4505
4506/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4507/// if the responder is dropped without sending a response, so that the client
4508/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4509impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
4510    fn drop(&mut self) {
4511        self.control_handle.shutdown();
4512        // Safety: drops once, never accessed again
4513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4514    }
4515}
4516
4517impl fdomain_client::fidl::Responder for DirectorySetExtendedAttributeResponder {
4518    type ControlHandle = DirectoryControlHandle;
4519
4520    fn control_handle(&self) -> &DirectoryControlHandle {
4521        &self.control_handle
4522    }
4523
4524    fn drop_without_shutdown(mut self) {
4525        // Safety: drops once, never accessed again due to mem::forget
4526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4527        // Prevent Drop from running (which would shut down the channel)
4528        std::mem::forget(self);
4529    }
4530}
4531
4532impl DirectorySetExtendedAttributeResponder {
4533    /// Sends a response to the FIDL transaction.
4534    ///
4535    /// Sets the channel to shutdown if an error occurs.
4536    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4537        let _result = self.send_raw(result);
4538        if _result.is_err() {
4539            self.control_handle.shutdown();
4540        }
4541        self.drop_without_shutdown();
4542        _result
4543    }
4544
4545    /// Similar to "send" but does not shutdown the channel if an error occurs.
4546    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4547        let _result = self.send_raw(result);
4548        self.drop_without_shutdown();
4549        _result
4550    }
4551
4552    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4553        self.control_handle
4554            .inner
4555            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4556                result,
4557                self.tx_id,
4558                0x4a951362f681f23c,
4559                fidl::encoding::DynamicFlags::empty(),
4560            )
4561    }
4562}
4563
4564#[must_use = "FIDL methods require a response to be sent"]
4565#[derive(Debug)]
4566pub struct DirectoryRemoveExtendedAttributeResponder {
4567    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4568    tx_id: u32,
4569}
4570
4571/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4572/// if the responder is dropped without sending a response, so that the client
4573/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4574impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
4575    fn drop(&mut self) {
4576        self.control_handle.shutdown();
4577        // Safety: drops once, never accessed again
4578        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4579    }
4580}
4581
4582impl fdomain_client::fidl::Responder for DirectoryRemoveExtendedAttributeResponder {
4583    type ControlHandle = DirectoryControlHandle;
4584
4585    fn control_handle(&self) -> &DirectoryControlHandle {
4586        &self.control_handle
4587    }
4588
4589    fn drop_without_shutdown(mut self) {
4590        // Safety: drops once, never accessed again due to mem::forget
4591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4592        // Prevent Drop from running (which would shut down the channel)
4593        std::mem::forget(self);
4594    }
4595}
4596
4597impl DirectoryRemoveExtendedAttributeResponder {
4598    /// Sends a response to the FIDL transaction.
4599    ///
4600    /// Sets the channel to shutdown if an error occurs.
4601    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4602        let _result = self.send_raw(result);
4603        if _result.is_err() {
4604            self.control_handle.shutdown();
4605        }
4606        self.drop_without_shutdown();
4607        _result
4608    }
4609
4610    /// Similar to "send" but does not shutdown the channel if an error occurs.
4611    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4612        let _result = self.send_raw(result);
4613        self.drop_without_shutdown();
4614        _result
4615    }
4616
4617    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4618        self.control_handle
4619            .inner
4620            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4621                result,
4622                self.tx_id,
4623                0x7a0b9f3a9bf9032d,
4624                fidl::encoding::DynamicFlags::empty(),
4625            )
4626    }
4627}
4628
4629#[must_use = "FIDL methods require a response to be sent"]
4630#[derive(Debug)]
4631pub struct DirectoryReadDirentsResponder {
4632    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4633    tx_id: u32,
4634}
4635
4636/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4637/// if the responder is dropped without sending a response, so that the client
4638/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4639impl std::ops::Drop for DirectoryReadDirentsResponder {
4640    fn drop(&mut self) {
4641        self.control_handle.shutdown();
4642        // Safety: drops once, never accessed again
4643        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4644    }
4645}
4646
4647impl fdomain_client::fidl::Responder for DirectoryReadDirentsResponder {
4648    type ControlHandle = DirectoryControlHandle;
4649
4650    fn control_handle(&self) -> &DirectoryControlHandle {
4651        &self.control_handle
4652    }
4653
4654    fn drop_without_shutdown(mut self) {
4655        // Safety: drops once, never accessed again due to mem::forget
4656        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4657        // Prevent Drop from running (which would shut down the channel)
4658        std::mem::forget(self);
4659    }
4660}
4661
4662impl DirectoryReadDirentsResponder {
4663    /// Sends a response to the FIDL transaction.
4664    ///
4665    /// Sets the channel to shutdown if an error occurs.
4666    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4667        let _result = self.send_raw(s, dirents);
4668        if _result.is_err() {
4669            self.control_handle.shutdown();
4670        }
4671        self.drop_without_shutdown();
4672        _result
4673    }
4674
4675    /// Similar to "send" but does not shutdown the channel if an error occurs.
4676    pub fn send_no_shutdown_on_err(
4677        self,
4678        mut s: i32,
4679        mut dirents: &[u8],
4680    ) -> Result<(), fidl::Error> {
4681        let _result = self.send_raw(s, dirents);
4682        self.drop_without_shutdown();
4683        _result
4684    }
4685
4686    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4687        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
4688            (s, dirents),
4689            self.tx_id,
4690            0x3582806bf27faa0a,
4691            fidl::encoding::DynamicFlags::empty(),
4692        )
4693    }
4694}
4695
4696#[must_use = "FIDL methods require a response to be sent"]
4697#[derive(Debug)]
4698pub struct DirectoryRewindResponder {
4699    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4700    tx_id: u32,
4701}
4702
4703/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4704/// if the responder is dropped without sending a response, so that the client
4705/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4706impl std::ops::Drop for DirectoryRewindResponder {
4707    fn drop(&mut self) {
4708        self.control_handle.shutdown();
4709        // Safety: drops once, never accessed again
4710        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4711    }
4712}
4713
4714impl fdomain_client::fidl::Responder for DirectoryRewindResponder {
4715    type ControlHandle = DirectoryControlHandle;
4716
4717    fn control_handle(&self) -> &DirectoryControlHandle {
4718        &self.control_handle
4719    }
4720
4721    fn drop_without_shutdown(mut self) {
4722        // Safety: drops once, never accessed again due to mem::forget
4723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4724        // Prevent Drop from running (which would shut down the channel)
4725        std::mem::forget(self);
4726    }
4727}
4728
4729impl DirectoryRewindResponder {
4730    /// Sends a response to the FIDL transaction.
4731    ///
4732    /// Sets the channel to shutdown if an error occurs.
4733    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4734        let _result = self.send_raw(s);
4735        if _result.is_err() {
4736            self.control_handle.shutdown();
4737        }
4738        self.drop_without_shutdown();
4739        _result
4740    }
4741
4742    /// Similar to "send" but does not shutdown the channel if an error occurs.
4743    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4744        let _result = self.send_raw(s);
4745        self.drop_without_shutdown();
4746        _result
4747    }
4748
4749    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4750        self.control_handle.inner.send::<DirectoryRewindResponse>(
4751            (s,),
4752            self.tx_id,
4753            0x16b1202af0f34c71,
4754            fidl::encoding::DynamicFlags::empty(),
4755        )
4756    }
4757}
4758
4759#[must_use = "FIDL methods require a response to be sent"]
4760#[derive(Debug)]
4761pub struct DirectoryGetTokenResponder {
4762    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4763    tx_id: u32,
4764}
4765
4766/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4767/// if the responder is dropped without sending a response, so that the client
4768/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4769impl std::ops::Drop for DirectoryGetTokenResponder {
4770    fn drop(&mut self) {
4771        self.control_handle.shutdown();
4772        // Safety: drops once, never accessed again
4773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4774    }
4775}
4776
4777impl fdomain_client::fidl::Responder for DirectoryGetTokenResponder {
4778    type ControlHandle = DirectoryControlHandle;
4779
4780    fn control_handle(&self) -> &DirectoryControlHandle {
4781        &self.control_handle
4782    }
4783
4784    fn drop_without_shutdown(mut self) {
4785        // Safety: drops once, never accessed again due to mem::forget
4786        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4787        // Prevent Drop from running (which would shut down the channel)
4788        std::mem::forget(self);
4789    }
4790}
4791
4792impl DirectoryGetTokenResponder {
4793    /// Sends a response to the FIDL transaction.
4794    ///
4795    /// Sets the channel to shutdown if an error occurs.
4796    pub fn send(
4797        self,
4798        mut s: i32,
4799        mut token: Option<fdomain_client::NullableHandle>,
4800    ) -> Result<(), fidl::Error> {
4801        let _result = self.send_raw(s, token);
4802        if _result.is_err() {
4803            self.control_handle.shutdown();
4804        }
4805        self.drop_without_shutdown();
4806        _result
4807    }
4808
4809    /// Similar to "send" but does not shutdown the channel if an error occurs.
4810    pub fn send_no_shutdown_on_err(
4811        self,
4812        mut s: i32,
4813        mut token: Option<fdomain_client::NullableHandle>,
4814    ) -> Result<(), fidl::Error> {
4815        let _result = self.send_raw(s, token);
4816        self.drop_without_shutdown();
4817        _result
4818    }
4819
4820    fn send_raw(
4821        &self,
4822        mut s: i32,
4823        mut token: Option<fdomain_client::NullableHandle>,
4824    ) -> Result<(), fidl::Error> {
4825        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
4826            (s, token),
4827            self.tx_id,
4828            0x26ae9d18763c8655,
4829            fidl::encoding::DynamicFlags::empty(),
4830        )
4831    }
4832}
4833
4834#[must_use = "FIDL methods require a response to be sent"]
4835#[derive(Debug)]
4836pub struct DirectoryLinkResponder {
4837    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4838    tx_id: u32,
4839}
4840
4841/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4842/// if the responder is dropped without sending a response, so that the client
4843/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4844impl std::ops::Drop for DirectoryLinkResponder {
4845    fn drop(&mut self) {
4846        self.control_handle.shutdown();
4847        // Safety: drops once, never accessed again
4848        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4849    }
4850}
4851
4852impl fdomain_client::fidl::Responder for DirectoryLinkResponder {
4853    type ControlHandle = DirectoryControlHandle;
4854
4855    fn control_handle(&self) -> &DirectoryControlHandle {
4856        &self.control_handle
4857    }
4858
4859    fn drop_without_shutdown(mut self) {
4860        // Safety: drops once, never accessed again due to mem::forget
4861        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4862        // Prevent Drop from running (which would shut down the channel)
4863        std::mem::forget(self);
4864    }
4865}
4866
4867impl DirectoryLinkResponder {
4868    /// Sends a response to the FIDL transaction.
4869    ///
4870    /// Sets the channel to shutdown if an error occurs.
4871    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4872        let _result = self.send_raw(s);
4873        if _result.is_err() {
4874            self.control_handle.shutdown();
4875        }
4876        self.drop_without_shutdown();
4877        _result
4878    }
4879
4880    /// Similar to "send" but does not shutdown the channel if an error occurs.
4881    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4882        let _result = self.send_raw(s);
4883        self.drop_without_shutdown();
4884        _result
4885    }
4886
4887    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4888        self.control_handle.inner.send::<DirectoryLinkResponse>(
4889            (s,),
4890            self.tx_id,
4891            0x740604c0c7c930e7,
4892            fidl::encoding::DynamicFlags::empty(),
4893        )
4894    }
4895}
4896
4897#[must_use = "FIDL methods require a response to be sent"]
4898#[derive(Debug)]
4899pub struct DirectoryUnlinkResponder {
4900    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4901    tx_id: u32,
4902}
4903
4904/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4905/// if the responder is dropped without sending a response, so that the client
4906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4907impl std::ops::Drop for DirectoryUnlinkResponder {
4908    fn drop(&mut self) {
4909        self.control_handle.shutdown();
4910        // Safety: drops once, never accessed again
4911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4912    }
4913}
4914
4915impl fdomain_client::fidl::Responder for DirectoryUnlinkResponder {
4916    type ControlHandle = DirectoryControlHandle;
4917
4918    fn control_handle(&self) -> &DirectoryControlHandle {
4919        &self.control_handle
4920    }
4921
4922    fn drop_without_shutdown(mut self) {
4923        // Safety: drops once, never accessed again due to mem::forget
4924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4925        // Prevent Drop from running (which would shut down the channel)
4926        std::mem::forget(self);
4927    }
4928}
4929
4930impl DirectoryUnlinkResponder {
4931    /// Sends a response to the FIDL transaction.
4932    ///
4933    /// Sets the channel to shutdown if an error occurs.
4934    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4935        let _result = self.send_raw(result);
4936        if _result.is_err() {
4937            self.control_handle.shutdown();
4938        }
4939        self.drop_without_shutdown();
4940        _result
4941    }
4942
4943    /// Similar to "send" but does not shutdown the channel if an error occurs.
4944    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4945        let _result = self.send_raw(result);
4946        self.drop_without_shutdown();
4947        _result
4948    }
4949
4950    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4951        self.control_handle
4952            .inner
4953            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4954                result,
4955                self.tx_id,
4956                0x750a0326a78d7bed,
4957                fidl::encoding::DynamicFlags::empty(),
4958            )
4959    }
4960}
4961
4962#[must_use = "FIDL methods require a response to be sent"]
4963#[derive(Debug)]
4964pub struct DirectoryRenameResponder {
4965    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4966    tx_id: u32,
4967}
4968
4969/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4970/// if the responder is dropped without sending a response, so that the client
4971/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4972impl std::ops::Drop for DirectoryRenameResponder {
4973    fn drop(&mut self) {
4974        self.control_handle.shutdown();
4975        // Safety: drops once, never accessed again
4976        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4977    }
4978}
4979
4980impl fdomain_client::fidl::Responder for DirectoryRenameResponder {
4981    type ControlHandle = DirectoryControlHandle;
4982
4983    fn control_handle(&self) -> &DirectoryControlHandle {
4984        &self.control_handle
4985    }
4986
4987    fn drop_without_shutdown(mut self) {
4988        // Safety: drops once, never accessed again due to mem::forget
4989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4990        // Prevent Drop from running (which would shut down the channel)
4991        std::mem::forget(self);
4992    }
4993}
4994
4995impl DirectoryRenameResponder {
4996    /// Sends a response to the FIDL transaction.
4997    ///
4998    /// Sets the channel to shutdown if an error occurs.
4999    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5000        let _result = self.send_raw(result);
5001        if _result.is_err() {
5002            self.control_handle.shutdown();
5003        }
5004        self.drop_without_shutdown();
5005        _result
5006    }
5007
5008    /// Similar to "send" but does not shutdown the channel if an error occurs.
5009    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5010        let _result = self.send_raw(result);
5011        self.drop_without_shutdown();
5012        _result
5013    }
5014
5015    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5016        self.control_handle
5017            .inner
5018            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5019                result,
5020                self.tx_id,
5021                0x7060e7723b9928de,
5022                fidl::encoding::DynamicFlags::empty(),
5023            )
5024    }
5025}
5026
5027#[must_use = "FIDL methods require a response to be sent"]
5028#[derive(Debug)]
5029pub struct DirectoryCreateSymlinkResponder {
5030    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5031    tx_id: u32,
5032}
5033
5034/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5035/// if the responder is dropped without sending a response, so that the client
5036/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5037impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5038    fn drop(&mut self) {
5039        self.control_handle.shutdown();
5040        // Safety: drops once, never accessed again
5041        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5042    }
5043}
5044
5045impl fdomain_client::fidl::Responder for DirectoryCreateSymlinkResponder {
5046    type ControlHandle = DirectoryControlHandle;
5047
5048    fn control_handle(&self) -> &DirectoryControlHandle {
5049        &self.control_handle
5050    }
5051
5052    fn drop_without_shutdown(mut self) {
5053        // Safety: drops once, never accessed again due to mem::forget
5054        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5055        // Prevent Drop from running (which would shut down the channel)
5056        std::mem::forget(self);
5057    }
5058}
5059
5060impl DirectoryCreateSymlinkResponder {
5061    /// Sends a response to the FIDL transaction.
5062    ///
5063    /// Sets the channel to shutdown if an error occurs.
5064    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5065        let _result = self.send_raw(result);
5066        if _result.is_err() {
5067            self.control_handle.shutdown();
5068        }
5069        self.drop_without_shutdown();
5070        _result
5071    }
5072
5073    /// Similar to "send" but does not shutdown the channel if an error occurs.
5074    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5075        let _result = self.send_raw(result);
5076        self.drop_without_shutdown();
5077        _result
5078    }
5079
5080    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5081        self.control_handle
5082            .inner
5083            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5084                result,
5085                self.tx_id,
5086                0x21ce0f19ec043889,
5087                fidl::encoding::DynamicFlags::empty(),
5088            )
5089    }
5090}
5091
5092#[must_use = "FIDL methods require a response to be sent"]
5093#[derive(Debug)]
5094pub struct DirectoryWatchResponder {
5095    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5096    tx_id: u32,
5097}
5098
5099/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5100/// if the responder is dropped without sending a response, so that the client
5101/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5102impl std::ops::Drop for DirectoryWatchResponder {
5103    fn drop(&mut self) {
5104        self.control_handle.shutdown();
5105        // Safety: drops once, never accessed again
5106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5107    }
5108}
5109
5110impl fdomain_client::fidl::Responder for DirectoryWatchResponder {
5111    type ControlHandle = DirectoryControlHandle;
5112
5113    fn control_handle(&self) -> &DirectoryControlHandle {
5114        &self.control_handle
5115    }
5116
5117    fn drop_without_shutdown(mut self) {
5118        // Safety: drops once, never accessed again due to mem::forget
5119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5120        // Prevent Drop from running (which would shut down the channel)
5121        std::mem::forget(self);
5122    }
5123}
5124
5125impl DirectoryWatchResponder {
5126    /// Sends a response to the FIDL transaction.
5127    ///
5128    /// Sets the channel to shutdown if an error occurs.
5129    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5130        let _result = self.send_raw(s);
5131        if _result.is_err() {
5132            self.control_handle.shutdown();
5133        }
5134        self.drop_without_shutdown();
5135        _result
5136    }
5137
5138    /// Similar to "send" but does not shutdown the channel if an error occurs.
5139    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5140        let _result = self.send_raw(s);
5141        self.drop_without_shutdown();
5142        _result
5143    }
5144
5145    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5146        self.control_handle.inner.send::<DirectoryWatchResponse>(
5147            (s,),
5148            self.tx_id,
5149            0x5717193a59d66d91,
5150            fidl::encoding::DynamicFlags::empty(),
5151        )
5152    }
5153}
5154
5155#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5156pub struct DirectoryWatcherMarker;
5157
5158impl fdomain_client::fidl::ProtocolMarker for DirectoryWatcherMarker {
5159    type Proxy = DirectoryWatcherProxy;
5160    type RequestStream = DirectoryWatcherRequestStream;
5161
5162    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
5163}
5164
5165pub trait DirectoryWatcherProxyInterface: Send + Sync {}
5166
5167#[derive(Debug, Clone)]
5168pub struct DirectoryWatcherProxy {
5169    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5170}
5171
5172impl fdomain_client::fidl::Proxy for DirectoryWatcherProxy {
5173    type Protocol = DirectoryWatcherMarker;
5174
5175    fn from_channel(inner: fdomain_client::Channel) -> Self {
5176        Self::new(inner)
5177    }
5178
5179    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5180        self.client.into_channel().map_err(|client| Self { client })
5181    }
5182
5183    fn as_channel(&self) -> &fdomain_client::Channel {
5184        self.client.as_channel()
5185    }
5186}
5187
5188impl DirectoryWatcherProxy {
5189    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
5190    pub fn new(channel: fdomain_client::Channel) -> Self {
5191        let protocol_name =
5192            <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5193        Self { client: fidl::client::Client::new(channel, protocol_name) }
5194    }
5195
5196    /// Get a Stream of events from the remote end of the protocol.
5197    ///
5198    /// # Panics
5199    ///
5200    /// Panics if the event stream was already taken.
5201    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
5202        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
5203    }
5204}
5205
5206impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
5207
5208pub struct DirectoryWatcherEventStream {
5209    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5210}
5211
5212impl std::marker::Unpin for DirectoryWatcherEventStream {}
5213
5214impl futures::stream::FusedStream for DirectoryWatcherEventStream {
5215    fn is_terminated(&self) -> bool {
5216        self.event_receiver.is_terminated()
5217    }
5218}
5219
5220impl futures::Stream for DirectoryWatcherEventStream {
5221    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
5222
5223    fn poll_next(
5224        mut self: std::pin::Pin<&mut Self>,
5225        cx: &mut std::task::Context<'_>,
5226    ) -> std::task::Poll<Option<Self::Item>> {
5227        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5228            &mut self.event_receiver,
5229            cx
5230        )?) {
5231            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
5232            None => std::task::Poll::Ready(None),
5233        }
5234    }
5235}
5236
5237#[derive(Debug)]
5238pub enum DirectoryWatcherEvent {}
5239
5240impl DirectoryWatcherEvent {
5241    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
5242    fn decode(
5243        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5244    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
5245        let (bytes, _handles) = buf.split_mut();
5246        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5247        debug_assert_eq!(tx_header.tx_id, 0);
5248        match tx_header.ordinal {
5249            _ => Err(fidl::Error::UnknownOrdinal {
5250                ordinal: tx_header.ordinal,
5251                protocol_name:
5252                    <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5253            }),
5254        }
5255    }
5256}
5257
5258/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
5259pub struct DirectoryWatcherRequestStream {
5260    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5261    is_terminated: bool,
5262}
5263
5264impl std::marker::Unpin for DirectoryWatcherRequestStream {}
5265
5266impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
5267    fn is_terminated(&self) -> bool {
5268        self.is_terminated
5269    }
5270}
5271
5272impl fdomain_client::fidl::RequestStream for DirectoryWatcherRequestStream {
5273    type Protocol = DirectoryWatcherMarker;
5274    type ControlHandle = DirectoryWatcherControlHandle;
5275
5276    fn from_channel(channel: fdomain_client::Channel) -> Self {
5277        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5278    }
5279
5280    fn control_handle(&self) -> Self::ControlHandle {
5281        DirectoryWatcherControlHandle { inner: self.inner.clone() }
5282    }
5283
5284    fn into_inner(
5285        self,
5286    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5287    {
5288        (self.inner, self.is_terminated)
5289    }
5290
5291    fn from_inner(
5292        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5293        is_terminated: bool,
5294    ) -> Self {
5295        Self { inner, is_terminated }
5296    }
5297}
5298
5299impl futures::Stream for DirectoryWatcherRequestStream {
5300    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
5301
5302    fn poll_next(
5303        mut self: std::pin::Pin<&mut Self>,
5304        cx: &mut std::task::Context<'_>,
5305    ) -> std::task::Poll<Option<Self::Item>> {
5306        let this = &mut *self;
5307        if this.inner.check_shutdown(cx) {
5308            this.is_terminated = true;
5309            return std::task::Poll::Ready(None);
5310        }
5311        if this.is_terminated {
5312            panic!("polled DirectoryWatcherRequestStream after completion");
5313        }
5314        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5315            |bytes, handles| {
5316                match this.inner.channel().read_etc(cx, bytes, handles) {
5317                    std::task::Poll::Ready(Ok(())) => {}
5318                    std::task::Poll::Pending => return std::task::Poll::Pending,
5319                    std::task::Poll::Ready(Err(None)) => {
5320                        this.is_terminated = true;
5321                        return std::task::Poll::Ready(None);
5322                    }
5323                    std::task::Poll::Ready(Err(Some(e))) => {
5324                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5325                            e.into(),
5326                        ))));
5327                    }
5328                }
5329
5330                // A message has been received from the channel
5331                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5332
5333                std::task::Poll::Ready(Some(match header.ordinal {
5334                _ => Err(fidl::Error::UnknownOrdinal {
5335                    ordinal: header.ordinal,
5336                    protocol_name: <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5337                }),
5338            }))
5339            },
5340        )
5341    }
5342}
5343
5344/// DirectoryWatcher transmits messages from a filesystem server
5345/// about events happening in the filesystem. Clients can register
5346/// new watchers using the `Directory.Watch` method, where they can
5347/// filter which events they want to receive notifications for.
5348///
5349/// The DirectoryWatcher will send messages of the form:
5350/// ```
5351/// struct {
5352///   uint8 event;
5353///   uint8 len;
5354///   char name[];
5355/// };
5356/// ```
5357/// Where names are NOT null-terminated. The name is the relative
5358/// path to the entry the event is refering to. It will be empty if
5359/// the event isn't referencing a particular entry (e.g. for the
5360/// `IDLE` event).
5361#[derive(Debug)]
5362pub enum DirectoryWatcherRequest {}
5363
5364impl DirectoryWatcherRequest {
5365    /// Name of the method defined in FIDL
5366    pub fn method_name(&self) -> &'static str {
5367        match *self {}
5368    }
5369}
5370
5371#[derive(Debug, Clone)]
5372pub struct DirectoryWatcherControlHandle {
5373    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5374}
5375
5376impl fdomain_client::fidl::ControlHandle for DirectoryWatcherControlHandle {
5377    fn shutdown(&self) {
5378        self.inner.shutdown()
5379    }
5380
5381    fn is_closed(&self) -> bool {
5382        self.inner.channel().is_closed()
5383    }
5384    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5385        self.inner.channel().on_closed()
5386    }
5387}
5388
5389impl DirectoryWatcherControlHandle {}
5390
5391#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5392pub struct ExtendedAttributeIteratorMarker;
5393
5394impl fdomain_client::fidl::ProtocolMarker for ExtendedAttributeIteratorMarker {
5395    type Proxy = ExtendedAttributeIteratorProxy;
5396    type RequestStream = ExtendedAttributeIteratorRequestStream;
5397
5398    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
5399}
5400pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
5401
5402pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
5403    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
5404        + Send;
5405    fn r#get_next(&self) -> Self::GetNextResponseFut;
5406}
5407
5408#[derive(Debug, Clone)]
5409pub struct ExtendedAttributeIteratorProxy {
5410    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5411}
5412
5413impl fdomain_client::fidl::Proxy for ExtendedAttributeIteratorProxy {
5414    type Protocol = ExtendedAttributeIteratorMarker;
5415
5416    fn from_channel(inner: fdomain_client::Channel) -> Self {
5417        Self::new(inner)
5418    }
5419
5420    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5421        self.client.into_channel().map_err(|client| Self { client })
5422    }
5423
5424    fn as_channel(&self) -> &fdomain_client::Channel {
5425        self.client.as_channel()
5426    }
5427}
5428
5429impl ExtendedAttributeIteratorProxy {
5430    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
5431    pub fn new(channel: fdomain_client::Channel) -> Self {
5432        let protocol_name =
5433            <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5434        Self { client: fidl::client::Client::new(channel, protocol_name) }
5435    }
5436
5437    /// Get a Stream of events from the remote end of the protocol.
5438    ///
5439    /// # Panics
5440    ///
5441    /// Panics if the event stream was already taken.
5442    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
5443        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5444    }
5445
5446    /// Get the next chunk of extended attribute names. If this is the last
5447    /// chunk, last will be true, and the channel will be closed after the
5448    /// call.
5449    pub fn r#get_next(
5450        &self,
5451    ) -> fidl::client::QueryResponseFut<
5452        ExtendedAttributeIteratorGetNextResult,
5453        fdomain_client::fidl::FDomainResourceDialect,
5454    > {
5455        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
5456    }
5457}
5458
5459impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
5460    type GetNextResponseFut = fidl::client::QueryResponseFut<
5461        ExtendedAttributeIteratorGetNextResult,
5462        fdomain_client::fidl::FDomainResourceDialect,
5463    >;
5464    fn r#get_next(&self) -> Self::GetNextResponseFut {
5465        fn _decode(
5466            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5467        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
5468            let _response = fidl::client::decode_transaction_body::<
5469                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
5470                fdomain_client::fidl::FDomainResourceDialect,
5471                0x3ba664a1c2e45a7,
5472            >(_buf?)?;
5473            Ok(_response.map(|x| (x.attributes, x.last)))
5474        }
5475        self.client.send_query_and_decode::<
5476            fidl::encoding::EmptyPayload,
5477            ExtendedAttributeIteratorGetNextResult,
5478        >(
5479            (),
5480            0x3ba664a1c2e45a7,
5481            fidl::encoding::DynamicFlags::empty(),
5482            _decode,
5483        )
5484    }
5485}
5486
5487pub struct ExtendedAttributeIteratorEventStream {
5488    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5489}
5490
5491impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
5492
5493impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
5494    fn is_terminated(&self) -> bool {
5495        self.event_receiver.is_terminated()
5496    }
5497}
5498
5499impl futures::Stream for ExtendedAttributeIteratorEventStream {
5500    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
5501
5502    fn poll_next(
5503        mut self: std::pin::Pin<&mut Self>,
5504        cx: &mut std::task::Context<'_>,
5505    ) -> std::task::Poll<Option<Self::Item>> {
5506        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5507            &mut self.event_receiver,
5508            cx
5509        )?) {
5510            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
5511            None => std::task::Poll::Ready(None),
5512        }
5513    }
5514}
5515
5516#[derive(Debug)]
5517pub enum ExtendedAttributeIteratorEvent {}
5518
5519impl ExtendedAttributeIteratorEvent {
5520    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
5521    fn decode(
5522        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5523    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
5524        let (bytes, _handles) = buf.split_mut();
5525        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5526        debug_assert_eq!(tx_header.tx_id, 0);
5527        match tx_header.ordinal {
5528            _ => Err(fidl::Error::UnknownOrdinal {
5529                ordinal: tx_header.ordinal,
5530                protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5531            })
5532        }
5533    }
5534}
5535
5536/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
5537pub struct ExtendedAttributeIteratorRequestStream {
5538    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5539    is_terminated: bool,
5540}
5541
5542impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
5543
5544impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
5545    fn is_terminated(&self) -> bool {
5546        self.is_terminated
5547    }
5548}
5549
5550impl fdomain_client::fidl::RequestStream for ExtendedAttributeIteratorRequestStream {
5551    type Protocol = ExtendedAttributeIteratorMarker;
5552    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5553
5554    fn from_channel(channel: fdomain_client::Channel) -> Self {
5555        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5556    }
5557
5558    fn control_handle(&self) -> Self::ControlHandle {
5559        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
5560    }
5561
5562    fn into_inner(
5563        self,
5564    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5565    {
5566        (self.inner, self.is_terminated)
5567    }
5568
5569    fn from_inner(
5570        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5571        is_terminated: bool,
5572    ) -> Self {
5573        Self { inner, is_terminated }
5574    }
5575}
5576
5577impl futures::Stream for ExtendedAttributeIteratorRequestStream {
5578    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
5579
5580    fn poll_next(
5581        mut self: std::pin::Pin<&mut Self>,
5582        cx: &mut std::task::Context<'_>,
5583    ) -> std::task::Poll<Option<Self::Item>> {
5584        let this = &mut *self;
5585        if this.inner.check_shutdown(cx) {
5586            this.is_terminated = true;
5587            return std::task::Poll::Ready(None);
5588        }
5589        if this.is_terminated {
5590            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
5591        }
5592        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5593            |bytes, handles| {
5594                match this.inner.channel().read_etc(cx, bytes, handles) {
5595                    std::task::Poll::Ready(Ok(())) => {}
5596                    std::task::Poll::Pending => return std::task::Poll::Pending,
5597                    std::task::Poll::Ready(Err(None)) => {
5598                        this.is_terminated = true;
5599                        return std::task::Poll::Ready(None);
5600                    }
5601                    std::task::Poll::Ready(Err(Some(e))) => {
5602                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5603                            e.into(),
5604                        ))));
5605                    }
5606                }
5607
5608                // A message has been received from the channel
5609                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5610
5611                std::task::Poll::Ready(Some(match header.ordinal {
5612                0x3ba664a1c2e45a7 => {
5613                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5614                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
5615                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5616                    let control_handle = ExtendedAttributeIteratorControlHandle {
5617                        inner: this.inner.clone(),
5618                    };
5619                    Ok(ExtendedAttributeIteratorRequest::GetNext {
5620                        responder: ExtendedAttributeIteratorGetNextResponder {
5621                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5622                            tx_id: header.tx_id,
5623                        },
5624                    })
5625                }
5626                _ => Err(fidl::Error::UnknownOrdinal {
5627                    ordinal: header.ordinal,
5628                    protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5629                }),
5630            }))
5631            },
5632        )
5633    }
5634}
5635
5636#[derive(Debug)]
5637pub enum ExtendedAttributeIteratorRequest {
5638    /// Get the next chunk of extended attribute names. If this is the last
5639    /// chunk, last will be true, and the channel will be closed after the
5640    /// call.
5641    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
5642}
5643
5644impl ExtendedAttributeIteratorRequest {
5645    #[allow(irrefutable_let_patterns)]
5646    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
5647        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
5648            Some((responder))
5649        } else {
5650            None
5651        }
5652    }
5653
5654    /// Name of the method defined in FIDL
5655    pub fn method_name(&self) -> &'static str {
5656        match *self {
5657            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
5658        }
5659    }
5660}
5661
5662#[derive(Debug, Clone)]
5663pub struct ExtendedAttributeIteratorControlHandle {
5664    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5665}
5666
5667impl fdomain_client::fidl::ControlHandle for ExtendedAttributeIteratorControlHandle {
5668    fn shutdown(&self) {
5669        self.inner.shutdown()
5670    }
5671
5672    fn is_closed(&self) -> bool {
5673        self.inner.channel().is_closed()
5674    }
5675    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5676        self.inner.channel().on_closed()
5677    }
5678}
5679
5680impl ExtendedAttributeIteratorControlHandle {}
5681
5682#[must_use = "FIDL methods require a response to be sent"]
5683#[derive(Debug)]
5684pub struct ExtendedAttributeIteratorGetNextResponder {
5685    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
5686    tx_id: u32,
5687}
5688
5689/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
5690/// if the responder is dropped without sending a response, so that the client
5691/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5692impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
5693    fn drop(&mut self) {
5694        self.control_handle.shutdown();
5695        // Safety: drops once, never accessed again
5696        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5697    }
5698}
5699
5700impl fdomain_client::fidl::Responder for ExtendedAttributeIteratorGetNextResponder {
5701    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5702
5703    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
5704        &self.control_handle
5705    }
5706
5707    fn drop_without_shutdown(mut self) {
5708        // Safety: drops once, never accessed again due to mem::forget
5709        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5710        // Prevent Drop from running (which would shut down the channel)
5711        std::mem::forget(self);
5712    }
5713}
5714
5715impl ExtendedAttributeIteratorGetNextResponder {
5716    /// Sends a response to the FIDL transaction.
5717    ///
5718    /// Sets the channel to shutdown if an error occurs.
5719    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5720        let _result = self.send_raw(result);
5721        if _result.is_err() {
5722            self.control_handle.shutdown();
5723        }
5724        self.drop_without_shutdown();
5725        _result
5726    }
5727
5728    /// Similar to "send" but does not shutdown the channel if an error occurs.
5729    pub fn send_no_shutdown_on_err(
5730        self,
5731        mut result: Result<(&[Vec<u8>], bool), i32>,
5732    ) -> Result<(), fidl::Error> {
5733        let _result = self.send_raw(result);
5734        self.drop_without_shutdown();
5735        _result
5736    }
5737
5738    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5739        self.control_handle.inner.send::<fidl::encoding::ResultType<
5740            ExtendedAttributeIteratorGetNextResponse,
5741            i32,
5742        >>(
5743            result,
5744            self.tx_id,
5745            0x3ba664a1c2e45a7,
5746            fidl::encoding::DynamicFlags::empty(),
5747        )
5748    }
5749}
5750
5751#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5752pub struct FileMarker;
5753
5754impl fdomain_client::fidl::ProtocolMarker for FileMarker {
5755    type Proxy = FileProxy;
5756    type RequestStream = FileRequestStream;
5757
5758    const DEBUG_NAME: &'static str = "fuchsia.io.File";
5759}
5760impl fdomain_client::fidl::DiscoverableProtocolMarker for FileMarker {}
5761pub type FileSeekResult = Result<u64, i32>;
5762pub type FileReadAtResult = Result<Vec<u8>, i32>;
5763pub type FileWriteAtResult = Result<u64, i32>;
5764pub type FileResizeResult = Result<(), i32>;
5765pub type FileGetBackingMemoryResult = Result<fdomain_client::Vmo, i32>;
5766pub type FileAllocateResult = Result<(), i32>;
5767pub type FileEnableVerityResult = Result<(), i32>;
5768
5769pub trait FileProxyInterface: Send + Sync {
5770    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
5771        + Send;
5772    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
5773    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
5774        + Send;
5775    fn r#link_into(
5776        &self,
5777        dst_parent_token: fdomain_client::Event,
5778        dst: &str,
5779    ) -> Self::LinkIntoResponseFut;
5780    fn r#clone(
5781        &self,
5782        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5783    ) -> Result<(), fidl::Error>;
5784    type CloseResponseFut: std::future::Future<
5785            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
5786        > + Send;
5787    fn r#close(&self) -> Self::CloseResponseFut;
5788    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
5789    fn r#query(&self) -> Self::QueryResponseFut;
5790    fn r#deprecated_clone(
5791        &self,
5792        flags: OpenFlags,
5793        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
5794    ) -> Result<(), fidl::Error>;
5795    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
5796        + Send;
5797    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
5798    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
5799    fn r#deprecated_set_attr(
5800        &self,
5801        flags: NodeAttributeFlags,
5802        attributes: &NodeAttributes,
5803    ) -> Self::DeprecatedSetAttrResponseFut;
5804    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
5805        + Send;
5806    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
5807    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
5808        + Send;
5809    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
5810    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
5811        + Send;
5812    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
5813    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
5814        + Send;
5815    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
5816    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
5817        + Send;
5818    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
5819    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
5820        + Send;
5821    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
5822    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
5823        + Send;
5824    fn r#update_attributes(
5825        &self,
5826        payload: &MutableNodeAttributes,
5827    ) -> Self::UpdateAttributesResponseFut;
5828    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
5829    fn r#sync(&self) -> Self::SyncResponseFut;
5830    fn r#list_extended_attributes(
5831        &self,
5832        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
5833    ) -> Result<(), fidl::Error>;
5834    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
5835        + Send;
5836    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
5837    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
5838        + Send;
5839    fn r#set_extended_attribute(
5840        &self,
5841        name: &[u8],
5842        value: ExtendedAttributeValue,
5843        mode: SetExtendedAttributeMode,
5844    ) -> Self::SetExtendedAttributeResponseFut;
5845    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
5846        + Send;
5847    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
5848    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
5849        + Send;
5850    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
5851    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
5852        + Send;
5853    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
5854    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
5855    fn r#describe(&self) -> Self::DescribeResponseFut;
5856    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
5857    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
5858    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
5859        + Send;
5860    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
5861    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
5862        + Send;
5863    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
5864    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
5865        + Send;
5866    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
5867    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
5868        + Send;
5869    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
5870    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
5871        + Send;
5872    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
5873    -> Self::AllocateResponseFut;
5874    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
5875        + Send;
5876    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
5877}
5878
5879#[derive(Debug, Clone)]
5880pub struct FileProxy {
5881    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5882}
5883
5884impl fdomain_client::fidl::Proxy for FileProxy {
5885    type Protocol = FileMarker;
5886
5887    fn from_channel(inner: fdomain_client::Channel) -> Self {
5888        Self::new(inner)
5889    }
5890
5891    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5892        self.client.into_channel().map_err(|client| Self { client })
5893    }
5894
5895    fn as_channel(&self) -> &fdomain_client::Channel {
5896        self.client.as_channel()
5897    }
5898}
5899
5900impl FileProxy {
5901    /// Create a new Proxy for fuchsia.io/File.
5902    pub fn new(channel: fdomain_client::Channel) -> Self {
5903        let protocol_name = <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5904        Self { client: fidl::client::Client::new(channel, protocol_name) }
5905    }
5906
5907    /// Get a Stream of events from the remote end of the protocol.
5908    ///
5909    /// # Panics
5910    ///
5911    /// Panics if the event stream was already taken.
5912    pub fn take_event_stream(&self) -> FileEventStream {
5913        FileEventStream { event_receiver: self.client.take_event_receiver() }
5914    }
5915
5916    /// Acquires an advisory lock on the underlying file.
5917    ///
5918    /// The lock lasts until either this connection is closed or
5919    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
5920    /// explicitly.
5921    ///
5922    /// Advisory locks are purely advisory. They do not prevent actual read or
5923    /// write operations from occurring on the file, either through this
5924    /// connection or through other connections.
5925    ///
5926    /// This method requires the following rights:
5927    ///
5928    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
5929    /// * [`Rights.WRITE_BYTES`] if `request.type` is
5930    ///   [`AdvisoryLockType.WRITE`].
5931    ///
5932    /// # Errors
5933    ///
5934    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
5935    ///   example, another connection might hold a conflicting lock type.
5936    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
5937    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
5938    ///   to acquire the given type of lock.
5939    pub fn r#advisory_lock(
5940        &self,
5941        mut request: &AdvisoryLockRequest,
5942    ) -> fidl::client::QueryResponseFut<
5943        AdvisoryLockingAdvisoryLockResult,
5944        fdomain_client::fidl::FDomainResourceDialect,
5945    > {
5946        FileProxyInterface::r#advisory_lock(self, request)
5947    }
5948
5949    /// Creates a link to this this object with name `dst` in the directory represented by
5950    /// `dst_parent_token`.
5951    ///
5952    /// `dst` must be a resolved object name. Including "/" in the string will return
5953    /// `ZX_ERR_INVALID_ARGS`.
5954    ///
5955    /// This method requires the maximal set of rights supported by the filesystem for this object.
5956    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
5957    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
5958    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
5959    /// `ZX_ERR_ACCESS_DENIED`.
5960    ///
5961    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
5962    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
5963    ///
5964    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
5965    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
5966    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
5967    ///
5968    /// This method does not have the same atomicity properties has the `Directory::Link` method,
5969    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
5970    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
5971    pub fn r#link_into(
5972        &self,
5973        mut dst_parent_token: fdomain_client::Event,
5974        mut dst: &str,
5975    ) -> fidl::client::QueryResponseFut<
5976        LinkableLinkIntoResult,
5977        fdomain_client::fidl::FDomainResourceDialect,
5978    > {
5979        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
5980    }
5981
5982    pub fn r#clone(
5983        &self,
5984        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5985    ) -> Result<(), fidl::Error> {
5986        FileProxyInterface::r#clone(self, request)
5987    }
5988
5989    /// Terminates the connection.
5990    ///
5991    /// After calling `Close`, the client must not send any other requests.
5992    ///
5993    /// Servers, after sending the status response, should close the connection
5994    /// regardless of status and without sending an epitaph.
5995    ///
5996    /// Closing the client end of the channel should be semantically equivalent
5997    /// to calling `Close` without knowing when the close has completed or its
5998    /// status.
5999    pub fn r#close(
6000        &self,
6001    ) -> fidl::client::QueryResponseFut<
6002        fdomain_fuchsia_unknown::CloseableCloseResult,
6003        fdomain_client::fidl::FDomainResourceDialect,
6004    > {
6005        FileProxyInterface::r#close(self)
6006    }
6007
6008    pub fn r#query(
6009        &self,
6010    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
6011        FileProxyInterface::r#query(self)
6012    }
6013
6014    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
6015    pub fn r#deprecated_clone(
6016        &self,
6017        mut flags: OpenFlags,
6018        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6019    ) -> Result<(), fidl::Error> {
6020        FileProxyInterface::r#deprecated_clone(self, flags, object)
6021    }
6022
6023    /// DEPRECATED - Use `Node.GetAttributes` instead.
6024    pub fn r#deprecated_get_attr(
6025        &self,
6026    ) -> fidl::client::QueryResponseFut<
6027        (i32, NodeAttributes),
6028        fdomain_client::fidl::FDomainResourceDialect,
6029    > {
6030        FileProxyInterface::r#deprecated_get_attr(self)
6031    }
6032
6033    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
6034    pub fn r#deprecated_set_attr(
6035        &self,
6036        mut flags: NodeAttributeFlags,
6037        mut attributes: &NodeAttributes,
6038    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6039        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
6040    }
6041
6042    /// [DEPRECATED - Use new GetFlags method instead.]
6043    pub fn r#deprecated_get_flags(
6044        &self,
6045    ) -> fidl::client::QueryResponseFut<
6046        (i32, OpenFlags),
6047        fdomain_client::fidl::FDomainResourceDialect,
6048    > {
6049        FileProxyInterface::r#deprecated_get_flags(self)
6050    }
6051
6052    /// [DEPRECATED - Use new SetFlags method instead.]
6053    pub fn r#deprecated_set_flags(
6054        &self,
6055        mut flags: OpenFlags,
6056    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6057        FileProxyInterface::r#deprecated_set_flags(self, flags)
6058    }
6059
6060    /// Queries the flags that apply to this node after it has been opened/created. This method does
6061    /// not require any rights.
6062    ///
6063    /// Note that the final set of flags that apply to the connection may differ from those
6064    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
6065    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
6066    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
6067    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
6068    pub fn r#get_flags(
6069        &self,
6070    ) -> fidl::client::QueryResponseFut<
6071        NodeGetFlagsResult,
6072        fdomain_client::fidl::FDomainResourceDialect,
6073    > {
6074        FileProxyInterface::r#get_flags(self)
6075    }
6076
6077    /// Sets the flags that apply to this node after it has been opened. This method does not
6078    /// require any rights.
6079    ///
6080    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
6081    /// clear append mode.
6082    ///
6083    /// Errors:
6084    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
6085    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
6086    pub fn r#set_flags(
6087        &self,
6088        mut flags: Flags,
6089    ) -> fidl::client::QueryResponseFut<
6090        NodeSetFlagsResult,
6091        fdomain_client::fidl::FDomainResourceDialect,
6092    > {
6093        FileProxyInterface::r#set_flags(self, flags)
6094    }
6095
6096    /// Query the filesystem for filesystem-specific information.
6097    pub fn r#query_filesystem(
6098        &self,
6099    ) -> fidl::client::QueryResponseFut<
6100        (i32, Option<Box<FilesystemInfo>>),
6101        fdomain_client::fidl::FDomainResourceDialect,
6102    > {
6103        FileProxyInterface::r#query_filesystem(self)
6104    }
6105
6106    /// Acquires information about the node.
6107    ///
6108    /// The attributes of a node should be stable, independent of the
6109    /// specific protocol used to access it.
6110    ///
6111    /// If a particular attribute is not applicable or not supported,
6112    /// filesystems should leave the corresponding field absent.
6113    ///
6114    /// + `query` a bit-mask specifying which attributes to fetch. The server
6115    ///   should not return more than necessary.
6116    /// - `attributes` the returned attributes.
6117    ///
6118    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6119    pub fn r#get_attributes(
6120        &self,
6121        mut query: NodeAttributesQuery,
6122    ) -> fidl::client::QueryResponseFut<
6123        NodeGetAttributesResult,
6124        fdomain_client::fidl::FDomainResourceDialect,
6125    > {
6126        FileProxyInterface::r#get_attributes(self, query)
6127    }
6128
6129    /// Updates information about the node.
6130    ///
6131    /// + `attributes` the presence of a table field in `attributes` indicates
6132    /// the intent to update the corresponding attribute.
6133    ///
6134    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
6135    ///
6136    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6137    pub fn r#update_attributes(
6138        &self,
6139        mut payload: &MutableNodeAttributes,
6140    ) -> fidl::client::QueryResponseFut<
6141        NodeUpdateAttributesResult,
6142        fdomain_client::fidl::FDomainResourceDialect,
6143    > {
6144        FileProxyInterface::r#update_attributes(self, payload)
6145    }
6146
6147    /// Synchronizes updates to the node to the underlying media, if it exists.
6148    ///
6149    /// This method will return when the filesystem server has flushed the
6150    /// relevant updates to the underlying media, but does not guarantee the
6151    /// underlying media has persisted the information, nor that any information
6152    /// is committed to hardware. Clients may use `Sync` to ensure ordering
6153    /// between operations.
6154    ///
6155    /// This method does not require any rights.
6156    pub fn r#sync(
6157        &self,
6158    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
6159    {
6160        FileProxyInterface::r#sync(self)
6161    }
6162
6163    /// Creates an iterator over all the extended attribute names associated
6164    /// with this node. If an error occurs it is returned as an epitaph on the
6165    /// iterator request channel, and then the channel is closed.
6166    ///
6167    /// GetExtendedAttributes can be used with any of these names to retrieve
6168    /// the associated value.
6169    ///
6170    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6171    pub fn r#list_extended_attributes(
6172        &self,
6173        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6174    ) -> Result<(), fidl::Error> {
6175        FileProxyInterface::r#list_extended_attributes(self, iterator)
6176    }
6177
6178    /// Get the value associated with the given attribute `name` for this node.
6179    ///
6180    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
6181    /// particular structure is imposed on them.
6182    ///
6183    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6184    pub fn r#get_extended_attribute(
6185        &self,
6186        mut name: &[u8],
6187    ) -> fidl::client::QueryResponseFut<
6188        NodeGetExtendedAttributeResult,
6189        fdomain_client::fidl::FDomainResourceDialect,
6190    > {
6191        FileProxyInterface::r#get_extended_attribute(self, name)
6192    }
6193
6194    /// Set the value for the given attribute `name` to `value` for this node.
6195    ///
6196    /// The attribute name may exist, in which case the attribute is updated.
6197    /// If the attribute doesn't exist, it is created. The name should have no
6198    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
6199    ///
6200    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6201    pub fn r#set_extended_attribute(
6202        &self,
6203        mut name: &[u8],
6204        mut value: ExtendedAttributeValue,
6205        mut mode: SetExtendedAttributeMode,
6206    ) -> fidl::client::QueryResponseFut<
6207        NodeSetExtendedAttributeResult,
6208        fdomain_client::fidl::FDomainResourceDialect,
6209    > {
6210        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
6211    }
6212
6213    /// Remove the specified extended attribute.
6214    ///
6215    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
6216    ///
6217    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6218    pub fn r#remove_extended_attribute(
6219        &self,
6220        mut name: &[u8],
6221    ) -> fidl::client::QueryResponseFut<
6222        NodeRemoveExtendedAttributeResult,
6223        fdomain_client::fidl::FDomainResourceDialect,
6224    > {
6225        FileProxyInterface::r#remove_extended_attribute(self, name)
6226    }
6227
6228    /// Reads up to 'count' bytes at the seek offset.
6229    /// The seek offset is moved forward by the number of bytes read.
6230    ///
6231    /// ## Invariants
6232    ///
6233    /// * The returned `data.length` will never be greater than `count`.
6234    /// * If `data.length` is less than `count`, it means that the seek offset
6235    ///   has reached the end of file as part of this operation.
6236    /// * If `data.length` is zero while `count` is not, it means that the
6237    ///   seek offset is already at or beyond the end of file, and no data could
6238    ///   be read.
6239    /// * If `count` is zero, the server should perform all the checks ensuring
6240    ///   read access without actually read anything, and return an empty
6241    ///   `data` vector.
6242    ///
6243    /// This method requires the [`Rights.READ_BYTES`] right.
6244    ///
6245    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6246    pub fn r#read(
6247        &self,
6248        mut count: u64,
6249    ) -> fidl::client::QueryResponseFut<
6250        ReadableReadResult,
6251        fdomain_client::fidl::FDomainResourceDialect,
6252    > {
6253        FileProxyInterface::r#read(self, count)
6254    }
6255
6256    /// Writes data at the seek offset.
6257    /// The seek offset is moved forward by the number of bytes written.
6258    /// If the file is in append mode, the seek offset is first set to the end
6259    /// of the file, followed by the write, in one atomic step.
6260    ///
6261    /// The file size may grow if the seek offset plus `data.length` is beyond
6262    /// the current end of file.
6263    ///
6264    /// + request `data` the byte buffer to write to the file.
6265    /// - response `actual_count` the number of bytes written.
6266    ///
6267    /// ## Invariants
6268    ///
6269    /// * The returned `actual_count` will never be greater than `data.length`.
6270    /// * If the server is unable to write all the data due to e.g. not enough
6271    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6272    ///   could be written, an error is returned.
6273    /// * If `data.length` is zero, the server should perform all the checks
6274    ///   ensuring write access without mutating the file and return a
6275    ///   successful write of zero bytes.  The seek offset is still updated if
6276    ///   in append mode.
6277    ///
6278    /// This method requires the [`Rights.WRITE_BYTES`] right.
6279    pub fn r#write(
6280        &self,
6281        mut data: &[u8],
6282    ) -> fidl::client::QueryResponseFut<
6283        WritableWriteResult,
6284        fdomain_client::fidl::FDomainResourceDialect,
6285    > {
6286        FileProxyInterface::r#write(self, data)
6287    }
6288
6289    pub fn r#describe(
6290        &self,
6291    ) -> fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
6292    {
6293        FileProxyInterface::r#describe(self)
6294    }
6295
6296    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
6297    /// will occur. The seek offset is specific to each file connection.
6298    ///
6299    /// + request `origin` the reference point where `offset` will be based on.
6300    /// + request `offset` the number of bytes to seek.
6301    /// - response `offset_from_start` the adjusted seek offset, from the start
6302    ///   of the file.
6303    ///
6304    /// This method does not require any rights.
6305    pub fn r#seek(
6306        &self,
6307        mut origin: SeekOrigin,
6308        mut offset: i64,
6309    ) -> fidl::client::QueryResponseFut<FileSeekResult, fdomain_client::fidl::FDomainResourceDialect>
6310    {
6311        FileProxyInterface::r#seek(self, origin, offset)
6312    }
6313
6314    /// Reads up to 'count' bytes at the provided offset.
6315    /// Does not affect the seek offset.
6316    ///
6317    /// ## Invariants
6318    ///
6319    /// * The returned `data.length` will never be greater than `count`.
6320    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
6321    ///   the end of file as part of this operation.
6322    /// * If `data.length` is zero while `count` is not, it means that `offset`
6323    ///   is at or past the end of file, and no data can be read.
6324    /// * If `count` is zero, the server should perform all the checks ensuring
6325    ///   read access without actually reading anything, and return an empty
6326    ///   `data` vector.
6327    ///
6328    /// This method requires the [`Rights.READ_BYTES`] right.
6329    ///
6330    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6331    pub fn r#read_at(
6332        &self,
6333        mut count: u64,
6334        mut offset: u64,
6335    ) -> fidl::client::QueryResponseFut<
6336        FileReadAtResult,
6337        fdomain_client::fidl::FDomainResourceDialect,
6338    > {
6339        FileProxyInterface::r#read_at(self, count, offset)
6340    }
6341
6342    /// Writes data at the provided offset.
6343    /// Does not affect the seek offset.
6344    ///
6345    /// The file size may grow if `offset` plus `data.length` is past the
6346    /// current end of file.
6347    ///
6348    /// + request `data` the byte buffer to write to the file.
6349    /// + request `offset` the offset from start of the file to begin writing.
6350    /// - response `actual_count` the number of bytes written.
6351    ///
6352    /// ## Invariants
6353    ///
6354    /// * The returned `actual_count` will never be greater than `data.length`.
6355    /// * If the server is unable to write all the data due to e.g. not enough
6356    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6357    ///   could be written, an error is returned.
6358    /// * If `data.length` is zero, the server should perform all the checks
6359    ///   ensuring write access without mutating the file, and will return a
6360    ///   successful write of zero bytes.
6361    ///
6362    /// This method requires the [`Rights.WRITE_BYTES`] right.
6363    pub fn r#write_at(
6364        &self,
6365        mut data: &[u8],
6366        mut offset: u64,
6367    ) -> fidl::client::QueryResponseFut<
6368        FileWriteAtResult,
6369        fdomain_client::fidl::FDomainResourceDialect,
6370    > {
6371        FileProxyInterface::r#write_at(self, data, offset)
6372    }
6373
6374    /// Shrinks or grows the file size to 'length' bytes.
6375    ///
6376    /// If file size is reduced by this operation, the extra trailing data'
6377    /// is discarded.
6378    /// If file size is increased by this operation, the extended area appears
6379    /// as if it was zeroed.
6380    ///
6381    /// This method requires the [`Rights.WRITE_BYTES`] right.
6382    pub fn r#resize(
6383        &self,
6384        mut length: u64,
6385    ) -> fidl::client::QueryResponseFut<
6386        FileResizeResult,
6387        fdomain_client::fidl::FDomainResourceDialect,
6388    > {
6389        FileProxyInterface::r#resize(self, length)
6390    }
6391
6392    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
6393    /// with the requested access rights.
6394    ///
6395    /// Implementations are not required to implement files backed by VMOs so
6396    /// this request may fail. Additionally, implementations may only support
6397    /// a certain subset of the flags. Clients should be prepared with fallback
6398    /// behavior if this request fails.
6399    ///
6400    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
6401    /// implementation is free to choose the semantics of the returned VMO.
6402    ///
6403    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
6404    /// - response `vmo` the requested [`zx.Handle:VMO`].
6405    /// * error a [`zx.Status`] value indicating the failure.
6406    ///
6407    /// This method requires the following rights:
6408    ///
6409    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
6410    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
6411    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
6412    pub fn r#get_backing_memory(
6413        &self,
6414        mut flags: VmoFlags,
6415    ) -> fidl::client::QueryResponseFut<
6416        FileGetBackingMemoryResult,
6417        fdomain_client::fidl::FDomainResourceDialect,
6418    > {
6419        FileProxyInterface::r#get_backing_memory(self, flags)
6420    }
6421
6422    /// Pre-allocate on-disk space for this file.
6423    pub fn r#allocate(
6424        &self,
6425        mut offset: u64,
6426        mut length: u64,
6427        mut mode: AllocateMode,
6428    ) -> fidl::client::QueryResponseFut<
6429        FileAllocateResult,
6430        fdomain_client::fidl::FDomainResourceDialect,
6431    > {
6432        FileProxyInterface::r#allocate(self, offset, length, mode)
6433    }
6434
6435    /// Enables verification for the file (permanently) which involves computing a merkle tree for
6436    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
6437    /// captured. Future reads will be verified against the computed merkle tree and writes will be
6438    /// rejected. This method can take some time to complete as it depends on the size of the file.
6439    /// This method can be aborted by closing the connection that this method was issued on.
6440    ///
6441    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6442    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
6443    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
6444    /// Also returns any error that might arise from reading the file, or from flushing the file,
6445    /// such as `ZX_ERR_IO`.
6446    pub fn r#enable_verity(
6447        &self,
6448        mut options: &VerificationOptions,
6449    ) -> fidl::client::QueryResponseFut<
6450        FileEnableVerityResult,
6451        fdomain_client::fidl::FDomainResourceDialect,
6452    > {
6453        FileProxyInterface::r#enable_verity(self, options)
6454    }
6455}
6456
6457impl FileProxyInterface for FileProxy {
6458    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
6459        AdvisoryLockingAdvisoryLockResult,
6460        fdomain_client::fidl::FDomainResourceDialect,
6461    >;
6462    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
6463        fn _decode(
6464            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6465        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
6466            let _response = fidl::client::decode_transaction_body::<
6467                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6468                fdomain_client::fidl::FDomainResourceDialect,
6469                0x6ee9c0ad53ec87aa,
6470            >(_buf?)?;
6471            Ok(_response.map(|x| x))
6472        }
6473        self.client.send_query_and_decode::<
6474            AdvisoryLockingAdvisoryLockRequest,
6475            AdvisoryLockingAdvisoryLockResult,
6476        >(
6477            (request,),
6478            0x6ee9c0ad53ec87aa,
6479            fidl::encoding::DynamicFlags::empty(),
6480            _decode,
6481        )
6482    }
6483
6484    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
6485        LinkableLinkIntoResult,
6486        fdomain_client::fidl::FDomainResourceDialect,
6487    >;
6488    fn r#link_into(
6489        &self,
6490        mut dst_parent_token: fdomain_client::Event,
6491        mut dst: &str,
6492    ) -> Self::LinkIntoResponseFut {
6493        fn _decode(
6494            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6495        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
6496            let _response = fidl::client::decode_transaction_body::<
6497                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6498                fdomain_client::fidl::FDomainResourceDialect,
6499                0x54f3949246a03e74,
6500            >(_buf?)?;
6501            Ok(_response.map(|x| x))
6502        }
6503        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
6504            (dst_parent_token, dst),
6505            0x54f3949246a03e74,
6506            fidl::encoding::DynamicFlags::empty(),
6507            _decode,
6508        )
6509    }
6510
6511    fn r#clone(
6512        &self,
6513        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6514    ) -> Result<(), fidl::Error> {
6515        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
6516            (request,),
6517            0x20d8a7aba2168a79,
6518            fidl::encoding::DynamicFlags::empty(),
6519        )
6520    }
6521
6522    type CloseResponseFut = fidl::client::QueryResponseFut<
6523        fdomain_fuchsia_unknown::CloseableCloseResult,
6524        fdomain_client::fidl::FDomainResourceDialect,
6525    >;
6526    fn r#close(&self) -> Self::CloseResponseFut {
6527        fn _decode(
6528            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6529        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
6530            let _response = fidl::client::decode_transaction_body::<
6531                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6532                fdomain_client::fidl::FDomainResourceDialect,
6533                0x5ac5d459ad7f657e,
6534            >(_buf?)?;
6535            Ok(_response.map(|x| x))
6536        }
6537        self.client.send_query_and_decode::<
6538            fidl::encoding::EmptyPayload,
6539            fdomain_fuchsia_unknown::CloseableCloseResult,
6540        >(
6541            (),
6542            0x5ac5d459ad7f657e,
6543            fidl::encoding::DynamicFlags::empty(),
6544            _decode,
6545        )
6546    }
6547
6548    type QueryResponseFut =
6549        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
6550    fn r#query(&self) -> Self::QueryResponseFut {
6551        fn _decode(
6552            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6553        ) -> Result<Vec<u8>, fidl::Error> {
6554            let _response = fidl::client::decode_transaction_body::<
6555                fdomain_fuchsia_unknown::QueryableQueryResponse,
6556                fdomain_client::fidl::FDomainResourceDialect,
6557                0x2658edee9decfc06,
6558            >(_buf?)?;
6559            Ok(_response.protocol)
6560        }
6561        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
6562            (),
6563            0x2658edee9decfc06,
6564            fidl::encoding::DynamicFlags::empty(),
6565            _decode,
6566        )
6567    }
6568
6569    fn r#deprecated_clone(
6570        &self,
6571        mut flags: OpenFlags,
6572        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6573    ) -> Result<(), fidl::Error> {
6574        self.client.send::<NodeDeprecatedCloneRequest>(
6575            (flags, object),
6576            0x5a61678f293ce16f,
6577            fidl::encoding::DynamicFlags::FLEXIBLE,
6578        )
6579    }
6580
6581    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
6582        (i32, NodeAttributes),
6583        fdomain_client::fidl::FDomainResourceDialect,
6584    >;
6585    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
6586        fn _decode(
6587            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6588        ) -> Result<(i32, NodeAttributes), fidl::Error> {
6589            let _response = fidl::client::decode_transaction_body::<
6590                NodeDeprecatedGetAttrResponse,
6591                fdomain_client::fidl::FDomainResourceDialect,
6592                0x78985e216314dafd,
6593            >(_buf?)?;
6594            Ok((_response.s, _response.attributes))
6595        }
6596        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
6597            (),
6598            0x78985e216314dafd,
6599            fidl::encoding::DynamicFlags::empty(),
6600            _decode,
6601        )
6602    }
6603
6604    type DeprecatedSetAttrResponseFut =
6605        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6606    fn r#deprecated_set_attr(
6607        &self,
6608        mut flags: NodeAttributeFlags,
6609        mut attributes: &NodeAttributes,
6610    ) -> Self::DeprecatedSetAttrResponseFut {
6611        fn _decode(
6612            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6613        ) -> Result<i32, fidl::Error> {
6614            let _response = fidl::client::decode_transaction_body::<
6615                NodeDeprecatedSetAttrResponse,
6616                fdomain_client::fidl::FDomainResourceDialect,
6617                0x4186c0f40d938f46,
6618            >(_buf?)?;
6619            Ok(_response.s)
6620        }
6621        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
6622            (flags, attributes),
6623            0x4186c0f40d938f46,
6624            fidl::encoding::DynamicFlags::empty(),
6625            _decode,
6626        )
6627    }
6628
6629    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
6630        (i32, OpenFlags),
6631        fdomain_client::fidl::FDomainResourceDialect,
6632    >;
6633    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
6634        fn _decode(
6635            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6636        ) -> Result<(i32, OpenFlags), fidl::Error> {
6637            let _response = fidl::client::decode_transaction_body::<
6638                NodeDeprecatedGetFlagsResponse,
6639                fdomain_client::fidl::FDomainResourceDialect,
6640                0x5b88fffb8eda3aa1,
6641            >(_buf?)?;
6642            Ok((_response.s, _response.flags))
6643        }
6644        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
6645            (),
6646            0x5b88fffb8eda3aa1,
6647            fidl::encoding::DynamicFlags::empty(),
6648            _decode,
6649        )
6650    }
6651
6652    type DeprecatedSetFlagsResponseFut =
6653        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6654    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
6655        fn _decode(
6656            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6657        ) -> Result<i32, fidl::Error> {
6658            let _response = fidl::client::decode_transaction_body::<
6659                NodeDeprecatedSetFlagsResponse,
6660                fdomain_client::fidl::FDomainResourceDialect,
6661                0x5295b76c71fde733,
6662            >(_buf?)?;
6663            Ok(_response.s)
6664        }
6665        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
6666            (flags,),
6667            0x5295b76c71fde733,
6668            fidl::encoding::DynamicFlags::empty(),
6669            _decode,
6670        )
6671    }
6672
6673    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
6674        NodeGetFlagsResult,
6675        fdomain_client::fidl::FDomainResourceDialect,
6676    >;
6677    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
6678        fn _decode(
6679            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6680        ) -> Result<NodeGetFlagsResult, fidl::Error> {
6681            let _response = fidl::client::decode_transaction_body::<
6682                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
6683                fdomain_client::fidl::FDomainResourceDialect,
6684                0x176eb318f64ec23,
6685            >(_buf?)?
6686            .into_result_fdomain::<FileMarker>("get_flags")?;
6687            Ok(_response.map(|x| x.flags))
6688        }
6689        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
6690            (),
6691            0x176eb318f64ec23,
6692            fidl::encoding::DynamicFlags::FLEXIBLE,
6693            _decode,
6694        )
6695    }
6696
6697    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
6698        NodeSetFlagsResult,
6699        fdomain_client::fidl::FDomainResourceDialect,
6700    >;
6701    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
6702        fn _decode(
6703            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6704        ) -> Result<NodeSetFlagsResult, fidl::Error> {
6705            let _response = fidl::client::decode_transaction_body::<
6706                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6707                fdomain_client::fidl::FDomainResourceDialect,
6708                0x55a8028685791ea8,
6709            >(_buf?)?
6710            .into_result_fdomain::<FileMarker>("set_flags")?;
6711            Ok(_response.map(|x| x))
6712        }
6713        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
6714            (flags,),
6715            0x55a8028685791ea8,
6716            fidl::encoding::DynamicFlags::FLEXIBLE,
6717            _decode,
6718        )
6719    }
6720
6721    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
6722        (i32, Option<Box<FilesystemInfo>>),
6723        fdomain_client::fidl::FDomainResourceDialect,
6724    >;
6725    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
6726        fn _decode(
6727            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6728        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
6729            let _response = fidl::client::decode_transaction_body::<
6730                NodeQueryFilesystemResponse,
6731                fdomain_client::fidl::FDomainResourceDialect,
6732                0x6f344a1c6b0a0610,
6733            >(_buf?)?;
6734            Ok((_response.s, _response.info))
6735        }
6736        self.client.send_query_and_decode::<
6737            fidl::encoding::EmptyPayload,
6738            (i32, Option<Box<FilesystemInfo>>),
6739        >(
6740            (),
6741            0x6f344a1c6b0a0610,
6742            fidl::encoding::DynamicFlags::empty(),
6743            _decode,
6744        )
6745    }
6746
6747    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
6748        NodeGetAttributesResult,
6749        fdomain_client::fidl::FDomainResourceDialect,
6750    >;
6751    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
6752        fn _decode(
6753            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6754        ) -> Result<NodeGetAttributesResult, fidl::Error> {
6755            let _response = fidl::client::decode_transaction_body::<
6756                fidl::encoding::ResultType<NodeAttributes2, i32>,
6757                fdomain_client::fidl::FDomainResourceDialect,
6758                0x3d4396a638ea053b,
6759            >(_buf?)?;
6760            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
6761        }
6762        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
6763            (query,),
6764            0x3d4396a638ea053b,
6765            fidl::encoding::DynamicFlags::empty(),
6766            _decode,
6767        )
6768    }
6769
6770    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
6771        NodeUpdateAttributesResult,
6772        fdomain_client::fidl::FDomainResourceDialect,
6773    >;
6774    fn r#update_attributes(
6775        &self,
6776        mut payload: &MutableNodeAttributes,
6777    ) -> Self::UpdateAttributesResponseFut {
6778        fn _decode(
6779            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6780        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
6781            let _response = fidl::client::decode_transaction_body::<
6782                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6783                fdomain_client::fidl::FDomainResourceDialect,
6784                0x3308c1da5a89bf08,
6785            >(_buf?)?;
6786            Ok(_response.map(|x| x))
6787        }
6788        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
6789            payload,
6790            0x3308c1da5a89bf08,
6791            fidl::encoding::DynamicFlags::empty(),
6792            _decode,
6793        )
6794    }
6795
6796    type SyncResponseFut = fidl::client::QueryResponseFut<
6797        NodeSyncResult,
6798        fdomain_client::fidl::FDomainResourceDialect,
6799    >;
6800    fn r#sync(&self) -> Self::SyncResponseFut {
6801        fn _decode(
6802            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6803        ) -> Result<NodeSyncResult, fidl::Error> {
6804            let _response = fidl::client::decode_transaction_body::<
6805                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6806                fdomain_client::fidl::FDomainResourceDialect,
6807                0x2c5c27ca0ab5dc49,
6808            >(_buf?)?;
6809            Ok(_response.map(|x| x))
6810        }
6811        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
6812            (),
6813            0x2c5c27ca0ab5dc49,
6814            fidl::encoding::DynamicFlags::empty(),
6815            _decode,
6816        )
6817    }
6818
6819    fn r#list_extended_attributes(
6820        &self,
6821        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6822    ) -> Result<(), fidl::Error> {
6823        self.client.send::<NodeListExtendedAttributesRequest>(
6824            (iterator,),
6825            0x4b61033de007fcd0,
6826            fidl::encoding::DynamicFlags::empty(),
6827        )
6828    }
6829
6830    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6831        NodeGetExtendedAttributeResult,
6832        fdomain_client::fidl::FDomainResourceDialect,
6833    >;
6834    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
6835        fn _decode(
6836            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6837        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
6838            let _response = fidl::client::decode_transaction_body::<
6839                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
6840                fdomain_client::fidl::FDomainResourceDialect,
6841                0x45ffa3ccfdeb76db,
6842            >(_buf?)?;
6843            Ok(_response.map(|x| x))
6844        }
6845        self.client.send_query_and_decode::<
6846            NodeGetExtendedAttributeRequest,
6847            NodeGetExtendedAttributeResult,
6848        >(
6849            (name,),
6850            0x45ffa3ccfdeb76db,
6851            fidl::encoding::DynamicFlags::empty(),
6852            _decode,
6853        )
6854    }
6855
6856    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6857        NodeSetExtendedAttributeResult,
6858        fdomain_client::fidl::FDomainResourceDialect,
6859    >;
6860    fn r#set_extended_attribute(
6861        &self,
6862        mut name: &[u8],
6863        mut value: ExtendedAttributeValue,
6864        mut mode: SetExtendedAttributeMode,
6865    ) -> Self::SetExtendedAttributeResponseFut {
6866        fn _decode(
6867            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6868        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
6869            let _response = fidl::client::decode_transaction_body::<
6870                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6871                fdomain_client::fidl::FDomainResourceDialect,
6872                0x4a951362f681f23c,
6873            >(_buf?)?;
6874            Ok(_response.map(|x| x))
6875        }
6876        self.client.send_query_and_decode::<
6877            NodeSetExtendedAttributeRequest,
6878            NodeSetExtendedAttributeResult,
6879        >(
6880            (name, &mut value, mode,),
6881            0x4a951362f681f23c,
6882            fidl::encoding::DynamicFlags::empty(),
6883            _decode,
6884        )
6885    }
6886
6887    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6888        NodeRemoveExtendedAttributeResult,
6889        fdomain_client::fidl::FDomainResourceDialect,
6890    >;
6891    fn r#remove_extended_attribute(
6892        &self,
6893        mut name: &[u8],
6894    ) -> Self::RemoveExtendedAttributeResponseFut {
6895        fn _decode(
6896            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6897        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
6898            let _response = fidl::client::decode_transaction_body::<
6899                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6900                fdomain_client::fidl::FDomainResourceDialect,
6901                0x7a0b9f3a9bf9032d,
6902            >(_buf?)?;
6903            Ok(_response.map(|x| x))
6904        }
6905        self.client.send_query_and_decode::<
6906            NodeRemoveExtendedAttributeRequest,
6907            NodeRemoveExtendedAttributeResult,
6908        >(
6909            (name,),
6910            0x7a0b9f3a9bf9032d,
6911            fidl::encoding::DynamicFlags::empty(),
6912            _decode,
6913        )
6914    }
6915
6916    type ReadResponseFut = fidl::client::QueryResponseFut<
6917        ReadableReadResult,
6918        fdomain_client::fidl::FDomainResourceDialect,
6919    >;
6920    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
6921        fn _decode(
6922            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6923        ) -> Result<ReadableReadResult, fidl::Error> {
6924            let _response = fidl::client::decode_transaction_body::<
6925                fidl::encoding::ResultType<ReadableReadResponse, i32>,
6926                fdomain_client::fidl::FDomainResourceDialect,
6927                0x57e419a298c8ede,
6928            >(_buf?)?;
6929            Ok(_response.map(|x| x.data))
6930        }
6931        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
6932            (count,),
6933            0x57e419a298c8ede,
6934            fidl::encoding::DynamicFlags::empty(),
6935            _decode,
6936        )
6937    }
6938
6939    type WriteResponseFut = fidl::client::QueryResponseFut<
6940        WritableWriteResult,
6941        fdomain_client::fidl::FDomainResourceDialect,
6942    >;
6943    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
6944        fn _decode(
6945            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6946        ) -> Result<WritableWriteResult, fidl::Error> {
6947            let _response = fidl::client::decode_transaction_body::<
6948                fidl::encoding::ResultType<WritableWriteResponse, i32>,
6949                fdomain_client::fidl::FDomainResourceDialect,
6950                0x6a31437832469f82,
6951            >(_buf?)?;
6952            Ok(_response.map(|x| x.actual_count))
6953        }
6954        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
6955            (data,),
6956            0x6a31437832469f82,
6957            fidl::encoding::DynamicFlags::empty(),
6958            _decode,
6959        )
6960    }
6961
6962    type DescribeResponseFut =
6963        fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>;
6964    fn r#describe(&self) -> Self::DescribeResponseFut {
6965        fn _decode(
6966            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6967        ) -> Result<FileInfo, fidl::Error> {
6968            let _response = fidl::client::decode_transaction_body::<
6969                FileInfo,
6970                fdomain_client::fidl::FDomainResourceDialect,
6971                0x68b5ac00c62906bc,
6972            >(_buf?)?;
6973            Ok(_response)
6974        }
6975        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
6976            (),
6977            0x68b5ac00c62906bc,
6978            fidl::encoding::DynamicFlags::empty(),
6979            _decode,
6980        )
6981    }
6982
6983    type SeekResponseFut = fidl::client::QueryResponseFut<
6984        FileSeekResult,
6985        fdomain_client::fidl::FDomainResourceDialect,
6986    >;
6987    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
6988        fn _decode(
6989            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6990        ) -> Result<FileSeekResult, fidl::Error> {
6991            let _response = fidl::client::decode_transaction_body::<
6992                fidl::encoding::ResultType<FileSeekResponse, i32>,
6993                fdomain_client::fidl::FDomainResourceDialect,
6994                0x78079168162c5207,
6995            >(_buf?)?;
6996            Ok(_response.map(|x| x.offset_from_start))
6997        }
6998        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
6999            (origin, offset),
7000            0x78079168162c5207,
7001            fidl::encoding::DynamicFlags::empty(),
7002            _decode,
7003        )
7004    }
7005
7006    type ReadAtResponseFut = fidl::client::QueryResponseFut<
7007        FileReadAtResult,
7008        fdomain_client::fidl::FDomainResourceDialect,
7009    >;
7010    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
7011        fn _decode(
7012            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7013        ) -> Result<FileReadAtResult, fidl::Error> {
7014            let _response = fidl::client::decode_transaction_body::<
7015                fidl::encoding::ResultType<FileReadAtResponse, i32>,
7016                fdomain_client::fidl::FDomainResourceDialect,
7017                0x1607a293a60d723e,
7018            >(_buf?)?;
7019            Ok(_response.map(|x| x.data))
7020        }
7021        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
7022            (count, offset),
7023            0x1607a293a60d723e,
7024            fidl::encoding::DynamicFlags::empty(),
7025            _decode,
7026        )
7027    }
7028
7029    type WriteAtResponseFut = fidl::client::QueryResponseFut<
7030        FileWriteAtResult,
7031        fdomain_client::fidl::FDomainResourceDialect,
7032    >;
7033    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
7034        fn _decode(
7035            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7036        ) -> Result<FileWriteAtResult, fidl::Error> {
7037            let _response = fidl::client::decode_transaction_body::<
7038                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7039                fdomain_client::fidl::FDomainResourceDialect,
7040                0x793eefc0045e792b,
7041            >(_buf?)?;
7042            Ok(_response.map(|x| x.actual_count))
7043        }
7044        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
7045            (data, offset),
7046            0x793eefc0045e792b,
7047            fidl::encoding::DynamicFlags::empty(),
7048            _decode,
7049        )
7050    }
7051
7052    type ResizeResponseFut = fidl::client::QueryResponseFut<
7053        FileResizeResult,
7054        fdomain_client::fidl::FDomainResourceDialect,
7055    >;
7056    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
7057        fn _decode(
7058            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7059        ) -> Result<FileResizeResult, fidl::Error> {
7060            let _response = fidl::client::decode_transaction_body::<
7061                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7062                fdomain_client::fidl::FDomainResourceDialect,
7063                0x2b80825f0535743a,
7064            >(_buf?)?;
7065            Ok(_response.map(|x| x))
7066        }
7067        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
7068            (length,),
7069            0x2b80825f0535743a,
7070            fidl::encoding::DynamicFlags::empty(),
7071            _decode,
7072        )
7073    }
7074
7075    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
7076        FileGetBackingMemoryResult,
7077        fdomain_client::fidl::FDomainResourceDialect,
7078    >;
7079    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
7080        fn _decode(
7081            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7082        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7083            let _response = fidl::client::decode_transaction_body::<
7084                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7085                fdomain_client::fidl::FDomainResourceDialect,
7086                0xa6a9e654cbf62b,
7087            >(_buf?)?;
7088            Ok(_response.map(|x| x.vmo))
7089        }
7090        self.client
7091            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
7092                (flags,),
7093                0xa6a9e654cbf62b,
7094                fidl::encoding::DynamicFlags::empty(),
7095                _decode,
7096            )
7097    }
7098
7099    type AllocateResponseFut = fidl::client::QueryResponseFut<
7100        FileAllocateResult,
7101        fdomain_client::fidl::FDomainResourceDialect,
7102    >;
7103    fn r#allocate(
7104        &self,
7105        mut offset: u64,
7106        mut length: u64,
7107        mut mode: AllocateMode,
7108    ) -> Self::AllocateResponseFut {
7109        fn _decode(
7110            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7111        ) -> Result<FileAllocateResult, fidl::Error> {
7112            let _response = fidl::client::decode_transaction_body::<
7113                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7114                fdomain_client::fidl::FDomainResourceDialect,
7115                0x77fa0c330b57fd2e,
7116            >(_buf?)?
7117            .into_result_fdomain::<FileMarker>("allocate")?;
7118            Ok(_response.map(|x| x))
7119        }
7120        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
7121            (offset, length, mode),
7122            0x77fa0c330b57fd2e,
7123            fidl::encoding::DynamicFlags::FLEXIBLE,
7124            _decode,
7125        )
7126    }
7127
7128    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
7129        FileEnableVerityResult,
7130        fdomain_client::fidl::FDomainResourceDialect,
7131    >;
7132    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
7133        fn _decode(
7134            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7135        ) -> Result<FileEnableVerityResult, fidl::Error> {
7136            let _response = fidl::client::decode_transaction_body::<
7137                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7138                fdomain_client::fidl::FDomainResourceDialect,
7139                0x2c421ec3faaeb8bb,
7140            >(_buf?)?
7141            .into_result_fdomain::<FileMarker>("enable_verity")?;
7142            Ok(_response.map(|x| x))
7143        }
7144        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
7145            (options,),
7146            0x2c421ec3faaeb8bb,
7147            fidl::encoding::DynamicFlags::FLEXIBLE,
7148            _decode,
7149        )
7150    }
7151}
7152
7153pub struct FileEventStream {
7154    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7155}
7156
7157impl std::marker::Unpin for FileEventStream {}
7158
7159impl futures::stream::FusedStream for FileEventStream {
7160    fn is_terminated(&self) -> bool {
7161        self.event_receiver.is_terminated()
7162    }
7163}
7164
7165impl futures::Stream for FileEventStream {
7166    type Item = Result<FileEvent, fidl::Error>;
7167
7168    fn poll_next(
7169        mut self: std::pin::Pin<&mut Self>,
7170        cx: &mut std::task::Context<'_>,
7171    ) -> std::task::Poll<Option<Self::Item>> {
7172        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7173            &mut self.event_receiver,
7174            cx
7175        )?) {
7176            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
7177            None => std::task::Poll::Ready(None),
7178        }
7179    }
7180}
7181
7182#[derive(Debug)]
7183pub enum FileEvent {
7184    OnOpen_ {
7185        s: i32,
7186        info: Option<Box<NodeInfoDeprecated>>,
7187    },
7188    OnRepresentation {
7189        payload: Representation,
7190    },
7191    #[non_exhaustive]
7192    _UnknownEvent {
7193        /// Ordinal of the event that was sent.
7194        ordinal: u64,
7195    },
7196}
7197
7198impl FileEvent {
7199    #[allow(irrefutable_let_patterns)]
7200    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
7201        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
7202    }
7203    #[allow(irrefutable_let_patterns)]
7204    pub fn into_on_representation(self) -> Option<Representation> {
7205        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
7206    }
7207
7208    /// Decodes a message buffer as a [`FileEvent`].
7209    fn decode(
7210        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7211    ) -> Result<FileEvent, fidl::Error> {
7212        let (bytes, _handles) = buf.split_mut();
7213        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7214        debug_assert_eq!(tx_header.tx_id, 0);
7215        match tx_header.ordinal {
7216            0x7fc7bbb1dbfd1972 => {
7217                let mut out = fidl::new_empty!(
7218                    NodeOnOpenRequest,
7219                    fdomain_client::fidl::FDomainResourceDialect
7220                );
7221                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
7222                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
7223            }
7224            0x5cb40567d80a510c => {
7225                let mut out =
7226                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
7227                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
7228                Ok((FileEvent::OnRepresentation { payload: out }))
7229            }
7230            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7231                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7232            }
7233            _ => Err(fidl::Error::UnknownOrdinal {
7234                ordinal: tx_header.ordinal,
7235                protocol_name: <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7236            }),
7237        }
7238    }
7239}
7240
7241/// A Stream of incoming requests for fuchsia.io/File.
7242pub struct FileRequestStream {
7243    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7244    is_terminated: bool,
7245}
7246
7247impl std::marker::Unpin for FileRequestStream {}
7248
7249impl futures::stream::FusedStream for FileRequestStream {
7250    fn is_terminated(&self) -> bool {
7251        self.is_terminated
7252    }
7253}
7254
7255impl fdomain_client::fidl::RequestStream for FileRequestStream {
7256    type Protocol = FileMarker;
7257    type ControlHandle = FileControlHandle;
7258
7259    fn from_channel(channel: fdomain_client::Channel) -> Self {
7260        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7261    }
7262
7263    fn control_handle(&self) -> Self::ControlHandle {
7264        FileControlHandle { inner: self.inner.clone() }
7265    }
7266
7267    fn into_inner(
7268        self,
7269    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7270    {
7271        (self.inner, self.is_terminated)
7272    }
7273
7274    fn from_inner(
7275        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7276        is_terminated: bool,
7277    ) -> Self {
7278        Self { inner, is_terminated }
7279    }
7280}
7281
7282impl futures::Stream for FileRequestStream {
7283    type Item = Result<FileRequest, fidl::Error>;
7284
7285    fn poll_next(
7286        mut self: std::pin::Pin<&mut Self>,
7287        cx: &mut std::task::Context<'_>,
7288    ) -> std::task::Poll<Option<Self::Item>> {
7289        let this = &mut *self;
7290        if this.inner.check_shutdown(cx) {
7291            this.is_terminated = true;
7292            return std::task::Poll::Ready(None);
7293        }
7294        if this.is_terminated {
7295            panic!("polled FileRequestStream after completion");
7296        }
7297        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7298            |bytes, handles| {
7299                match this.inner.channel().read_etc(cx, bytes, handles) {
7300                    std::task::Poll::Ready(Ok(())) => {}
7301                    std::task::Poll::Pending => return std::task::Poll::Pending,
7302                    std::task::Poll::Ready(Err(None)) => {
7303                        this.is_terminated = true;
7304                        return std::task::Poll::Ready(None);
7305                    }
7306                    std::task::Poll::Ready(Err(Some(e))) => {
7307                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7308                            e.into(),
7309                        ))));
7310                    }
7311                }
7312
7313                // A message has been received from the channel
7314                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7315
7316                std::task::Poll::Ready(Some(match header.ordinal {
7317                    0x6ee9c0ad53ec87aa => {
7318                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7319                        let mut req = fidl::new_empty!(
7320                            AdvisoryLockingAdvisoryLockRequest,
7321                            fdomain_client::fidl::FDomainResourceDialect
7322                        );
7323                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
7324                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7325                        Ok(FileRequest::AdvisoryLock {
7326                            request: req.request,
7327
7328                            responder: FileAdvisoryLockResponder {
7329                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7330                                tx_id: header.tx_id,
7331                            },
7332                        })
7333                    }
7334                    0x54f3949246a03e74 => {
7335                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7336                        let mut req = fidl::new_empty!(
7337                            LinkableLinkIntoRequest,
7338                            fdomain_client::fidl::FDomainResourceDialect
7339                        );
7340                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
7341                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7342                        Ok(FileRequest::LinkInto {
7343                            dst_parent_token: req.dst_parent_token,
7344                            dst: req.dst,
7345
7346                            responder: FileLinkIntoResponder {
7347                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7348                                tx_id: header.tx_id,
7349                            },
7350                        })
7351                    }
7352                    0x20d8a7aba2168a79 => {
7353                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7354                        let mut req = fidl::new_empty!(
7355                            fdomain_fuchsia_unknown::CloneableCloneRequest,
7356                            fdomain_client::fidl::FDomainResourceDialect
7357                        );
7358                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7359                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7360                        Ok(FileRequest::Clone { request: req.request, control_handle })
7361                    }
7362                    0x5ac5d459ad7f657e => {
7363                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7364                        let mut req = fidl::new_empty!(
7365                            fidl::encoding::EmptyPayload,
7366                            fdomain_client::fidl::FDomainResourceDialect
7367                        );
7368                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7369                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7370                        Ok(FileRequest::Close {
7371                            responder: FileCloseResponder {
7372                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7373                                tx_id: header.tx_id,
7374                            },
7375                        })
7376                    }
7377                    0x2658edee9decfc06 => {
7378                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7379                        let mut req = fidl::new_empty!(
7380                            fidl::encoding::EmptyPayload,
7381                            fdomain_client::fidl::FDomainResourceDialect
7382                        );
7383                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7384                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7385                        Ok(FileRequest::Query {
7386                            responder: FileQueryResponder {
7387                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7388                                tx_id: header.tx_id,
7389                            },
7390                        })
7391                    }
7392                    0x5a61678f293ce16f => {
7393                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7394                        let mut req = fidl::new_empty!(
7395                            NodeDeprecatedCloneRequest,
7396                            fdomain_client::fidl::FDomainResourceDialect
7397                        );
7398                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7399                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7400                        Ok(FileRequest::DeprecatedClone {
7401                            flags: req.flags,
7402                            object: req.object,
7403
7404                            control_handle,
7405                        })
7406                    }
7407                    0x78985e216314dafd => {
7408                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7409                        let mut req = fidl::new_empty!(
7410                            fidl::encoding::EmptyPayload,
7411                            fdomain_client::fidl::FDomainResourceDialect
7412                        );
7413                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7414                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7415                        Ok(FileRequest::DeprecatedGetAttr {
7416                            responder: FileDeprecatedGetAttrResponder {
7417                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7418                                tx_id: header.tx_id,
7419                            },
7420                        })
7421                    }
7422                    0x4186c0f40d938f46 => {
7423                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7424                        let mut req = fidl::new_empty!(
7425                            NodeDeprecatedSetAttrRequest,
7426                            fdomain_client::fidl::FDomainResourceDialect
7427                        );
7428                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
7429                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7430                        Ok(FileRequest::DeprecatedSetAttr {
7431                            flags: req.flags,
7432                            attributes: req.attributes,
7433
7434                            responder: FileDeprecatedSetAttrResponder {
7435                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7436                                tx_id: header.tx_id,
7437                            },
7438                        })
7439                    }
7440                    0x5b88fffb8eda3aa1 => {
7441                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7442                        let mut req = fidl::new_empty!(
7443                            fidl::encoding::EmptyPayload,
7444                            fdomain_client::fidl::FDomainResourceDialect
7445                        );
7446                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7447                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7448                        Ok(FileRequest::DeprecatedGetFlags {
7449                            responder: FileDeprecatedGetFlagsResponder {
7450                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7451                                tx_id: header.tx_id,
7452                            },
7453                        })
7454                    }
7455                    0x5295b76c71fde733 => {
7456                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7457                        let mut req = fidl::new_empty!(
7458                            NodeDeprecatedSetFlagsRequest,
7459                            fdomain_client::fidl::FDomainResourceDialect
7460                        );
7461                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7462                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7463                        Ok(FileRequest::DeprecatedSetFlags {
7464                            flags: req.flags,
7465
7466                            responder: FileDeprecatedSetFlagsResponder {
7467                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7468                                tx_id: header.tx_id,
7469                            },
7470                        })
7471                    }
7472                    0x176eb318f64ec23 => {
7473                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7474                        let mut req = fidl::new_empty!(
7475                            fidl::encoding::EmptyPayload,
7476                            fdomain_client::fidl::FDomainResourceDialect
7477                        );
7478                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7479                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7480                        Ok(FileRequest::GetFlags {
7481                            responder: FileGetFlagsResponder {
7482                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7483                                tx_id: header.tx_id,
7484                            },
7485                        })
7486                    }
7487                    0x55a8028685791ea8 => {
7488                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7489                        let mut req = fidl::new_empty!(
7490                            NodeSetFlagsRequest,
7491                            fdomain_client::fidl::FDomainResourceDialect
7492                        );
7493                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7494                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7495                        Ok(FileRequest::SetFlags {
7496                            flags: req.flags,
7497
7498                            responder: FileSetFlagsResponder {
7499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7500                                tx_id: header.tx_id,
7501                            },
7502                        })
7503                    }
7504                    0x6f344a1c6b0a0610 => {
7505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7506                        let mut req = fidl::new_empty!(
7507                            fidl::encoding::EmptyPayload,
7508                            fdomain_client::fidl::FDomainResourceDialect
7509                        );
7510                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7511                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7512                        Ok(FileRequest::QueryFilesystem {
7513                            responder: FileQueryFilesystemResponder {
7514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7515                                tx_id: header.tx_id,
7516                            },
7517                        })
7518                    }
7519                    0x3d4396a638ea053b => {
7520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7521                        let mut req = fidl::new_empty!(
7522                            NodeGetAttributesRequest,
7523                            fdomain_client::fidl::FDomainResourceDialect
7524                        );
7525                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7526                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7527                        Ok(FileRequest::GetAttributes {
7528                            query: req.query,
7529
7530                            responder: FileGetAttributesResponder {
7531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7532                                tx_id: header.tx_id,
7533                            },
7534                        })
7535                    }
7536                    0x3308c1da5a89bf08 => {
7537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7538                        let mut req = fidl::new_empty!(
7539                            MutableNodeAttributes,
7540                            fdomain_client::fidl::FDomainResourceDialect
7541                        );
7542                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
7543                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7544                        Ok(FileRequest::UpdateAttributes {
7545                            payload: req,
7546                            responder: FileUpdateAttributesResponder {
7547                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7548                                tx_id: header.tx_id,
7549                            },
7550                        })
7551                    }
7552                    0x2c5c27ca0ab5dc49 => {
7553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7554                        let mut req = fidl::new_empty!(
7555                            fidl::encoding::EmptyPayload,
7556                            fdomain_client::fidl::FDomainResourceDialect
7557                        );
7558                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7559                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7560                        Ok(FileRequest::Sync {
7561                            responder: FileSyncResponder {
7562                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7563                                tx_id: header.tx_id,
7564                            },
7565                        })
7566                    }
7567                    0x4b61033de007fcd0 => {
7568                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7569                        let mut req = fidl::new_empty!(
7570                            NodeListExtendedAttributesRequest,
7571                            fdomain_client::fidl::FDomainResourceDialect
7572                        );
7573                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7574                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7575                        Ok(FileRequest::ListExtendedAttributes {
7576                            iterator: req.iterator,
7577
7578                            control_handle,
7579                        })
7580                    }
7581                    0x45ffa3ccfdeb76db => {
7582                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7583                        let mut req = fidl::new_empty!(
7584                            NodeGetExtendedAttributeRequest,
7585                            fdomain_client::fidl::FDomainResourceDialect
7586                        );
7587                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7588                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7589                        Ok(FileRequest::GetExtendedAttribute {
7590                            name: req.name,
7591
7592                            responder: FileGetExtendedAttributeResponder {
7593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7594                                tx_id: header.tx_id,
7595                            },
7596                        })
7597                    }
7598                    0x4a951362f681f23c => {
7599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7600                        let mut req = fidl::new_empty!(
7601                            NodeSetExtendedAttributeRequest,
7602                            fdomain_client::fidl::FDomainResourceDialect
7603                        );
7604                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7605                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7606                        Ok(FileRequest::SetExtendedAttribute {
7607                            name: req.name,
7608                            value: req.value,
7609                            mode: req.mode,
7610
7611                            responder: FileSetExtendedAttributeResponder {
7612                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7613                                tx_id: header.tx_id,
7614                            },
7615                        })
7616                    }
7617                    0x7a0b9f3a9bf9032d => {
7618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7619                        let mut req = fidl::new_empty!(
7620                            NodeRemoveExtendedAttributeRequest,
7621                            fdomain_client::fidl::FDomainResourceDialect
7622                        );
7623                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7624                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7625                        Ok(FileRequest::RemoveExtendedAttribute {
7626                            name: req.name,
7627
7628                            responder: FileRemoveExtendedAttributeResponder {
7629                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7630                                tx_id: header.tx_id,
7631                            },
7632                        })
7633                    }
7634                    0x57e419a298c8ede => {
7635                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7636                        let mut req = fidl::new_empty!(
7637                            ReadableReadRequest,
7638                            fdomain_client::fidl::FDomainResourceDialect
7639                        );
7640                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
7641                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7642                        Ok(FileRequest::Read {
7643                            count: req.count,
7644
7645                            responder: FileReadResponder {
7646                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7647                                tx_id: header.tx_id,
7648                            },
7649                        })
7650                    }
7651                    0x6a31437832469f82 => {
7652                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7653                        let mut req = fidl::new_empty!(
7654                            WritableWriteRequest,
7655                            fdomain_client::fidl::FDomainResourceDialect
7656                        );
7657                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
7658                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7659                        Ok(FileRequest::Write {
7660                            data: req.data,
7661
7662                            responder: FileWriteResponder {
7663                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7664                                tx_id: header.tx_id,
7665                            },
7666                        })
7667                    }
7668                    0x68b5ac00c62906bc => {
7669                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7670                        let mut req = fidl::new_empty!(
7671                            fidl::encoding::EmptyPayload,
7672                            fdomain_client::fidl::FDomainResourceDialect
7673                        );
7674                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7675                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7676                        Ok(FileRequest::Describe {
7677                            responder: FileDescribeResponder {
7678                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7679                                tx_id: header.tx_id,
7680                            },
7681                        })
7682                    }
7683                    0x78079168162c5207 => {
7684                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7685                        let mut req = fidl::new_empty!(
7686                            FileSeekRequest,
7687                            fdomain_client::fidl::FDomainResourceDialect
7688                        );
7689                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
7690                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7691                        Ok(FileRequest::Seek {
7692                            origin: req.origin,
7693                            offset: req.offset,
7694
7695                            responder: FileSeekResponder {
7696                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7697                                tx_id: header.tx_id,
7698                            },
7699                        })
7700                    }
7701                    0x1607a293a60d723e => {
7702                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7703                        let mut req = fidl::new_empty!(
7704                            FileReadAtRequest,
7705                            fdomain_client::fidl::FDomainResourceDialect
7706                        );
7707                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
7708                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7709                        Ok(FileRequest::ReadAt {
7710                            count: req.count,
7711                            offset: req.offset,
7712
7713                            responder: FileReadAtResponder {
7714                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7715                                tx_id: header.tx_id,
7716                            },
7717                        })
7718                    }
7719                    0x793eefc0045e792b => {
7720                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7721                        let mut req = fidl::new_empty!(
7722                            FileWriteAtRequest,
7723                            fdomain_client::fidl::FDomainResourceDialect
7724                        );
7725                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
7726                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7727                        Ok(FileRequest::WriteAt {
7728                            data: req.data,
7729                            offset: req.offset,
7730
7731                            responder: FileWriteAtResponder {
7732                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7733                                tx_id: header.tx_id,
7734                            },
7735                        })
7736                    }
7737                    0x2b80825f0535743a => {
7738                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7739                        let mut req = fidl::new_empty!(
7740                            FileResizeRequest,
7741                            fdomain_client::fidl::FDomainResourceDialect
7742                        );
7743                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
7744                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7745                        Ok(FileRequest::Resize {
7746                            length: req.length,
7747
7748                            responder: FileResizeResponder {
7749                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7750                                tx_id: header.tx_id,
7751                            },
7752                        })
7753                    }
7754                    0xa6a9e654cbf62b => {
7755                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7756                        let mut req = fidl::new_empty!(
7757                            FileGetBackingMemoryRequest,
7758                            fdomain_client::fidl::FDomainResourceDialect
7759                        );
7760                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
7761                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7762                        Ok(FileRequest::GetBackingMemory {
7763                            flags: req.flags,
7764
7765                            responder: FileGetBackingMemoryResponder {
7766                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7767                                tx_id: header.tx_id,
7768                            },
7769                        })
7770                    }
7771                    0x77fa0c330b57fd2e => {
7772                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7773                        let mut req = fidl::new_empty!(
7774                            FileAllocateRequest,
7775                            fdomain_client::fidl::FDomainResourceDialect
7776                        );
7777                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
7778                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7779                        Ok(FileRequest::Allocate {
7780                            offset: req.offset,
7781                            length: req.length,
7782                            mode: req.mode,
7783
7784                            responder: FileAllocateResponder {
7785                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7786                                tx_id: header.tx_id,
7787                            },
7788                        })
7789                    }
7790                    0x2c421ec3faaeb8bb => {
7791                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7792                        let mut req = fidl::new_empty!(
7793                            FileEnableVerityRequest,
7794                            fdomain_client::fidl::FDomainResourceDialect
7795                        );
7796                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
7797                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7798                        Ok(FileRequest::EnableVerity {
7799                            options: req.options,
7800
7801                            responder: FileEnableVerityResponder {
7802                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7803                                tx_id: header.tx_id,
7804                            },
7805                        })
7806                    }
7807                    _ if header.tx_id == 0
7808                        && header
7809                            .dynamic_flags()
7810                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7811                    {
7812                        Ok(FileRequest::_UnknownMethod {
7813                            ordinal: header.ordinal,
7814                            control_handle: FileControlHandle { inner: this.inner.clone() },
7815                            method_type: fidl::MethodType::OneWay,
7816                        })
7817                    }
7818                    _ if header
7819                        .dynamic_flags()
7820                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7821                    {
7822                        this.inner.send_framework_err(
7823                            fidl::encoding::FrameworkErr::UnknownMethod,
7824                            header.tx_id,
7825                            header.ordinal,
7826                            header.dynamic_flags(),
7827                            (bytes, handles),
7828                        )?;
7829                        Ok(FileRequest::_UnknownMethod {
7830                            ordinal: header.ordinal,
7831                            control_handle: FileControlHandle { inner: this.inner.clone() },
7832                            method_type: fidl::MethodType::TwoWay,
7833                        })
7834                    }
7835                    _ => Err(fidl::Error::UnknownOrdinal {
7836                        ordinal: header.ordinal,
7837                        protocol_name:
7838                            <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7839                    }),
7840                }))
7841            },
7842        )
7843    }
7844}
7845
7846/// A [`Node`] which contains a sequence of bytes of definite length.
7847///
7848/// NOTE: cloned connections do not share their seek offset with their source
7849/// connection.
7850#[derive(Debug)]
7851pub enum FileRequest {
7852    /// Acquires an advisory lock on the underlying file.
7853    ///
7854    /// The lock lasts until either this connection is closed or
7855    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7856    /// explicitly.
7857    ///
7858    /// Advisory locks are purely advisory. They do not prevent actual read or
7859    /// write operations from occurring on the file, either through this
7860    /// connection or through other connections.
7861    ///
7862    /// This method requires the following rights:
7863    ///
7864    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7865    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7866    ///   [`AdvisoryLockType.WRITE`].
7867    ///
7868    /// # Errors
7869    ///
7870    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7871    ///   example, another connection might hold a conflicting lock type.
7872    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7873    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7874    ///   to acquire the given type of lock.
7875    AdvisoryLock {
7876        request: AdvisoryLockRequest,
7877        responder: FileAdvisoryLockResponder,
7878    },
7879    /// Creates a link to this this object with name `dst` in the directory represented by
7880    /// `dst_parent_token`.
7881    ///
7882    /// `dst` must be a resolved object name. Including "/" in the string will return
7883    /// `ZX_ERR_INVALID_ARGS`.
7884    ///
7885    /// This method requires the maximal set of rights supported by the filesystem for this object.
7886    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7887    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7888    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7889    /// `ZX_ERR_ACCESS_DENIED`.
7890    ///
7891    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7892    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7893    ///
7894    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7895    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7896    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7897    ///
7898    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7899    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7900    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7901    LinkInto {
7902        dst_parent_token: fdomain_client::Event,
7903        dst: String,
7904        responder: FileLinkIntoResponder,
7905    },
7906    Clone {
7907        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
7908        control_handle: FileControlHandle,
7909    },
7910    /// Terminates the connection.
7911    ///
7912    /// After calling `Close`, the client must not send any other requests.
7913    ///
7914    /// Servers, after sending the status response, should close the connection
7915    /// regardless of status and without sending an epitaph.
7916    ///
7917    /// Closing the client end of the channel should be semantically equivalent
7918    /// to calling `Close` without knowing when the close has completed or its
7919    /// status.
7920    Close {
7921        responder: FileCloseResponder,
7922    },
7923    Query {
7924        responder: FileQueryResponder,
7925    },
7926    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7927    DeprecatedClone {
7928        flags: OpenFlags,
7929        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
7930        control_handle: FileControlHandle,
7931    },
7932    /// DEPRECATED - Use `Node.GetAttributes` instead.
7933    DeprecatedGetAttr {
7934        responder: FileDeprecatedGetAttrResponder,
7935    },
7936    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7937    DeprecatedSetAttr {
7938        flags: NodeAttributeFlags,
7939        attributes: NodeAttributes,
7940        responder: FileDeprecatedSetAttrResponder,
7941    },
7942    /// [DEPRECATED - Use new GetFlags method instead.]
7943    DeprecatedGetFlags {
7944        responder: FileDeprecatedGetFlagsResponder,
7945    },
7946    /// [DEPRECATED - Use new SetFlags method instead.]
7947    DeprecatedSetFlags {
7948        flags: OpenFlags,
7949        responder: FileDeprecatedSetFlagsResponder,
7950    },
7951    /// Queries the flags that apply to this node after it has been opened/created. This method does
7952    /// not require any rights.
7953    ///
7954    /// Note that the final set of flags that apply to the connection may differ from those
7955    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7956    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7957    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7958    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7959    GetFlags {
7960        responder: FileGetFlagsResponder,
7961    },
7962    /// Sets the flags that apply to this node after it has been opened. This method does not
7963    /// require any rights.
7964    ///
7965    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7966    /// clear append mode.
7967    ///
7968    /// Errors:
7969    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7970    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7971    SetFlags {
7972        flags: Flags,
7973        responder: FileSetFlagsResponder,
7974    },
7975    /// Query the filesystem for filesystem-specific information.
7976    QueryFilesystem {
7977        responder: FileQueryFilesystemResponder,
7978    },
7979    /// Acquires information about the node.
7980    ///
7981    /// The attributes of a node should be stable, independent of the
7982    /// specific protocol used to access it.
7983    ///
7984    /// If a particular attribute is not applicable or not supported,
7985    /// filesystems should leave the corresponding field absent.
7986    ///
7987    /// + `query` a bit-mask specifying which attributes to fetch. The server
7988    ///   should not return more than necessary.
7989    /// - `attributes` the returned attributes.
7990    ///
7991    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7992    GetAttributes {
7993        query: NodeAttributesQuery,
7994        responder: FileGetAttributesResponder,
7995    },
7996    /// Updates information about the node.
7997    ///
7998    /// + `attributes` the presence of a table field in `attributes` indicates
7999    /// the intent to update the corresponding attribute.
8000    ///
8001    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8002    ///
8003    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8004    UpdateAttributes {
8005        payload: MutableNodeAttributes,
8006        responder: FileUpdateAttributesResponder,
8007    },
8008    /// Synchronizes updates to the node to the underlying media, if it exists.
8009    ///
8010    /// This method will return when the filesystem server has flushed the
8011    /// relevant updates to the underlying media, but does not guarantee the
8012    /// underlying media has persisted the information, nor that any information
8013    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8014    /// between operations.
8015    ///
8016    /// This method does not require any rights.
8017    Sync {
8018        responder: FileSyncResponder,
8019    },
8020    /// Creates an iterator over all the extended attribute names associated
8021    /// with this node. If an error occurs it is returned as an epitaph on the
8022    /// iterator request channel, and then the channel is closed.
8023    ///
8024    /// GetExtendedAttributes can be used with any of these names to retrieve
8025    /// the associated value.
8026    ///
8027    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8028    ListExtendedAttributes {
8029        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
8030        control_handle: FileControlHandle,
8031    },
8032    /// Get the value associated with the given attribute `name` for this node.
8033    ///
8034    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8035    /// particular structure is imposed on them.
8036    ///
8037    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8038    GetExtendedAttribute {
8039        name: Vec<u8>,
8040        responder: FileGetExtendedAttributeResponder,
8041    },
8042    /// Set the value for the given attribute `name` to `value` for this node.
8043    ///
8044    /// The attribute name may exist, in which case the attribute is updated.
8045    /// If the attribute doesn't exist, it is created. The name should have no
8046    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8047    ///
8048    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8049    SetExtendedAttribute {
8050        name: Vec<u8>,
8051        value: ExtendedAttributeValue,
8052        mode: SetExtendedAttributeMode,
8053        responder: FileSetExtendedAttributeResponder,
8054    },
8055    /// Remove the specified extended attribute.
8056    ///
8057    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8058    ///
8059    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8060    RemoveExtendedAttribute {
8061        name: Vec<u8>,
8062        responder: FileRemoveExtendedAttributeResponder,
8063    },
8064    /// Reads up to 'count' bytes at the seek offset.
8065    /// The seek offset is moved forward by the number of bytes read.
8066    ///
8067    /// ## Invariants
8068    ///
8069    /// * The returned `data.length` will never be greater than `count`.
8070    /// * If `data.length` is less than `count`, it means that the seek offset
8071    ///   has reached the end of file as part of this operation.
8072    /// * If `data.length` is zero while `count` is not, it means that the
8073    ///   seek offset is already at or beyond the end of file, and no data could
8074    ///   be read.
8075    /// * If `count` is zero, the server should perform all the checks ensuring
8076    ///   read access without actually read anything, and return an empty
8077    ///   `data` vector.
8078    ///
8079    /// This method requires the [`Rights.READ_BYTES`] right.
8080    ///
8081    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8082    Read {
8083        count: u64,
8084        responder: FileReadResponder,
8085    },
8086    /// Writes data at the seek offset.
8087    /// The seek offset is moved forward by the number of bytes written.
8088    /// If the file is in append mode, the seek offset is first set to the end
8089    /// of the file, followed by the write, in one atomic step.
8090    ///
8091    /// The file size may grow if the seek offset plus `data.length` is beyond
8092    /// the current end of file.
8093    ///
8094    /// + request `data` the byte buffer to write to the file.
8095    /// - response `actual_count` the number of bytes written.
8096    ///
8097    /// ## Invariants
8098    ///
8099    /// * The returned `actual_count` will never be greater than `data.length`.
8100    /// * If the server is unable to write all the data due to e.g. not enough
8101    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8102    ///   could be written, an error is returned.
8103    /// * If `data.length` is zero, the server should perform all the checks
8104    ///   ensuring write access without mutating the file and return a
8105    ///   successful write of zero bytes.  The seek offset is still updated if
8106    ///   in append mode.
8107    ///
8108    /// This method requires the [`Rights.WRITE_BYTES`] right.
8109    Write {
8110        data: Vec<u8>,
8111        responder: FileWriteResponder,
8112    },
8113    Describe {
8114        responder: FileDescribeResponder,
8115    },
8116    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8117    /// will occur. The seek offset is specific to each file connection.
8118    ///
8119    /// + request `origin` the reference point where `offset` will be based on.
8120    /// + request `offset` the number of bytes to seek.
8121    /// - response `offset_from_start` the adjusted seek offset, from the start
8122    ///   of the file.
8123    ///
8124    /// This method does not require any rights.
8125    Seek {
8126        origin: SeekOrigin,
8127        offset: i64,
8128        responder: FileSeekResponder,
8129    },
8130    /// Reads up to 'count' bytes at the provided offset.
8131    /// Does not affect the seek offset.
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 `ReadAt` has hit
8137    ///   the end of file as part of this operation.
8138    /// * If `data.length` is zero while `count` is not, it means that `offset`
8139    ///   is at or past the end of file, and no data can be read.
8140    /// * If `count` is zero, the server should perform all the checks ensuring
8141    ///   read access without actually reading anything, and return an empty
8142    ///   `data` vector.
8143    ///
8144    /// This method requires the [`Rights.READ_BYTES`] right.
8145    ///
8146    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8147    ReadAt {
8148        count: u64,
8149        offset: u64,
8150        responder: FileReadAtResponder,
8151    },
8152    /// Writes data at the provided offset.
8153    /// Does not affect the seek offset.
8154    ///
8155    /// The file size may grow if `offset` plus `data.length` is past the
8156    /// current end of file.
8157    ///
8158    /// + request `data` the byte buffer to write to the file.
8159    /// + request `offset` the offset from start of the file to begin writing.
8160    /// - response `actual_count` the number of bytes written.
8161    ///
8162    /// ## Invariants
8163    ///
8164    /// * The returned `actual_count` will never be greater than `data.length`.
8165    /// * If the server is unable to write all the data due to e.g. not enough
8166    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8167    ///   could be written, an error is returned.
8168    /// * If `data.length` is zero, the server should perform all the checks
8169    ///   ensuring write access without mutating the file, and will return a
8170    ///   successful write of zero bytes.
8171    ///
8172    /// This method requires the [`Rights.WRITE_BYTES`] right.
8173    WriteAt {
8174        data: Vec<u8>,
8175        offset: u64,
8176        responder: FileWriteAtResponder,
8177    },
8178    /// Shrinks or grows the file size to 'length' bytes.
8179    ///
8180    /// If file size is reduced by this operation, the extra trailing data'
8181    /// is discarded.
8182    /// If file size is increased by this operation, the extended area appears
8183    /// as if it was zeroed.
8184    ///
8185    /// This method requires the [`Rights.WRITE_BYTES`] right.
8186    Resize {
8187        length: u64,
8188        responder: FileResizeResponder,
8189    },
8190    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8191    /// with the requested access rights.
8192    ///
8193    /// Implementations are not required to implement files backed by VMOs so
8194    /// this request may fail. Additionally, implementations may only support
8195    /// a certain subset of the flags. Clients should be prepared with fallback
8196    /// behavior if this request fails.
8197    ///
8198    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8199    /// implementation is free to choose the semantics of the returned VMO.
8200    ///
8201    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8202    /// - response `vmo` the requested [`zx.Handle:VMO`].
8203    /// * error a [`zx.Status`] value indicating the failure.
8204    ///
8205    /// This method requires the following rights:
8206    ///
8207    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8208    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8209    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8210    GetBackingMemory {
8211        flags: VmoFlags,
8212        responder: FileGetBackingMemoryResponder,
8213    },
8214    /// Pre-allocate on-disk space for this file.
8215    Allocate {
8216        offset: u64,
8217        length: u64,
8218        mode: AllocateMode,
8219        responder: FileAllocateResponder,
8220    },
8221    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8222    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8223    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8224    /// rejected. This method can take some time to complete as it depends on the size of the file.
8225    /// This method can be aborted by closing the connection that this method was issued on.
8226    ///
8227    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8228    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8229    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8230    /// Also returns any error that might arise from reading the file, or from flushing the file,
8231    /// such as `ZX_ERR_IO`.
8232    EnableVerity {
8233        options: VerificationOptions,
8234        responder: FileEnableVerityResponder,
8235    },
8236    /// An interaction was received which does not match any known method.
8237    #[non_exhaustive]
8238    _UnknownMethod {
8239        /// Ordinal of the method that was called.
8240        ordinal: u64,
8241        control_handle: FileControlHandle,
8242        method_type: fidl::MethodType,
8243    },
8244}
8245
8246impl FileRequest {
8247    #[allow(irrefutable_let_patterns)]
8248    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
8249        if let FileRequest::AdvisoryLock { request, responder } = self {
8250            Some((request, responder))
8251        } else {
8252            None
8253        }
8254    }
8255
8256    #[allow(irrefutable_let_patterns)]
8257    pub fn into_link_into(self) -> Option<(fdomain_client::Event, String, FileLinkIntoResponder)> {
8258        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
8259            Some((dst_parent_token, dst, responder))
8260        } else {
8261            None
8262        }
8263    }
8264
8265    #[allow(irrefutable_let_patterns)]
8266    pub fn into_clone(
8267        self,
8268    ) -> Option<(
8269        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8270        FileControlHandle,
8271    )> {
8272        if let FileRequest::Clone { request, control_handle } = self {
8273            Some((request, control_handle))
8274        } else {
8275            None
8276        }
8277    }
8278
8279    #[allow(irrefutable_let_patterns)]
8280    pub fn into_close(self) -> Option<(FileCloseResponder)> {
8281        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
8282    }
8283
8284    #[allow(irrefutable_let_patterns)]
8285    pub fn into_query(self) -> Option<(FileQueryResponder)> {
8286        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
8287    }
8288
8289    #[allow(irrefutable_let_patterns)]
8290    pub fn into_deprecated_clone(
8291        self,
8292    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, FileControlHandle)> {
8293        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
8294            Some((flags, object, control_handle))
8295        } else {
8296            None
8297        }
8298    }
8299
8300    #[allow(irrefutable_let_patterns)]
8301    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
8302        if let FileRequest::DeprecatedGetAttr { responder } = self {
8303            Some((responder))
8304        } else {
8305            None
8306        }
8307    }
8308
8309    #[allow(irrefutable_let_patterns)]
8310    pub fn into_deprecated_set_attr(
8311        self,
8312    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
8313        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
8314            Some((flags, attributes, responder))
8315        } else {
8316            None
8317        }
8318    }
8319
8320    #[allow(irrefutable_let_patterns)]
8321    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
8322        if let FileRequest::DeprecatedGetFlags { responder } = self {
8323            Some((responder))
8324        } else {
8325            None
8326        }
8327    }
8328
8329    #[allow(irrefutable_let_patterns)]
8330    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
8331        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
8332            Some((flags, responder))
8333        } else {
8334            None
8335        }
8336    }
8337
8338    #[allow(irrefutable_let_patterns)]
8339    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
8340        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
8341    }
8342
8343    #[allow(irrefutable_let_patterns)]
8344    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
8345        if let FileRequest::SetFlags { flags, responder } = self {
8346            Some((flags, responder))
8347        } else {
8348            None
8349        }
8350    }
8351
8352    #[allow(irrefutable_let_patterns)]
8353    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
8354        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
8355    }
8356
8357    #[allow(irrefutable_let_patterns)]
8358    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
8359        if let FileRequest::GetAttributes { query, responder } = self {
8360            Some((query, responder))
8361        } else {
8362            None
8363        }
8364    }
8365
8366    #[allow(irrefutable_let_patterns)]
8367    pub fn into_update_attributes(
8368        self,
8369    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
8370        if let FileRequest::UpdateAttributes { payload, responder } = self {
8371            Some((payload, responder))
8372        } else {
8373            None
8374        }
8375    }
8376
8377    #[allow(irrefutable_let_patterns)]
8378    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
8379        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
8380    }
8381
8382    #[allow(irrefutable_let_patterns)]
8383    pub fn into_list_extended_attributes(
8384        self,
8385    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
8386    {
8387        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
8388            Some((iterator, control_handle))
8389        } else {
8390            None
8391        }
8392    }
8393
8394    #[allow(irrefutable_let_patterns)]
8395    pub fn into_get_extended_attribute(
8396        self,
8397    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
8398        if let FileRequest::GetExtendedAttribute { name, responder } = self {
8399            Some((name, responder))
8400        } else {
8401            None
8402        }
8403    }
8404
8405    #[allow(irrefutable_let_patterns)]
8406    pub fn into_set_extended_attribute(
8407        self,
8408    ) -> Option<(
8409        Vec<u8>,
8410        ExtendedAttributeValue,
8411        SetExtendedAttributeMode,
8412        FileSetExtendedAttributeResponder,
8413    )> {
8414        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
8415            Some((name, value, mode, responder))
8416        } else {
8417            None
8418        }
8419    }
8420
8421    #[allow(irrefutable_let_patterns)]
8422    pub fn into_remove_extended_attribute(
8423        self,
8424    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
8425        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
8426            Some((name, responder))
8427        } else {
8428            None
8429        }
8430    }
8431
8432    #[allow(irrefutable_let_patterns)]
8433    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
8434        if let FileRequest::Read { count, responder } = self {
8435            Some((count, responder))
8436        } else {
8437            None
8438        }
8439    }
8440
8441    #[allow(irrefutable_let_patterns)]
8442    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
8443        if let FileRequest::Write { data, responder } = self {
8444            Some((data, responder))
8445        } else {
8446            None
8447        }
8448    }
8449
8450    #[allow(irrefutable_let_patterns)]
8451    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
8452        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
8453    }
8454
8455    #[allow(irrefutable_let_patterns)]
8456    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
8457        if let FileRequest::Seek { origin, offset, responder } = self {
8458            Some((origin, offset, responder))
8459        } else {
8460            None
8461        }
8462    }
8463
8464    #[allow(irrefutable_let_patterns)]
8465    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
8466        if let FileRequest::ReadAt { count, offset, responder } = self {
8467            Some((count, offset, responder))
8468        } else {
8469            None
8470        }
8471    }
8472
8473    #[allow(irrefutable_let_patterns)]
8474    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
8475        if let FileRequest::WriteAt { data, offset, responder } = self {
8476            Some((data, offset, responder))
8477        } else {
8478            None
8479        }
8480    }
8481
8482    #[allow(irrefutable_let_patterns)]
8483    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
8484        if let FileRequest::Resize { length, responder } = self {
8485            Some((length, responder))
8486        } else {
8487            None
8488        }
8489    }
8490
8491    #[allow(irrefutable_let_patterns)]
8492    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
8493        if let FileRequest::GetBackingMemory { flags, responder } = self {
8494            Some((flags, responder))
8495        } else {
8496            None
8497        }
8498    }
8499
8500    #[allow(irrefutable_let_patterns)]
8501    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
8502        if let FileRequest::Allocate { offset, length, mode, responder } = self {
8503            Some((offset, length, mode, responder))
8504        } else {
8505            None
8506        }
8507    }
8508
8509    #[allow(irrefutable_let_patterns)]
8510    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
8511        if let FileRequest::EnableVerity { options, responder } = self {
8512            Some((options, responder))
8513        } else {
8514            None
8515        }
8516    }
8517
8518    /// Name of the method defined in FIDL
8519    pub fn method_name(&self) -> &'static str {
8520        match *self {
8521            FileRequest::AdvisoryLock { .. } => "advisory_lock",
8522            FileRequest::LinkInto { .. } => "link_into",
8523            FileRequest::Clone { .. } => "clone",
8524            FileRequest::Close { .. } => "close",
8525            FileRequest::Query { .. } => "query",
8526            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
8527            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
8528            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
8529            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
8530            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
8531            FileRequest::GetFlags { .. } => "get_flags",
8532            FileRequest::SetFlags { .. } => "set_flags",
8533            FileRequest::QueryFilesystem { .. } => "query_filesystem",
8534            FileRequest::GetAttributes { .. } => "get_attributes",
8535            FileRequest::UpdateAttributes { .. } => "update_attributes",
8536            FileRequest::Sync { .. } => "sync",
8537            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
8538            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
8539            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
8540            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
8541            FileRequest::Read { .. } => "read",
8542            FileRequest::Write { .. } => "write",
8543            FileRequest::Describe { .. } => "describe",
8544            FileRequest::Seek { .. } => "seek",
8545            FileRequest::ReadAt { .. } => "read_at",
8546            FileRequest::WriteAt { .. } => "write_at",
8547            FileRequest::Resize { .. } => "resize",
8548            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
8549            FileRequest::Allocate { .. } => "allocate",
8550            FileRequest::EnableVerity { .. } => "enable_verity",
8551            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8552                "unknown one-way method"
8553            }
8554            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8555                "unknown two-way method"
8556            }
8557        }
8558    }
8559}
8560
8561#[derive(Debug, Clone)]
8562pub struct FileControlHandle {
8563    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8564}
8565
8566impl fdomain_client::fidl::ControlHandle for FileControlHandle {
8567    fn shutdown(&self) {
8568        self.inner.shutdown()
8569    }
8570
8571    fn is_closed(&self) -> bool {
8572        self.inner.channel().is_closed()
8573    }
8574    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8575        self.inner.channel().on_closed()
8576    }
8577}
8578
8579impl FileControlHandle {
8580    pub fn send_on_open_(
8581        &self,
8582        mut s: i32,
8583        mut info: Option<NodeInfoDeprecated>,
8584    ) -> Result<(), fidl::Error> {
8585        self.inner.send::<NodeOnOpenRequest>(
8586            (s, info.as_mut()),
8587            0,
8588            0x7fc7bbb1dbfd1972,
8589            fidl::encoding::DynamicFlags::FLEXIBLE,
8590        )
8591    }
8592
8593    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
8594        self.inner.send::<Representation>(
8595            &mut payload,
8596            0,
8597            0x5cb40567d80a510c,
8598            fidl::encoding::DynamicFlags::empty(),
8599        )
8600    }
8601}
8602
8603#[must_use = "FIDL methods require a response to be sent"]
8604#[derive(Debug)]
8605pub struct FileAdvisoryLockResponder {
8606    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8607    tx_id: u32,
8608}
8609
8610/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8611/// if the responder is dropped without sending a response, so that the client
8612/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8613impl std::ops::Drop for FileAdvisoryLockResponder {
8614    fn drop(&mut self) {
8615        self.control_handle.shutdown();
8616        // Safety: drops once, never accessed again
8617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8618    }
8619}
8620
8621impl fdomain_client::fidl::Responder for FileAdvisoryLockResponder {
8622    type ControlHandle = FileControlHandle;
8623
8624    fn control_handle(&self) -> &FileControlHandle {
8625        &self.control_handle
8626    }
8627
8628    fn drop_without_shutdown(mut self) {
8629        // Safety: drops once, never accessed again due to mem::forget
8630        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8631        // Prevent Drop from running (which would shut down the channel)
8632        std::mem::forget(self);
8633    }
8634}
8635
8636impl FileAdvisoryLockResponder {
8637    /// Sends a response to the FIDL transaction.
8638    ///
8639    /// Sets the channel to shutdown if an error occurs.
8640    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8641        let _result = self.send_raw(result);
8642        if _result.is_err() {
8643            self.control_handle.shutdown();
8644        }
8645        self.drop_without_shutdown();
8646        _result
8647    }
8648
8649    /// Similar to "send" but does not shutdown the channel if an error occurs.
8650    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8651        let _result = self.send_raw(result);
8652        self.drop_without_shutdown();
8653        _result
8654    }
8655
8656    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8657        self.control_handle
8658            .inner
8659            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8660                result,
8661                self.tx_id,
8662                0x6ee9c0ad53ec87aa,
8663                fidl::encoding::DynamicFlags::empty(),
8664            )
8665    }
8666}
8667
8668#[must_use = "FIDL methods require a response to be sent"]
8669#[derive(Debug)]
8670pub struct FileLinkIntoResponder {
8671    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8672    tx_id: u32,
8673}
8674
8675/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8676/// if the responder is dropped without sending a response, so that the client
8677/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8678impl std::ops::Drop for FileLinkIntoResponder {
8679    fn drop(&mut self) {
8680        self.control_handle.shutdown();
8681        // Safety: drops once, never accessed again
8682        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8683    }
8684}
8685
8686impl fdomain_client::fidl::Responder for FileLinkIntoResponder {
8687    type ControlHandle = FileControlHandle;
8688
8689    fn control_handle(&self) -> &FileControlHandle {
8690        &self.control_handle
8691    }
8692
8693    fn drop_without_shutdown(mut self) {
8694        // Safety: drops once, never accessed again due to mem::forget
8695        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8696        // Prevent Drop from running (which would shut down the channel)
8697        std::mem::forget(self);
8698    }
8699}
8700
8701impl FileLinkIntoResponder {
8702    /// Sends a response to the FIDL transaction.
8703    ///
8704    /// Sets the channel to shutdown if an error occurs.
8705    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8706        let _result = self.send_raw(result);
8707        if _result.is_err() {
8708            self.control_handle.shutdown();
8709        }
8710        self.drop_without_shutdown();
8711        _result
8712    }
8713
8714    /// Similar to "send" but does not shutdown the channel if an error occurs.
8715    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8716        let _result = self.send_raw(result);
8717        self.drop_without_shutdown();
8718        _result
8719    }
8720
8721    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8722        self.control_handle
8723            .inner
8724            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8725                result,
8726                self.tx_id,
8727                0x54f3949246a03e74,
8728                fidl::encoding::DynamicFlags::empty(),
8729            )
8730    }
8731}
8732
8733#[must_use = "FIDL methods require a response to be sent"]
8734#[derive(Debug)]
8735pub struct FileCloseResponder {
8736    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8737    tx_id: u32,
8738}
8739
8740/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8741/// if the responder is dropped without sending a response, so that the client
8742/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8743impl std::ops::Drop for FileCloseResponder {
8744    fn drop(&mut self) {
8745        self.control_handle.shutdown();
8746        // Safety: drops once, never accessed again
8747        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8748    }
8749}
8750
8751impl fdomain_client::fidl::Responder for FileCloseResponder {
8752    type ControlHandle = FileControlHandle;
8753
8754    fn control_handle(&self) -> &FileControlHandle {
8755        &self.control_handle
8756    }
8757
8758    fn drop_without_shutdown(mut self) {
8759        // Safety: drops once, never accessed again due to mem::forget
8760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8761        // Prevent Drop from running (which would shut down the channel)
8762        std::mem::forget(self);
8763    }
8764}
8765
8766impl FileCloseResponder {
8767    /// Sends a response to the FIDL transaction.
8768    ///
8769    /// Sets the channel to shutdown if an error occurs.
8770    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8771        let _result = self.send_raw(result);
8772        if _result.is_err() {
8773            self.control_handle.shutdown();
8774        }
8775        self.drop_without_shutdown();
8776        _result
8777    }
8778
8779    /// Similar to "send" but does not shutdown the channel if an error occurs.
8780    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8781        let _result = self.send_raw(result);
8782        self.drop_without_shutdown();
8783        _result
8784    }
8785
8786    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8787        self.control_handle
8788            .inner
8789            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8790                result,
8791                self.tx_id,
8792                0x5ac5d459ad7f657e,
8793                fidl::encoding::DynamicFlags::empty(),
8794            )
8795    }
8796}
8797
8798#[must_use = "FIDL methods require a response to be sent"]
8799#[derive(Debug)]
8800pub struct FileQueryResponder {
8801    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8802    tx_id: u32,
8803}
8804
8805/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8806/// if the responder is dropped without sending a response, so that the client
8807/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8808impl std::ops::Drop for FileQueryResponder {
8809    fn drop(&mut self) {
8810        self.control_handle.shutdown();
8811        // Safety: drops once, never accessed again
8812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8813    }
8814}
8815
8816impl fdomain_client::fidl::Responder for FileQueryResponder {
8817    type ControlHandle = FileControlHandle;
8818
8819    fn control_handle(&self) -> &FileControlHandle {
8820        &self.control_handle
8821    }
8822
8823    fn drop_without_shutdown(mut self) {
8824        // Safety: drops once, never accessed again due to mem::forget
8825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8826        // Prevent Drop from running (which would shut down the channel)
8827        std::mem::forget(self);
8828    }
8829}
8830
8831impl FileQueryResponder {
8832    /// Sends a response to the FIDL transaction.
8833    ///
8834    /// Sets the channel to shutdown if an error occurs.
8835    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8836        let _result = self.send_raw(protocol);
8837        if _result.is_err() {
8838            self.control_handle.shutdown();
8839        }
8840        self.drop_without_shutdown();
8841        _result
8842    }
8843
8844    /// Similar to "send" but does not shutdown the channel if an error occurs.
8845    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8846        let _result = self.send_raw(protocol);
8847        self.drop_without_shutdown();
8848        _result
8849    }
8850
8851    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8852        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
8853            (protocol,),
8854            self.tx_id,
8855            0x2658edee9decfc06,
8856            fidl::encoding::DynamicFlags::empty(),
8857        )
8858    }
8859}
8860
8861#[must_use = "FIDL methods require a response to be sent"]
8862#[derive(Debug)]
8863pub struct FileDeprecatedGetAttrResponder {
8864    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8865    tx_id: u32,
8866}
8867
8868/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8869/// if the responder is dropped without sending a response, so that the client
8870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8871impl std::ops::Drop for FileDeprecatedGetAttrResponder {
8872    fn drop(&mut self) {
8873        self.control_handle.shutdown();
8874        // Safety: drops once, never accessed again
8875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8876    }
8877}
8878
8879impl fdomain_client::fidl::Responder for FileDeprecatedGetAttrResponder {
8880    type ControlHandle = FileControlHandle;
8881
8882    fn control_handle(&self) -> &FileControlHandle {
8883        &self.control_handle
8884    }
8885
8886    fn drop_without_shutdown(mut self) {
8887        // Safety: drops once, never accessed again due to mem::forget
8888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8889        // Prevent Drop from running (which would shut down the channel)
8890        std::mem::forget(self);
8891    }
8892}
8893
8894impl FileDeprecatedGetAttrResponder {
8895    /// Sends a response to the FIDL transaction.
8896    ///
8897    /// Sets the channel to shutdown if an error occurs.
8898    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8899        let _result = self.send_raw(s, attributes);
8900        if _result.is_err() {
8901            self.control_handle.shutdown();
8902        }
8903        self.drop_without_shutdown();
8904        _result
8905    }
8906
8907    /// Similar to "send" but does not shutdown the channel if an error occurs.
8908    pub fn send_no_shutdown_on_err(
8909        self,
8910        mut s: i32,
8911        mut attributes: &NodeAttributes,
8912    ) -> Result<(), fidl::Error> {
8913        let _result = self.send_raw(s, attributes);
8914        self.drop_without_shutdown();
8915        _result
8916    }
8917
8918    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8919        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
8920            (s, attributes),
8921            self.tx_id,
8922            0x78985e216314dafd,
8923            fidl::encoding::DynamicFlags::empty(),
8924        )
8925    }
8926}
8927
8928#[must_use = "FIDL methods require a response to be sent"]
8929#[derive(Debug)]
8930pub struct FileDeprecatedSetAttrResponder {
8931    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8932    tx_id: u32,
8933}
8934
8935/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8936/// if the responder is dropped without sending a response, so that the client
8937/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8938impl std::ops::Drop for FileDeprecatedSetAttrResponder {
8939    fn drop(&mut self) {
8940        self.control_handle.shutdown();
8941        // Safety: drops once, never accessed again
8942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8943    }
8944}
8945
8946impl fdomain_client::fidl::Responder for FileDeprecatedSetAttrResponder {
8947    type ControlHandle = FileControlHandle;
8948
8949    fn control_handle(&self) -> &FileControlHandle {
8950        &self.control_handle
8951    }
8952
8953    fn drop_without_shutdown(mut self) {
8954        // Safety: drops once, never accessed again due to mem::forget
8955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8956        // Prevent Drop from running (which would shut down the channel)
8957        std::mem::forget(self);
8958    }
8959}
8960
8961impl FileDeprecatedSetAttrResponder {
8962    /// Sends a response to the FIDL transaction.
8963    ///
8964    /// Sets the channel to shutdown if an error occurs.
8965    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
8966        let _result = self.send_raw(s);
8967        if _result.is_err() {
8968            self.control_handle.shutdown();
8969        }
8970        self.drop_without_shutdown();
8971        _result
8972    }
8973
8974    /// Similar to "send" but does not shutdown the channel if an error occurs.
8975    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
8976        let _result = self.send_raw(s);
8977        self.drop_without_shutdown();
8978        _result
8979    }
8980
8981    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
8982        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
8983            (s,),
8984            self.tx_id,
8985            0x4186c0f40d938f46,
8986            fidl::encoding::DynamicFlags::empty(),
8987        )
8988    }
8989}
8990
8991#[must_use = "FIDL methods require a response to be sent"]
8992#[derive(Debug)]
8993pub struct FileDeprecatedGetFlagsResponder {
8994    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8995    tx_id: u32,
8996}
8997
8998/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8999/// if the responder is dropped without sending a response, so that the client
9000/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9001impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
9002    fn drop(&mut self) {
9003        self.control_handle.shutdown();
9004        // Safety: drops once, never accessed again
9005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9006    }
9007}
9008
9009impl fdomain_client::fidl::Responder for FileDeprecatedGetFlagsResponder {
9010    type ControlHandle = FileControlHandle;
9011
9012    fn control_handle(&self) -> &FileControlHandle {
9013        &self.control_handle
9014    }
9015
9016    fn drop_without_shutdown(mut self) {
9017        // Safety: drops once, never accessed again due to mem::forget
9018        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9019        // Prevent Drop from running (which would shut down the channel)
9020        std::mem::forget(self);
9021    }
9022}
9023
9024impl FileDeprecatedGetFlagsResponder {
9025    /// Sends a response to the FIDL transaction.
9026    ///
9027    /// Sets the channel to shutdown if an error occurs.
9028    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9029        let _result = self.send_raw(s, flags);
9030        if _result.is_err() {
9031            self.control_handle.shutdown();
9032        }
9033        self.drop_without_shutdown();
9034        _result
9035    }
9036
9037    /// Similar to "send" but does not shutdown the channel if an error occurs.
9038    pub fn send_no_shutdown_on_err(
9039        self,
9040        mut s: i32,
9041        mut flags: OpenFlags,
9042    ) -> Result<(), fidl::Error> {
9043        let _result = self.send_raw(s, flags);
9044        self.drop_without_shutdown();
9045        _result
9046    }
9047
9048    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9049        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
9050            (s, flags),
9051            self.tx_id,
9052            0x5b88fffb8eda3aa1,
9053            fidl::encoding::DynamicFlags::empty(),
9054        )
9055    }
9056}
9057
9058#[must_use = "FIDL methods require a response to be sent"]
9059#[derive(Debug)]
9060pub struct FileDeprecatedSetFlagsResponder {
9061    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9062    tx_id: u32,
9063}
9064
9065/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9066/// if the responder is dropped without sending a response, so that the client
9067/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9068impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
9069    fn drop(&mut self) {
9070        self.control_handle.shutdown();
9071        // Safety: drops once, never accessed again
9072        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9073    }
9074}
9075
9076impl fdomain_client::fidl::Responder for FileDeprecatedSetFlagsResponder {
9077    type ControlHandle = FileControlHandle;
9078
9079    fn control_handle(&self) -> &FileControlHandle {
9080        &self.control_handle
9081    }
9082
9083    fn drop_without_shutdown(mut self) {
9084        // Safety: drops once, never accessed again due to mem::forget
9085        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9086        // Prevent Drop from running (which would shut down the channel)
9087        std::mem::forget(self);
9088    }
9089}
9090
9091impl FileDeprecatedSetFlagsResponder {
9092    /// Sends a response to the FIDL transaction.
9093    ///
9094    /// Sets the channel to shutdown if an error occurs.
9095    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9096        let _result = self.send_raw(s);
9097        if _result.is_err() {
9098            self.control_handle.shutdown();
9099        }
9100        self.drop_without_shutdown();
9101        _result
9102    }
9103
9104    /// Similar to "send" but does not shutdown the channel if an error occurs.
9105    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9106        let _result = self.send_raw(s);
9107        self.drop_without_shutdown();
9108        _result
9109    }
9110
9111    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9112        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
9113            (s,),
9114            self.tx_id,
9115            0x5295b76c71fde733,
9116            fidl::encoding::DynamicFlags::empty(),
9117        )
9118    }
9119}
9120
9121#[must_use = "FIDL methods require a response to be sent"]
9122#[derive(Debug)]
9123pub struct FileGetFlagsResponder {
9124    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9125    tx_id: u32,
9126}
9127
9128/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9129/// if the responder is dropped without sending a response, so that the client
9130/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9131impl std::ops::Drop for FileGetFlagsResponder {
9132    fn drop(&mut self) {
9133        self.control_handle.shutdown();
9134        // Safety: drops once, never accessed again
9135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9136    }
9137}
9138
9139impl fdomain_client::fidl::Responder for FileGetFlagsResponder {
9140    type ControlHandle = FileControlHandle;
9141
9142    fn control_handle(&self) -> &FileControlHandle {
9143        &self.control_handle
9144    }
9145
9146    fn drop_without_shutdown(mut self) {
9147        // Safety: drops once, never accessed again due to mem::forget
9148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9149        // Prevent Drop from running (which would shut down the channel)
9150        std::mem::forget(self);
9151    }
9152}
9153
9154impl FileGetFlagsResponder {
9155    /// Sends a response to the FIDL transaction.
9156    ///
9157    /// Sets the channel to shutdown if an error occurs.
9158    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9159        let _result = self.send_raw(result);
9160        if _result.is_err() {
9161            self.control_handle.shutdown();
9162        }
9163        self.drop_without_shutdown();
9164        _result
9165    }
9166
9167    /// Similar to "send" but does not shutdown the channel if an error occurs.
9168    pub fn send_no_shutdown_on_err(
9169        self,
9170        mut result: Result<Flags, i32>,
9171    ) -> Result<(), fidl::Error> {
9172        let _result = self.send_raw(result);
9173        self.drop_without_shutdown();
9174        _result
9175    }
9176
9177    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9178        self.control_handle
9179            .inner
9180            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
9181                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
9182                self.tx_id,
9183                0x176eb318f64ec23,
9184                fidl::encoding::DynamicFlags::FLEXIBLE,
9185            )
9186    }
9187}
9188
9189#[must_use = "FIDL methods require a response to be sent"]
9190#[derive(Debug)]
9191pub struct FileSetFlagsResponder {
9192    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9193    tx_id: u32,
9194}
9195
9196/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9197/// if the responder is dropped without sending a response, so that the client
9198/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9199impl std::ops::Drop for FileSetFlagsResponder {
9200    fn drop(&mut self) {
9201        self.control_handle.shutdown();
9202        // Safety: drops once, never accessed again
9203        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9204    }
9205}
9206
9207impl fdomain_client::fidl::Responder for FileSetFlagsResponder {
9208    type ControlHandle = FileControlHandle;
9209
9210    fn control_handle(&self) -> &FileControlHandle {
9211        &self.control_handle
9212    }
9213
9214    fn drop_without_shutdown(mut self) {
9215        // Safety: drops once, never accessed again due to mem::forget
9216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9217        // Prevent Drop from running (which would shut down the channel)
9218        std::mem::forget(self);
9219    }
9220}
9221
9222impl FileSetFlagsResponder {
9223    /// Sends a response to the FIDL transaction.
9224    ///
9225    /// Sets the channel to shutdown if an error occurs.
9226    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9227        let _result = self.send_raw(result);
9228        if _result.is_err() {
9229            self.control_handle.shutdown();
9230        }
9231        self.drop_without_shutdown();
9232        _result
9233    }
9234
9235    /// Similar to "send" but does not shutdown the channel if an error occurs.
9236    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9237        let _result = self.send_raw(result);
9238        self.drop_without_shutdown();
9239        _result
9240    }
9241
9242    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9243        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9244            fidl::encoding::EmptyStruct,
9245            i32,
9246        >>(
9247            fidl::encoding::FlexibleResult::new(result),
9248            self.tx_id,
9249            0x55a8028685791ea8,
9250            fidl::encoding::DynamicFlags::FLEXIBLE,
9251        )
9252    }
9253}
9254
9255#[must_use = "FIDL methods require a response to be sent"]
9256#[derive(Debug)]
9257pub struct FileQueryFilesystemResponder {
9258    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9259    tx_id: u32,
9260}
9261
9262/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9263/// if the responder is dropped without sending a response, so that the client
9264/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9265impl std::ops::Drop for FileQueryFilesystemResponder {
9266    fn drop(&mut self) {
9267        self.control_handle.shutdown();
9268        // Safety: drops once, never accessed again
9269        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9270    }
9271}
9272
9273impl fdomain_client::fidl::Responder for FileQueryFilesystemResponder {
9274    type ControlHandle = FileControlHandle;
9275
9276    fn control_handle(&self) -> &FileControlHandle {
9277        &self.control_handle
9278    }
9279
9280    fn drop_without_shutdown(mut self) {
9281        // Safety: drops once, never accessed again due to mem::forget
9282        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9283        // Prevent Drop from running (which would shut down the channel)
9284        std::mem::forget(self);
9285    }
9286}
9287
9288impl FileQueryFilesystemResponder {
9289    /// Sends a response to the FIDL transaction.
9290    ///
9291    /// Sets the channel to shutdown if an error occurs.
9292    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9293        let _result = self.send_raw(s, info);
9294        if _result.is_err() {
9295            self.control_handle.shutdown();
9296        }
9297        self.drop_without_shutdown();
9298        _result
9299    }
9300
9301    /// Similar to "send" but does not shutdown the channel if an error occurs.
9302    pub fn send_no_shutdown_on_err(
9303        self,
9304        mut s: i32,
9305        mut info: Option<&FilesystemInfo>,
9306    ) -> Result<(), fidl::Error> {
9307        let _result = self.send_raw(s, info);
9308        self.drop_without_shutdown();
9309        _result
9310    }
9311
9312    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9313        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
9314            (s, info),
9315            self.tx_id,
9316            0x6f344a1c6b0a0610,
9317            fidl::encoding::DynamicFlags::empty(),
9318        )
9319    }
9320}
9321
9322#[must_use = "FIDL methods require a response to be sent"]
9323#[derive(Debug)]
9324pub struct FileGetAttributesResponder {
9325    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9326    tx_id: u32,
9327}
9328
9329/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9330/// if the responder is dropped without sending a response, so that the client
9331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9332impl std::ops::Drop for FileGetAttributesResponder {
9333    fn drop(&mut self) {
9334        self.control_handle.shutdown();
9335        // Safety: drops once, never accessed again
9336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9337    }
9338}
9339
9340impl fdomain_client::fidl::Responder for FileGetAttributesResponder {
9341    type ControlHandle = FileControlHandle;
9342
9343    fn control_handle(&self) -> &FileControlHandle {
9344        &self.control_handle
9345    }
9346
9347    fn drop_without_shutdown(mut self) {
9348        // Safety: drops once, never accessed again due to mem::forget
9349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9350        // Prevent Drop from running (which would shut down the channel)
9351        std::mem::forget(self);
9352    }
9353}
9354
9355impl FileGetAttributesResponder {
9356    /// Sends a response to the FIDL transaction.
9357    ///
9358    /// Sets the channel to shutdown if an error occurs.
9359    pub fn send(
9360        self,
9361        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9362    ) -> Result<(), fidl::Error> {
9363        let _result = self.send_raw(result);
9364        if _result.is_err() {
9365            self.control_handle.shutdown();
9366        }
9367        self.drop_without_shutdown();
9368        _result
9369    }
9370
9371    /// Similar to "send" but does not shutdown the channel if an error occurs.
9372    pub fn send_no_shutdown_on_err(
9373        self,
9374        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9375    ) -> Result<(), fidl::Error> {
9376        let _result = self.send_raw(result);
9377        self.drop_without_shutdown();
9378        _result
9379    }
9380
9381    fn send_raw(
9382        &self,
9383        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9384    ) -> Result<(), fidl::Error> {
9385        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
9386            result,
9387            self.tx_id,
9388            0x3d4396a638ea053b,
9389            fidl::encoding::DynamicFlags::empty(),
9390        )
9391    }
9392}
9393
9394#[must_use = "FIDL methods require a response to be sent"]
9395#[derive(Debug)]
9396pub struct FileUpdateAttributesResponder {
9397    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9398    tx_id: u32,
9399}
9400
9401/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9402/// if the responder is dropped without sending a response, so that the client
9403/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9404impl std::ops::Drop for FileUpdateAttributesResponder {
9405    fn drop(&mut self) {
9406        self.control_handle.shutdown();
9407        // Safety: drops once, never accessed again
9408        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9409    }
9410}
9411
9412impl fdomain_client::fidl::Responder for FileUpdateAttributesResponder {
9413    type ControlHandle = FileControlHandle;
9414
9415    fn control_handle(&self) -> &FileControlHandle {
9416        &self.control_handle
9417    }
9418
9419    fn drop_without_shutdown(mut self) {
9420        // Safety: drops once, never accessed again due to mem::forget
9421        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9422        // Prevent Drop from running (which would shut down the channel)
9423        std::mem::forget(self);
9424    }
9425}
9426
9427impl FileUpdateAttributesResponder {
9428    /// Sends a response to the FIDL transaction.
9429    ///
9430    /// Sets the channel to shutdown if an error occurs.
9431    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9432        let _result = self.send_raw(result);
9433        if _result.is_err() {
9434            self.control_handle.shutdown();
9435        }
9436        self.drop_without_shutdown();
9437        _result
9438    }
9439
9440    /// Similar to "send" but does not shutdown the channel if an error occurs.
9441    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9442        let _result = self.send_raw(result);
9443        self.drop_without_shutdown();
9444        _result
9445    }
9446
9447    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9448        self.control_handle
9449            .inner
9450            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9451                result,
9452                self.tx_id,
9453                0x3308c1da5a89bf08,
9454                fidl::encoding::DynamicFlags::empty(),
9455            )
9456    }
9457}
9458
9459#[must_use = "FIDL methods require a response to be sent"]
9460#[derive(Debug)]
9461pub struct FileSyncResponder {
9462    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9463    tx_id: u32,
9464}
9465
9466/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9467/// if the responder is dropped without sending a response, so that the client
9468/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9469impl std::ops::Drop for FileSyncResponder {
9470    fn drop(&mut self) {
9471        self.control_handle.shutdown();
9472        // Safety: drops once, never accessed again
9473        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9474    }
9475}
9476
9477impl fdomain_client::fidl::Responder for FileSyncResponder {
9478    type ControlHandle = FileControlHandle;
9479
9480    fn control_handle(&self) -> &FileControlHandle {
9481        &self.control_handle
9482    }
9483
9484    fn drop_without_shutdown(mut self) {
9485        // Safety: drops once, never accessed again due to mem::forget
9486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9487        // Prevent Drop from running (which would shut down the channel)
9488        std::mem::forget(self);
9489    }
9490}
9491
9492impl FileSyncResponder {
9493    /// Sends a response to the FIDL transaction.
9494    ///
9495    /// Sets the channel to shutdown if an error occurs.
9496    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9497        let _result = self.send_raw(result);
9498        if _result.is_err() {
9499            self.control_handle.shutdown();
9500        }
9501        self.drop_without_shutdown();
9502        _result
9503    }
9504
9505    /// Similar to "send" but does not shutdown the channel if an error occurs.
9506    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9507        let _result = self.send_raw(result);
9508        self.drop_without_shutdown();
9509        _result
9510    }
9511
9512    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9513        self.control_handle
9514            .inner
9515            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9516                result,
9517                self.tx_id,
9518                0x2c5c27ca0ab5dc49,
9519                fidl::encoding::DynamicFlags::empty(),
9520            )
9521    }
9522}
9523
9524#[must_use = "FIDL methods require a response to be sent"]
9525#[derive(Debug)]
9526pub struct FileGetExtendedAttributeResponder {
9527    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9528    tx_id: u32,
9529}
9530
9531/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9532/// if the responder is dropped without sending a response, so that the client
9533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9534impl std::ops::Drop for FileGetExtendedAttributeResponder {
9535    fn drop(&mut self) {
9536        self.control_handle.shutdown();
9537        // Safety: drops once, never accessed again
9538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9539    }
9540}
9541
9542impl fdomain_client::fidl::Responder for FileGetExtendedAttributeResponder {
9543    type ControlHandle = FileControlHandle;
9544
9545    fn control_handle(&self) -> &FileControlHandle {
9546        &self.control_handle
9547    }
9548
9549    fn drop_without_shutdown(mut self) {
9550        // Safety: drops once, never accessed again due to mem::forget
9551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9552        // Prevent Drop from running (which would shut down the channel)
9553        std::mem::forget(self);
9554    }
9555}
9556
9557impl FileGetExtendedAttributeResponder {
9558    /// Sends a response to the FIDL transaction.
9559    ///
9560    /// Sets the channel to shutdown if an error occurs.
9561    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9562        let _result = self.send_raw(result);
9563        if _result.is_err() {
9564            self.control_handle.shutdown();
9565        }
9566        self.drop_without_shutdown();
9567        _result
9568    }
9569
9570    /// Similar to "send" but does not shutdown the channel if an error occurs.
9571    pub fn send_no_shutdown_on_err(
9572        self,
9573        mut result: Result<ExtendedAttributeValue, i32>,
9574    ) -> Result<(), fidl::Error> {
9575        let _result = self.send_raw(result);
9576        self.drop_without_shutdown();
9577        _result
9578    }
9579
9580    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9581        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
9582            result.as_mut().map_err(|e| *e),
9583            self.tx_id,
9584            0x45ffa3ccfdeb76db,
9585            fidl::encoding::DynamicFlags::empty(),
9586        )
9587    }
9588}
9589
9590#[must_use = "FIDL methods require a response to be sent"]
9591#[derive(Debug)]
9592pub struct FileSetExtendedAttributeResponder {
9593    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9594    tx_id: u32,
9595}
9596
9597/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9598/// if the responder is dropped without sending a response, so that the client
9599/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9600impl std::ops::Drop for FileSetExtendedAttributeResponder {
9601    fn drop(&mut self) {
9602        self.control_handle.shutdown();
9603        // Safety: drops once, never accessed again
9604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9605    }
9606}
9607
9608impl fdomain_client::fidl::Responder for FileSetExtendedAttributeResponder {
9609    type ControlHandle = FileControlHandle;
9610
9611    fn control_handle(&self) -> &FileControlHandle {
9612        &self.control_handle
9613    }
9614
9615    fn drop_without_shutdown(mut self) {
9616        // Safety: drops once, never accessed again due to mem::forget
9617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9618        // Prevent Drop from running (which would shut down the channel)
9619        std::mem::forget(self);
9620    }
9621}
9622
9623impl FileSetExtendedAttributeResponder {
9624    /// Sends a response to the FIDL transaction.
9625    ///
9626    /// Sets the channel to shutdown if an error occurs.
9627    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9628        let _result = self.send_raw(result);
9629        if _result.is_err() {
9630            self.control_handle.shutdown();
9631        }
9632        self.drop_without_shutdown();
9633        _result
9634    }
9635
9636    /// Similar to "send" but does not shutdown the channel if an error occurs.
9637    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9638        let _result = self.send_raw(result);
9639        self.drop_without_shutdown();
9640        _result
9641    }
9642
9643    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9644        self.control_handle
9645            .inner
9646            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9647                result,
9648                self.tx_id,
9649                0x4a951362f681f23c,
9650                fidl::encoding::DynamicFlags::empty(),
9651            )
9652    }
9653}
9654
9655#[must_use = "FIDL methods require a response to be sent"]
9656#[derive(Debug)]
9657pub struct FileRemoveExtendedAttributeResponder {
9658    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9659    tx_id: u32,
9660}
9661
9662/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9663/// if the responder is dropped without sending a response, so that the client
9664/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9665impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
9666    fn drop(&mut self) {
9667        self.control_handle.shutdown();
9668        // Safety: drops once, never accessed again
9669        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9670    }
9671}
9672
9673impl fdomain_client::fidl::Responder for FileRemoveExtendedAttributeResponder {
9674    type ControlHandle = FileControlHandle;
9675
9676    fn control_handle(&self) -> &FileControlHandle {
9677        &self.control_handle
9678    }
9679
9680    fn drop_without_shutdown(mut self) {
9681        // Safety: drops once, never accessed again due to mem::forget
9682        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9683        // Prevent Drop from running (which would shut down the channel)
9684        std::mem::forget(self);
9685    }
9686}
9687
9688impl FileRemoveExtendedAttributeResponder {
9689    /// Sends a response to the FIDL transaction.
9690    ///
9691    /// Sets the channel to shutdown if an error occurs.
9692    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9693        let _result = self.send_raw(result);
9694        if _result.is_err() {
9695            self.control_handle.shutdown();
9696        }
9697        self.drop_without_shutdown();
9698        _result
9699    }
9700
9701    /// Similar to "send" but does not shutdown the channel if an error occurs.
9702    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9703        let _result = self.send_raw(result);
9704        self.drop_without_shutdown();
9705        _result
9706    }
9707
9708    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9709        self.control_handle
9710            .inner
9711            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9712                result,
9713                self.tx_id,
9714                0x7a0b9f3a9bf9032d,
9715                fidl::encoding::DynamicFlags::empty(),
9716            )
9717    }
9718}
9719
9720#[must_use = "FIDL methods require a response to be sent"]
9721#[derive(Debug)]
9722pub struct FileReadResponder {
9723    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9724    tx_id: u32,
9725}
9726
9727/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9728/// if the responder is dropped without sending a response, so that the client
9729/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9730impl std::ops::Drop for FileReadResponder {
9731    fn drop(&mut self) {
9732        self.control_handle.shutdown();
9733        // Safety: drops once, never accessed again
9734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9735    }
9736}
9737
9738impl fdomain_client::fidl::Responder for FileReadResponder {
9739    type ControlHandle = FileControlHandle;
9740
9741    fn control_handle(&self) -> &FileControlHandle {
9742        &self.control_handle
9743    }
9744
9745    fn drop_without_shutdown(mut self) {
9746        // Safety: drops once, never accessed again due to mem::forget
9747        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9748        // Prevent Drop from running (which would shut down the channel)
9749        std::mem::forget(self);
9750    }
9751}
9752
9753impl FileReadResponder {
9754    /// Sends a response to the FIDL transaction.
9755    ///
9756    /// Sets the channel to shutdown if an error occurs.
9757    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9758        let _result = self.send_raw(result);
9759        if _result.is_err() {
9760            self.control_handle.shutdown();
9761        }
9762        self.drop_without_shutdown();
9763        _result
9764    }
9765
9766    /// Similar to "send" but does not shutdown the channel if an error occurs.
9767    pub fn send_no_shutdown_on_err(
9768        self,
9769        mut result: Result<&[u8], i32>,
9770    ) -> Result<(), fidl::Error> {
9771        let _result = self.send_raw(result);
9772        self.drop_without_shutdown();
9773        _result
9774    }
9775
9776    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9777        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
9778            result.map(|data| (data,)),
9779            self.tx_id,
9780            0x57e419a298c8ede,
9781            fidl::encoding::DynamicFlags::empty(),
9782        )
9783    }
9784}
9785
9786#[must_use = "FIDL methods require a response to be sent"]
9787#[derive(Debug)]
9788pub struct FileWriteResponder {
9789    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9790    tx_id: u32,
9791}
9792
9793/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9794/// if the responder is dropped without sending a response, so that the client
9795/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9796impl std::ops::Drop for FileWriteResponder {
9797    fn drop(&mut self) {
9798        self.control_handle.shutdown();
9799        // Safety: drops once, never accessed again
9800        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9801    }
9802}
9803
9804impl fdomain_client::fidl::Responder for FileWriteResponder {
9805    type ControlHandle = FileControlHandle;
9806
9807    fn control_handle(&self) -> &FileControlHandle {
9808        &self.control_handle
9809    }
9810
9811    fn drop_without_shutdown(mut self) {
9812        // Safety: drops once, never accessed again due to mem::forget
9813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9814        // Prevent Drop from running (which would shut down the channel)
9815        std::mem::forget(self);
9816    }
9817}
9818
9819impl FileWriteResponder {
9820    /// Sends a response to the FIDL transaction.
9821    ///
9822    /// Sets the channel to shutdown if an error occurs.
9823    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9824        let _result = self.send_raw(result);
9825        if _result.is_err() {
9826            self.control_handle.shutdown();
9827        }
9828        self.drop_without_shutdown();
9829        _result
9830    }
9831
9832    /// Similar to "send" but does not shutdown the channel if an error occurs.
9833    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9834        let _result = self.send_raw(result);
9835        self.drop_without_shutdown();
9836        _result
9837    }
9838
9839    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9840        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
9841            result.map(|actual_count| (actual_count,)),
9842            self.tx_id,
9843            0x6a31437832469f82,
9844            fidl::encoding::DynamicFlags::empty(),
9845        )
9846    }
9847}
9848
9849#[must_use = "FIDL methods require a response to be sent"]
9850#[derive(Debug)]
9851pub struct FileDescribeResponder {
9852    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9853    tx_id: u32,
9854}
9855
9856/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9857/// if the responder is dropped without sending a response, so that the client
9858/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9859impl std::ops::Drop for FileDescribeResponder {
9860    fn drop(&mut self) {
9861        self.control_handle.shutdown();
9862        // Safety: drops once, never accessed again
9863        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9864    }
9865}
9866
9867impl fdomain_client::fidl::Responder for FileDescribeResponder {
9868    type ControlHandle = FileControlHandle;
9869
9870    fn control_handle(&self) -> &FileControlHandle {
9871        &self.control_handle
9872    }
9873
9874    fn drop_without_shutdown(mut self) {
9875        // Safety: drops once, never accessed again due to mem::forget
9876        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9877        // Prevent Drop from running (which would shut down the channel)
9878        std::mem::forget(self);
9879    }
9880}
9881
9882impl FileDescribeResponder {
9883    /// Sends a response to the FIDL transaction.
9884    ///
9885    /// Sets the channel to shutdown if an error occurs.
9886    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9887        let _result = self.send_raw(payload);
9888        if _result.is_err() {
9889            self.control_handle.shutdown();
9890        }
9891        self.drop_without_shutdown();
9892        _result
9893    }
9894
9895    /// Similar to "send" but does not shutdown the channel if an error occurs.
9896    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9897        let _result = self.send_raw(payload);
9898        self.drop_without_shutdown();
9899        _result
9900    }
9901
9902    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9903        self.control_handle.inner.send::<FileInfo>(
9904            &mut payload,
9905            self.tx_id,
9906            0x68b5ac00c62906bc,
9907            fidl::encoding::DynamicFlags::empty(),
9908        )
9909    }
9910}
9911
9912#[must_use = "FIDL methods require a response to be sent"]
9913#[derive(Debug)]
9914pub struct FileSeekResponder {
9915    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9916    tx_id: u32,
9917}
9918
9919/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9920/// if the responder is dropped without sending a response, so that the client
9921/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9922impl std::ops::Drop for FileSeekResponder {
9923    fn drop(&mut self) {
9924        self.control_handle.shutdown();
9925        // Safety: drops once, never accessed again
9926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9927    }
9928}
9929
9930impl fdomain_client::fidl::Responder for FileSeekResponder {
9931    type ControlHandle = FileControlHandle;
9932
9933    fn control_handle(&self) -> &FileControlHandle {
9934        &self.control_handle
9935    }
9936
9937    fn drop_without_shutdown(mut self) {
9938        // Safety: drops once, never accessed again due to mem::forget
9939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9940        // Prevent Drop from running (which would shut down the channel)
9941        std::mem::forget(self);
9942    }
9943}
9944
9945impl FileSeekResponder {
9946    /// Sends a response to the FIDL transaction.
9947    ///
9948    /// Sets the channel to shutdown if an error occurs.
9949    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9950        let _result = self.send_raw(result);
9951        if _result.is_err() {
9952            self.control_handle.shutdown();
9953        }
9954        self.drop_without_shutdown();
9955        _result
9956    }
9957
9958    /// Similar to "send" but does not shutdown the channel if an error occurs.
9959    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9960        let _result = self.send_raw(result);
9961        self.drop_without_shutdown();
9962        _result
9963    }
9964
9965    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9966        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
9967            result.map(|offset_from_start| (offset_from_start,)),
9968            self.tx_id,
9969            0x78079168162c5207,
9970            fidl::encoding::DynamicFlags::empty(),
9971        )
9972    }
9973}
9974
9975#[must_use = "FIDL methods require a response to be sent"]
9976#[derive(Debug)]
9977pub struct FileReadAtResponder {
9978    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9979    tx_id: u32,
9980}
9981
9982/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9983/// if the responder is dropped without sending a response, so that the client
9984/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9985impl std::ops::Drop for FileReadAtResponder {
9986    fn drop(&mut self) {
9987        self.control_handle.shutdown();
9988        // Safety: drops once, never accessed again
9989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9990    }
9991}
9992
9993impl fdomain_client::fidl::Responder for FileReadAtResponder {
9994    type ControlHandle = FileControlHandle;
9995
9996    fn control_handle(&self) -> &FileControlHandle {
9997        &self.control_handle
9998    }
9999
10000    fn drop_without_shutdown(mut self) {
10001        // Safety: drops once, never accessed again due to mem::forget
10002        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10003        // Prevent Drop from running (which would shut down the channel)
10004        std::mem::forget(self);
10005    }
10006}
10007
10008impl FileReadAtResponder {
10009    /// Sends a response to the FIDL transaction.
10010    ///
10011    /// Sets the channel to shutdown if an error occurs.
10012    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10013        let _result = self.send_raw(result);
10014        if _result.is_err() {
10015            self.control_handle.shutdown();
10016        }
10017        self.drop_without_shutdown();
10018        _result
10019    }
10020
10021    /// Similar to "send" but does not shutdown the channel if an error occurs.
10022    pub fn send_no_shutdown_on_err(
10023        self,
10024        mut result: Result<&[u8], i32>,
10025    ) -> Result<(), fidl::Error> {
10026        let _result = self.send_raw(result);
10027        self.drop_without_shutdown();
10028        _result
10029    }
10030
10031    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10032        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
10033            result.map(|data| (data,)),
10034            self.tx_id,
10035            0x1607a293a60d723e,
10036            fidl::encoding::DynamicFlags::empty(),
10037        )
10038    }
10039}
10040
10041#[must_use = "FIDL methods require a response to be sent"]
10042#[derive(Debug)]
10043pub struct FileWriteAtResponder {
10044    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10045    tx_id: u32,
10046}
10047
10048/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10049/// if the responder is dropped without sending a response, so that the client
10050/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10051impl std::ops::Drop for FileWriteAtResponder {
10052    fn drop(&mut self) {
10053        self.control_handle.shutdown();
10054        // Safety: drops once, never accessed again
10055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10056    }
10057}
10058
10059impl fdomain_client::fidl::Responder for FileWriteAtResponder {
10060    type ControlHandle = FileControlHandle;
10061
10062    fn control_handle(&self) -> &FileControlHandle {
10063        &self.control_handle
10064    }
10065
10066    fn drop_without_shutdown(mut self) {
10067        // Safety: drops once, never accessed again due to mem::forget
10068        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10069        // Prevent Drop from running (which would shut down the channel)
10070        std::mem::forget(self);
10071    }
10072}
10073
10074impl FileWriteAtResponder {
10075    /// Sends a response to the FIDL transaction.
10076    ///
10077    /// Sets the channel to shutdown if an error occurs.
10078    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10079        let _result = self.send_raw(result);
10080        if _result.is_err() {
10081            self.control_handle.shutdown();
10082        }
10083        self.drop_without_shutdown();
10084        _result
10085    }
10086
10087    /// Similar to "send" but does not shutdown the channel if an error occurs.
10088    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10089        let _result = self.send_raw(result);
10090        self.drop_without_shutdown();
10091        _result
10092    }
10093
10094    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10095        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
10096            result.map(|actual_count| (actual_count,)),
10097            self.tx_id,
10098            0x793eefc0045e792b,
10099            fidl::encoding::DynamicFlags::empty(),
10100        )
10101    }
10102}
10103
10104#[must_use = "FIDL methods require a response to be sent"]
10105#[derive(Debug)]
10106pub struct FileResizeResponder {
10107    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10108    tx_id: u32,
10109}
10110
10111/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10112/// if the responder is dropped without sending a response, so that the client
10113/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10114impl std::ops::Drop for FileResizeResponder {
10115    fn drop(&mut self) {
10116        self.control_handle.shutdown();
10117        // Safety: drops once, never accessed again
10118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10119    }
10120}
10121
10122impl fdomain_client::fidl::Responder for FileResizeResponder {
10123    type ControlHandle = FileControlHandle;
10124
10125    fn control_handle(&self) -> &FileControlHandle {
10126        &self.control_handle
10127    }
10128
10129    fn drop_without_shutdown(mut self) {
10130        // Safety: drops once, never accessed again due to mem::forget
10131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10132        // Prevent Drop from running (which would shut down the channel)
10133        std::mem::forget(self);
10134    }
10135}
10136
10137impl FileResizeResponder {
10138    /// Sends a response to the FIDL transaction.
10139    ///
10140    /// Sets the channel to shutdown if an error occurs.
10141    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10142        let _result = self.send_raw(result);
10143        if _result.is_err() {
10144            self.control_handle.shutdown();
10145        }
10146        self.drop_without_shutdown();
10147        _result
10148    }
10149
10150    /// Similar to "send" but does not shutdown the channel if an error occurs.
10151    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10152        let _result = self.send_raw(result);
10153        self.drop_without_shutdown();
10154        _result
10155    }
10156
10157    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10158        self.control_handle
10159            .inner
10160            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10161                result,
10162                self.tx_id,
10163                0x2b80825f0535743a,
10164                fidl::encoding::DynamicFlags::empty(),
10165            )
10166    }
10167}
10168
10169#[must_use = "FIDL methods require a response to be sent"]
10170#[derive(Debug)]
10171pub struct FileGetBackingMemoryResponder {
10172    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10173    tx_id: u32,
10174}
10175
10176/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10177/// if the responder is dropped without sending a response, so that the client
10178/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10179impl std::ops::Drop for FileGetBackingMemoryResponder {
10180    fn drop(&mut self) {
10181        self.control_handle.shutdown();
10182        // Safety: drops once, never accessed again
10183        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10184    }
10185}
10186
10187impl fdomain_client::fidl::Responder for FileGetBackingMemoryResponder {
10188    type ControlHandle = FileControlHandle;
10189
10190    fn control_handle(&self) -> &FileControlHandle {
10191        &self.control_handle
10192    }
10193
10194    fn drop_without_shutdown(mut self) {
10195        // Safety: drops once, never accessed again due to mem::forget
10196        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10197        // Prevent Drop from running (which would shut down the channel)
10198        std::mem::forget(self);
10199    }
10200}
10201
10202impl FileGetBackingMemoryResponder {
10203    /// Sends a response to the FIDL transaction.
10204    ///
10205    /// Sets the channel to shutdown if an error occurs.
10206    pub fn send(self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10207        let _result = self.send_raw(result);
10208        if _result.is_err() {
10209            self.control_handle.shutdown();
10210        }
10211        self.drop_without_shutdown();
10212        _result
10213    }
10214
10215    /// Similar to "send" but does not shutdown the channel if an error occurs.
10216    pub fn send_no_shutdown_on_err(
10217        self,
10218        mut result: Result<fdomain_client::Vmo, i32>,
10219    ) -> Result<(), fidl::Error> {
10220        let _result = self.send_raw(result);
10221        self.drop_without_shutdown();
10222        _result
10223    }
10224
10225    fn send_raw(&self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10226        self.control_handle
10227            .inner
10228            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
10229                result.map(|vmo| (vmo,)),
10230                self.tx_id,
10231                0xa6a9e654cbf62b,
10232                fidl::encoding::DynamicFlags::empty(),
10233            )
10234    }
10235}
10236
10237#[must_use = "FIDL methods require a response to be sent"]
10238#[derive(Debug)]
10239pub struct FileAllocateResponder {
10240    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10241    tx_id: u32,
10242}
10243
10244/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10245/// if the responder is dropped without sending a response, so that the client
10246/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10247impl std::ops::Drop for FileAllocateResponder {
10248    fn drop(&mut self) {
10249        self.control_handle.shutdown();
10250        // Safety: drops once, never accessed again
10251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10252    }
10253}
10254
10255impl fdomain_client::fidl::Responder for FileAllocateResponder {
10256    type ControlHandle = FileControlHandle;
10257
10258    fn control_handle(&self) -> &FileControlHandle {
10259        &self.control_handle
10260    }
10261
10262    fn drop_without_shutdown(mut self) {
10263        // Safety: drops once, never accessed again due to mem::forget
10264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10265        // Prevent Drop from running (which would shut down the channel)
10266        std::mem::forget(self);
10267    }
10268}
10269
10270impl FileAllocateResponder {
10271    /// Sends a response to the FIDL transaction.
10272    ///
10273    /// Sets the channel to shutdown if an error occurs.
10274    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10275        let _result = self.send_raw(result);
10276        if _result.is_err() {
10277            self.control_handle.shutdown();
10278        }
10279        self.drop_without_shutdown();
10280        _result
10281    }
10282
10283    /// Similar to "send" but does not shutdown the channel if an error occurs.
10284    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10285        let _result = self.send_raw(result);
10286        self.drop_without_shutdown();
10287        _result
10288    }
10289
10290    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10291        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10292            fidl::encoding::EmptyStruct,
10293            i32,
10294        >>(
10295            fidl::encoding::FlexibleResult::new(result),
10296            self.tx_id,
10297            0x77fa0c330b57fd2e,
10298            fidl::encoding::DynamicFlags::FLEXIBLE,
10299        )
10300    }
10301}
10302
10303#[must_use = "FIDL methods require a response to be sent"]
10304#[derive(Debug)]
10305pub struct FileEnableVerityResponder {
10306    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10307    tx_id: u32,
10308}
10309
10310/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10311/// if the responder is dropped without sending a response, so that the client
10312/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10313impl std::ops::Drop for FileEnableVerityResponder {
10314    fn drop(&mut self) {
10315        self.control_handle.shutdown();
10316        // Safety: drops once, never accessed again
10317        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10318    }
10319}
10320
10321impl fdomain_client::fidl::Responder for FileEnableVerityResponder {
10322    type ControlHandle = FileControlHandle;
10323
10324    fn control_handle(&self) -> &FileControlHandle {
10325        &self.control_handle
10326    }
10327
10328    fn drop_without_shutdown(mut self) {
10329        // Safety: drops once, never accessed again due to mem::forget
10330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10331        // Prevent Drop from running (which would shut down the channel)
10332        std::mem::forget(self);
10333    }
10334}
10335
10336impl FileEnableVerityResponder {
10337    /// Sends a response to the FIDL transaction.
10338    ///
10339    /// Sets the channel to shutdown if an error occurs.
10340    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10341        let _result = self.send_raw(result);
10342        if _result.is_err() {
10343            self.control_handle.shutdown();
10344        }
10345        self.drop_without_shutdown();
10346        _result
10347    }
10348
10349    /// Similar to "send" but does not shutdown the channel if an error occurs.
10350    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10351        let _result = self.send_raw(result);
10352        self.drop_without_shutdown();
10353        _result
10354    }
10355
10356    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10357        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10358            fidl::encoding::EmptyStruct,
10359            i32,
10360        >>(
10361            fidl::encoding::FlexibleResult::new(result),
10362            self.tx_id,
10363            0x2c421ec3faaeb8bb,
10364            fidl::encoding::DynamicFlags::FLEXIBLE,
10365        )
10366    }
10367}
10368
10369#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10370pub struct LinkableMarker;
10371
10372impl fdomain_client::fidl::ProtocolMarker for LinkableMarker {
10373    type Proxy = LinkableProxy;
10374    type RequestStream = LinkableRequestStream;
10375
10376    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
10377}
10378pub type LinkableLinkIntoResult = Result<(), i32>;
10379
10380pub trait LinkableProxyInterface: Send + Sync {
10381    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
10382        + Send;
10383    fn r#link_into(
10384        &self,
10385        dst_parent_token: fdomain_client::Event,
10386        dst: &str,
10387    ) -> Self::LinkIntoResponseFut;
10388}
10389
10390#[derive(Debug, Clone)]
10391pub struct LinkableProxy {
10392    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10393}
10394
10395impl fdomain_client::fidl::Proxy for LinkableProxy {
10396    type Protocol = LinkableMarker;
10397
10398    fn from_channel(inner: fdomain_client::Channel) -> Self {
10399        Self::new(inner)
10400    }
10401
10402    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10403        self.client.into_channel().map_err(|client| Self { client })
10404    }
10405
10406    fn as_channel(&self) -> &fdomain_client::Channel {
10407        self.client.as_channel()
10408    }
10409}
10410
10411impl LinkableProxy {
10412    /// Create a new Proxy for fuchsia.io/Linkable.
10413    pub fn new(channel: fdomain_client::Channel) -> Self {
10414        let protocol_name = <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10415        Self { client: fidl::client::Client::new(channel, protocol_name) }
10416    }
10417
10418    /// Get a Stream of events from the remote end of the protocol.
10419    ///
10420    /// # Panics
10421    ///
10422    /// Panics if the event stream was already taken.
10423    pub fn take_event_stream(&self) -> LinkableEventStream {
10424        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
10425    }
10426
10427    /// Creates a link to this this object with name `dst` in the directory represented by
10428    /// `dst_parent_token`.
10429    ///
10430    /// `dst` must be a resolved object name. Including "/" in the string will return
10431    /// `ZX_ERR_INVALID_ARGS`.
10432    ///
10433    /// This method requires the maximal set of rights supported by the filesystem for this object.
10434    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10435    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10436    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10437    /// `ZX_ERR_ACCESS_DENIED`.
10438    ///
10439    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10440    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10441    ///
10442    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10443    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10444    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10445    ///
10446    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10447    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10448    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10449    pub fn r#link_into(
10450        &self,
10451        mut dst_parent_token: fdomain_client::Event,
10452        mut dst: &str,
10453    ) -> fidl::client::QueryResponseFut<
10454        LinkableLinkIntoResult,
10455        fdomain_client::fidl::FDomainResourceDialect,
10456    > {
10457        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
10458    }
10459}
10460
10461impl LinkableProxyInterface for LinkableProxy {
10462    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
10463        LinkableLinkIntoResult,
10464        fdomain_client::fidl::FDomainResourceDialect,
10465    >;
10466    fn r#link_into(
10467        &self,
10468        mut dst_parent_token: fdomain_client::Event,
10469        mut dst: &str,
10470    ) -> Self::LinkIntoResponseFut {
10471        fn _decode(
10472            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10473        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
10474            let _response = fidl::client::decode_transaction_body::<
10475                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10476                fdomain_client::fidl::FDomainResourceDialect,
10477                0x54f3949246a03e74,
10478            >(_buf?)?;
10479            Ok(_response.map(|x| x))
10480        }
10481        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
10482            (dst_parent_token, dst),
10483            0x54f3949246a03e74,
10484            fidl::encoding::DynamicFlags::empty(),
10485            _decode,
10486        )
10487    }
10488}
10489
10490pub struct LinkableEventStream {
10491    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
10492}
10493
10494impl std::marker::Unpin for LinkableEventStream {}
10495
10496impl futures::stream::FusedStream for LinkableEventStream {
10497    fn is_terminated(&self) -> bool {
10498        self.event_receiver.is_terminated()
10499    }
10500}
10501
10502impl futures::Stream for LinkableEventStream {
10503    type Item = Result<LinkableEvent, fidl::Error>;
10504
10505    fn poll_next(
10506        mut self: std::pin::Pin<&mut Self>,
10507        cx: &mut std::task::Context<'_>,
10508    ) -> std::task::Poll<Option<Self::Item>> {
10509        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10510            &mut self.event_receiver,
10511            cx
10512        )?) {
10513            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
10514            None => std::task::Poll::Ready(None),
10515        }
10516    }
10517}
10518
10519#[derive(Debug)]
10520pub enum LinkableEvent {}
10521
10522impl LinkableEvent {
10523    /// Decodes a message buffer as a [`LinkableEvent`].
10524    fn decode(
10525        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10526    ) -> Result<LinkableEvent, fidl::Error> {
10527        let (bytes, _handles) = buf.split_mut();
10528        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10529        debug_assert_eq!(tx_header.tx_id, 0);
10530        match tx_header.ordinal {
10531            _ => Err(fidl::Error::UnknownOrdinal {
10532                ordinal: tx_header.ordinal,
10533                protocol_name: <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10534            }),
10535        }
10536    }
10537}
10538
10539/// A Stream of incoming requests for fuchsia.io/Linkable.
10540pub struct LinkableRequestStream {
10541    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10542    is_terminated: bool,
10543}
10544
10545impl std::marker::Unpin for LinkableRequestStream {}
10546
10547impl futures::stream::FusedStream for LinkableRequestStream {
10548    fn is_terminated(&self) -> bool {
10549        self.is_terminated
10550    }
10551}
10552
10553impl fdomain_client::fidl::RequestStream for LinkableRequestStream {
10554    type Protocol = LinkableMarker;
10555    type ControlHandle = LinkableControlHandle;
10556
10557    fn from_channel(channel: fdomain_client::Channel) -> Self {
10558        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10559    }
10560
10561    fn control_handle(&self) -> Self::ControlHandle {
10562        LinkableControlHandle { inner: self.inner.clone() }
10563    }
10564
10565    fn into_inner(
10566        self,
10567    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
10568    {
10569        (self.inner, self.is_terminated)
10570    }
10571
10572    fn from_inner(
10573        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10574        is_terminated: bool,
10575    ) -> Self {
10576        Self { inner, is_terminated }
10577    }
10578}
10579
10580impl futures::Stream for LinkableRequestStream {
10581    type Item = Result<LinkableRequest, fidl::Error>;
10582
10583    fn poll_next(
10584        mut self: std::pin::Pin<&mut Self>,
10585        cx: &mut std::task::Context<'_>,
10586    ) -> std::task::Poll<Option<Self::Item>> {
10587        let this = &mut *self;
10588        if this.inner.check_shutdown(cx) {
10589            this.is_terminated = true;
10590            return std::task::Poll::Ready(None);
10591        }
10592        if this.is_terminated {
10593            panic!("polled LinkableRequestStream after completion");
10594        }
10595        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
10596            |bytes, handles| {
10597                match this.inner.channel().read_etc(cx, bytes, handles) {
10598                    std::task::Poll::Ready(Ok(())) => {}
10599                    std::task::Poll::Pending => return std::task::Poll::Pending,
10600                    std::task::Poll::Ready(Err(None)) => {
10601                        this.is_terminated = true;
10602                        return std::task::Poll::Ready(None);
10603                    }
10604                    std::task::Poll::Ready(Err(Some(e))) => {
10605                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10606                            e.into(),
10607                        ))));
10608                    }
10609                }
10610
10611                // A message has been received from the channel
10612                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10613
10614                std::task::Poll::Ready(Some(match header.ordinal {
10615                    0x54f3949246a03e74 => {
10616                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10617                        let mut req = fidl::new_empty!(
10618                            LinkableLinkIntoRequest,
10619                            fdomain_client::fidl::FDomainResourceDialect
10620                        );
10621                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
10622                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
10623                        Ok(LinkableRequest::LinkInto {
10624                            dst_parent_token: req.dst_parent_token,
10625                            dst: req.dst,
10626
10627                            responder: LinkableLinkIntoResponder {
10628                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10629                                tx_id: header.tx_id,
10630                            },
10631                        })
10632                    }
10633                    _ => Err(fidl::Error::UnknownOrdinal {
10634                        ordinal: header.ordinal,
10635                        protocol_name:
10636                            <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10637                    }),
10638                }))
10639            },
10640        )
10641    }
10642}
10643
10644#[derive(Debug)]
10645pub enum LinkableRequest {
10646    /// Creates a link to this this object with name `dst` in the directory represented by
10647    /// `dst_parent_token`.
10648    ///
10649    /// `dst` must be a resolved object name. Including "/" in the string will return
10650    /// `ZX_ERR_INVALID_ARGS`.
10651    ///
10652    /// This method requires the maximal set of rights supported by the filesystem for this object.
10653    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10654    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10655    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10656    /// `ZX_ERR_ACCESS_DENIED`.
10657    ///
10658    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10659    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10660    ///
10661    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10662    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10663    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10664    ///
10665    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10666    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10667    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10668    LinkInto {
10669        dst_parent_token: fdomain_client::Event,
10670        dst: String,
10671        responder: LinkableLinkIntoResponder,
10672    },
10673}
10674
10675impl LinkableRequest {
10676    #[allow(irrefutable_let_patterns)]
10677    pub fn into_link_into(
10678        self,
10679    ) -> Option<(fdomain_client::Event, String, LinkableLinkIntoResponder)> {
10680        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
10681            Some((dst_parent_token, dst, responder))
10682        } else {
10683            None
10684        }
10685    }
10686
10687    /// Name of the method defined in FIDL
10688    pub fn method_name(&self) -> &'static str {
10689        match *self {
10690            LinkableRequest::LinkInto { .. } => "link_into",
10691        }
10692    }
10693}
10694
10695#[derive(Debug, Clone)]
10696pub struct LinkableControlHandle {
10697    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10698}
10699
10700impl fdomain_client::fidl::ControlHandle for LinkableControlHandle {
10701    fn shutdown(&self) {
10702        self.inner.shutdown()
10703    }
10704
10705    fn is_closed(&self) -> bool {
10706        self.inner.channel().is_closed()
10707    }
10708    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
10709        self.inner.channel().on_closed()
10710    }
10711}
10712
10713impl LinkableControlHandle {}
10714
10715#[must_use = "FIDL methods require a response to be sent"]
10716#[derive(Debug)]
10717pub struct LinkableLinkIntoResponder {
10718    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
10719    tx_id: u32,
10720}
10721
10722/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
10723/// if the responder is dropped without sending a response, so that the client
10724/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10725impl std::ops::Drop for LinkableLinkIntoResponder {
10726    fn drop(&mut self) {
10727        self.control_handle.shutdown();
10728        // Safety: drops once, never accessed again
10729        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10730    }
10731}
10732
10733impl fdomain_client::fidl::Responder for LinkableLinkIntoResponder {
10734    type ControlHandle = LinkableControlHandle;
10735
10736    fn control_handle(&self) -> &LinkableControlHandle {
10737        &self.control_handle
10738    }
10739
10740    fn drop_without_shutdown(mut self) {
10741        // Safety: drops once, never accessed again due to mem::forget
10742        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10743        // Prevent Drop from running (which would shut down the channel)
10744        std::mem::forget(self);
10745    }
10746}
10747
10748impl LinkableLinkIntoResponder {
10749    /// Sends a response to the FIDL transaction.
10750    ///
10751    /// Sets the channel to shutdown if an error occurs.
10752    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10753        let _result = self.send_raw(result);
10754        if _result.is_err() {
10755            self.control_handle.shutdown();
10756        }
10757        self.drop_without_shutdown();
10758        _result
10759    }
10760
10761    /// Similar to "send" but does not shutdown the channel if an error occurs.
10762    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10763        let _result = self.send_raw(result);
10764        self.drop_without_shutdown();
10765        _result
10766    }
10767
10768    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10769        self.control_handle
10770            .inner
10771            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10772                result,
10773                self.tx_id,
10774                0x54f3949246a03e74,
10775                fidl::encoding::DynamicFlags::empty(),
10776            )
10777    }
10778}
10779
10780#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10781pub struct NodeMarker;
10782
10783impl fdomain_client::fidl::ProtocolMarker for NodeMarker {
10784    type Proxy = NodeProxy;
10785    type RequestStream = NodeRequestStream;
10786
10787    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
10788}
10789impl fdomain_client::fidl::DiscoverableProtocolMarker for NodeMarker {}
10790pub type NodeGetFlagsResult = Result<Flags, i32>;
10791pub type NodeSetFlagsResult = Result<(), i32>;
10792pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
10793pub type NodeUpdateAttributesResult = Result<(), i32>;
10794pub type NodeSyncResult = Result<(), i32>;
10795pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
10796pub type NodeSetExtendedAttributeResult = Result<(), i32>;
10797pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
10798
10799pub trait NodeProxyInterface: Send + Sync {
10800    fn r#clone(
10801        &self,
10802        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10803    ) -> Result<(), fidl::Error>;
10804    type CloseResponseFut: std::future::Future<
10805            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
10806        > + Send;
10807    fn r#close(&self) -> Self::CloseResponseFut;
10808    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
10809    fn r#query(&self) -> Self::QueryResponseFut;
10810    fn r#deprecated_clone(
10811        &self,
10812        flags: OpenFlags,
10813        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10814    ) -> Result<(), fidl::Error>;
10815    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
10816        + Send;
10817    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
10818    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
10819    fn r#deprecated_set_attr(
10820        &self,
10821        flags: NodeAttributeFlags,
10822        attributes: &NodeAttributes,
10823    ) -> Self::DeprecatedSetAttrResponseFut;
10824    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
10825        + Send;
10826    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
10827    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
10828        + Send;
10829    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
10830    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
10831        + Send;
10832    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
10833    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
10834        + Send;
10835    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
10836    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
10837        + Send;
10838    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
10839    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
10840        + Send;
10841    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
10842    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
10843        + Send;
10844    fn r#update_attributes(
10845        &self,
10846        payload: &MutableNodeAttributes,
10847    ) -> Self::UpdateAttributesResponseFut;
10848    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
10849    fn r#sync(&self) -> Self::SyncResponseFut;
10850    fn r#list_extended_attributes(
10851        &self,
10852        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
10853    ) -> Result<(), fidl::Error>;
10854    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
10855        + Send;
10856    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
10857    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
10858        + Send;
10859    fn r#set_extended_attribute(
10860        &self,
10861        name: &[u8],
10862        value: ExtendedAttributeValue,
10863        mode: SetExtendedAttributeMode,
10864    ) -> Self::SetExtendedAttributeResponseFut;
10865    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
10866        + Send;
10867    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
10868}
10869
10870#[derive(Debug, Clone)]
10871pub struct NodeProxy {
10872    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10873}
10874
10875impl fdomain_client::fidl::Proxy for NodeProxy {
10876    type Protocol = NodeMarker;
10877
10878    fn from_channel(inner: fdomain_client::Channel) -> Self {
10879        Self::new(inner)
10880    }
10881
10882    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10883        self.client.into_channel().map_err(|client| Self { client })
10884    }
10885
10886    fn as_channel(&self) -> &fdomain_client::Channel {
10887        self.client.as_channel()
10888    }
10889}
10890
10891impl NodeProxy {
10892    /// Create a new Proxy for fuchsia.io/Node.
10893    pub fn new(channel: fdomain_client::Channel) -> Self {
10894        let protocol_name = <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10895        Self { client: fidl::client::Client::new(channel, protocol_name) }
10896    }
10897
10898    /// Get a Stream of events from the remote end of the protocol.
10899    ///
10900    /// # Panics
10901    ///
10902    /// Panics if the event stream was already taken.
10903    pub fn take_event_stream(&self) -> NodeEventStream {
10904        NodeEventStream { event_receiver: self.client.take_event_receiver() }
10905    }
10906
10907    pub fn r#clone(
10908        &self,
10909        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10910    ) -> Result<(), fidl::Error> {
10911        NodeProxyInterface::r#clone(self, request)
10912    }
10913
10914    /// Terminates the connection.
10915    ///
10916    /// After calling `Close`, the client must not send any other requests.
10917    ///
10918    /// Servers, after sending the status response, should close the connection
10919    /// regardless of status and without sending an epitaph.
10920    ///
10921    /// Closing the client end of the channel should be semantically equivalent
10922    /// to calling `Close` without knowing when the close has completed or its
10923    /// status.
10924    pub fn r#close(
10925        &self,
10926    ) -> fidl::client::QueryResponseFut<
10927        fdomain_fuchsia_unknown::CloseableCloseResult,
10928        fdomain_client::fidl::FDomainResourceDialect,
10929    > {
10930        NodeProxyInterface::r#close(self)
10931    }
10932
10933    pub fn r#query(
10934        &self,
10935    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
10936        NodeProxyInterface::r#query(self)
10937    }
10938
10939    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
10940    pub fn r#deprecated_clone(
10941        &self,
10942        mut flags: OpenFlags,
10943        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10944    ) -> Result<(), fidl::Error> {
10945        NodeProxyInterface::r#deprecated_clone(self, flags, object)
10946    }
10947
10948    /// DEPRECATED - Use `Node.GetAttributes` instead.
10949    pub fn r#deprecated_get_attr(
10950        &self,
10951    ) -> fidl::client::QueryResponseFut<
10952        (i32, NodeAttributes),
10953        fdomain_client::fidl::FDomainResourceDialect,
10954    > {
10955        NodeProxyInterface::r#deprecated_get_attr(self)
10956    }
10957
10958    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
10959    pub fn r#deprecated_set_attr(
10960        &self,
10961        mut flags: NodeAttributeFlags,
10962        mut attributes: &NodeAttributes,
10963    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
10964        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
10965    }
10966
10967    /// [DEPRECATED - Use new GetFlags method instead.]
10968    pub fn r#deprecated_get_flags(
10969        &self,
10970    ) -> fidl::client::QueryResponseFut<
10971        (i32, OpenFlags),
10972        fdomain_client::fidl::FDomainResourceDialect,
10973    > {
10974        NodeProxyInterface::r#deprecated_get_flags(self)
10975    }
10976
10977    /// [DEPRECATED - Use new SetFlags method instead.]
10978    pub fn r#deprecated_set_flags(
10979        &self,
10980        mut flags: OpenFlags,
10981    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
10982        NodeProxyInterface::r#deprecated_set_flags(self, flags)
10983    }
10984
10985    /// Queries the flags that apply to this node after it has been opened/created. This method does
10986    /// not require any rights.
10987    ///
10988    /// Note that the final set of flags that apply to the connection may differ from those
10989    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
10990    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
10991    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
10992    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
10993    pub fn r#get_flags(
10994        &self,
10995    ) -> fidl::client::QueryResponseFut<
10996        NodeGetFlagsResult,
10997        fdomain_client::fidl::FDomainResourceDialect,
10998    > {
10999        NodeProxyInterface::r#get_flags(self)
11000    }
11001
11002    /// Sets the flags that apply to this node after it has been opened. This method does not
11003    /// require any rights.
11004    ///
11005    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
11006    /// clear append mode.
11007    ///
11008    /// Errors:
11009    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
11010    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
11011    pub fn r#set_flags(
11012        &self,
11013        mut flags: Flags,
11014    ) -> fidl::client::QueryResponseFut<
11015        NodeSetFlagsResult,
11016        fdomain_client::fidl::FDomainResourceDialect,
11017    > {
11018        NodeProxyInterface::r#set_flags(self, flags)
11019    }
11020
11021    /// Query the filesystem for filesystem-specific information.
11022    pub fn r#query_filesystem(
11023        &self,
11024    ) -> fidl::client::QueryResponseFut<
11025        (i32, Option<Box<FilesystemInfo>>),
11026        fdomain_client::fidl::FDomainResourceDialect,
11027    > {
11028        NodeProxyInterface::r#query_filesystem(self)
11029    }
11030
11031    /// Acquires information about the node.
11032    ///
11033    /// The attributes of a node should be stable, independent of the
11034    /// specific protocol used to access it.
11035    ///
11036    /// If a particular attribute is not applicable or not supported,
11037    /// filesystems should leave the corresponding field absent.
11038    ///
11039    /// + `query` a bit-mask specifying which attributes to fetch. The server
11040    ///   should not return more than necessary.
11041    /// - `attributes` the returned attributes.
11042    ///
11043    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11044    pub fn r#get_attributes(
11045        &self,
11046        mut query: NodeAttributesQuery,
11047    ) -> fidl::client::QueryResponseFut<
11048        NodeGetAttributesResult,
11049        fdomain_client::fidl::FDomainResourceDialect,
11050    > {
11051        NodeProxyInterface::r#get_attributes(self, query)
11052    }
11053
11054    /// Updates information about the node.
11055    ///
11056    /// + `attributes` the presence of a table field in `attributes` indicates
11057    /// the intent to update the corresponding attribute.
11058    ///
11059    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
11060    ///
11061    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11062    pub fn r#update_attributes(
11063        &self,
11064        mut payload: &MutableNodeAttributes,
11065    ) -> fidl::client::QueryResponseFut<
11066        NodeUpdateAttributesResult,
11067        fdomain_client::fidl::FDomainResourceDialect,
11068    > {
11069        NodeProxyInterface::r#update_attributes(self, payload)
11070    }
11071
11072    /// Synchronizes updates to the node to the underlying media, if it exists.
11073    ///
11074    /// This method will return when the filesystem server has flushed the
11075    /// relevant updates to the underlying media, but does not guarantee the
11076    /// underlying media has persisted the information, nor that any information
11077    /// is committed to hardware. Clients may use `Sync` to ensure ordering
11078    /// between operations.
11079    ///
11080    /// This method does not require any rights.
11081    pub fn r#sync(
11082        &self,
11083    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
11084    {
11085        NodeProxyInterface::r#sync(self)
11086    }
11087
11088    /// Creates an iterator over all the extended attribute names associated
11089    /// with this node. If an error occurs it is returned as an epitaph on the
11090    /// iterator request channel, and then the channel is closed.
11091    ///
11092    /// GetExtendedAttributes can be used with any of these names to retrieve
11093    /// the associated value.
11094    ///
11095    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11096    pub fn r#list_extended_attributes(
11097        &self,
11098        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11099    ) -> Result<(), fidl::Error> {
11100        NodeProxyInterface::r#list_extended_attributes(self, iterator)
11101    }
11102
11103    /// Get the value associated with the given attribute `name` for this node.
11104    ///
11105    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
11106    /// particular structure is imposed on them.
11107    ///
11108    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11109    pub fn r#get_extended_attribute(
11110        &self,
11111        mut name: &[u8],
11112    ) -> fidl::client::QueryResponseFut<
11113        NodeGetExtendedAttributeResult,
11114        fdomain_client::fidl::FDomainResourceDialect,
11115    > {
11116        NodeProxyInterface::r#get_extended_attribute(self, name)
11117    }
11118
11119    /// Set the value for the given attribute `name` to `value` for this node.
11120    ///
11121    /// The attribute name may exist, in which case the attribute is updated.
11122    /// If the attribute doesn't exist, it is created. The name should have no
11123    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
11124    ///
11125    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11126    pub fn r#set_extended_attribute(
11127        &self,
11128        mut name: &[u8],
11129        mut value: ExtendedAttributeValue,
11130        mut mode: SetExtendedAttributeMode,
11131    ) -> fidl::client::QueryResponseFut<
11132        NodeSetExtendedAttributeResult,
11133        fdomain_client::fidl::FDomainResourceDialect,
11134    > {
11135        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
11136    }
11137
11138    /// Remove the specified extended attribute.
11139    ///
11140    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
11141    ///
11142    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11143    pub fn r#remove_extended_attribute(
11144        &self,
11145        mut name: &[u8],
11146    ) -> fidl::client::QueryResponseFut<
11147        NodeRemoveExtendedAttributeResult,
11148        fdomain_client::fidl::FDomainResourceDialect,
11149    > {
11150        NodeProxyInterface::r#remove_extended_attribute(self, name)
11151    }
11152}
11153
11154impl NodeProxyInterface for NodeProxy {
11155    fn r#clone(
11156        &self,
11157        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11158    ) -> Result<(), fidl::Error> {
11159        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
11160            (request,),
11161            0x20d8a7aba2168a79,
11162            fidl::encoding::DynamicFlags::empty(),
11163        )
11164    }
11165
11166    type CloseResponseFut = fidl::client::QueryResponseFut<
11167        fdomain_fuchsia_unknown::CloseableCloseResult,
11168        fdomain_client::fidl::FDomainResourceDialect,
11169    >;
11170    fn r#close(&self) -> Self::CloseResponseFut {
11171        fn _decode(
11172            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11173        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
11174            let _response = fidl::client::decode_transaction_body::<
11175                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11176                fdomain_client::fidl::FDomainResourceDialect,
11177                0x5ac5d459ad7f657e,
11178            >(_buf?)?;
11179            Ok(_response.map(|x| x))
11180        }
11181        self.client.send_query_and_decode::<
11182            fidl::encoding::EmptyPayload,
11183            fdomain_fuchsia_unknown::CloseableCloseResult,
11184        >(
11185            (),
11186            0x5ac5d459ad7f657e,
11187            fidl::encoding::DynamicFlags::empty(),
11188            _decode,
11189        )
11190    }
11191
11192    type QueryResponseFut =
11193        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
11194    fn r#query(&self) -> Self::QueryResponseFut {
11195        fn _decode(
11196            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11197        ) -> Result<Vec<u8>, fidl::Error> {
11198            let _response = fidl::client::decode_transaction_body::<
11199                fdomain_fuchsia_unknown::QueryableQueryResponse,
11200                fdomain_client::fidl::FDomainResourceDialect,
11201                0x2658edee9decfc06,
11202            >(_buf?)?;
11203            Ok(_response.protocol)
11204        }
11205        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
11206            (),
11207            0x2658edee9decfc06,
11208            fidl::encoding::DynamicFlags::empty(),
11209            _decode,
11210        )
11211    }
11212
11213    fn r#deprecated_clone(
11214        &self,
11215        mut flags: OpenFlags,
11216        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11217    ) -> Result<(), fidl::Error> {
11218        self.client.send::<NodeDeprecatedCloneRequest>(
11219            (flags, object),
11220            0x5a61678f293ce16f,
11221            fidl::encoding::DynamicFlags::FLEXIBLE,
11222        )
11223    }
11224
11225    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
11226        (i32, NodeAttributes),
11227        fdomain_client::fidl::FDomainResourceDialect,
11228    >;
11229    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
11230        fn _decode(
11231            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11232        ) -> Result<(i32, NodeAttributes), fidl::Error> {
11233            let _response = fidl::client::decode_transaction_body::<
11234                NodeDeprecatedGetAttrResponse,
11235                fdomain_client::fidl::FDomainResourceDialect,
11236                0x78985e216314dafd,
11237            >(_buf?)?;
11238            Ok((_response.s, _response.attributes))
11239        }
11240        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
11241            (),
11242            0x78985e216314dafd,
11243            fidl::encoding::DynamicFlags::empty(),
11244            _decode,
11245        )
11246    }
11247
11248    type DeprecatedSetAttrResponseFut =
11249        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11250    fn r#deprecated_set_attr(
11251        &self,
11252        mut flags: NodeAttributeFlags,
11253        mut attributes: &NodeAttributes,
11254    ) -> Self::DeprecatedSetAttrResponseFut {
11255        fn _decode(
11256            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11257        ) -> Result<i32, fidl::Error> {
11258            let _response = fidl::client::decode_transaction_body::<
11259                NodeDeprecatedSetAttrResponse,
11260                fdomain_client::fidl::FDomainResourceDialect,
11261                0x4186c0f40d938f46,
11262            >(_buf?)?;
11263            Ok(_response.s)
11264        }
11265        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
11266            (flags, attributes),
11267            0x4186c0f40d938f46,
11268            fidl::encoding::DynamicFlags::empty(),
11269            _decode,
11270        )
11271    }
11272
11273    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
11274        (i32, OpenFlags),
11275        fdomain_client::fidl::FDomainResourceDialect,
11276    >;
11277    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
11278        fn _decode(
11279            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11280        ) -> Result<(i32, OpenFlags), fidl::Error> {
11281            let _response = fidl::client::decode_transaction_body::<
11282                NodeDeprecatedGetFlagsResponse,
11283                fdomain_client::fidl::FDomainResourceDialect,
11284                0x5b88fffb8eda3aa1,
11285            >(_buf?)?;
11286            Ok((_response.s, _response.flags))
11287        }
11288        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
11289            (),
11290            0x5b88fffb8eda3aa1,
11291            fidl::encoding::DynamicFlags::empty(),
11292            _decode,
11293        )
11294    }
11295
11296    type DeprecatedSetFlagsResponseFut =
11297        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11298    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
11299        fn _decode(
11300            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11301        ) -> Result<i32, fidl::Error> {
11302            let _response = fidl::client::decode_transaction_body::<
11303                NodeDeprecatedSetFlagsResponse,
11304                fdomain_client::fidl::FDomainResourceDialect,
11305                0x5295b76c71fde733,
11306            >(_buf?)?;
11307            Ok(_response.s)
11308        }
11309        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
11310            (flags,),
11311            0x5295b76c71fde733,
11312            fidl::encoding::DynamicFlags::empty(),
11313            _decode,
11314        )
11315    }
11316
11317    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
11318        NodeGetFlagsResult,
11319        fdomain_client::fidl::FDomainResourceDialect,
11320    >;
11321    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
11322        fn _decode(
11323            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11324        ) -> Result<NodeGetFlagsResult, fidl::Error> {
11325            let _response = fidl::client::decode_transaction_body::<
11326                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
11327                fdomain_client::fidl::FDomainResourceDialect,
11328                0x176eb318f64ec23,
11329            >(_buf?)?
11330            .into_result_fdomain::<NodeMarker>("get_flags")?;
11331            Ok(_response.map(|x| x.flags))
11332        }
11333        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
11334            (),
11335            0x176eb318f64ec23,
11336            fidl::encoding::DynamicFlags::FLEXIBLE,
11337            _decode,
11338        )
11339    }
11340
11341    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
11342        NodeSetFlagsResult,
11343        fdomain_client::fidl::FDomainResourceDialect,
11344    >;
11345    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
11346        fn _decode(
11347            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11348        ) -> Result<NodeSetFlagsResult, fidl::Error> {
11349            let _response = fidl::client::decode_transaction_body::<
11350                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
11351                fdomain_client::fidl::FDomainResourceDialect,
11352                0x55a8028685791ea8,
11353            >(_buf?)?
11354            .into_result_fdomain::<NodeMarker>("set_flags")?;
11355            Ok(_response.map(|x| x))
11356        }
11357        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
11358            (flags,),
11359            0x55a8028685791ea8,
11360            fidl::encoding::DynamicFlags::FLEXIBLE,
11361            _decode,
11362        )
11363    }
11364
11365    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
11366        (i32, Option<Box<FilesystemInfo>>),
11367        fdomain_client::fidl::FDomainResourceDialect,
11368    >;
11369    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
11370        fn _decode(
11371            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11372        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
11373            let _response = fidl::client::decode_transaction_body::<
11374                NodeQueryFilesystemResponse,
11375                fdomain_client::fidl::FDomainResourceDialect,
11376                0x6f344a1c6b0a0610,
11377            >(_buf?)?;
11378            Ok((_response.s, _response.info))
11379        }
11380        self.client.send_query_and_decode::<
11381            fidl::encoding::EmptyPayload,
11382            (i32, Option<Box<FilesystemInfo>>),
11383        >(
11384            (),
11385            0x6f344a1c6b0a0610,
11386            fidl::encoding::DynamicFlags::empty(),
11387            _decode,
11388        )
11389    }
11390
11391    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
11392        NodeGetAttributesResult,
11393        fdomain_client::fidl::FDomainResourceDialect,
11394    >;
11395    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
11396        fn _decode(
11397            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11398        ) -> Result<NodeGetAttributesResult, fidl::Error> {
11399            let _response = fidl::client::decode_transaction_body::<
11400                fidl::encoding::ResultType<NodeAttributes2, i32>,
11401                fdomain_client::fidl::FDomainResourceDialect,
11402                0x3d4396a638ea053b,
11403            >(_buf?)?;
11404            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
11405        }
11406        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
11407            (query,),
11408            0x3d4396a638ea053b,
11409            fidl::encoding::DynamicFlags::empty(),
11410            _decode,
11411        )
11412    }
11413
11414    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
11415        NodeUpdateAttributesResult,
11416        fdomain_client::fidl::FDomainResourceDialect,
11417    >;
11418    fn r#update_attributes(
11419        &self,
11420        mut payload: &MutableNodeAttributes,
11421    ) -> Self::UpdateAttributesResponseFut {
11422        fn _decode(
11423            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11424        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
11425            let _response = fidl::client::decode_transaction_body::<
11426                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11427                fdomain_client::fidl::FDomainResourceDialect,
11428                0x3308c1da5a89bf08,
11429            >(_buf?)?;
11430            Ok(_response.map(|x| x))
11431        }
11432        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
11433            payload,
11434            0x3308c1da5a89bf08,
11435            fidl::encoding::DynamicFlags::empty(),
11436            _decode,
11437        )
11438    }
11439
11440    type SyncResponseFut = fidl::client::QueryResponseFut<
11441        NodeSyncResult,
11442        fdomain_client::fidl::FDomainResourceDialect,
11443    >;
11444    fn r#sync(&self) -> Self::SyncResponseFut {
11445        fn _decode(
11446            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11447        ) -> Result<NodeSyncResult, fidl::Error> {
11448            let _response = fidl::client::decode_transaction_body::<
11449                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11450                fdomain_client::fidl::FDomainResourceDialect,
11451                0x2c5c27ca0ab5dc49,
11452            >(_buf?)?;
11453            Ok(_response.map(|x| x))
11454        }
11455        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
11456            (),
11457            0x2c5c27ca0ab5dc49,
11458            fidl::encoding::DynamicFlags::empty(),
11459            _decode,
11460        )
11461    }
11462
11463    fn r#list_extended_attributes(
11464        &self,
11465        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11466    ) -> Result<(), fidl::Error> {
11467        self.client.send::<NodeListExtendedAttributesRequest>(
11468            (iterator,),
11469            0x4b61033de007fcd0,
11470            fidl::encoding::DynamicFlags::empty(),
11471        )
11472    }
11473
11474    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11475        NodeGetExtendedAttributeResult,
11476        fdomain_client::fidl::FDomainResourceDialect,
11477    >;
11478    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
11479        fn _decode(
11480            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11481        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
11482            let _response = fidl::client::decode_transaction_body::<
11483                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
11484                fdomain_client::fidl::FDomainResourceDialect,
11485                0x45ffa3ccfdeb76db,
11486            >(_buf?)?;
11487            Ok(_response.map(|x| x))
11488        }
11489        self.client.send_query_and_decode::<
11490            NodeGetExtendedAttributeRequest,
11491            NodeGetExtendedAttributeResult,
11492        >(
11493            (name,),
11494            0x45ffa3ccfdeb76db,
11495            fidl::encoding::DynamicFlags::empty(),
11496            _decode,
11497        )
11498    }
11499
11500    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11501        NodeSetExtendedAttributeResult,
11502        fdomain_client::fidl::FDomainResourceDialect,
11503    >;
11504    fn r#set_extended_attribute(
11505        &self,
11506        mut name: &[u8],
11507        mut value: ExtendedAttributeValue,
11508        mut mode: SetExtendedAttributeMode,
11509    ) -> Self::SetExtendedAttributeResponseFut {
11510        fn _decode(
11511            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11512        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
11513            let _response = fidl::client::decode_transaction_body::<
11514                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11515                fdomain_client::fidl::FDomainResourceDialect,
11516                0x4a951362f681f23c,
11517            >(_buf?)?;
11518            Ok(_response.map(|x| x))
11519        }
11520        self.client.send_query_and_decode::<
11521            NodeSetExtendedAttributeRequest,
11522            NodeSetExtendedAttributeResult,
11523        >(
11524            (name, &mut value, mode,),
11525            0x4a951362f681f23c,
11526            fidl::encoding::DynamicFlags::empty(),
11527            _decode,
11528        )
11529    }
11530
11531    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11532        NodeRemoveExtendedAttributeResult,
11533        fdomain_client::fidl::FDomainResourceDialect,
11534    >;
11535    fn r#remove_extended_attribute(
11536        &self,
11537        mut name: &[u8],
11538    ) -> Self::RemoveExtendedAttributeResponseFut {
11539        fn _decode(
11540            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11541        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
11542            let _response = fidl::client::decode_transaction_body::<
11543                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11544                fdomain_client::fidl::FDomainResourceDialect,
11545                0x7a0b9f3a9bf9032d,
11546            >(_buf?)?;
11547            Ok(_response.map(|x| x))
11548        }
11549        self.client.send_query_and_decode::<
11550            NodeRemoveExtendedAttributeRequest,
11551            NodeRemoveExtendedAttributeResult,
11552        >(
11553            (name,),
11554            0x7a0b9f3a9bf9032d,
11555            fidl::encoding::DynamicFlags::empty(),
11556            _decode,
11557        )
11558    }
11559}
11560
11561pub struct NodeEventStream {
11562    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
11563}
11564
11565impl std::marker::Unpin for NodeEventStream {}
11566
11567impl futures::stream::FusedStream for NodeEventStream {
11568    fn is_terminated(&self) -> bool {
11569        self.event_receiver.is_terminated()
11570    }
11571}
11572
11573impl futures::Stream for NodeEventStream {
11574    type Item = Result<NodeEvent, fidl::Error>;
11575
11576    fn poll_next(
11577        mut self: std::pin::Pin<&mut Self>,
11578        cx: &mut std::task::Context<'_>,
11579    ) -> std::task::Poll<Option<Self::Item>> {
11580        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11581            &mut self.event_receiver,
11582            cx
11583        )?) {
11584            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
11585            None => std::task::Poll::Ready(None),
11586        }
11587    }
11588}
11589
11590#[derive(Debug)]
11591pub enum NodeEvent {
11592    OnOpen_ {
11593        s: i32,
11594        info: Option<Box<NodeInfoDeprecated>>,
11595    },
11596    OnRepresentation {
11597        payload: Representation,
11598    },
11599    #[non_exhaustive]
11600    _UnknownEvent {
11601        /// Ordinal of the event that was sent.
11602        ordinal: u64,
11603    },
11604}
11605
11606impl NodeEvent {
11607    #[allow(irrefutable_let_patterns)]
11608    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
11609        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
11610    }
11611    #[allow(irrefutable_let_patterns)]
11612    pub fn into_on_representation(self) -> Option<Representation> {
11613        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
11614    }
11615
11616    /// Decodes a message buffer as a [`NodeEvent`].
11617    fn decode(
11618        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11619    ) -> Result<NodeEvent, fidl::Error> {
11620        let (bytes, _handles) = buf.split_mut();
11621        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11622        debug_assert_eq!(tx_header.tx_id, 0);
11623        match tx_header.ordinal {
11624            0x7fc7bbb1dbfd1972 => {
11625                let mut out = fidl::new_empty!(
11626                    NodeOnOpenRequest,
11627                    fdomain_client::fidl::FDomainResourceDialect
11628                );
11629                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
11630                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
11631            }
11632            0x5cb40567d80a510c => {
11633                let mut out =
11634                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
11635                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
11636                Ok((NodeEvent::OnRepresentation { payload: out }))
11637            }
11638            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11639                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11640            }
11641            _ => Err(fidl::Error::UnknownOrdinal {
11642                ordinal: tx_header.ordinal,
11643                protocol_name: <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
11644            }),
11645        }
11646    }
11647}
11648
11649/// A Stream of incoming requests for fuchsia.io/Node.
11650pub struct NodeRequestStream {
11651    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11652    is_terminated: bool,
11653}
11654
11655impl std::marker::Unpin for NodeRequestStream {}
11656
11657impl futures::stream::FusedStream for NodeRequestStream {
11658    fn is_terminated(&self) -> bool {
11659        self.is_terminated
11660    }
11661}
11662
11663impl fdomain_client::fidl::RequestStream for NodeRequestStream {
11664    type Protocol = NodeMarker;
11665    type ControlHandle = NodeControlHandle;
11666
11667    fn from_channel(channel: fdomain_client::Channel) -> Self {
11668        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11669    }
11670
11671    fn control_handle(&self) -> Self::ControlHandle {
11672        NodeControlHandle { inner: self.inner.clone() }
11673    }
11674
11675    fn into_inner(
11676        self,
11677    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
11678    {
11679        (self.inner, self.is_terminated)
11680    }
11681
11682    fn from_inner(
11683        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11684        is_terminated: bool,
11685    ) -> Self {
11686        Self { inner, is_terminated }
11687    }
11688}
11689
11690impl futures::Stream for NodeRequestStream {
11691    type Item = Result<NodeRequest, fidl::Error>;
11692
11693    fn poll_next(
11694        mut self: std::pin::Pin<&mut Self>,
11695        cx: &mut std::task::Context<'_>,
11696    ) -> std::task::Poll<Option<Self::Item>> {
11697        let this = &mut *self;
11698        if this.inner.check_shutdown(cx) {
11699            this.is_terminated = true;
11700            return std::task::Poll::Ready(None);
11701        }
11702        if this.is_terminated {
11703            panic!("polled NodeRequestStream after completion");
11704        }
11705        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
11706            |bytes, handles| {
11707                match this.inner.channel().read_etc(cx, bytes, handles) {
11708                    std::task::Poll::Ready(Ok(())) => {}
11709                    std::task::Poll::Pending => return std::task::Poll::Pending,
11710                    std::task::Poll::Ready(Err(None)) => {
11711                        this.is_terminated = true;
11712                        return std::task::Poll::Ready(None);
11713                    }
11714                    std::task::Poll::Ready(Err(Some(e))) => {
11715                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11716                            e.into(),
11717                        ))));
11718                    }
11719                }
11720
11721                // A message has been received from the channel
11722                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11723
11724                std::task::Poll::Ready(Some(match header.ordinal {
11725                    0x20d8a7aba2168a79 => {
11726                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11727                        let mut req = fidl::new_empty!(
11728                            fdomain_fuchsia_unknown::CloneableCloneRequest,
11729                            fdomain_client::fidl::FDomainResourceDialect
11730                        );
11731                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11732                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11733                        Ok(NodeRequest::Clone { request: req.request, control_handle })
11734                    }
11735                    0x5ac5d459ad7f657e => {
11736                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11737                        let mut req = fidl::new_empty!(
11738                            fidl::encoding::EmptyPayload,
11739                            fdomain_client::fidl::FDomainResourceDialect
11740                        );
11741                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11742                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11743                        Ok(NodeRequest::Close {
11744                            responder: NodeCloseResponder {
11745                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11746                                tx_id: header.tx_id,
11747                            },
11748                        })
11749                    }
11750                    0x2658edee9decfc06 => {
11751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11752                        let mut req = fidl::new_empty!(
11753                            fidl::encoding::EmptyPayload,
11754                            fdomain_client::fidl::FDomainResourceDialect
11755                        );
11756                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11757                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11758                        Ok(NodeRequest::Query {
11759                            responder: NodeQueryResponder {
11760                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11761                                tx_id: header.tx_id,
11762                            },
11763                        })
11764                    }
11765                    0x5a61678f293ce16f => {
11766                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11767                        let mut req = fidl::new_empty!(
11768                            NodeDeprecatedCloneRequest,
11769                            fdomain_client::fidl::FDomainResourceDialect
11770                        );
11771                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11772                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11773                        Ok(NodeRequest::DeprecatedClone {
11774                            flags: req.flags,
11775                            object: req.object,
11776
11777                            control_handle,
11778                        })
11779                    }
11780                    0x78985e216314dafd => {
11781                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11782                        let mut req = fidl::new_empty!(
11783                            fidl::encoding::EmptyPayload,
11784                            fdomain_client::fidl::FDomainResourceDialect
11785                        );
11786                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11787                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11788                        Ok(NodeRequest::DeprecatedGetAttr {
11789                            responder: NodeDeprecatedGetAttrResponder {
11790                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11791                                tx_id: header.tx_id,
11792                            },
11793                        })
11794                    }
11795                    0x4186c0f40d938f46 => {
11796                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11797                        let mut req = fidl::new_empty!(
11798                            NodeDeprecatedSetAttrRequest,
11799                            fdomain_client::fidl::FDomainResourceDialect
11800                        );
11801                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
11802                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11803                        Ok(NodeRequest::DeprecatedSetAttr {
11804                            flags: req.flags,
11805                            attributes: req.attributes,
11806
11807                            responder: NodeDeprecatedSetAttrResponder {
11808                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11809                                tx_id: header.tx_id,
11810                            },
11811                        })
11812                    }
11813                    0x5b88fffb8eda3aa1 => {
11814                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11815                        let mut req = fidl::new_empty!(
11816                            fidl::encoding::EmptyPayload,
11817                            fdomain_client::fidl::FDomainResourceDialect
11818                        );
11819                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11820                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11821                        Ok(NodeRequest::DeprecatedGetFlags {
11822                            responder: NodeDeprecatedGetFlagsResponder {
11823                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11824                                tx_id: header.tx_id,
11825                            },
11826                        })
11827                    }
11828                    0x5295b76c71fde733 => {
11829                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11830                        let mut req = fidl::new_empty!(
11831                            NodeDeprecatedSetFlagsRequest,
11832                            fdomain_client::fidl::FDomainResourceDialect
11833                        );
11834                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11835                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11836                        Ok(NodeRequest::DeprecatedSetFlags {
11837                            flags: req.flags,
11838
11839                            responder: NodeDeprecatedSetFlagsResponder {
11840                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11841                                tx_id: header.tx_id,
11842                            },
11843                        })
11844                    }
11845                    0x176eb318f64ec23 => {
11846                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11847                        let mut req = fidl::new_empty!(
11848                            fidl::encoding::EmptyPayload,
11849                            fdomain_client::fidl::FDomainResourceDialect
11850                        );
11851                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11852                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11853                        Ok(NodeRequest::GetFlags {
11854                            responder: NodeGetFlagsResponder {
11855                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11856                                tx_id: header.tx_id,
11857                            },
11858                        })
11859                    }
11860                    0x55a8028685791ea8 => {
11861                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11862                        let mut req = fidl::new_empty!(
11863                            NodeSetFlagsRequest,
11864                            fdomain_client::fidl::FDomainResourceDialect
11865                        );
11866                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11867                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11868                        Ok(NodeRequest::SetFlags {
11869                            flags: req.flags,
11870
11871                            responder: NodeSetFlagsResponder {
11872                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11873                                tx_id: header.tx_id,
11874                            },
11875                        })
11876                    }
11877                    0x6f344a1c6b0a0610 => {
11878                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11879                        let mut req = fidl::new_empty!(
11880                            fidl::encoding::EmptyPayload,
11881                            fdomain_client::fidl::FDomainResourceDialect
11882                        );
11883                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11884                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11885                        Ok(NodeRequest::QueryFilesystem {
11886                            responder: NodeQueryFilesystemResponder {
11887                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11888                                tx_id: header.tx_id,
11889                            },
11890                        })
11891                    }
11892                    0x3d4396a638ea053b => {
11893                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11894                        let mut req = fidl::new_empty!(
11895                            NodeGetAttributesRequest,
11896                            fdomain_client::fidl::FDomainResourceDialect
11897                        );
11898                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11899                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11900                        Ok(NodeRequest::GetAttributes {
11901                            query: req.query,
11902
11903                            responder: NodeGetAttributesResponder {
11904                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11905                                tx_id: header.tx_id,
11906                            },
11907                        })
11908                    }
11909                    0x3308c1da5a89bf08 => {
11910                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11911                        let mut req = fidl::new_empty!(
11912                            MutableNodeAttributes,
11913                            fdomain_client::fidl::FDomainResourceDialect
11914                        );
11915                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
11916                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11917                        Ok(NodeRequest::UpdateAttributes {
11918                            payload: req,
11919                            responder: NodeUpdateAttributesResponder {
11920                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11921                                tx_id: header.tx_id,
11922                            },
11923                        })
11924                    }
11925                    0x2c5c27ca0ab5dc49 => {
11926                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11927                        let mut req = fidl::new_empty!(
11928                            fidl::encoding::EmptyPayload,
11929                            fdomain_client::fidl::FDomainResourceDialect
11930                        );
11931                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11932                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11933                        Ok(NodeRequest::Sync {
11934                            responder: NodeSyncResponder {
11935                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11936                                tx_id: header.tx_id,
11937                            },
11938                        })
11939                    }
11940                    0x4b61033de007fcd0 => {
11941                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11942                        let mut req = fidl::new_empty!(
11943                            NodeListExtendedAttributesRequest,
11944                            fdomain_client::fidl::FDomainResourceDialect
11945                        );
11946                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11947                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11948                        Ok(NodeRequest::ListExtendedAttributes {
11949                            iterator: req.iterator,
11950
11951                            control_handle,
11952                        })
11953                    }
11954                    0x45ffa3ccfdeb76db => {
11955                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11956                        let mut req = fidl::new_empty!(
11957                            NodeGetExtendedAttributeRequest,
11958                            fdomain_client::fidl::FDomainResourceDialect
11959                        );
11960                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
11961                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11962                        Ok(NodeRequest::GetExtendedAttribute {
11963                            name: req.name,
11964
11965                            responder: NodeGetExtendedAttributeResponder {
11966                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11967                                tx_id: header.tx_id,
11968                            },
11969                        })
11970                    }
11971                    0x4a951362f681f23c => {
11972                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11973                        let mut req = fidl::new_empty!(
11974                            NodeSetExtendedAttributeRequest,
11975                            fdomain_client::fidl::FDomainResourceDialect
11976                        );
11977                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
11978                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11979                        Ok(NodeRequest::SetExtendedAttribute {
11980                            name: req.name,
11981                            value: req.value,
11982                            mode: req.mode,
11983
11984                            responder: NodeSetExtendedAttributeResponder {
11985                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11986                                tx_id: header.tx_id,
11987                            },
11988                        })
11989                    }
11990                    0x7a0b9f3a9bf9032d => {
11991                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11992                        let mut req = fidl::new_empty!(
11993                            NodeRemoveExtendedAttributeRequest,
11994                            fdomain_client::fidl::FDomainResourceDialect
11995                        );
11996                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
11997                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11998                        Ok(NodeRequest::RemoveExtendedAttribute {
11999                            name: req.name,
12000
12001                            responder: NodeRemoveExtendedAttributeResponder {
12002                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12003                                tx_id: header.tx_id,
12004                            },
12005                        })
12006                    }
12007                    _ if header.tx_id == 0
12008                        && header
12009                            .dynamic_flags()
12010                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12011                    {
12012                        Ok(NodeRequest::_UnknownMethod {
12013                            ordinal: header.ordinal,
12014                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12015                            method_type: fidl::MethodType::OneWay,
12016                        })
12017                    }
12018                    _ if header
12019                        .dynamic_flags()
12020                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12021                    {
12022                        this.inner.send_framework_err(
12023                            fidl::encoding::FrameworkErr::UnknownMethod,
12024                            header.tx_id,
12025                            header.ordinal,
12026                            header.dynamic_flags(),
12027                            (bytes, handles),
12028                        )?;
12029                        Ok(NodeRequest::_UnknownMethod {
12030                            ordinal: header.ordinal,
12031                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12032                            method_type: fidl::MethodType::TwoWay,
12033                        })
12034                    }
12035                    _ => Err(fidl::Error::UnknownOrdinal {
12036                        ordinal: header.ordinal,
12037                        protocol_name:
12038                            <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
12039                    }),
12040                }))
12041            },
12042        )
12043    }
12044}
12045
12046/// Node defines the minimal interface for entities which can be accessed in a filesystem.
12047#[derive(Debug)]
12048pub enum NodeRequest {
12049    Clone {
12050        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12051        control_handle: NodeControlHandle,
12052    },
12053    /// Terminates the connection.
12054    ///
12055    /// After calling `Close`, the client must not send any other requests.
12056    ///
12057    /// Servers, after sending the status response, should close the connection
12058    /// regardless of status and without sending an epitaph.
12059    ///
12060    /// Closing the client end of the channel should be semantically equivalent
12061    /// to calling `Close` without knowing when the close has completed or its
12062    /// status.
12063    Close {
12064        responder: NodeCloseResponder,
12065    },
12066    Query {
12067        responder: NodeQueryResponder,
12068    },
12069    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12070    DeprecatedClone {
12071        flags: OpenFlags,
12072        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
12073        control_handle: NodeControlHandle,
12074    },
12075    /// DEPRECATED - Use `Node.GetAttributes` instead.
12076    DeprecatedGetAttr {
12077        responder: NodeDeprecatedGetAttrResponder,
12078    },
12079    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12080    DeprecatedSetAttr {
12081        flags: NodeAttributeFlags,
12082        attributes: NodeAttributes,
12083        responder: NodeDeprecatedSetAttrResponder,
12084    },
12085    /// [DEPRECATED - Use new GetFlags method instead.]
12086    DeprecatedGetFlags {
12087        responder: NodeDeprecatedGetFlagsResponder,
12088    },
12089    /// [DEPRECATED - Use new SetFlags method instead.]
12090    DeprecatedSetFlags {
12091        flags: OpenFlags,
12092        responder: NodeDeprecatedSetFlagsResponder,
12093    },
12094    /// Queries the flags that apply to this node after it has been opened/created. This method does
12095    /// not require any rights.
12096    ///
12097    /// Note that the final set of flags that apply to the connection may differ from those
12098    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
12099    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
12100    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
12101    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
12102    GetFlags {
12103        responder: NodeGetFlagsResponder,
12104    },
12105    /// Sets the flags that apply to this node after it has been opened. This method does not
12106    /// require any rights.
12107    ///
12108    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
12109    /// clear append mode.
12110    ///
12111    /// Errors:
12112    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
12113    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
12114    SetFlags {
12115        flags: Flags,
12116        responder: NodeSetFlagsResponder,
12117    },
12118    /// Query the filesystem for filesystem-specific information.
12119    QueryFilesystem {
12120        responder: NodeQueryFilesystemResponder,
12121    },
12122    /// Acquires information about the node.
12123    ///
12124    /// The attributes of a node should be stable, independent of the
12125    /// specific protocol used to access it.
12126    ///
12127    /// If a particular attribute is not applicable or not supported,
12128    /// filesystems should leave the corresponding field absent.
12129    ///
12130    /// + `query` a bit-mask specifying which attributes to fetch. The server
12131    ///   should not return more than necessary.
12132    /// - `attributes` the returned attributes.
12133    ///
12134    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12135    GetAttributes {
12136        query: NodeAttributesQuery,
12137        responder: NodeGetAttributesResponder,
12138    },
12139    /// Updates information about the node.
12140    ///
12141    /// + `attributes` the presence of a table field in `attributes` indicates
12142    /// the intent to update the corresponding attribute.
12143    ///
12144    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
12145    ///
12146    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12147    UpdateAttributes {
12148        payload: MutableNodeAttributes,
12149        responder: NodeUpdateAttributesResponder,
12150    },
12151    /// Synchronizes updates to the node to the underlying media, if it exists.
12152    ///
12153    /// This method will return when the filesystem server has flushed the
12154    /// relevant updates to the underlying media, but does not guarantee the
12155    /// underlying media has persisted the information, nor that any information
12156    /// is committed to hardware. Clients may use `Sync` to ensure ordering
12157    /// between operations.
12158    ///
12159    /// This method does not require any rights.
12160    Sync {
12161        responder: NodeSyncResponder,
12162    },
12163    /// Creates an iterator over all the extended attribute names associated
12164    /// with this node. If an error occurs it is returned as an epitaph on the
12165    /// iterator request channel, and then the channel is closed.
12166    ///
12167    /// GetExtendedAttributes can be used with any of these names to retrieve
12168    /// the associated value.
12169    ///
12170    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12171    ListExtendedAttributes {
12172        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
12173        control_handle: NodeControlHandle,
12174    },
12175    /// Get the value associated with the given attribute `name` for this node.
12176    ///
12177    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
12178    /// particular structure is imposed on them.
12179    ///
12180    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12181    GetExtendedAttribute {
12182        name: Vec<u8>,
12183        responder: NodeGetExtendedAttributeResponder,
12184    },
12185    /// Set the value for the given attribute `name` to `value` for this node.
12186    ///
12187    /// The attribute name may exist, in which case the attribute is updated.
12188    /// If the attribute doesn't exist, it is created. The name should have no
12189    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
12190    ///
12191    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12192    SetExtendedAttribute {
12193        name: Vec<u8>,
12194        value: ExtendedAttributeValue,
12195        mode: SetExtendedAttributeMode,
12196        responder: NodeSetExtendedAttributeResponder,
12197    },
12198    /// Remove the specified extended attribute.
12199    ///
12200    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
12201    ///
12202    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12203    RemoveExtendedAttribute {
12204        name: Vec<u8>,
12205        responder: NodeRemoveExtendedAttributeResponder,
12206    },
12207    /// An interaction was received which does not match any known method.
12208    #[non_exhaustive]
12209    _UnknownMethod {
12210        /// Ordinal of the method that was called.
12211        ordinal: u64,
12212        control_handle: NodeControlHandle,
12213        method_type: fidl::MethodType,
12214    },
12215}
12216
12217impl NodeRequest {
12218    #[allow(irrefutable_let_patterns)]
12219    pub fn into_clone(
12220        self,
12221    ) -> Option<(
12222        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12223        NodeControlHandle,
12224    )> {
12225        if let NodeRequest::Clone { request, control_handle } = self {
12226            Some((request, control_handle))
12227        } else {
12228            None
12229        }
12230    }
12231
12232    #[allow(irrefutable_let_patterns)]
12233    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
12234        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
12235    }
12236
12237    #[allow(irrefutable_let_patterns)]
12238    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
12239        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
12240    }
12241
12242    #[allow(irrefutable_let_patterns)]
12243    pub fn into_deprecated_clone(
12244        self,
12245    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, NodeControlHandle)> {
12246        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
12247            Some((flags, object, control_handle))
12248        } else {
12249            None
12250        }
12251    }
12252
12253    #[allow(irrefutable_let_patterns)]
12254    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
12255        if let NodeRequest::DeprecatedGetAttr { responder } = self {
12256            Some((responder))
12257        } else {
12258            None
12259        }
12260    }
12261
12262    #[allow(irrefutable_let_patterns)]
12263    pub fn into_deprecated_set_attr(
12264        self,
12265    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
12266        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
12267            Some((flags, attributes, responder))
12268        } else {
12269            None
12270        }
12271    }
12272
12273    #[allow(irrefutable_let_patterns)]
12274    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
12275        if let NodeRequest::DeprecatedGetFlags { responder } = self {
12276            Some((responder))
12277        } else {
12278            None
12279        }
12280    }
12281
12282    #[allow(irrefutable_let_patterns)]
12283    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
12284        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
12285            Some((flags, responder))
12286        } else {
12287            None
12288        }
12289    }
12290
12291    #[allow(irrefutable_let_patterns)]
12292    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
12293        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
12294    }
12295
12296    #[allow(irrefutable_let_patterns)]
12297    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
12298        if let NodeRequest::SetFlags { flags, responder } = self {
12299            Some((flags, responder))
12300        } else {
12301            None
12302        }
12303    }
12304
12305    #[allow(irrefutable_let_patterns)]
12306    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
12307        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
12308    }
12309
12310    #[allow(irrefutable_let_patterns)]
12311    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
12312        if let NodeRequest::GetAttributes { query, responder } = self {
12313            Some((query, responder))
12314        } else {
12315            None
12316        }
12317    }
12318
12319    #[allow(irrefutable_let_patterns)]
12320    pub fn into_update_attributes(
12321        self,
12322    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
12323        if let NodeRequest::UpdateAttributes { payload, responder } = self {
12324            Some((payload, responder))
12325        } else {
12326            None
12327        }
12328    }
12329
12330    #[allow(irrefutable_let_patterns)]
12331    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
12332        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
12333    }
12334
12335    #[allow(irrefutable_let_patterns)]
12336    pub fn into_list_extended_attributes(
12337        self,
12338    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
12339    {
12340        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
12341            Some((iterator, control_handle))
12342        } else {
12343            None
12344        }
12345    }
12346
12347    #[allow(irrefutable_let_patterns)]
12348    pub fn into_get_extended_attribute(
12349        self,
12350    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
12351        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
12352            Some((name, responder))
12353        } else {
12354            None
12355        }
12356    }
12357
12358    #[allow(irrefutable_let_patterns)]
12359    pub fn into_set_extended_attribute(
12360        self,
12361    ) -> Option<(
12362        Vec<u8>,
12363        ExtendedAttributeValue,
12364        SetExtendedAttributeMode,
12365        NodeSetExtendedAttributeResponder,
12366    )> {
12367        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
12368            Some((name, value, mode, responder))
12369        } else {
12370            None
12371        }
12372    }
12373
12374    #[allow(irrefutable_let_patterns)]
12375    pub fn into_remove_extended_attribute(
12376        self,
12377    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
12378        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
12379            Some((name, responder))
12380        } else {
12381            None
12382        }
12383    }
12384
12385    /// Name of the method defined in FIDL
12386    pub fn method_name(&self) -> &'static str {
12387        match *self {
12388            NodeRequest::Clone { .. } => "clone",
12389            NodeRequest::Close { .. } => "close",
12390            NodeRequest::Query { .. } => "query",
12391            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
12392            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
12393            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
12394            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
12395            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
12396            NodeRequest::GetFlags { .. } => "get_flags",
12397            NodeRequest::SetFlags { .. } => "set_flags",
12398            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
12399            NodeRequest::GetAttributes { .. } => "get_attributes",
12400            NodeRequest::UpdateAttributes { .. } => "update_attributes",
12401            NodeRequest::Sync { .. } => "sync",
12402            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
12403            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
12404            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
12405            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
12406            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12407                "unknown one-way method"
12408            }
12409            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12410                "unknown two-way method"
12411            }
12412        }
12413    }
12414}
12415
12416#[derive(Debug, Clone)]
12417pub struct NodeControlHandle {
12418    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
12419}
12420
12421impl fdomain_client::fidl::ControlHandle for NodeControlHandle {
12422    fn shutdown(&self) {
12423        self.inner.shutdown()
12424    }
12425
12426    fn is_closed(&self) -> bool {
12427        self.inner.channel().is_closed()
12428    }
12429    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
12430        self.inner.channel().on_closed()
12431    }
12432}
12433
12434impl NodeControlHandle {
12435    pub fn send_on_open_(
12436        &self,
12437        mut s: i32,
12438        mut info: Option<NodeInfoDeprecated>,
12439    ) -> Result<(), fidl::Error> {
12440        self.inner.send::<NodeOnOpenRequest>(
12441            (s, info.as_mut()),
12442            0,
12443            0x7fc7bbb1dbfd1972,
12444            fidl::encoding::DynamicFlags::FLEXIBLE,
12445        )
12446    }
12447
12448    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
12449        self.inner.send::<Representation>(
12450            &mut payload,
12451            0,
12452            0x5cb40567d80a510c,
12453            fidl::encoding::DynamicFlags::empty(),
12454        )
12455    }
12456}
12457
12458#[must_use = "FIDL methods require a response to be sent"]
12459#[derive(Debug)]
12460pub struct NodeCloseResponder {
12461    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12462    tx_id: u32,
12463}
12464
12465/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12466/// if the responder is dropped without sending a response, so that the client
12467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12468impl std::ops::Drop for NodeCloseResponder {
12469    fn drop(&mut self) {
12470        self.control_handle.shutdown();
12471        // Safety: drops once, never accessed again
12472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12473    }
12474}
12475
12476impl fdomain_client::fidl::Responder for NodeCloseResponder {
12477    type ControlHandle = NodeControlHandle;
12478
12479    fn control_handle(&self) -> &NodeControlHandle {
12480        &self.control_handle
12481    }
12482
12483    fn drop_without_shutdown(mut self) {
12484        // Safety: drops once, never accessed again due to mem::forget
12485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12486        // Prevent Drop from running (which would shut down the channel)
12487        std::mem::forget(self);
12488    }
12489}
12490
12491impl NodeCloseResponder {
12492    /// Sends a response to the FIDL transaction.
12493    ///
12494    /// Sets the channel to shutdown if an error occurs.
12495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12496        let _result = self.send_raw(result);
12497        if _result.is_err() {
12498            self.control_handle.shutdown();
12499        }
12500        self.drop_without_shutdown();
12501        _result
12502    }
12503
12504    /// Similar to "send" but does not shutdown the channel if an error occurs.
12505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12506        let _result = self.send_raw(result);
12507        self.drop_without_shutdown();
12508        _result
12509    }
12510
12511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12512        self.control_handle
12513            .inner
12514            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12515                result,
12516                self.tx_id,
12517                0x5ac5d459ad7f657e,
12518                fidl::encoding::DynamicFlags::empty(),
12519            )
12520    }
12521}
12522
12523#[must_use = "FIDL methods require a response to be sent"]
12524#[derive(Debug)]
12525pub struct NodeQueryResponder {
12526    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12527    tx_id: u32,
12528}
12529
12530/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12531/// if the responder is dropped without sending a response, so that the client
12532/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12533impl std::ops::Drop for NodeQueryResponder {
12534    fn drop(&mut self) {
12535        self.control_handle.shutdown();
12536        // Safety: drops once, never accessed again
12537        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12538    }
12539}
12540
12541impl fdomain_client::fidl::Responder for NodeQueryResponder {
12542    type ControlHandle = NodeControlHandle;
12543
12544    fn control_handle(&self) -> &NodeControlHandle {
12545        &self.control_handle
12546    }
12547
12548    fn drop_without_shutdown(mut self) {
12549        // Safety: drops once, never accessed again due to mem::forget
12550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12551        // Prevent Drop from running (which would shut down the channel)
12552        std::mem::forget(self);
12553    }
12554}
12555
12556impl NodeQueryResponder {
12557    /// Sends a response to the FIDL transaction.
12558    ///
12559    /// Sets the channel to shutdown if an error occurs.
12560    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12561        let _result = self.send_raw(protocol);
12562        if _result.is_err() {
12563            self.control_handle.shutdown();
12564        }
12565        self.drop_without_shutdown();
12566        _result
12567    }
12568
12569    /// Similar to "send" but does not shutdown the channel if an error occurs.
12570    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12571        let _result = self.send_raw(protocol);
12572        self.drop_without_shutdown();
12573        _result
12574    }
12575
12576    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12577        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
12578            (protocol,),
12579            self.tx_id,
12580            0x2658edee9decfc06,
12581            fidl::encoding::DynamicFlags::empty(),
12582        )
12583    }
12584}
12585
12586#[must_use = "FIDL methods require a response to be sent"]
12587#[derive(Debug)]
12588pub struct NodeDeprecatedGetAttrResponder {
12589    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12590    tx_id: u32,
12591}
12592
12593/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12594/// if the responder is dropped without sending a response, so that the client
12595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12596impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
12597    fn drop(&mut self) {
12598        self.control_handle.shutdown();
12599        // Safety: drops once, never accessed again
12600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12601    }
12602}
12603
12604impl fdomain_client::fidl::Responder for NodeDeprecatedGetAttrResponder {
12605    type ControlHandle = NodeControlHandle;
12606
12607    fn control_handle(&self) -> &NodeControlHandle {
12608        &self.control_handle
12609    }
12610
12611    fn drop_without_shutdown(mut self) {
12612        // Safety: drops once, never accessed again due to mem::forget
12613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12614        // Prevent Drop from running (which would shut down the channel)
12615        std::mem::forget(self);
12616    }
12617}
12618
12619impl NodeDeprecatedGetAttrResponder {
12620    /// Sends a response to the FIDL transaction.
12621    ///
12622    /// Sets the channel to shutdown if an error occurs.
12623    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12624        let _result = self.send_raw(s, attributes);
12625        if _result.is_err() {
12626            self.control_handle.shutdown();
12627        }
12628        self.drop_without_shutdown();
12629        _result
12630    }
12631
12632    /// Similar to "send" but does not shutdown the channel if an error occurs.
12633    pub fn send_no_shutdown_on_err(
12634        self,
12635        mut s: i32,
12636        mut attributes: &NodeAttributes,
12637    ) -> Result<(), fidl::Error> {
12638        let _result = self.send_raw(s, attributes);
12639        self.drop_without_shutdown();
12640        _result
12641    }
12642
12643    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12644        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
12645            (s, attributes),
12646            self.tx_id,
12647            0x78985e216314dafd,
12648            fidl::encoding::DynamicFlags::empty(),
12649        )
12650    }
12651}
12652
12653#[must_use = "FIDL methods require a response to be sent"]
12654#[derive(Debug)]
12655pub struct NodeDeprecatedSetAttrResponder {
12656    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12657    tx_id: u32,
12658}
12659
12660/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12661/// if the responder is dropped without sending a response, so that the client
12662/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12663impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
12664    fn drop(&mut self) {
12665        self.control_handle.shutdown();
12666        // Safety: drops once, never accessed again
12667        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12668    }
12669}
12670
12671impl fdomain_client::fidl::Responder for NodeDeprecatedSetAttrResponder {
12672    type ControlHandle = NodeControlHandle;
12673
12674    fn control_handle(&self) -> &NodeControlHandle {
12675        &self.control_handle
12676    }
12677
12678    fn drop_without_shutdown(mut self) {
12679        // Safety: drops once, never accessed again due to mem::forget
12680        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12681        // Prevent Drop from running (which would shut down the channel)
12682        std::mem::forget(self);
12683    }
12684}
12685
12686impl NodeDeprecatedSetAttrResponder {
12687    /// Sends a response to the FIDL transaction.
12688    ///
12689    /// Sets the channel to shutdown if an error occurs.
12690    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12691        let _result = self.send_raw(s);
12692        if _result.is_err() {
12693            self.control_handle.shutdown();
12694        }
12695        self.drop_without_shutdown();
12696        _result
12697    }
12698
12699    /// Similar to "send" but does not shutdown the channel if an error occurs.
12700    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12701        let _result = self.send_raw(s);
12702        self.drop_without_shutdown();
12703        _result
12704    }
12705
12706    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12707        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
12708            (s,),
12709            self.tx_id,
12710            0x4186c0f40d938f46,
12711            fidl::encoding::DynamicFlags::empty(),
12712        )
12713    }
12714}
12715
12716#[must_use = "FIDL methods require a response to be sent"]
12717#[derive(Debug)]
12718pub struct NodeDeprecatedGetFlagsResponder {
12719    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12720    tx_id: u32,
12721}
12722
12723/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12724/// if the responder is dropped without sending a response, so that the client
12725/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12726impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
12727    fn drop(&mut self) {
12728        self.control_handle.shutdown();
12729        // Safety: drops once, never accessed again
12730        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12731    }
12732}
12733
12734impl fdomain_client::fidl::Responder for NodeDeprecatedGetFlagsResponder {
12735    type ControlHandle = NodeControlHandle;
12736
12737    fn control_handle(&self) -> &NodeControlHandle {
12738        &self.control_handle
12739    }
12740
12741    fn drop_without_shutdown(mut self) {
12742        // Safety: drops once, never accessed again due to mem::forget
12743        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12744        // Prevent Drop from running (which would shut down the channel)
12745        std::mem::forget(self);
12746    }
12747}
12748
12749impl NodeDeprecatedGetFlagsResponder {
12750    /// Sends a response to the FIDL transaction.
12751    ///
12752    /// Sets the channel to shutdown if an error occurs.
12753    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12754        let _result = self.send_raw(s, flags);
12755        if _result.is_err() {
12756            self.control_handle.shutdown();
12757        }
12758        self.drop_without_shutdown();
12759        _result
12760    }
12761
12762    /// Similar to "send" but does not shutdown the channel if an error occurs.
12763    pub fn send_no_shutdown_on_err(
12764        self,
12765        mut s: i32,
12766        mut flags: OpenFlags,
12767    ) -> Result<(), fidl::Error> {
12768        let _result = self.send_raw(s, flags);
12769        self.drop_without_shutdown();
12770        _result
12771    }
12772
12773    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12774        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
12775            (s, flags),
12776            self.tx_id,
12777            0x5b88fffb8eda3aa1,
12778            fidl::encoding::DynamicFlags::empty(),
12779        )
12780    }
12781}
12782
12783#[must_use = "FIDL methods require a response to be sent"]
12784#[derive(Debug)]
12785pub struct NodeDeprecatedSetFlagsResponder {
12786    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12787    tx_id: u32,
12788}
12789
12790/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12791/// if the responder is dropped without sending a response, so that the client
12792/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12793impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
12794    fn drop(&mut self) {
12795        self.control_handle.shutdown();
12796        // Safety: drops once, never accessed again
12797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12798    }
12799}
12800
12801impl fdomain_client::fidl::Responder for NodeDeprecatedSetFlagsResponder {
12802    type ControlHandle = NodeControlHandle;
12803
12804    fn control_handle(&self) -> &NodeControlHandle {
12805        &self.control_handle
12806    }
12807
12808    fn drop_without_shutdown(mut self) {
12809        // Safety: drops once, never accessed again due to mem::forget
12810        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12811        // Prevent Drop from running (which would shut down the channel)
12812        std::mem::forget(self);
12813    }
12814}
12815
12816impl NodeDeprecatedSetFlagsResponder {
12817    /// Sends a response to the FIDL transaction.
12818    ///
12819    /// Sets the channel to shutdown if an error occurs.
12820    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12821        let _result = self.send_raw(s);
12822        if _result.is_err() {
12823            self.control_handle.shutdown();
12824        }
12825        self.drop_without_shutdown();
12826        _result
12827    }
12828
12829    /// Similar to "send" but does not shutdown the channel if an error occurs.
12830    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12831        let _result = self.send_raw(s);
12832        self.drop_without_shutdown();
12833        _result
12834    }
12835
12836    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12837        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
12838            (s,),
12839            self.tx_id,
12840            0x5295b76c71fde733,
12841            fidl::encoding::DynamicFlags::empty(),
12842        )
12843    }
12844}
12845
12846#[must_use = "FIDL methods require a response to be sent"]
12847#[derive(Debug)]
12848pub struct NodeGetFlagsResponder {
12849    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12850    tx_id: u32,
12851}
12852
12853/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12854/// if the responder is dropped without sending a response, so that the client
12855/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12856impl std::ops::Drop for NodeGetFlagsResponder {
12857    fn drop(&mut self) {
12858        self.control_handle.shutdown();
12859        // Safety: drops once, never accessed again
12860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12861    }
12862}
12863
12864impl fdomain_client::fidl::Responder for NodeGetFlagsResponder {
12865    type ControlHandle = NodeControlHandle;
12866
12867    fn control_handle(&self) -> &NodeControlHandle {
12868        &self.control_handle
12869    }
12870
12871    fn drop_without_shutdown(mut self) {
12872        // Safety: drops once, never accessed again due to mem::forget
12873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12874        // Prevent Drop from running (which would shut down the channel)
12875        std::mem::forget(self);
12876    }
12877}
12878
12879impl NodeGetFlagsResponder {
12880    /// Sends a response to the FIDL transaction.
12881    ///
12882    /// Sets the channel to shutdown if an error occurs.
12883    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12884        let _result = self.send_raw(result);
12885        if _result.is_err() {
12886            self.control_handle.shutdown();
12887        }
12888        self.drop_without_shutdown();
12889        _result
12890    }
12891
12892    /// Similar to "send" but does not shutdown the channel if an error occurs.
12893    pub fn send_no_shutdown_on_err(
12894        self,
12895        mut result: Result<Flags, i32>,
12896    ) -> Result<(), fidl::Error> {
12897        let _result = self.send_raw(result);
12898        self.drop_without_shutdown();
12899        _result
12900    }
12901
12902    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12903        self.control_handle
12904            .inner
12905            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
12906                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
12907                self.tx_id,
12908                0x176eb318f64ec23,
12909                fidl::encoding::DynamicFlags::FLEXIBLE,
12910            )
12911    }
12912}
12913
12914#[must_use = "FIDL methods require a response to be sent"]
12915#[derive(Debug)]
12916pub struct NodeSetFlagsResponder {
12917    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12918    tx_id: u32,
12919}
12920
12921/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12922/// if the responder is dropped without sending a response, so that the client
12923/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12924impl std::ops::Drop for NodeSetFlagsResponder {
12925    fn drop(&mut self) {
12926        self.control_handle.shutdown();
12927        // Safety: drops once, never accessed again
12928        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12929    }
12930}
12931
12932impl fdomain_client::fidl::Responder for NodeSetFlagsResponder {
12933    type ControlHandle = NodeControlHandle;
12934
12935    fn control_handle(&self) -> &NodeControlHandle {
12936        &self.control_handle
12937    }
12938
12939    fn drop_without_shutdown(mut self) {
12940        // Safety: drops once, never accessed again due to mem::forget
12941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12942        // Prevent Drop from running (which would shut down the channel)
12943        std::mem::forget(self);
12944    }
12945}
12946
12947impl NodeSetFlagsResponder {
12948    /// Sends a response to the FIDL transaction.
12949    ///
12950    /// Sets the channel to shutdown if an error occurs.
12951    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12952        let _result = self.send_raw(result);
12953        if _result.is_err() {
12954            self.control_handle.shutdown();
12955        }
12956        self.drop_without_shutdown();
12957        _result
12958    }
12959
12960    /// Similar to "send" but does not shutdown the channel if an error occurs.
12961    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12962        let _result = self.send_raw(result);
12963        self.drop_without_shutdown();
12964        _result
12965    }
12966
12967    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12968        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12969            fidl::encoding::EmptyStruct,
12970            i32,
12971        >>(
12972            fidl::encoding::FlexibleResult::new(result),
12973            self.tx_id,
12974            0x55a8028685791ea8,
12975            fidl::encoding::DynamicFlags::FLEXIBLE,
12976        )
12977    }
12978}
12979
12980#[must_use = "FIDL methods require a response to be sent"]
12981#[derive(Debug)]
12982pub struct NodeQueryFilesystemResponder {
12983    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12984    tx_id: u32,
12985}
12986
12987/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12988/// if the responder is dropped without sending a response, so that the client
12989/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12990impl std::ops::Drop for NodeQueryFilesystemResponder {
12991    fn drop(&mut self) {
12992        self.control_handle.shutdown();
12993        // Safety: drops once, never accessed again
12994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12995    }
12996}
12997
12998impl fdomain_client::fidl::Responder for NodeQueryFilesystemResponder {
12999    type ControlHandle = NodeControlHandle;
13000
13001    fn control_handle(&self) -> &NodeControlHandle {
13002        &self.control_handle
13003    }
13004
13005    fn drop_without_shutdown(mut self) {
13006        // Safety: drops once, never accessed again due to mem::forget
13007        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13008        // Prevent Drop from running (which would shut down the channel)
13009        std::mem::forget(self);
13010    }
13011}
13012
13013impl NodeQueryFilesystemResponder {
13014    /// Sends a response to the FIDL transaction.
13015    ///
13016    /// Sets the channel to shutdown if an error occurs.
13017    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13018        let _result = self.send_raw(s, info);
13019        if _result.is_err() {
13020            self.control_handle.shutdown();
13021        }
13022        self.drop_without_shutdown();
13023        _result
13024    }
13025
13026    /// Similar to "send" but does not shutdown the channel if an error occurs.
13027    pub fn send_no_shutdown_on_err(
13028        self,
13029        mut s: i32,
13030        mut info: Option<&FilesystemInfo>,
13031    ) -> Result<(), fidl::Error> {
13032        let _result = self.send_raw(s, info);
13033        self.drop_without_shutdown();
13034        _result
13035    }
13036
13037    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13038        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
13039            (s, info),
13040            self.tx_id,
13041            0x6f344a1c6b0a0610,
13042            fidl::encoding::DynamicFlags::empty(),
13043        )
13044    }
13045}
13046
13047#[must_use = "FIDL methods require a response to be sent"]
13048#[derive(Debug)]
13049pub struct NodeGetAttributesResponder {
13050    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13051    tx_id: u32,
13052}
13053
13054/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13055/// if the responder is dropped without sending a response, so that the client
13056/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13057impl std::ops::Drop for NodeGetAttributesResponder {
13058    fn drop(&mut self) {
13059        self.control_handle.shutdown();
13060        // Safety: drops once, never accessed again
13061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13062    }
13063}
13064
13065impl fdomain_client::fidl::Responder for NodeGetAttributesResponder {
13066    type ControlHandle = NodeControlHandle;
13067
13068    fn control_handle(&self) -> &NodeControlHandle {
13069        &self.control_handle
13070    }
13071
13072    fn drop_without_shutdown(mut self) {
13073        // Safety: drops once, never accessed again due to mem::forget
13074        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13075        // Prevent Drop from running (which would shut down the channel)
13076        std::mem::forget(self);
13077    }
13078}
13079
13080impl NodeGetAttributesResponder {
13081    /// Sends a response to the FIDL transaction.
13082    ///
13083    /// Sets the channel to shutdown if an error occurs.
13084    pub fn send(
13085        self,
13086        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13087    ) -> Result<(), fidl::Error> {
13088        let _result = self.send_raw(result);
13089        if _result.is_err() {
13090            self.control_handle.shutdown();
13091        }
13092        self.drop_without_shutdown();
13093        _result
13094    }
13095
13096    /// Similar to "send" but does not shutdown the channel if an error occurs.
13097    pub fn send_no_shutdown_on_err(
13098        self,
13099        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13100    ) -> Result<(), fidl::Error> {
13101        let _result = self.send_raw(result);
13102        self.drop_without_shutdown();
13103        _result
13104    }
13105
13106    fn send_raw(
13107        &self,
13108        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13109    ) -> Result<(), fidl::Error> {
13110        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
13111            result,
13112            self.tx_id,
13113            0x3d4396a638ea053b,
13114            fidl::encoding::DynamicFlags::empty(),
13115        )
13116    }
13117}
13118
13119#[must_use = "FIDL methods require a response to be sent"]
13120#[derive(Debug)]
13121pub struct NodeUpdateAttributesResponder {
13122    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13123    tx_id: u32,
13124}
13125
13126/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13127/// if the responder is dropped without sending a response, so that the client
13128/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13129impl std::ops::Drop for NodeUpdateAttributesResponder {
13130    fn drop(&mut self) {
13131        self.control_handle.shutdown();
13132        // Safety: drops once, never accessed again
13133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13134    }
13135}
13136
13137impl fdomain_client::fidl::Responder for NodeUpdateAttributesResponder {
13138    type ControlHandle = NodeControlHandle;
13139
13140    fn control_handle(&self) -> &NodeControlHandle {
13141        &self.control_handle
13142    }
13143
13144    fn drop_without_shutdown(mut self) {
13145        // Safety: drops once, never accessed again due to mem::forget
13146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13147        // Prevent Drop from running (which would shut down the channel)
13148        std::mem::forget(self);
13149    }
13150}
13151
13152impl NodeUpdateAttributesResponder {
13153    /// Sends a response to the FIDL transaction.
13154    ///
13155    /// Sets the channel to shutdown if an error occurs.
13156    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13157        let _result = self.send_raw(result);
13158        if _result.is_err() {
13159            self.control_handle.shutdown();
13160        }
13161        self.drop_without_shutdown();
13162        _result
13163    }
13164
13165    /// Similar to "send" but does not shutdown the channel if an error occurs.
13166    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13167        let _result = self.send_raw(result);
13168        self.drop_without_shutdown();
13169        _result
13170    }
13171
13172    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13173        self.control_handle
13174            .inner
13175            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13176                result,
13177                self.tx_id,
13178                0x3308c1da5a89bf08,
13179                fidl::encoding::DynamicFlags::empty(),
13180            )
13181    }
13182}
13183
13184#[must_use = "FIDL methods require a response to be sent"]
13185#[derive(Debug)]
13186pub struct NodeSyncResponder {
13187    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13188    tx_id: u32,
13189}
13190
13191/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13192/// if the responder is dropped without sending a response, so that the client
13193/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13194impl std::ops::Drop for NodeSyncResponder {
13195    fn drop(&mut self) {
13196        self.control_handle.shutdown();
13197        // Safety: drops once, never accessed again
13198        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13199    }
13200}
13201
13202impl fdomain_client::fidl::Responder for NodeSyncResponder {
13203    type ControlHandle = NodeControlHandle;
13204
13205    fn control_handle(&self) -> &NodeControlHandle {
13206        &self.control_handle
13207    }
13208
13209    fn drop_without_shutdown(mut self) {
13210        // Safety: drops once, never accessed again due to mem::forget
13211        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13212        // Prevent Drop from running (which would shut down the channel)
13213        std::mem::forget(self);
13214    }
13215}
13216
13217impl NodeSyncResponder {
13218    /// Sends a response to the FIDL transaction.
13219    ///
13220    /// Sets the channel to shutdown if an error occurs.
13221    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13222        let _result = self.send_raw(result);
13223        if _result.is_err() {
13224            self.control_handle.shutdown();
13225        }
13226        self.drop_without_shutdown();
13227        _result
13228    }
13229
13230    /// Similar to "send" but does not shutdown the channel if an error occurs.
13231    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13232        let _result = self.send_raw(result);
13233        self.drop_without_shutdown();
13234        _result
13235    }
13236
13237    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13238        self.control_handle
13239            .inner
13240            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13241                result,
13242                self.tx_id,
13243                0x2c5c27ca0ab5dc49,
13244                fidl::encoding::DynamicFlags::empty(),
13245            )
13246    }
13247}
13248
13249#[must_use = "FIDL methods require a response to be sent"]
13250#[derive(Debug)]
13251pub struct NodeGetExtendedAttributeResponder {
13252    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13253    tx_id: u32,
13254}
13255
13256/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13257/// if the responder is dropped without sending a response, so that the client
13258/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13259impl std::ops::Drop for NodeGetExtendedAttributeResponder {
13260    fn drop(&mut self) {
13261        self.control_handle.shutdown();
13262        // Safety: drops once, never accessed again
13263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13264    }
13265}
13266
13267impl fdomain_client::fidl::Responder for NodeGetExtendedAttributeResponder {
13268    type ControlHandle = NodeControlHandle;
13269
13270    fn control_handle(&self) -> &NodeControlHandle {
13271        &self.control_handle
13272    }
13273
13274    fn drop_without_shutdown(mut self) {
13275        // Safety: drops once, never accessed again due to mem::forget
13276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13277        // Prevent Drop from running (which would shut down the channel)
13278        std::mem::forget(self);
13279    }
13280}
13281
13282impl NodeGetExtendedAttributeResponder {
13283    /// Sends a response to the FIDL transaction.
13284    ///
13285    /// Sets the channel to shutdown if an error occurs.
13286    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13287        let _result = self.send_raw(result);
13288        if _result.is_err() {
13289            self.control_handle.shutdown();
13290        }
13291        self.drop_without_shutdown();
13292        _result
13293    }
13294
13295    /// Similar to "send" but does not shutdown the channel if an error occurs.
13296    pub fn send_no_shutdown_on_err(
13297        self,
13298        mut result: Result<ExtendedAttributeValue, i32>,
13299    ) -> Result<(), fidl::Error> {
13300        let _result = self.send_raw(result);
13301        self.drop_without_shutdown();
13302        _result
13303    }
13304
13305    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13306        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
13307            result.as_mut().map_err(|e| *e),
13308            self.tx_id,
13309            0x45ffa3ccfdeb76db,
13310            fidl::encoding::DynamicFlags::empty(),
13311        )
13312    }
13313}
13314
13315#[must_use = "FIDL methods require a response to be sent"]
13316#[derive(Debug)]
13317pub struct NodeSetExtendedAttributeResponder {
13318    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13319    tx_id: u32,
13320}
13321
13322/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13323/// if the responder is dropped without sending a response, so that the client
13324/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13325impl std::ops::Drop for NodeSetExtendedAttributeResponder {
13326    fn drop(&mut self) {
13327        self.control_handle.shutdown();
13328        // Safety: drops once, never accessed again
13329        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13330    }
13331}
13332
13333impl fdomain_client::fidl::Responder for NodeSetExtendedAttributeResponder {
13334    type ControlHandle = NodeControlHandle;
13335
13336    fn control_handle(&self) -> &NodeControlHandle {
13337        &self.control_handle
13338    }
13339
13340    fn drop_without_shutdown(mut self) {
13341        // Safety: drops once, never accessed again due to mem::forget
13342        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13343        // Prevent Drop from running (which would shut down the channel)
13344        std::mem::forget(self);
13345    }
13346}
13347
13348impl NodeSetExtendedAttributeResponder {
13349    /// Sends a response to the FIDL transaction.
13350    ///
13351    /// Sets the channel to shutdown if an error occurs.
13352    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13353        let _result = self.send_raw(result);
13354        if _result.is_err() {
13355            self.control_handle.shutdown();
13356        }
13357        self.drop_without_shutdown();
13358        _result
13359    }
13360
13361    /// Similar to "send" but does not shutdown the channel if an error occurs.
13362    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13363        let _result = self.send_raw(result);
13364        self.drop_without_shutdown();
13365        _result
13366    }
13367
13368    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13369        self.control_handle
13370            .inner
13371            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13372                result,
13373                self.tx_id,
13374                0x4a951362f681f23c,
13375                fidl::encoding::DynamicFlags::empty(),
13376            )
13377    }
13378}
13379
13380#[must_use = "FIDL methods require a response to be sent"]
13381#[derive(Debug)]
13382pub struct NodeRemoveExtendedAttributeResponder {
13383    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13384    tx_id: u32,
13385}
13386
13387/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13388/// if the responder is dropped without sending a response, so that the client
13389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13390impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
13391    fn drop(&mut self) {
13392        self.control_handle.shutdown();
13393        // Safety: drops once, never accessed again
13394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13395    }
13396}
13397
13398impl fdomain_client::fidl::Responder for NodeRemoveExtendedAttributeResponder {
13399    type ControlHandle = NodeControlHandle;
13400
13401    fn control_handle(&self) -> &NodeControlHandle {
13402        &self.control_handle
13403    }
13404
13405    fn drop_without_shutdown(mut self) {
13406        // Safety: drops once, never accessed again due to mem::forget
13407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13408        // Prevent Drop from running (which would shut down the channel)
13409        std::mem::forget(self);
13410    }
13411}
13412
13413impl NodeRemoveExtendedAttributeResponder {
13414    /// Sends a response to the FIDL transaction.
13415    ///
13416    /// Sets the channel to shutdown if an error occurs.
13417    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13418        let _result = self.send_raw(result);
13419        if _result.is_err() {
13420            self.control_handle.shutdown();
13421        }
13422        self.drop_without_shutdown();
13423        _result
13424    }
13425
13426    /// Similar to "send" but does not shutdown the channel if an error occurs.
13427    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13428        let _result = self.send_raw(result);
13429        self.drop_without_shutdown();
13430        _result
13431    }
13432
13433    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13434        self.control_handle
13435            .inner
13436            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13437                result,
13438                self.tx_id,
13439                0x7a0b9f3a9bf9032d,
13440                fidl::encoding::DynamicFlags::empty(),
13441            )
13442    }
13443}
13444
13445#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13446pub struct ReadableMarker;
13447
13448impl fdomain_client::fidl::ProtocolMarker for ReadableMarker {
13449    type Proxy = ReadableProxy;
13450    type RequestStream = ReadableRequestStream;
13451
13452    const DEBUG_NAME: &'static str = "(anonymous) Readable";
13453}
13454pub type ReadableReadResult = Result<Vec<u8>, i32>;
13455
13456pub trait ReadableProxyInterface: Send + Sync {
13457    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
13458        + Send;
13459    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
13460}
13461
13462#[derive(Debug, Clone)]
13463pub struct ReadableProxy {
13464    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13465}
13466
13467impl fdomain_client::fidl::Proxy for ReadableProxy {
13468    type Protocol = ReadableMarker;
13469
13470    fn from_channel(inner: fdomain_client::Channel) -> Self {
13471        Self::new(inner)
13472    }
13473
13474    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13475        self.client.into_channel().map_err(|client| Self { client })
13476    }
13477
13478    fn as_channel(&self) -> &fdomain_client::Channel {
13479        self.client.as_channel()
13480    }
13481}
13482
13483impl ReadableProxy {
13484    /// Create a new Proxy for fuchsia.io/Readable.
13485    pub fn new(channel: fdomain_client::Channel) -> Self {
13486        let protocol_name = <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13487        Self { client: fidl::client::Client::new(channel, protocol_name) }
13488    }
13489
13490    /// Get a Stream of events from the remote end of the protocol.
13491    ///
13492    /// # Panics
13493    ///
13494    /// Panics if the event stream was already taken.
13495    pub fn take_event_stream(&self) -> ReadableEventStream {
13496        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
13497    }
13498
13499    /// Reads up to 'count' bytes at the seek offset.
13500    /// The seek offset is moved forward by the number of bytes read.
13501    ///
13502    /// ## Invariants
13503    ///
13504    /// * The returned `data.length` will never be greater than `count`.
13505    /// * If `data.length` is less than `count`, it means that the seek offset
13506    ///   has reached the end of file as part of this operation.
13507    /// * If `data.length` is zero while `count` is not, it means that the
13508    ///   seek offset is already at or beyond the end of file, and no data could
13509    ///   be read.
13510    /// * If `count` is zero, the server should perform all the checks ensuring
13511    ///   read access without actually read anything, and return an empty
13512    ///   `data` vector.
13513    ///
13514    /// This method requires the [`Rights.READ_BYTES`] right.
13515    ///
13516    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13517    pub fn r#read(
13518        &self,
13519        mut count: u64,
13520    ) -> fidl::client::QueryResponseFut<
13521        ReadableReadResult,
13522        fdomain_client::fidl::FDomainResourceDialect,
13523    > {
13524        ReadableProxyInterface::r#read(self, count)
13525    }
13526}
13527
13528impl ReadableProxyInterface for ReadableProxy {
13529    type ReadResponseFut = fidl::client::QueryResponseFut<
13530        ReadableReadResult,
13531        fdomain_client::fidl::FDomainResourceDialect,
13532    >;
13533    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
13534        fn _decode(
13535            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13536        ) -> Result<ReadableReadResult, fidl::Error> {
13537            let _response = fidl::client::decode_transaction_body::<
13538                fidl::encoding::ResultType<ReadableReadResponse, i32>,
13539                fdomain_client::fidl::FDomainResourceDialect,
13540                0x57e419a298c8ede,
13541            >(_buf?)?;
13542            Ok(_response.map(|x| x.data))
13543        }
13544        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
13545            (count,),
13546            0x57e419a298c8ede,
13547            fidl::encoding::DynamicFlags::empty(),
13548            _decode,
13549        )
13550    }
13551}
13552
13553pub struct ReadableEventStream {
13554    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
13555}
13556
13557impl std::marker::Unpin for ReadableEventStream {}
13558
13559impl futures::stream::FusedStream for ReadableEventStream {
13560    fn is_terminated(&self) -> bool {
13561        self.event_receiver.is_terminated()
13562    }
13563}
13564
13565impl futures::Stream for ReadableEventStream {
13566    type Item = Result<ReadableEvent, fidl::Error>;
13567
13568    fn poll_next(
13569        mut self: std::pin::Pin<&mut Self>,
13570        cx: &mut std::task::Context<'_>,
13571    ) -> std::task::Poll<Option<Self::Item>> {
13572        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13573            &mut self.event_receiver,
13574            cx
13575        )?) {
13576            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
13577            None => std::task::Poll::Ready(None),
13578        }
13579    }
13580}
13581
13582#[derive(Debug)]
13583pub enum ReadableEvent {}
13584
13585impl ReadableEvent {
13586    /// Decodes a message buffer as a [`ReadableEvent`].
13587    fn decode(
13588        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13589    ) -> Result<ReadableEvent, fidl::Error> {
13590        let (bytes, _handles) = buf.split_mut();
13591        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13592        debug_assert_eq!(tx_header.tx_id, 0);
13593        match tx_header.ordinal {
13594            _ => Err(fidl::Error::UnknownOrdinal {
13595                ordinal: tx_header.ordinal,
13596                protocol_name: <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13597            }),
13598        }
13599    }
13600}
13601
13602/// A Stream of incoming requests for fuchsia.io/Readable.
13603pub struct ReadableRequestStream {
13604    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13605    is_terminated: bool,
13606}
13607
13608impl std::marker::Unpin for ReadableRequestStream {}
13609
13610impl futures::stream::FusedStream for ReadableRequestStream {
13611    fn is_terminated(&self) -> bool {
13612        self.is_terminated
13613    }
13614}
13615
13616impl fdomain_client::fidl::RequestStream for ReadableRequestStream {
13617    type Protocol = ReadableMarker;
13618    type ControlHandle = ReadableControlHandle;
13619
13620    fn from_channel(channel: fdomain_client::Channel) -> Self {
13621        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13622    }
13623
13624    fn control_handle(&self) -> Self::ControlHandle {
13625        ReadableControlHandle { inner: self.inner.clone() }
13626    }
13627
13628    fn into_inner(
13629        self,
13630    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
13631    {
13632        (self.inner, self.is_terminated)
13633    }
13634
13635    fn from_inner(
13636        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13637        is_terminated: bool,
13638    ) -> Self {
13639        Self { inner, is_terminated }
13640    }
13641}
13642
13643impl futures::Stream for ReadableRequestStream {
13644    type Item = Result<ReadableRequest, fidl::Error>;
13645
13646    fn poll_next(
13647        mut self: std::pin::Pin<&mut Self>,
13648        cx: &mut std::task::Context<'_>,
13649    ) -> std::task::Poll<Option<Self::Item>> {
13650        let this = &mut *self;
13651        if this.inner.check_shutdown(cx) {
13652            this.is_terminated = true;
13653            return std::task::Poll::Ready(None);
13654        }
13655        if this.is_terminated {
13656            panic!("polled ReadableRequestStream after completion");
13657        }
13658        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
13659            |bytes, handles| {
13660                match this.inner.channel().read_etc(cx, bytes, handles) {
13661                    std::task::Poll::Ready(Ok(())) => {}
13662                    std::task::Poll::Pending => return std::task::Poll::Pending,
13663                    std::task::Poll::Ready(Err(None)) => {
13664                        this.is_terminated = true;
13665                        return std::task::Poll::Ready(None);
13666                    }
13667                    std::task::Poll::Ready(Err(Some(e))) => {
13668                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13669                            e.into(),
13670                        ))));
13671                    }
13672                }
13673
13674                // A message has been received from the channel
13675                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13676
13677                std::task::Poll::Ready(Some(match header.ordinal {
13678                    0x57e419a298c8ede => {
13679                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
13680                        let mut req = fidl::new_empty!(
13681                            ReadableReadRequest,
13682                            fdomain_client::fidl::FDomainResourceDialect
13683                        );
13684                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
13685                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
13686                        Ok(ReadableRequest::Read {
13687                            count: req.count,
13688
13689                            responder: ReadableReadResponder {
13690                                control_handle: std::mem::ManuallyDrop::new(control_handle),
13691                                tx_id: header.tx_id,
13692                            },
13693                        })
13694                    }
13695                    _ => Err(fidl::Error::UnknownOrdinal {
13696                        ordinal: header.ordinal,
13697                        protocol_name:
13698                            <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13699                    }),
13700                }))
13701            },
13702        )
13703    }
13704}
13705
13706#[derive(Debug)]
13707pub enum ReadableRequest {
13708    /// Reads up to 'count' bytes at the seek offset.
13709    /// The seek offset is moved forward by the number of bytes read.
13710    ///
13711    /// ## Invariants
13712    ///
13713    /// * The returned `data.length` will never be greater than `count`.
13714    /// * If `data.length` is less than `count`, it means that the seek offset
13715    ///   has reached the end of file as part of this operation.
13716    /// * If `data.length` is zero while `count` is not, it means that the
13717    ///   seek offset is already at or beyond the end of file, and no data could
13718    ///   be read.
13719    /// * If `count` is zero, the server should perform all the checks ensuring
13720    ///   read access without actually read anything, and return an empty
13721    ///   `data` vector.
13722    ///
13723    /// This method requires the [`Rights.READ_BYTES`] right.
13724    ///
13725    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13726    Read { count: u64, responder: ReadableReadResponder },
13727}
13728
13729impl ReadableRequest {
13730    #[allow(irrefutable_let_patterns)]
13731    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
13732        if let ReadableRequest::Read { count, responder } = self {
13733            Some((count, responder))
13734        } else {
13735            None
13736        }
13737    }
13738
13739    /// Name of the method defined in FIDL
13740    pub fn method_name(&self) -> &'static str {
13741        match *self {
13742            ReadableRequest::Read { .. } => "read",
13743        }
13744    }
13745}
13746
13747#[derive(Debug, Clone)]
13748pub struct ReadableControlHandle {
13749    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13750}
13751
13752impl fdomain_client::fidl::ControlHandle for ReadableControlHandle {
13753    fn shutdown(&self) {
13754        self.inner.shutdown()
13755    }
13756
13757    fn is_closed(&self) -> bool {
13758        self.inner.channel().is_closed()
13759    }
13760    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
13761        self.inner.channel().on_closed()
13762    }
13763}
13764
13765impl ReadableControlHandle {}
13766
13767#[must_use = "FIDL methods require a response to be sent"]
13768#[derive(Debug)]
13769pub struct ReadableReadResponder {
13770    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
13771    tx_id: u32,
13772}
13773
13774/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
13775/// if the responder is dropped without sending a response, so that the client
13776/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13777impl std::ops::Drop for ReadableReadResponder {
13778    fn drop(&mut self) {
13779        self.control_handle.shutdown();
13780        // Safety: drops once, never accessed again
13781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13782    }
13783}
13784
13785impl fdomain_client::fidl::Responder for ReadableReadResponder {
13786    type ControlHandle = ReadableControlHandle;
13787
13788    fn control_handle(&self) -> &ReadableControlHandle {
13789        &self.control_handle
13790    }
13791
13792    fn drop_without_shutdown(mut self) {
13793        // Safety: drops once, never accessed again due to mem::forget
13794        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13795        // Prevent Drop from running (which would shut down the channel)
13796        std::mem::forget(self);
13797    }
13798}
13799
13800impl ReadableReadResponder {
13801    /// Sends a response to the FIDL transaction.
13802    ///
13803    /// Sets the channel to shutdown if an error occurs.
13804    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
13805        let _result = self.send_raw(result);
13806        if _result.is_err() {
13807            self.control_handle.shutdown();
13808        }
13809        self.drop_without_shutdown();
13810        _result
13811    }
13812
13813    /// Similar to "send" but does not shutdown the channel if an error occurs.
13814    pub fn send_no_shutdown_on_err(
13815        self,
13816        mut result: Result<&[u8], i32>,
13817    ) -> Result<(), fidl::Error> {
13818        let _result = self.send_raw(result);
13819        self.drop_without_shutdown();
13820        _result
13821    }
13822
13823    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
13824        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
13825            result.map(|data| (data,)),
13826            self.tx_id,
13827            0x57e419a298c8ede,
13828            fidl::encoding::DynamicFlags::empty(),
13829        )
13830    }
13831}
13832
13833#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13834pub struct SymlinkMarker;
13835
13836impl fdomain_client::fidl::ProtocolMarker for SymlinkMarker {
13837    type Proxy = SymlinkProxy;
13838    type RequestStream = SymlinkRequestStream;
13839
13840    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
13841}
13842impl fdomain_client::fidl::DiscoverableProtocolMarker for SymlinkMarker {}
13843
13844pub trait SymlinkProxyInterface: Send + Sync {
13845    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
13846        + Send;
13847    fn r#link_into(
13848        &self,
13849        dst_parent_token: fdomain_client::Event,
13850        dst: &str,
13851    ) -> Self::LinkIntoResponseFut;
13852    fn r#clone(
13853        &self,
13854        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
13855    ) -> Result<(), fidl::Error>;
13856    type CloseResponseFut: std::future::Future<
13857            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
13858        > + Send;
13859    fn r#close(&self) -> Self::CloseResponseFut;
13860    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
13861    fn r#query(&self) -> Self::QueryResponseFut;
13862    fn r#deprecated_clone(
13863        &self,
13864        flags: OpenFlags,
13865        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
13866    ) -> Result<(), fidl::Error>;
13867    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
13868        + Send;
13869    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
13870    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
13871    fn r#deprecated_set_attr(
13872        &self,
13873        flags: NodeAttributeFlags,
13874        attributes: &NodeAttributes,
13875    ) -> Self::DeprecatedSetAttrResponseFut;
13876    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
13877        + Send;
13878    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
13879    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
13880        + Send;
13881    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
13882    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
13883        + Send;
13884    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
13885    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
13886        + Send;
13887    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
13888    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
13889        + Send;
13890    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
13891    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
13892        + Send;
13893    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
13894    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
13895        + Send;
13896    fn r#update_attributes(
13897        &self,
13898        payload: &MutableNodeAttributes,
13899    ) -> Self::UpdateAttributesResponseFut;
13900    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
13901    fn r#sync(&self) -> Self::SyncResponseFut;
13902    fn r#list_extended_attributes(
13903        &self,
13904        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
13905    ) -> Result<(), fidl::Error>;
13906    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
13907        + Send;
13908    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
13909    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
13910        + Send;
13911    fn r#set_extended_attribute(
13912        &self,
13913        name: &[u8],
13914        value: ExtendedAttributeValue,
13915        mode: SetExtendedAttributeMode,
13916    ) -> Self::SetExtendedAttributeResponseFut;
13917    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
13918        + Send;
13919    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
13920    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
13921    fn r#describe(&self) -> Self::DescribeResponseFut;
13922}
13923
13924#[derive(Debug, Clone)]
13925pub struct SymlinkProxy {
13926    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13927}
13928
13929impl fdomain_client::fidl::Proxy for SymlinkProxy {
13930    type Protocol = SymlinkMarker;
13931
13932    fn from_channel(inner: fdomain_client::Channel) -> Self {
13933        Self::new(inner)
13934    }
13935
13936    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13937        self.client.into_channel().map_err(|client| Self { client })
13938    }
13939
13940    fn as_channel(&self) -> &fdomain_client::Channel {
13941        self.client.as_channel()
13942    }
13943}
13944
13945impl SymlinkProxy {
13946    /// Create a new Proxy for fuchsia.io/Symlink.
13947    pub fn new(channel: fdomain_client::Channel) -> Self {
13948        let protocol_name = <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13949        Self { client: fidl::client::Client::new(channel, protocol_name) }
13950    }
13951
13952    /// Get a Stream of events from the remote end of the protocol.
13953    ///
13954    /// # Panics
13955    ///
13956    /// Panics if the event stream was already taken.
13957    pub fn take_event_stream(&self) -> SymlinkEventStream {
13958        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
13959    }
13960
13961    /// Creates a link to this this object with name `dst` in the directory represented by
13962    /// `dst_parent_token`.
13963    ///
13964    /// `dst` must be a resolved object name. Including "/" in the string will return
13965    /// `ZX_ERR_INVALID_ARGS`.
13966    ///
13967    /// This method requires the maximal set of rights supported by the filesystem for this object.
13968    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
13969    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
13970    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
13971    /// `ZX_ERR_ACCESS_DENIED`.
13972    ///
13973    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
13974    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
13975    ///
13976    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
13977    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
13978    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
13979    ///
13980    /// This method does not have the same atomicity properties has the `Directory::Link` method,
13981    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
13982    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
13983    pub fn r#link_into(
13984        &self,
13985        mut dst_parent_token: fdomain_client::Event,
13986        mut dst: &str,
13987    ) -> fidl::client::QueryResponseFut<
13988        LinkableLinkIntoResult,
13989        fdomain_client::fidl::FDomainResourceDialect,
13990    > {
13991        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
13992    }
13993
13994    pub fn r#clone(
13995        &self,
13996        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
13997    ) -> Result<(), fidl::Error> {
13998        SymlinkProxyInterface::r#clone(self, request)
13999    }
14000
14001    /// Terminates the connection.
14002    ///
14003    /// After calling `Close`, the client must not send any other requests.
14004    ///
14005    /// Servers, after sending the status response, should close the connection
14006    /// regardless of status and without sending an epitaph.
14007    ///
14008    /// Closing the client end of the channel should be semantically equivalent
14009    /// to calling `Close` without knowing when the close has completed or its
14010    /// status.
14011    pub fn r#close(
14012        &self,
14013    ) -> fidl::client::QueryResponseFut<
14014        fdomain_fuchsia_unknown::CloseableCloseResult,
14015        fdomain_client::fidl::FDomainResourceDialect,
14016    > {
14017        SymlinkProxyInterface::r#close(self)
14018    }
14019
14020    pub fn r#query(
14021        &self,
14022    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
14023        SymlinkProxyInterface::r#query(self)
14024    }
14025
14026    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14027    pub fn r#deprecated_clone(
14028        &self,
14029        mut flags: OpenFlags,
14030        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14031    ) -> Result<(), fidl::Error> {
14032        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
14033    }
14034
14035    /// DEPRECATED - Use `Node.GetAttributes` instead.
14036    pub fn r#deprecated_get_attr(
14037        &self,
14038    ) -> fidl::client::QueryResponseFut<
14039        (i32, NodeAttributes),
14040        fdomain_client::fidl::FDomainResourceDialect,
14041    > {
14042        SymlinkProxyInterface::r#deprecated_get_attr(self)
14043    }
14044
14045    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14046    pub fn r#deprecated_set_attr(
14047        &self,
14048        mut flags: NodeAttributeFlags,
14049        mut attributes: &NodeAttributes,
14050    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14051        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
14052    }
14053
14054    /// [DEPRECATED - Use new GetFlags method instead.]
14055    pub fn r#deprecated_get_flags(
14056        &self,
14057    ) -> fidl::client::QueryResponseFut<
14058        (i32, OpenFlags),
14059        fdomain_client::fidl::FDomainResourceDialect,
14060    > {
14061        SymlinkProxyInterface::r#deprecated_get_flags(self)
14062    }
14063
14064    /// [DEPRECATED - Use new SetFlags method instead.]
14065    pub fn r#deprecated_set_flags(
14066        &self,
14067        mut flags: OpenFlags,
14068    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14069        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
14070    }
14071
14072    /// Queries the flags that apply to this node after it has been opened/created. This method does
14073    /// not require any rights.
14074    ///
14075    /// Note that the final set of flags that apply to the connection may differ from those
14076    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14077    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14078    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14079    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14080    pub fn r#get_flags(
14081        &self,
14082    ) -> fidl::client::QueryResponseFut<
14083        NodeGetFlagsResult,
14084        fdomain_client::fidl::FDomainResourceDialect,
14085    > {
14086        SymlinkProxyInterface::r#get_flags(self)
14087    }
14088
14089    /// Sets the flags that apply to this node after it has been opened. This method does not
14090    /// require any rights.
14091    ///
14092    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14093    /// clear append mode.
14094    ///
14095    /// Errors:
14096    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14097    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14098    pub fn r#set_flags(
14099        &self,
14100        mut flags: Flags,
14101    ) -> fidl::client::QueryResponseFut<
14102        NodeSetFlagsResult,
14103        fdomain_client::fidl::FDomainResourceDialect,
14104    > {
14105        SymlinkProxyInterface::r#set_flags(self, flags)
14106    }
14107
14108    /// Query the filesystem for filesystem-specific information.
14109    pub fn r#query_filesystem(
14110        &self,
14111    ) -> fidl::client::QueryResponseFut<
14112        (i32, Option<Box<FilesystemInfo>>),
14113        fdomain_client::fidl::FDomainResourceDialect,
14114    > {
14115        SymlinkProxyInterface::r#query_filesystem(self)
14116    }
14117
14118    /// Acquires information about the node.
14119    ///
14120    /// The attributes of a node should be stable, independent of the
14121    /// specific protocol used to access it.
14122    ///
14123    /// If a particular attribute is not applicable or not supported,
14124    /// filesystems should leave the corresponding field absent.
14125    ///
14126    /// + `query` a bit-mask specifying which attributes to fetch. The server
14127    ///   should not return more than necessary.
14128    /// - `attributes` the returned attributes.
14129    ///
14130    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14131    pub fn r#get_attributes(
14132        &self,
14133        mut query: NodeAttributesQuery,
14134    ) -> fidl::client::QueryResponseFut<
14135        NodeGetAttributesResult,
14136        fdomain_client::fidl::FDomainResourceDialect,
14137    > {
14138        SymlinkProxyInterface::r#get_attributes(self, query)
14139    }
14140
14141    /// Updates information about the node.
14142    ///
14143    /// + `attributes` the presence of a table field in `attributes` indicates
14144    /// the intent to update the corresponding attribute.
14145    ///
14146    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14147    ///
14148    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14149    pub fn r#update_attributes(
14150        &self,
14151        mut payload: &MutableNodeAttributes,
14152    ) -> fidl::client::QueryResponseFut<
14153        NodeUpdateAttributesResult,
14154        fdomain_client::fidl::FDomainResourceDialect,
14155    > {
14156        SymlinkProxyInterface::r#update_attributes(self, payload)
14157    }
14158
14159    /// Synchronizes updates to the node to the underlying media, if it exists.
14160    ///
14161    /// This method will return when the filesystem server has flushed the
14162    /// relevant updates to the underlying media, but does not guarantee the
14163    /// underlying media has persisted the information, nor that any information
14164    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14165    /// between operations.
14166    ///
14167    /// This method does not require any rights.
14168    pub fn r#sync(
14169        &self,
14170    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
14171    {
14172        SymlinkProxyInterface::r#sync(self)
14173    }
14174
14175    /// Creates an iterator over all the extended attribute names associated
14176    /// with this node. If an error occurs it is returned as an epitaph on the
14177    /// iterator request channel, and then the channel is closed.
14178    ///
14179    /// GetExtendedAttributes can be used with any of these names to retrieve
14180    /// the associated value.
14181    ///
14182    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14183    pub fn r#list_extended_attributes(
14184        &self,
14185        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14186    ) -> Result<(), fidl::Error> {
14187        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
14188    }
14189
14190    /// Get the value associated with the given attribute `name` for this node.
14191    ///
14192    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14193    /// particular structure is imposed on them.
14194    ///
14195    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14196    pub fn r#get_extended_attribute(
14197        &self,
14198        mut name: &[u8],
14199    ) -> fidl::client::QueryResponseFut<
14200        NodeGetExtendedAttributeResult,
14201        fdomain_client::fidl::FDomainResourceDialect,
14202    > {
14203        SymlinkProxyInterface::r#get_extended_attribute(self, name)
14204    }
14205
14206    /// Set the value for the given attribute `name` to `value` for this node.
14207    ///
14208    /// The attribute name may exist, in which case the attribute is updated.
14209    /// If the attribute doesn't exist, it is created. The name should have no
14210    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14211    ///
14212    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14213    pub fn r#set_extended_attribute(
14214        &self,
14215        mut name: &[u8],
14216        mut value: ExtendedAttributeValue,
14217        mut mode: SetExtendedAttributeMode,
14218    ) -> fidl::client::QueryResponseFut<
14219        NodeSetExtendedAttributeResult,
14220        fdomain_client::fidl::FDomainResourceDialect,
14221    > {
14222        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
14223    }
14224
14225    /// Remove the specified extended attribute.
14226    ///
14227    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14228    ///
14229    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14230    pub fn r#remove_extended_attribute(
14231        &self,
14232        mut name: &[u8],
14233    ) -> fidl::client::QueryResponseFut<
14234        NodeRemoveExtendedAttributeResult,
14235        fdomain_client::fidl::FDomainResourceDialect,
14236    > {
14237        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
14238    }
14239
14240    pub fn r#describe(
14241        &self,
14242    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>
14243    {
14244        SymlinkProxyInterface::r#describe(self)
14245    }
14246}
14247
14248impl SymlinkProxyInterface for SymlinkProxy {
14249    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
14250        LinkableLinkIntoResult,
14251        fdomain_client::fidl::FDomainResourceDialect,
14252    >;
14253    fn r#link_into(
14254        &self,
14255        mut dst_parent_token: fdomain_client::Event,
14256        mut dst: &str,
14257    ) -> Self::LinkIntoResponseFut {
14258        fn _decode(
14259            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14260        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
14261            let _response = fidl::client::decode_transaction_body::<
14262                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14263                fdomain_client::fidl::FDomainResourceDialect,
14264                0x54f3949246a03e74,
14265            >(_buf?)?;
14266            Ok(_response.map(|x| x))
14267        }
14268        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
14269            (dst_parent_token, dst),
14270            0x54f3949246a03e74,
14271            fidl::encoding::DynamicFlags::empty(),
14272            _decode,
14273        )
14274    }
14275
14276    fn r#clone(
14277        &self,
14278        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14279    ) -> Result<(), fidl::Error> {
14280        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
14281            (request,),
14282            0x20d8a7aba2168a79,
14283            fidl::encoding::DynamicFlags::empty(),
14284        )
14285    }
14286
14287    type CloseResponseFut = fidl::client::QueryResponseFut<
14288        fdomain_fuchsia_unknown::CloseableCloseResult,
14289        fdomain_client::fidl::FDomainResourceDialect,
14290    >;
14291    fn r#close(&self) -> Self::CloseResponseFut {
14292        fn _decode(
14293            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14294        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
14295            let _response = fidl::client::decode_transaction_body::<
14296                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14297                fdomain_client::fidl::FDomainResourceDialect,
14298                0x5ac5d459ad7f657e,
14299            >(_buf?)?;
14300            Ok(_response.map(|x| x))
14301        }
14302        self.client.send_query_and_decode::<
14303            fidl::encoding::EmptyPayload,
14304            fdomain_fuchsia_unknown::CloseableCloseResult,
14305        >(
14306            (),
14307            0x5ac5d459ad7f657e,
14308            fidl::encoding::DynamicFlags::empty(),
14309            _decode,
14310        )
14311    }
14312
14313    type QueryResponseFut =
14314        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
14315    fn r#query(&self) -> Self::QueryResponseFut {
14316        fn _decode(
14317            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14318        ) -> Result<Vec<u8>, fidl::Error> {
14319            let _response = fidl::client::decode_transaction_body::<
14320                fdomain_fuchsia_unknown::QueryableQueryResponse,
14321                fdomain_client::fidl::FDomainResourceDialect,
14322                0x2658edee9decfc06,
14323            >(_buf?)?;
14324            Ok(_response.protocol)
14325        }
14326        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
14327            (),
14328            0x2658edee9decfc06,
14329            fidl::encoding::DynamicFlags::empty(),
14330            _decode,
14331        )
14332    }
14333
14334    fn r#deprecated_clone(
14335        &self,
14336        mut flags: OpenFlags,
14337        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14338    ) -> Result<(), fidl::Error> {
14339        self.client.send::<NodeDeprecatedCloneRequest>(
14340            (flags, object),
14341            0x5a61678f293ce16f,
14342            fidl::encoding::DynamicFlags::FLEXIBLE,
14343        )
14344    }
14345
14346    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
14347        (i32, NodeAttributes),
14348        fdomain_client::fidl::FDomainResourceDialect,
14349    >;
14350    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
14351        fn _decode(
14352            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14353        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14354            let _response = fidl::client::decode_transaction_body::<
14355                NodeDeprecatedGetAttrResponse,
14356                fdomain_client::fidl::FDomainResourceDialect,
14357                0x78985e216314dafd,
14358            >(_buf?)?;
14359            Ok((_response.s, _response.attributes))
14360        }
14361        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14362            (),
14363            0x78985e216314dafd,
14364            fidl::encoding::DynamicFlags::empty(),
14365            _decode,
14366        )
14367    }
14368
14369    type DeprecatedSetAttrResponseFut =
14370        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14371    fn r#deprecated_set_attr(
14372        &self,
14373        mut flags: NodeAttributeFlags,
14374        mut attributes: &NodeAttributes,
14375    ) -> Self::DeprecatedSetAttrResponseFut {
14376        fn _decode(
14377            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14378        ) -> Result<i32, fidl::Error> {
14379            let _response = fidl::client::decode_transaction_body::<
14380                NodeDeprecatedSetAttrResponse,
14381                fdomain_client::fidl::FDomainResourceDialect,
14382                0x4186c0f40d938f46,
14383            >(_buf?)?;
14384            Ok(_response.s)
14385        }
14386        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
14387            (flags, attributes),
14388            0x4186c0f40d938f46,
14389            fidl::encoding::DynamicFlags::empty(),
14390            _decode,
14391        )
14392    }
14393
14394    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14395        (i32, OpenFlags),
14396        fdomain_client::fidl::FDomainResourceDialect,
14397    >;
14398    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14399        fn _decode(
14400            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14401        ) -> Result<(i32, OpenFlags), fidl::Error> {
14402            let _response = fidl::client::decode_transaction_body::<
14403                NodeDeprecatedGetFlagsResponse,
14404                fdomain_client::fidl::FDomainResourceDialect,
14405                0x5b88fffb8eda3aa1,
14406            >(_buf?)?;
14407            Ok((_response.s, _response.flags))
14408        }
14409        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14410            (),
14411            0x5b88fffb8eda3aa1,
14412            fidl::encoding::DynamicFlags::empty(),
14413            _decode,
14414        )
14415    }
14416
14417    type DeprecatedSetFlagsResponseFut =
14418        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14419    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14420        fn _decode(
14421            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14422        ) -> Result<i32, fidl::Error> {
14423            let _response = fidl::client::decode_transaction_body::<
14424                NodeDeprecatedSetFlagsResponse,
14425                fdomain_client::fidl::FDomainResourceDialect,
14426                0x5295b76c71fde733,
14427            >(_buf?)?;
14428            Ok(_response.s)
14429        }
14430        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14431            (flags,),
14432            0x5295b76c71fde733,
14433            fidl::encoding::DynamicFlags::empty(),
14434            _decode,
14435        )
14436    }
14437
14438    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14439        NodeGetFlagsResult,
14440        fdomain_client::fidl::FDomainResourceDialect,
14441    >;
14442    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14443        fn _decode(
14444            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14445        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14446            let _response = fidl::client::decode_transaction_body::<
14447                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14448                fdomain_client::fidl::FDomainResourceDialect,
14449                0x176eb318f64ec23,
14450            >(_buf?)?
14451            .into_result_fdomain::<SymlinkMarker>("get_flags")?;
14452            Ok(_response.map(|x| x.flags))
14453        }
14454        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14455            (),
14456            0x176eb318f64ec23,
14457            fidl::encoding::DynamicFlags::FLEXIBLE,
14458            _decode,
14459        )
14460    }
14461
14462    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14463        NodeSetFlagsResult,
14464        fdomain_client::fidl::FDomainResourceDialect,
14465    >;
14466    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14467        fn _decode(
14468            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14469        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14470            let _response = fidl::client::decode_transaction_body::<
14471                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14472                fdomain_client::fidl::FDomainResourceDialect,
14473                0x55a8028685791ea8,
14474            >(_buf?)?
14475            .into_result_fdomain::<SymlinkMarker>("set_flags")?;
14476            Ok(_response.map(|x| x))
14477        }
14478        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14479            (flags,),
14480            0x55a8028685791ea8,
14481            fidl::encoding::DynamicFlags::FLEXIBLE,
14482            _decode,
14483        )
14484    }
14485
14486    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14487        (i32, Option<Box<FilesystemInfo>>),
14488        fdomain_client::fidl::FDomainResourceDialect,
14489    >;
14490    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14491        fn _decode(
14492            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14493        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14494            let _response = fidl::client::decode_transaction_body::<
14495                NodeQueryFilesystemResponse,
14496                fdomain_client::fidl::FDomainResourceDialect,
14497                0x6f344a1c6b0a0610,
14498            >(_buf?)?;
14499            Ok((_response.s, _response.info))
14500        }
14501        self.client.send_query_and_decode::<
14502            fidl::encoding::EmptyPayload,
14503            (i32, Option<Box<FilesystemInfo>>),
14504        >(
14505            (),
14506            0x6f344a1c6b0a0610,
14507            fidl::encoding::DynamicFlags::empty(),
14508            _decode,
14509        )
14510    }
14511
14512    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
14513        NodeGetAttributesResult,
14514        fdomain_client::fidl::FDomainResourceDialect,
14515    >;
14516    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
14517        fn _decode(
14518            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14519        ) -> Result<NodeGetAttributesResult, fidl::Error> {
14520            let _response = fidl::client::decode_transaction_body::<
14521                fidl::encoding::ResultType<NodeAttributes2, i32>,
14522                fdomain_client::fidl::FDomainResourceDialect,
14523                0x3d4396a638ea053b,
14524            >(_buf?)?;
14525            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
14526        }
14527        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
14528            (query,),
14529            0x3d4396a638ea053b,
14530            fidl::encoding::DynamicFlags::empty(),
14531            _decode,
14532        )
14533    }
14534
14535    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
14536        NodeUpdateAttributesResult,
14537        fdomain_client::fidl::FDomainResourceDialect,
14538    >;
14539    fn r#update_attributes(
14540        &self,
14541        mut payload: &MutableNodeAttributes,
14542    ) -> Self::UpdateAttributesResponseFut {
14543        fn _decode(
14544            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14545        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
14546            let _response = fidl::client::decode_transaction_body::<
14547                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14548                fdomain_client::fidl::FDomainResourceDialect,
14549                0x3308c1da5a89bf08,
14550            >(_buf?)?;
14551            Ok(_response.map(|x| x))
14552        }
14553        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
14554            payload,
14555            0x3308c1da5a89bf08,
14556            fidl::encoding::DynamicFlags::empty(),
14557            _decode,
14558        )
14559    }
14560
14561    type SyncResponseFut = fidl::client::QueryResponseFut<
14562        NodeSyncResult,
14563        fdomain_client::fidl::FDomainResourceDialect,
14564    >;
14565    fn r#sync(&self) -> Self::SyncResponseFut {
14566        fn _decode(
14567            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14568        ) -> Result<NodeSyncResult, fidl::Error> {
14569            let _response = fidl::client::decode_transaction_body::<
14570                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14571                fdomain_client::fidl::FDomainResourceDialect,
14572                0x2c5c27ca0ab5dc49,
14573            >(_buf?)?;
14574            Ok(_response.map(|x| x))
14575        }
14576        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
14577            (),
14578            0x2c5c27ca0ab5dc49,
14579            fidl::encoding::DynamicFlags::empty(),
14580            _decode,
14581        )
14582    }
14583
14584    fn r#list_extended_attributes(
14585        &self,
14586        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14587    ) -> Result<(), fidl::Error> {
14588        self.client.send::<NodeListExtendedAttributesRequest>(
14589            (iterator,),
14590            0x4b61033de007fcd0,
14591            fidl::encoding::DynamicFlags::empty(),
14592        )
14593    }
14594
14595    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14596        NodeGetExtendedAttributeResult,
14597        fdomain_client::fidl::FDomainResourceDialect,
14598    >;
14599    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14600        fn _decode(
14601            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14602        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14603            let _response = fidl::client::decode_transaction_body::<
14604                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14605                fdomain_client::fidl::FDomainResourceDialect,
14606                0x45ffa3ccfdeb76db,
14607            >(_buf?)?;
14608            Ok(_response.map(|x| x))
14609        }
14610        self.client.send_query_and_decode::<
14611            NodeGetExtendedAttributeRequest,
14612            NodeGetExtendedAttributeResult,
14613        >(
14614            (name,),
14615            0x45ffa3ccfdeb76db,
14616            fidl::encoding::DynamicFlags::empty(),
14617            _decode,
14618        )
14619    }
14620
14621    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14622        NodeSetExtendedAttributeResult,
14623        fdomain_client::fidl::FDomainResourceDialect,
14624    >;
14625    fn r#set_extended_attribute(
14626        &self,
14627        mut name: &[u8],
14628        mut value: ExtendedAttributeValue,
14629        mut mode: SetExtendedAttributeMode,
14630    ) -> Self::SetExtendedAttributeResponseFut {
14631        fn _decode(
14632            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14633        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14634            let _response = fidl::client::decode_transaction_body::<
14635                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14636                fdomain_client::fidl::FDomainResourceDialect,
14637                0x4a951362f681f23c,
14638            >(_buf?)?;
14639            Ok(_response.map(|x| x))
14640        }
14641        self.client.send_query_and_decode::<
14642            NodeSetExtendedAttributeRequest,
14643            NodeSetExtendedAttributeResult,
14644        >(
14645            (name, &mut value, mode,),
14646            0x4a951362f681f23c,
14647            fidl::encoding::DynamicFlags::empty(),
14648            _decode,
14649        )
14650    }
14651
14652    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14653        NodeRemoveExtendedAttributeResult,
14654        fdomain_client::fidl::FDomainResourceDialect,
14655    >;
14656    fn r#remove_extended_attribute(
14657        &self,
14658        mut name: &[u8],
14659    ) -> Self::RemoveExtendedAttributeResponseFut {
14660        fn _decode(
14661            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14662        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14663            let _response = fidl::client::decode_transaction_body::<
14664                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14665                fdomain_client::fidl::FDomainResourceDialect,
14666                0x7a0b9f3a9bf9032d,
14667            >(_buf?)?;
14668            Ok(_response.map(|x| x))
14669        }
14670        self.client.send_query_and_decode::<
14671            NodeRemoveExtendedAttributeRequest,
14672            NodeRemoveExtendedAttributeResult,
14673        >(
14674            (name,),
14675            0x7a0b9f3a9bf9032d,
14676            fidl::encoding::DynamicFlags::empty(),
14677            _decode,
14678        )
14679    }
14680
14681    type DescribeResponseFut =
14682        fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>;
14683    fn r#describe(&self) -> Self::DescribeResponseFut {
14684        fn _decode(
14685            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14686        ) -> Result<SymlinkInfo, fidl::Error> {
14687            let _response = fidl::client::decode_transaction_body::<
14688                fidl::encoding::FlexibleType<SymlinkInfo>,
14689                fdomain_client::fidl::FDomainResourceDialect,
14690                0x742c2ea5e89831f3,
14691            >(_buf?)?
14692            .into_result_fdomain::<SymlinkMarker>("describe")?;
14693            Ok(_response)
14694        }
14695        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
14696            (),
14697            0x742c2ea5e89831f3,
14698            fidl::encoding::DynamicFlags::FLEXIBLE,
14699            _decode,
14700        )
14701    }
14702}
14703
14704pub struct SymlinkEventStream {
14705    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
14706}
14707
14708impl std::marker::Unpin for SymlinkEventStream {}
14709
14710impl futures::stream::FusedStream for SymlinkEventStream {
14711    fn is_terminated(&self) -> bool {
14712        self.event_receiver.is_terminated()
14713    }
14714}
14715
14716impl futures::Stream for SymlinkEventStream {
14717    type Item = Result<SymlinkEvent, fidl::Error>;
14718
14719    fn poll_next(
14720        mut self: std::pin::Pin<&mut Self>,
14721        cx: &mut std::task::Context<'_>,
14722    ) -> std::task::Poll<Option<Self::Item>> {
14723        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14724            &mut self.event_receiver,
14725            cx
14726        )?) {
14727            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
14728            None => std::task::Poll::Ready(None),
14729        }
14730    }
14731}
14732
14733#[derive(Debug)]
14734pub enum SymlinkEvent {
14735    OnOpen_ {
14736        s: i32,
14737        info: Option<Box<NodeInfoDeprecated>>,
14738    },
14739    OnRepresentation {
14740        payload: Representation,
14741    },
14742    #[non_exhaustive]
14743    _UnknownEvent {
14744        /// Ordinal of the event that was sent.
14745        ordinal: u64,
14746    },
14747}
14748
14749impl SymlinkEvent {
14750    #[allow(irrefutable_let_patterns)]
14751    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14752        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14753    }
14754    #[allow(irrefutable_let_patterns)]
14755    pub fn into_on_representation(self) -> Option<Representation> {
14756        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14757    }
14758
14759    /// Decodes a message buffer as a [`SymlinkEvent`].
14760    fn decode(
14761        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14762    ) -> Result<SymlinkEvent, fidl::Error> {
14763        let (bytes, _handles) = buf.split_mut();
14764        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14765        debug_assert_eq!(tx_header.tx_id, 0);
14766        match tx_header.ordinal {
14767            0x7fc7bbb1dbfd1972 => {
14768                let mut out = fidl::new_empty!(
14769                    NodeOnOpenRequest,
14770                    fdomain_client::fidl::FDomainResourceDialect
14771                );
14772                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14773                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
14774            }
14775            0x5cb40567d80a510c => {
14776                let mut out =
14777                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
14778                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14779                Ok((SymlinkEvent::OnRepresentation { payload: out }))
14780            }
14781            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14782                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14783            }
14784            _ => Err(fidl::Error::UnknownOrdinal {
14785                ordinal: tx_header.ordinal,
14786                protocol_name: <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14787            }),
14788        }
14789    }
14790}
14791
14792/// A Stream of incoming requests for fuchsia.io/Symlink.
14793pub struct SymlinkRequestStream {
14794    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14795    is_terminated: bool,
14796}
14797
14798impl std::marker::Unpin for SymlinkRequestStream {}
14799
14800impl futures::stream::FusedStream for SymlinkRequestStream {
14801    fn is_terminated(&self) -> bool {
14802        self.is_terminated
14803    }
14804}
14805
14806impl fdomain_client::fidl::RequestStream for SymlinkRequestStream {
14807    type Protocol = SymlinkMarker;
14808    type ControlHandle = SymlinkControlHandle;
14809
14810    fn from_channel(channel: fdomain_client::Channel) -> Self {
14811        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14812    }
14813
14814    fn control_handle(&self) -> Self::ControlHandle {
14815        SymlinkControlHandle { inner: self.inner.clone() }
14816    }
14817
14818    fn into_inner(
14819        self,
14820    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
14821    {
14822        (self.inner, self.is_terminated)
14823    }
14824
14825    fn from_inner(
14826        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14827        is_terminated: bool,
14828    ) -> Self {
14829        Self { inner, is_terminated }
14830    }
14831}
14832
14833impl futures::Stream for SymlinkRequestStream {
14834    type Item = Result<SymlinkRequest, fidl::Error>;
14835
14836    fn poll_next(
14837        mut self: std::pin::Pin<&mut Self>,
14838        cx: &mut std::task::Context<'_>,
14839    ) -> std::task::Poll<Option<Self::Item>> {
14840        let this = &mut *self;
14841        if this.inner.check_shutdown(cx) {
14842            this.is_terminated = true;
14843            return std::task::Poll::Ready(None);
14844        }
14845        if this.is_terminated {
14846            panic!("polled SymlinkRequestStream after completion");
14847        }
14848        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14849            |bytes, handles| {
14850                match this.inner.channel().read_etc(cx, bytes, handles) {
14851                    std::task::Poll::Ready(Ok(())) => {}
14852                    std::task::Poll::Pending => return std::task::Poll::Pending,
14853                    std::task::Poll::Ready(Err(None)) => {
14854                        this.is_terminated = true;
14855                        return std::task::Poll::Ready(None);
14856                    }
14857                    std::task::Poll::Ready(Err(Some(e))) => {
14858                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14859                            e.into(),
14860                        ))));
14861                    }
14862                }
14863
14864                // A message has been received from the channel
14865                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14866
14867                std::task::Poll::Ready(Some(match header.ordinal {
14868                    0x54f3949246a03e74 => {
14869                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14870                        let mut req = fidl::new_empty!(
14871                            LinkableLinkIntoRequest,
14872                            fdomain_client::fidl::FDomainResourceDialect
14873                        );
14874                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
14875                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14876                        Ok(SymlinkRequest::LinkInto {
14877                            dst_parent_token: req.dst_parent_token,
14878                            dst: req.dst,
14879
14880                            responder: SymlinkLinkIntoResponder {
14881                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14882                                tx_id: header.tx_id,
14883                            },
14884                        })
14885                    }
14886                    0x20d8a7aba2168a79 => {
14887                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14888                        let mut req = fidl::new_empty!(
14889                            fdomain_fuchsia_unknown::CloneableCloneRequest,
14890                            fdomain_client::fidl::FDomainResourceDialect
14891                        );
14892                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14893                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14894                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
14895                    }
14896                    0x5ac5d459ad7f657e => {
14897                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14898                        let mut req = fidl::new_empty!(
14899                            fidl::encoding::EmptyPayload,
14900                            fdomain_client::fidl::FDomainResourceDialect
14901                        );
14902                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14903                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14904                        Ok(SymlinkRequest::Close {
14905                            responder: SymlinkCloseResponder {
14906                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14907                                tx_id: header.tx_id,
14908                            },
14909                        })
14910                    }
14911                    0x2658edee9decfc06 => {
14912                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14913                        let mut req = fidl::new_empty!(
14914                            fidl::encoding::EmptyPayload,
14915                            fdomain_client::fidl::FDomainResourceDialect
14916                        );
14917                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14918                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14919                        Ok(SymlinkRequest::Query {
14920                            responder: SymlinkQueryResponder {
14921                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14922                                tx_id: header.tx_id,
14923                            },
14924                        })
14925                    }
14926                    0x5a61678f293ce16f => {
14927                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14928                        let mut req = fidl::new_empty!(
14929                            NodeDeprecatedCloneRequest,
14930                            fdomain_client::fidl::FDomainResourceDialect
14931                        );
14932                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14933                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14934                        Ok(SymlinkRequest::DeprecatedClone {
14935                            flags: req.flags,
14936                            object: req.object,
14937
14938                            control_handle,
14939                        })
14940                    }
14941                    0x78985e216314dafd => {
14942                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14943                        let mut req = fidl::new_empty!(
14944                            fidl::encoding::EmptyPayload,
14945                            fdomain_client::fidl::FDomainResourceDialect
14946                        );
14947                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14948                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14949                        Ok(SymlinkRequest::DeprecatedGetAttr {
14950                            responder: SymlinkDeprecatedGetAttrResponder {
14951                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14952                                tx_id: header.tx_id,
14953                            },
14954                        })
14955                    }
14956                    0x4186c0f40d938f46 => {
14957                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14958                        let mut req = fidl::new_empty!(
14959                            NodeDeprecatedSetAttrRequest,
14960                            fdomain_client::fidl::FDomainResourceDialect
14961                        );
14962                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14963                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14964                        Ok(SymlinkRequest::DeprecatedSetAttr {
14965                            flags: req.flags,
14966                            attributes: req.attributes,
14967
14968                            responder: SymlinkDeprecatedSetAttrResponder {
14969                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14970                                tx_id: header.tx_id,
14971                            },
14972                        })
14973                    }
14974                    0x5b88fffb8eda3aa1 => {
14975                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14976                        let mut req = fidl::new_empty!(
14977                            fidl::encoding::EmptyPayload,
14978                            fdomain_client::fidl::FDomainResourceDialect
14979                        );
14980                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14981                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14982                        Ok(SymlinkRequest::DeprecatedGetFlags {
14983                            responder: SymlinkDeprecatedGetFlagsResponder {
14984                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14985                                tx_id: header.tx_id,
14986                            },
14987                        })
14988                    }
14989                    0x5295b76c71fde733 => {
14990                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14991                        let mut req = fidl::new_empty!(
14992                            NodeDeprecatedSetFlagsRequest,
14993                            fdomain_client::fidl::FDomainResourceDialect
14994                        );
14995                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14996                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14997                        Ok(SymlinkRequest::DeprecatedSetFlags {
14998                            flags: req.flags,
14999
15000                            responder: SymlinkDeprecatedSetFlagsResponder {
15001                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15002                                tx_id: header.tx_id,
15003                            },
15004                        })
15005                    }
15006                    0x176eb318f64ec23 => {
15007                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15008                        let mut req = fidl::new_empty!(
15009                            fidl::encoding::EmptyPayload,
15010                            fdomain_client::fidl::FDomainResourceDialect
15011                        );
15012                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15013                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15014                        Ok(SymlinkRequest::GetFlags {
15015                            responder: SymlinkGetFlagsResponder {
15016                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15017                                tx_id: header.tx_id,
15018                            },
15019                        })
15020                    }
15021                    0x55a8028685791ea8 => {
15022                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15023                        let mut req = fidl::new_empty!(
15024                            NodeSetFlagsRequest,
15025                            fdomain_client::fidl::FDomainResourceDialect
15026                        );
15027                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15028                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15029                        Ok(SymlinkRequest::SetFlags {
15030                            flags: req.flags,
15031
15032                            responder: SymlinkSetFlagsResponder {
15033                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15034                                tx_id: header.tx_id,
15035                            },
15036                        })
15037                    }
15038                    0x6f344a1c6b0a0610 => {
15039                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15040                        let mut req = fidl::new_empty!(
15041                            fidl::encoding::EmptyPayload,
15042                            fdomain_client::fidl::FDomainResourceDialect
15043                        );
15044                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15045                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15046                        Ok(SymlinkRequest::QueryFilesystem {
15047                            responder: SymlinkQueryFilesystemResponder {
15048                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15049                                tx_id: header.tx_id,
15050                            },
15051                        })
15052                    }
15053                    0x3d4396a638ea053b => {
15054                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15055                        let mut req = fidl::new_empty!(
15056                            NodeGetAttributesRequest,
15057                            fdomain_client::fidl::FDomainResourceDialect
15058                        );
15059                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15060                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15061                        Ok(SymlinkRequest::GetAttributes {
15062                            query: req.query,
15063
15064                            responder: SymlinkGetAttributesResponder {
15065                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15066                                tx_id: header.tx_id,
15067                            },
15068                        })
15069                    }
15070                    0x3308c1da5a89bf08 => {
15071                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15072                        let mut req = fidl::new_empty!(
15073                            MutableNodeAttributes,
15074                            fdomain_client::fidl::FDomainResourceDialect
15075                        );
15076                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
15077                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15078                        Ok(SymlinkRequest::UpdateAttributes {
15079                            payload: req,
15080                            responder: SymlinkUpdateAttributesResponder {
15081                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15082                                tx_id: header.tx_id,
15083                            },
15084                        })
15085                    }
15086                    0x2c5c27ca0ab5dc49 => {
15087                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15088                        let mut req = fidl::new_empty!(
15089                            fidl::encoding::EmptyPayload,
15090                            fdomain_client::fidl::FDomainResourceDialect
15091                        );
15092                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15093                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15094                        Ok(SymlinkRequest::Sync {
15095                            responder: SymlinkSyncResponder {
15096                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15097                                tx_id: header.tx_id,
15098                            },
15099                        })
15100                    }
15101                    0x4b61033de007fcd0 => {
15102                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15103                        let mut req = fidl::new_empty!(
15104                            NodeListExtendedAttributesRequest,
15105                            fdomain_client::fidl::FDomainResourceDialect
15106                        );
15107                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15108                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15109                        Ok(SymlinkRequest::ListExtendedAttributes {
15110                            iterator: req.iterator,
15111
15112                            control_handle,
15113                        })
15114                    }
15115                    0x45ffa3ccfdeb76db => {
15116                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15117                        let mut req = fidl::new_empty!(
15118                            NodeGetExtendedAttributeRequest,
15119                            fdomain_client::fidl::FDomainResourceDialect
15120                        );
15121                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15122                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15123                        Ok(SymlinkRequest::GetExtendedAttribute {
15124                            name: req.name,
15125
15126                            responder: SymlinkGetExtendedAttributeResponder {
15127                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15128                                tx_id: header.tx_id,
15129                            },
15130                        })
15131                    }
15132                    0x4a951362f681f23c => {
15133                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15134                        let mut req = fidl::new_empty!(
15135                            NodeSetExtendedAttributeRequest,
15136                            fdomain_client::fidl::FDomainResourceDialect
15137                        );
15138                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15139                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15140                        Ok(SymlinkRequest::SetExtendedAttribute {
15141                            name: req.name,
15142                            value: req.value,
15143                            mode: req.mode,
15144
15145                            responder: SymlinkSetExtendedAttributeResponder {
15146                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15147                                tx_id: header.tx_id,
15148                            },
15149                        })
15150                    }
15151                    0x7a0b9f3a9bf9032d => {
15152                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15153                        let mut req = fidl::new_empty!(
15154                            NodeRemoveExtendedAttributeRequest,
15155                            fdomain_client::fidl::FDomainResourceDialect
15156                        );
15157                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15158                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15159                        Ok(SymlinkRequest::RemoveExtendedAttribute {
15160                            name: req.name,
15161
15162                            responder: SymlinkRemoveExtendedAttributeResponder {
15163                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15164                                tx_id: header.tx_id,
15165                            },
15166                        })
15167                    }
15168                    0x742c2ea5e89831f3 => {
15169                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15170                        let mut req = fidl::new_empty!(
15171                            fidl::encoding::EmptyPayload,
15172                            fdomain_client::fidl::FDomainResourceDialect
15173                        );
15174                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15175                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15176                        Ok(SymlinkRequest::Describe {
15177                            responder: SymlinkDescribeResponder {
15178                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15179                                tx_id: header.tx_id,
15180                            },
15181                        })
15182                    }
15183                    _ if header.tx_id == 0
15184                        && header
15185                            .dynamic_flags()
15186                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15187                    {
15188                        Ok(SymlinkRequest::_UnknownMethod {
15189                            ordinal: header.ordinal,
15190                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15191                            method_type: fidl::MethodType::OneWay,
15192                        })
15193                    }
15194                    _ if header
15195                        .dynamic_flags()
15196                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15197                    {
15198                        this.inner.send_framework_err(
15199                            fidl::encoding::FrameworkErr::UnknownMethod,
15200                            header.tx_id,
15201                            header.ordinal,
15202                            header.dynamic_flags(),
15203                            (bytes, handles),
15204                        )?;
15205                        Ok(SymlinkRequest::_UnknownMethod {
15206                            ordinal: header.ordinal,
15207                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15208                            method_type: fidl::MethodType::TwoWay,
15209                        })
15210                    }
15211                    _ => Err(fidl::Error::UnknownOrdinal {
15212                        ordinal: header.ordinal,
15213                        protocol_name:
15214                            <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15215                    }),
15216                }))
15217            },
15218        )
15219    }
15220}
15221
15222/// A ['Node'] which contains a symbolic link.
15223#[derive(Debug)]
15224pub enum SymlinkRequest {
15225    /// Creates a link to this this object with name `dst` in the directory represented by
15226    /// `dst_parent_token`.
15227    ///
15228    /// `dst` must be a resolved object name. Including "/" in the string will return
15229    /// `ZX_ERR_INVALID_ARGS`.
15230    ///
15231    /// This method requires the maximal set of rights supported by the filesystem for this object.
15232    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
15233    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
15234    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
15235    /// `ZX_ERR_ACCESS_DENIED`.
15236    ///
15237    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
15238    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
15239    ///
15240    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
15241    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
15242    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
15243    ///
15244    /// This method does not have the same atomicity properties has the `Directory::Link` method,
15245    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
15246    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
15247    LinkInto {
15248        dst_parent_token: fdomain_client::Event,
15249        dst: String,
15250        responder: SymlinkLinkIntoResponder,
15251    },
15252    Clone {
15253        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15254        control_handle: SymlinkControlHandle,
15255    },
15256    /// Terminates the connection.
15257    ///
15258    /// After calling `Close`, the client must not send any other requests.
15259    ///
15260    /// Servers, after sending the status response, should close the connection
15261    /// regardless of status and without sending an epitaph.
15262    ///
15263    /// Closing the client end of the channel should be semantically equivalent
15264    /// to calling `Close` without knowing when the close has completed or its
15265    /// status.
15266    Close {
15267        responder: SymlinkCloseResponder,
15268    },
15269    Query {
15270        responder: SymlinkQueryResponder,
15271    },
15272    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
15273    DeprecatedClone {
15274        flags: OpenFlags,
15275        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
15276        control_handle: SymlinkControlHandle,
15277    },
15278    /// DEPRECATED - Use `Node.GetAttributes` instead.
15279    DeprecatedGetAttr {
15280        responder: SymlinkDeprecatedGetAttrResponder,
15281    },
15282    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
15283    DeprecatedSetAttr {
15284        flags: NodeAttributeFlags,
15285        attributes: NodeAttributes,
15286        responder: SymlinkDeprecatedSetAttrResponder,
15287    },
15288    /// [DEPRECATED - Use new GetFlags method instead.]
15289    DeprecatedGetFlags {
15290        responder: SymlinkDeprecatedGetFlagsResponder,
15291    },
15292    /// [DEPRECATED - Use new SetFlags method instead.]
15293    DeprecatedSetFlags {
15294        flags: OpenFlags,
15295        responder: SymlinkDeprecatedSetFlagsResponder,
15296    },
15297    /// Queries the flags that apply to this node after it has been opened/created. This method does
15298    /// not require any rights.
15299    ///
15300    /// Note that the final set of flags that apply to the connection may differ from those
15301    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
15302    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
15303    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
15304    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
15305    GetFlags {
15306        responder: SymlinkGetFlagsResponder,
15307    },
15308    /// Sets the flags that apply to this node after it has been opened. This method does not
15309    /// require any rights.
15310    ///
15311    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
15312    /// clear append mode.
15313    ///
15314    /// Errors:
15315    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
15316    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
15317    SetFlags {
15318        flags: Flags,
15319        responder: SymlinkSetFlagsResponder,
15320    },
15321    /// Query the filesystem for filesystem-specific information.
15322    QueryFilesystem {
15323        responder: SymlinkQueryFilesystemResponder,
15324    },
15325    /// Acquires information about the node.
15326    ///
15327    /// The attributes of a node should be stable, independent of the
15328    /// specific protocol used to access it.
15329    ///
15330    /// If a particular attribute is not applicable or not supported,
15331    /// filesystems should leave the corresponding field absent.
15332    ///
15333    /// + `query` a bit-mask specifying which attributes to fetch. The server
15334    ///   should not return more than necessary.
15335    /// - `attributes` the returned attributes.
15336    ///
15337    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15338    GetAttributes {
15339        query: NodeAttributesQuery,
15340        responder: SymlinkGetAttributesResponder,
15341    },
15342    /// Updates information about the node.
15343    ///
15344    /// + `attributes` the presence of a table field in `attributes` indicates
15345    /// the intent to update the corresponding attribute.
15346    ///
15347    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
15348    ///
15349    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15350    UpdateAttributes {
15351        payload: MutableNodeAttributes,
15352        responder: SymlinkUpdateAttributesResponder,
15353    },
15354    /// Synchronizes updates to the node to the underlying media, if it exists.
15355    ///
15356    /// This method will return when the filesystem server has flushed the
15357    /// relevant updates to the underlying media, but does not guarantee the
15358    /// underlying media has persisted the information, nor that any information
15359    /// is committed to hardware. Clients may use `Sync` to ensure ordering
15360    /// between operations.
15361    ///
15362    /// This method does not require any rights.
15363    Sync {
15364        responder: SymlinkSyncResponder,
15365    },
15366    /// Creates an iterator over all the extended attribute names associated
15367    /// with this node. If an error occurs it is returned as an epitaph on the
15368    /// iterator request channel, and then the channel is closed.
15369    ///
15370    /// GetExtendedAttributes can be used with any of these names to retrieve
15371    /// the associated value.
15372    ///
15373    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15374    ListExtendedAttributes {
15375        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15376        control_handle: SymlinkControlHandle,
15377    },
15378    /// Get the value associated with the given attribute `name` for this node.
15379    ///
15380    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15381    /// particular structure is imposed on them.
15382    ///
15383    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15384    GetExtendedAttribute {
15385        name: Vec<u8>,
15386        responder: SymlinkGetExtendedAttributeResponder,
15387    },
15388    /// Set the value for the given attribute `name` to `value` for this node.
15389    ///
15390    /// The attribute name may exist, in which case the attribute is updated.
15391    /// If the attribute doesn't exist, it is created. The name should have no
15392    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15393    ///
15394    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15395    SetExtendedAttribute {
15396        name: Vec<u8>,
15397        value: ExtendedAttributeValue,
15398        mode: SetExtendedAttributeMode,
15399        responder: SymlinkSetExtendedAttributeResponder,
15400    },
15401    /// Remove the specified extended attribute.
15402    ///
15403    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15404    ///
15405    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15406    RemoveExtendedAttribute {
15407        name: Vec<u8>,
15408        responder: SymlinkRemoveExtendedAttributeResponder,
15409    },
15410    Describe {
15411        responder: SymlinkDescribeResponder,
15412    },
15413    /// An interaction was received which does not match any known method.
15414    #[non_exhaustive]
15415    _UnknownMethod {
15416        /// Ordinal of the method that was called.
15417        ordinal: u64,
15418        control_handle: SymlinkControlHandle,
15419        method_type: fidl::MethodType,
15420    },
15421}
15422
15423impl SymlinkRequest {
15424    #[allow(irrefutable_let_patterns)]
15425    pub fn into_link_into(
15426        self,
15427    ) -> Option<(fdomain_client::Event, String, SymlinkLinkIntoResponder)> {
15428        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
15429            Some((dst_parent_token, dst, responder))
15430        } else {
15431            None
15432        }
15433    }
15434
15435    #[allow(irrefutable_let_patterns)]
15436    pub fn into_clone(
15437        self,
15438    ) -> Option<(
15439        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15440        SymlinkControlHandle,
15441    )> {
15442        if let SymlinkRequest::Clone { request, control_handle } = self {
15443            Some((request, control_handle))
15444        } else {
15445            None
15446        }
15447    }
15448
15449    #[allow(irrefutable_let_patterns)]
15450    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
15451        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
15452    }
15453
15454    #[allow(irrefutable_let_patterns)]
15455    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
15456        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
15457    }
15458
15459    #[allow(irrefutable_let_patterns)]
15460    pub fn into_deprecated_clone(
15461        self,
15462    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, SymlinkControlHandle)>
15463    {
15464        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
15465            Some((flags, object, control_handle))
15466        } else {
15467            None
15468        }
15469    }
15470
15471    #[allow(irrefutable_let_patterns)]
15472    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
15473        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
15474            Some((responder))
15475        } else {
15476            None
15477        }
15478    }
15479
15480    #[allow(irrefutable_let_patterns)]
15481    pub fn into_deprecated_set_attr(
15482        self,
15483    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
15484        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
15485            Some((flags, attributes, responder))
15486        } else {
15487            None
15488        }
15489    }
15490
15491    #[allow(irrefutable_let_patterns)]
15492    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
15493        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
15494            Some((responder))
15495        } else {
15496            None
15497        }
15498    }
15499
15500    #[allow(irrefutable_let_patterns)]
15501    pub fn into_deprecated_set_flags(
15502        self,
15503    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
15504        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
15505            Some((flags, responder))
15506        } else {
15507            None
15508        }
15509    }
15510
15511    #[allow(irrefutable_let_patterns)]
15512    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
15513        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
15514    }
15515
15516    #[allow(irrefutable_let_patterns)]
15517    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
15518        if let SymlinkRequest::SetFlags { flags, responder } = self {
15519            Some((flags, responder))
15520        } else {
15521            None
15522        }
15523    }
15524
15525    #[allow(irrefutable_let_patterns)]
15526    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
15527        if let SymlinkRequest::QueryFilesystem { responder } = self {
15528            Some((responder))
15529        } else {
15530            None
15531        }
15532    }
15533
15534    #[allow(irrefutable_let_patterns)]
15535    pub fn into_get_attributes(
15536        self,
15537    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
15538        if let SymlinkRequest::GetAttributes { query, responder } = self {
15539            Some((query, responder))
15540        } else {
15541            None
15542        }
15543    }
15544
15545    #[allow(irrefutable_let_patterns)]
15546    pub fn into_update_attributes(
15547        self,
15548    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
15549        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
15550            Some((payload, responder))
15551        } else {
15552            None
15553        }
15554    }
15555
15556    #[allow(irrefutable_let_patterns)]
15557    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
15558        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
15559    }
15560
15561    #[allow(irrefutable_let_patterns)]
15562    pub fn into_list_extended_attributes(
15563        self,
15564    ) -> Option<(
15565        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15566        SymlinkControlHandle,
15567    )> {
15568        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
15569            Some((iterator, control_handle))
15570        } else {
15571            None
15572        }
15573    }
15574
15575    #[allow(irrefutable_let_patterns)]
15576    pub fn into_get_extended_attribute(
15577        self,
15578    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
15579        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
15580            Some((name, responder))
15581        } else {
15582            None
15583        }
15584    }
15585
15586    #[allow(irrefutable_let_patterns)]
15587    pub fn into_set_extended_attribute(
15588        self,
15589    ) -> Option<(
15590        Vec<u8>,
15591        ExtendedAttributeValue,
15592        SetExtendedAttributeMode,
15593        SymlinkSetExtendedAttributeResponder,
15594    )> {
15595        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
15596            Some((name, value, mode, responder))
15597        } else {
15598            None
15599        }
15600    }
15601
15602    #[allow(irrefutable_let_patterns)]
15603    pub fn into_remove_extended_attribute(
15604        self,
15605    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
15606        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
15607            Some((name, responder))
15608        } else {
15609            None
15610        }
15611    }
15612
15613    #[allow(irrefutable_let_patterns)]
15614    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
15615        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
15616    }
15617
15618    /// Name of the method defined in FIDL
15619    pub fn method_name(&self) -> &'static str {
15620        match *self {
15621            SymlinkRequest::LinkInto { .. } => "link_into",
15622            SymlinkRequest::Clone { .. } => "clone",
15623            SymlinkRequest::Close { .. } => "close",
15624            SymlinkRequest::Query { .. } => "query",
15625            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
15626            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
15627            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
15628            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
15629            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
15630            SymlinkRequest::GetFlags { .. } => "get_flags",
15631            SymlinkRequest::SetFlags { .. } => "set_flags",
15632            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
15633            SymlinkRequest::GetAttributes { .. } => "get_attributes",
15634            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
15635            SymlinkRequest::Sync { .. } => "sync",
15636            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
15637            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
15638            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
15639            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
15640            SymlinkRequest::Describe { .. } => "describe",
15641            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
15642                "unknown one-way method"
15643            }
15644            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
15645                "unknown two-way method"
15646            }
15647        }
15648    }
15649}
15650
15651#[derive(Debug, Clone)]
15652pub struct SymlinkControlHandle {
15653    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15654}
15655
15656impl fdomain_client::fidl::ControlHandle for SymlinkControlHandle {
15657    fn shutdown(&self) {
15658        self.inner.shutdown()
15659    }
15660
15661    fn is_closed(&self) -> bool {
15662        self.inner.channel().is_closed()
15663    }
15664    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
15665        self.inner.channel().on_closed()
15666    }
15667}
15668
15669impl SymlinkControlHandle {
15670    pub fn send_on_open_(
15671        &self,
15672        mut s: i32,
15673        mut info: Option<NodeInfoDeprecated>,
15674    ) -> Result<(), fidl::Error> {
15675        self.inner.send::<NodeOnOpenRequest>(
15676            (s, info.as_mut()),
15677            0,
15678            0x7fc7bbb1dbfd1972,
15679            fidl::encoding::DynamicFlags::FLEXIBLE,
15680        )
15681    }
15682
15683    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
15684        self.inner.send::<Representation>(
15685            &mut payload,
15686            0,
15687            0x5cb40567d80a510c,
15688            fidl::encoding::DynamicFlags::empty(),
15689        )
15690    }
15691}
15692
15693#[must_use = "FIDL methods require a response to be sent"]
15694#[derive(Debug)]
15695pub struct SymlinkLinkIntoResponder {
15696    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15697    tx_id: u32,
15698}
15699
15700/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15701/// if the responder is dropped without sending a response, so that the client
15702/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15703impl std::ops::Drop for SymlinkLinkIntoResponder {
15704    fn drop(&mut self) {
15705        self.control_handle.shutdown();
15706        // Safety: drops once, never accessed again
15707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15708    }
15709}
15710
15711impl fdomain_client::fidl::Responder for SymlinkLinkIntoResponder {
15712    type ControlHandle = SymlinkControlHandle;
15713
15714    fn control_handle(&self) -> &SymlinkControlHandle {
15715        &self.control_handle
15716    }
15717
15718    fn drop_without_shutdown(mut self) {
15719        // Safety: drops once, never accessed again due to mem::forget
15720        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15721        // Prevent Drop from running (which would shut down the channel)
15722        std::mem::forget(self);
15723    }
15724}
15725
15726impl SymlinkLinkIntoResponder {
15727    /// Sends a response to the FIDL transaction.
15728    ///
15729    /// Sets the channel to shutdown if an error occurs.
15730    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15731        let _result = self.send_raw(result);
15732        if _result.is_err() {
15733            self.control_handle.shutdown();
15734        }
15735        self.drop_without_shutdown();
15736        _result
15737    }
15738
15739    /// Similar to "send" but does not shutdown the channel if an error occurs.
15740    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15741        let _result = self.send_raw(result);
15742        self.drop_without_shutdown();
15743        _result
15744    }
15745
15746    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15747        self.control_handle
15748            .inner
15749            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15750                result,
15751                self.tx_id,
15752                0x54f3949246a03e74,
15753                fidl::encoding::DynamicFlags::empty(),
15754            )
15755    }
15756}
15757
15758#[must_use = "FIDL methods require a response to be sent"]
15759#[derive(Debug)]
15760pub struct SymlinkCloseResponder {
15761    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15762    tx_id: u32,
15763}
15764
15765/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15766/// if the responder is dropped without sending a response, so that the client
15767/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15768impl std::ops::Drop for SymlinkCloseResponder {
15769    fn drop(&mut self) {
15770        self.control_handle.shutdown();
15771        // Safety: drops once, never accessed again
15772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15773    }
15774}
15775
15776impl fdomain_client::fidl::Responder for SymlinkCloseResponder {
15777    type ControlHandle = SymlinkControlHandle;
15778
15779    fn control_handle(&self) -> &SymlinkControlHandle {
15780        &self.control_handle
15781    }
15782
15783    fn drop_without_shutdown(mut self) {
15784        // Safety: drops once, never accessed again due to mem::forget
15785        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15786        // Prevent Drop from running (which would shut down the channel)
15787        std::mem::forget(self);
15788    }
15789}
15790
15791impl SymlinkCloseResponder {
15792    /// Sends a response to the FIDL transaction.
15793    ///
15794    /// Sets the channel to shutdown if an error occurs.
15795    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15796        let _result = self.send_raw(result);
15797        if _result.is_err() {
15798            self.control_handle.shutdown();
15799        }
15800        self.drop_without_shutdown();
15801        _result
15802    }
15803
15804    /// Similar to "send" but does not shutdown the channel if an error occurs.
15805    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15806        let _result = self.send_raw(result);
15807        self.drop_without_shutdown();
15808        _result
15809    }
15810
15811    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15812        self.control_handle
15813            .inner
15814            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15815                result,
15816                self.tx_id,
15817                0x5ac5d459ad7f657e,
15818                fidl::encoding::DynamicFlags::empty(),
15819            )
15820    }
15821}
15822
15823#[must_use = "FIDL methods require a response to be sent"]
15824#[derive(Debug)]
15825pub struct SymlinkQueryResponder {
15826    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15827    tx_id: u32,
15828}
15829
15830/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15831/// if the responder is dropped without sending a response, so that the client
15832/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15833impl std::ops::Drop for SymlinkQueryResponder {
15834    fn drop(&mut self) {
15835        self.control_handle.shutdown();
15836        // Safety: drops once, never accessed again
15837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15838    }
15839}
15840
15841impl fdomain_client::fidl::Responder for SymlinkQueryResponder {
15842    type ControlHandle = SymlinkControlHandle;
15843
15844    fn control_handle(&self) -> &SymlinkControlHandle {
15845        &self.control_handle
15846    }
15847
15848    fn drop_without_shutdown(mut self) {
15849        // Safety: drops once, never accessed again due to mem::forget
15850        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15851        // Prevent Drop from running (which would shut down the channel)
15852        std::mem::forget(self);
15853    }
15854}
15855
15856impl SymlinkQueryResponder {
15857    /// Sends a response to the FIDL transaction.
15858    ///
15859    /// Sets the channel to shutdown if an error occurs.
15860    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15861        let _result = self.send_raw(protocol);
15862        if _result.is_err() {
15863            self.control_handle.shutdown();
15864        }
15865        self.drop_without_shutdown();
15866        _result
15867    }
15868
15869    /// Similar to "send" but does not shutdown the channel if an error occurs.
15870    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15871        let _result = self.send_raw(protocol);
15872        self.drop_without_shutdown();
15873        _result
15874    }
15875
15876    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15877        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
15878            (protocol,),
15879            self.tx_id,
15880            0x2658edee9decfc06,
15881            fidl::encoding::DynamicFlags::empty(),
15882        )
15883    }
15884}
15885
15886#[must_use = "FIDL methods require a response to be sent"]
15887#[derive(Debug)]
15888pub struct SymlinkDeprecatedGetAttrResponder {
15889    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15890    tx_id: u32,
15891}
15892
15893/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15894/// if the responder is dropped without sending a response, so that the client
15895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15896impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
15897    fn drop(&mut self) {
15898        self.control_handle.shutdown();
15899        // Safety: drops once, never accessed again
15900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15901    }
15902}
15903
15904impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetAttrResponder {
15905    type ControlHandle = SymlinkControlHandle;
15906
15907    fn control_handle(&self) -> &SymlinkControlHandle {
15908        &self.control_handle
15909    }
15910
15911    fn drop_without_shutdown(mut self) {
15912        // Safety: drops once, never accessed again due to mem::forget
15913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15914        // Prevent Drop from running (which would shut down the channel)
15915        std::mem::forget(self);
15916    }
15917}
15918
15919impl SymlinkDeprecatedGetAttrResponder {
15920    /// Sends a response to the FIDL transaction.
15921    ///
15922    /// Sets the channel to shutdown if an error occurs.
15923    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15924        let _result = self.send_raw(s, attributes);
15925        if _result.is_err() {
15926            self.control_handle.shutdown();
15927        }
15928        self.drop_without_shutdown();
15929        _result
15930    }
15931
15932    /// Similar to "send" but does not shutdown the channel if an error occurs.
15933    pub fn send_no_shutdown_on_err(
15934        self,
15935        mut s: i32,
15936        mut attributes: &NodeAttributes,
15937    ) -> Result<(), fidl::Error> {
15938        let _result = self.send_raw(s, attributes);
15939        self.drop_without_shutdown();
15940        _result
15941    }
15942
15943    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15944        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15945            (s, attributes),
15946            self.tx_id,
15947            0x78985e216314dafd,
15948            fidl::encoding::DynamicFlags::empty(),
15949        )
15950    }
15951}
15952
15953#[must_use = "FIDL methods require a response to be sent"]
15954#[derive(Debug)]
15955pub struct SymlinkDeprecatedSetAttrResponder {
15956    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15957    tx_id: u32,
15958}
15959
15960/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15961/// if the responder is dropped without sending a response, so that the client
15962/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15963impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
15964    fn drop(&mut self) {
15965        self.control_handle.shutdown();
15966        // Safety: drops once, never accessed again
15967        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15968    }
15969}
15970
15971impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetAttrResponder {
15972    type ControlHandle = SymlinkControlHandle;
15973
15974    fn control_handle(&self) -> &SymlinkControlHandle {
15975        &self.control_handle
15976    }
15977
15978    fn drop_without_shutdown(mut self) {
15979        // Safety: drops once, never accessed again due to mem::forget
15980        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15981        // Prevent Drop from running (which would shut down the channel)
15982        std::mem::forget(self);
15983    }
15984}
15985
15986impl SymlinkDeprecatedSetAttrResponder {
15987    /// Sends a response to the FIDL transaction.
15988    ///
15989    /// Sets the channel to shutdown if an error occurs.
15990    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15991        let _result = self.send_raw(s);
15992        if _result.is_err() {
15993            self.control_handle.shutdown();
15994        }
15995        self.drop_without_shutdown();
15996        _result
15997    }
15998
15999    /// Similar to "send" but does not shutdown the channel if an error occurs.
16000    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16001        let _result = self.send_raw(s);
16002        self.drop_without_shutdown();
16003        _result
16004    }
16005
16006    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16007        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
16008            (s,),
16009            self.tx_id,
16010            0x4186c0f40d938f46,
16011            fidl::encoding::DynamicFlags::empty(),
16012        )
16013    }
16014}
16015
16016#[must_use = "FIDL methods require a response to be sent"]
16017#[derive(Debug)]
16018pub struct SymlinkDeprecatedGetFlagsResponder {
16019    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16020    tx_id: u32,
16021}
16022
16023/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16024/// if the responder is dropped without sending a response, so that the client
16025/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16026impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
16027    fn drop(&mut self) {
16028        self.control_handle.shutdown();
16029        // Safety: drops once, never accessed again
16030        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16031    }
16032}
16033
16034impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetFlagsResponder {
16035    type ControlHandle = SymlinkControlHandle;
16036
16037    fn control_handle(&self) -> &SymlinkControlHandle {
16038        &self.control_handle
16039    }
16040
16041    fn drop_without_shutdown(mut self) {
16042        // Safety: drops once, never accessed again due to mem::forget
16043        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16044        // Prevent Drop from running (which would shut down the channel)
16045        std::mem::forget(self);
16046    }
16047}
16048
16049impl SymlinkDeprecatedGetFlagsResponder {
16050    /// Sends a response to the FIDL transaction.
16051    ///
16052    /// Sets the channel to shutdown if an error occurs.
16053    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16054        let _result = self.send_raw(s, flags);
16055        if _result.is_err() {
16056            self.control_handle.shutdown();
16057        }
16058        self.drop_without_shutdown();
16059        _result
16060    }
16061
16062    /// Similar to "send" but does not shutdown the channel if an error occurs.
16063    pub fn send_no_shutdown_on_err(
16064        self,
16065        mut s: i32,
16066        mut flags: OpenFlags,
16067    ) -> Result<(), fidl::Error> {
16068        let _result = self.send_raw(s, flags);
16069        self.drop_without_shutdown();
16070        _result
16071    }
16072
16073    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16074        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
16075            (s, flags),
16076            self.tx_id,
16077            0x5b88fffb8eda3aa1,
16078            fidl::encoding::DynamicFlags::empty(),
16079        )
16080    }
16081}
16082
16083#[must_use = "FIDL methods require a response to be sent"]
16084#[derive(Debug)]
16085pub struct SymlinkDeprecatedSetFlagsResponder {
16086    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16087    tx_id: u32,
16088}
16089
16090/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16091/// if the responder is dropped without sending a response, so that the client
16092/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16093impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
16094    fn drop(&mut self) {
16095        self.control_handle.shutdown();
16096        // Safety: drops once, never accessed again
16097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16098    }
16099}
16100
16101impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetFlagsResponder {
16102    type ControlHandle = SymlinkControlHandle;
16103
16104    fn control_handle(&self) -> &SymlinkControlHandle {
16105        &self.control_handle
16106    }
16107
16108    fn drop_without_shutdown(mut self) {
16109        // Safety: drops once, never accessed again due to mem::forget
16110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16111        // Prevent Drop from running (which would shut down the channel)
16112        std::mem::forget(self);
16113    }
16114}
16115
16116impl SymlinkDeprecatedSetFlagsResponder {
16117    /// Sends a response to the FIDL transaction.
16118    ///
16119    /// Sets the channel to shutdown if an error occurs.
16120    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16121        let _result = self.send_raw(s);
16122        if _result.is_err() {
16123            self.control_handle.shutdown();
16124        }
16125        self.drop_without_shutdown();
16126        _result
16127    }
16128
16129    /// Similar to "send" but does not shutdown the channel if an error occurs.
16130    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16131        let _result = self.send_raw(s);
16132        self.drop_without_shutdown();
16133        _result
16134    }
16135
16136    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16137        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
16138            (s,),
16139            self.tx_id,
16140            0x5295b76c71fde733,
16141            fidl::encoding::DynamicFlags::empty(),
16142        )
16143    }
16144}
16145
16146#[must_use = "FIDL methods require a response to be sent"]
16147#[derive(Debug)]
16148pub struct SymlinkGetFlagsResponder {
16149    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16150    tx_id: u32,
16151}
16152
16153/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16154/// if the responder is dropped without sending a response, so that the client
16155/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16156impl std::ops::Drop for SymlinkGetFlagsResponder {
16157    fn drop(&mut self) {
16158        self.control_handle.shutdown();
16159        // Safety: drops once, never accessed again
16160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16161    }
16162}
16163
16164impl fdomain_client::fidl::Responder for SymlinkGetFlagsResponder {
16165    type ControlHandle = SymlinkControlHandle;
16166
16167    fn control_handle(&self) -> &SymlinkControlHandle {
16168        &self.control_handle
16169    }
16170
16171    fn drop_without_shutdown(mut self) {
16172        // Safety: drops once, never accessed again due to mem::forget
16173        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16174        // Prevent Drop from running (which would shut down the channel)
16175        std::mem::forget(self);
16176    }
16177}
16178
16179impl SymlinkGetFlagsResponder {
16180    /// Sends a response to the FIDL transaction.
16181    ///
16182    /// Sets the channel to shutdown if an error occurs.
16183    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16184        let _result = self.send_raw(result);
16185        if _result.is_err() {
16186            self.control_handle.shutdown();
16187        }
16188        self.drop_without_shutdown();
16189        _result
16190    }
16191
16192    /// Similar to "send" but does not shutdown the channel if an error occurs.
16193    pub fn send_no_shutdown_on_err(
16194        self,
16195        mut result: Result<Flags, i32>,
16196    ) -> Result<(), fidl::Error> {
16197        let _result = self.send_raw(result);
16198        self.drop_without_shutdown();
16199        _result
16200    }
16201
16202    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16203        self.control_handle
16204            .inner
16205            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
16206                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
16207                self.tx_id,
16208                0x176eb318f64ec23,
16209                fidl::encoding::DynamicFlags::FLEXIBLE,
16210            )
16211    }
16212}
16213
16214#[must_use = "FIDL methods require a response to be sent"]
16215#[derive(Debug)]
16216pub struct SymlinkSetFlagsResponder {
16217    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16218    tx_id: u32,
16219}
16220
16221/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16222/// if the responder is dropped without sending a response, so that the client
16223/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16224impl std::ops::Drop for SymlinkSetFlagsResponder {
16225    fn drop(&mut self) {
16226        self.control_handle.shutdown();
16227        // Safety: drops once, never accessed again
16228        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16229    }
16230}
16231
16232impl fdomain_client::fidl::Responder for SymlinkSetFlagsResponder {
16233    type ControlHandle = SymlinkControlHandle;
16234
16235    fn control_handle(&self) -> &SymlinkControlHandle {
16236        &self.control_handle
16237    }
16238
16239    fn drop_without_shutdown(mut self) {
16240        // Safety: drops once, never accessed again due to mem::forget
16241        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16242        // Prevent Drop from running (which would shut down the channel)
16243        std::mem::forget(self);
16244    }
16245}
16246
16247impl SymlinkSetFlagsResponder {
16248    /// Sends a response to the FIDL transaction.
16249    ///
16250    /// Sets the channel to shutdown if an error occurs.
16251    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16252        let _result = self.send_raw(result);
16253        if _result.is_err() {
16254            self.control_handle.shutdown();
16255        }
16256        self.drop_without_shutdown();
16257        _result
16258    }
16259
16260    /// Similar to "send" but does not shutdown the channel if an error occurs.
16261    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16262        let _result = self.send_raw(result);
16263        self.drop_without_shutdown();
16264        _result
16265    }
16266
16267    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16268        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
16269            fidl::encoding::EmptyStruct,
16270            i32,
16271        >>(
16272            fidl::encoding::FlexibleResult::new(result),
16273            self.tx_id,
16274            0x55a8028685791ea8,
16275            fidl::encoding::DynamicFlags::FLEXIBLE,
16276        )
16277    }
16278}
16279
16280#[must_use = "FIDL methods require a response to be sent"]
16281#[derive(Debug)]
16282pub struct SymlinkQueryFilesystemResponder {
16283    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16284    tx_id: u32,
16285}
16286
16287/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16288/// if the responder is dropped without sending a response, so that the client
16289/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16290impl std::ops::Drop for SymlinkQueryFilesystemResponder {
16291    fn drop(&mut self) {
16292        self.control_handle.shutdown();
16293        // Safety: drops once, never accessed again
16294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16295    }
16296}
16297
16298impl fdomain_client::fidl::Responder for SymlinkQueryFilesystemResponder {
16299    type ControlHandle = SymlinkControlHandle;
16300
16301    fn control_handle(&self) -> &SymlinkControlHandle {
16302        &self.control_handle
16303    }
16304
16305    fn drop_without_shutdown(mut self) {
16306        // Safety: drops once, never accessed again due to mem::forget
16307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16308        // Prevent Drop from running (which would shut down the channel)
16309        std::mem::forget(self);
16310    }
16311}
16312
16313impl SymlinkQueryFilesystemResponder {
16314    /// Sends a response to the FIDL transaction.
16315    ///
16316    /// Sets the channel to shutdown if an error occurs.
16317    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16318        let _result = self.send_raw(s, info);
16319        if _result.is_err() {
16320            self.control_handle.shutdown();
16321        }
16322        self.drop_without_shutdown();
16323        _result
16324    }
16325
16326    /// Similar to "send" but does not shutdown the channel if an error occurs.
16327    pub fn send_no_shutdown_on_err(
16328        self,
16329        mut s: i32,
16330        mut info: Option<&FilesystemInfo>,
16331    ) -> Result<(), fidl::Error> {
16332        let _result = self.send_raw(s, info);
16333        self.drop_without_shutdown();
16334        _result
16335    }
16336
16337    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16338        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
16339            (s, info),
16340            self.tx_id,
16341            0x6f344a1c6b0a0610,
16342            fidl::encoding::DynamicFlags::empty(),
16343        )
16344    }
16345}
16346
16347#[must_use = "FIDL methods require a response to be sent"]
16348#[derive(Debug)]
16349pub struct SymlinkGetAttributesResponder {
16350    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16351    tx_id: u32,
16352}
16353
16354/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16355/// if the responder is dropped without sending a response, so that the client
16356/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16357impl std::ops::Drop for SymlinkGetAttributesResponder {
16358    fn drop(&mut self) {
16359        self.control_handle.shutdown();
16360        // Safety: drops once, never accessed again
16361        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16362    }
16363}
16364
16365impl fdomain_client::fidl::Responder for SymlinkGetAttributesResponder {
16366    type ControlHandle = SymlinkControlHandle;
16367
16368    fn control_handle(&self) -> &SymlinkControlHandle {
16369        &self.control_handle
16370    }
16371
16372    fn drop_without_shutdown(mut self) {
16373        // Safety: drops once, never accessed again due to mem::forget
16374        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16375        // Prevent Drop from running (which would shut down the channel)
16376        std::mem::forget(self);
16377    }
16378}
16379
16380impl SymlinkGetAttributesResponder {
16381    /// Sends a response to the FIDL transaction.
16382    ///
16383    /// Sets the channel to shutdown if an error occurs.
16384    pub fn send(
16385        self,
16386        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16387    ) -> Result<(), fidl::Error> {
16388        let _result = self.send_raw(result);
16389        if _result.is_err() {
16390            self.control_handle.shutdown();
16391        }
16392        self.drop_without_shutdown();
16393        _result
16394    }
16395
16396    /// Similar to "send" but does not shutdown the channel if an error occurs.
16397    pub fn send_no_shutdown_on_err(
16398        self,
16399        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16400    ) -> Result<(), fidl::Error> {
16401        let _result = self.send_raw(result);
16402        self.drop_without_shutdown();
16403        _result
16404    }
16405
16406    fn send_raw(
16407        &self,
16408        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16409    ) -> Result<(), fidl::Error> {
16410        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16411            result,
16412            self.tx_id,
16413            0x3d4396a638ea053b,
16414            fidl::encoding::DynamicFlags::empty(),
16415        )
16416    }
16417}
16418
16419#[must_use = "FIDL methods require a response to be sent"]
16420#[derive(Debug)]
16421pub struct SymlinkUpdateAttributesResponder {
16422    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16423    tx_id: u32,
16424}
16425
16426/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16427/// if the responder is dropped without sending a response, so that the client
16428/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16429impl std::ops::Drop for SymlinkUpdateAttributesResponder {
16430    fn drop(&mut self) {
16431        self.control_handle.shutdown();
16432        // Safety: drops once, never accessed again
16433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16434    }
16435}
16436
16437impl fdomain_client::fidl::Responder for SymlinkUpdateAttributesResponder {
16438    type ControlHandle = SymlinkControlHandle;
16439
16440    fn control_handle(&self) -> &SymlinkControlHandle {
16441        &self.control_handle
16442    }
16443
16444    fn drop_without_shutdown(mut self) {
16445        // Safety: drops once, never accessed again due to mem::forget
16446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16447        // Prevent Drop from running (which would shut down the channel)
16448        std::mem::forget(self);
16449    }
16450}
16451
16452impl SymlinkUpdateAttributesResponder {
16453    /// Sends a response to the FIDL transaction.
16454    ///
16455    /// Sets the channel to shutdown if an error occurs.
16456    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16457        let _result = self.send_raw(result);
16458        if _result.is_err() {
16459            self.control_handle.shutdown();
16460        }
16461        self.drop_without_shutdown();
16462        _result
16463    }
16464
16465    /// Similar to "send" but does not shutdown the channel if an error occurs.
16466    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16467        let _result = self.send_raw(result);
16468        self.drop_without_shutdown();
16469        _result
16470    }
16471
16472    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16473        self.control_handle
16474            .inner
16475            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16476                result,
16477                self.tx_id,
16478                0x3308c1da5a89bf08,
16479                fidl::encoding::DynamicFlags::empty(),
16480            )
16481    }
16482}
16483
16484#[must_use = "FIDL methods require a response to be sent"]
16485#[derive(Debug)]
16486pub struct SymlinkSyncResponder {
16487    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16488    tx_id: u32,
16489}
16490
16491/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16492/// if the responder is dropped without sending a response, so that the client
16493/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16494impl std::ops::Drop for SymlinkSyncResponder {
16495    fn drop(&mut self) {
16496        self.control_handle.shutdown();
16497        // Safety: drops once, never accessed again
16498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16499    }
16500}
16501
16502impl fdomain_client::fidl::Responder for SymlinkSyncResponder {
16503    type ControlHandle = SymlinkControlHandle;
16504
16505    fn control_handle(&self) -> &SymlinkControlHandle {
16506        &self.control_handle
16507    }
16508
16509    fn drop_without_shutdown(mut self) {
16510        // Safety: drops once, never accessed again due to mem::forget
16511        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16512        // Prevent Drop from running (which would shut down the channel)
16513        std::mem::forget(self);
16514    }
16515}
16516
16517impl SymlinkSyncResponder {
16518    /// Sends a response to the FIDL transaction.
16519    ///
16520    /// Sets the channel to shutdown if an error occurs.
16521    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16522        let _result = self.send_raw(result);
16523        if _result.is_err() {
16524            self.control_handle.shutdown();
16525        }
16526        self.drop_without_shutdown();
16527        _result
16528    }
16529
16530    /// Similar to "send" but does not shutdown the channel if an error occurs.
16531    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16532        let _result = self.send_raw(result);
16533        self.drop_without_shutdown();
16534        _result
16535    }
16536
16537    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16538        self.control_handle
16539            .inner
16540            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16541                result,
16542                self.tx_id,
16543                0x2c5c27ca0ab5dc49,
16544                fidl::encoding::DynamicFlags::empty(),
16545            )
16546    }
16547}
16548
16549#[must_use = "FIDL methods require a response to be sent"]
16550#[derive(Debug)]
16551pub struct SymlinkGetExtendedAttributeResponder {
16552    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16553    tx_id: u32,
16554}
16555
16556/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16557/// if the responder is dropped without sending a response, so that the client
16558/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16559impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
16560    fn drop(&mut self) {
16561        self.control_handle.shutdown();
16562        // Safety: drops once, never accessed again
16563        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16564    }
16565}
16566
16567impl fdomain_client::fidl::Responder for SymlinkGetExtendedAttributeResponder {
16568    type ControlHandle = SymlinkControlHandle;
16569
16570    fn control_handle(&self) -> &SymlinkControlHandle {
16571        &self.control_handle
16572    }
16573
16574    fn drop_without_shutdown(mut self) {
16575        // Safety: drops once, never accessed again due to mem::forget
16576        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16577        // Prevent Drop from running (which would shut down the channel)
16578        std::mem::forget(self);
16579    }
16580}
16581
16582impl SymlinkGetExtendedAttributeResponder {
16583    /// Sends a response to the FIDL transaction.
16584    ///
16585    /// Sets the channel to shutdown if an error occurs.
16586    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16587        let _result = self.send_raw(result);
16588        if _result.is_err() {
16589            self.control_handle.shutdown();
16590        }
16591        self.drop_without_shutdown();
16592        _result
16593    }
16594
16595    /// Similar to "send" but does not shutdown the channel if an error occurs.
16596    pub fn send_no_shutdown_on_err(
16597        self,
16598        mut result: Result<ExtendedAttributeValue, i32>,
16599    ) -> Result<(), fidl::Error> {
16600        let _result = self.send_raw(result);
16601        self.drop_without_shutdown();
16602        _result
16603    }
16604
16605    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16606        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
16607            result.as_mut().map_err(|e| *e),
16608            self.tx_id,
16609            0x45ffa3ccfdeb76db,
16610            fidl::encoding::DynamicFlags::empty(),
16611        )
16612    }
16613}
16614
16615#[must_use = "FIDL methods require a response to be sent"]
16616#[derive(Debug)]
16617pub struct SymlinkSetExtendedAttributeResponder {
16618    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16619    tx_id: u32,
16620}
16621
16622/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16623/// if the responder is dropped without sending a response, so that the client
16624/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16625impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
16626    fn drop(&mut self) {
16627        self.control_handle.shutdown();
16628        // Safety: drops once, never accessed again
16629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16630    }
16631}
16632
16633impl fdomain_client::fidl::Responder for SymlinkSetExtendedAttributeResponder {
16634    type ControlHandle = SymlinkControlHandle;
16635
16636    fn control_handle(&self) -> &SymlinkControlHandle {
16637        &self.control_handle
16638    }
16639
16640    fn drop_without_shutdown(mut self) {
16641        // Safety: drops once, never accessed again due to mem::forget
16642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16643        // Prevent Drop from running (which would shut down the channel)
16644        std::mem::forget(self);
16645    }
16646}
16647
16648impl SymlinkSetExtendedAttributeResponder {
16649    /// Sends a response to the FIDL transaction.
16650    ///
16651    /// Sets the channel to shutdown if an error occurs.
16652    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16653        let _result = self.send_raw(result);
16654        if _result.is_err() {
16655            self.control_handle.shutdown();
16656        }
16657        self.drop_without_shutdown();
16658        _result
16659    }
16660
16661    /// Similar to "send" but does not shutdown the channel if an error occurs.
16662    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16663        let _result = self.send_raw(result);
16664        self.drop_without_shutdown();
16665        _result
16666    }
16667
16668    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16669        self.control_handle
16670            .inner
16671            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16672                result,
16673                self.tx_id,
16674                0x4a951362f681f23c,
16675                fidl::encoding::DynamicFlags::empty(),
16676            )
16677    }
16678}
16679
16680#[must_use = "FIDL methods require a response to be sent"]
16681#[derive(Debug)]
16682pub struct SymlinkRemoveExtendedAttributeResponder {
16683    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16684    tx_id: u32,
16685}
16686
16687/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16688/// if the responder is dropped without sending a response, so that the client
16689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16690impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
16691    fn drop(&mut self) {
16692        self.control_handle.shutdown();
16693        // Safety: drops once, never accessed again
16694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16695    }
16696}
16697
16698impl fdomain_client::fidl::Responder for SymlinkRemoveExtendedAttributeResponder {
16699    type ControlHandle = SymlinkControlHandle;
16700
16701    fn control_handle(&self) -> &SymlinkControlHandle {
16702        &self.control_handle
16703    }
16704
16705    fn drop_without_shutdown(mut self) {
16706        // Safety: drops once, never accessed again due to mem::forget
16707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16708        // Prevent Drop from running (which would shut down the channel)
16709        std::mem::forget(self);
16710    }
16711}
16712
16713impl SymlinkRemoveExtendedAttributeResponder {
16714    /// Sends a response to the FIDL transaction.
16715    ///
16716    /// Sets the channel to shutdown if an error occurs.
16717    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16718        let _result = self.send_raw(result);
16719        if _result.is_err() {
16720            self.control_handle.shutdown();
16721        }
16722        self.drop_without_shutdown();
16723        _result
16724    }
16725
16726    /// Similar to "send" but does not shutdown the channel if an error occurs.
16727    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16728        let _result = self.send_raw(result);
16729        self.drop_without_shutdown();
16730        _result
16731    }
16732
16733    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16734        self.control_handle
16735            .inner
16736            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16737                result,
16738                self.tx_id,
16739                0x7a0b9f3a9bf9032d,
16740                fidl::encoding::DynamicFlags::empty(),
16741            )
16742    }
16743}
16744
16745#[must_use = "FIDL methods require a response to be sent"]
16746#[derive(Debug)]
16747pub struct SymlinkDescribeResponder {
16748    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16749    tx_id: u32,
16750}
16751
16752/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16753/// if the responder is dropped without sending a response, so that the client
16754/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16755impl std::ops::Drop for SymlinkDescribeResponder {
16756    fn drop(&mut self) {
16757        self.control_handle.shutdown();
16758        // Safety: drops once, never accessed again
16759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16760    }
16761}
16762
16763impl fdomain_client::fidl::Responder for SymlinkDescribeResponder {
16764    type ControlHandle = SymlinkControlHandle;
16765
16766    fn control_handle(&self) -> &SymlinkControlHandle {
16767        &self.control_handle
16768    }
16769
16770    fn drop_without_shutdown(mut self) {
16771        // Safety: drops once, never accessed again due to mem::forget
16772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16773        // Prevent Drop from running (which would shut down the channel)
16774        std::mem::forget(self);
16775    }
16776}
16777
16778impl SymlinkDescribeResponder {
16779    /// Sends a response to the FIDL transaction.
16780    ///
16781    /// Sets the channel to shutdown if an error occurs.
16782    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16783        let _result = self.send_raw(payload);
16784        if _result.is_err() {
16785            self.control_handle.shutdown();
16786        }
16787        self.drop_without_shutdown();
16788        _result
16789    }
16790
16791    /// Similar to "send" but does not shutdown the channel if an error occurs.
16792    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16793        let _result = self.send_raw(payload);
16794        self.drop_without_shutdown();
16795        _result
16796    }
16797
16798    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16799        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
16800            fidl::encoding::Flexible::new(payload),
16801            self.tx_id,
16802            0x742c2ea5e89831f3,
16803            fidl::encoding::DynamicFlags::FLEXIBLE,
16804        )
16805    }
16806}
16807
16808#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16809pub struct WritableMarker;
16810
16811impl fdomain_client::fidl::ProtocolMarker for WritableMarker {
16812    type Proxy = WritableProxy;
16813    type RequestStream = WritableRequestStream;
16814
16815    const DEBUG_NAME: &'static str = "(anonymous) Writable";
16816}
16817pub type WritableWriteResult = Result<u64, i32>;
16818
16819pub trait WritableProxyInterface: Send + Sync {
16820    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
16821        + Send;
16822    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
16823}
16824
16825#[derive(Debug, Clone)]
16826pub struct WritableProxy {
16827    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
16828}
16829
16830impl fdomain_client::fidl::Proxy for WritableProxy {
16831    type Protocol = WritableMarker;
16832
16833    fn from_channel(inner: fdomain_client::Channel) -> Self {
16834        Self::new(inner)
16835    }
16836
16837    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
16838        self.client.into_channel().map_err(|client| Self { client })
16839    }
16840
16841    fn as_channel(&self) -> &fdomain_client::Channel {
16842        self.client.as_channel()
16843    }
16844}
16845
16846impl WritableProxy {
16847    /// Create a new Proxy for fuchsia.io/Writable.
16848    pub fn new(channel: fdomain_client::Channel) -> Self {
16849        let protocol_name = <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
16850        Self { client: fidl::client::Client::new(channel, protocol_name) }
16851    }
16852
16853    /// Get a Stream of events from the remote end of the protocol.
16854    ///
16855    /// # Panics
16856    ///
16857    /// Panics if the event stream was already taken.
16858    pub fn take_event_stream(&self) -> WritableEventStream {
16859        WritableEventStream { event_receiver: self.client.take_event_receiver() }
16860    }
16861
16862    /// Writes data at the seek offset.
16863    /// The seek offset is moved forward by the number of bytes written.
16864    /// If the file is in append mode, the seek offset is first set to the end
16865    /// of the file, followed by the write, in one atomic step.
16866    ///
16867    /// The file size may grow if the seek offset plus `data.length` is beyond
16868    /// the current end of file.
16869    ///
16870    /// + request `data` the byte buffer to write to the file.
16871    /// - response `actual_count` the number of bytes written.
16872    ///
16873    /// ## Invariants
16874    ///
16875    /// * The returned `actual_count` will never be greater than `data.length`.
16876    /// * If the server is unable to write all the data due to e.g. not enough
16877    ///   space, `actual_count` may be less than `data.length`.  If no bytes
16878    ///   could be written, an error is returned.
16879    /// * If `data.length` is zero, the server should perform all the checks
16880    ///   ensuring write access without mutating the file and return a
16881    ///   successful write of zero bytes.  The seek offset is still updated if
16882    ///   in append mode.
16883    ///
16884    /// This method requires the [`Rights.WRITE_BYTES`] right.
16885    pub fn r#write(
16886        &self,
16887        mut data: &[u8],
16888    ) -> fidl::client::QueryResponseFut<
16889        WritableWriteResult,
16890        fdomain_client::fidl::FDomainResourceDialect,
16891    > {
16892        WritableProxyInterface::r#write(self, data)
16893    }
16894}
16895
16896impl WritableProxyInterface for WritableProxy {
16897    type WriteResponseFut = fidl::client::QueryResponseFut<
16898        WritableWriteResult,
16899        fdomain_client::fidl::FDomainResourceDialect,
16900    >;
16901    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
16902        fn _decode(
16903            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16904        ) -> Result<WritableWriteResult, fidl::Error> {
16905            let _response = fidl::client::decode_transaction_body::<
16906                fidl::encoding::ResultType<WritableWriteResponse, i32>,
16907                fdomain_client::fidl::FDomainResourceDialect,
16908                0x6a31437832469f82,
16909            >(_buf?)?;
16910            Ok(_response.map(|x| x.actual_count))
16911        }
16912        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
16913            (data,),
16914            0x6a31437832469f82,
16915            fidl::encoding::DynamicFlags::empty(),
16916            _decode,
16917        )
16918    }
16919}
16920
16921pub struct WritableEventStream {
16922    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
16923}
16924
16925impl std::marker::Unpin for WritableEventStream {}
16926
16927impl futures::stream::FusedStream for WritableEventStream {
16928    fn is_terminated(&self) -> bool {
16929        self.event_receiver.is_terminated()
16930    }
16931}
16932
16933impl futures::Stream for WritableEventStream {
16934    type Item = Result<WritableEvent, fidl::Error>;
16935
16936    fn poll_next(
16937        mut self: std::pin::Pin<&mut Self>,
16938        cx: &mut std::task::Context<'_>,
16939    ) -> std::task::Poll<Option<Self::Item>> {
16940        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16941            &mut self.event_receiver,
16942            cx
16943        )?) {
16944            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
16945            None => std::task::Poll::Ready(None),
16946        }
16947    }
16948}
16949
16950#[derive(Debug)]
16951pub enum WritableEvent {}
16952
16953impl WritableEvent {
16954    /// Decodes a message buffer as a [`WritableEvent`].
16955    fn decode(
16956        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16957    ) -> Result<WritableEvent, fidl::Error> {
16958        let (bytes, _handles) = buf.split_mut();
16959        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16960        debug_assert_eq!(tx_header.tx_id, 0);
16961        match tx_header.ordinal {
16962            _ => Err(fidl::Error::UnknownOrdinal {
16963                ordinal: tx_header.ordinal,
16964                protocol_name: <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
16965            }),
16966        }
16967    }
16968}
16969
16970/// A Stream of incoming requests for fuchsia.io/Writable.
16971pub struct WritableRequestStream {
16972    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
16973    is_terminated: bool,
16974}
16975
16976impl std::marker::Unpin for WritableRequestStream {}
16977
16978impl futures::stream::FusedStream for WritableRequestStream {
16979    fn is_terminated(&self) -> bool {
16980        self.is_terminated
16981    }
16982}
16983
16984impl fdomain_client::fidl::RequestStream for WritableRequestStream {
16985    type Protocol = WritableMarker;
16986    type ControlHandle = WritableControlHandle;
16987
16988    fn from_channel(channel: fdomain_client::Channel) -> Self {
16989        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16990    }
16991
16992    fn control_handle(&self) -> Self::ControlHandle {
16993        WritableControlHandle { inner: self.inner.clone() }
16994    }
16995
16996    fn into_inner(
16997        self,
16998    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
16999    {
17000        (self.inner, self.is_terminated)
17001    }
17002
17003    fn from_inner(
17004        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17005        is_terminated: bool,
17006    ) -> Self {
17007        Self { inner, is_terminated }
17008    }
17009}
17010
17011impl futures::Stream for WritableRequestStream {
17012    type Item = Result<WritableRequest, fidl::Error>;
17013
17014    fn poll_next(
17015        mut self: std::pin::Pin<&mut Self>,
17016        cx: &mut std::task::Context<'_>,
17017    ) -> std::task::Poll<Option<Self::Item>> {
17018        let this = &mut *self;
17019        if this.inner.check_shutdown(cx) {
17020            this.is_terminated = true;
17021            return std::task::Poll::Ready(None);
17022        }
17023        if this.is_terminated {
17024            panic!("polled WritableRequestStream after completion");
17025        }
17026        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
17027            |bytes, handles| {
17028                match this.inner.channel().read_etc(cx, bytes, handles) {
17029                    std::task::Poll::Ready(Ok(())) => {}
17030                    std::task::Poll::Pending => return std::task::Poll::Pending,
17031                    std::task::Poll::Ready(Err(None)) => {
17032                        this.is_terminated = true;
17033                        return std::task::Poll::Ready(None);
17034                    }
17035                    std::task::Poll::Ready(Err(Some(e))) => {
17036                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17037                            e.into(),
17038                        ))));
17039                    }
17040                }
17041
17042                // A message has been received from the channel
17043                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17044
17045                std::task::Poll::Ready(Some(match header.ordinal {
17046                    0x6a31437832469f82 => {
17047                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17048                        let mut req = fidl::new_empty!(
17049                            WritableWriteRequest,
17050                            fdomain_client::fidl::FDomainResourceDialect
17051                        );
17052                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
17053                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
17054                        Ok(WritableRequest::Write {
17055                            data: req.data,
17056
17057                            responder: WritableWriteResponder {
17058                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17059                                tx_id: header.tx_id,
17060                            },
17061                        })
17062                    }
17063                    _ => Err(fidl::Error::UnknownOrdinal {
17064                        ordinal: header.ordinal,
17065                        protocol_name:
17066                            <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17067                    }),
17068                }))
17069            },
17070        )
17071    }
17072}
17073
17074#[derive(Debug)]
17075pub enum WritableRequest {
17076    /// Writes data at the seek offset.
17077    /// The seek offset is moved forward by the number of bytes written.
17078    /// If the file is in append mode, the seek offset is first set to the end
17079    /// of the file, followed by the write, in one atomic step.
17080    ///
17081    /// The file size may grow if the seek offset plus `data.length` is beyond
17082    /// the current end of file.
17083    ///
17084    /// + request `data` the byte buffer to write to the file.
17085    /// - response `actual_count` the number of bytes written.
17086    ///
17087    /// ## Invariants
17088    ///
17089    /// * The returned `actual_count` will never be greater than `data.length`.
17090    /// * If the server is unable to write all the data due to e.g. not enough
17091    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17092    ///   could be written, an error is returned.
17093    /// * If `data.length` is zero, the server should perform all the checks
17094    ///   ensuring write access without mutating the file and return a
17095    ///   successful write of zero bytes.  The seek offset is still updated if
17096    ///   in append mode.
17097    ///
17098    /// This method requires the [`Rights.WRITE_BYTES`] right.
17099    Write { data: Vec<u8>, responder: WritableWriteResponder },
17100}
17101
17102impl WritableRequest {
17103    #[allow(irrefutable_let_patterns)]
17104    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
17105        if let WritableRequest::Write { data, responder } = self {
17106            Some((data, responder))
17107        } else {
17108            None
17109        }
17110    }
17111
17112    /// Name of the method defined in FIDL
17113    pub fn method_name(&self) -> &'static str {
17114        match *self {
17115            WritableRequest::Write { .. } => "write",
17116        }
17117    }
17118}
17119
17120#[derive(Debug, Clone)]
17121pub struct WritableControlHandle {
17122    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17123}
17124
17125impl fdomain_client::fidl::ControlHandle for WritableControlHandle {
17126    fn shutdown(&self) {
17127        self.inner.shutdown()
17128    }
17129
17130    fn is_closed(&self) -> bool {
17131        self.inner.channel().is_closed()
17132    }
17133    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
17134        self.inner.channel().on_closed()
17135    }
17136}
17137
17138impl WritableControlHandle {}
17139
17140#[must_use = "FIDL methods require a response to be sent"]
17141#[derive(Debug)]
17142pub struct WritableWriteResponder {
17143    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
17144    tx_id: u32,
17145}
17146
17147/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
17148/// if the responder is dropped without sending a response, so that the client
17149/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17150impl std::ops::Drop for WritableWriteResponder {
17151    fn drop(&mut self) {
17152        self.control_handle.shutdown();
17153        // Safety: drops once, never accessed again
17154        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17155    }
17156}
17157
17158impl fdomain_client::fidl::Responder for WritableWriteResponder {
17159    type ControlHandle = WritableControlHandle;
17160
17161    fn control_handle(&self) -> &WritableControlHandle {
17162        &self.control_handle
17163    }
17164
17165    fn drop_without_shutdown(mut self) {
17166        // Safety: drops once, never accessed again due to mem::forget
17167        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17168        // Prevent Drop from running (which would shut down the channel)
17169        std::mem::forget(self);
17170    }
17171}
17172
17173impl WritableWriteResponder {
17174    /// Sends a response to the FIDL transaction.
17175    ///
17176    /// Sets the channel to shutdown if an error occurs.
17177    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17178        let _result = self.send_raw(result);
17179        if _result.is_err() {
17180            self.control_handle.shutdown();
17181        }
17182        self.drop_without_shutdown();
17183        _result
17184    }
17185
17186    /// Similar to "send" but does not shutdown the channel if an error occurs.
17187    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17188        let _result = self.send_raw(result);
17189        self.drop_without_shutdown();
17190        _result
17191    }
17192
17193    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17194        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
17195            result.map(|actual_count| (actual_count,)),
17196            self.tx_id,
17197            0x6a31437832469f82,
17198            fidl::encoding::DynamicFlags::empty(),
17199        )
17200    }
17201}
17202
17203mod internal {
17204    use super::*;
17205
17206    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
17207        type Borrowed<'a> = &'a mut Self;
17208        fn take_or_borrow<'a>(
17209            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17210        ) -> Self::Borrowed<'a> {
17211            value
17212        }
17213    }
17214
17215    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
17216        type Owned = Self;
17217
17218        #[inline(always)]
17219        fn inline_align(_context: fidl::encoding::Context) -> usize {
17220            8
17221        }
17222
17223        #[inline(always)]
17224        fn inline_size(_context: fidl::encoding::Context) -> usize {
17225            40
17226        }
17227    }
17228
17229    unsafe impl
17230        fidl::encoding::Encode<
17231            DirectoryCreateSymlinkRequest,
17232            fdomain_client::fidl::FDomainResourceDialect,
17233        > for &mut DirectoryCreateSymlinkRequest
17234    {
17235        #[inline]
17236        unsafe fn encode(
17237            self,
17238            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17239            offset: usize,
17240            _depth: fidl::encoding::Depth,
17241        ) -> fidl::Result<()> {
17242            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17243            // Delegate to tuple encoding.
17244            fidl::encoding::Encode::<
17245                DirectoryCreateSymlinkRequest,
17246                fdomain_client::fidl::FDomainResourceDialect,
17247            >::encode(
17248                (
17249                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17250                        &self.name,
17251                    ),
17252                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
17253                        &self.target,
17254                    ),
17255                    <fidl::encoding::Optional<
17256                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17257                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17258                        &mut self.connection
17259                    ),
17260                ),
17261                encoder,
17262                offset,
17263                _depth,
17264            )
17265        }
17266    }
17267    unsafe impl<
17268        T0: fidl::encoding::Encode<
17269                fidl::encoding::BoundedString<255>,
17270                fdomain_client::fidl::FDomainResourceDialect,
17271            >,
17272        T1: fidl::encoding::Encode<
17273                fidl::encoding::Vector<u8, 4095>,
17274                fdomain_client::fidl::FDomainResourceDialect,
17275            >,
17276        T2: fidl::encoding::Encode<
17277                fidl::encoding::Optional<
17278                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17279                >,
17280                fdomain_client::fidl::FDomainResourceDialect,
17281            >,
17282    >
17283        fidl::encoding::Encode<
17284            DirectoryCreateSymlinkRequest,
17285            fdomain_client::fidl::FDomainResourceDialect,
17286        > for (T0, T1, T2)
17287    {
17288        #[inline]
17289        unsafe fn encode(
17290            self,
17291            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17292            offset: usize,
17293            depth: fidl::encoding::Depth,
17294        ) -> fidl::Result<()> {
17295            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17296            // Zero out padding regions. There's no need to apply masks
17297            // because the unmasked parts will be overwritten by fields.
17298            unsafe {
17299                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
17300                (ptr as *mut u64).write_unaligned(0);
17301            }
17302            // Write the fields.
17303            self.0.encode(encoder, offset + 0, depth)?;
17304            self.1.encode(encoder, offset + 16, depth)?;
17305            self.2.encode(encoder, offset + 32, depth)?;
17306            Ok(())
17307        }
17308    }
17309
17310    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17311        for DirectoryCreateSymlinkRequest
17312    {
17313        #[inline(always)]
17314        fn new_empty() -> Self {
17315            Self {
17316                name: fidl::new_empty!(
17317                    fidl::encoding::BoundedString<255>,
17318                    fdomain_client::fidl::FDomainResourceDialect
17319                ),
17320                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect),
17321                connection: fidl::new_empty!(
17322                    fidl::encoding::Optional<
17323                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17324                    >,
17325                    fdomain_client::fidl::FDomainResourceDialect
17326                ),
17327            }
17328        }
17329
17330        #[inline]
17331        unsafe fn decode(
17332            &mut self,
17333            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17334            offset: usize,
17335            _depth: fidl::encoding::Depth,
17336        ) -> fidl::Result<()> {
17337            decoder.debug_check_bounds::<Self>(offset);
17338            // Verify that padding bytes are zero.
17339            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
17340            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17341            let mask = 0xffffffff00000000u64;
17342            let maskedval = padval & mask;
17343            if maskedval != 0 {
17344                return Err(fidl::Error::NonZeroPadding {
17345                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
17346                });
17347            }
17348            fidl::decode!(
17349                fidl::encoding::BoundedString<255>,
17350                fdomain_client::fidl::FDomainResourceDialect,
17351                &mut self.name,
17352                decoder,
17353                offset + 0,
17354                _depth
17355            )?;
17356            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
17357            fidl::decode!(
17358                fidl::encoding::Optional<
17359                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17360                >,
17361                fdomain_client::fidl::FDomainResourceDialect,
17362                &mut self.connection,
17363                decoder,
17364                offset + 32,
17365                _depth
17366            )?;
17367            Ok(())
17368        }
17369    }
17370
17371    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
17372        type Borrowed<'a> = &'a mut Self;
17373        fn take_or_borrow<'a>(
17374            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17375        ) -> Self::Borrowed<'a> {
17376            value
17377        }
17378    }
17379
17380    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
17381        type Owned = Self;
17382
17383        #[inline(always)]
17384        fn inline_align(_context: fidl::encoding::Context) -> usize {
17385            8
17386        }
17387
17388        #[inline(always)]
17389        fn inline_size(_context: fidl::encoding::Context) -> usize {
17390            32
17391        }
17392    }
17393
17394    unsafe impl
17395        fidl::encoding::Encode<
17396            DirectoryDeprecatedOpenRequest,
17397            fdomain_client::fidl::FDomainResourceDialect,
17398        > for &mut DirectoryDeprecatedOpenRequest
17399    {
17400        #[inline]
17401        unsafe fn encode(
17402            self,
17403            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17404            offset: usize,
17405            _depth: fidl::encoding::Depth,
17406        ) -> fidl::Result<()> {
17407            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17408            // Delegate to tuple encoding.
17409            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17410                (
17411                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17412                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
17413                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17414                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17415                ),
17416                encoder, offset, _depth
17417            )
17418        }
17419    }
17420    unsafe impl<
17421        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
17422        T1: fidl::encoding::Encode<ModeType, fdomain_client::fidl::FDomainResourceDialect>,
17423        T2: fidl::encoding::Encode<
17424                fidl::encoding::BoundedString<4095>,
17425                fdomain_client::fidl::FDomainResourceDialect,
17426            >,
17427        T3: fidl::encoding::Encode<
17428                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17429                fdomain_client::fidl::FDomainResourceDialect,
17430            >,
17431    >
17432        fidl::encoding::Encode<
17433            DirectoryDeprecatedOpenRequest,
17434            fdomain_client::fidl::FDomainResourceDialect,
17435        > for (T0, T1, T2, T3)
17436    {
17437        #[inline]
17438        unsafe fn encode(
17439            self,
17440            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17441            offset: usize,
17442            depth: fidl::encoding::Depth,
17443        ) -> fidl::Result<()> {
17444            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17445            // Zero out padding regions. There's no need to apply masks
17446            // because the unmasked parts will be overwritten by fields.
17447            unsafe {
17448                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
17449                (ptr as *mut u64).write_unaligned(0);
17450            }
17451            // Write the fields.
17452            self.0.encode(encoder, offset + 0, depth)?;
17453            self.1.encode(encoder, offset + 4, depth)?;
17454            self.2.encode(encoder, offset + 8, depth)?;
17455            self.3.encode(encoder, offset + 24, depth)?;
17456            Ok(())
17457        }
17458    }
17459
17460    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17461        for DirectoryDeprecatedOpenRequest
17462    {
17463        #[inline(always)]
17464        fn new_empty() -> Self {
17465            Self {
17466                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
17467                mode: fidl::new_empty!(ModeType, fdomain_client::fidl::FDomainResourceDialect),
17468                path: fidl::new_empty!(
17469                    fidl::encoding::BoundedString<4095>,
17470                    fdomain_client::fidl::FDomainResourceDialect
17471                ),
17472                object: fidl::new_empty!(
17473                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17474                    fdomain_client::fidl::FDomainResourceDialect
17475                ),
17476            }
17477        }
17478
17479        #[inline]
17480        unsafe fn decode(
17481            &mut self,
17482            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17483            offset: usize,
17484            _depth: fidl::encoding::Depth,
17485        ) -> fidl::Result<()> {
17486            decoder.debug_check_bounds::<Self>(offset);
17487            // Verify that padding bytes are zero.
17488            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
17489            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17490            let mask = 0xffffffff00000000u64;
17491            let maskedval = padval & mask;
17492            if maskedval != 0 {
17493                return Err(fidl::Error::NonZeroPadding {
17494                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
17495                });
17496            }
17497            fidl::decode!(
17498                OpenFlags,
17499                fdomain_client::fidl::FDomainResourceDialect,
17500                &mut self.flags,
17501                decoder,
17502                offset + 0,
17503                _depth
17504            )?;
17505            fidl::decode!(
17506                ModeType,
17507                fdomain_client::fidl::FDomainResourceDialect,
17508                &mut self.mode,
17509                decoder,
17510                offset + 4,
17511                _depth
17512            )?;
17513            fidl::decode!(
17514                fidl::encoding::BoundedString<4095>,
17515                fdomain_client::fidl::FDomainResourceDialect,
17516                &mut self.path,
17517                decoder,
17518                offset + 8,
17519                _depth
17520            )?;
17521            fidl::decode!(
17522                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17523                fdomain_client::fidl::FDomainResourceDialect,
17524                &mut self.object,
17525                decoder,
17526                offset + 24,
17527                _depth
17528            )?;
17529            Ok(())
17530        }
17531    }
17532
17533    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
17534        type Borrowed<'a> = &'a mut Self;
17535        fn take_or_borrow<'a>(
17536            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17537        ) -> Self::Borrowed<'a> {
17538            value
17539        }
17540    }
17541
17542    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
17543        type Owned = Self;
17544
17545        #[inline(always)]
17546        fn inline_align(_context: fidl::encoding::Context) -> usize {
17547            4
17548        }
17549
17550        #[inline(always)]
17551        fn inline_size(_context: fidl::encoding::Context) -> usize {
17552            8
17553        }
17554    }
17555
17556    unsafe impl
17557        fidl::encoding::Encode<
17558            DirectoryGetTokenResponse,
17559            fdomain_client::fidl::FDomainResourceDialect,
17560        > for &mut DirectoryGetTokenResponse
17561    {
17562        #[inline]
17563        unsafe fn encode(
17564            self,
17565            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17566            offset: usize,
17567            _depth: fidl::encoding::Depth,
17568        ) -> fidl::Result<()> {
17569            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
17570            // Delegate to tuple encoding.
17571            fidl::encoding::Encode::<
17572                DirectoryGetTokenResponse,
17573                fdomain_client::fidl::FDomainResourceDialect,
17574            >::encode(
17575                (
17576                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
17577                    <fidl::encoding::Optional<
17578                        fidl::encoding::HandleType<
17579                            fdomain_client::NullableHandle,
17580                            { fidl::ObjectType::NONE.into_raw() },
17581                            2147483648,
17582                        >,
17583                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17584                        &mut self.token
17585                    ),
17586                ),
17587                encoder,
17588                offset,
17589                _depth,
17590            )
17591        }
17592    }
17593    unsafe impl<
17594        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
17595        T1: fidl::encoding::Encode<
17596                fidl::encoding::Optional<
17597                    fidl::encoding::HandleType<
17598                        fdomain_client::NullableHandle,
17599                        { fidl::ObjectType::NONE.into_raw() },
17600                        2147483648,
17601                    >,
17602                >,
17603                fdomain_client::fidl::FDomainResourceDialect,
17604            >,
17605    >
17606        fidl::encoding::Encode<
17607            DirectoryGetTokenResponse,
17608            fdomain_client::fidl::FDomainResourceDialect,
17609        > for (T0, T1)
17610    {
17611        #[inline]
17612        unsafe fn encode(
17613            self,
17614            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17615            offset: usize,
17616            depth: fidl::encoding::Depth,
17617        ) -> fidl::Result<()> {
17618            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
17619            // Zero out padding regions. There's no need to apply masks
17620            // because the unmasked parts will be overwritten by fields.
17621            // Write the fields.
17622            self.0.encode(encoder, offset + 0, depth)?;
17623            self.1.encode(encoder, offset + 4, depth)?;
17624            Ok(())
17625        }
17626    }
17627
17628    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17629        for DirectoryGetTokenResponse
17630    {
17631        #[inline(always)]
17632        fn new_empty() -> Self {
17633            Self {
17634                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
17635                token: fidl::new_empty!(
17636                    fidl::encoding::Optional<
17637                        fidl::encoding::HandleType<
17638                            fdomain_client::NullableHandle,
17639                            { fidl::ObjectType::NONE.into_raw() },
17640                            2147483648,
17641                        >,
17642                    >,
17643                    fdomain_client::fidl::FDomainResourceDialect
17644                ),
17645            }
17646        }
17647
17648        #[inline]
17649        unsafe fn decode(
17650            &mut self,
17651            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17652            offset: usize,
17653            _depth: fidl::encoding::Depth,
17654        ) -> fidl::Result<()> {
17655            decoder.debug_check_bounds::<Self>(offset);
17656            // Verify that padding bytes are zero.
17657            fidl::decode!(
17658                i32,
17659                fdomain_client::fidl::FDomainResourceDialect,
17660                &mut self.s,
17661                decoder,
17662                offset + 0,
17663                _depth
17664            )?;
17665            fidl::decode!(
17666                fidl::encoding::Optional<
17667                    fidl::encoding::HandleType<
17668                        fdomain_client::NullableHandle,
17669                        { fidl::ObjectType::NONE.into_raw() },
17670                        2147483648,
17671                    >,
17672                >,
17673                fdomain_client::fidl::FDomainResourceDialect,
17674                &mut self.token,
17675                decoder,
17676                offset + 4,
17677                _depth
17678            )?;
17679            Ok(())
17680        }
17681    }
17682
17683    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
17684        type Borrowed<'a> = &'a mut Self;
17685        fn take_or_borrow<'a>(
17686            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17687        ) -> Self::Borrowed<'a> {
17688            value
17689        }
17690    }
17691
17692    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
17693        type Owned = Self;
17694
17695        #[inline(always)]
17696        fn inline_align(_context: fidl::encoding::Context) -> usize {
17697            8
17698        }
17699
17700        #[inline(always)]
17701        fn inline_size(_context: fidl::encoding::Context) -> usize {
17702            40
17703        }
17704    }
17705
17706    unsafe impl
17707        fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
17708        for &mut DirectoryLinkRequest
17709    {
17710        #[inline]
17711        unsafe fn encode(
17712            self,
17713            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17714            offset: usize,
17715            _depth: fidl::encoding::Depth,
17716        ) -> fidl::Result<()> {
17717            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
17718            // Delegate to tuple encoding.
17719            fidl::encoding::Encode::<
17720                DirectoryLinkRequest,
17721                fdomain_client::fidl::FDomainResourceDialect,
17722            >::encode(
17723                (
17724                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17725                        &self.src,
17726                    ),
17727                    <fidl::encoding::HandleType<
17728                        fdomain_client::NullableHandle,
17729                        { fidl::ObjectType::NONE.into_raw() },
17730                        2147483648,
17731                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17732                        &mut self.dst_parent_token,
17733                    ),
17734                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17735                        &self.dst,
17736                    ),
17737                ),
17738                encoder,
17739                offset,
17740                _depth,
17741            )
17742        }
17743    }
17744    unsafe impl<
17745        T0: fidl::encoding::Encode<
17746                fidl::encoding::BoundedString<255>,
17747                fdomain_client::fidl::FDomainResourceDialect,
17748            >,
17749        T1: fidl::encoding::Encode<
17750                fidl::encoding::HandleType<
17751                    fdomain_client::NullableHandle,
17752                    { fidl::ObjectType::NONE.into_raw() },
17753                    2147483648,
17754                >,
17755                fdomain_client::fidl::FDomainResourceDialect,
17756            >,
17757        T2: fidl::encoding::Encode<
17758                fidl::encoding::BoundedString<255>,
17759                fdomain_client::fidl::FDomainResourceDialect,
17760            >,
17761    > fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
17762        for (T0, T1, T2)
17763    {
17764        #[inline]
17765        unsafe fn encode(
17766            self,
17767            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17768            offset: usize,
17769            depth: fidl::encoding::Depth,
17770        ) -> fidl::Result<()> {
17771            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
17772            // Zero out padding regions. There's no need to apply masks
17773            // because the unmasked parts will be overwritten by fields.
17774            unsafe {
17775                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
17776                (ptr as *mut u64).write_unaligned(0);
17777            }
17778            // Write the fields.
17779            self.0.encode(encoder, offset + 0, depth)?;
17780            self.1.encode(encoder, offset + 16, depth)?;
17781            self.2.encode(encoder, offset + 24, depth)?;
17782            Ok(())
17783        }
17784    }
17785
17786    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17787        for DirectoryLinkRequest
17788    {
17789        #[inline(always)]
17790        fn new_empty() -> Self {
17791            Self {
17792                src: fidl::new_empty!(
17793                    fidl::encoding::BoundedString<255>,
17794                    fdomain_client::fidl::FDomainResourceDialect
17795                ),
17796                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
17797                dst: fidl::new_empty!(
17798                    fidl::encoding::BoundedString<255>,
17799                    fdomain_client::fidl::FDomainResourceDialect
17800                ),
17801            }
17802        }
17803
17804        #[inline]
17805        unsafe fn decode(
17806            &mut self,
17807            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17808            offset: usize,
17809            _depth: fidl::encoding::Depth,
17810        ) -> fidl::Result<()> {
17811            decoder.debug_check_bounds::<Self>(offset);
17812            // Verify that padding bytes are zero.
17813            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
17814            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17815            let mask = 0xffffffff00000000u64;
17816            let maskedval = padval & mask;
17817            if maskedval != 0 {
17818                return Err(fidl::Error::NonZeroPadding {
17819                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
17820                });
17821            }
17822            fidl::decode!(
17823                fidl::encoding::BoundedString<255>,
17824                fdomain_client::fidl::FDomainResourceDialect,
17825                &mut self.src,
17826                decoder,
17827                offset + 0,
17828                _depth
17829            )?;
17830            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)?;
17831            fidl::decode!(
17832                fidl::encoding::BoundedString<255>,
17833                fdomain_client::fidl::FDomainResourceDialect,
17834                &mut self.dst,
17835                decoder,
17836                offset + 24,
17837                _depth
17838            )?;
17839            Ok(())
17840        }
17841    }
17842
17843    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
17844        type Borrowed<'a> = &'a mut Self;
17845        fn take_or_borrow<'a>(
17846            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17847        ) -> Self::Borrowed<'a> {
17848            value
17849        }
17850    }
17851
17852    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
17853        type Owned = Self;
17854
17855        #[inline(always)]
17856        fn inline_align(_context: fidl::encoding::Context) -> usize {
17857            8
17858        }
17859
17860        #[inline(always)]
17861        fn inline_size(_context: fidl::encoding::Context) -> usize {
17862            48
17863        }
17864    }
17865
17866    unsafe impl
17867        fidl::encoding::Encode<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
17868        for &mut DirectoryOpenRequest
17869    {
17870        #[inline]
17871        unsafe fn encode(
17872            self,
17873            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17874            offset: usize,
17875            _depth: fidl::encoding::Depth,
17876        ) -> fidl::Result<()> {
17877            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
17878            // Delegate to tuple encoding.
17879            fidl::encoding::Encode::<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17880                (
17881                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17882                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17883                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
17884                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17885                ),
17886                encoder, offset, _depth
17887            )
17888        }
17889    }
17890    unsafe impl<
17891        T0: fidl::encoding::Encode<
17892                fidl::encoding::BoundedString<4095>,
17893                fdomain_client::fidl::FDomainResourceDialect,
17894            >,
17895        T1: fidl::encoding::Encode<Flags, fdomain_client::fidl::FDomainResourceDialect>,
17896        T2: fidl::encoding::Encode<Options, fdomain_client::fidl::FDomainResourceDialect>,
17897        T3: fidl::encoding::Encode<
17898                fidl::encoding::HandleType<
17899                    fdomain_client::Channel,
17900                    { fidl::ObjectType::CHANNEL.into_raw() },
17901                    2147483648,
17902                >,
17903                fdomain_client::fidl::FDomainResourceDialect,
17904            >,
17905    > fidl::encoding::Encode<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
17906        for (T0, T1, T2, T3)
17907    {
17908        #[inline]
17909        unsafe fn encode(
17910            self,
17911            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17912            offset: usize,
17913            depth: fidl::encoding::Depth,
17914        ) -> fidl::Result<()> {
17915            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
17916            // Zero out padding regions. There's no need to apply masks
17917            // because the unmasked parts will be overwritten by fields.
17918            unsafe {
17919                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
17920                (ptr as *mut u64).write_unaligned(0);
17921            }
17922            // Write the fields.
17923            self.0.encode(encoder, offset + 0, depth)?;
17924            self.1.encode(encoder, offset + 16, depth)?;
17925            self.2.encode(encoder, offset + 24, depth)?;
17926            self.3.encode(encoder, offset + 40, depth)?;
17927            Ok(())
17928        }
17929    }
17930
17931    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17932        for DirectoryOpenRequest
17933    {
17934        #[inline(always)]
17935        fn new_empty() -> Self {
17936            Self {
17937                path: fidl::new_empty!(
17938                    fidl::encoding::BoundedString<4095>,
17939                    fdomain_client::fidl::FDomainResourceDialect
17940                ),
17941                flags: fidl::new_empty!(Flags, fdomain_client::fidl::FDomainResourceDialect),
17942                options: fidl::new_empty!(Options, fdomain_client::fidl::FDomainResourceDialect),
17943                object: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
17944            }
17945        }
17946
17947        #[inline]
17948        unsafe fn decode(
17949            &mut self,
17950            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17951            offset: usize,
17952            _depth: fidl::encoding::Depth,
17953        ) -> fidl::Result<()> {
17954            decoder.debug_check_bounds::<Self>(offset);
17955            // Verify that padding bytes are zero.
17956            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
17957            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17958            let mask = 0xffffffff00000000u64;
17959            let maskedval = padval & mask;
17960            if maskedval != 0 {
17961                return Err(fidl::Error::NonZeroPadding {
17962                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
17963                });
17964            }
17965            fidl::decode!(
17966                fidl::encoding::BoundedString<4095>,
17967                fdomain_client::fidl::FDomainResourceDialect,
17968                &mut self.path,
17969                decoder,
17970                offset + 0,
17971                _depth
17972            )?;
17973            fidl::decode!(
17974                Flags,
17975                fdomain_client::fidl::FDomainResourceDialect,
17976                &mut self.flags,
17977                decoder,
17978                offset + 16,
17979                _depth
17980            )?;
17981            fidl::decode!(
17982                Options,
17983                fdomain_client::fidl::FDomainResourceDialect,
17984                &mut self.options,
17985                decoder,
17986                offset + 24,
17987                _depth
17988            )?;
17989            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)?;
17990            Ok(())
17991        }
17992    }
17993
17994    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
17995        type Borrowed<'a> = &'a mut Self;
17996        fn take_or_borrow<'a>(
17997            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17998        ) -> Self::Borrowed<'a> {
17999            value
18000        }
18001    }
18002
18003    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
18004        type Owned = Self;
18005
18006        #[inline(always)]
18007        fn inline_align(_context: fidl::encoding::Context) -> usize {
18008            8
18009        }
18010
18011        #[inline(always)]
18012        fn inline_size(_context: fidl::encoding::Context) -> usize {
18013            40
18014        }
18015    }
18016
18017    unsafe impl
18018        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18019        for &mut DirectoryRenameRequest
18020    {
18021        #[inline]
18022        unsafe fn encode(
18023            self,
18024            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18025            offset: usize,
18026            _depth: fidl::encoding::Depth,
18027        ) -> fidl::Result<()> {
18028            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18029            // Delegate to tuple encoding.
18030            fidl::encoding::Encode::<
18031                DirectoryRenameRequest,
18032                fdomain_client::fidl::FDomainResourceDialect,
18033            >::encode(
18034                (
18035                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18036                        &self.src,
18037                    ),
18038                    <fidl::encoding::HandleType<
18039                        fdomain_client::Event,
18040                        { fidl::ObjectType::EVENT.into_raw() },
18041                        2147483648,
18042                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18043                        &mut self.dst_parent_token,
18044                    ),
18045                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18046                        &self.dst,
18047                    ),
18048                ),
18049                encoder,
18050                offset,
18051                _depth,
18052            )
18053        }
18054    }
18055    unsafe impl<
18056        T0: fidl::encoding::Encode<
18057                fidl::encoding::BoundedString<255>,
18058                fdomain_client::fidl::FDomainResourceDialect,
18059            >,
18060        T1: fidl::encoding::Encode<
18061                fidl::encoding::HandleType<
18062                    fdomain_client::Event,
18063                    { fidl::ObjectType::EVENT.into_raw() },
18064                    2147483648,
18065                >,
18066                fdomain_client::fidl::FDomainResourceDialect,
18067            >,
18068        T2: fidl::encoding::Encode<
18069                fidl::encoding::BoundedString<255>,
18070                fdomain_client::fidl::FDomainResourceDialect,
18071            >,
18072    >
18073        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18074        for (T0, T1, T2)
18075    {
18076        #[inline]
18077        unsafe fn encode(
18078            self,
18079            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18080            offset: usize,
18081            depth: fidl::encoding::Depth,
18082        ) -> fidl::Result<()> {
18083            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18084            // Zero out padding regions. There's no need to apply masks
18085            // because the unmasked parts will be overwritten by fields.
18086            unsafe {
18087                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18088                (ptr as *mut u64).write_unaligned(0);
18089            }
18090            // Write the fields.
18091            self.0.encode(encoder, offset + 0, depth)?;
18092            self.1.encode(encoder, offset + 16, depth)?;
18093            self.2.encode(encoder, offset + 24, depth)?;
18094            Ok(())
18095        }
18096    }
18097
18098    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18099        for DirectoryRenameRequest
18100    {
18101        #[inline(always)]
18102        fn new_empty() -> Self {
18103            Self {
18104                src: fidl::new_empty!(
18105                    fidl::encoding::BoundedString<255>,
18106                    fdomain_client::fidl::FDomainResourceDialect
18107                ),
18108                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18109                dst: fidl::new_empty!(
18110                    fidl::encoding::BoundedString<255>,
18111                    fdomain_client::fidl::FDomainResourceDialect
18112                ),
18113            }
18114        }
18115
18116        #[inline]
18117        unsafe fn decode(
18118            &mut self,
18119            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18120            offset: usize,
18121            _depth: fidl::encoding::Depth,
18122        ) -> fidl::Result<()> {
18123            decoder.debug_check_bounds::<Self>(offset);
18124            // Verify that padding bytes are zero.
18125            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18126            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18127            let mask = 0xffffffff00000000u64;
18128            let maskedval = padval & mask;
18129            if maskedval != 0 {
18130                return Err(fidl::Error::NonZeroPadding {
18131                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18132                });
18133            }
18134            fidl::decode!(
18135                fidl::encoding::BoundedString<255>,
18136                fdomain_client::fidl::FDomainResourceDialect,
18137                &mut self.src,
18138                decoder,
18139                offset + 0,
18140                _depth
18141            )?;
18142            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)?;
18143            fidl::decode!(
18144                fidl::encoding::BoundedString<255>,
18145                fdomain_client::fidl::FDomainResourceDialect,
18146                &mut self.dst,
18147                decoder,
18148                offset + 24,
18149                _depth
18150            )?;
18151            Ok(())
18152        }
18153    }
18154
18155    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
18156        type Borrowed<'a> = &'a mut Self;
18157        fn take_or_borrow<'a>(
18158            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18159        ) -> Self::Borrowed<'a> {
18160            value
18161        }
18162    }
18163
18164    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
18165        type Owned = Self;
18166
18167        #[inline(always)]
18168        fn inline_align(_context: fidl::encoding::Context) -> usize {
18169            4
18170        }
18171
18172        #[inline(always)]
18173        fn inline_size(_context: fidl::encoding::Context) -> usize {
18174            12
18175        }
18176    }
18177
18178    unsafe impl
18179        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18180        for &mut DirectoryWatchRequest
18181    {
18182        #[inline]
18183        unsafe fn encode(
18184            self,
18185            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18186            offset: usize,
18187            _depth: fidl::encoding::Depth,
18188        ) -> fidl::Result<()> {
18189            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18190            // Delegate to tuple encoding.
18191            fidl::encoding::Encode::<
18192                DirectoryWatchRequest,
18193                fdomain_client::fidl::FDomainResourceDialect,
18194            >::encode(
18195                (
18196                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
18197                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
18198                    <fidl::encoding::Endpoint<
18199                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18200                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18201                        &mut self.watcher
18202                    ),
18203                ),
18204                encoder,
18205                offset,
18206                _depth,
18207            )
18208        }
18209    }
18210    unsafe impl<
18211        T0: fidl::encoding::Encode<WatchMask, fdomain_client::fidl::FDomainResourceDialect>,
18212        T1: fidl::encoding::Encode<u32, fdomain_client::fidl::FDomainResourceDialect>,
18213        T2: fidl::encoding::Encode<
18214                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18215                fdomain_client::fidl::FDomainResourceDialect,
18216            >,
18217    >
18218        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18219        for (T0, T1, T2)
18220    {
18221        #[inline]
18222        unsafe fn encode(
18223            self,
18224            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18225            offset: usize,
18226            depth: fidl::encoding::Depth,
18227        ) -> fidl::Result<()> {
18228            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18229            // Zero out padding regions. There's no need to apply masks
18230            // because the unmasked parts will be overwritten by fields.
18231            // Write the fields.
18232            self.0.encode(encoder, offset + 0, depth)?;
18233            self.1.encode(encoder, offset + 4, depth)?;
18234            self.2.encode(encoder, offset + 8, depth)?;
18235            Ok(())
18236        }
18237    }
18238
18239    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18240        for DirectoryWatchRequest
18241    {
18242        #[inline(always)]
18243        fn new_empty() -> Self {
18244            Self {
18245                mask: fidl::new_empty!(WatchMask, fdomain_client::fidl::FDomainResourceDialect),
18246                options: fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect),
18247                watcher: fidl::new_empty!(
18248                    fidl::encoding::Endpoint<
18249                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18250                    >,
18251                    fdomain_client::fidl::FDomainResourceDialect
18252                ),
18253            }
18254        }
18255
18256        #[inline]
18257        unsafe fn decode(
18258            &mut self,
18259            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18260            offset: usize,
18261            _depth: fidl::encoding::Depth,
18262        ) -> fidl::Result<()> {
18263            decoder.debug_check_bounds::<Self>(offset);
18264            // Verify that padding bytes are zero.
18265            fidl::decode!(
18266                WatchMask,
18267                fdomain_client::fidl::FDomainResourceDialect,
18268                &mut self.mask,
18269                decoder,
18270                offset + 0,
18271                _depth
18272            )?;
18273            fidl::decode!(
18274                u32,
18275                fdomain_client::fidl::FDomainResourceDialect,
18276                &mut self.options,
18277                decoder,
18278                offset + 4,
18279                _depth
18280            )?;
18281            fidl::decode!(
18282                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18283                fdomain_client::fidl::FDomainResourceDialect,
18284                &mut self.watcher,
18285                decoder,
18286                offset + 8,
18287                _depth
18288            )?;
18289            Ok(())
18290        }
18291    }
18292
18293    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
18294        type Borrowed<'a> = &'a mut Self;
18295        fn take_or_borrow<'a>(
18296            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18297        ) -> Self::Borrowed<'a> {
18298            value
18299        }
18300    }
18301
18302    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
18303        type Owned = Self;
18304
18305        #[inline(always)]
18306        fn inline_align(_context: fidl::encoding::Context) -> usize {
18307            8
18308        }
18309
18310        #[inline(always)]
18311        fn inline_size(_context: fidl::encoding::Context) -> usize {
18312            24
18313        }
18314    }
18315
18316    unsafe impl
18317        fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18318        for &mut FileAllocateRequest
18319    {
18320        #[inline]
18321        unsafe fn encode(
18322            self,
18323            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18324            offset: usize,
18325            _depth: fidl::encoding::Depth,
18326        ) -> fidl::Result<()> {
18327            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18328            // Delegate to tuple encoding.
18329            fidl::encoding::Encode::<
18330                FileAllocateRequest,
18331                fdomain_client::fidl::FDomainResourceDialect,
18332            >::encode(
18333                (
18334                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
18335                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
18336                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
18337                ),
18338                encoder,
18339                offset,
18340                _depth,
18341            )
18342        }
18343    }
18344    unsafe impl<
18345        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18346        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18347        T2: fidl::encoding::Encode<AllocateMode, fdomain_client::fidl::FDomainResourceDialect>,
18348    > fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18349        for (T0, T1, T2)
18350    {
18351        #[inline]
18352        unsafe fn encode(
18353            self,
18354            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18355            offset: usize,
18356            depth: fidl::encoding::Depth,
18357        ) -> fidl::Result<()> {
18358            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18359            // Zero out padding regions. There's no need to apply masks
18360            // because the unmasked parts will be overwritten by fields.
18361            unsafe {
18362                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18363                (ptr as *mut u64).write_unaligned(0);
18364            }
18365            // Write the fields.
18366            self.0.encode(encoder, offset + 0, depth)?;
18367            self.1.encode(encoder, offset + 8, depth)?;
18368            self.2.encode(encoder, offset + 16, depth)?;
18369            Ok(())
18370        }
18371    }
18372
18373    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18374        for FileAllocateRequest
18375    {
18376        #[inline(always)]
18377        fn new_empty() -> Self {
18378            Self {
18379                offset: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18380                length: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18381                mode: fidl::new_empty!(AllocateMode, fdomain_client::fidl::FDomainResourceDialect),
18382            }
18383        }
18384
18385        #[inline]
18386        unsafe fn decode(
18387            &mut self,
18388            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18389            offset: usize,
18390            _depth: fidl::encoding::Depth,
18391        ) -> fidl::Result<()> {
18392            decoder.debug_check_bounds::<Self>(offset);
18393            // Verify that padding bytes are zero.
18394            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18395            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18396            let mask = 0xffffffff00000000u64;
18397            let maskedval = padval & mask;
18398            if maskedval != 0 {
18399                return Err(fidl::Error::NonZeroPadding {
18400                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18401                });
18402            }
18403            fidl::decode!(
18404                u64,
18405                fdomain_client::fidl::FDomainResourceDialect,
18406                &mut self.offset,
18407                decoder,
18408                offset + 0,
18409                _depth
18410            )?;
18411            fidl::decode!(
18412                u64,
18413                fdomain_client::fidl::FDomainResourceDialect,
18414                &mut self.length,
18415                decoder,
18416                offset + 8,
18417                _depth
18418            )?;
18419            fidl::decode!(
18420                AllocateMode,
18421                fdomain_client::fidl::FDomainResourceDialect,
18422                &mut self.mode,
18423                decoder,
18424                offset + 16,
18425                _depth
18426            )?;
18427            Ok(())
18428        }
18429    }
18430
18431    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
18432        type Borrowed<'a> = &'a mut Self;
18433        fn take_or_borrow<'a>(
18434            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18435        ) -> Self::Borrowed<'a> {
18436            value
18437        }
18438    }
18439
18440    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
18441        type Owned = Self;
18442
18443        #[inline(always)]
18444        fn inline_align(_context: fidl::encoding::Context) -> usize {
18445            8
18446        }
18447
18448        #[inline(always)]
18449        fn inline_size(_context: fidl::encoding::Context) -> usize {
18450            16
18451        }
18452    }
18453
18454    unsafe impl
18455        fidl::encoding::Encode<
18456            FileEnableVerityRequest,
18457            fdomain_client::fidl::FDomainResourceDialect,
18458        > for &mut FileEnableVerityRequest
18459    {
18460        #[inline]
18461        unsafe fn encode(
18462            self,
18463            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18464            offset: usize,
18465            _depth: fidl::encoding::Depth,
18466        ) -> fidl::Result<()> {
18467            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18468            // Delegate to tuple encoding.
18469            fidl::encoding::Encode::<
18470                FileEnableVerityRequest,
18471                fdomain_client::fidl::FDomainResourceDialect,
18472            >::encode(
18473                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
18474                encoder,
18475                offset,
18476                _depth,
18477            )
18478        }
18479    }
18480    unsafe impl<
18481        T0: fidl::encoding::Encode<VerificationOptions, fdomain_client::fidl::FDomainResourceDialect>,
18482    >
18483        fidl::encoding::Encode<
18484            FileEnableVerityRequest,
18485            fdomain_client::fidl::FDomainResourceDialect,
18486        > for (T0,)
18487    {
18488        #[inline]
18489        unsafe fn encode(
18490            self,
18491            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18492            offset: usize,
18493            depth: fidl::encoding::Depth,
18494        ) -> fidl::Result<()> {
18495            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18496            // Zero out padding regions. There's no need to apply masks
18497            // because the unmasked parts will be overwritten by fields.
18498            // Write the fields.
18499            self.0.encode(encoder, offset + 0, depth)?;
18500            Ok(())
18501        }
18502    }
18503
18504    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18505        for FileEnableVerityRequest
18506    {
18507        #[inline(always)]
18508        fn new_empty() -> Self {
18509            Self {
18510                options: fidl::new_empty!(
18511                    VerificationOptions,
18512                    fdomain_client::fidl::FDomainResourceDialect
18513                ),
18514            }
18515        }
18516
18517        #[inline]
18518        unsafe fn decode(
18519            &mut self,
18520            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18521            offset: usize,
18522            _depth: fidl::encoding::Depth,
18523        ) -> fidl::Result<()> {
18524            decoder.debug_check_bounds::<Self>(offset);
18525            // Verify that padding bytes are zero.
18526            fidl::decode!(
18527                VerificationOptions,
18528                fdomain_client::fidl::FDomainResourceDialect,
18529                &mut self.options,
18530                decoder,
18531                offset + 0,
18532                _depth
18533            )?;
18534            Ok(())
18535        }
18536    }
18537
18538    impl fidl::encoding::ResourceTypeMarker for FileObject {
18539        type Borrowed<'a> = &'a mut Self;
18540        fn take_or_borrow<'a>(
18541            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18542        ) -> Self::Borrowed<'a> {
18543            value
18544        }
18545    }
18546
18547    unsafe impl fidl::encoding::TypeMarker for FileObject {
18548        type Owned = Self;
18549
18550        #[inline(always)]
18551        fn inline_align(_context: fidl::encoding::Context) -> usize {
18552            4
18553        }
18554
18555        #[inline(always)]
18556        fn inline_size(_context: fidl::encoding::Context) -> usize {
18557            8
18558        }
18559    }
18560
18561    unsafe impl fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18562        for &mut FileObject
18563    {
18564        #[inline]
18565        unsafe fn encode(
18566            self,
18567            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18568            offset: usize,
18569            _depth: fidl::encoding::Depth,
18570        ) -> fidl::Result<()> {
18571            encoder.debug_check_bounds::<FileObject>(offset);
18572            // Delegate to tuple encoding.
18573            fidl::encoding::Encode::<FileObject, fdomain_client::fidl::FDomainResourceDialect>::encode(
18574                (
18575                    <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),
18576                    <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),
18577                ),
18578                encoder, offset, _depth
18579            )
18580        }
18581    }
18582    unsafe impl<
18583        T0: fidl::encoding::Encode<
18584                fidl::encoding::Optional<
18585                    fidl::encoding::HandleType<
18586                        fdomain_client::Event,
18587                        { fidl::ObjectType::EVENT.into_raw() },
18588                        2147483648,
18589                    >,
18590                >,
18591                fdomain_client::fidl::FDomainResourceDialect,
18592            >,
18593        T1: fidl::encoding::Encode<
18594                fidl::encoding::Optional<
18595                    fidl::encoding::HandleType<
18596                        fdomain_client::Stream,
18597                        { fidl::ObjectType::STREAM.into_raw() },
18598                        2147483648,
18599                    >,
18600                >,
18601                fdomain_client::fidl::FDomainResourceDialect,
18602            >,
18603    > fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18604        for (T0, T1)
18605    {
18606        #[inline]
18607        unsafe fn encode(
18608            self,
18609            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18610            offset: usize,
18611            depth: fidl::encoding::Depth,
18612        ) -> fidl::Result<()> {
18613            encoder.debug_check_bounds::<FileObject>(offset);
18614            // Zero out padding regions. There's no need to apply masks
18615            // because the unmasked parts will be overwritten by fields.
18616            // Write the fields.
18617            self.0.encode(encoder, offset + 0, depth)?;
18618            self.1.encode(encoder, offset + 4, depth)?;
18619            Ok(())
18620        }
18621    }
18622
18623    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileObject {
18624        #[inline(always)]
18625        fn new_empty() -> Self {
18626            Self {
18627                event: fidl::new_empty!(
18628                    fidl::encoding::Optional<
18629                        fidl::encoding::HandleType<
18630                            fdomain_client::Event,
18631                            { fidl::ObjectType::EVENT.into_raw() },
18632                            2147483648,
18633                        >,
18634                    >,
18635                    fdomain_client::fidl::FDomainResourceDialect
18636                ),
18637                stream: fidl::new_empty!(
18638                    fidl::encoding::Optional<
18639                        fidl::encoding::HandleType<
18640                            fdomain_client::Stream,
18641                            { fidl::ObjectType::STREAM.into_raw() },
18642                            2147483648,
18643                        >,
18644                    >,
18645                    fdomain_client::fidl::FDomainResourceDialect
18646                ),
18647            }
18648        }
18649
18650        #[inline]
18651        unsafe fn decode(
18652            &mut self,
18653            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18654            offset: usize,
18655            _depth: fidl::encoding::Depth,
18656        ) -> fidl::Result<()> {
18657            decoder.debug_check_bounds::<Self>(offset);
18658            // Verify that padding bytes are zero.
18659            fidl::decode!(
18660                fidl::encoding::Optional<
18661                    fidl::encoding::HandleType<
18662                        fdomain_client::Event,
18663                        { fidl::ObjectType::EVENT.into_raw() },
18664                        2147483648,
18665                    >,
18666                >,
18667                fdomain_client::fidl::FDomainResourceDialect,
18668                &mut self.event,
18669                decoder,
18670                offset + 0,
18671                _depth
18672            )?;
18673            fidl::decode!(
18674                fidl::encoding::Optional<
18675                    fidl::encoding::HandleType<
18676                        fdomain_client::Stream,
18677                        { fidl::ObjectType::STREAM.into_raw() },
18678                        2147483648,
18679                    >,
18680                >,
18681                fdomain_client::fidl::FDomainResourceDialect,
18682                &mut self.stream,
18683                decoder,
18684                offset + 4,
18685                _depth
18686            )?;
18687            Ok(())
18688        }
18689    }
18690
18691    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
18692        type Borrowed<'a> = &'a mut Self;
18693        fn take_or_borrow<'a>(
18694            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18695        ) -> Self::Borrowed<'a> {
18696            value
18697        }
18698    }
18699
18700    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
18701        type Owned = Self;
18702
18703        #[inline(always)]
18704        fn inline_align(_context: fidl::encoding::Context) -> usize {
18705            4
18706        }
18707
18708        #[inline(always)]
18709        fn inline_size(_context: fidl::encoding::Context) -> usize {
18710            4
18711        }
18712    }
18713
18714    unsafe impl
18715        fidl::encoding::Encode<
18716            FileGetBackingMemoryResponse,
18717            fdomain_client::fidl::FDomainResourceDialect,
18718        > for &mut FileGetBackingMemoryResponse
18719    {
18720        #[inline]
18721        unsafe fn encode(
18722            self,
18723            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18724            offset: usize,
18725            _depth: fidl::encoding::Depth,
18726        ) -> fidl::Result<()> {
18727            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
18728            // Delegate to tuple encoding.
18729            fidl::encoding::Encode::<
18730                FileGetBackingMemoryResponse,
18731                fdomain_client::fidl::FDomainResourceDialect,
18732            >::encode(
18733                (<fidl::encoding::HandleType<
18734                    fdomain_client::Vmo,
18735                    { fidl::ObjectType::VMO.into_raw() },
18736                    2147483648,
18737                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18738                    &mut self.vmo
18739                ),),
18740                encoder,
18741                offset,
18742                _depth,
18743            )
18744        }
18745    }
18746    unsafe impl<
18747        T0: fidl::encoding::Encode<
18748                fidl::encoding::HandleType<
18749                    fdomain_client::Vmo,
18750                    { fidl::ObjectType::VMO.into_raw() },
18751                    2147483648,
18752                >,
18753                fdomain_client::fidl::FDomainResourceDialect,
18754            >,
18755    >
18756        fidl::encoding::Encode<
18757            FileGetBackingMemoryResponse,
18758            fdomain_client::fidl::FDomainResourceDialect,
18759        > for (T0,)
18760    {
18761        #[inline]
18762        unsafe fn encode(
18763            self,
18764            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18765            offset: usize,
18766            depth: fidl::encoding::Depth,
18767        ) -> fidl::Result<()> {
18768            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
18769            // Zero out padding regions. There's no need to apply masks
18770            // because the unmasked parts will be overwritten by fields.
18771            // Write the fields.
18772            self.0.encode(encoder, offset + 0, depth)?;
18773            Ok(())
18774        }
18775    }
18776
18777    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18778        for FileGetBackingMemoryResponse
18779    {
18780        #[inline(always)]
18781        fn new_empty() -> Self {
18782            Self {
18783                vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18784            }
18785        }
18786
18787        #[inline]
18788        unsafe fn decode(
18789            &mut self,
18790            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18791            offset: usize,
18792            _depth: fidl::encoding::Depth,
18793        ) -> fidl::Result<()> {
18794            decoder.debug_check_bounds::<Self>(offset);
18795            // Verify that padding bytes are zero.
18796            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)?;
18797            Ok(())
18798        }
18799    }
18800
18801    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
18802        type Borrowed<'a> = &'a mut Self;
18803        fn take_or_borrow<'a>(
18804            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18805        ) -> Self::Borrowed<'a> {
18806            value
18807        }
18808    }
18809
18810    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
18811        type Owned = Self;
18812
18813        #[inline(always)]
18814        fn inline_align(_context: fidl::encoding::Context) -> usize {
18815            8
18816        }
18817
18818        #[inline(always)]
18819        fn inline_size(_context: fidl::encoding::Context) -> usize {
18820            24
18821        }
18822    }
18823
18824    unsafe impl
18825        fidl::encoding::Encode<
18826            LinkableLinkIntoRequest,
18827            fdomain_client::fidl::FDomainResourceDialect,
18828        > for &mut LinkableLinkIntoRequest
18829    {
18830        #[inline]
18831        unsafe fn encode(
18832            self,
18833            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18834            offset: usize,
18835            _depth: fidl::encoding::Depth,
18836        ) -> fidl::Result<()> {
18837            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
18838            // Delegate to tuple encoding.
18839            fidl::encoding::Encode::<
18840                LinkableLinkIntoRequest,
18841                fdomain_client::fidl::FDomainResourceDialect,
18842            >::encode(
18843                (
18844                    <fidl::encoding::HandleType<
18845                        fdomain_client::Event,
18846                        { fidl::ObjectType::EVENT.into_raw() },
18847                        2147483648,
18848                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18849                        &mut self.dst_parent_token,
18850                    ),
18851                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18852                        &self.dst,
18853                    ),
18854                ),
18855                encoder,
18856                offset,
18857                _depth,
18858            )
18859        }
18860    }
18861    unsafe impl<
18862        T0: fidl::encoding::Encode<
18863                fidl::encoding::HandleType<
18864                    fdomain_client::Event,
18865                    { fidl::ObjectType::EVENT.into_raw() },
18866                    2147483648,
18867                >,
18868                fdomain_client::fidl::FDomainResourceDialect,
18869            >,
18870        T1: fidl::encoding::Encode<
18871                fidl::encoding::BoundedString<255>,
18872                fdomain_client::fidl::FDomainResourceDialect,
18873            >,
18874    >
18875        fidl::encoding::Encode<
18876            LinkableLinkIntoRequest,
18877            fdomain_client::fidl::FDomainResourceDialect,
18878        > for (T0, T1)
18879    {
18880        #[inline]
18881        unsafe fn encode(
18882            self,
18883            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18884            offset: usize,
18885            depth: fidl::encoding::Depth,
18886        ) -> fidl::Result<()> {
18887            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
18888            // Zero out padding regions. There's no need to apply masks
18889            // because the unmasked parts will be overwritten by fields.
18890            unsafe {
18891                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
18892                (ptr as *mut u64).write_unaligned(0);
18893            }
18894            // Write the fields.
18895            self.0.encode(encoder, offset + 0, depth)?;
18896            self.1.encode(encoder, offset + 8, depth)?;
18897            Ok(())
18898        }
18899    }
18900
18901    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18902        for LinkableLinkIntoRequest
18903    {
18904        #[inline(always)]
18905        fn new_empty() -> Self {
18906            Self {
18907                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18908                dst: fidl::new_empty!(
18909                    fidl::encoding::BoundedString<255>,
18910                    fdomain_client::fidl::FDomainResourceDialect
18911                ),
18912            }
18913        }
18914
18915        #[inline]
18916        unsafe fn decode(
18917            &mut self,
18918            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18919            offset: usize,
18920            _depth: fidl::encoding::Depth,
18921        ) -> fidl::Result<()> {
18922            decoder.debug_check_bounds::<Self>(offset);
18923            // Verify that padding bytes are zero.
18924            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
18925            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18926            let mask = 0xffffffff00000000u64;
18927            let maskedval = padval & mask;
18928            if maskedval != 0 {
18929                return Err(fidl::Error::NonZeroPadding {
18930                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
18931                });
18932            }
18933            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)?;
18934            fidl::decode!(
18935                fidl::encoding::BoundedString<255>,
18936                fdomain_client::fidl::FDomainResourceDialect,
18937                &mut self.dst,
18938                decoder,
18939                offset + 8,
18940                _depth
18941            )?;
18942            Ok(())
18943        }
18944    }
18945
18946    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
18947        type Borrowed<'a> = &'a mut Self;
18948        fn take_or_borrow<'a>(
18949            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18950        ) -> Self::Borrowed<'a> {
18951            value
18952        }
18953    }
18954
18955    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
18956        type Owned = Self;
18957
18958        #[inline(always)]
18959        fn inline_align(_context: fidl::encoding::Context) -> usize {
18960            4
18961        }
18962
18963        #[inline(always)]
18964        fn inline_size(_context: fidl::encoding::Context) -> usize {
18965            8
18966        }
18967    }
18968
18969    unsafe impl
18970        fidl::encoding::Encode<
18971            NodeDeprecatedCloneRequest,
18972            fdomain_client::fidl::FDomainResourceDialect,
18973        > for &mut NodeDeprecatedCloneRequest
18974    {
18975        #[inline]
18976        unsafe fn encode(
18977            self,
18978            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18979            offset: usize,
18980            _depth: fidl::encoding::Depth,
18981        ) -> fidl::Result<()> {
18982            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
18983            // Delegate to tuple encoding.
18984            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
18985                (
18986                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
18987                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
18988                ),
18989                encoder, offset, _depth
18990            )
18991        }
18992    }
18993    unsafe impl<
18994        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
18995        T1: fidl::encoding::Encode<
18996                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
18997                fdomain_client::fidl::FDomainResourceDialect,
18998            >,
18999    >
19000        fidl::encoding::Encode<
19001            NodeDeprecatedCloneRequest,
19002            fdomain_client::fidl::FDomainResourceDialect,
19003        > for (T0, T1)
19004    {
19005        #[inline]
19006        unsafe fn encode(
19007            self,
19008            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19009            offset: usize,
19010            depth: fidl::encoding::Depth,
19011        ) -> fidl::Result<()> {
19012            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19013            // Zero out padding regions. There's no need to apply masks
19014            // because the unmasked parts will be overwritten by fields.
19015            // Write the fields.
19016            self.0.encode(encoder, offset + 0, depth)?;
19017            self.1.encode(encoder, offset + 4, depth)?;
19018            Ok(())
19019        }
19020    }
19021
19022    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19023        for NodeDeprecatedCloneRequest
19024    {
19025        #[inline(always)]
19026        fn new_empty() -> Self {
19027            Self {
19028                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
19029                object: fidl::new_empty!(
19030                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19031                    fdomain_client::fidl::FDomainResourceDialect
19032                ),
19033            }
19034        }
19035
19036        #[inline]
19037        unsafe fn decode(
19038            &mut self,
19039            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19040            offset: usize,
19041            _depth: fidl::encoding::Depth,
19042        ) -> fidl::Result<()> {
19043            decoder.debug_check_bounds::<Self>(offset);
19044            // Verify that padding bytes are zero.
19045            fidl::decode!(
19046                OpenFlags,
19047                fdomain_client::fidl::FDomainResourceDialect,
19048                &mut self.flags,
19049                decoder,
19050                offset + 0,
19051                _depth
19052            )?;
19053            fidl::decode!(
19054                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19055                fdomain_client::fidl::FDomainResourceDialect,
19056                &mut self.object,
19057                decoder,
19058                offset + 4,
19059                _depth
19060            )?;
19061            Ok(())
19062        }
19063    }
19064
19065    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
19066        type Borrowed<'a> = &'a mut Self;
19067        fn take_or_borrow<'a>(
19068            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19069        ) -> Self::Borrowed<'a> {
19070            value
19071        }
19072    }
19073
19074    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
19075        type Owned = Self;
19076
19077        #[inline(always)]
19078        fn inline_align(_context: fidl::encoding::Context) -> usize {
19079            4
19080        }
19081
19082        #[inline(always)]
19083        fn inline_size(_context: fidl::encoding::Context) -> usize {
19084            4
19085        }
19086    }
19087
19088    unsafe impl
19089        fidl::encoding::Encode<
19090            NodeListExtendedAttributesRequest,
19091            fdomain_client::fidl::FDomainResourceDialect,
19092        > for &mut NodeListExtendedAttributesRequest
19093    {
19094        #[inline]
19095        unsafe fn encode(
19096            self,
19097            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19098            offset: usize,
19099            _depth: fidl::encoding::Depth,
19100        ) -> fidl::Result<()> {
19101            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19102            // Delegate to tuple encoding.
19103            fidl::encoding::Encode::<
19104                NodeListExtendedAttributesRequest,
19105                fdomain_client::fidl::FDomainResourceDialect,
19106            >::encode(
19107                (<fidl::encoding::Endpoint<
19108                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19109                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19110                    &mut self.iterator
19111                ),),
19112                encoder,
19113                offset,
19114                _depth,
19115            )
19116        }
19117    }
19118    unsafe impl<
19119        T0: fidl::encoding::Encode<
19120                fidl::encoding::Endpoint<
19121                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19122                >,
19123                fdomain_client::fidl::FDomainResourceDialect,
19124            >,
19125    >
19126        fidl::encoding::Encode<
19127            NodeListExtendedAttributesRequest,
19128            fdomain_client::fidl::FDomainResourceDialect,
19129        > for (T0,)
19130    {
19131        #[inline]
19132        unsafe fn encode(
19133            self,
19134            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19135            offset: usize,
19136            depth: fidl::encoding::Depth,
19137        ) -> fidl::Result<()> {
19138            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19139            // Zero out padding regions. There's no need to apply masks
19140            // because the unmasked parts will be overwritten by fields.
19141            // Write the fields.
19142            self.0.encode(encoder, offset + 0, depth)?;
19143            Ok(())
19144        }
19145    }
19146
19147    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19148        for NodeListExtendedAttributesRequest
19149    {
19150        #[inline(always)]
19151        fn new_empty() -> Self {
19152            Self {
19153                iterator: fidl::new_empty!(
19154                    fidl::encoding::Endpoint<
19155                        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19156                    >,
19157                    fdomain_client::fidl::FDomainResourceDialect
19158                ),
19159            }
19160        }
19161
19162        #[inline]
19163        unsafe fn decode(
19164            &mut self,
19165            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19166            offset: usize,
19167            _depth: fidl::encoding::Depth,
19168        ) -> fidl::Result<()> {
19169            decoder.debug_check_bounds::<Self>(offset);
19170            // Verify that padding bytes are zero.
19171            fidl::decode!(
19172                fidl::encoding::Endpoint<
19173                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19174                >,
19175                fdomain_client::fidl::FDomainResourceDialect,
19176                &mut self.iterator,
19177                decoder,
19178                offset + 0,
19179                _depth
19180            )?;
19181            Ok(())
19182        }
19183    }
19184
19185    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
19186        type Borrowed<'a> = &'a mut Self;
19187        fn take_or_borrow<'a>(
19188            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19189        ) -> Self::Borrowed<'a> {
19190            value
19191        }
19192    }
19193
19194    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
19195        type Owned = Self;
19196
19197        #[inline(always)]
19198        fn inline_align(_context: fidl::encoding::Context) -> usize {
19199            8
19200        }
19201
19202        #[inline(always)]
19203        fn inline_size(_context: fidl::encoding::Context) -> usize {
19204            24
19205        }
19206    }
19207
19208    unsafe impl
19209        fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19210        for &mut NodeOnOpenRequest
19211    {
19212        #[inline]
19213        unsafe fn encode(
19214            self,
19215            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19216            offset: usize,
19217            _depth: fidl::encoding::Depth,
19218        ) -> fidl::Result<()> {
19219            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19220            // Delegate to tuple encoding.
19221            fidl::encoding::Encode::<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19222                (
19223                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
19224                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
19225                ),
19226                encoder, offset, _depth
19227            )
19228        }
19229    }
19230    unsafe impl<
19231        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
19232        T1: fidl::encoding::Encode<
19233                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19234                fdomain_client::fidl::FDomainResourceDialect,
19235            >,
19236    > fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19237        for (T0, T1)
19238    {
19239        #[inline]
19240        unsafe fn encode(
19241            self,
19242            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19243            offset: usize,
19244            depth: fidl::encoding::Depth,
19245        ) -> fidl::Result<()> {
19246            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19247            // Zero out padding regions. There's no need to apply masks
19248            // because the unmasked parts will be overwritten by fields.
19249            unsafe {
19250                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19251                (ptr as *mut u64).write_unaligned(0);
19252            }
19253            // Write the fields.
19254            self.0.encode(encoder, offset + 0, depth)?;
19255            self.1.encode(encoder, offset + 8, depth)?;
19256            Ok(())
19257        }
19258    }
19259
19260    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19261        for NodeOnOpenRequest
19262    {
19263        #[inline(always)]
19264        fn new_empty() -> Self {
19265            Self {
19266                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
19267                info: fidl::new_empty!(
19268                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19269                    fdomain_client::fidl::FDomainResourceDialect
19270                ),
19271            }
19272        }
19273
19274        #[inline]
19275        unsafe fn decode(
19276            &mut self,
19277            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19278            offset: usize,
19279            _depth: fidl::encoding::Depth,
19280        ) -> fidl::Result<()> {
19281            decoder.debug_check_bounds::<Self>(offset);
19282            // Verify that padding bytes are zero.
19283            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19284            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19285            let mask = 0xffffffff00000000u64;
19286            let maskedval = padval & mask;
19287            if maskedval != 0 {
19288                return Err(fidl::Error::NonZeroPadding {
19289                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19290                });
19291            }
19292            fidl::decode!(
19293                i32,
19294                fdomain_client::fidl::FDomainResourceDialect,
19295                &mut self.s,
19296                decoder,
19297                offset + 0,
19298                _depth
19299            )?;
19300            fidl::decode!(
19301                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19302                fdomain_client::fidl::FDomainResourceDialect,
19303                &mut self.info,
19304                decoder,
19305                offset + 8,
19306                _depth
19307            )?;
19308            Ok(())
19309        }
19310    }
19311
19312    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
19313        type Borrowed<'a> = &'a mut Self;
19314        fn take_or_borrow<'a>(
19315            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19316        ) -> Self::Borrowed<'a> {
19317            value
19318        }
19319    }
19320
19321    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
19322        type Owned = Self;
19323
19324        #[inline(always)]
19325        fn inline_align(_context: fidl::encoding::Context) -> usize {
19326            8
19327        }
19328
19329        #[inline(always)]
19330        fn inline_size(_context: fidl::encoding::Context) -> usize {
19331            40
19332        }
19333    }
19334
19335    unsafe impl
19336        fidl::encoding::Encode<
19337            NodeSetExtendedAttributeRequest,
19338            fdomain_client::fidl::FDomainResourceDialect,
19339        > for &mut NodeSetExtendedAttributeRequest
19340    {
19341        #[inline]
19342        unsafe fn encode(
19343            self,
19344            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19345            offset: usize,
19346            _depth: fidl::encoding::Depth,
19347        ) -> fidl::Result<()> {
19348            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19349            // Delegate to tuple encoding.
19350            fidl::encoding::Encode::<
19351                NodeSetExtendedAttributeRequest,
19352                fdomain_client::fidl::FDomainResourceDialect,
19353            >::encode(
19354                (
19355                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
19356                        &self.name,
19357                    ),
19358                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19359                        &mut self.value,
19360                    ),
19361                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
19362                        &self.mode,
19363                    ),
19364                ),
19365                encoder,
19366                offset,
19367                _depth,
19368            )
19369        }
19370    }
19371    unsafe impl<
19372        T0: fidl::encoding::Encode<
19373                fidl::encoding::Vector<u8, 255>,
19374                fdomain_client::fidl::FDomainResourceDialect,
19375            >,
19376        T1: fidl::encoding::Encode<
19377                ExtendedAttributeValue,
19378                fdomain_client::fidl::FDomainResourceDialect,
19379            >,
19380        T2: fidl::encoding::Encode<
19381                SetExtendedAttributeMode,
19382                fdomain_client::fidl::FDomainResourceDialect,
19383            >,
19384    >
19385        fidl::encoding::Encode<
19386            NodeSetExtendedAttributeRequest,
19387            fdomain_client::fidl::FDomainResourceDialect,
19388        > for (T0, T1, T2)
19389    {
19390        #[inline]
19391        unsafe fn encode(
19392            self,
19393            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19394            offset: usize,
19395            depth: fidl::encoding::Depth,
19396        ) -> fidl::Result<()> {
19397            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19398            // Zero out padding regions. There's no need to apply masks
19399            // because the unmasked parts will be overwritten by fields.
19400            unsafe {
19401                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
19402                (ptr as *mut u64).write_unaligned(0);
19403            }
19404            // Write the fields.
19405            self.0.encode(encoder, offset + 0, depth)?;
19406            self.1.encode(encoder, offset + 16, depth)?;
19407            self.2.encode(encoder, offset + 32, depth)?;
19408            Ok(())
19409        }
19410    }
19411
19412    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19413        for NodeSetExtendedAttributeRequest
19414    {
19415        #[inline(always)]
19416        fn new_empty() -> Self {
19417            Self {
19418                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect),
19419                value: fidl::new_empty!(
19420                    ExtendedAttributeValue,
19421                    fdomain_client::fidl::FDomainResourceDialect
19422                ),
19423                mode: fidl::new_empty!(
19424                    SetExtendedAttributeMode,
19425                    fdomain_client::fidl::FDomainResourceDialect
19426                ),
19427            }
19428        }
19429
19430        #[inline]
19431        unsafe fn decode(
19432            &mut self,
19433            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19434            offset: usize,
19435            _depth: fidl::encoding::Depth,
19436        ) -> fidl::Result<()> {
19437            decoder.debug_check_bounds::<Self>(offset);
19438            // Verify that padding bytes are zero.
19439            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
19440            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19441            let mask = 0xffffffff00000000u64;
19442            let maskedval = padval & mask;
19443            if maskedval != 0 {
19444                return Err(fidl::Error::NonZeroPadding {
19445                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
19446                });
19447            }
19448            fidl::decode!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
19449            fidl::decode!(
19450                ExtendedAttributeValue,
19451                fdomain_client::fidl::FDomainResourceDialect,
19452                &mut self.value,
19453                decoder,
19454                offset + 16,
19455                _depth
19456            )?;
19457            fidl::decode!(
19458                SetExtendedAttributeMode,
19459                fdomain_client::fidl::FDomainResourceDialect,
19460                &mut self.mode,
19461                decoder,
19462                offset + 32,
19463                _depth
19464            )?;
19465            Ok(())
19466        }
19467    }
19468
19469    impl ConnectionInfo {
19470        #[inline(always)]
19471        fn max_ordinal_present(&self) -> u64 {
19472            if let Some(_) = self.rights {
19473                return 1;
19474            }
19475            0
19476        }
19477    }
19478
19479    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
19480        type Borrowed<'a> = &'a mut Self;
19481        fn take_or_borrow<'a>(
19482            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19483        ) -> Self::Borrowed<'a> {
19484            value
19485        }
19486    }
19487
19488    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
19489        type Owned = Self;
19490
19491        #[inline(always)]
19492        fn inline_align(_context: fidl::encoding::Context) -> usize {
19493            8
19494        }
19495
19496        #[inline(always)]
19497        fn inline_size(_context: fidl::encoding::Context) -> usize {
19498            16
19499        }
19500    }
19501
19502    unsafe impl fidl::encoding::Encode<ConnectionInfo, fdomain_client::fidl::FDomainResourceDialect>
19503        for &mut ConnectionInfo
19504    {
19505        unsafe fn encode(
19506            self,
19507            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19508            offset: usize,
19509            mut depth: fidl::encoding::Depth,
19510        ) -> fidl::Result<()> {
19511            encoder.debug_check_bounds::<ConnectionInfo>(offset);
19512            // Vector header
19513            let max_ordinal: u64 = self.max_ordinal_present();
19514            encoder.write_num(max_ordinal, offset);
19515            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19516            // Calling encoder.out_of_line_offset(0) is not allowed.
19517            if max_ordinal == 0 {
19518                return Ok(());
19519            }
19520            depth.increment()?;
19521            let envelope_size = 8;
19522            let bytes_len = max_ordinal as usize * envelope_size;
19523            #[allow(unused_variables)]
19524            let offset = encoder.out_of_line_offset(bytes_len);
19525            let mut _prev_end_offset: usize = 0;
19526            if 1 > max_ordinal {
19527                return Ok(());
19528            }
19529
19530            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19531            // are envelope_size bytes.
19532            let cur_offset: usize = (1 - 1) * envelope_size;
19533
19534            // Zero reserved fields.
19535            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19536
19537            // Safety:
19538            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19539            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19540            //   envelope_size bytes, there is always sufficient room.
19541            fidl::encoding::encode_in_envelope_optional::<
19542                Operations,
19543                fdomain_client::fidl::FDomainResourceDialect,
19544            >(
19545                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
19546                encoder,
19547                offset + cur_offset,
19548                depth,
19549            )?;
19550
19551            _prev_end_offset = cur_offset + envelope_size;
19552
19553            Ok(())
19554        }
19555    }
19556
19557    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {
19558        #[inline(always)]
19559        fn new_empty() -> Self {
19560            Self::default()
19561        }
19562
19563        unsafe fn decode(
19564            &mut self,
19565            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19566            offset: usize,
19567            mut depth: fidl::encoding::Depth,
19568        ) -> fidl::Result<()> {
19569            decoder.debug_check_bounds::<Self>(offset);
19570            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19571                None => return Err(fidl::Error::NotNullable),
19572                Some(len) => len,
19573            };
19574            // Calling decoder.out_of_line_offset(0) is not allowed.
19575            if len == 0 {
19576                return Ok(());
19577            };
19578            depth.increment()?;
19579            let envelope_size = 8;
19580            let bytes_len = len * envelope_size;
19581            let offset = decoder.out_of_line_offset(bytes_len)?;
19582            // Decode the envelope for each type.
19583            let mut _next_ordinal_to_read = 0;
19584            let mut next_offset = offset;
19585            let end_offset = offset + bytes_len;
19586            _next_ordinal_to_read += 1;
19587            if next_offset >= end_offset {
19588                return Ok(());
19589            }
19590
19591            // Decode unknown envelopes for gaps in ordinals.
19592            while _next_ordinal_to_read < 1 {
19593                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19594                _next_ordinal_to_read += 1;
19595                next_offset += envelope_size;
19596            }
19597
19598            let next_out_of_line = decoder.next_out_of_line();
19599            let handles_before = decoder.remaining_handles();
19600            if let Some((inlined, num_bytes, num_handles)) =
19601                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19602            {
19603                let member_inline_size =
19604                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19605                if inlined != (member_inline_size <= 4) {
19606                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19607                }
19608                let inner_offset;
19609                let mut inner_depth = depth.clone();
19610                if inlined {
19611                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19612                    inner_offset = next_offset;
19613                } else {
19614                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19615                    inner_depth.increment()?;
19616                }
19617                let val_ref = self.rights.get_or_insert_with(|| {
19618                    fidl::new_empty!(Operations, fdomain_client::fidl::FDomainResourceDialect)
19619                });
19620                fidl::decode!(
19621                    Operations,
19622                    fdomain_client::fidl::FDomainResourceDialect,
19623                    val_ref,
19624                    decoder,
19625                    inner_offset,
19626                    inner_depth
19627                )?;
19628                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19629                {
19630                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19631                }
19632                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19633                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19634                }
19635            }
19636
19637            next_offset += envelope_size;
19638
19639            // Decode the remaining unknown envelopes.
19640            while next_offset < end_offset {
19641                _next_ordinal_to_read += 1;
19642                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19643                next_offset += envelope_size;
19644            }
19645
19646            Ok(())
19647        }
19648    }
19649
19650    impl FileInfo {
19651        #[inline(always)]
19652        fn max_ordinal_present(&self) -> u64 {
19653            if let Some(_) = self.attributes {
19654                return 4;
19655            }
19656            if let Some(_) = self.stream {
19657                return 3;
19658            }
19659            if let Some(_) = self.observer {
19660                return 2;
19661            }
19662            if let Some(_) = self.is_append {
19663                return 1;
19664            }
19665            0
19666        }
19667    }
19668
19669    impl fidl::encoding::ResourceTypeMarker for FileInfo {
19670        type Borrowed<'a> = &'a mut Self;
19671        fn take_or_borrow<'a>(
19672            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19673        ) -> Self::Borrowed<'a> {
19674            value
19675        }
19676    }
19677
19678    unsafe impl fidl::encoding::TypeMarker for FileInfo {
19679        type Owned = Self;
19680
19681        #[inline(always)]
19682        fn inline_align(_context: fidl::encoding::Context) -> usize {
19683            8
19684        }
19685
19686        #[inline(always)]
19687        fn inline_size(_context: fidl::encoding::Context) -> usize {
19688            16
19689        }
19690    }
19691
19692    unsafe impl fidl::encoding::Encode<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
19693        for &mut FileInfo
19694    {
19695        unsafe fn encode(
19696            self,
19697            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19698            offset: usize,
19699            mut depth: fidl::encoding::Depth,
19700        ) -> fidl::Result<()> {
19701            encoder.debug_check_bounds::<FileInfo>(offset);
19702            // Vector header
19703            let max_ordinal: u64 = self.max_ordinal_present();
19704            encoder.write_num(max_ordinal, offset);
19705            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19706            // Calling encoder.out_of_line_offset(0) is not allowed.
19707            if max_ordinal == 0 {
19708                return Ok(());
19709            }
19710            depth.increment()?;
19711            let envelope_size = 8;
19712            let bytes_len = max_ordinal as usize * envelope_size;
19713            #[allow(unused_variables)]
19714            let offset = encoder.out_of_line_offset(bytes_len);
19715            let mut _prev_end_offset: usize = 0;
19716            if 1 > max_ordinal {
19717                return Ok(());
19718            }
19719
19720            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19721            // are envelope_size bytes.
19722            let cur_offset: usize = (1 - 1) * envelope_size;
19723
19724            // Zero reserved fields.
19725            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19726
19727            // Safety:
19728            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19729            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19730            //   envelope_size bytes, there is always sufficient room.
19731            fidl::encoding::encode_in_envelope_optional::<
19732                bool,
19733                fdomain_client::fidl::FDomainResourceDialect,
19734            >(
19735                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19736                encoder,
19737                offset + cur_offset,
19738                depth,
19739            )?;
19740
19741            _prev_end_offset = cur_offset + envelope_size;
19742            if 2 > max_ordinal {
19743                return Ok(());
19744            }
19745
19746            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19747            // are envelope_size bytes.
19748            let cur_offset: usize = (2 - 1) * envelope_size;
19749
19750            // Zero reserved fields.
19751            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19752
19753            // Safety:
19754            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19755            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19756            //   envelope_size bytes, there is always sufficient room.
19757            fidl::encoding::encode_in_envelope_optional::<
19758                fidl::encoding::HandleType<
19759                    fdomain_client::Event,
19760                    { fidl::ObjectType::EVENT.into_raw() },
19761                    2147483648,
19762                >,
19763                fdomain_client::fidl::FDomainResourceDialect,
19764            >(
19765                self.observer.as_mut().map(
19766                    <fidl::encoding::HandleType<
19767                        fdomain_client::Event,
19768                        { fidl::ObjectType::EVENT.into_raw() },
19769                        2147483648,
19770                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
19771                ),
19772                encoder,
19773                offset + cur_offset,
19774                depth,
19775            )?;
19776
19777            _prev_end_offset = cur_offset + envelope_size;
19778            if 3 > max_ordinal {
19779                return Ok(());
19780            }
19781
19782            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19783            // are envelope_size bytes.
19784            let cur_offset: usize = (3 - 1) * envelope_size;
19785
19786            // Zero reserved fields.
19787            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19788
19789            // Safety:
19790            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19791            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19792            //   envelope_size bytes, there is always sufficient room.
19793            fidl::encoding::encode_in_envelope_optional::<
19794                fidl::encoding::HandleType<
19795                    fdomain_client::Stream,
19796                    { fidl::ObjectType::STREAM.into_raw() },
19797                    2147483648,
19798                >,
19799                fdomain_client::fidl::FDomainResourceDialect,
19800            >(
19801                self.stream.as_mut().map(
19802                    <fidl::encoding::HandleType<
19803                        fdomain_client::Stream,
19804                        { fidl::ObjectType::STREAM.into_raw() },
19805                        2147483648,
19806                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
19807                ),
19808                encoder,
19809                offset + cur_offset,
19810                depth,
19811            )?;
19812
19813            _prev_end_offset = cur_offset + envelope_size;
19814            if 4 > max_ordinal {
19815                return Ok(());
19816            }
19817
19818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19819            // are envelope_size bytes.
19820            let cur_offset: usize = (4 - 1) * envelope_size;
19821
19822            // Zero reserved fields.
19823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19824
19825            // Safety:
19826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19828            //   envelope_size bytes, there is always sufficient room.
19829            fidl::encoding::encode_in_envelope_optional::<
19830                NodeAttributes2,
19831                fdomain_client::fidl::FDomainResourceDialect,
19832            >(
19833                self.attributes
19834                    .as_ref()
19835                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
19836                encoder,
19837                offset + cur_offset,
19838                depth,
19839            )?;
19840
19841            _prev_end_offset = cur_offset + envelope_size;
19842
19843            Ok(())
19844        }
19845    }
19846
19847    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileInfo {
19848        #[inline(always)]
19849        fn new_empty() -> Self {
19850            Self::default()
19851        }
19852
19853        unsafe fn decode(
19854            &mut self,
19855            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19856            offset: usize,
19857            mut depth: fidl::encoding::Depth,
19858        ) -> fidl::Result<()> {
19859            decoder.debug_check_bounds::<Self>(offset);
19860            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19861                None => return Err(fidl::Error::NotNullable),
19862                Some(len) => len,
19863            };
19864            // Calling decoder.out_of_line_offset(0) is not allowed.
19865            if len == 0 {
19866                return Ok(());
19867            };
19868            depth.increment()?;
19869            let envelope_size = 8;
19870            let bytes_len = len * envelope_size;
19871            let offset = decoder.out_of_line_offset(bytes_len)?;
19872            // Decode the envelope for each type.
19873            let mut _next_ordinal_to_read = 0;
19874            let mut next_offset = offset;
19875            let end_offset = offset + bytes_len;
19876            _next_ordinal_to_read += 1;
19877            if next_offset >= end_offset {
19878                return Ok(());
19879            }
19880
19881            // Decode unknown envelopes for gaps in ordinals.
19882            while _next_ordinal_to_read < 1 {
19883                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19884                _next_ordinal_to_read += 1;
19885                next_offset += envelope_size;
19886            }
19887
19888            let next_out_of_line = decoder.next_out_of_line();
19889            let handles_before = decoder.remaining_handles();
19890            if let Some((inlined, num_bytes, num_handles)) =
19891                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19892            {
19893                let member_inline_size =
19894                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19895                if inlined != (member_inline_size <= 4) {
19896                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19897                }
19898                let inner_offset;
19899                let mut inner_depth = depth.clone();
19900                if inlined {
19901                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19902                    inner_offset = next_offset;
19903                } else {
19904                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19905                    inner_depth.increment()?;
19906                }
19907                let val_ref = self.is_append.get_or_insert_with(|| {
19908                    fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect)
19909                });
19910                fidl::decode!(
19911                    bool,
19912                    fdomain_client::fidl::FDomainResourceDialect,
19913                    val_ref,
19914                    decoder,
19915                    inner_offset,
19916                    inner_depth
19917                )?;
19918                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19919                {
19920                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19921                }
19922                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19923                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19924                }
19925            }
19926
19927            next_offset += envelope_size;
19928            _next_ordinal_to_read += 1;
19929            if next_offset >= end_offset {
19930                return Ok(());
19931            }
19932
19933            // Decode unknown envelopes for gaps in ordinals.
19934            while _next_ordinal_to_read < 2 {
19935                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19936                _next_ordinal_to_read += 1;
19937                next_offset += envelope_size;
19938            }
19939
19940            let next_out_of_line = decoder.next_out_of_line();
19941            let handles_before = decoder.remaining_handles();
19942            if let Some((inlined, num_bytes, num_handles)) =
19943                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19944            {
19945                let member_inline_size = <fidl::encoding::HandleType<
19946                    fdomain_client::Event,
19947                    { fidl::ObjectType::EVENT.into_raw() },
19948                    2147483648,
19949                > as fidl::encoding::TypeMarker>::inline_size(
19950                    decoder.context
19951                );
19952                if inlined != (member_inline_size <= 4) {
19953                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19954                }
19955                let inner_offset;
19956                let mut inner_depth = depth.clone();
19957                if inlined {
19958                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19959                    inner_offset = next_offset;
19960                } else {
19961                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19962                    inner_depth.increment()?;
19963                }
19964                let val_ref =
19965                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));
19966                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)?;
19967                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19968                {
19969                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19970                }
19971                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19972                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19973                }
19974            }
19975
19976            next_offset += envelope_size;
19977            _next_ordinal_to_read += 1;
19978            if next_offset >= end_offset {
19979                return Ok(());
19980            }
19981
19982            // Decode unknown envelopes for gaps in ordinals.
19983            while _next_ordinal_to_read < 3 {
19984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19985                _next_ordinal_to_read += 1;
19986                next_offset += envelope_size;
19987            }
19988
19989            let next_out_of_line = decoder.next_out_of_line();
19990            let handles_before = decoder.remaining_handles();
19991            if let Some((inlined, num_bytes, num_handles)) =
19992                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19993            {
19994                let member_inline_size = <fidl::encoding::HandleType<
19995                    fdomain_client::Stream,
19996                    { fidl::ObjectType::STREAM.into_raw() },
19997                    2147483648,
19998                > as fidl::encoding::TypeMarker>::inline_size(
19999                    decoder.context
20000                );
20001                if inlined != (member_inline_size <= 4) {
20002                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20003                }
20004                let inner_offset;
20005                let mut inner_depth = depth.clone();
20006                if inlined {
20007                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20008                    inner_offset = next_offset;
20009                } else {
20010                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20011                    inner_depth.increment()?;
20012                }
20013                let val_ref =
20014                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));
20015                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)?;
20016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20017                {
20018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20019                }
20020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20022                }
20023            }
20024
20025            next_offset += envelope_size;
20026            _next_ordinal_to_read += 1;
20027            if next_offset >= end_offset {
20028                return Ok(());
20029            }
20030
20031            // Decode unknown envelopes for gaps in ordinals.
20032            while _next_ordinal_to_read < 4 {
20033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20034                _next_ordinal_to_read += 1;
20035                next_offset += envelope_size;
20036            }
20037
20038            let next_out_of_line = decoder.next_out_of_line();
20039            let handles_before = decoder.remaining_handles();
20040            if let Some((inlined, num_bytes, num_handles)) =
20041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20042            {
20043                let member_inline_size =
20044                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20045                if inlined != (member_inline_size <= 4) {
20046                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20047                }
20048                let inner_offset;
20049                let mut inner_depth = depth.clone();
20050                if inlined {
20051                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20052                    inner_offset = next_offset;
20053                } else {
20054                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20055                    inner_depth.increment()?;
20056                }
20057                let val_ref = self.attributes.get_or_insert_with(|| {
20058                    fidl::new_empty!(NodeAttributes2, fdomain_client::fidl::FDomainResourceDialect)
20059                });
20060                fidl::decode!(
20061                    NodeAttributes2,
20062                    fdomain_client::fidl::FDomainResourceDialect,
20063                    val_ref,
20064                    decoder,
20065                    inner_offset,
20066                    inner_depth
20067                )?;
20068                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20069                {
20070                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20071                }
20072                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20073                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20074                }
20075            }
20076
20077            next_offset += envelope_size;
20078
20079            // Decode the remaining unknown envelopes.
20080            while next_offset < end_offset {
20081                _next_ordinal_to_read += 1;
20082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20083                next_offset += envelope_size;
20084            }
20085
20086            Ok(())
20087        }
20088    }
20089
20090    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
20091        type Borrowed<'a> = &'a mut Self;
20092        fn take_or_borrow<'a>(
20093            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20094        ) -> Self::Borrowed<'a> {
20095            value
20096        }
20097    }
20098
20099    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
20100        type Owned = Self;
20101
20102        #[inline(always)]
20103        fn inline_align(_context: fidl::encoding::Context) -> usize {
20104            8
20105        }
20106
20107        #[inline(always)]
20108        fn inline_size(_context: fidl::encoding::Context) -> usize {
20109            16
20110        }
20111    }
20112
20113    unsafe impl
20114        fidl::encoding::Encode<ExtendedAttributeValue, fdomain_client::fidl::FDomainResourceDialect>
20115        for &mut ExtendedAttributeValue
20116    {
20117        #[inline]
20118        unsafe fn encode(
20119            self,
20120            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20121            offset: usize,
20122            _depth: fidl::encoding::Depth,
20123        ) -> fidl::Result<()> {
20124            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
20125            encoder.write_num::<u64>(self.ordinal(), offset);
20126            match self {
20127                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
20128                    fidl::encoding::Vector<u8, 32768>,
20129                    fdomain_client::fidl::FDomainResourceDialect,
20130                >(
20131                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
20132                        val,
20133                    ),
20134                    encoder,
20135                    offset + 8,
20136                    _depth,
20137                ),
20138                ExtendedAttributeValue::Buffer(ref mut val) => {
20139                    fidl::encoding::encode_in_envelope::<
20140                        fidl::encoding::HandleType<
20141                            fdomain_client::Vmo,
20142                            { fidl::ObjectType::VMO.into_raw() },
20143                            2147483648,
20144                        >,
20145                        fdomain_client::fidl::FDomainResourceDialect,
20146                    >(
20147                        <fidl::encoding::HandleType<
20148                            fdomain_client::Vmo,
20149                            { fidl::ObjectType::VMO.into_raw() },
20150                            2147483648,
20151                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20152                            val
20153                        ),
20154                        encoder,
20155                        offset + 8,
20156                        _depth,
20157                    )
20158                }
20159                ExtendedAttributeValue::__SourceBreaking { .. } => {
20160                    Err(fidl::Error::UnknownUnionTag)
20161                }
20162            }
20163        }
20164    }
20165
20166    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20167        for ExtendedAttributeValue
20168    {
20169        #[inline(always)]
20170        fn new_empty() -> Self {
20171            Self::__SourceBreaking { unknown_ordinal: 0 }
20172        }
20173
20174        #[inline]
20175        unsafe fn decode(
20176            &mut self,
20177            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20178            offset: usize,
20179            mut depth: fidl::encoding::Depth,
20180        ) -> fidl::Result<()> {
20181            decoder.debug_check_bounds::<Self>(offset);
20182            #[allow(unused_variables)]
20183            let next_out_of_line = decoder.next_out_of_line();
20184            let handles_before = decoder.remaining_handles();
20185            let (ordinal, inlined, num_bytes, num_handles) =
20186                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20187
20188            let member_inline_size = match ordinal {
20189                1 => {
20190                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
20191                        decoder.context,
20192                    )
20193                }
20194                2 => <fidl::encoding::HandleType<
20195                    fdomain_client::Vmo,
20196                    { fidl::ObjectType::VMO.into_raw() },
20197                    2147483648,
20198                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20199                0 => return Err(fidl::Error::UnknownUnionTag),
20200                _ => num_bytes as usize,
20201            };
20202
20203            if inlined != (member_inline_size <= 4) {
20204                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20205            }
20206            let _inner_offset;
20207            if inlined {
20208                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20209                _inner_offset = offset + 8;
20210            } else {
20211                depth.increment()?;
20212                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20213            }
20214            match ordinal {
20215                1 => {
20216                    #[allow(irrefutable_let_patterns)]
20217                    if let ExtendedAttributeValue::Bytes(_) = self {
20218                        // Do nothing, read the value into the object
20219                    } else {
20220                        // Initialize `self` to the right variant
20221                        *self = ExtendedAttributeValue::Bytes(
20222                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect),
20223                        );
20224                    }
20225                    #[allow(irrefutable_let_patterns)]
20226                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
20227                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20228                    } else {
20229                        unreachable!()
20230                    }
20231                }
20232                2 => {
20233                    #[allow(irrefutable_let_patterns)]
20234                    if let ExtendedAttributeValue::Buffer(_) = self {
20235                        // Do nothing, read the value into the object
20236                    } else {
20237                        // Initialize `self` to the right variant
20238                        *self = ExtendedAttributeValue::Buffer(
20239                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20240                        );
20241                    }
20242                    #[allow(irrefutable_let_patterns)]
20243                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
20244                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20245                    } else {
20246                        unreachable!()
20247                    }
20248                }
20249                #[allow(deprecated)]
20250                ordinal => {
20251                    for _ in 0..num_handles {
20252                        decoder.drop_next_handle()?;
20253                    }
20254                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
20255                }
20256            }
20257            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20258                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20259            }
20260            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20261                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20262            }
20263            Ok(())
20264        }
20265    }
20266
20267    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
20268        type Borrowed<'a> = &'a mut Self;
20269        fn take_or_borrow<'a>(
20270            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20271        ) -> Self::Borrowed<'a> {
20272            value
20273        }
20274    }
20275
20276    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
20277        type Owned = Self;
20278
20279        #[inline(always)]
20280        fn inline_align(_context: fidl::encoding::Context) -> usize {
20281            8
20282        }
20283
20284        #[inline(always)]
20285        fn inline_size(_context: fidl::encoding::Context) -> usize {
20286            16
20287        }
20288    }
20289
20290    unsafe impl
20291        fidl::encoding::Encode<NodeInfoDeprecated, fdomain_client::fidl::FDomainResourceDialect>
20292        for &mut NodeInfoDeprecated
20293    {
20294        #[inline]
20295        unsafe fn encode(
20296            self,
20297            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20298            offset: usize,
20299            _depth: fidl::encoding::Depth,
20300        ) -> fidl::Result<()> {
20301            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
20302            encoder.write_num::<u64>(self.ordinal(), offset);
20303            match self {
20304                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
20305                    Service,
20306                    fdomain_client::fidl::FDomainResourceDialect,
20307                >(
20308                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
20309                    encoder,
20310                    offset + 8,
20311                    _depth,
20312                ),
20313                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20314                    FileObject,
20315                    fdomain_client::fidl::FDomainResourceDialect,
20316                >(
20317                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20318                    encoder,
20319                    offset + 8,
20320                    _depth,
20321                ),
20322                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20323                    DirectoryObject,
20324                    fdomain_client::fidl::FDomainResourceDialect,
20325                >(
20326                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20327                    encoder,
20328                    offset + 8,
20329                    _depth,
20330                ),
20331                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20332                    SymlinkObject,
20333                    fdomain_client::fidl::FDomainResourceDialect,
20334                >(
20335                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20336                    encoder,
20337                    offset + 8,
20338                    _depth,
20339                ),
20340            }
20341        }
20342    }
20343
20344    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20345        for NodeInfoDeprecated
20346    {
20347        #[inline(always)]
20348        fn new_empty() -> Self {
20349            Self::Service(fidl::new_empty!(Service, fdomain_client::fidl::FDomainResourceDialect))
20350        }
20351
20352        #[inline]
20353        unsafe fn decode(
20354            &mut self,
20355            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20356            offset: usize,
20357            mut depth: fidl::encoding::Depth,
20358        ) -> fidl::Result<()> {
20359            decoder.debug_check_bounds::<Self>(offset);
20360            #[allow(unused_variables)]
20361            let next_out_of_line = decoder.next_out_of_line();
20362            let handles_before = decoder.remaining_handles();
20363            let (ordinal, inlined, num_bytes, num_handles) =
20364                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20365
20366            let member_inline_size = match ordinal {
20367                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20368                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20369                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20370                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20371                _ => return Err(fidl::Error::UnknownUnionTag),
20372            };
20373
20374            if inlined != (member_inline_size <= 4) {
20375                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20376            }
20377            let _inner_offset;
20378            if inlined {
20379                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20380                _inner_offset = offset + 8;
20381            } else {
20382                depth.increment()?;
20383                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20384            }
20385            match ordinal {
20386                1 => {
20387                    #[allow(irrefutable_let_patterns)]
20388                    if let NodeInfoDeprecated::Service(_) = self {
20389                        // Do nothing, read the value into the object
20390                    } else {
20391                        // Initialize `self` to the right variant
20392                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
20393                            Service,
20394                            fdomain_client::fidl::FDomainResourceDialect
20395                        ));
20396                    }
20397                    #[allow(irrefutable_let_patterns)]
20398                    if let NodeInfoDeprecated::Service(ref mut val) = self {
20399                        fidl::decode!(
20400                            Service,
20401                            fdomain_client::fidl::FDomainResourceDialect,
20402                            val,
20403                            decoder,
20404                            _inner_offset,
20405                            depth
20406                        )?;
20407                    } else {
20408                        unreachable!()
20409                    }
20410                }
20411                2 => {
20412                    #[allow(irrefutable_let_patterns)]
20413                    if let NodeInfoDeprecated::File(_) = self {
20414                        // Do nothing, read the value into the object
20415                    } else {
20416                        // Initialize `self` to the right variant
20417                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
20418                            FileObject,
20419                            fdomain_client::fidl::FDomainResourceDialect
20420                        ));
20421                    }
20422                    #[allow(irrefutable_let_patterns)]
20423                    if let NodeInfoDeprecated::File(ref mut val) = self {
20424                        fidl::decode!(
20425                            FileObject,
20426                            fdomain_client::fidl::FDomainResourceDialect,
20427                            val,
20428                            decoder,
20429                            _inner_offset,
20430                            depth
20431                        )?;
20432                    } else {
20433                        unreachable!()
20434                    }
20435                }
20436                3 => {
20437                    #[allow(irrefutable_let_patterns)]
20438                    if let NodeInfoDeprecated::Directory(_) = self {
20439                        // Do nothing, read the value into the object
20440                    } else {
20441                        // Initialize `self` to the right variant
20442                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
20443                            DirectoryObject,
20444                            fdomain_client::fidl::FDomainResourceDialect
20445                        ));
20446                    }
20447                    #[allow(irrefutable_let_patterns)]
20448                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
20449                        fidl::decode!(
20450                            DirectoryObject,
20451                            fdomain_client::fidl::FDomainResourceDialect,
20452                            val,
20453                            decoder,
20454                            _inner_offset,
20455                            depth
20456                        )?;
20457                    } else {
20458                        unreachable!()
20459                    }
20460                }
20461                4 => {
20462                    #[allow(irrefutable_let_patterns)]
20463                    if let NodeInfoDeprecated::Symlink(_) = self {
20464                        // Do nothing, read the value into the object
20465                    } else {
20466                        // Initialize `self` to the right variant
20467                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
20468                            SymlinkObject,
20469                            fdomain_client::fidl::FDomainResourceDialect
20470                        ));
20471                    }
20472                    #[allow(irrefutable_let_patterns)]
20473                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
20474                        fidl::decode!(
20475                            SymlinkObject,
20476                            fdomain_client::fidl::FDomainResourceDialect,
20477                            val,
20478                            decoder,
20479                            _inner_offset,
20480                            depth
20481                        )?;
20482                    } else {
20483                        unreachable!()
20484                    }
20485                }
20486                ordinal => panic!("unexpected ordinal {:?}", ordinal),
20487            }
20488            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20489                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20490            }
20491            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20492                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20493            }
20494            Ok(())
20495        }
20496    }
20497
20498    impl fidl::encoding::ResourceTypeMarker for Representation {
20499        type Borrowed<'a> = &'a mut Self;
20500        fn take_or_borrow<'a>(
20501            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20502        ) -> Self::Borrowed<'a> {
20503            value
20504        }
20505    }
20506
20507    unsafe impl fidl::encoding::TypeMarker for Representation {
20508        type Owned = Self;
20509
20510        #[inline(always)]
20511        fn inline_align(_context: fidl::encoding::Context) -> usize {
20512            8
20513        }
20514
20515        #[inline(always)]
20516        fn inline_size(_context: fidl::encoding::Context) -> usize {
20517            16
20518        }
20519    }
20520
20521    unsafe impl fidl::encoding::Encode<Representation, fdomain_client::fidl::FDomainResourceDialect>
20522        for &mut Representation
20523    {
20524        #[inline]
20525        unsafe fn encode(
20526            self,
20527            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20528            offset: usize,
20529            _depth: fidl::encoding::Depth,
20530        ) -> fidl::Result<()> {
20531            encoder.debug_check_bounds::<Representation>(offset);
20532            encoder.write_num::<u64>(self.ordinal(), offset);
20533            match self {
20534                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
20535                    NodeInfo,
20536                    fdomain_client::fidl::FDomainResourceDialect,
20537                >(
20538                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20539                    encoder,
20540                    offset + 8,
20541                    _depth,
20542                ),
20543                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20544                    DirectoryInfo,
20545                    fdomain_client::fidl::FDomainResourceDialect,
20546                >(
20547                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20548                    encoder,
20549                    offset + 8,
20550                    _depth,
20551                ),
20552                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20553                    FileInfo,
20554                    fdomain_client::fidl::FDomainResourceDialect,
20555                >(
20556                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20557                    encoder,
20558                    offset + 8,
20559                    _depth,
20560                ),
20561                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20562                    SymlinkInfo,
20563                    fdomain_client::fidl::FDomainResourceDialect,
20564                >(
20565                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20566                    encoder,
20567                    offset + 8,
20568                    _depth,
20569                ),
20570                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
20571            }
20572        }
20573    }
20574
20575    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Representation {
20576        #[inline(always)]
20577        fn new_empty() -> Self {
20578            Self::__SourceBreaking { unknown_ordinal: 0 }
20579        }
20580
20581        #[inline]
20582        unsafe fn decode(
20583            &mut self,
20584            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20585            offset: usize,
20586            mut depth: fidl::encoding::Depth,
20587        ) -> fidl::Result<()> {
20588            decoder.debug_check_bounds::<Self>(offset);
20589            #[allow(unused_variables)]
20590            let next_out_of_line = decoder.next_out_of_line();
20591            let handles_before = decoder.remaining_handles();
20592            let (ordinal, inlined, num_bytes, num_handles) =
20593                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20594
20595            let member_inline_size = match ordinal {
20596                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20597                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20598                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20599                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20600                0 => return Err(fidl::Error::UnknownUnionTag),
20601                _ => num_bytes as usize,
20602            };
20603
20604            if inlined != (member_inline_size <= 4) {
20605                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20606            }
20607            let _inner_offset;
20608            if inlined {
20609                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20610                _inner_offset = offset + 8;
20611            } else {
20612                depth.increment()?;
20613                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20614            }
20615            match ordinal {
20616                1 => {
20617                    #[allow(irrefutable_let_patterns)]
20618                    if let Representation::Node(_) = self {
20619                        // Do nothing, read the value into the object
20620                    } else {
20621                        // Initialize `self` to the right variant
20622                        *self = Representation::Node(fidl::new_empty!(
20623                            NodeInfo,
20624                            fdomain_client::fidl::FDomainResourceDialect
20625                        ));
20626                    }
20627                    #[allow(irrefutable_let_patterns)]
20628                    if let Representation::Node(ref mut val) = self {
20629                        fidl::decode!(
20630                            NodeInfo,
20631                            fdomain_client::fidl::FDomainResourceDialect,
20632                            val,
20633                            decoder,
20634                            _inner_offset,
20635                            depth
20636                        )?;
20637                    } else {
20638                        unreachable!()
20639                    }
20640                }
20641                2 => {
20642                    #[allow(irrefutable_let_patterns)]
20643                    if let Representation::Directory(_) = self {
20644                        // Do nothing, read the value into the object
20645                    } else {
20646                        // Initialize `self` to the right variant
20647                        *self = Representation::Directory(fidl::new_empty!(
20648                            DirectoryInfo,
20649                            fdomain_client::fidl::FDomainResourceDialect
20650                        ));
20651                    }
20652                    #[allow(irrefutable_let_patterns)]
20653                    if let Representation::Directory(ref mut val) = self {
20654                        fidl::decode!(
20655                            DirectoryInfo,
20656                            fdomain_client::fidl::FDomainResourceDialect,
20657                            val,
20658                            decoder,
20659                            _inner_offset,
20660                            depth
20661                        )?;
20662                    } else {
20663                        unreachable!()
20664                    }
20665                }
20666                3 => {
20667                    #[allow(irrefutable_let_patterns)]
20668                    if let Representation::File(_) = self {
20669                        // Do nothing, read the value into the object
20670                    } else {
20671                        // Initialize `self` to the right variant
20672                        *self = Representation::File(fidl::new_empty!(
20673                            FileInfo,
20674                            fdomain_client::fidl::FDomainResourceDialect
20675                        ));
20676                    }
20677                    #[allow(irrefutable_let_patterns)]
20678                    if let Representation::File(ref mut val) = self {
20679                        fidl::decode!(
20680                            FileInfo,
20681                            fdomain_client::fidl::FDomainResourceDialect,
20682                            val,
20683                            decoder,
20684                            _inner_offset,
20685                            depth
20686                        )?;
20687                    } else {
20688                        unreachable!()
20689                    }
20690                }
20691                4 => {
20692                    #[allow(irrefutable_let_patterns)]
20693                    if let Representation::Symlink(_) = self {
20694                        // Do nothing, read the value into the object
20695                    } else {
20696                        // Initialize `self` to the right variant
20697                        *self = Representation::Symlink(fidl::new_empty!(
20698                            SymlinkInfo,
20699                            fdomain_client::fidl::FDomainResourceDialect
20700                        ));
20701                    }
20702                    #[allow(irrefutable_let_patterns)]
20703                    if let Representation::Symlink(ref mut val) = self {
20704                        fidl::decode!(
20705                            SymlinkInfo,
20706                            fdomain_client::fidl::FDomainResourceDialect,
20707                            val,
20708                            decoder,
20709                            _inner_offset,
20710                            depth
20711                        )?;
20712                    } else {
20713                        unreachable!()
20714                    }
20715                }
20716                #[allow(deprecated)]
20717                ordinal => {
20718                    for _ in 0..num_handles {
20719                        decoder.drop_next_handle()?;
20720                    }
20721                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
20722                }
20723            }
20724            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20725                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20726            }
20727            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20728                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20729            }
20730            Ok(())
20731        }
20732    }
20733}