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 shutdown_with_epitaph(&self, status: zx_status::Status) {
717        self.inner.shutdown_with_epitaph(status)
718    }
719
720    fn is_closed(&self) -> bool {
721        self.inner.channel().is_closed()
722    }
723    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
724        self.inner.channel().on_closed()
725    }
726}
727
728impl AdvisoryLockingControlHandle {}
729
730#[must_use = "FIDL methods require a response to be sent"]
731#[derive(Debug)]
732pub struct AdvisoryLockingAdvisoryLockResponder {
733    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
734    tx_id: u32,
735}
736
737/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
738/// if the responder is dropped without sending a response, so that the client
739/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
740impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
741    fn drop(&mut self) {
742        self.control_handle.shutdown();
743        // Safety: drops once, never accessed again
744        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
745    }
746}
747
748impl fdomain_client::fidl::Responder for AdvisoryLockingAdvisoryLockResponder {
749    type ControlHandle = AdvisoryLockingControlHandle;
750
751    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
752        &self.control_handle
753    }
754
755    fn drop_without_shutdown(mut self) {
756        // Safety: drops once, never accessed again due to mem::forget
757        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
758        // Prevent Drop from running (which would shut down the channel)
759        std::mem::forget(self);
760    }
761}
762
763impl AdvisoryLockingAdvisoryLockResponder {
764    /// Sends a response to the FIDL transaction.
765    ///
766    /// Sets the channel to shutdown if an error occurs.
767    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
768        let _result = self.send_raw(result);
769        if _result.is_err() {
770            self.control_handle.shutdown();
771        }
772        self.drop_without_shutdown();
773        _result
774    }
775
776    /// Similar to "send" but does not shutdown the channel if an error occurs.
777    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
778        let _result = self.send_raw(result);
779        self.drop_without_shutdown();
780        _result
781    }
782
783    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
784        self.control_handle
785            .inner
786            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
787                result,
788                self.tx_id,
789                0x6ee9c0ad53ec87aa,
790                fidl::encoding::DynamicFlags::empty(),
791            )
792    }
793}
794
795#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
796pub struct DirectoryMarker;
797
798impl fdomain_client::fidl::ProtocolMarker for DirectoryMarker {
799    type Proxy = DirectoryProxy;
800    type RequestStream = DirectoryRequestStream;
801
802    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
803}
804impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryMarker {}
805pub type DirectoryUnlinkResult = Result<(), i32>;
806pub type DirectoryRenameResult = Result<(), i32>;
807pub type DirectoryCreateSymlinkResult = Result<(), i32>;
808
809pub trait DirectoryProxyInterface: Send + Sync {
810    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
811        + Send;
812    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
813    fn r#clone(
814        &self,
815        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
816    ) -> Result<(), fidl::Error>;
817    type CloseResponseFut: std::future::Future<
818            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
819        > + Send;
820    fn r#close(&self) -> Self::CloseResponseFut;
821    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
822    fn r#query(&self) -> Self::QueryResponseFut;
823    fn r#deprecated_clone(
824        &self,
825        flags: OpenFlags,
826        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
827    ) -> Result<(), fidl::Error>;
828    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
829        + Send;
830    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
831    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
832    fn r#deprecated_set_attr(
833        &self,
834        flags: NodeAttributeFlags,
835        attributes: &NodeAttributes,
836    ) -> Self::DeprecatedSetAttrResponseFut;
837    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
838        + Send;
839    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
840    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
841        + Send;
842    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
843    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
844        + Send;
845    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
846    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
847        + Send;
848    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
849    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
850        + Send;
851    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
852    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
853        + Send;
854    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
855    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
856        + Send;
857    fn r#update_attributes(
858        &self,
859        payload: &MutableNodeAttributes,
860    ) -> Self::UpdateAttributesResponseFut;
861    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
862    fn r#sync(&self) -> Self::SyncResponseFut;
863    fn r#list_extended_attributes(
864        &self,
865        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
866    ) -> Result<(), fidl::Error>;
867    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
868        + Send;
869    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
870    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
871        + Send;
872    fn r#set_extended_attribute(
873        &self,
874        name: &[u8],
875        value: ExtendedAttributeValue,
876        mode: SetExtendedAttributeMode,
877    ) -> Self::SetExtendedAttributeResponseFut;
878    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
879        + Send;
880    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
881    fn r#deprecated_open(
882        &self,
883        flags: OpenFlags,
884        mode: ModeType,
885        path: &str,
886        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
887    ) -> Result<(), fidl::Error>;
888    fn r#open(
889        &self,
890        path: &str,
891        flags: Flags,
892        options: &Options,
893        object: fdomain_client::Channel,
894    ) -> Result<(), fidl::Error>;
895    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
896        + Send;
897    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
898    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
899    fn r#rewind(&self) -> Self::RewindResponseFut;
900    type GetTokenResponseFut: std::future::Future<
901            Output = Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error>,
902        > + Send;
903    fn r#get_token(&self) -> Self::GetTokenResponseFut;
904    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
905    fn r#link(
906        &self,
907        src: &str,
908        dst_parent_token: fdomain_client::NullableHandle,
909        dst: &str,
910    ) -> Self::LinkResponseFut;
911    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
912        + Send;
913    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
914    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
915        + Send;
916    fn r#rename(
917        &self,
918        src: &str,
919        dst_parent_token: fdomain_client::Event,
920        dst: &str,
921    ) -> Self::RenameResponseFut;
922    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
923        + Send;
924    fn r#create_symlink(
925        &self,
926        name: &str,
927        target: &[u8],
928        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
929    ) -> Self::CreateSymlinkResponseFut;
930    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
931    fn r#watch(
932        &self,
933        mask: WatchMask,
934        options: u32,
935        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
936    ) -> Self::WatchResponseFut;
937}
938
939#[derive(Debug, Clone)]
940pub struct DirectoryProxy {
941    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
942}
943
944impl fdomain_client::fidl::Proxy for DirectoryProxy {
945    type Protocol = DirectoryMarker;
946
947    fn from_channel(inner: fdomain_client::Channel) -> Self {
948        Self::new(inner)
949    }
950
951    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
952        self.client.into_channel().map_err(|client| Self { client })
953    }
954
955    fn as_channel(&self) -> &fdomain_client::Channel {
956        self.client.as_channel()
957    }
958}
959
960impl DirectoryProxy {
961    /// Create a new Proxy for fuchsia.io/Directory.
962    pub fn new(channel: fdomain_client::Channel) -> Self {
963        let protocol_name = <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
964        Self { client: fidl::client::Client::new(channel, protocol_name) }
965    }
966
967    /// Get a Stream of events from the remote end of the protocol.
968    ///
969    /// # Panics
970    ///
971    /// Panics if the event stream was already taken.
972    pub fn take_event_stream(&self) -> DirectoryEventStream {
973        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
974    }
975
976    /// Acquires an advisory lock on the underlying file.
977    ///
978    /// The lock lasts until either this connection is closed or
979    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
980    /// explicitly.
981    ///
982    /// Advisory locks are purely advisory. They do not prevent actual read or
983    /// write operations from occurring on the file, either through this
984    /// connection or through other connections.
985    ///
986    /// This method requires the following rights:
987    ///
988    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
989    /// * [`Rights.WRITE_BYTES`] if `request.type` is
990    ///   [`AdvisoryLockType.WRITE`].
991    ///
992    /// # Errors
993    ///
994    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
995    ///   example, another connection might hold a conflicting lock type.
996    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
997    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
998    ///   to acquire the given type of lock.
999    pub fn r#advisory_lock(
1000        &self,
1001        mut request: &AdvisoryLockRequest,
1002    ) -> fidl::client::QueryResponseFut<
1003        AdvisoryLockingAdvisoryLockResult,
1004        fdomain_client::fidl::FDomainResourceDialect,
1005    > {
1006        DirectoryProxyInterface::r#advisory_lock(self, request)
1007    }
1008
1009    pub fn r#clone(
1010        &self,
1011        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1012    ) -> Result<(), fidl::Error> {
1013        DirectoryProxyInterface::r#clone(self, request)
1014    }
1015
1016    /// Terminates the connection.
1017    ///
1018    /// After calling `Close`, the client must not send any other requests.
1019    ///
1020    /// Servers, after sending the status response, should close the connection
1021    /// regardless of status and without sending an epitaph.
1022    ///
1023    /// Closing the client end of the channel should be semantically equivalent
1024    /// to calling `Close` without knowing when the close has completed or its
1025    /// status.
1026    pub fn r#close(
1027        &self,
1028    ) -> fidl::client::QueryResponseFut<
1029        fdomain_fuchsia_unknown::CloseableCloseResult,
1030        fdomain_client::fidl::FDomainResourceDialect,
1031    > {
1032        DirectoryProxyInterface::r#close(self)
1033    }
1034
1035    pub fn r#query(
1036        &self,
1037    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
1038        DirectoryProxyInterface::r#query(self)
1039    }
1040
1041    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1042    pub fn r#deprecated_clone(
1043        &self,
1044        mut flags: OpenFlags,
1045        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1046    ) -> Result<(), fidl::Error> {
1047        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1048    }
1049
1050    /// DEPRECATED - Use `Node.GetAttributes` instead.
1051    pub fn r#deprecated_get_attr(
1052        &self,
1053    ) -> fidl::client::QueryResponseFut<
1054        (i32, NodeAttributes),
1055        fdomain_client::fidl::FDomainResourceDialect,
1056    > {
1057        DirectoryProxyInterface::r#deprecated_get_attr(self)
1058    }
1059
1060    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1061    pub fn r#deprecated_set_attr(
1062        &self,
1063        mut flags: NodeAttributeFlags,
1064        mut attributes: &NodeAttributes,
1065    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1066        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1067    }
1068
1069    /// [DEPRECATED - Use new GetFlags method instead.]
1070    pub fn r#deprecated_get_flags(
1071        &self,
1072    ) -> fidl::client::QueryResponseFut<
1073        (i32, OpenFlags),
1074        fdomain_client::fidl::FDomainResourceDialect,
1075    > {
1076        DirectoryProxyInterface::r#deprecated_get_flags(self)
1077    }
1078
1079    /// [DEPRECATED - Use new SetFlags method instead.]
1080    pub fn r#deprecated_set_flags(
1081        &self,
1082        mut flags: OpenFlags,
1083    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1084        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
1085    }
1086
1087    /// Queries the flags that apply to this node after it has been opened/created. This method does
1088    /// not require any rights.
1089    ///
1090    /// Note that the final set of flags that apply to the connection may differ from those
1091    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1092    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1093    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1094    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1095    pub fn r#get_flags(
1096        &self,
1097    ) -> fidl::client::QueryResponseFut<
1098        NodeGetFlagsResult,
1099        fdomain_client::fidl::FDomainResourceDialect,
1100    > {
1101        DirectoryProxyInterface::r#get_flags(self)
1102    }
1103
1104    /// Sets the flags that apply to this node after it has been opened. This method does not
1105    /// require any rights.
1106    ///
1107    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1108    /// clear append mode.
1109    ///
1110    /// Errors:
1111    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1112    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1113    pub fn r#set_flags(
1114        &self,
1115        mut flags: Flags,
1116    ) -> fidl::client::QueryResponseFut<
1117        NodeSetFlagsResult,
1118        fdomain_client::fidl::FDomainResourceDialect,
1119    > {
1120        DirectoryProxyInterface::r#set_flags(self, flags)
1121    }
1122
1123    /// Query the filesystem for filesystem-specific information.
1124    pub fn r#query_filesystem(
1125        &self,
1126    ) -> fidl::client::QueryResponseFut<
1127        (i32, Option<Box<FilesystemInfo>>),
1128        fdomain_client::fidl::FDomainResourceDialect,
1129    > {
1130        DirectoryProxyInterface::r#query_filesystem(self)
1131    }
1132
1133    /// Acquires information about the node.
1134    ///
1135    /// The attributes of a node should be stable, independent of the
1136    /// specific protocol used to access it.
1137    ///
1138    /// If a particular attribute is not applicable or not supported,
1139    /// filesystems should leave the corresponding field absent.
1140    ///
1141    /// + `query` a bit-mask specifying which attributes to fetch. The server
1142    ///   should not return more than necessary.
1143    /// - `attributes` the returned attributes.
1144    ///
1145    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1146    pub fn r#get_attributes(
1147        &self,
1148        mut query: NodeAttributesQuery,
1149    ) -> fidl::client::QueryResponseFut<
1150        NodeGetAttributesResult,
1151        fdomain_client::fidl::FDomainResourceDialect,
1152    > {
1153        DirectoryProxyInterface::r#get_attributes(self, query)
1154    }
1155
1156    /// Updates information about the node.
1157    ///
1158    /// + `attributes` the presence of a table field in `attributes` indicates
1159    /// the intent to update the corresponding attribute.
1160    ///
1161    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1162    ///
1163    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1164    pub fn r#update_attributes(
1165        &self,
1166        mut payload: &MutableNodeAttributes,
1167    ) -> fidl::client::QueryResponseFut<
1168        NodeUpdateAttributesResult,
1169        fdomain_client::fidl::FDomainResourceDialect,
1170    > {
1171        DirectoryProxyInterface::r#update_attributes(self, payload)
1172    }
1173
1174    /// Synchronizes updates to the node to the underlying media, if it exists.
1175    ///
1176    /// This method will return when the filesystem server has flushed the
1177    /// relevant updates to the underlying media, but does not guarantee the
1178    /// underlying media has persisted the information, nor that any information
1179    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1180    /// between operations.
1181    ///
1182    /// This method does not require any rights.
1183    pub fn r#sync(
1184        &self,
1185    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
1186    {
1187        DirectoryProxyInterface::r#sync(self)
1188    }
1189
1190    /// Creates an iterator over all the extended attribute names associated
1191    /// with this node. If an error occurs it is returned as an epitaph on the
1192    /// iterator request channel, and then the channel is closed.
1193    ///
1194    /// GetExtendedAttributes can be used with any of these names to retrieve
1195    /// the associated value.
1196    ///
1197    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1198    pub fn r#list_extended_attributes(
1199        &self,
1200        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1201    ) -> Result<(), fidl::Error> {
1202        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
1203    }
1204
1205    /// Get the value associated with the given attribute `name` for this node.
1206    ///
1207    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1208    /// particular structure is imposed on them.
1209    ///
1210    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1211    pub fn r#get_extended_attribute(
1212        &self,
1213        mut name: &[u8],
1214    ) -> fidl::client::QueryResponseFut<
1215        NodeGetExtendedAttributeResult,
1216        fdomain_client::fidl::FDomainResourceDialect,
1217    > {
1218        DirectoryProxyInterface::r#get_extended_attribute(self, name)
1219    }
1220
1221    /// Set the value for the given attribute `name` to `value` for this node.
1222    ///
1223    /// The attribute name may exist, in which case the attribute is updated.
1224    /// If the attribute doesn't exist, it is created. The name should have no
1225    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1226    ///
1227    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1228    pub fn r#set_extended_attribute(
1229        &self,
1230        mut name: &[u8],
1231        mut value: ExtendedAttributeValue,
1232        mut mode: SetExtendedAttributeMode,
1233    ) -> fidl::client::QueryResponseFut<
1234        NodeSetExtendedAttributeResult,
1235        fdomain_client::fidl::FDomainResourceDialect,
1236    > {
1237        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
1238    }
1239
1240    /// Remove the specified extended attribute.
1241    ///
1242    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1243    ///
1244    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1245    pub fn r#remove_extended_attribute(
1246        &self,
1247        mut name: &[u8],
1248    ) -> fidl::client::QueryResponseFut<
1249        NodeRemoveExtendedAttributeResult,
1250        fdomain_client::fidl::FDomainResourceDialect,
1251    > {
1252        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
1253    }
1254
1255    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1256    pub fn r#deprecated_open(
1257        &self,
1258        mut flags: OpenFlags,
1259        mut mode: ModeType,
1260        mut path: &str,
1261        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1262    ) -> Result<(), fidl::Error> {
1263        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
1264    }
1265
1266    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1267    /// epitaph sent on the `object` channel.
1268    ///
1269    /// Errors:
1270    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1271    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1272    pub fn r#open(
1273        &self,
1274        mut path: &str,
1275        mut flags: Flags,
1276        mut options: &Options,
1277        mut object: fdomain_client::Channel,
1278    ) -> Result<(), fidl::Error> {
1279        DirectoryProxyInterface::r#open(self, path, flags, options, object)
1280    }
1281
1282    /// Reads a collection of variably sized dirents into a buffer.
1283    /// The number of dirents in a directory may be very large: akin to
1284    /// calling read multiple times on a file, directories have a seek
1285    /// offset which is updated on subsequent calls to ReadDirents.
1286    /// Each call to ReadDirents will only return whole dirent structures,
1287    /// they will not get split across ReadDirent calls. When the seek
1288    /// offset reaches the end, `dirents` will be empty.
1289    ///
1290    /// These dirents are of the form:
1291    /// ```
1292    /// struct dirent {
1293    ///   // Describes the inode of the entry.
1294    ///   uint64 ino;
1295    ///   // Describes the length of the dirent name in bytes.
1296    ///   uint8 size;
1297    ///   // Describes the type of the entry. Aligned with the
1298    ///   // POSIX d_type values. Use `DirentType` constants.
1299    ///   uint8 type;
1300    ///   // Unterminated name of entry.
1301    ///   char name[0];
1302    /// }
1303    /// ```
1304    ///
1305    /// This method does not require any rights, since one could always probe for
1306    /// directory contents by triggering name conflicts during file creation.
1307    pub fn r#read_dirents(
1308        &self,
1309        mut max_bytes: u64,
1310    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fdomain_client::fidl::FDomainResourceDialect>
1311    {
1312        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
1313    }
1314
1315    /// Resets the directory seek offset.
1316    ///
1317    /// This method does not require any rights, similar to ReadDirents.
1318    pub fn r#rewind(
1319        &self,
1320    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1321        DirectoryProxyInterface::r#rewind(self)
1322    }
1323
1324    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1325    /// in time. The token will remain valid for as long as the connection requesting the token
1326    /// remains open.
1327    ///
1328    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1329    /// `ZX_ERR_BAD_HANDLE`.
1330    pub fn r#get_token(
1331        &self,
1332    ) -> fidl::client::QueryResponseFut<
1333        (i32, Option<fdomain_client::NullableHandle>),
1334        fdomain_client::fidl::FDomainResourceDialect,
1335    > {
1336        DirectoryProxyInterface::r#get_token(self)
1337    }
1338
1339    /// Creates a link to an object named src by the name dst, within a directory represented by
1340    /// token.
1341    ///
1342    /// `src` must be a resolved object name. Including "/" in the string will
1343    /// return `ZX_ERR_INVALID_ARGS`.
1344    ///
1345    /// `dst` must be a resolved object name. Including "/" in the string will
1346    /// return `ZX_ERR_INVALID_ARGS`.
1347    ///
1348    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1349    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1350    ///
1351    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1352    /// there are two actors operating concurrently, and one actor performs a rename that affects
1353    /// the source within this directory, and the other does a link, each will appear to occur
1354    /// atomically in an unspecified order.
1355    pub fn r#link(
1356        &self,
1357        mut src: &str,
1358        mut dst_parent_token: fdomain_client::NullableHandle,
1359        mut dst: &str,
1360    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1361        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
1362    }
1363
1364    /// Removes a child node from the this directory's list of entries.
1365    ///
1366    /// Note: this does not guarantee that the underlying object is destroyed.
1367    /// Although the link will be removed from the containing directory,
1368    /// objects with multiple references (such as files which are still open)
1369    /// will not actually be destroyed until all references are closed.
1370    ///
1371    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1372    ///   [`Rights.WRITE_BYTES`].
1373    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1374    ///   support writing.
1375    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1376    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1377    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1378    ///   containing a remote channel.
1379    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1380    ///     something other than a directory was found.
1381    ///
1382    /// Other errors may be returned for filesystem-specific reasons.
1383    ///
1384    /// This method requires the following rights:
1385    ///
1386    /// * [`Rights.ENUMERATE`]
1387    /// * [`Rights.MODIFY_DIRECTORY`]
1388    pub fn r#unlink(
1389        &self,
1390        mut name: &str,
1391        mut options: &UnlinkOptions,
1392    ) -> fidl::client::QueryResponseFut<
1393        DirectoryUnlinkResult,
1394        fdomain_client::fidl::FDomainResourceDialect,
1395    > {
1396        DirectoryProxyInterface::r#unlink(self, name, options)
1397    }
1398
1399    /// Renames a node named `src` to the name `dst`, in a directory represented
1400    /// by `dst_parent_token`.
1401    ///
1402    /// `src` and `dst` must be valid node names.
1403    /// See [`Name`] for what constitutes a valid name.
1404    ///
1405    /// This method requires the following rights on both the current connection, and the connection
1406    /// identified by `dst_parent_token`:
1407    ///
1408    /// * [`Rights.ENUMERATE`]
1409    /// * [`Rights.MODIFY_DIRECTORY`]
1410    ///
1411    /// The following requirements are necessary to avoid rights escalations.
1412    ///
1413    /// If the source and destination directory differ, the source directory must also have the
1414    /// maximal set of abilities supported for files, which would typically be
1415    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1416    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1417    /// right.
1418    ///
1419    /// If `src` refers to a directory, and differs from the destination directory, then the source
1420    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1421    ///
1422    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1423    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1424    pub fn r#rename(
1425        &self,
1426        mut src: &str,
1427        mut dst_parent_token: fdomain_client::Event,
1428        mut dst: &str,
1429    ) -> fidl::client::QueryResponseFut<
1430        DirectoryRenameResult,
1431        fdomain_client::fidl::FDomainResourceDialect,
1432    > {
1433        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
1434    }
1435
1436    /// Creates a symbolic link.
1437    ///
1438    /// `name` is the name to be given to the created symbolic link.
1439    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1440    /// will perform no validation of `target` except for a server chosen maximum length.
1441    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1442    /// on the successfully created node.
1443    ///
1444    /// * [`Rights.MODIFY_DIRECTORY`]
1445    ///
1446    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1447    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1448    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1449    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1450    pub fn r#create_symlink(
1451        &self,
1452        mut name: &str,
1453        mut target: &[u8],
1454        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
1455    ) -> fidl::client::QueryResponseFut<
1456        DirectoryCreateSymlinkResult,
1457        fdomain_client::fidl::FDomainResourceDialect,
1458    > {
1459        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
1460    }
1461
1462    /// Watches a directory, receiving events of added messages on the
1463    /// watcher request channel.
1464    ///
1465    /// Options must be zero; it is reserved.
1466    ///
1467    /// This method does not require any rights, similar to ReadDirents.
1468    pub fn r#watch(
1469        &self,
1470        mut mask: WatchMask,
1471        mut options: u32,
1472        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
1473    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
1474        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
1475    }
1476}
1477
1478impl DirectoryProxyInterface for DirectoryProxy {
1479    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
1480        AdvisoryLockingAdvisoryLockResult,
1481        fdomain_client::fidl::FDomainResourceDialect,
1482    >;
1483    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
1484        fn _decode(
1485            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1486        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1487            let _response = fidl::client::decode_transaction_body::<
1488                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1489                fdomain_client::fidl::FDomainResourceDialect,
1490                0x6ee9c0ad53ec87aa,
1491            >(_buf?)?;
1492            Ok(_response.map(|x| x))
1493        }
1494        self.client.send_query_and_decode::<
1495            AdvisoryLockingAdvisoryLockRequest,
1496            AdvisoryLockingAdvisoryLockResult,
1497        >(
1498            (request,),
1499            0x6ee9c0ad53ec87aa,
1500            fidl::encoding::DynamicFlags::empty(),
1501            _decode,
1502        )
1503    }
1504
1505    fn r#clone(
1506        &self,
1507        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
1508    ) -> Result<(), fidl::Error> {
1509        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
1510            (request,),
1511            0x20d8a7aba2168a79,
1512            fidl::encoding::DynamicFlags::empty(),
1513        )
1514    }
1515
1516    type CloseResponseFut = fidl::client::QueryResponseFut<
1517        fdomain_fuchsia_unknown::CloseableCloseResult,
1518        fdomain_client::fidl::FDomainResourceDialect,
1519    >;
1520    fn r#close(&self) -> Self::CloseResponseFut {
1521        fn _decode(
1522            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1523        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1524            let _response = fidl::client::decode_transaction_body::<
1525                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1526                fdomain_client::fidl::FDomainResourceDialect,
1527                0x5ac5d459ad7f657e,
1528            >(_buf?)?;
1529            Ok(_response.map(|x| x))
1530        }
1531        self.client.send_query_and_decode::<
1532            fidl::encoding::EmptyPayload,
1533            fdomain_fuchsia_unknown::CloseableCloseResult,
1534        >(
1535            (),
1536            0x5ac5d459ad7f657e,
1537            fidl::encoding::DynamicFlags::empty(),
1538            _decode,
1539        )
1540    }
1541
1542    type QueryResponseFut =
1543        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
1544    fn r#query(&self) -> Self::QueryResponseFut {
1545        fn _decode(
1546            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1547        ) -> Result<Vec<u8>, fidl::Error> {
1548            let _response = fidl::client::decode_transaction_body::<
1549                fdomain_fuchsia_unknown::QueryableQueryResponse,
1550                fdomain_client::fidl::FDomainResourceDialect,
1551                0x2658edee9decfc06,
1552            >(_buf?)?;
1553            Ok(_response.protocol)
1554        }
1555        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
1556            (),
1557            0x2658edee9decfc06,
1558            fidl::encoding::DynamicFlags::empty(),
1559            _decode,
1560        )
1561    }
1562
1563    fn r#deprecated_clone(
1564        &self,
1565        mut flags: OpenFlags,
1566        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1567    ) -> Result<(), fidl::Error> {
1568        self.client.send::<NodeDeprecatedCloneRequest>(
1569            (flags, object),
1570            0x5a61678f293ce16f,
1571            fidl::encoding::DynamicFlags::FLEXIBLE,
1572        )
1573    }
1574
1575    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
1576        (i32, NodeAttributes),
1577        fdomain_client::fidl::FDomainResourceDialect,
1578    >;
1579    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
1580        fn _decode(
1581            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1582        ) -> Result<(i32, NodeAttributes), fidl::Error> {
1583            let _response = fidl::client::decode_transaction_body::<
1584                NodeDeprecatedGetAttrResponse,
1585                fdomain_client::fidl::FDomainResourceDialect,
1586                0x78985e216314dafd,
1587            >(_buf?)?;
1588            Ok((_response.s, _response.attributes))
1589        }
1590        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
1591            (),
1592            0x78985e216314dafd,
1593            fidl::encoding::DynamicFlags::empty(),
1594            _decode,
1595        )
1596    }
1597
1598    type DeprecatedSetAttrResponseFut =
1599        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1600    fn r#deprecated_set_attr(
1601        &self,
1602        mut flags: NodeAttributeFlags,
1603        mut attributes: &NodeAttributes,
1604    ) -> Self::DeprecatedSetAttrResponseFut {
1605        fn _decode(
1606            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1607        ) -> Result<i32, fidl::Error> {
1608            let _response = fidl::client::decode_transaction_body::<
1609                NodeDeprecatedSetAttrResponse,
1610                fdomain_client::fidl::FDomainResourceDialect,
1611                0x4186c0f40d938f46,
1612            >(_buf?)?;
1613            Ok(_response.s)
1614        }
1615        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
1616            (flags, attributes),
1617            0x4186c0f40d938f46,
1618            fidl::encoding::DynamicFlags::empty(),
1619            _decode,
1620        )
1621    }
1622
1623    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
1624        (i32, OpenFlags),
1625        fdomain_client::fidl::FDomainResourceDialect,
1626    >;
1627    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
1628        fn _decode(
1629            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1630        ) -> Result<(i32, OpenFlags), fidl::Error> {
1631            let _response = fidl::client::decode_transaction_body::<
1632                NodeDeprecatedGetFlagsResponse,
1633                fdomain_client::fidl::FDomainResourceDialect,
1634                0x5b88fffb8eda3aa1,
1635            >(_buf?)?;
1636            Ok((_response.s, _response.flags))
1637        }
1638        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
1639            (),
1640            0x5b88fffb8eda3aa1,
1641            fidl::encoding::DynamicFlags::empty(),
1642            _decode,
1643        )
1644    }
1645
1646    type DeprecatedSetFlagsResponseFut =
1647        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1648    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
1649        fn _decode(
1650            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1651        ) -> Result<i32, fidl::Error> {
1652            let _response = fidl::client::decode_transaction_body::<
1653                NodeDeprecatedSetFlagsResponse,
1654                fdomain_client::fidl::FDomainResourceDialect,
1655                0x5295b76c71fde733,
1656            >(_buf?)?;
1657            Ok(_response.s)
1658        }
1659        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
1660            (flags,),
1661            0x5295b76c71fde733,
1662            fidl::encoding::DynamicFlags::empty(),
1663            _decode,
1664        )
1665    }
1666
1667    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
1668        NodeGetFlagsResult,
1669        fdomain_client::fidl::FDomainResourceDialect,
1670    >;
1671    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
1672        fn _decode(
1673            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1674        ) -> Result<NodeGetFlagsResult, fidl::Error> {
1675            let _response = fidl::client::decode_transaction_body::<
1676                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1677                fdomain_client::fidl::FDomainResourceDialect,
1678                0x176eb318f64ec23,
1679            >(_buf?)?
1680            .into_result_fdomain::<DirectoryMarker>("get_flags")?;
1681            Ok(_response.map(|x| x.flags))
1682        }
1683        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
1684            (),
1685            0x176eb318f64ec23,
1686            fidl::encoding::DynamicFlags::FLEXIBLE,
1687            _decode,
1688        )
1689    }
1690
1691    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
1692        NodeSetFlagsResult,
1693        fdomain_client::fidl::FDomainResourceDialect,
1694    >;
1695    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
1696        fn _decode(
1697            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1698        ) -> Result<NodeSetFlagsResult, fidl::Error> {
1699            let _response = fidl::client::decode_transaction_body::<
1700                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1701                fdomain_client::fidl::FDomainResourceDialect,
1702                0x55a8028685791ea8,
1703            >(_buf?)?
1704            .into_result_fdomain::<DirectoryMarker>("set_flags")?;
1705            Ok(_response.map(|x| x))
1706        }
1707        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
1708            (flags,),
1709            0x55a8028685791ea8,
1710            fidl::encoding::DynamicFlags::FLEXIBLE,
1711            _decode,
1712        )
1713    }
1714
1715    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
1716        (i32, Option<Box<FilesystemInfo>>),
1717        fdomain_client::fidl::FDomainResourceDialect,
1718    >;
1719    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
1720        fn _decode(
1721            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1722        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1723            let _response = fidl::client::decode_transaction_body::<
1724                NodeQueryFilesystemResponse,
1725                fdomain_client::fidl::FDomainResourceDialect,
1726                0x6f344a1c6b0a0610,
1727            >(_buf?)?;
1728            Ok((_response.s, _response.info))
1729        }
1730        self.client.send_query_and_decode::<
1731            fidl::encoding::EmptyPayload,
1732            (i32, Option<Box<FilesystemInfo>>),
1733        >(
1734            (),
1735            0x6f344a1c6b0a0610,
1736            fidl::encoding::DynamicFlags::empty(),
1737            _decode,
1738        )
1739    }
1740
1741    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
1742        NodeGetAttributesResult,
1743        fdomain_client::fidl::FDomainResourceDialect,
1744    >;
1745    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
1746        fn _decode(
1747            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1748        ) -> Result<NodeGetAttributesResult, fidl::Error> {
1749            let _response = fidl::client::decode_transaction_body::<
1750                fidl::encoding::ResultType<NodeAttributes2, i32>,
1751                fdomain_client::fidl::FDomainResourceDialect,
1752                0x3d4396a638ea053b,
1753            >(_buf?)?;
1754            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1755        }
1756        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
1757            (query,),
1758            0x3d4396a638ea053b,
1759            fidl::encoding::DynamicFlags::empty(),
1760            _decode,
1761        )
1762    }
1763
1764    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
1765        NodeUpdateAttributesResult,
1766        fdomain_client::fidl::FDomainResourceDialect,
1767    >;
1768    fn r#update_attributes(
1769        &self,
1770        mut payload: &MutableNodeAttributes,
1771    ) -> Self::UpdateAttributesResponseFut {
1772        fn _decode(
1773            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1774        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1775            let _response = fidl::client::decode_transaction_body::<
1776                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1777                fdomain_client::fidl::FDomainResourceDialect,
1778                0x3308c1da5a89bf08,
1779            >(_buf?)?;
1780            Ok(_response.map(|x| x))
1781        }
1782        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
1783            payload,
1784            0x3308c1da5a89bf08,
1785            fidl::encoding::DynamicFlags::empty(),
1786            _decode,
1787        )
1788    }
1789
1790    type SyncResponseFut = fidl::client::QueryResponseFut<
1791        NodeSyncResult,
1792        fdomain_client::fidl::FDomainResourceDialect,
1793    >;
1794    fn r#sync(&self) -> Self::SyncResponseFut {
1795        fn _decode(
1796            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1797        ) -> Result<NodeSyncResult, fidl::Error> {
1798            let _response = fidl::client::decode_transaction_body::<
1799                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1800                fdomain_client::fidl::FDomainResourceDialect,
1801                0x2c5c27ca0ab5dc49,
1802            >(_buf?)?;
1803            Ok(_response.map(|x| x))
1804        }
1805        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
1806            (),
1807            0x2c5c27ca0ab5dc49,
1808            fidl::encoding::DynamicFlags::empty(),
1809            _decode,
1810        )
1811    }
1812
1813    fn r#list_extended_attributes(
1814        &self,
1815        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
1816    ) -> Result<(), fidl::Error> {
1817        self.client.send::<NodeListExtendedAttributesRequest>(
1818            (iterator,),
1819            0x4b61033de007fcd0,
1820            fidl::encoding::DynamicFlags::empty(),
1821        )
1822    }
1823
1824    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1825        NodeGetExtendedAttributeResult,
1826        fdomain_client::fidl::FDomainResourceDialect,
1827    >;
1828    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
1829        fn _decode(
1830            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1831        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1832            let _response = fidl::client::decode_transaction_body::<
1833                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1834                fdomain_client::fidl::FDomainResourceDialect,
1835                0x45ffa3ccfdeb76db,
1836            >(_buf?)?;
1837            Ok(_response.map(|x| x))
1838        }
1839        self.client.send_query_and_decode::<
1840            NodeGetExtendedAttributeRequest,
1841            NodeGetExtendedAttributeResult,
1842        >(
1843            (name,),
1844            0x45ffa3ccfdeb76db,
1845            fidl::encoding::DynamicFlags::empty(),
1846            _decode,
1847        )
1848    }
1849
1850    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1851        NodeSetExtendedAttributeResult,
1852        fdomain_client::fidl::FDomainResourceDialect,
1853    >;
1854    fn r#set_extended_attribute(
1855        &self,
1856        mut name: &[u8],
1857        mut value: ExtendedAttributeValue,
1858        mut mode: SetExtendedAttributeMode,
1859    ) -> Self::SetExtendedAttributeResponseFut {
1860        fn _decode(
1861            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1862        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1863            let _response = fidl::client::decode_transaction_body::<
1864                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1865                fdomain_client::fidl::FDomainResourceDialect,
1866                0x4a951362f681f23c,
1867            >(_buf?)?;
1868            Ok(_response.map(|x| x))
1869        }
1870        self.client.send_query_and_decode::<
1871            NodeSetExtendedAttributeRequest,
1872            NodeSetExtendedAttributeResult,
1873        >(
1874            (name, &mut value, mode,),
1875            0x4a951362f681f23c,
1876            fidl::encoding::DynamicFlags::empty(),
1877            _decode,
1878        )
1879    }
1880
1881    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
1882        NodeRemoveExtendedAttributeResult,
1883        fdomain_client::fidl::FDomainResourceDialect,
1884    >;
1885    fn r#remove_extended_attribute(
1886        &self,
1887        mut name: &[u8],
1888    ) -> Self::RemoveExtendedAttributeResponseFut {
1889        fn _decode(
1890            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1891        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1892            let _response = fidl::client::decode_transaction_body::<
1893                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1894                fdomain_client::fidl::FDomainResourceDialect,
1895                0x7a0b9f3a9bf9032d,
1896            >(_buf?)?;
1897            Ok(_response.map(|x| x))
1898        }
1899        self.client.send_query_and_decode::<
1900            NodeRemoveExtendedAttributeRequest,
1901            NodeRemoveExtendedAttributeResult,
1902        >(
1903            (name,),
1904            0x7a0b9f3a9bf9032d,
1905            fidl::encoding::DynamicFlags::empty(),
1906            _decode,
1907        )
1908    }
1909
1910    fn r#deprecated_open(
1911        &self,
1912        mut flags: OpenFlags,
1913        mut mode: ModeType,
1914        mut path: &str,
1915        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
1916    ) -> Result<(), fidl::Error> {
1917        self.client.send::<DirectoryDeprecatedOpenRequest>(
1918            (flags, mode, path, object),
1919            0x2c5044561d685ec0,
1920            fidl::encoding::DynamicFlags::FLEXIBLE,
1921        )
1922    }
1923
1924    fn r#open(
1925        &self,
1926        mut path: &str,
1927        mut flags: Flags,
1928        mut options: &Options,
1929        mut object: fdomain_client::Channel,
1930    ) -> Result<(), fidl::Error> {
1931        self.client.send::<DirectoryOpenRequest>(
1932            (path, flags, options, object),
1933            0x568ddcb9a9cbb6d9,
1934            fidl::encoding::DynamicFlags::empty(),
1935        )
1936    }
1937
1938    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
1939        (i32, Vec<u8>),
1940        fdomain_client::fidl::FDomainResourceDialect,
1941    >;
1942    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
1943        fn _decode(
1944            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1945        ) -> Result<(i32, Vec<u8>), fidl::Error> {
1946            let _response = fidl::client::decode_transaction_body::<
1947                DirectoryReadDirentsResponse,
1948                fdomain_client::fidl::FDomainResourceDialect,
1949                0x3582806bf27faa0a,
1950            >(_buf?)?;
1951            Ok((_response.s, _response.dirents))
1952        }
1953        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
1954            (max_bytes,),
1955            0x3582806bf27faa0a,
1956            fidl::encoding::DynamicFlags::empty(),
1957            _decode,
1958        )
1959    }
1960
1961    type RewindResponseFut =
1962        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
1963    fn r#rewind(&self) -> Self::RewindResponseFut {
1964        fn _decode(
1965            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1966        ) -> Result<i32, fidl::Error> {
1967            let _response = fidl::client::decode_transaction_body::<
1968                DirectoryRewindResponse,
1969                fdomain_client::fidl::FDomainResourceDialect,
1970                0x16b1202af0f34c71,
1971            >(_buf?)?;
1972            Ok(_response.s)
1973        }
1974        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1975            (),
1976            0x16b1202af0f34c71,
1977            fidl::encoding::DynamicFlags::empty(),
1978            _decode,
1979        )
1980    }
1981
1982    type GetTokenResponseFut = fidl::client::QueryResponseFut<
1983        (i32, Option<fdomain_client::NullableHandle>),
1984        fdomain_client::fidl::FDomainResourceDialect,
1985    >;
1986    fn r#get_token(&self) -> Self::GetTokenResponseFut {
1987        fn _decode(
1988            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1989        ) -> Result<(i32, Option<fdomain_client::NullableHandle>), fidl::Error> {
1990            let _response = fidl::client::decode_transaction_body::<
1991                DirectoryGetTokenResponse,
1992                fdomain_client::fidl::FDomainResourceDialect,
1993                0x26ae9d18763c8655,
1994            >(_buf?)?;
1995            Ok((_response.s, _response.token))
1996        }
1997        self.client.send_query_and_decode::<
1998            fidl::encoding::EmptyPayload,
1999            (i32, Option<fdomain_client::NullableHandle>),
2000        >(
2001            (),
2002            0x26ae9d18763c8655,
2003            fidl::encoding::DynamicFlags::empty(),
2004            _decode,
2005        )
2006    }
2007
2008    type LinkResponseFut =
2009        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2010    fn r#link(
2011        &self,
2012        mut src: &str,
2013        mut dst_parent_token: fdomain_client::NullableHandle,
2014        mut dst: &str,
2015    ) -> Self::LinkResponseFut {
2016        fn _decode(
2017            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2018        ) -> Result<i32, fidl::Error> {
2019            let _response = fidl::client::decode_transaction_body::<
2020                DirectoryLinkResponse,
2021                fdomain_client::fidl::FDomainResourceDialect,
2022                0x740604c0c7c930e7,
2023            >(_buf?)?;
2024            Ok(_response.s)
2025        }
2026        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2027            (src, dst_parent_token, dst),
2028            0x740604c0c7c930e7,
2029            fidl::encoding::DynamicFlags::empty(),
2030            _decode,
2031        )
2032    }
2033
2034    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2035        DirectoryUnlinkResult,
2036        fdomain_client::fidl::FDomainResourceDialect,
2037    >;
2038    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2039        fn _decode(
2040            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2041        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2042            let _response = fidl::client::decode_transaction_body::<
2043                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2044                fdomain_client::fidl::FDomainResourceDialect,
2045                0x750a0326a78d7bed,
2046            >(_buf?)?;
2047            Ok(_response.map(|x| x))
2048        }
2049        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2050            (name, options),
2051            0x750a0326a78d7bed,
2052            fidl::encoding::DynamicFlags::empty(),
2053            _decode,
2054        )
2055    }
2056
2057    type RenameResponseFut = fidl::client::QueryResponseFut<
2058        DirectoryRenameResult,
2059        fdomain_client::fidl::FDomainResourceDialect,
2060    >;
2061    fn r#rename(
2062        &self,
2063        mut src: &str,
2064        mut dst_parent_token: fdomain_client::Event,
2065        mut dst: &str,
2066    ) -> Self::RenameResponseFut {
2067        fn _decode(
2068            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2069        ) -> Result<DirectoryRenameResult, fidl::Error> {
2070            let _response = fidl::client::decode_transaction_body::<
2071                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2072                fdomain_client::fidl::FDomainResourceDialect,
2073                0x7060e7723b9928de,
2074            >(_buf?)?;
2075            Ok(_response.map(|x| x))
2076        }
2077        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2078            (src, dst_parent_token, dst),
2079            0x7060e7723b9928de,
2080            fidl::encoding::DynamicFlags::empty(),
2081            _decode,
2082        )
2083    }
2084
2085    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
2086        DirectoryCreateSymlinkResult,
2087        fdomain_client::fidl::FDomainResourceDialect,
2088    >;
2089    fn r#create_symlink(
2090        &self,
2091        mut name: &str,
2092        mut target: &[u8],
2093        mut connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
2094    ) -> Self::CreateSymlinkResponseFut {
2095        fn _decode(
2096            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2097        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
2098            let _response = fidl::client::decode_transaction_body::<
2099                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2100                fdomain_client::fidl::FDomainResourceDialect,
2101                0x21ce0f19ec043889,
2102            >(_buf?)?;
2103            Ok(_response.map(|x| x))
2104        }
2105        self.client
2106            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
2107                (name, target, connection),
2108                0x21ce0f19ec043889,
2109                fidl::encoding::DynamicFlags::empty(),
2110                _decode,
2111            )
2112    }
2113
2114    type WatchResponseFut =
2115        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2116    fn r#watch(
2117        &self,
2118        mut mask: WatchMask,
2119        mut options: u32,
2120        mut watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
2121    ) -> Self::WatchResponseFut {
2122        fn _decode(
2123            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2124        ) -> Result<i32, fidl::Error> {
2125            let _response = fidl::client::decode_transaction_body::<
2126                DirectoryWatchResponse,
2127                fdomain_client::fidl::FDomainResourceDialect,
2128                0x5717193a59d66d91,
2129            >(_buf?)?;
2130            Ok(_response.s)
2131        }
2132        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
2133            (mask, options, watcher),
2134            0x5717193a59d66d91,
2135            fidl::encoding::DynamicFlags::empty(),
2136            _decode,
2137        )
2138    }
2139}
2140
2141pub struct DirectoryEventStream {
2142    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2143}
2144
2145impl std::marker::Unpin for DirectoryEventStream {}
2146
2147impl futures::stream::FusedStream for DirectoryEventStream {
2148    fn is_terminated(&self) -> bool {
2149        self.event_receiver.is_terminated()
2150    }
2151}
2152
2153impl futures::Stream for DirectoryEventStream {
2154    type Item = Result<DirectoryEvent, fidl::Error>;
2155
2156    fn poll_next(
2157        mut self: std::pin::Pin<&mut Self>,
2158        cx: &mut std::task::Context<'_>,
2159    ) -> std::task::Poll<Option<Self::Item>> {
2160        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2161            &mut self.event_receiver,
2162            cx
2163        )?) {
2164            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
2165            None => std::task::Poll::Ready(None),
2166        }
2167    }
2168}
2169
2170#[derive(Debug)]
2171pub enum DirectoryEvent {
2172    OnOpen_ {
2173        s: i32,
2174        info: Option<Box<NodeInfoDeprecated>>,
2175    },
2176    OnRepresentation {
2177        payload: Representation,
2178    },
2179    #[non_exhaustive]
2180    _UnknownEvent {
2181        /// Ordinal of the event that was sent.
2182        ordinal: u64,
2183    },
2184}
2185
2186impl DirectoryEvent {
2187    #[allow(irrefutable_let_patterns)]
2188    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
2189        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
2190    }
2191    #[allow(irrefutable_let_patterns)]
2192    pub fn into_on_representation(self) -> Option<Representation> {
2193        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
2194    }
2195
2196    /// Decodes a message buffer as a [`DirectoryEvent`].
2197    fn decode(
2198        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2199    ) -> Result<DirectoryEvent, fidl::Error> {
2200        let (bytes, _handles) = buf.split_mut();
2201        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2202        debug_assert_eq!(tx_header.tx_id, 0);
2203        match tx_header.ordinal {
2204            0x7fc7bbb1dbfd1972 => {
2205                let mut out = fidl::new_empty!(
2206                    NodeOnOpenRequest,
2207                    fdomain_client::fidl::FDomainResourceDialect
2208                );
2209                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2210                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
2211            }
2212            0x5cb40567d80a510c => {
2213                let mut out =
2214                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
2215                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
2216                Ok((DirectoryEvent::OnRepresentation { payload: out }))
2217            }
2218            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2219                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2220            }
2221            _ => Err(fidl::Error::UnknownOrdinal {
2222                ordinal: tx_header.ordinal,
2223                protocol_name:
2224                    <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2225            }),
2226        }
2227    }
2228}
2229
2230/// A Stream of incoming requests for fuchsia.io/Directory.
2231pub struct DirectoryRequestStream {
2232    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2233    is_terminated: bool,
2234}
2235
2236impl std::marker::Unpin for DirectoryRequestStream {}
2237
2238impl futures::stream::FusedStream for DirectoryRequestStream {
2239    fn is_terminated(&self) -> bool {
2240        self.is_terminated
2241    }
2242}
2243
2244impl fdomain_client::fidl::RequestStream for DirectoryRequestStream {
2245    type Protocol = DirectoryMarker;
2246    type ControlHandle = DirectoryControlHandle;
2247
2248    fn from_channel(channel: fdomain_client::Channel) -> Self {
2249        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2250    }
2251
2252    fn control_handle(&self) -> Self::ControlHandle {
2253        DirectoryControlHandle { inner: self.inner.clone() }
2254    }
2255
2256    fn into_inner(
2257        self,
2258    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2259    {
2260        (self.inner, self.is_terminated)
2261    }
2262
2263    fn from_inner(
2264        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2265        is_terminated: bool,
2266    ) -> Self {
2267        Self { inner, is_terminated }
2268    }
2269}
2270
2271impl futures::Stream for DirectoryRequestStream {
2272    type Item = Result<DirectoryRequest, fidl::Error>;
2273
2274    fn poll_next(
2275        mut self: std::pin::Pin<&mut Self>,
2276        cx: &mut std::task::Context<'_>,
2277    ) -> std::task::Poll<Option<Self::Item>> {
2278        let this = &mut *self;
2279        if this.inner.check_shutdown(cx) {
2280            this.is_terminated = true;
2281            return std::task::Poll::Ready(None);
2282        }
2283        if this.is_terminated {
2284            panic!("polled DirectoryRequestStream after completion");
2285        }
2286        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2287            |bytes, handles| {
2288                match this.inner.channel().read_etc(cx, bytes, handles) {
2289                    std::task::Poll::Ready(Ok(())) => {}
2290                    std::task::Poll::Pending => return std::task::Poll::Pending,
2291                    std::task::Poll::Ready(Err(None)) => {
2292                        this.is_terminated = true;
2293                        return std::task::Poll::Ready(None);
2294                    }
2295                    std::task::Poll::Ready(Err(Some(e))) => {
2296                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2297                            e.into(),
2298                        ))));
2299                    }
2300                }
2301
2302                // A message has been received from the channel
2303                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2304
2305                std::task::Poll::Ready(Some(match header.ordinal {
2306                    0x6ee9c0ad53ec87aa => {
2307                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2308                        let mut req = fidl::new_empty!(
2309                            AdvisoryLockingAdvisoryLockRequest,
2310                            fdomain_client::fidl::FDomainResourceDialect
2311                        );
2312                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
2313                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2314                        Ok(DirectoryRequest::AdvisoryLock {
2315                            request: req.request,
2316
2317                            responder: DirectoryAdvisoryLockResponder {
2318                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2319                                tx_id: header.tx_id,
2320                            },
2321                        })
2322                    }
2323                    0x20d8a7aba2168a79 => {
2324                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2325                        let mut req = fidl::new_empty!(
2326                            fdomain_fuchsia_unknown::CloneableCloneRequest,
2327                            fdomain_client::fidl::FDomainResourceDialect
2328                        );
2329                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2330                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2331                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
2332                    }
2333                    0x5ac5d459ad7f657e => {
2334                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2335                        let mut req = fidl::new_empty!(
2336                            fidl::encoding::EmptyPayload,
2337                            fdomain_client::fidl::FDomainResourceDialect
2338                        );
2339                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2340                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2341                        Ok(DirectoryRequest::Close {
2342                            responder: DirectoryCloseResponder {
2343                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2344                                tx_id: header.tx_id,
2345                            },
2346                        })
2347                    }
2348                    0x2658edee9decfc06 => {
2349                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2350                        let mut req = fidl::new_empty!(
2351                            fidl::encoding::EmptyPayload,
2352                            fdomain_client::fidl::FDomainResourceDialect
2353                        );
2354                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2355                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2356                        Ok(DirectoryRequest::Query {
2357                            responder: DirectoryQueryResponder {
2358                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2359                                tx_id: header.tx_id,
2360                            },
2361                        })
2362                    }
2363                    0x5a61678f293ce16f => {
2364                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2365                        let mut req = fidl::new_empty!(
2366                            NodeDeprecatedCloneRequest,
2367                            fdomain_client::fidl::FDomainResourceDialect
2368                        );
2369                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
2370                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2371                        Ok(DirectoryRequest::DeprecatedClone {
2372                            flags: req.flags,
2373                            object: req.object,
2374
2375                            control_handle,
2376                        })
2377                    }
2378                    0x78985e216314dafd => {
2379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2380                        let mut req = fidl::new_empty!(
2381                            fidl::encoding::EmptyPayload,
2382                            fdomain_client::fidl::FDomainResourceDialect
2383                        );
2384                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2385                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2386                        Ok(DirectoryRequest::DeprecatedGetAttr {
2387                            responder: DirectoryDeprecatedGetAttrResponder {
2388                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2389                                tx_id: header.tx_id,
2390                            },
2391                        })
2392                    }
2393                    0x4186c0f40d938f46 => {
2394                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2395                        let mut req = fidl::new_empty!(
2396                            NodeDeprecatedSetAttrRequest,
2397                            fdomain_client::fidl::FDomainResourceDialect
2398                        );
2399                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
2400                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2401                        Ok(DirectoryRequest::DeprecatedSetAttr {
2402                            flags: req.flags,
2403                            attributes: req.attributes,
2404
2405                            responder: DirectoryDeprecatedSetAttrResponder {
2406                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2407                                tx_id: header.tx_id,
2408                            },
2409                        })
2410                    }
2411                    0x5b88fffb8eda3aa1 => {
2412                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2413                        let mut req = fidl::new_empty!(
2414                            fidl::encoding::EmptyPayload,
2415                            fdomain_client::fidl::FDomainResourceDialect
2416                        );
2417                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2418                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2419                        Ok(DirectoryRequest::DeprecatedGetFlags {
2420                            responder: DirectoryDeprecatedGetFlagsResponder {
2421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2422                                tx_id: header.tx_id,
2423                            },
2424                        })
2425                    }
2426                    0x5295b76c71fde733 => {
2427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2428                        let mut req = fidl::new_empty!(
2429                            NodeDeprecatedSetFlagsRequest,
2430                            fdomain_client::fidl::FDomainResourceDialect
2431                        );
2432                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2433                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2434                        Ok(DirectoryRequest::DeprecatedSetFlags {
2435                            flags: req.flags,
2436
2437                            responder: DirectoryDeprecatedSetFlagsResponder {
2438                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2439                                tx_id: header.tx_id,
2440                            },
2441                        })
2442                    }
2443                    0x176eb318f64ec23 => {
2444                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2445                        let mut req = fidl::new_empty!(
2446                            fidl::encoding::EmptyPayload,
2447                            fdomain_client::fidl::FDomainResourceDialect
2448                        );
2449                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2450                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2451                        Ok(DirectoryRequest::GetFlags {
2452                            responder: DirectoryGetFlagsResponder {
2453                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2454                                tx_id: header.tx_id,
2455                            },
2456                        })
2457                    }
2458                    0x55a8028685791ea8 => {
2459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2460                        let mut req = fidl::new_empty!(
2461                            NodeSetFlagsRequest,
2462                            fdomain_client::fidl::FDomainResourceDialect
2463                        );
2464                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
2465                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2466                        Ok(DirectoryRequest::SetFlags {
2467                            flags: req.flags,
2468
2469                            responder: DirectorySetFlagsResponder {
2470                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2471                                tx_id: header.tx_id,
2472                            },
2473                        })
2474                    }
2475                    0x6f344a1c6b0a0610 => {
2476                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2477                        let mut req = fidl::new_empty!(
2478                            fidl::encoding::EmptyPayload,
2479                            fdomain_client::fidl::FDomainResourceDialect
2480                        );
2481                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2482                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2483                        Ok(DirectoryRequest::QueryFilesystem {
2484                            responder: DirectoryQueryFilesystemResponder {
2485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2486                                tx_id: header.tx_id,
2487                            },
2488                        })
2489                    }
2490                    0x3d4396a638ea053b => {
2491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2492                        let mut req = fidl::new_empty!(
2493                            NodeGetAttributesRequest,
2494                            fdomain_client::fidl::FDomainResourceDialect
2495                        );
2496                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2497                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2498                        Ok(DirectoryRequest::GetAttributes {
2499                            query: req.query,
2500
2501                            responder: DirectoryGetAttributesResponder {
2502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2503                                tx_id: header.tx_id,
2504                            },
2505                        })
2506                    }
2507                    0x3308c1da5a89bf08 => {
2508                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2509                        let mut req = fidl::new_empty!(
2510                            MutableNodeAttributes,
2511                            fdomain_client::fidl::FDomainResourceDialect
2512                        );
2513                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
2514                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2515                        Ok(DirectoryRequest::UpdateAttributes {
2516                            payload: req,
2517                            responder: DirectoryUpdateAttributesResponder {
2518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2519                                tx_id: header.tx_id,
2520                            },
2521                        })
2522                    }
2523                    0x2c5c27ca0ab5dc49 => {
2524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2525                        let mut req = fidl::new_empty!(
2526                            fidl::encoding::EmptyPayload,
2527                            fdomain_client::fidl::FDomainResourceDialect
2528                        );
2529                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2530                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2531                        Ok(DirectoryRequest::Sync {
2532                            responder: DirectorySyncResponder {
2533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2534                                tx_id: header.tx_id,
2535                            },
2536                        })
2537                    }
2538                    0x4b61033de007fcd0 => {
2539                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2540                        let mut req = fidl::new_empty!(
2541                            NodeListExtendedAttributesRequest,
2542                            fdomain_client::fidl::FDomainResourceDialect
2543                        );
2544                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
2545                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2546                        Ok(DirectoryRequest::ListExtendedAttributes {
2547                            iterator: req.iterator,
2548
2549                            control_handle,
2550                        })
2551                    }
2552                    0x45ffa3ccfdeb76db => {
2553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2554                        let mut req = fidl::new_empty!(
2555                            NodeGetExtendedAttributeRequest,
2556                            fdomain_client::fidl::FDomainResourceDialect
2557                        );
2558                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2559                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2560                        Ok(DirectoryRequest::GetExtendedAttribute {
2561                            name: req.name,
2562
2563                            responder: DirectoryGetExtendedAttributeResponder {
2564                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2565                                tx_id: header.tx_id,
2566                            },
2567                        })
2568                    }
2569                    0x4a951362f681f23c => {
2570                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2571                        let mut req = fidl::new_empty!(
2572                            NodeSetExtendedAttributeRequest,
2573                            fdomain_client::fidl::FDomainResourceDialect
2574                        );
2575                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2576                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2577                        Ok(DirectoryRequest::SetExtendedAttribute {
2578                            name: req.name,
2579                            value: req.value,
2580                            mode: req.mode,
2581
2582                            responder: DirectorySetExtendedAttributeResponder {
2583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2584                                tx_id: header.tx_id,
2585                            },
2586                        })
2587                    }
2588                    0x7a0b9f3a9bf9032d => {
2589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2590                        let mut req = fidl::new_empty!(
2591                            NodeRemoveExtendedAttributeRequest,
2592                            fdomain_client::fidl::FDomainResourceDialect
2593                        );
2594                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
2595                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2596                        Ok(DirectoryRequest::RemoveExtendedAttribute {
2597                            name: req.name,
2598
2599                            responder: DirectoryRemoveExtendedAttributeResponder {
2600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2601                                tx_id: header.tx_id,
2602                            },
2603                        })
2604                    }
2605                    0x2c5044561d685ec0 => {
2606                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2607                        let mut req = fidl::new_empty!(
2608                            DirectoryDeprecatedOpenRequest,
2609                            fdomain_client::fidl::FDomainResourceDialect
2610                        );
2611                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2612                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2613                        Ok(DirectoryRequest::DeprecatedOpen {
2614                            flags: req.flags,
2615                            mode: req.mode,
2616                            path: req.path,
2617                            object: req.object,
2618
2619                            control_handle,
2620                        })
2621                    }
2622                    0x568ddcb9a9cbb6d9 => {
2623                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2624                        let mut req = fidl::new_empty!(
2625                            DirectoryOpenRequest,
2626                            fdomain_client::fidl::FDomainResourceDialect
2627                        );
2628                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2629                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2630                        Ok(DirectoryRequest::Open {
2631                            path: req.path,
2632                            flags: req.flags,
2633                            options: req.options,
2634                            object: req.object,
2635
2636                            control_handle,
2637                        })
2638                    }
2639                    0x3582806bf27faa0a => {
2640                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2641                        let mut req = fidl::new_empty!(
2642                            DirectoryReadDirentsRequest,
2643                            fdomain_client::fidl::FDomainResourceDialect
2644                        );
2645                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
2646                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2647                        Ok(DirectoryRequest::ReadDirents {
2648                            max_bytes: req.max_bytes,
2649
2650                            responder: DirectoryReadDirentsResponder {
2651                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2652                                tx_id: header.tx_id,
2653                            },
2654                        })
2655                    }
2656                    0x16b1202af0f34c71 => {
2657                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2658                        let mut req = fidl::new_empty!(
2659                            fidl::encoding::EmptyPayload,
2660                            fdomain_client::fidl::FDomainResourceDialect
2661                        );
2662                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2663                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2664                        Ok(DirectoryRequest::Rewind {
2665                            responder: DirectoryRewindResponder {
2666                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2667                                tx_id: header.tx_id,
2668                            },
2669                        })
2670                    }
2671                    0x26ae9d18763c8655 => {
2672                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2673                        let mut req = fidl::new_empty!(
2674                            fidl::encoding::EmptyPayload,
2675                            fdomain_client::fidl::FDomainResourceDialect
2676                        );
2677                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2678                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2679                        Ok(DirectoryRequest::GetToken {
2680                            responder: DirectoryGetTokenResponder {
2681                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2682                                tx_id: header.tx_id,
2683                            },
2684                        })
2685                    }
2686                    0x740604c0c7c930e7 => {
2687                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2688                        let mut req = fidl::new_empty!(
2689                            DirectoryLinkRequest,
2690                            fdomain_client::fidl::FDomainResourceDialect
2691                        );
2692                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
2693                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2694                        Ok(DirectoryRequest::Link {
2695                            src: req.src,
2696                            dst_parent_token: req.dst_parent_token,
2697                            dst: req.dst,
2698
2699                            responder: DirectoryLinkResponder {
2700                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2701                                tx_id: header.tx_id,
2702                            },
2703                        })
2704                    }
2705                    0x750a0326a78d7bed => {
2706                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2707                        let mut req = fidl::new_empty!(
2708                            DirectoryUnlinkRequest,
2709                            fdomain_client::fidl::FDomainResourceDialect
2710                        );
2711                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2712                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2713                        Ok(DirectoryRequest::Unlink {
2714                            name: req.name,
2715                            options: req.options,
2716
2717                            responder: DirectoryUnlinkResponder {
2718                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2719                                tx_id: header.tx_id,
2720                            },
2721                        })
2722                    }
2723                    0x7060e7723b9928de => {
2724                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2725                        let mut req = fidl::new_empty!(
2726                            DirectoryRenameRequest,
2727                            fdomain_client::fidl::FDomainResourceDialect
2728                        );
2729                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
2730                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2731                        Ok(DirectoryRequest::Rename {
2732                            src: req.src,
2733                            dst_parent_token: req.dst_parent_token,
2734                            dst: req.dst,
2735
2736                            responder: DirectoryRenameResponder {
2737                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2738                                tx_id: header.tx_id,
2739                            },
2740                        })
2741                    }
2742                    0x21ce0f19ec043889 => {
2743                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2744                        let mut req = fidl::new_empty!(
2745                            DirectoryCreateSymlinkRequest,
2746                            fdomain_client::fidl::FDomainResourceDialect
2747                        );
2748                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
2749                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2750                        Ok(DirectoryRequest::CreateSymlink {
2751                            name: req.name,
2752                            target: req.target,
2753                            connection: req.connection,
2754
2755                            responder: DirectoryCreateSymlinkResponder {
2756                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2757                                tx_id: header.tx_id,
2758                            },
2759                        })
2760                    }
2761                    0x5717193a59d66d91 => {
2762                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2763                        let mut req = fidl::new_empty!(
2764                            DirectoryWatchRequest,
2765                            fdomain_client::fidl::FDomainResourceDialect
2766                        );
2767                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2768                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
2769                        Ok(DirectoryRequest::Watch {
2770                            mask: req.mask,
2771                            options: req.options,
2772                            watcher: req.watcher,
2773
2774                            responder: DirectoryWatchResponder {
2775                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2776                                tx_id: header.tx_id,
2777                            },
2778                        })
2779                    }
2780                    _ if header.tx_id == 0
2781                        && header
2782                            .dynamic_flags()
2783                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2784                    {
2785                        Ok(DirectoryRequest::_UnknownMethod {
2786                            ordinal: header.ordinal,
2787                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2788                            method_type: fidl::MethodType::OneWay,
2789                        })
2790                    }
2791                    _ if header
2792                        .dynamic_flags()
2793                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2794                    {
2795                        this.inner.send_framework_err(
2796                            fidl::encoding::FrameworkErr::UnknownMethod,
2797                            header.tx_id,
2798                            header.ordinal,
2799                            header.dynamic_flags(),
2800                            (bytes, handles),
2801                        )?;
2802                        Ok(DirectoryRequest::_UnknownMethod {
2803                            ordinal: header.ordinal,
2804                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
2805                            method_type: fidl::MethodType::TwoWay,
2806                        })
2807                    }
2808                    _ => Err(fidl::Error::UnknownOrdinal {
2809                        ordinal: header.ordinal,
2810                        protocol_name:
2811                            <DirectoryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2812                    }),
2813                }))
2814            },
2815        )
2816    }
2817}
2818
2819/// Directory defines a node which is capable of containing other Objects.
2820#[derive(Debug)]
2821pub enum DirectoryRequest {
2822    /// Acquires an advisory lock on the underlying file.
2823    ///
2824    /// The lock lasts until either this connection is closed or
2825    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
2826    /// explicitly.
2827    ///
2828    /// Advisory locks are purely advisory. They do not prevent actual read or
2829    /// write operations from occurring on the file, either through this
2830    /// connection or through other connections.
2831    ///
2832    /// This method requires the following rights:
2833    ///
2834    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
2835    /// * [`Rights.WRITE_BYTES`] if `request.type` is
2836    ///   [`AdvisoryLockType.WRITE`].
2837    ///
2838    /// # Errors
2839    ///
2840    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
2841    ///   example, another connection might hold a conflicting lock type.
2842    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
2843    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
2844    ///   to acquire the given type of lock.
2845    AdvisoryLock {
2846        request: AdvisoryLockRequest,
2847        responder: DirectoryAdvisoryLockResponder,
2848    },
2849    Clone {
2850        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
2851        control_handle: DirectoryControlHandle,
2852    },
2853    /// Terminates the connection.
2854    ///
2855    /// After calling `Close`, the client must not send any other requests.
2856    ///
2857    /// Servers, after sending the status response, should close the connection
2858    /// regardless of status and without sending an epitaph.
2859    ///
2860    /// Closing the client end of the channel should be semantically equivalent
2861    /// to calling `Close` without knowing when the close has completed or its
2862    /// status.
2863    Close {
2864        responder: DirectoryCloseResponder,
2865    },
2866    Query {
2867        responder: DirectoryQueryResponder,
2868    },
2869    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
2870    DeprecatedClone {
2871        flags: OpenFlags,
2872        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
2873        control_handle: DirectoryControlHandle,
2874    },
2875    /// DEPRECATED - Use `Node.GetAttributes` instead.
2876    DeprecatedGetAttr {
2877        responder: DirectoryDeprecatedGetAttrResponder,
2878    },
2879    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
2880    DeprecatedSetAttr {
2881        flags: NodeAttributeFlags,
2882        attributes: NodeAttributes,
2883        responder: DirectoryDeprecatedSetAttrResponder,
2884    },
2885    /// [DEPRECATED - Use new GetFlags method instead.]
2886    DeprecatedGetFlags {
2887        responder: DirectoryDeprecatedGetFlagsResponder,
2888    },
2889    /// [DEPRECATED - Use new SetFlags method instead.]
2890    DeprecatedSetFlags {
2891        flags: OpenFlags,
2892        responder: DirectoryDeprecatedSetFlagsResponder,
2893    },
2894    /// Queries the flags that apply to this node after it has been opened/created. This method does
2895    /// not require any rights.
2896    ///
2897    /// Note that the final set of flags that apply to the connection may differ from those
2898    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2899    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2900    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2901    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2902    GetFlags {
2903        responder: DirectoryGetFlagsResponder,
2904    },
2905    /// Sets the flags that apply to this node after it has been opened. This method does not
2906    /// require any rights.
2907    ///
2908    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2909    /// clear append mode.
2910    ///
2911    /// Errors:
2912    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2913    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2914    SetFlags {
2915        flags: Flags,
2916        responder: DirectorySetFlagsResponder,
2917    },
2918    /// Query the filesystem for filesystem-specific information.
2919    QueryFilesystem {
2920        responder: DirectoryQueryFilesystemResponder,
2921    },
2922    /// Acquires information about the node.
2923    ///
2924    /// The attributes of a node should be stable, independent of the
2925    /// specific protocol used to access it.
2926    ///
2927    /// If a particular attribute is not applicable or not supported,
2928    /// filesystems should leave the corresponding field absent.
2929    ///
2930    /// + `query` a bit-mask specifying which attributes to fetch. The server
2931    ///   should not return more than necessary.
2932    /// - `attributes` the returned attributes.
2933    ///
2934    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2935    GetAttributes {
2936        query: NodeAttributesQuery,
2937        responder: DirectoryGetAttributesResponder,
2938    },
2939    /// Updates information about the node.
2940    ///
2941    /// + `attributes` the presence of a table field in `attributes` indicates
2942    /// the intent to update the corresponding attribute.
2943    ///
2944    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2945    ///
2946    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2947    UpdateAttributes {
2948        payload: MutableNodeAttributes,
2949        responder: DirectoryUpdateAttributesResponder,
2950    },
2951    /// Synchronizes updates to the node to the underlying media, if it exists.
2952    ///
2953    /// This method will return when the filesystem server has flushed the
2954    /// relevant updates to the underlying media, but does not guarantee the
2955    /// underlying media has persisted the information, nor that any information
2956    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2957    /// between operations.
2958    ///
2959    /// This method does not require any rights.
2960    Sync {
2961        responder: DirectorySyncResponder,
2962    },
2963    /// Creates an iterator over all the extended attribute names associated
2964    /// with this node. If an error occurs it is returned as an epitaph on the
2965    /// iterator request channel, and then the channel is closed.
2966    ///
2967    /// GetExtendedAttributes can be used with any of these names to retrieve
2968    /// the associated value.
2969    ///
2970    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2971    ListExtendedAttributes {
2972        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
2973        control_handle: DirectoryControlHandle,
2974    },
2975    /// Get the value associated with the given attribute `name` for this node.
2976    ///
2977    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2978    /// particular structure is imposed on them.
2979    ///
2980    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2981    GetExtendedAttribute {
2982        name: Vec<u8>,
2983        responder: DirectoryGetExtendedAttributeResponder,
2984    },
2985    /// Set the value for the given attribute `name` to `value` for this node.
2986    ///
2987    /// The attribute name may exist, in which case the attribute is updated.
2988    /// If the attribute doesn't exist, it is created. The name should have no
2989    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2990    ///
2991    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2992    SetExtendedAttribute {
2993        name: Vec<u8>,
2994        value: ExtendedAttributeValue,
2995        mode: SetExtendedAttributeMode,
2996        responder: DirectorySetExtendedAttributeResponder,
2997    },
2998    /// Remove the specified extended attribute.
2999    ///
3000    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3001    ///
3002    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3003    RemoveExtendedAttribute {
3004        name: Vec<u8>,
3005        responder: DirectoryRemoveExtendedAttributeResponder,
3006    },
3007    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3008    DeprecatedOpen {
3009        flags: OpenFlags,
3010        mode: ModeType,
3011        path: String,
3012        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
3013        control_handle: DirectoryControlHandle,
3014    },
3015    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3016    /// epitaph sent on the `object` channel.
3017    ///
3018    /// Errors:
3019    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3020    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3021    Open {
3022        path: String,
3023        flags: Flags,
3024        options: Options,
3025        object: fdomain_client::Channel,
3026        control_handle: DirectoryControlHandle,
3027    },
3028    /// Reads a collection of variably sized dirents into a buffer.
3029    /// The number of dirents in a directory may be very large: akin to
3030    /// calling read multiple times on a file, directories have a seek
3031    /// offset which is updated on subsequent calls to ReadDirents.
3032    /// Each call to ReadDirents will only return whole dirent structures,
3033    /// they will not get split across ReadDirent calls. When the seek
3034    /// offset reaches the end, `dirents` will be empty.
3035    ///
3036    /// These dirents are of the form:
3037    /// ```
3038    /// struct dirent {
3039    ///   // Describes the inode of the entry.
3040    ///   uint64 ino;
3041    ///   // Describes the length of the dirent name in bytes.
3042    ///   uint8 size;
3043    ///   // Describes the type of the entry. Aligned with the
3044    ///   // POSIX d_type values. Use `DirentType` constants.
3045    ///   uint8 type;
3046    ///   // Unterminated name of entry.
3047    ///   char name[0];
3048    /// }
3049    /// ```
3050    ///
3051    /// This method does not require any rights, since one could always probe for
3052    /// directory contents by triggering name conflicts during file creation.
3053    ReadDirents {
3054        max_bytes: u64,
3055        responder: DirectoryReadDirentsResponder,
3056    },
3057    /// Resets the directory seek offset.
3058    ///
3059    /// This method does not require any rights, similar to ReadDirents.
3060    Rewind {
3061        responder: DirectoryRewindResponder,
3062    },
3063    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3064    /// in time. The token will remain valid for as long as the connection requesting the token
3065    /// remains open.
3066    ///
3067    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3068    /// `ZX_ERR_BAD_HANDLE`.
3069    GetToken {
3070        responder: DirectoryGetTokenResponder,
3071    },
3072    /// Creates a link to an object named src by the name dst, within a directory represented by
3073    /// token.
3074    ///
3075    /// `src` must be a resolved object name. Including "/" in the string will
3076    /// return `ZX_ERR_INVALID_ARGS`.
3077    ///
3078    /// `dst` must be a resolved object name. Including "/" in the string will
3079    /// return `ZX_ERR_INVALID_ARGS`.
3080    ///
3081    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
3082    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
3083    ///
3084    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
3085    /// there are two actors operating concurrently, and one actor performs a rename that affects
3086    /// the source within this directory, and the other does a link, each will appear to occur
3087    /// atomically in an unspecified order.
3088    Link {
3089        src: String,
3090        dst_parent_token: fdomain_client::NullableHandle,
3091        dst: String,
3092        responder: DirectoryLinkResponder,
3093    },
3094    /// Removes a child node from the this directory's list of entries.
3095    ///
3096    /// Note: this does not guarantee that the underlying object is destroyed.
3097    /// Although the link will be removed from the containing directory,
3098    /// objects with multiple references (such as files which are still open)
3099    /// will not actually be destroyed until all references are closed.
3100    ///
3101    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
3102    ///   [`Rights.WRITE_BYTES`].
3103    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
3104    ///   support writing.
3105    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
3106    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
3107    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
3108    ///   containing a remote channel.
3109    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
3110    ///     something other than a directory was found.
3111    ///
3112    /// Other errors may be returned for filesystem-specific reasons.
3113    ///
3114    /// This method requires the following rights:
3115    ///
3116    /// * [`Rights.ENUMERATE`]
3117    /// * [`Rights.MODIFY_DIRECTORY`]
3118    Unlink {
3119        name: String,
3120        options: UnlinkOptions,
3121        responder: DirectoryUnlinkResponder,
3122    },
3123    /// Renames a node named `src` to the name `dst`, in a directory represented
3124    /// by `dst_parent_token`.
3125    ///
3126    /// `src` and `dst` must be valid node names.
3127    /// See [`Name`] for what constitutes a valid name.
3128    ///
3129    /// This method requires the following rights on both the current connection, and the connection
3130    /// identified by `dst_parent_token`:
3131    ///
3132    /// * [`Rights.ENUMERATE`]
3133    /// * [`Rights.MODIFY_DIRECTORY`]
3134    ///
3135    /// The following requirements are necessary to avoid rights escalations.
3136    ///
3137    /// If the source and destination directory differ, the source directory must also have the
3138    /// maximal set of abilities supported for files, which would typically be
3139    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
3140    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
3141    /// right.
3142    ///
3143    /// If `src` refers to a directory, and differs from the destination directory, then the source
3144    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
3145    ///
3146    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
3147    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
3148    Rename {
3149        src: String,
3150        dst_parent_token: fdomain_client::Event,
3151        dst: String,
3152        responder: DirectoryRenameResponder,
3153    },
3154    /// Creates a symbolic link.
3155    ///
3156    /// `name` is the name to be given to the created symbolic link.
3157    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
3158    /// will perform no validation of `target` except for a server chosen maximum length.
3159    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
3160    /// on the successfully created node.
3161    ///
3162    /// * [`Rights.MODIFY_DIRECTORY`]
3163    ///
3164    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
3165    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
3166    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
3167    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
3168    CreateSymlink {
3169        name: String,
3170        target: Vec<u8>,
3171        connection: Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3172        responder: DirectoryCreateSymlinkResponder,
3173    },
3174    /// Watches a directory, receiving events of added messages on the
3175    /// watcher request channel.
3176    ///
3177    /// Options must be zero; it is reserved.
3178    ///
3179    /// This method does not require any rights, similar to ReadDirents.
3180    Watch {
3181        mask: WatchMask,
3182        options: u32,
3183        watcher: fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3184        responder: DirectoryWatchResponder,
3185    },
3186    /// An interaction was received which does not match any known method.
3187    #[non_exhaustive]
3188    _UnknownMethod {
3189        /// Ordinal of the method that was called.
3190        ordinal: u64,
3191        control_handle: DirectoryControlHandle,
3192        method_type: fidl::MethodType,
3193    },
3194}
3195
3196impl DirectoryRequest {
3197    #[allow(irrefutable_let_patterns)]
3198    pub fn into_advisory_lock(
3199        self,
3200    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
3201        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
3202            Some((request, responder))
3203        } else {
3204            None
3205        }
3206    }
3207
3208    #[allow(irrefutable_let_patterns)]
3209    pub fn into_clone(
3210        self,
3211    ) -> Option<(
3212        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
3213        DirectoryControlHandle,
3214    )> {
3215        if let DirectoryRequest::Clone { request, control_handle } = self {
3216            Some((request, control_handle))
3217        } else {
3218            None
3219        }
3220    }
3221
3222    #[allow(irrefutable_let_patterns)]
3223    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
3224        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
3225    }
3226
3227    #[allow(irrefutable_let_patterns)]
3228    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
3229        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
3230    }
3231
3232    #[allow(irrefutable_let_patterns)]
3233    pub fn into_deprecated_clone(
3234        self,
3235    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, DirectoryControlHandle)>
3236    {
3237        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
3238            Some((flags, object, control_handle))
3239        } else {
3240            None
3241        }
3242    }
3243
3244    #[allow(irrefutable_let_patterns)]
3245    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
3246        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
3247            Some((responder))
3248        } else {
3249            None
3250        }
3251    }
3252
3253    #[allow(irrefutable_let_patterns)]
3254    pub fn into_deprecated_set_attr(
3255        self,
3256    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
3257        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
3258            Some((flags, attributes, responder))
3259        } else {
3260            None
3261        }
3262    }
3263
3264    #[allow(irrefutable_let_patterns)]
3265    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
3266        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
3267            Some((responder))
3268        } else {
3269            None
3270        }
3271    }
3272
3273    #[allow(irrefutable_let_patterns)]
3274    pub fn into_deprecated_set_flags(
3275        self,
3276    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
3277        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
3278            Some((flags, responder))
3279        } else {
3280            None
3281        }
3282    }
3283
3284    #[allow(irrefutable_let_patterns)]
3285    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
3286        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
3287    }
3288
3289    #[allow(irrefutable_let_patterns)]
3290    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
3291        if let DirectoryRequest::SetFlags { flags, responder } = self {
3292            Some((flags, responder))
3293        } else {
3294            None
3295        }
3296    }
3297
3298    #[allow(irrefutable_let_patterns)]
3299    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
3300        if let DirectoryRequest::QueryFilesystem { responder } = self {
3301            Some((responder))
3302        } else {
3303            None
3304        }
3305    }
3306
3307    #[allow(irrefutable_let_patterns)]
3308    pub fn into_get_attributes(
3309        self,
3310    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
3311        if let DirectoryRequest::GetAttributes { query, responder } = self {
3312            Some((query, responder))
3313        } else {
3314            None
3315        }
3316    }
3317
3318    #[allow(irrefutable_let_patterns)]
3319    pub fn into_update_attributes(
3320        self,
3321    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
3322        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
3323            Some((payload, responder))
3324        } else {
3325            None
3326        }
3327    }
3328
3329    #[allow(irrefutable_let_patterns)]
3330    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
3331        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
3332    }
3333
3334    #[allow(irrefutable_let_patterns)]
3335    pub fn into_list_extended_attributes(
3336        self,
3337    ) -> Option<(
3338        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
3339        DirectoryControlHandle,
3340    )> {
3341        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
3342            Some((iterator, control_handle))
3343        } else {
3344            None
3345        }
3346    }
3347
3348    #[allow(irrefutable_let_patterns)]
3349    pub fn into_get_extended_attribute(
3350        self,
3351    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
3352        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
3353            Some((name, responder))
3354        } else {
3355            None
3356        }
3357    }
3358
3359    #[allow(irrefutable_let_patterns)]
3360    pub fn into_set_extended_attribute(
3361        self,
3362    ) -> Option<(
3363        Vec<u8>,
3364        ExtendedAttributeValue,
3365        SetExtendedAttributeMode,
3366        DirectorySetExtendedAttributeResponder,
3367    )> {
3368        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
3369            Some((name, value, mode, responder))
3370        } else {
3371            None
3372        }
3373    }
3374
3375    #[allow(irrefutable_let_patterns)]
3376    pub fn into_remove_extended_attribute(
3377        self,
3378    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
3379        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
3380            Some((name, responder))
3381        } else {
3382            None
3383        }
3384    }
3385
3386    #[allow(irrefutable_let_patterns)]
3387    pub fn into_deprecated_open(
3388        self,
3389    ) -> Option<(
3390        OpenFlags,
3391        ModeType,
3392        String,
3393        fdomain_client::fidl::ServerEnd<NodeMarker>,
3394        DirectoryControlHandle,
3395    )> {
3396        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
3397        {
3398            Some((flags, mode, path, object, control_handle))
3399        } else {
3400            None
3401        }
3402    }
3403
3404    #[allow(irrefutable_let_patterns)]
3405    pub fn into_open(
3406        self,
3407    ) -> Option<(String, Flags, Options, fdomain_client::Channel, DirectoryControlHandle)> {
3408        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
3409            Some((path, flags, options, object, control_handle))
3410        } else {
3411            None
3412        }
3413    }
3414
3415    #[allow(irrefutable_let_patterns)]
3416    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
3417        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
3418            Some((max_bytes, responder))
3419        } else {
3420            None
3421        }
3422    }
3423
3424    #[allow(irrefutable_let_patterns)]
3425    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
3426        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
3427    }
3428
3429    #[allow(irrefutable_let_patterns)]
3430    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
3431        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
3432    }
3433
3434    #[allow(irrefutable_let_patterns)]
3435    pub fn into_link(
3436        self,
3437    ) -> Option<(String, fdomain_client::NullableHandle, String, DirectoryLinkResponder)> {
3438        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
3439            Some((src, dst_parent_token, dst, responder))
3440        } else {
3441            None
3442        }
3443    }
3444
3445    #[allow(irrefutable_let_patterns)]
3446    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
3447        if let DirectoryRequest::Unlink { name, options, responder } = self {
3448            Some((name, options, responder))
3449        } else {
3450            None
3451        }
3452    }
3453
3454    #[allow(irrefutable_let_patterns)]
3455    pub fn into_rename(
3456        self,
3457    ) -> Option<(String, fdomain_client::Event, String, DirectoryRenameResponder)> {
3458        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
3459            Some((src, dst_parent_token, dst, responder))
3460        } else {
3461            None
3462        }
3463    }
3464
3465    #[allow(irrefutable_let_patterns)]
3466    pub fn into_create_symlink(
3467        self,
3468    ) -> Option<(
3469        String,
3470        Vec<u8>,
3471        Option<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
3472        DirectoryCreateSymlinkResponder,
3473    )> {
3474        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
3475            Some((name, target, connection, responder))
3476        } else {
3477            None
3478        }
3479    }
3480
3481    #[allow(irrefutable_let_patterns)]
3482    pub fn into_watch(
3483        self,
3484    ) -> Option<(
3485        WatchMask,
3486        u32,
3487        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
3488        DirectoryWatchResponder,
3489    )> {
3490        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
3491            Some((mask, options, watcher, responder))
3492        } else {
3493            None
3494        }
3495    }
3496
3497    /// Name of the method defined in FIDL
3498    pub fn method_name(&self) -> &'static str {
3499        match *self {
3500            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
3501            DirectoryRequest::Clone { .. } => "clone",
3502            DirectoryRequest::Close { .. } => "close",
3503            DirectoryRequest::Query { .. } => "query",
3504            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
3505            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
3506            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
3507            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
3508            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
3509            DirectoryRequest::GetFlags { .. } => "get_flags",
3510            DirectoryRequest::SetFlags { .. } => "set_flags",
3511            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
3512            DirectoryRequest::GetAttributes { .. } => "get_attributes",
3513            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
3514            DirectoryRequest::Sync { .. } => "sync",
3515            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
3516            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
3517            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
3518            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
3519            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
3520            DirectoryRequest::Open { .. } => "open",
3521            DirectoryRequest::ReadDirents { .. } => "read_dirents",
3522            DirectoryRequest::Rewind { .. } => "rewind",
3523            DirectoryRequest::GetToken { .. } => "get_token",
3524            DirectoryRequest::Link { .. } => "link",
3525            DirectoryRequest::Unlink { .. } => "unlink",
3526            DirectoryRequest::Rename { .. } => "rename",
3527            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
3528            DirectoryRequest::Watch { .. } => "watch",
3529            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3530                "unknown one-way method"
3531            }
3532            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3533                "unknown two-way method"
3534            }
3535        }
3536    }
3537}
3538
3539#[derive(Debug, Clone)]
3540pub struct DirectoryControlHandle {
3541    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3542}
3543
3544impl fdomain_client::fidl::ControlHandle for DirectoryControlHandle {
3545    fn shutdown(&self) {
3546        self.inner.shutdown()
3547    }
3548
3549    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3550        self.inner.shutdown_with_epitaph(status)
3551    }
3552
3553    fn is_closed(&self) -> bool {
3554        self.inner.channel().is_closed()
3555    }
3556    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3557        self.inner.channel().on_closed()
3558    }
3559}
3560
3561impl DirectoryControlHandle {
3562    pub fn send_on_open_(
3563        &self,
3564        mut s: i32,
3565        mut info: Option<NodeInfoDeprecated>,
3566    ) -> Result<(), fidl::Error> {
3567        self.inner.send::<NodeOnOpenRequest>(
3568            (s, info.as_mut()),
3569            0,
3570            0x7fc7bbb1dbfd1972,
3571            fidl::encoding::DynamicFlags::FLEXIBLE,
3572        )
3573    }
3574
3575    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
3576        self.inner.send::<Representation>(
3577            &mut payload,
3578            0,
3579            0x5cb40567d80a510c,
3580            fidl::encoding::DynamicFlags::empty(),
3581        )
3582    }
3583}
3584
3585#[must_use = "FIDL methods require a response to be sent"]
3586#[derive(Debug)]
3587pub struct DirectoryAdvisoryLockResponder {
3588    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3589    tx_id: u32,
3590}
3591
3592/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3593/// if the responder is dropped without sending a response, so that the client
3594/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3595impl std::ops::Drop for DirectoryAdvisoryLockResponder {
3596    fn drop(&mut self) {
3597        self.control_handle.shutdown();
3598        // Safety: drops once, never accessed again
3599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3600    }
3601}
3602
3603impl fdomain_client::fidl::Responder for DirectoryAdvisoryLockResponder {
3604    type ControlHandle = DirectoryControlHandle;
3605
3606    fn control_handle(&self) -> &DirectoryControlHandle {
3607        &self.control_handle
3608    }
3609
3610    fn drop_without_shutdown(mut self) {
3611        // Safety: drops once, never accessed again due to mem::forget
3612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3613        // Prevent Drop from running (which would shut down the channel)
3614        std::mem::forget(self);
3615    }
3616}
3617
3618impl DirectoryAdvisoryLockResponder {
3619    /// Sends a response to the FIDL transaction.
3620    ///
3621    /// Sets the channel to shutdown if an error occurs.
3622    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3623        let _result = self.send_raw(result);
3624        if _result.is_err() {
3625            self.control_handle.shutdown();
3626        }
3627        self.drop_without_shutdown();
3628        _result
3629    }
3630
3631    /// Similar to "send" but does not shutdown the channel if an error occurs.
3632    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3633        let _result = self.send_raw(result);
3634        self.drop_without_shutdown();
3635        _result
3636    }
3637
3638    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3639        self.control_handle
3640            .inner
3641            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3642                result,
3643                self.tx_id,
3644                0x6ee9c0ad53ec87aa,
3645                fidl::encoding::DynamicFlags::empty(),
3646            )
3647    }
3648}
3649
3650#[must_use = "FIDL methods require a response to be sent"]
3651#[derive(Debug)]
3652pub struct DirectoryCloseResponder {
3653    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3654    tx_id: u32,
3655}
3656
3657/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3658/// if the responder is dropped without sending a response, so that the client
3659/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3660impl std::ops::Drop for DirectoryCloseResponder {
3661    fn drop(&mut self) {
3662        self.control_handle.shutdown();
3663        // Safety: drops once, never accessed again
3664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3665    }
3666}
3667
3668impl fdomain_client::fidl::Responder for DirectoryCloseResponder {
3669    type ControlHandle = DirectoryControlHandle;
3670
3671    fn control_handle(&self) -> &DirectoryControlHandle {
3672        &self.control_handle
3673    }
3674
3675    fn drop_without_shutdown(mut self) {
3676        // Safety: drops once, never accessed again due to mem::forget
3677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3678        // Prevent Drop from running (which would shut down the channel)
3679        std::mem::forget(self);
3680    }
3681}
3682
3683impl DirectoryCloseResponder {
3684    /// Sends a response to the FIDL transaction.
3685    ///
3686    /// Sets the channel to shutdown if an error occurs.
3687    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3688        let _result = self.send_raw(result);
3689        if _result.is_err() {
3690            self.control_handle.shutdown();
3691        }
3692        self.drop_without_shutdown();
3693        _result
3694    }
3695
3696    /// Similar to "send" but does not shutdown the channel if an error occurs.
3697    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3698        let _result = self.send_raw(result);
3699        self.drop_without_shutdown();
3700        _result
3701    }
3702
3703    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3704        self.control_handle
3705            .inner
3706            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3707                result,
3708                self.tx_id,
3709                0x5ac5d459ad7f657e,
3710                fidl::encoding::DynamicFlags::empty(),
3711            )
3712    }
3713}
3714
3715#[must_use = "FIDL methods require a response to be sent"]
3716#[derive(Debug)]
3717pub struct DirectoryQueryResponder {
3718    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3719    tx_id: u32,
3720}
3721
3722/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3723/// if the responder is dropped without sending a response, so that the client
3724/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3725impl std::ops::Drop for DirectoryQueryResponder {
3726    fn drop(&mut self) {
3727        self.control_handle.shutdown();
3728        // Safety: drops once, never accessed again
3729        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3730    }
3731}
3732
3733impl fdomain_client::fidl::Responder for DirectoryQueryResponder {
3734    type ControlHandle = DirectoryControlHandle;
3735
3736    fn control_handle(&self) -> &DirectoryControlHandle {
3737        &self.control_handle
3738    }
3739
3740    fn drop_without_shutdown(mut self) {
3741        // Safety: drops once, never accessed again due to mem::forget
3742        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3743        // Prevent Drop from running (which would shut down the channel)
3744        std::mem::forget(self);
3745    }
3746}
3747
3748impl DirectoryQueryResponder {
3749    /// Sends a response to the FIDL transaction.
3750    ///
3751    /// Sets the channel to shutdown if an error occurs.
3752    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3753        let _result = self.send_raw(protocol);
3754        if _result.is_err() {
3755            self.control_handle.shutdown();
3756        }
3757        self.drop_without_shutdown();
3758        _result
3759    }
3760
3761    /// Similar to "send" but does not shutdown the channel if an error occurs.
3762    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3763        let _result = self.send_raw(protocol);
3764        self.drop_without_shutdown();
3765        _result
3766    }
3767
3768    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
3769        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
3770            (protocol,),
3771            self.tx_id,
3772            0x2658edee9decfc06,
3773            fidl::encoding::DynamicFlags::empty(),
3774        )
3775    }
3776}
3777
3778#[must_use = "FIDL methods require a response to be sent"]
3779#[derive(Debug)]
3780pub struct DirectoryDeprecatedGetAttrResponder {
3781    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3782    tx_id: u32,
3783}
3784
3785/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3786/// if the responder is dropped without sending a response, so that the client
3787/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3788impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
3789    fn drop(&mut self) {
3790        self.control_handle.shutdown();
3791        // Safety: drops once, never accessed again
3792        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3793    }
3794}
3795
3796impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetAttrResponder {
3797    type ControlHandle = DirectoryControlHandle;
3798
3799    fn control_handle(&self) -> &DirectoryControlHandle {
3800        &self.control_handle
3801    }
3802
3803    fn drop_without_shutdown(mut self) {
3804        // Safety: drops once, never accessed again due to mem::forget
3805        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3806        // Prevent Drop from running (which would shut down the channel)
3807        std::mem::forget(self);
3808    }
3809}
3810
3811impl DirectoryDeprecatedGetAttrResponder {
3812    /// Sends a response to the FIDL transaction.
3813    ///
3814    /// Sets the channel to shutdown if an error occurs.
3815    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3816        let _result = self.send_raw(s, attributes);
3817        if _result.is_err() {
3818            self.control_handle.shutdown();
3819        }
3820        self.drop_without_shutdown();
3821        _result
3822    }
3823
3824    /// Similar to "send" but does not shutdown the channel if an error occurs.
3825    pub fn send_no_shutdown_on_err(
3826        self,
3827        mut s: i32,
3828        mut attributes: &NodeAttributes,
3829    ) -> Result<(), fidl::Error> {
3830        let _result = self.send_raw(s, attributes);
3831        self.drop_without_shutdown();
3832        _result
3833    }
3834
3835    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
3836        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
3837            (s, attributes),
3838            self.tx_id,
3839            0x78985e216314dafd,
3840            fidl::encoding::DynamicFlags::empty(),
3841        )
3842    }
3843}
3844
3845#[must_use = "FIDL methods require a response to be sent"]
3846#[derive(Debug)]
3847pub struct DirectoryDeprecatedSetAttrResponder {
3848    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3849    tx_id: u32,
3850}
3851
3852/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3853/// if the responder is dropped without sending a response, so that the client
3854/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3855impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
3856    fn drop(&mut self) {
3857        self.control_handle.shutdown();
3858        // Safety: drops once, never accessed again
3859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3860    }
3861}
3862
3863impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetAttrResponder {
3864    type ControlHandle = DirectoryControlHandle;
3865
3866    fn control_handle(&self) -> &DirectoryControlHandle {
3867        &self.control_handle
3868    }
3869
3870    fn drop_without_shutdown(mut self) {
3871        // Safety: drops once, never accessed again due to mem::forget
3872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3873        // Prevent Drop from running (which would shut down the channel)
3874        std::mem::forget(self);
3875    }
3876}
3877
3878impl DirectoryDeprecatedSetAttrResponder {
3879    /// Sends a response to the FIDL transaction.
3880    ///
3881    /// Sets the channel to shutdown if an error occurs.
3882    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
3883        let _result = self.send_raw(s);
3884        if _result.is_err() {
3885            self.control_handle.shutdown();
3886        }
3887        self.drop_without_shutdown();
3888        _result
3889    }
3890
3891    /// Similar to "send" but does not shutdown the channel if an error occurs.
3892    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
3893        let _result = self.send_raw(s);
3894        self.drop_without_shutdown();
3895        _result
3896    }
3897
3898    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
3899        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
3900            (s,),
3901            self.tx_id,
3902            0x4186c0f40d938f46,
3903            fidl::encoding::DynamicFlags::empty(),
3904        )
3905    }
3906}
3907
3908#[must_use = "FIDL methods require a response to be sent"]
3909#[derive(Debug)]
3910pub struct DirectoryDeprecatedGetFlagsResponder {
3911    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3912    tx_id: u32,
3913}
3914
3915/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3916/// if the responder is dropped without sending a response, so that the client
3917/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3918impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
3919    fn drop(&mut self) {
3920        self.control_handle.shutdown();
3921        // Safety: drops once, never accessed again
3922        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3923    }
3924}
3925
3926impl fdomain_client::fidl::Responder for DirectoryDeprecatedGetFlagsResponder {
3927    type ControlHandle = DirectoryControlHandle;
3928
3929    fn control_handle(&self) -> &DirectoryControlHandle {
3930        &self.control_handle
3931    }
3932
3933    fn drop_without_shutdown(mut self) {
3934        // Safety: drops once, never accessed again due to mem::forget
3935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3936        // Prevent Drop from running (which would shut down the channel)
3937        std::mem::forget(self);
3938    }
3939}
3940
3941impl DirectoryDeprecatedGetFlagsResponder {
3942    /// Sends a response to the FIDL transaction.
3943    ///
3944    /// Sets the channel to shutdown if an error occurs.
3945    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3946        let _result = self.send_raw(s, flags);
3947        if _result.is_err() {
3948            self.control_handle.shutdown();
3949        }
3950        self.drop_without_shutdown();
3951        _result
3952    }
3953
3954    /// Similar to "send" but does not shutdown the channel if an error occurs.
3955    pub fn send_no_shutdown_on_err(
3956        self,
3957        mut s: i32,
3958        mut flags: OpenFlags,
3959    ) -> Result<(), fidl::Error> {
3960        let _result = self.send_raw(s, flags);
3961        self.drop_without_shutdown();
3962        _result
3963    }
3964
3965    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
3966        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
3967            (s, flags),
3968            self.tx_id,
3969            0x5b88fffb8eda3aa1,
3970            fidl::encoding::DynamicFlags::empty(),
3971        )
3972    }
3973}
3974
3975#[must_use = "FIDL methods require a response to be sent"]
3976#[derive(Debug)]
3977pub struct DirectoryDeprecatedSetFlagsResponder {
3978    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
3979    tx_id: u32,
3980}
3981
3982/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
3983/// if the responder is dropped without sending a response, so that the client
3984/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3985impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
3986    fn drop(&mut self) {
3987        self.control_handle.shutdown();
3988        // Safety: drops once, never accessed again
3989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3990    }
3991}
3992
3993impl fdomain_client::fidl::Responder for DirectoryDeprecatedSetFlagsResponder {
3994    type ControlHandle = DirectoryControlHandle;
3995
3996    fn control_handle(&self) -> &DirectoryControlHandle {
3997        &self.control_handle
3998    }
3999
4000    fn drop_without_shutdown(mut self) {
4001        // Safety: drops once, never accessed again due to mem::forget
4002        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4003        // Prevent Drop from running (which would shut down the channel)
4004        std::mem::forget(self);
4005    }
4006}
4007
4008impl DirectoryDeprecatedSetFlagsResponder {
4009    /// Sends a response to the FIDL transaction.
4010    ///
4011    /// Sets the channel to shutdown if an error occurs.
4012    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4013        let _result = self.send_raw(s);
4014        if _result.is_err() {
4015            self.control_handle.shutdown();
4016        }
4017        self.drop_without_shutdown();
4018        _result
4019    }
4020
4021    /// Similar to "send" but does not shutdown the channel if an error occurs.
4022    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4023        let _result = self.send_raw(s);
4024        self.drop_without_shutdown();
4025        _result
4026    }
4027
4028    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4029        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4030            (s,),
4031            self.tx_id,
4032            0x5295b76c71fde733,
4033            fidl::encoding::DynamicFlags::empty(),
4034        )
4035    }
4036}
4037
4038#[must_use = "FIDL methods require a response to be sent"]
4039#[derive(Debug)]
4040pub struct DirectoryGetFlagsResponder {
4041    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4042    tx_id: u32,
4043}
4044
4045/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4046/// if the responder is dropped without sending a response, so that the client
4047/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4048impl std::ops::Drop for DirectoryGetFlagsResponder {
4049    fn drop(&mut self) {
4050        self.control_handle.shutdown();
4051        // Safety: drops once, never accessed again
4052        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4053    }
4054}
4055
4056impl fdomain_client::fidl::Responder for DirectoryGetFlagsResponder {
4057    type ControlHandle = DirectoryControlHandle;
4058
4059    fn control_handle(&self) -> &DirectoryControlHandle {
4060        &self.control_handle
4061    }
4062
4063    fn drop_without_shutdown(mut self) {
4064        // Safety: drops once, never accessed again due to mem::forget
4065        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4066        // Prevent Drop from running (which would shut down the channel)
4067        std::mem::forget(self);
4068    }
4069}
4070
4071impl DirectoryGetFlagsResponder {
4072    /// Sends a response to the FIDL transaction.
4073    ///
4074    /// Sets the channel to shutdown if an error occurs.
4075    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4076        let _result = self.send_raw(result);
4077        if _result.is_err() {
4078            self.control_handle.shutdown();
4079        }
4080        self.drop_without_shutdown();
4081        _result
4082    }
4083
4084    /// Similar to "send" but does not shutdown the channel if an error occurs.
4085    pub fn send_no_shutdown_on_err(
4086        self,
4087        mut result: Result<Flags, i32>,
4088    ) -> Result<(), fidl::Error> {
4089        let _result = self.send_raw(result);
4090        self.drop_without_shutdown();
4091        _result
4092    }
4093
4094    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
4095        self.control_handle
4096            .inner
4097            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
4098                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
4099                self.tx_id,
4100                0x176eb318f64ec23,
4101                fidl::encoding::DynamicFlags::FLEXIBLE,
4102            )
4103    }
4104}
4105
4106#[must_use = "FIDL methods require a response to be sent"]
4107#[derive(Debug)]
4108pub struct DirectorySetFlagsResponder {
4109    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4110    tx_id: u32,
4111}
4112
4113/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4114/// if the responder is dropped without sending a response, so that the client
4115/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4116impl std::ops::Drop for DirectorySetFlagsResponder {
4117    fn drop(&mut self) {
4118        self.control_handle.shutdown();
4119        // Safety: drops once, never accessed again
4120        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4121    }
4122}
4123
4124impl fdomain_client::fidl::Responder for DirectorySetFlagsResponder {
4125    type ControlHandle = DirectoryControlHandle;
4126
4127    fn control_handle(&self) -> &DirectoryControlHandle {
4128        &self.control_handle
4129    }
4130
4131    fn drop_without_shutdown(mut self) {
4132        // Safety: drops once, never accessed again due to mem::forget
4133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4134        // Prevent Drop from running (which would shut down the channel)
4135        std::mem::forget(self);
4136    }
4137}
4138
4139impl DirectorySetFlagsResponder {
4140    /// Sends a response to the FIDL transaction.
4141    ///
4142    /// Sets the channel to shutdown if an error occurs.
4143    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4144        let _result = self.send_raw(result);
4145        if _result.is_err() {
4146            self.control_handle.shutdown();
4147        }
4148        self.drop_without_shutdown();
4149        _result
4150    }
4151
4152    /// Similar to "send" but does not shutdown the channel if an error occurs.
4153    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4154        let _result = self.send_raw(result);
4155        self.drop_without_shutdown();
4156        _result
4157    }
4158
4159    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4160        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4161            fidl::encoding::EmptyStruct,
4162            i32,
4163        >>(
4164            fidl::encoding::FlexibleResult::new(result),
4165            self.tx_id,
4166            0x55a8028685791ea8,
4167            fidl::encoding::DynamicFlags::FLEXIBLE,
4168        )
4169    }
4170}
4171
4172#[must_use = "FIDL methods require a response to be sent"]
4173#[derive(Debug)]
4174pub struct DirectoryQueryFilesystemResponder {
4175    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4176    tx_id: u32,
4177}
4178
4179/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4180/// if the responder is dropped without sending a response, so that the client
4181/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4182impl std::ops::Drop for DirectoryQueryFilesystemResponder {
4183    fn drop(&mut self) {
4184        self.control_handle.shutdown();
4185        // Safety: drops once, never accessed again
4186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4187    }
4188}
4189
4190impl fdomain_client::fidl::Responder for DirectoryQueryFilesystemResponder {
4191    type ControlHandle = DirectoryControlHandle;
4192
4193    fn control_handle(&self) -> &DirectoryControlHandle {
4194        &self.control_handle
4195    }
4196
4197    fn drop_without_shutdown(mut self) {
4198        // Safety: drops once, never accessed again due to mem::forget
4199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4200        // Prevent Drop from running (which would shut down the channel)
4201        std::mem::forget(self);
4202    }
4203}
4204
4205impl DirectoryQueryFilesystemResponder {
4206    /// Sends a response to the FIDL transaction.
4207    ///
4208    /// Sets the channel to shutdown if an error occurs.
4209    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4210        let _result = self.send_raw(s, info);
4211        if _result.is_err() {
4212            self.control_handle.shutdown();
4213        }
4214        self.drop_without_shutdown();
4215        _result
4216    }
4217
4218    /// Similar to "send" but does not shutdown the channel if an error occurs.
4219    pub fn send_no_shutdown_on_err(
4220        self,
4221        mut s: i32,
4222        mut info: Option<&FilesystemInfo>,
4223    ) -> Result<(), fidl::Error> {
4224        let _result = self.send_raw(s, info);
4225        self.drop_without_shutdown();
4226        _result
4227    }
4228
4229    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
4230        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
4231            (s, info),
4232            self.tx_id,
4233            0x6f344a1c6b0a0610,
4234            fidl::encoding::DynamicFlags::empty(),
4235        )
4236    }
4237}
4238
4239#[must_use = "FIDL methods require a response to be sent"]
4240#[derive(Debug)]
4241pub struct DirectoryGetAttributesResponder {
4242    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4243    tx_id: u32,
4244}
4245
4246/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4247/// if the responder is dropped without sending a response, so that the client
4248/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4249impl std::ops::Drop for DirectoryGetAttributesResponder {
4250    fn drop(&mut self) {
4251        self.control_handle.shutdown();
4252        // Safety: drops once, never accessed again
4253        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4254    }
4255}
4256
4257impl fdomain_client::fidl::Responder for DirectoryGetAttributesResponder {
4258    type ControlHandle = DirectoryControlHandle;
4259
4260    fn control_handle(&self) -> &DirectoryControlHandle {
4261        &self.control_handle
4262    }
4263
4264    fn drop_without_shutdown(mut self) {
4265        // Safety: drops once, never accessed again due to mem::forget
4266        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4267        // Prevent Drop from running (which would shut down the channel)
4268        std::mem::forget(self);
4269    }
4270}
4271
4272impl DirectoryGetAttributesResponder {
4273    /// Sends a response to the FIDL transaction.
4274    ///
4275    /// Sets the channel to shutdown if an error occurs.
4276    pub fn send(
4277        self,
4278        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4279    ) -> Result<(), fidl::Error> {
4280        let _result = self.send_raw(result);
4281        if _result.is_err() {
4282            self.control_handle.shutdown();
4283        }
4284        self.drop_without_shutdown();
4285        _result
4286    }
4287
4288    /// Similar to "send" but does not shutdown the channel if an error occurs.
4289    pub fn send_no_shutdown_on_err(
4290        self,
4291        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4292    ) -> Result<(), fidl::Error> {
4293        let _result = self.send_raw(result);
4294        self.drop_without_shutdown();
4295        _result
4296    }
4297
4298    fn send_raw(
4299        &self,
4300        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
4301    ) -> Result<(), fidl::Error> {
4302        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
4303            result,
4304            self.tx_id,
4305            0x3d4396a638ea053b,
4306            fidl::encoding::DynamicFlags::empty(),
4307        )
4308    }
4309}
4310
4311#[must_use = "FIDL methods require a response to be sent"]
4312#[derive(Debug)]
4313pub struct DirectoryUpdateAttributesResponder {
4314    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4315    tx_id: u32,
4316}
4317
4318/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4319/// if the responder is dropped without sending a response, so that the client
4320/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4321impl std::ops::Drop for DirectoryUpdateAttributesResponder {
4322    fn drop(&mut self) {
4323        self.control_handle.shutdown();
4324        // Safety: drops once, never accessed again
4325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4326    }
4327}
4328
4329impl fdomain_client::fidl::Responder for DirectoryUpdateAttributesResponder {
4330    type ControlHandle = DirectoryControlHandle;
4331
4332    fn control_handle(&self) -> &DirectoryControlHandle {
4333        &self.control_handle
4334    }
4335
4336    fn drop_without_shutdown(mut self) {
4337        // Safety: drops once, never accessed again due to mem::forget
4338        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4339        // Prevent Drop from running (which would shut down the channel)
4340        std::mem::forget(self);
4341    }
4342}
4343
4344impl DirectoryUpdateAttributesResponder {
4345    /// Sends a response to the FIDL transaction.
4346    ///
4347    /// Sets the channel to shutdown if an error occurs.
4348    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4349        let _result = self.send_raw(result);
4350        if _result.is_err() {
4351            self.control_handle.shutdown();
4352        }
4353        self.drop_without_shutdown();
4354        _result
4355    }
4356
4357    /// Similar to "send" but does not shutdown the channel if an error occurs.
4358    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4359        let _result = self.send_raw(result);
4360        self.drop_without_shutdown();
4361        _result
4362    }
4363
4364    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4365        self.control_handle
4366            .inner
4367            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4368                result,
4369                self.tx_id,
4370                0x3308c1da5a89bf08,
4371                fidl::encoding::DynamicFlags::empty(),
4372            )
4373    }
4374}
4375
4376#[must_use = "FIDL methods require a response to be sent"]
4377#[derive(Debug)]
4378pub struct DirectorySyncResponder {
4379    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4380    tx_id: u32,
4381}
4382
4383/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4384/// if the responder is dropped without sending a response, so that the client
4385/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4386impl std::ops::Drop for DirectorySyncResponder {
4387    fn drop(&mut self) {
4388        self.control_handle.shutdown();
4389        // Safety: drops once, never accessed again
4390        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4391    }
4392}
4393
4394impl fdomain_client::fidl::Responder for DirectorySyncResponder {
4395    type ControlHandle = DirectoryControlHandle;
4396
4397    fn control_handle(&self) -> &DirectoryControlHandle {
4398        &self.control_handle
4399    }
4400
4401    fn drop_without_shutdown(mut self) {
4402        // Safety: drops once, never accessed again due to mem::forget
4403        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4404        // Prevent Drop from running (which would shut down the channel)
4405        std::mem::forget(self);
4406    }
4407}
4408
4409impl DirectorySyncResponder {
4410    /// Sends a response to the FIDL transaction.
4411    ///
4412    /// Sets the channel to shutdown if an error occurs.
4413    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4414        let _result = self.send_raw(result);
4415        if _result.is_err() {
4416            self.control_handle.shutdown();
4417        }
4418        self.drop_without_shutdown();
4419        _result
4420    }
4421
4422    /// Similar to "send" but does not shutdown the channel if an error occurs.
4423    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4424        let _result = self.send_raw(result);
4425        self.drop_without_shutdown();
4426        _result
4427    }
4428
4429    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4430        self.control_handle
4431            .inner
4432            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4433                result,
4434                self.tx_id,
4435                0x2c5c27ca0ab5dc49,
4436                fidl::encoding::DynamicFlags::empty(),
4437            )
4438    }
4439}
4440
4441#[must_use = "FIDL methods require a response to be sent"]
4442#[derive(Debug)]
4443pub struct DirectoryGetExtendedAttributeResponder {
4444    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4445    tx_id: u32,
4446}
4447
4448/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4449/// if the responder is dropped without sending a response, so that the client
4450/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4451impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
4452    fn drop(&mut self) {
4453        self.control_handle.shutdown();
4454        // Safety: drops once, never accessed again
4455        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4456    }
4457}
4458
4459impl fdomain_client::fidl::Responder for DirectoryGetExtendedAttributeResponder {
4460    type ControlHandle = DirectoryControlHandle;
4461
4462    fn control_handle(&self) -> &DirectoryControlHandle {
4463        &self.control_handle
4464    }
4465
4466    fn drop_without_shutdown(mut self) {
4467        // Safety: drops once, never accessed again due to mem::forget
4468        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4469        // Prevent Drop from running (which would shut down the channel)
4470        std::mem::forget(self);
4471    }
4472}
4473
4474impl DirectoryGetExtendedAttributeResponder {
4475    /// Sends a response to the FIDL transaction.
4476    ///
4477    /// Sets the channel to shutdown if an error occurs.
4478    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4479        let _result = self.send_raw(result);
4480        if _result.is_err() {
4481            self.control_handle.shutdown();
4482        }
4483        self.drop_without_shutdown();
4484        _result
4485    }
4486
4487    /// Similar to "send" but does not shutdown the channel if an error occurs.
4488    pub fn send_no_shutdown_on_err(
4489        self,
4490        mut result: Result<ExtendedAttributeValue, i32>,
4491    ) -> Result<(), fidl::Error> {
4492        let _result = self.send_raw(result);
4493        self.drop_without_shutdown();
4494        _result
4495    }
4496
4497    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
4498        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
4499            result.as_mut().map_err(|e| *e),
4500            self.tx_id,
4501            0x45ffa3ccfdeb76db,
4502            fidl::encoding::DynamicFlags::empty(),
4503        )
4504    }
4505}
4506
4507#[must_use = "FIDL methods require a response to be sent"]
4508#[derive(Debug)]
4509pub struct DirectorySetExtendedAttributeResponder {
4510    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4511    tx_id: u32,
4512}
4513
4514/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4515/// if the responder is dropped without sending a response, so that the client
4516/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4517impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
4518    fn drop(&mut self) {
4519        self.control_handle.shutdown();
4520        // Safety: drops once, never accessed again
4521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4522    }
4523}
4524
4525impl fdomain_client::fidl::Responder for DirectorySetExtendedAttributeResponder {
4526    type ControlHandle = DirectoryControlHandle;
4527
4528    fn control_handle(&self) -> &DirectoryControlHandle {
4529        &self.control_handle
4530    }
4531
4532    fn drop_without_shutdown(mut self) {
4533        // Safety: drops once, never accessed again due to mem::forget
4534        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4535        // Prevent Drop from running (which would shut down the channel)
4536        std::mem::forget(self);
4537    }
4538}
4539
4540impl DirectorySetExtendedAttributeResponder {
4541    /// Sends a response to the FIDL transaction.
4542    ///
4543    /// Sets the channel to shutdown if an error occurs.
4544    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4545        let _result = self.send_raw(result);
4546        if _result.is_err() {
4547            self.control_handle.shutdown();
4548        }
4549        self.drop_without_shutdown();
4550        _result
4551    }
4552
4553    /// Similar to "send" but does not shutdown the channel if an error occurs.
4554    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4555        let _result = self.send_raw(result);
4556        self.drop_without_shutdown();
4557        _result
4558    }
4559
4560    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4561        self.control_handle
4562            .inner
4563            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4564                result,
4565                self.tx_id,
4566                0x4a951362f681f23c,
4567                fidl::encoding::DynamicFlags::empty(),
4568            )
4569    }
4570}
4571
4572#[must_use = "FIDL methods require a response to be sent"]
4573#[derive(Debug)]
4574pub struct DirectoryRemoveExtendedAttributeResponder {
4575    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4576    tx_id: u32,
4577}
4578
4579/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4580/// if the responder is dropped without sending a response, so that the client
4581/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4582impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
4583    fn drop(&mut self) {
4584        self.control_handle.shutdown();
4585        // Safety: drops once, never accessed again
4586        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4587    }
4588}
4589
4590impl fdomain_client::fidl::Responder for DirectoryRemoveExtendedAttributeResponder {
4591    type ControlHandle = DirectoryControlHandle;
4592
4593    fn control_handle(&self) -> &DirectoryControlHandle {
4594        &self.control_handle
4595    }
4596
4597    fn drop_without_shutdown(mut self) {
4598        // Safety: drops once, never accessed again due to mem::forget
4599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4600        // Prevent Drop from running (which would shut down the channel)
4601        std::mem::forget(self);
4602    }
4603}
4604
4605impl DirectoryRemoveExtendedAttributeResponder {
4606    /// Sends a response to the FIDL transaction.
4607    ///
4608    /// Sets the channel to shutdown if an error occurs.
4609    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4610        let _result = self.send_raw(result);
4611        if _result.is_err() {
4612            self.control_handle.shutdown();
4613        }
4614        self.drop_without_shutdown();
4615        _result
4616    }
4617
4618    /// Similar to "send" but does not shutdown the channel if an error occurs.
4619    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4620        let _result = self.send_raw(result);
4621        self.drop_without_shutdown();
4622        _result
4623    }
4624
4625    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4626        self.control_handle
4627            .inner
4628            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4629                result,
4630                self.tx_id,
4631                0x7a0b9f3a9bf9032d,
4632                fidl::encoding::DynamicFlags::empty(),
4633            )
4634    }
4635}
4636
4637#[must_use = "FIDL methods require a response to be sent"]
4638#[derive(Debug)]
4639pub struct DirectoryReadDirentsResponder {
4640    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4641    tx_id: u32,
4642}
4643
4644/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4645/// if the responder is dropped without sending a response, so that the client
4646/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4647impl std::ops::Drop for DirectoryReadDirentsResponder {
4648    fn drop(&mut self) {
4649        self.control_handle.shutdown();
4650        // Safety: drops once, never accessed again
4651        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4652    }
4653}
4654
4655impl fdomain_client::fidl::Responder for DirectoryReadDirentsResponder {
4656    type ControlHandle = DirectoryControlHandle;
4657
4658    fn control_handle(&self) -> &DirectoryControlHandle {
4659        &self.control_handle
4660    }
4661
4662    fn drop_without_shutdown(mut self) {
4663        // Safety: drops once, never accessed again due to mem::forget
4664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4665        // Prevent Drop from running (which would shut down the channel)
4666        std::mem::forget(self);
4667    }
4668}
4669
4670impl DirectoryReadDirentsResponder {
4671    /// Sends a response to the FIDL transaction.
4672    ///
4673    /// Sets the channel to shutdown if an error occurs.
4674    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4675        let _result = self.send_raw(s, dirents);
4676        if _result.is_err() {
4677            self.control_handle.shutdown();
4678        }
4679        self.drop_without_shutdown();
4680        _result
4681    }
4682
4683    /// Similar to "send" but does not shutdown the channel if an error occurs.
4684    pub fn send_no_shutdown_on_err(
4685        self,
4686        mut s: i32,
4687        mut dirents: &[u8],
4688    ) -> Result<(), fidl::Error> {
4689        let _result = self.send_raw(s, dirents);
4690        self.drop_without_shutdown();
4691        _result
4692    }
4693
4694    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
4695        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
4696            (s, dirents),
4697            self.tx_id,
4698            0x3582806bf27faa0a,
4699            fidl::encoding::DynamicFlags::empty(),
4700        )
4701    }
4702}
4703
4704#[must_use = "FIDL methods require a response to be sent"]
4705#[derive(Debug)]
4706pub struct DirectoryRewindResponder {
4707    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4708    tx_id: u32,
4709}
4710
4711/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4712/// if the responder is dropped without sending a response, so that the client
4713/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4714impl std::ops::Drop for DirectoryRewindResponder {
4715    fn drop(&mut self) {
4716        self.control_handle.shutdown();
4717        // Safety: drops once, never accessed again
4718        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4719    }
4720}
4721
4722impl fdomain_client::fidl::Responder for DirectoryRewindResponder {
4723    type ControlHandle = DirectoryControlHandle;
4724
4725    fn control_handle(&self) -> &DirectoryControlHandle {
4726        &self.control_handle
4727    }
4728
4729    fn drop_without_shutdown(mut self) {
4730        // Safety: drops once, never accessed again due to mem::forget
4731        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4732        // Prevent Drop from running (which would shut down the channel)
4733        std::mem::forget(self);
4734    }
4735}
4736
4737impl DirectoryRewindResponder {
4738    /// Sends a response to the FIDL transaction.
4739    ///
4740    /// Sets the channel to shutdown if an error occurs.
4741    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4742        let _result = self.send_raw(s);
4743        if _result.is_err() {
4744            self.control_handle.shutdown();
4745        }
4746        self.drop_without_shutdown();
4747        _result
4748    }
4749
4750    /// Similar to "send" but does not shutdown the channel if an error occurs.
4751    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4752        let _result = self.send_raw(s);
4753        self.drop_without_shutdown();
4754        _result
4755    }
4756
4757    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4758        self.control_handle.inner.send::<DirectoryRewindResponse>(
4759            (s,),
4760            self.tx_id,
4761            0x16b1202af0f34c71,
4762            fidl::encoding::DynamicFlags::empty(),
4763        )
4764    }
4765}
4766
4767#[must_use = "FIDL methods require a response to be sent"]
4768#[derive(Debug)]
4769pub struct DirectoryGetTokenResponder {
4770    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4771    tx_id: u32,
4772}
4773
4774/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4775/// if the responder is dropped without sending a response, so that the client
4776/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4777impl std::ops::Drop for DirectoryGetTokenResponder {
4778    fn drop(&mut self) {
4779        self.control_handle.shutdown();
4780        // Safety: drops once, never accessed again
4781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4782    }
4783}
4784
4785impl fdomain_client::fidl::Responder for DirectoryGetTokenResponder {
4786    type ControlHandle = DirectoryControlHandle;
4787
4788    fn control_handle(&self) -> &DirectoryControlHandle {
4789        &self.control_handle
4790    }
4791
4792    fn drop_without_shutdown(mut self) {
4793        // Safety: drops once, never accessed again due to mem::forget
4794        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4795        // Prevent Drop from running (which would shut down the channel)
4796        std::mem::forget(self);
4797    }
4798}
4799
4800impl DirectoryGetTokenResponder {
4801    /// Sends a response to the FIDL transaction.
4802    ///
4803    /// Sets the channel to shutdown if an error occurs.
4804    pub fn send(
4805        self,
4806        mut s: i32,
4807        mut token: Option<fdomain_client::NullableHandle>,
4808    ) -> Result<(), fidl::Error> {
4809        let _result = self.send_raw(s, token);
4810        if _result.is_err() {
4811            self.control_handle.shutdown();
4812        }
4813        self.drop_without_shutdown();
4814        _result
4815    }
4816
4817    /// Similar to "send" but does not shutdown the channel if an error occurs.
4818    pub fn send_no_shutdown_on_err(
4819        self,
4820        mut s: i32,
4821        mut token: Option<fdomain_client::NullableHandle>,
4822    ) -> Result<(), fidl::Error> {
4823        let _result = self.send_raw(s, token);
4824        self.drop_without_shutdown();
4825        _result
4826    }
4827
4828    fn send_raw(
4829        &self,
4830        mut s: i32,
4831        mut token: Option<fdomain_client::NullableHandle>,
4832    ) -> Result<(), fidl::Error> {
4833        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
4834            (s, token),
4835            self.tx_id,
4836            0x26ae9d18763c8655,
4837            fidl::encoding::DynamicFlags::empty(),
4838        )
4839    }
4840}
4841
4842#[must_use = "FIDL methods require a response to be sent"]
4843#[derive(Debug)]
4844pub struct DirectoryLinkResponder {
4845    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4846    tx_id: u32,
4847}
4848
4849/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4850/// if the responder is dropped without sending a response, so that the client
4851/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4852impl std::ops::Drop for DirectoryLinkResponder {
4853    fn drop(&mut self) {
4854        self.control_handle.shutdown();
4855        // Safety: drops once, never accessed again
4856        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4857    }
4858}
4859
4860impl fdomain_client::fidl::Responder for DirectoryLinkResponder {
4861    type ControlHandle = DirectoryControlHandle;
4862
4863    fn control_handle(&self) -> &DirectoryControlHandle {
4864        &self.control_handle
4865    }
4866
4867    fn drop_without_shutdown(mut self) {
4868        // Safety: drops once, never accessed again due to mem::forget
4869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4870        // Prevent Drop from running (which would shut down the channel)
4871        std::mem::forget(self);
4872    }
4873}
4874
4875impl DirectoryLinkResponder {
4876    /// Sends a response to the FIDL transaction.
4877    ///
4878    /// Sets the channel to shutdown if an error occurs.
4879    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4880        let _result = self.send_raw(s);
4881        if _result.is_err() {
4882            self.control_handle.shutdown();
4883        }
4884        self.drop_without_shutdown();
4885        _result
4886    }
4887
4888    /// Similar to "send" but does not shutdown the channel if an error occurs.
4889    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4890        let _result = self.send_raw(s);
4891        self.drop_without_shutdown();
4892        _result
4893    }
4894
4895    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4896        self.control_handle.inner.send::<DirectoryLinkResponse>(
4897            (s,),
4898            self.tx_id,
4899            0x740604c0c7c930e7,
4900            fidl::encoding::DynamicFlags::empty(),
4901        )
4902    }
4903}
4904
4905#[must_use = "FIDL methods require a response to be sent"]
4906#[derive(Debug)]
4907pub struct DirectoryUnlinkResponder {
4908    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4909    tx_id: u32,
4910}
4911
4912/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4913/// if the responder is dropped without sending a response, so that the client
4914/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4915impl std::ops::Drop for DirectoryUnlinkResponder {
4916    fn drop(&mut self) {
4917        self.control_handle.shutdown();
4918        // Safety: drops once, never accessed again
4919        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4920    }
4921}
4922
4923impl fdomain_client::fidl::Responder for DirectoryUnlinkResponder {
4924    type ControlHandle = DirectoryControlHandle;
4925
4926    fn control_handle(&self) -> &DirectoryControlHandle {
4927        &self.control_handle
4928    }
4929
4930    fn drop_without_shutdown(mut self) {
4931        // Safety: drops once, never accessed again due to mem::forget
4932        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4933        // Prevent Drop from running (which would shut down the channel)
4934        std::mem::forget(self);
4935    }
4936}
4937
4938impl DirectoryUnlinkResponder {
4939    /// Sends a response to the FIDL transaction.
4940    ///
4941    /// Sets the channel to shutdown if an error occurs.
4942    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4943        let _result = self.send_raw(result);
4944        if _result.is_err() {
4945            self.control_handle.shutdown();
4946        }
4947        self.drop_without_shutdown();
4948        _result
4949    }
4950
4951    /// Similar to "send" but does not shutdown the channel if an error occurs.
4952    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4953        let _result = self.send_raw(result);
4954        self.drop_without_shutdown();
4955        _result
4956    }
4957
4958    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4959        self.control_handle
4960            .inner
4961            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4962                result,
4963                self.tx_id,
4964                0x750a0326a78d7bed,
4965                fidl::encoding::DynamicFlags::empty(),
4966            )
4967    }
4968}
4969
4970#[must_use = "FIDL methods require a response to be sent"]
4971#[derive(Debug)]
4972pub struct DirectoryRenameResponder {
4973    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4974    tx_id: u32,
4975}
4976
4977/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4978/// if the responder is dropped without sending a response, so that the client
4979/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4980impl std::ops::Drop for DirectoryRenameResponder {
4981    fn drop(&mut self) {
4982        self.control_handle.shutdown();
4983        // Safety: drops once, never accessed again
4984        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4985    }
4986}
4987
4988impl fdomain_client::fidl::Responder for DirectoryRenameResponder {
4989    type ControlHandle = DirectoryControlHandle;
4990
4991    fn control_handle(&self) -> &DirectoryControlHandle {
4992        &self.control_handle
4993    }
4994
4995    fn drop_without_shutdown(mut self) {
4996        // Safety: drops once, never accessed again due to mem::forget
4997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4998        // Prevent Drop from running (which would shut down the channel)
4999        std::mem::forget(self);
5000    }
5001}
5002
5003impl DirectoryRenameResponder {
5004    /// Sends a response to the FIDL transaction.
5005    ///
5006    /// Sets the channel to shutdown if an error occurs.
5007    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5008        let _result = self.send_raw(result);
5009        if _result.is_err() {
5010            self.control_handle.shutdown();
5011        }
5012        self.drop_without_shutdown();
5013        _result
5014    }
5015
5016    /// Similar to "send" but does not shutdown the channel if an error occurs.
5017    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5018        let _result = self.send_raw(result);
5019        self.drop_without_shutdown();
5020        _result
5021    }
5022
5023    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5024        self.control_handle
5025            .inner
5026            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5027                result,
5028                self.tx_id,
5029                0x7060e7723b9928de,
5030                fidl::encoding::DynamicFlags::empty(),
5031            )
5032    }
5033}
5034
5035#[must_use = "FIDL methods require a response to be sent"]
5036#[derive(Debug)]
5037pub struct DirectoryCreateSymlinkResponder {
5038    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5039    tx_id: u32,
5040}
5041
5042/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5043/// if the responder is dropped without sending a response, so that the client
5044/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5045impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5046    fn drop(&mut self) {
5047        self.control_handle.shutdown();
5048        // Safety: drops once, never accessed again
5049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5050    }
5051}
5052
5053impl fdomain_client::fidl::Responder for DirectoryCreateSymlinkResponder {
5054    type ControlHandle = DirectoryControlHandle;
5055
5056    fn control_handle(&self) -> &DirectoryControlHandle {
5057        &self.control_handle
5058    }
5059
5060    fn drop_without_shutdown(mut self) {
5061        // Safety: drops once, never accessed again due to mem::forget
5062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5063        // Prevent Drop from running (which would shut down the channel)
5064        std::mem::forget(self);
5065    }
5066}
5067
5068impl DirectoryCreateSymlinkResponder {
5069    /// Sends a response to the FIDL transaction.
5070    ///
5071    /// Sets the channel to shutdown if an error occurs.
5072    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5073        let _result = self.send_raw(result);
5074        if _result.is_err() {
5075            self.control_handle.shutdown();
5076        }
5077        self.drop_without_shutdown();
5078        _result
5079    }
5080
5081    /// Similar to "send" but does not shutdown the channel if an error occurs.
5082    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5083        let _result = self.send_raw(result);
5084        self.drop_without_shutdown();
5085        _result
5086    }
5087
5088    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5089        self.control_handle
5090            .inner
5091            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5092                result,
5093                self.tx_id,
5094                0x21ce0f19ec043889,
5095                fidl::encoding::DynamicFlags::empty(),
5096            )
5097    }
5098}
5099
5100#[must_use = "FIDL methods require a response to be sent"]
5101#[derive(Debug)]
5102pub struct DirectoryWatchResponder {
5103    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5104    tx_id: u32,
5105}
5106
5107/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5108/// if the responder is dropped without sending a response, so that the client
5109/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5110impl std::ops::Drop for DirectoryWatchResponder {
5111    fn drop(&mut self) {
5112        self.control_handle.shutdown();
5113        // Safety: drops once, never accessed again
5114        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5115    }
5116}
5117
5118impl fdomain_client::fidl::Responder for DirectoryWatchResponder {
5119    type ControlHandle = DirectoryControlHandle;
5120
5121    fn control_handle(&self) -> &DirectoryControlHandle {
5122        &self.control_handle
5123    }
5124
5125    fn drop_without_shutdown(mut self) {
5126        // Safety: drops once, never accessed again due to mem::forget
5127        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5128        // Prevent Drop from running (which would shut down the channel)
5129        std::mem::forget(self);
5130    }
5131}
5132
5133impl DirectoryWatchResponder {
5134    /// Sends a response to the FIDL transaction.
5135    ///
5136    /// Sets the channel to shutdown if an error occurs.
5137    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5138        let _result = self.send_raw(s);
5139        if _result.is_err() {
5140            self.control_handle.shutdown();
5141        }
5142        self.drop_without_shutdown();
5143        _result
5144    }
5145
5146    /// Similar to "send" but does not shutdown the channel if an error occurs.
5147    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5148        let _result = self.send_raw(s);
5149        self.drop_without_shutdown();
5150        _result
5151    }
5152
5153    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5154        self.control_handle.inner.send::<DirectoryWatchResponse>(
5155            (s,),
5156            self.tx_id,
5157            0x5717193a59d66d91,
5158            fidl::encoding::DynamicFlags::empty(),
5159        )
5160    }
5161}
5162
5163#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5164pub struct DirectoryWatcherMarker;
5165
5166impl fdomain_client::fidl::ProtocolMarker for DirectoryWatcherMarker {
5167    type Proxy = DirectoryWatcherProxy;
5168    type RequestStream = DirectoryWatcherRequestStream;
5169
5170    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
5171}
5172
5173pub trait DirectoryWatcherProxyInterface: Send + Sync {}
5174
5175#[derive(Debug, Clone)]
5176pub struct DirectoryWatcherProxy {
5177    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5178}
5179
5180impl fdomain_client::fidl::Proxy for DirectoryWatcherProxy {
5181    type Protocol = DirectoryWatcherMarker;
5182
5183    fn from_channel(inner: fdomain_client::Channel) -> Self {
5184        Self::new(inner)
5185    }
5186
5187    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5188        self.client.into_channel().map_err(|client| Self { client })
5189    }
5190
5191    fn as_channel(&self) -> &fdomain_client::Channel {
5192        self.client.as_channel()
5193    }
5194}
5195
5196impl DirectoryWatcherProxy {
5197    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
5198    pub fn new(channel: fdomain_client::Channel) -> Self {
5199        let protocol_name =
5200            <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5201        Self { client: fidl::client::Client::new(channel, protocol_name) }
5202    }
5203
5204    /// Get a Stream of events from the remote end of the protocol.
5205    ///
5206    /// # Panics
5207    ///
5208    /// Panics if the event stream was already taken.
5209    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
5210        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
5211    }
5212}
5213
5214impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
5215
5216pub struct DirectoryWatcherEventStream {
5217    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5218}
5219
5220impl std::marker::Unpin for DirectoryWatcherEventStream {}
5221
5222impl futures::stream::FusedStream for DirectoryWatcherEventStream {
5223    fn is_terminated(&self) -> bool {
5224        self.event_receiver.is_terminated()
5225    }
5226}
5227
5228impl futures::Stream for DirectoryWatcherEventStream {
5229    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
5230
5231    fn poll_next(
5232        mut self: std::pin::Pin<&mut Self>,
5233        cx: &mut std::task::Context<'_>,
5234    ) -> std::task::Poll<Option<Self::Item>> {
5235        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5236            &mut self.event_receiver,
5237            cx
5238        )?) {
5239            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
5240            None => std::task::Poll::Ready(None),
5241        }
5242    }
5243}
5244
5245#[derive(Debug)]
5246pub enum DirectoryWatcherEvent {}
5247
5248impl DirectoryWatcherEvent {
5249    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
5250    fn decode(
5251        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5252    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
5253        let (bytes, _handles) = buf.split_mut();
5254        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5255        debug_assert_eq!(tx_header.tx_id, 0);
5256        match tx_header.ordinal {
5257            _ => Err(fidl::Error::UnknownOrdinal {
5258                ordinal: tx_header.ordinal,
5259                protocol_name:
5260                    <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5261            }),
5262        }
5263    }
5264}
5265
5266/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
5267pub struct DirectoryWatcherRequestStream {
5268    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5269    is_terminated: bool,
5270}
5271
5272impl std::marker::Unpin for DirectoryWatcherRequestStream {}
5273
5274impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
5275    fn is_terminated(&self) -> bool {
5276        self.is_terminated
5277    }
5278}
5279
5280impl fdomain_client::fidl::RequestStream for DirectoryWatcherRequestStream {
5281    type Protocol = DirectoryWatcherMarker;
5282    type ControlHandle = DirectoryWatcherControlHandle;
5283
5284    fn from_channel(channel: fdomain_client::Channel) -> Self {
5285        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5286    }
5287
5288    fn control_handle(&self) -> Self::ControlHandle {
5289        DirectoryWatcherControlHandle { inner: self.inner.clone() }
5290    }
5291
5292    fn into_inner(
5293        self,
5294    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5295    {
5296        (self.inner, self.is_terminated)
5297    }
5298
5299    fn from_inner(
5300        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5301        is_terminated: bool,
5302    ) -> Self {
5303        Self { inner, is_terminated }
5304    }
5305}
5306
5307impl futures::Stream for DirectoryWatcherRequestStream {
5308    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
5309
5310    fn poll_next(
5311        mut self: std::pin::Pin<&mut Self>,
5312        cx: &mut std::task::Context<'_>,
5313    ) -> std::task::Poll<Option<Self::Item>> {
5314        let this = &mut *self;
5315        if this.inner.check_shutdown(cx) {
5316            this.is_terminated = true;
5317            return std::task::Poll::Ready(None);
5318        }
5319        if this.is_terminated {
5320            panic!("polled DirectoryWatcherRequestStream after completion");
5321        }
5322        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5323            |bytes, handles| {
5324                match this.inner.channel().read_etc(cx, bytes, handles) {
5325                    std::task::Poll::Ready(Ok(())) => {}
5326                    std::task::Poll::Pending => return std::task::Poll::Pending,
5327                    std::task::Poll::Ready(Err(None)) => {
5328                        this.is_terminated = true;
5329                        return std::task::Poll::Ready(None);
5330                    }
5331                    std::task::Poll::Ready(Err(Some(e))) => {
5332                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5333                            e.into(),
5334                        ))));
5335                    }
5336                }
5337
5338                // A message has been received from the channel
5339                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5340
5341                std::task::Poll::Ready(Some(match header.ordinal {
5342                _ => Err(fidl::Error::UnknownOrdinal {
5343                    ordinal: header.ordinal,
5344                    protocol_name: <DirectoryWatcherMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5345                }),
5346            }))
5347            },
5348        )
5349    }
5350}
5351
5352/// DirectoryWatcher transmits messages from a filesystem server
5353/// about events happening in the filesystem. Clients can register
5354/// new watchers using the `Directory.Watch` method, where they can
5355/// filter which events they want to receive notifications for.
5356///
5357/// The DirectoryWatcher will send messages of the form:
5358/// ```
5359/// struct {
5360///   uint8 event;
5361///   uint8 len;
5362///   char name[];
5363/// };
5364/// ```
5365/// Where names are NOT null-terminated. The name is the relative
5366/// path to the entry the event is refering to. It will be empty if
5367/// the event isn't referencing a particular entry (e.g. for the
5368/// `IDLE` event).
5369#[derive(Debug)]
5370pub enum DirectoryWatcherRequest {}
5371
5372impl DirectoryWatcherRequest {
5373    /// Name of the method defined in FIDL
5374    pub fn method_name(&self) -> &'static str {
5375        match *self {}
5376    }
5377}
5378
5379#[derive(Debug, Clone)]
5380pub struct DirectoryWatcherControlHandle {
5381    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5382}
5383
5384impl fdomain_client::fidl::ControlHandle for DirectoryWatcherControlHandle {
5385    fn shutdown(&self) {
5386        self.inner.shutdown()
5387    }
5388
5389    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5390        self.inner.shutdown_with_epitaph(status)
5391    }
5392
5393    fn is_closed(&self) -> bool {
5394        self.inner.channel().is_closed()
5395    }
5396    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5397        self.inner.channel().on_closed()
5398    }
5399}
5400
5401impl DirectoryWatcherControlHandle {}
5402
5403#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5404pub struct ExtendedAttributeIteratorMarker;
5405
5406impl fdomain_client::fidl::ProtocolMarker for ExtendedAttributeIteratorMarker {
5407    type Proxy = ExtendedAttributeIteratorProxy;
5408    type RequestStream = ExtendedAttributeIteratorRequestStream;
5409
5410    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
5411}
5412pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
5413
5414pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
5415    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
5416        + Send;
5417    fn r#get_next(&self) -> Self::GetNextResponseFut;
5418}
5419
5420#[derive(Debug, Clone)]
5421pub struct ExtendedAttributeIteratorProxy {
5422    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5423}
5424
5425impl fdomain_client::fidl::Proxy for ExtendedAttributeIteratorProxy {
5426    type Protocol = ExtendedAttributeIteratorMarker;
5427
5428    fn from_channel(inner: fdomain_client::Channel) -> Self {
5429        Self::new(inner)
5430    }
5431
5432    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5433        self.client.into_channel().map_err(|client| Self { client })
5434    }
5435
5436    fn as_channel(&self) -> &fdomain_client::Channel {
5437        self.client.as_channel()
5438    }
5439}
5440
5441impl ExtendedAttributeIteratorProxy {
5442    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
5443    pub fn new(channel: fdomain_client::Channel) -> Self {
5444        let protocol_name =
5445            <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5446        Self { client: fidl::client::Client::new(channel, protocol_name) }
5447    }
5448
5449    /// Get a Stream of events from the remote end of the protocol.
5450    ///
5451    /// # Panics
5452    ///
5453    /// Panics if the event stream was already taken.
5454    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
5455        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5456    }
5457
5458    /// Get the next chunk of extended attribute names. If this is the last
5459    /// chunk, last will be true, and the channel will be closed after the
5460    /// call.
5461    pub fn r#get_next(
5462        &self,
5463    ) -> fidl::client::QueryResponseFut<
5464        ExtendedAttributeIteratorGetNextResult,
5465        fdomain_client::fidl::FDomainResourceDialect,
5466    > {
5467        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
5468    }
5469}
5470
5471impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
5472    type GetNextResponseFut = fidl::client::QueryResponseFut<
5473        ExtendedAttributeIteratorGetNextResult,
5474        fdomain_client::fidl::FDomainResourceDialect,
5475    >;
5476    fn r#get_next(&self) -> Self::GetNextResponseFut {
5477        fn _decode(
5478            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5479        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
5480            let _response = fidl::client::decode_transaction_body::<
5481                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
5482                fdomain_client::fidl::FDomainResourceDialect,
5483                0x3ba664a1c2e45a7,
5484            >(_buf?)?;
5485            Ok(_response.map(|x| (x.attributes, x.last)))
5486        }
5487        self.client.send_query_and_decode::<
5488            fidl::encoding::EmptyPayload,
5489            ExtendedAttributeIteratorGetNextResult,
5490        >(
5491            (),
5492            0x3ba664a1c2e45a7,
5493            fidl::encoding::DynamicFlags::empty(),
5494            _decode,
5495        )
5496    }
5497}
5498
5499pub struct ExtendedAttributeIteratorEventStream {
5500    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5501}
5502
5503impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
5504
5505impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
5506    fn is_terminated(&self) -> bool {
5507        self.event_receiver.is_terminated()
5508    }
5509}
5510
5511impl futures::Stream for ExtendedAttributeIteratorEventStream {
5512    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
5513
5514    fn poll_next(
5515        mut self: std::pin::Pin<&mut Self>,
5516        cx: &mut std::task::Context<'_>,
5517    ) -> std::task::Poll<Option<Self::Item>> {
5518        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5519            &mut self.event_receiver,
5520            cx
5521        )?) {
5522            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
5523            None => std::task::Poll::Ready(None),
5524        }
5525    }
5526}
5527
5528#[derive(Debug)]
5529pub enum ExtendedAttributeIteratorEvent {}
5530
5531impl ExtendedAttributeIteratorEvent {
5532    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
5533    fn decode(
5534        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5535    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
5536        let (bytes, _handles) = buf.split_mut();
5537        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5538        debug_assert_eq!(tx_header.tx_id, 0);
5539        match tx_header.ordinal {
5540            _ => Err(fidl::Error::UnknownOrdinal {
5541                ordinal: tx_header.ordinal,
5542                protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5543            })
5544        }
5545    }
5546}
5547
5548/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
5549pub struct ExtendedAttributeIteratorRequestStream {
5550    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5551    is_terminated: bool,
5552}
5553
5554impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
5555
5556impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
5557    fn is_terminated(&self) -> bool {
5558        self.is_terminated
5559    }
5560}
5561
5562impl fdomain_client::fidl::RequestStream for ExtendedAttributeIteratorRequestStream {
5563    type Protocol = ExtendedAttributeIteratorMarker;
5564    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5565
5566    fn from_channel(channel: fdomain_client::Channel) -> Self {
5567        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5568    }
5569
5570    fn control_handle(&self) -> Self::ControlHandle {
5571        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
5572    }
5573
5574    fn into_inner(
5575        self,
5576    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5577    {
5578        (self.inner, self.is_terminated)
5579    }
5580
5581    fn from_inner(
5582        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5583        is_terminated: bool,
5584    ) -> Self {
5585        Self { inner, is_terminated }
5586    }
5587}
5588
5589impl futures::Stream for ExtendedAttributeIteratorRequestStream {
5590    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
5591
5592    fn poll_next(
5593        mut self: std::pin::Pin<&mut Self>,
5594        cx: &mut std::task::Context<'_>,
5595    ) -> std::task::Poll<Option<Self::Item>> {
5596        let this = &mut *self;
5597        if this.inner.check_shutdown(cx) {
5598            this.is_terminated = true;
5599            return std::task::Poll::Ready(None);
5600        }
5601        if this.is_terminated {
5602            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
5603        }
5604        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5605            |bytes, handles| {
5606                match this.inner.channel().read_etc(cx, bytes, handles) {
5607                    std::task::Poll::Ready(Ok(())) => {}
5608                    std::task::Poll::Pending => return std::task::Poll::Pending,
5609                    std::task::Poll::Ready(Err(None)) => {
5610                        this.is_terminated = true;
5611                        return std::task::Poll::Ready(None);
5612                    }
5613                    std::task::Poll::Ready(Err(Some(e))) => {
5614                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5615                            e.into(),
5616                        ))));
5617                    }
5618                }
5619
5620                // A message has been received from the channel
5621                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5622
5623                std::task::Poll::Ready(Some(match header.ordinal {
5624                0x3ba664a1c2e45a7 => {
5625                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5626                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
5627                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5628                    let control_handle = ExtendedAttributeIteratorControlHandle {
5629                        inner: this.inner.clone(),
5630                    };
5631                    Ok(ExtendedAttributeIteratorRequest::GetNext {
5632                        responder: ExtendedAttributeIteratorGetNextResponder {
5633                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5634                            tx_id: header.tx_id,
5635                        },
5636                    })
5637                }
5638                _ => Err(fidl::Error::UnknownOrdinal {
5639                    ordinal: header.ordinal,
5640                    protocol_name: <ExtendedAttributeIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5641                }),
5642            }))
5643            },
5644        )
5645    }
5646}
5647
5648#[derive(Debug)]
5649pub enum ExtendedAttributeIteratorRequest {
5650    /// Get the next chunk of extended attribute names. If this is the last
5651    /// chunk, last will be true, and the channel will be closed after the
5652    /// call.
5653    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
5654}
5655
5656impl ExtendedAttributeIteratorRequest {
5657    #[allow(irrefutable_let_patterns)]
5658    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
5659        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
5660            Some((responder))
5661        } else {
5662            None
5663        }
5664    }
5665
5666    /// Name of the method defined in FIDL
5667    pub fn method_name(&self) -> &'static str {
5668        match *self {
5669            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
5670        }
5671    }
5672}
5673
5674#[derive(Debug, Clone)]
5675pub struct ExtendedAttributeIteratorControlHandle {
5676    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5677}
5678
5679impl fdomain_client::fidl::ControlHandle for ExtendedAttributeIteratorControlHandle {
5680    fn shutdown(&self) {
5681        self.inner.shutdown()
5682    }
5683
5684    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5685        self.inner.shutdown_with_epitaph(status)
5686    }
5687
5688    fn is_closed(&self) -> bool {
5689        self.inner.channel().is_closed()
5690    }
5691    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5692        self.inner.channel().on_closed()
5693    }
5694}
5695
5696impl ExtendedAttributeIteratorControlHandle {}
5697
5698#[must_use = "FIDL methods require a response to be sent"]
5699#[derive(Debug)]
5700pub struct ExtendedAttributeIteratorGetNextResponder {
5701    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
5702    tx_id: u32,
5703}
5704
5705/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
5706/// if the responder is dropped without sending a response, so that the client
5707/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5708impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
5709    fn drop(&mut self) {
5710        self.control_handle.shutdown();
5711        // Safety: drops once, never accessed again
5712        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5713    }
5714}
5715
5716impl fdomain_client::fidl::Responder for ExtendedAttributeIteratorGetNextResponder {
5717    type ControlHandle = ExtendedAttributeIteratorControlHandle;
5718
5719    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
5720        &self.control_handle
5721    }
5722
5723    fn drop_without_shutdown(mut self) {
5724        // Safety: drops once, never accessed again due to mem::forget
5725        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5726        // Prevent Drop from running (which would shut down the channel)
5727        std::mem::forget(self);
5728    }
5729}
5730
5731impl ExtendedAttributeIteratorGetNextResponder {
5732    /// Sends a response to the FIDL transaction.
5733    ///
5734    /// Sets the channel to shutdown if an error occurs.
5735    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5736        let _result = self.send_raw(result);
5737        if _result.is_err() {
5738            self.control_handle.shutdown();
5739        }
5740        self.drop_without_shutdown();
5741        _result
5742    }
5743
5744    /// Similar to "send" but does not shutdown the channel if an error occurs.
5745    pub fn send_no_shutdown_on_err(
5746        self,
5747        mut result: Result<(&[Vec<u8>], bool), i32>,
5748    ) -> Result<(), fidl::Error> {
5749        let _result = self.send_raw(result);
5750        self.drop_without_shutdown();
5751        _result
5752    }
5753
5754    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
5755        self.control_handle.inner.send::<fidl::encoding::ResultType<
5756            ExtendedAttributeIteratorGetNextResponse,
5757            i32,
5758        >>(
5759            result,
5760            self.tx_id,
5761            0x3ba664a1c2e45a7,
5762            fidl::encoding::DynamicFlags::empty(),
5763        )
5764    }
5765}
5766
5767#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5768pub struct FileMarker;
5769
5770impl fdomain_client::fidl::ProtocolMarker for FileMarker {
5771    type Proxy = FileProxy;
5772    type RequestStream = FileRequestStream;
5773
5774    const DEBUG_NAME: &'static str = "fuchsia.io.File";
5775}
5776impl fdomain_client::fidl::DiscoverableProtocolMarker for FileMarker {}
5777pub type FileSeekResult = Result<u64, i32>;
5778pub type FileReadAtResult = Result<Vec<u8>, i32>;
5779pub type FileWriteAtResult = Result<u64, i32>;
5780pub type FileResizeResult = Result<(), i32>;
5781pub type FileGetBackingMemoryResult = Result<fdomain_client::Vmo, i32>;
5782pub type FileAllocateResult = Result<(), i32>;
5783pub type FileEnableVerityResult = Result<(), i32>;
5784
5785pub trait FileProxyInterface: Send + Sync {
5786    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
5787        + Send;
5788    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
5789    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
5790        + Send;
5791    fn r#link_into(
5792        &self,
5793        dst_parent_token: fdomain_client::Event,
5794        dst: &str,
5795    ) -> Self::LinkIntoResponseFut;
5796    fn r#clone(
5797        &self,
5798        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
5799    ) -> Result<(), fidl::Error>;
5800    type CloseResponseFut: std::future::Future<
5801            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
5802        > + Send;
5803    fn r#close(&self) -> Self::CloseResponseFut;
5804    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
5805    fn r#query(&self) -> Self::QueryResponseFut;
5806    fn r#deprecated_clone(
5807        &self,
5808        flags: OpenFlags,
5809        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
5810    ) -> Result<(), fidl::Error>;
5811    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
5812        + Send;
5813    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
5814    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
5815    fn r#deprecated_set_attr(
5816        &self,
5817        flags: NodeAttributeFlags,
5818        attributes: &NodeAttributes,
5819    ) -> Self::DeprecatedSetAttrResponseFut;
5820    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
5821        + Send;
5822    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
5823    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
5824        + Send;
5825    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
5826    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
5827        + Send;
5828    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
5829    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
5830        + Send;
5831    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
5832    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
5833        + Send;
5834    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
5835    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
5836        + Send;
5837    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
5838    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
5839        + Send;
5840    fn r#update_attributes(
5841        &self,
5842        payload: &MutableNodeAttributes,
5843    ) -> Self::UpdateAttributesResponseFut;
5844    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
5845    fn r#sync(&self) -> Self::SyncResponseFut;
5846    fn r#list_extended_attributes(
5847        &self,
5848        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
5849    ) -> Result<(), fidl::Error>;
5850    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
5851        + Send;
5852    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
5853    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
5854        + Send;
5855    fn r#set_extended_attribute(
5856        &self,
5857        name: &[u8],
5858        value: ExtendedAttributeValue,
5859        mode: SetExtendedAttributeMode,
5860    ) -> Self::SetExtendedAttributeResponseFut;
5861    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
5862        + Send;
5863    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
5864    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
5865        + Send;
5866    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
5867    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
5868        + Send;
5869    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
5870    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
5871    fn r#describe(&self) -> Self::DescribeResponseFut;
5872    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
5873    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
5874    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
5875        + Send;
5876    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
5877    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
5878        + Send;
5879    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
5880    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
5881        + Send;
5882    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
5883    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
5884        + Send;
5885    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
5886    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
5887        + Send;
5888    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
5889    -> Self::AllocateResponseFut;
5890    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
5891        + Send;
5892    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
5893}
5894
5895#[derive(Debug, Clone)]
5896pub struct FileProxy {
5897    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5898}
5899
5900impl fdomain_client::fidl::Proxy for FileProxy {
5901    type Protocol = FileMarker;
5902
5903    fn from_channel(inner: fdomain_client::Channel) -> Self {
5904        Self::new(inner)
5905    }
5906
5907    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5908        self.client.into_channel().map_err(|client| Self { client })
5909    }
5910
5911    fn as_channel(&self) -> &fdomain_client::Channel {
5912        self.client.as_channel()
5913    }
5914}
5915
5916impl FileProxy {
5917    /// Create a new Proxy for fuchsia.io/File.
5918    pub fn new(channel: fdomain_client::Channel) -> Self {
5919        let protocol_name = <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5920        Self { client: fidl::client::Client::new(channel, protocol_name) }
5921    }
5922
5923    /// Get a Stream of events from the remote end of the protocol.
5924    ///
5925    /// # Panics
5926    ///
5927    /// Panics if the event stream was already taken.
5928    pub fn take_event_stream(&self) -> FileEventStream {
5929        FileEventStream { event_receiver: self.client.take_event_receiver() }
5930    }
5931
5932    /// Acquires an advisory lock on the underlying file.
5933    ///
5934    /// The lock lasts until either this connection is closed or
5935    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
5936    /// explicitly.
5937    ///
5938    /// Advisory locks are purely advisory. They do not prevent actual read or
5939    /// write operations from occurring on the file, either through this
5940    /// connection or through other connections.
5941    ///
5942    /// This method requires the following rights:
5943    ///
5944    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
5945    /// * [`Rights.WRITE_BYTES`] if `request.type` is
5946    ///   [`AdvisoryLockType.WRITE`].
5947    ///
5948    /// # Errors
5949    ///
5950    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
5951    ///   example, another connection might hold a conflicting lock type.
5952    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
5953    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
5954    ///   to acquire the given type of lock.
5955    pub fn r#advisory_lock(
5956        &self,
5957        mut request: &AdvisoryLockRequest,
5958    ) -> fidl::client::QueryResponseFut<
5959        AdvisoryLockingAdvisoryLockResult,
5960        fdomain_client::fidl::FDomainResourceDialect,
5961    > {
5962        FileProxyInterface::r#advisory_lock(self, request)
5963    }
5964
5965    /// Creates a link to this this object with name `dst` in the directory represented by
5966    /// `dst_parent_token`.
5967    ///
5968    /// `dst` must be a resolved object name. Including "/" in the string will return
5969    /// `ZX_ERR_INVALID_ARGS`.
5970    ///
5971    /// This method requires the maximal set of rights supported by the filesystem for this object.
5972    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
5973    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
5974    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
5975    /// `ZX_ERR_ACCESS_DENIED`.
5976    ///
5977    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
5978    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
5979    ///
5980    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
5981    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
5982    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
5983    ///
5984    /// This method does not have the same atomicity properties has the `Directory::Link` method,
5985    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
5986    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
5987    pub fn r#link_into(
5988        &self,
5989        mut dst_parent_token: fdomain_client::Event,
5990        mut dst: &str,
5991    ) -> fidl::client::QueryResponseFut<
5992        LinkableLinkIntoResult,
5993        fdomain_client::fidl::FDomainResourceDialect,
5994    > {
5995        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
5996    }
5997
5998    pub fn r#clone(
5999        &self,
6000        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6001    ) -> Result<(), fidl::Error> {
6002        FileProxyInterface::r#clone(self, request)
6003    }
6004
6005    /// Terminates the connection.
6006    ///
6007    /// After calling `Close`, the client must not send any other requests.
6008    ///
6009    /// Servers, after sending the status response, should close the connection
6010    /// regardless of status and without sending an epitaph.
6011    ///
6012    /// Closing the client end of the channel should be semantically equivalent
6013    /// to calling `Close` without knowing when the close has completed or its
6014    /// status.
6015    pub fn r#close(
6016        &self,
6017    ) -> fidl::client::QueryResponseFut<
6018        fdomain_fuchsia_unknown::CloseableCloseResult,
6019        fdomain_client::fidl::FDomainResourceDialect,
6020    > {
6021        FileProxyInterface::r#close(self)
6022    }
6023
6024    pub fn r#query(
6025        &self,
6026    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
6027        FileProxyInterface::r#query(self)
6028    }
6029
6030    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
6031    pub fn r#deprecated_clone(
6032        &self,
6033        mut flags: OpenFlags,
6034        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6035    ) -> Result<(), fidl::Error> {
6036        FileProxyInterface::r#deprecated_clone(self, flags, object)
6037    }
6038
6039    /// DEPRECATED - Use `Node.GetAttributes` instead.
6040    pub fn r#deprecated_get_attr(
6041        &self,
6042    ) -> fidl::client::QueryResponseFut<
6043        (i32, NodeAttributes),
6044        fdomain_client::fidl::FDomainResourceDialect,
6045    > {
6046        FileProxyInterface::r#deprecated_get_attr(self)
6047    }
6048
6049    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
6050    pub fn r#deprecated_set_attr(
6051        &self,
6052        mut flags: NodeAttributeFlags,
6053        mut attributes: &NodeAttributes,
6054    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6055        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
6056    }
6057
6058    /// [DEPRECATED - Use new GetFlags method instead.]
6059    pub fn r#deprecated_get_flags(
6060        &self,
6061    ) -> fidl::client::QueryResponseFut<
6062        (i32, OpenFlags),
6063        fdomain_client::fidl::FDomainResourceDialect,
6064    > {
6065        FileProxyInterface::r#deprecated_get_flags(self)
6066    }
6067
6068    /// [DEPRECATED - Use new SetFlags method instead.]
6069    pub fn r#deprecated_set_flags(
6070        &self,
6071        mut flags: OpenFlags,
6072    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
6073        FileProxyInterface::r#deprecated_set_flags(self, flags)
6074    }
6075
6076    /// Queries the flags that apply to this node after it has been opened/created. This method does
6077    /// not require any rights.
6078    ///
6079    /// Note that the final set of flags that apply to the connection may differ from those
6080    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
6081    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
6082    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
6083    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
6084    pub fn r#get_flags(
6085        &self,
6086    ) -> fidl::client::QueryResponseFut<
6087        NodeGetFlagsResult,
6088        fdomain_client::fidl::FDomainResourceDialect,
6089    > {
6090        FileProxyInterface::r#get_flags(self)
6091    }
6092
6093    /// Sets the flags that apply to this node after it has been opened. This method does not
6094    /// require any rights.
6095    ///
6096    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
6097    /// clear append mode.
6098    ///
6099    /// Errors:
6100    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
6101    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
6102    pub fn r#set_flags(
6103        &self,
6104        mut flags: Flags,
6105    ) -> fidl::client::QueryResponseFut<
6106        NodeSetFlagsResult,
6107        fdomain_client::fidl::FDomainResourceDialect,
6108    > {
6109        FileProxyInterface::r#set_flags(self, flags)
6110    }
6111
6112    /// Query the filesystem for filesystem-specific information.
6113    pub fn r#query_filesystem(
6114        &self,
6115    ) -> fidl::client::QueryResponseFut<
6116        (i32, Option<Box<FilesystemInfo>>),
6117        fdomain_client::fidl::FDomainResourceDialect,
6118    > {
6119        FileProxyInterface::r#query_filesystem(self)
6120    }
6121
6122    /// Acquires information about the node.
6123    ///
6124    /// The attributes of a node should be stable, independent of the
6125    /// specific protocol used to access it.
6126    ///
6127    /// If a particular attribute is not applicable or not supported,
6128    /// filesystems should leave the corresponding field absent.
6129    ///
6130    /// + `query` a bit-mask specifying which attributes to fetch. The server
6131    ///   should not return more than necessary.
6132    /// - `attributes` the returned attributes.
6133    ///
6134    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6135    pub fn r#get_attributes(
6136        &self,
6137        mut query: NodeAttributesQuery,
6138    ) -> fidl::client::QueryResponseFut<
6139        NodeGetAttributesResult,
6140        fdomain_client::fidl::FDomainResourceDialect,
6141    > {
6142        FileProxyInterface::r#get_attributes(self, query)
6143    }
6144
6145    /// Updates information about the node.
6146    ///
6147    /// + `attributes` the presence of a table field in `attributes` indicates
6148    /// the intent to update the corresponding attribute.
6149    ///
6150    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
6151    ///
6152    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6153    pub fn r#update_attributes(
6154        &self,
6155        mut payload: &MutableNodeAttributes,
6156    ) -> fidl::client::QueryResponseFut<
6157        NodeUpdateAttributesResult,
6158        fdomain_client::fidl::FDomainResourceDialect,
6159    > {
6160        FileProxyInterface::r#update_attributes(self, payload)
6161    }
6162
6163    /// Synchronizes updates to the node to the underlying media, if it exists.
6164    ///
6165    /// This method will return when the filesystem server has flushed the
6166    /// relevant updates to the underlying media, but does not guarantee the
6167    /// underlying media has persisted the information, nor that any information
6168    /// is committed to hardware. Clients may use `Sync` to ensure ordering
6169    /// between operations.
6170    ///
6171    /// This method does not require any rights.
6172    pub fn r#sync(
6173        &self,
6174    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
6175    {
6176        FileProxyInterface::r#sync(self)
6177    }
6178
6179    /// Creates an iterator over all the extended attribute names associated
6180    /// with this node. If an error occurs it is returned as an epitaph on the
6181    /// iterator request channel, and then the channel is closed.
6182    ///
6183    /// GetExtendedAttributes can be used with any of these names to retrieve
6184    /// the associated value.
6185    ///
6186    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6187    pub fn r#list_extended_attributes(
6188        &self,
6189        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6190    ) -> Result<(), fidl::Error> {
6191        FileProxyInterface::r#list_extended_attributes(self, iterator)
6192    }
6193
6194    /// Get the value associated with the given attribute `name` for this node.
6195    ///
6196    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
6197    /// particular structure is imposed on them.
6198    ///
6199    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
6200    pub fn r#get_extended_attribute(
6201        &self,
6202        mut name: &[u8],
6203    ) -> fidl::client::QueryResponseFut<
6204        NodeGetExtendedAttributeResult,
6205        fdomain_client::fidl::FDomainResourceDialect,
6206    > {
6207        FileProxyInterface::r#get_extended_attribute(self, name)
6208    }
6209
6210    /// Set the value for the given attribute `name` to `value` for this node.
6211    ///
6212    /// The attribute name may exist, in which case the attribute is updated.
6213    /// If the attribute doesn't exist, it is created. The name should have no
6214    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
6215    ///
6216    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6217    pub fn r#set_extended_attribute(
6218        &self,
6219        mut name: &[u8],
6220        mut value: ExtendedAttributeValue,
6221        mut mode: SetExtendedAttributeMode,
6222    ) -> fidl::client::QueryResponseFut<
6223        NodeSetExtendedAttributeResult,
6224        fdomain_client::fidl::FDomainResourceDialect,
6225    > {
6226        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
6227    }
6228
6229    /// Remove the specified extended attribute.
6230    ///
6231    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
6232    ///
6233    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6234    pub fn r#remove_extended_attribute(
6235        &self,
6236        mut name: &[u8],
6237    ) -> fidl::client::QueryResponseFut<
6238        NodeRemoveExtendedAttributeResult,
6239        fdomain_client::fidl::FDomainResourceDialect,
6240    > {
6241        FileProxyInterface::r#remove_extended_attribute(self, name)
6242    }
6243
6244    /// Reads up to 'count' bytes at the seek offset.
6245    /// The seek offset is moved forward by the number of bytes read.
6246    ///
6247    /// ## Invariants
6248    ///
6249    /// * The returned `data.length` will never be greater than `count`.
6250    /// * If `data.length` is less than `count`, it means that the seek offset
6251    ///   has reached the end of file as part of this operation.
6252    /// * If `data.length` is zero while `count` is not, it means that the
6253    ///   seek offset is already at or beyond the end of file, and no data could
6254    ///   be read.
6255    /// * If `count` is zero, the server should perform all the checks ensuring
6256    ///   read access without actually read anything, and return an empty
6257    ///   `data` vector.
6258    ///
6259    /// This method requires the [`Rights.READ_BYTES`] right.
6260    ///
6261    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6262    pub fn r#read(
6263        &self,
6264        mut count: u64,
6265    ) -> fidl::client::QueryResponseFut<
6266        ReadableReadResult,
6267        fdomain_client::fidl::FDomainResourceDialect,
6268    > {
6269        FileProxyInterface::r#read(self, count)
6270    }
6271
6272    /// Writes data at the seek offset.
6273    /// The seek offset is moved forward by the number of bytes written.
6274    /// If the file is in append mode, the seek offset is first set to the end
6275    /// of the file, followed by the write, in one atomic step.
6276    ///
6277    /// The file size may grow if the seek offset plus `data.length` is beyond
6278    /// the current end of file.
6279    ///
6280    /// + request `data` the byte buffer to write to the file.
6281    /// - response `actual_count` the number of bytes written.
6282    ///
6283    /// ## Invariants
6284    ///
6285    /// * The returned `actual_count` will never be greater than `data.length`.
6286    /// * If the server is unable to write all the data due to e.g. not enough
6287    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6288    ///   could be written, an error is returned.
6289    /// * If `data.length` is zero, the server should perform all the checks
6290    ///   ensuring write access without mutating the file and return a
6291    ///   successful write of zero bytes.  The seek offset is still updated if
6292    ///   in append mode.
6293    ///
6294    /// This method requires the [`Rights.WRITE_BYTES`] right.
6295    pub fn r#write(
6296        &self,
6297        mut data: &[u8],
6298    ) -> fidl::client::QueryResponseFut<
6299        WritableWriteResult,
6300        fdomain_client::fidl::FDomainResourceDialect,
6301    > {
6302        FileProxyInterface::r#write(self, data)
6303    }
6304
6305    pub fn r#describe(
6306        &self,
6307    ) -> fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
6308    {
6309        FileProxyInterface::r#describe(self)
6310    }
6311
6312    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
6313    /// will occur. The seek offset is specific to each file connection.
6314    ///
6315    /// + request `origin` the reference point where `offset` will be based on.
6316    /// + request `offset` the number of bytes to seek.
6317    /// - response `offset_from_start` the adjusted seek offset, from the start
6318    ///   of the file.
6319    ///
6320    /// This method does not require any rights.
6321    pub fn r#seek(
6322        &self,
6323        mut origin: SeekOrigin,
6324        mut offset: i64,
6325    ) -> fidl::client::QueryResponseFut<FileSeekResult, fdomain_client::fidl::FDomainResourceDialect>
6326    {
6327        FileProxyInterface::r#seek(self, origin, offset)
6328    }
6329
6330    /// Reads up to 'count' bytes at the provided offset.
6331    /// Does not affect the seek offset.
6332    ///
6333    /// ## Invariants
6334    ///
6335    /// * The returned `data.length` will never be greater than `count`.
6336    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
6337    ///   the end of file as part of this operation.
6338    /// * If `data.length` is zero while `count` is not, it means that `offset`
6339    ///   is at or past the end of file, and no data can be read.
6340    /// * If `count` is zero, the server should perform all the checks ensuring
6341    ///   read access without actually reading anything, and return an empty
6342    ///   `data` vector.
6343    ///
6344    /// This method requires the [`Rights.READ_BYTES`] right.
6345    ///
6346    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
6347    pub fn r#read_at(
6348        &self,
6349        mut count: u64,
6350        mut offset: u64,
6351    ) -> fidl::client::QueryResponseFut<
6352        FileReadAtResult,
6353        fdomain_client::fidl::FDomainResourceDialect,
6354    > {
6355        FileProxyInterface::r#read_at(self, count, offset)
6356    }
6357
6358    /// Writes data at the provided offset.
6359    /// Does not affect the seek offset.
6360    ///
6361    /// The file size may grow if `offset` plus `data.length` is past the
6362    /// current end of file.
6363    ///
6364    /// + request `data` the byte buffer to write to the file.
6365    /// + request `offset` the offset from start of the file to begin writing.
6366    /// - response `actual_count` the number of bytes written.
6367    ///
6368    /// ## Invariants
6369    ///
6370    /// * The returned `actual_count` will never be greater than `data.length`.
6371    /// * If the server is unable to write all the data due to e.g. not enough
6372    ///   space, `actual_count` may be less than `data.length`.  If no bytes
6373    ///   could be written, an error is returned.
6374    /// * If `data.length` is zero, the server should perform all the checks
6375    ///   ensuring write access without mutating the file, and will return a
6376    ///   successful write of zero bytes.
6377    ///
6378    /// This method requires the [`Rights.WRITE_BYTES`] right.
6379    pub fn r#write_at(
6380        &self,
6381        mut data: &[u8],
6382        mut offset: u64,
6383    ) -> fidl::client::QueryResponseFut<
6384        FileWriteAtResult,
6385        fdomain_client::fidl::FDomainResourceDialect,
6386    > {
6387        FileProxyInterface::r#write_at(self, data, offset)
6388    }
6389
6390    /// Shrinks or grows the file size to 'length' bytes.
6391    ///
6392    /// If file size is reduced by this operation, the extra trailing data'
6393    /// is discarded.
6394    /// If file size is increased by this operation, the extended area appears
6395    /// as if it was zeroed.
6396    ///
6397    /// This method requires the [`Rights.WRITE_BYTES`] right.
6398    pub fn r#resize(
6399        &self,
6400        mut length: u64,
6401    ) -> fidl::client::QueryResponseFut<
6402        FileResizeResult,
6403        fdomain_client::fidl::FDomainResourceDialect,
6404    > {
6405        FileProxyInterface::r#resize(self, length)
6406    }
6407
6408    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
6409    /// with the requested access rights.
6410    ///
6411    /// Implementations are not required to implement files backed by VMOs so
6412    /// this request may fail. Additionally, implementations may only support
6413    /// a certain subset of the flags. Clients should be prepared with fallback
6414    /// behavior if this request fails.
6415    ///
6416    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
6417    /// implementation is free to choose the semantics of the returned VMO.
6418    ///
6419    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
6420    /// - response `vmo` the requested [`zx.Handle:VMO`].
6421    /// * error a [`zx.Status`] value indicating the failure.
6422    ///
6423    /// This method requires the following rights:
6424    ///
6425    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
6426    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
6427    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
6428    pub fn r#get_backing_memory(
6429        &self,
6430        mut flags: VmoFlags,
6431    ) -> fidl::client::QueryResponseFut<
6432        FileGetBackingMemoryResult,
6433        fdomain_client::fidl::FDomainResourceDialect,
6434    > {
6435        FileProxyInterface::r#get_backing_memory(self, flags)
6436    }
6437
6438    /// Pre-allocate on-disk space for this file.
6439    pub fn r#allocate(
6440        &self,
6441        mut offset: u64,
6442        mut length: u64,
6443        mut mode: AllocateMode,
6444    ) -> fidl::client::QueryResponseFut<
6445        FileAllocateResult,
6446        fdomain_client::fidl::FDomainResourceDialect,
6447    > {
6448        FileProxyInterface::r#allocate(self, offset, length, mode)
6449    }
6450
6451    /// Enables verification for the file (permanently) which involves computing a merkle tree for
6452    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
6453    /// captured. Future reads will be verified against the computed merkle tree and writes will be
6454    /// rejected. This method can take some time to complete as it depends on the size of the file.
6455    /// This method can be aborted by closing the connection that this method was issued on.
6456    ///
6457    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
6458    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
6459    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
6460    /// Also returns any error that might arise from reading the file, or from flushing the file,
6461    /// such as `ZX_ERR_IO`.
6462    pub fn r#enable_verity(
6463        &self,
6464        mut options: &VerificationOptions,
6465    ) -> fidl::client::QueryResponseFut<
6466        FileEnableVerityResult,
6467        fdomain_client::fidl::FDomainResourceDialect,
6468    > {
6469        FileProxyInterface::r#enable_verity(self, options)
6470    }
6471}
6472
6473impl FileProxyInterface for FileProxy {
6474    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
6475        AdvisoryLockingAdvisoryLockResult,
6476        fdomain_client::fidl::FDomainResourceDialect,
6477    >;
6478    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
6479        fn _decode(
6480            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6481        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
6482            let _response = fidl::client::decode_transaction_body::<
6483                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6484                fdomain_client::fidl::FDomainResourceDialect,
6485                0x6ee9c0ad53ec87aa,
6486            >(_buf?)?;
6487            Ok(_response.map(|x| x))
6488        }
6489        self.client.send_query_and_decode::<
6490            AdvisoryLockingAdvisoryLockRequest,
6491            AdvisoryLockingAdvisoryLockResult,
6492        >(
6493            (request,),
6494            0x6ee9c0ad53ec87aa,
6495            fidl::encoding::DynamicFlags::empty(),
6496            _decode,
6497        )
6498    }
6499
6500    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
6501        LinkableLinkIntoResult,
6502        fdomain_client::fidl::FDomainResourceDialect,
6503    >;
6504    fn r#link_into(
6505        &self,
6506        mut dst_parent_token: fdomain_client::Event,
6507        mut dst: &str,
6508    ) -> Self::LinkIntoResponseFut {
6509        fn _decode(
6510            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6511        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
6512            let _response = fidl::client::decode_transaction_body::<
6513                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6514                fdomain_client::fidl::FDomainResourceDialect,
6515                0x54f3949246a03e74,
6516            >(_buf?)?;
6517            Ok(_response.map(|x| x))
6518        }
6519        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
6520            (dst_parent_token, dst),
6521            0x54f3949246a03e74,
6522            fidl::encoding::DynamicFlags::empty(),
6523            _decode,
6524        )
6525    }
6526
6527    fn r#clone(
6528        &self,
6529        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
6530    ) -> Result<(), fidl::Error> {
6531        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
6532            (request,),
6533            0x20d8a7aba2168a79,
6534            fidl::encoding::DynamicFlags::empty(),
6535        )
6536    }
6537
6538    type CloseResponseFut = fidl::client::QueryResponseFut<
6539        fdomain_fuchsia_unknown::CloseableCloseResult,
6540        fdomain_client::fidl::FDomainResourceDialect,
6541    >;
6542    fn r#close(&self) -> Self::CloseResponseFut {
6543        fn _decode(
6544            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6545        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
6546            let _response = fidl::client::decode_transaction_body::<
6547                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6548                fdomain_client::fidl::FDomainResourceDialect,
6549                0x5ac5d459ad7f657e,
6550            >(_buf?)?;
6551            Ok(_response.map(|x| x))
6552        }
6553        self.client.send_query_and_decode::<
6554            fidl::encoding::EmptyPayload,
6555            fdomain_fuchsia_unknown::CloseableCloseResult,
6556        >(
6557            (),
6558            0x5ac5d459ad7f657e,
6559            fidl::encoding::DynamicFlags::empty(),
6560            _decode,
6561        )
6562    }
6563
6564    type QueryResponseFut =
6565        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
6566    fn r#query(&self) -> Self::QueryResponseFut {
6567        fn _decode(
6568            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6569        ) -> Result<Vec<u8>, fidl::Error> {
6570            let _response = fidl::client::decode_transaction_body::<
6571                fdomain_fuchsia_unknown::QueryableQueryResponse,
6572                fdomain_client::fidl::FDomainResourceDialect,
6573                0x2658edee9decfc06,
6574            >(_buf?)?;
6575            Ok(_response.protocol)
6576        }
6577        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
6578            (),
6579            0x2658edee9decfc06,
6580            fidl::encoding::DynamicFlags::empty(),
6581            _decode,
6582        )
6583    }
6584
6585    fn r#deprecated_clone(
6586        &self,
6587        mut flags: OpenFlags,
6588        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
6589    ) -> Result<(), fidl::Error> {
6590        self.client.send::<NodeDeprecatedCloneRequest>(
6591            (flags, object),
6592            0x5a61678f293ce16f,
6593            fidl::encoding::DynamicFlags::FLEXIBLE,
6594        )
6595    }
6596
6597    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
6598        (i32, NodeAttributes),
6599        fdomain_client::fidl::FDomainResourceDialect,
6600    >;
6601    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
6602        fn _decode(
6603            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6604        ) -> Result<(i32, NodeAttributes), fidl::Error> {
6605            let _response = fidl::client::decode_transaction_body::<
6606                NodeDeprecatedGetAttrResponse,
6607                fdomain_client::fidl::FDomainResourceDialect,
6608                0x78985e216314dafd,
6609            >(_buf?)?;
6610            Ok((_response.s, _response.attributes))
6611        }
6612        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
6613            (),
6614            0x78985e216314dafd,
6615            fidl::encoding::DynamicFlags::empty(),
6616            _decode,
6617        )
6618    }
6619
6620    type DeprecatedSetAttrResponseFut =
6621        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6622    fn r#deprecated_set_attr(
6623        &self,
6624        mut flags: NodeAttributeFlags,
6625        mut attributes: &NodeAttributes,
6626    ) -> Self::DeprecatedSetAttrResponseFut {
6627        fn _decode(
6628            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6629        ) -> Result<i32, fidl::Error> {
6630            let _response = fidl::client::decode_transaction_body::<
6631                NodeDeprecatedSetAttrResponse,
6632                fdomain_client::fidl::FDomainResourceDialect,
6633                0x4186c0f40d938f46,
6634            >(_buf?)?;
6635            Ok(_response.s)
6636        }
6637        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
6638            (flags, attributes),
6639            0x4186c0f40d938f46,
6640            fidl::encoding::DynamicFlags::empty(),
6641            _decode,
6642        )
6643    }
6644
6645    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
6646        (i32, OpenFlags),
6647        fdomain_client::fidl::FDomainResourceDialect,
6648    >;
6649    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
6650        fn _decode(
6651            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6652        ) -> Result<(i32, OpenFlags), fidl::Error> {
6653            let _response = fidl::client::decode_transaction_body::<
6654                NodeDeprecatedGetFlagsResponse,
6655                fdomain_client::fidl::FDomainResourceDialect,
6656                0x5b88fffb8eda3aa1,
6657            >(_buf?)?;
6658            Ok((_response.s, _response.flags))
6659        }
6660        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
6661            (),
6662            0x5b88fffb8eda3aa1,
6663            fidl::encoding::DynamicFlags::empty(),
6664            _decode,
6665        )
6666    }
6667
6668    type DeprecatedSetFlagsResponseFut =
6669        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
6670    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
6671        fn _decode(
6672            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6673        ) -> Result<i32, fidl::Error> {
6674            let _response = fidl::client::decode_transaction_body::<
6675                NodeDeprecatedSetFlagsResponse,
6676                fdomain_client::fidl::FDomainResourceDialect,
6677                0x5295b76c71fde733,
6678            >(_buf?)?;
6679            Ok(_response.s)
6680        }
6681        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
6682            (flags,),
6683            0x5295b76c71fde733,
6684            fidl::encoding::DynamicFlags::empty(),
6685            _decode,
6686        )
6687    }
6688
6689    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
6690        NodeGetFlagsResult,
6691        fdomain_client::fidl::FDomainResourceDialect,
6692    >;
6693    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
6694        fn _decode(
6695            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6696        ) -> Result<NodeGetFlagsResult, fidl::Error> {
6697            let _response = fidl::client::decode_transaction_body::<
6698                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
6699                fdomain_client::fidl::FDomainResourceDialect,
6700                0x176eb318f64ec23,
6701            >(_buf?)?
6702            .into_result_fdomain::<FileMarker>("get_flags")?;
6703            Ok(_response.map(|x| x.flags))
6704        }
6705        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
6706            (),
6707            0x176eb318f64ec23,
6708            fidl::encoding::DynamicFlags::FLEXIBLE,
6709            _decode,
6710        )
6711    }
6712
6713    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
6714        NodeSetFlagsResult,
6715        fdomain_client::fidl::FDomainResourceDialect,
6716    >;
6717    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
6718        fn _decode(
6719            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6720        ) -> Result<NodeSetFlagsResult, fidl::Error> {
6721            let _response = fidl::client::decode_transaction_body::<
6722                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6723                fdomain_client::fidl::FDomainResourceDialect,
6724                0x55a8028685791ea8,
6725            >(_buf?)?
6726            .into_result_fdomain::<FileMarker>("set_flags")?;
6727            Ok(_response.map(|x| x))
6728        }
6729        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
6730            (flags,),
6731            0x55a8028685791ea8,
6732            fidl::encoding::DynamicFlags::FLEXIBLE,
6733            _decode,
6734        )
6735    }
6736
6737    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
6738        (i32, Option<Box<FilesystemInfo>>),
6739        fdomain_client::fidl::FDomainResourceDialect,
6740    >;
6741    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
6742        fn _decode(
6743            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6744        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
6745            let _response = fidl::client::decode_transaction_body::<
6746                NodeQueryFilesystemResponse,
6747                fdomain_client::fidl::FDomainResourceDialect,
6748                0x6f344a1c6b0a0610,
6749            >(_buf?)?;
6750            Ok((_response.s, _response.info))
6751        }
6752        self.client.send_query_and_decode::<
6753            fidl::encoding::EmptyPayload,
6754            (i32, Option<Box<FilesystemInfo>>),
6755        >(
6756            (),
6757            0x6f344a1c6b0a0610,
6758            fidl::encoding::DynamicFlags::empty(),
6759            _decode,
6760        )
6761    }
6762
6763    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
6764        NodeGetAttributesResult,
6765        fdomain_client::fidl::FDomainResourceDialect,
6766    >;
6767    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
6768        fn _decode(
6769            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6770        ) -> Result<NodeGetAttributesResult, fidl::Error> {
6771            let _response = fidl::client::decode_transaction_body::<
6772                fidl::encoding::ResultType<NodeAttributes2, i32>,
6773                fdomain_client::fidl::FDomainResourceDialect,
6774                0x3d4396a638ea053b,
6775            >(_buf?)?;
6776            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
6777        }
6778        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
6779            (query,),
6780            0x3d4396a638ea053b,
6781            fidl::encoding::DynamicFlags::empty(),
6782            _decode,
6783        )
6784    }
6785
6786    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
6787        NodeUpdateAttributesResult,
6788        fdomain_client::fidl::FDomainResourceDialect,
6789    >;
6790    fn r#update_attributes(
6791        &self,
6792        mut payload: &MutableNodeAttributes,
6793    ) -> Self::UpdateAttributesResponseFut {
6794        fn _decode(
6795            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6796        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
6797            let _response = fidl::client::decode_transaction_body::<
6798                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6799                fdomain_client::fidl::FDomainResourceDialect,
6800                0x3308c1da5a89bf08,
6801            >(_buf?)?;
6802            Ok(_response.map(|x| x))
6803        }
6804        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
6805            payload,
6806            0x3308c1da5a89bf08,
6807            fidl::encoding::DynamicFlags::empty(),
6808            _decode,
6809        )
6810    }
6811
6812    type SyncResponseFut = fidl::client::QueryResponseFut<
6813        NodeSyncResult,
6814        fdomain_client::fidl::FDomainResourceDialect,
6815    >;
6816    fn r#sync(&self) -> Self::SyncResponseFut {
6817        fn _decode(
6818            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6819        ) -> Result<NodeSyncResult, fidl::Error> {
6820            let _response = fidl::client::decode_transaction_body::<
6821                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6822                fdomain_client::fidl::FDomainResourceDialect,
6823                0x2c5c27ca0ab5dc49,
6824            >(_buf?)?;
6825            Ok(_response.map(|x| x))
6826        }
6827        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
6828            (),
6829            0x2c5c27ca0ab5dc49,
6830            fidl::encoding::DynamicFlags::empty(),
6831            _decode,
6832        )
6833    }
6834
6835    fn r#list_extended_attributes(
6836        &self,
6837        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
6838    ) -> Result<(), fidl::Error> {
6839        self.client.send::<NodeListExtendedAttributesRequest>(
6840            (iterator,),
6841            0x4b61033de007fcd0,
6842            fidl::encoding::DynamicFlags::empty(),
6843        )
6844    }
6845
6846    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6847        NodeGetExtendedAttributeResult,
6848        fdomain_client::fidl::FDomainResourceDialect,
6849    >;
6850    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
6851        fn _decode(
6852            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6853        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
6854            let _response = fidl::client::decode_transaction_body::<
6855                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
6856                fdomain_client::fidl::FDomainResourceDialect,
6857                0x45ffa3ccfdeb76db,
6858            >(_buf?)?;
6859            Ok(_response.map(|x| x))
6860        }
6861        self.client.send_query_and_decode::<
6862            NodeGetExtendedAttributeRequest,
6863            NodeGetExtendedAttributeResult,
6864        >(
6865            (name,),
6866            0x45ffa3ccfdeb76db,
6867            fidl::encoding::DynamicFlags::empty(),
6868            _decode,
6869        )
6870    }
6871
6872    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6873        NodeSetExtendedAttributeResult,
6874        fdomain_client::fidl::FDomainResourceDialect,
6875    >;
6876    fn r#set_extended_attribute(
6877        &self,
6878        mut name: &[u8],
6879        mut value: ExtendedAttributeValue,
6880        mut mode: SetExtendedAttributeMode,
6881    ) -> Self::SetExtendedAttributeResponseFut {
6882        fn _decode(
6883            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6884        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
6885            let _response = fidl::client::decode_transaction_body::<
6886                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6887                fdomain_client::fidl::FDomainResourceDialect,
6888                0x4a951362f681f23c,
6889            >(_buf?)?;
6890            Ok(_response.map(|x| x))
6891        }
6892        self.client.send_query_and_decode::<
6893            NodeSetExtendedAttributeRequest,
6894            NodeSetExtendedAttributeResult,
6895        >(
6896            (name, &mut value, mode,),
6897            0x4a951362f681f23c,
6898            fidl::encoding::DynamicFlags::empty(),
6899            _decode,
6900        )
6901    }
6902
6903    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
6904        NodeRemoveExtendedAttributeResult,
6905        fdomain_client::fidl::FDomainResourceDialect,
6906    >;
6907    fn r#remove_extended_attribute(
6908        &self,
6909        mut name: &[u8],
6910    ) -> Self::RemoveExtendedAttributeResponseFut {
6911        fn _decode(
6912            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6913        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
6914            let _response = fidl::client::decode_transaction_body::<
6915                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6916                fdomain_client::fidl::FDomainResourceDialect,
6917                0x7a0b9f3a9bf9032d,
6918            >(_buf?)?;
6919            Ok(_response.map(|x| x))
6920        }
6921        self.client.send_query_and_decode::<
6922            NodeRemoveExtendedAttributeRequest,
6923            NodeRemoveExtendedAttributeResult,
6924        >(
6925            (name,),
6926            0x7a0b9f3a9bf9032d,
6927            fidl::encoding::DynamicFlags::empty(),
6928            _decode,
6929        )
6930    }
6931
6932    type ReadResponseFut = fidl::client::QueryResponseFut<
6933        ReadableReadResult,
6934        fdomain_client::fidl::FDomainResourceDialect,
6935    >;
6936    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
6937        fn _decode(
6938            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6939        ) -> Result<ReadableReadResult, fidl::Error> {
6940            let _response = fidl::client::decode_transaction_body::<
6941                fidl::encoding::ResultType<ReadableReadResponse, i32>,
6942                fdomain_client::fidl::FDomainResourceDialect,
6943                0x57e419a298c8ede,
6944            >(_buf?)?;
6945            Ok(_response.map(|x| x.data))
6946        }
6947        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
6948            (count,),
6949            0x57e419a298c8ede,
6950            fidl::encoding::DynamicFlags::empty(),
6951            _decode,
6952        )
6953    }
6954
6955    type WriteResponseFut = fidl::client::QueryResponseFut<
6956        WritableWriteResult,
6957        fdomain_client::fidl::FDomainResourceDialect,
6958    >;
6959    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
6960        fn _decode(
6961            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6962        ) -> Result<WritableWriteResult, fidl::Error> {
6963            let _response = fidl::client::decode_transaction_body::<
6964                fidl::encoding::ResultType<WritableWriteResponse, i32>,
6965                fdomain_client::fidl::FDomainResourceDialect,
6966                0x6a31437832469f82,
6967            >(_buf?)?;
6968            Ok(_response.map(|x| x.actual_count))
6969        }
6970        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
6971            (data,),
6972            0x6a31437832469f82,
6973            fidl::encoding::DynamicFlags::empty(),
6974            _decode,
6975        )
6976    }
6977
6978    type DescribeResponseFut =
6979        fidl::client::QueryResponseFut<FileInfo, fdomain_client::fidl::FDomainResourceDialect>;
6980    fn r#describe(&self) -> Self::DescribeResponseFut {
6981        fn _decode(
6982            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6983        ) -> Result<FileInfo, fidl::Error> {
6984            let _response = fidl::client::decode_transaction_body::<
6985                FileInfo,
6986                fdomain_client::fidl::FDomainResourceDialect,
6987                0x68b5ac00c62906bc,
6988            >(_buf?)?;
6989            Ok(_response)
6990        }
6991        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
6992            (),
6993            0x68b5ac00c62906bc,
6994            fidl::encoding::DynamicFlags::empty(),
6995            _decode,
6996        )
6997    }
6998
6999    type SeekResponseFut = fidl::client::QueryResponseFut<
7000        FileSeekResult,
7001        fdomain_client::fidl::FDomainResourceDialect,
7002    >;
7003    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
7004        fn _decode(
7005            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7006        ) -> Result<FileSeekResult, fidl::Error> {
7007            let _response = fidl::client::decode_transaction_body::<
7008                fidl::encoding::ResultType<FileSeekResponse, i32>,
7009                fdomain_client::fidl::FDomainResourceDialect,
7010                0x78079168162c5207,
7011            >(_buf?)?;
7012            Ok(_response.map(|x| x.offset_from_start))
7013        }
7014        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
7015            (origin, offset),
7016            0x78079168162c5207,
7017            fidl::encoding::DynamicFlags::empty(),
7018            _decode,
7019        )
7020    }
7021
7022    type ReadAtResponseFut = fidl::client::QueryResponseFut<
7023        FileReadAtResult,
7024        fdomain_client::fidl::FDomainResourceDialect,
7025    >;
7026    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
7027        fn _decode(
7028            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7029        ) -> Result<FileReadAtResult, fidl::Error> {
7030            let _response = fidl::client::decode_transaction_body::<
7031                fidl::encoding::ResultType<FileReadAtResponse, i32>,
7032                fdomain_client::fidl::FDomainResourceDialect,
7033                0x1607a293a60d723e,
7034            >(_buf?)?;
7035            Ok(_response.map(|x| x.data))
7036        }
7037        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
7038            (count, offset),
7039            0x1607a293a60d723e,
7040            fidl::encoding::DynamicFlags::empty(),
7041            _decode,
7042        )
7043    }
7044
7045    type WriteAtResponseFut = fidl::client::QueryResponseFut<
7046        FileWriteAtResult,
7047        fdomain_client::fidl::FDomainResourceDialect,
7048    >;
7049    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
7050        fn _decode(
7051            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7052        ) -> Result<FileWriteAtResult, fidl::Error> {
7053            let _response = fidl::client::decode_transaction_body::<
7054                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7055                fdomain_client::fidl::FDomainResourceDialect,
7056                0x793eefc0045e792b,
7057            >(_buf?)?;
7058            Ok(_response.map(|x| x.actual_count))
7059        }
7060        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
7061            (data, offset),
7062            0x793eefc0045e792b,
7063            fidl::encoding::DynamicFlags::empty(),
7064            _decode,
7065        )
7066    }
7067
7068    type ResizeResponseFut = fidl::client::QueryResponseFut<
7069        FileResizeResult,
7070        fdomain_client::fidl::FDomainResourceDialect,
7071    >;
7072    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
7073        fn _decode(
7074            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7075        ) -> Result<FileResizeResult, fidl::Error> {
7076            let _response = fidl::client::decode_transaction_body::<
7077                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7078                fdomain_client::fidl::FDomainResourceDialect,
7079                0x2b80825f0535743a,
7080            >(_buf?)?;
7081            Ok(_response.map(|x| x))
7082        }
7083        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
7084            (length,),
7085            0x2b80825f0535743a,
7086            fidl::encoding::DynamicFlags::empty(),
7087            _decode,
7088        )
7089    }
7090
7091    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
7092        FileGetBackingMemoryResult,
7093        fdomain_client::fidl::FDomainResourceDialect,
7094    >;
7095    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
7096        fn _decode(
7097            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7098        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7099            let _response = fidl::client::decode_transaction_body::<
7100                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7101                fdomain_client::fidl::FDomainResourceDialect,
7102                0xa6a9e654cbf62b,
7103            >(_buf?)?;
7104            Ok(_response.map(|x| x.vmo))
7105        }
7106        self.client
7107            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
7108                (flags,),
7109                0xa6a9e654cbf62b,
7110                fidl::encoding::DynamicFlags::empty(),
7111                _decode,
7112            )
7113    }
7114
7115    type AllocateResponseFut = fidl::client::QueryResponseFut<
7116        FileAllocateResult,
7117        fdomain_client::fidl::FDomainResourceDialect,
7118    >;
7119    fn r#allocate(
7120        &self,
7121        mut offset: u64,
7122        mut length: u64,
7123        mut mode: AllocateMode,
7124    ) -> Self::AllocateResponseFut {
7125        fn _decode(
7126            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7127        ) -> Result<FileAllocateResult, fidl::Error> {
7128            let _response = fidl::client::decode_transaction_body::<
7129                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7130                fdomain_client::fidl::FDomainResourceDialect,
7131                0x77fa0c330b57fd2e,
7132            >(_buf?)?
7133            .into_result_fdomain::<FileMarker>("allocate")?;
7134            Ok(_response.map(|x| x))
7135        }
7136        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
7137            (offset, length, mode),
7138            0x77fa0c330b57fd2e,
7139            fidl::encoding::DynamicFlags::FLEXIBLE,
7140            _decode,
7141        )
7142    }
7143
7144    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
7145        FileEnableVerityResult,
7146        fdomain_client::fidl::FDomainResourceDialect,
7147    >;
7148    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
7149        fn _decode(
7150            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7151        ) -> Result<FileEnableVerityResult, fidl::Error> {
7152            let _response = fidl::client::decode_transaction_body::<
7153                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7154                fdomain_client::fidl::FDomainResourceDialect,
7155                0x2c421ec3faaeb8bb,
7156            >(_buf?)?
7157            .into_result_fdomain::<FileMarker>("enable_verity")?;
7158            Ok(_response.map(|x| x))
7159        }
7160        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
7161            (options,),
7162            0x2c421ec3faaeb8bb,
7163            fidl::encoding::DynamicFlags::FLEXIBLE,
7164            _decode,
7165        )
7166    }
7167}
7168
7169pub struct FileEventStream {
7170    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7171}
7172
7173impl std::marker::Unpin for FileEventStream {}
7174
7175impl futures::stream::FusedStream for FileEventStream {
7176    fn is_terminated(&self) -> bool {
7177        self.event_receiver.is_terminated()
7178    }
7179}
7180
7181impl futures::Stream for FileEventStream {
7182    type Item = Result<FileEvent, fidl::Error>;
7183
7184    fn poll_next(
7185        mut self: std::pin::Pin<&mut Self>,
7186        cx: &mut std::task::Context<'_>,
7187    ) -> std::task::Poll<Option<Self::Item>> {
7188        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7189            &mut self.event_receiver,
7190            cx
7191        )?) {
7192            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
7193            None => std::task::Poll::Ready(None),
7194        }
7195    }
7196}
7197
7198#[derive(Debug)]
7199pub enum FileEvent {
7200    OnOpen_ {
7201        s: i32,
7202        info: Option<Box<NodeInfoDeprecated>>,
7203    },
7204    OnRepresentation {
7205        payload: Representation,
7206    },
7207    #[non_exhaustive]
7208    _UnknownEvent {
7209        /// Ordinal of the event that was sent.
7210        ordinal: u64,
7211    },
7212}
7213
7214impl FileEvent {
7215    #[allow(irrefutable_let_patterns)]
7216    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
7217        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
7218    }
7219    #[allow(irrefutable_let_patterns)]
7220    pub fn into_on_representation(self) -> Option<Representation> {
7221        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
7222    }
7223
7224    /// Decodes a message buffer as a [`FileEvent`].
7225    fn decode(
7226        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7227    ) -> Result<FileEvent, fidl::Error> {
7228        let (bytes, _handles) = buf.split_mut();
7229        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7230        debug_assert_eq!(tx_header.tx_id, 0);
7231        match tx_header.ordinal {
7232            0x7fc7bbb1dbfd1972 => {
7233                let mut out = fidl::new_empty!(
7234                    NodeOnOpenRequest,
7235                    fdomain_client::fidl::FDomainResourceDialect
7236                );
7237                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
7238                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
7239            }
7240            0x5cb40567d80a510c => {
7241                let mut out =
7242                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
7243                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
7244                Ok((FileEvent::OnRepresentation { payload: out }))
7245            }
7246            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7247                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7248            }
7249            _ => Err(fidl::Error::UnknownOrdinal {
7250                ordinal: tx_header.ordinal,
7251                protocol_name: <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7252            }),
7253        }
7254    }
7255}
7256
7257/// A Stream of incoming requests for fuchsia.io/File.
7258pub struct FileRequestStream {
7259    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7260    is_terminated: bool,
7261}
7262
7263impl std::marker::Unpin for FileRequestStream {}
7264
7265impl futures::stream::FusedStream for FileRequestStream {
7266    fn is_terminated(&self) -> bool {
7267        self.is_terminated
7268    }
7269}
7270
7271impl fdomain_client::fidl::RequestStream for FileRequestStream {
7272    type Protocol = FileMarker;
7273    type ControlHandle = FileControlHandle;
7274
7275    fn from_channel(channel: fdomain_client::Channel) -> Self {
7276        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7277    }
7278
7279    fn control_handle(&self) -> Self::ControlHandle {
7280        FileControlHandle { inner: self.inner.clone() }
7281    }
7282
7283    fn into_inner(
7284        self,
7285    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7286    {
7287        (self.inner, self.is_terminated)
7288    }
7289
7290    fn from_inner(
7291        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7292        is_terminated: bool,
7293    ) -> Self {
7294        Self { inner, is_terminated }
7295    }
7296}
7297
7298impl futures::Stream for FileRequestStream {
7299    type Item = Result<FileRequest, fidl::Error>;
7300
7301    fn poll_next(
7302        mut self: std::pin::Pin<&mut Self>,
7303        cx: &mut std::task::Context<'_>,
7304    ) -> std::task::Poll<Option<Self::Item>> {
7305        let this = &mut *self;
7306        if this.inner.check_shutdown(cx) {
7307            this.is_terminated = true;
7308            return std::task::Poll::Ready(None);
7309        }
7310        if this.is_terminated {
7311            panic!("polled FileRequestStream after completion");
7312        }
7313        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7314            |bytes, handles| {
7315                match this.inner.channel().read_etc(cx, bytes, handles) {
7316                    std::task::Poll::Ready(Ok(())) => {}
7317                    std::task::Poll::Pending => return std::task::Poll::Pending,
7318                    std::task::Poll::Ready(Err(None)) => {
7319                        this.is_terminated = true;
7320                        return std::task::Poll::Ready(None);
7321                    }
7322                    std::task::Poll::Ready(Err(Some(e))) => {
7323                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7324                            e.into(),
7325                        ))));
7326                    }
7327                }
7328
7329                // A message has been received from the channel
7330                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7331
7332                std::task::Poll::Ready(Some(match header.ordinal {
7333                    0x6ee9c0ad53ec87aa => {
7334                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7335                        let mut req = fidl::new_empty!(
7336                            AdvisoryLockingAdvisoryLockRequest,
7337                            fdomain_client::fidl::FDomainResourceDialect
7338                        );
7339                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
7340                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7341                        Ok(FileRequest::AdvisoryLock {
7342                            request: req.request,
7343
7344                            responder: FileAdvisoryLockResponder {
7345                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7346                                tx_id: header.tx_id,
7347                            },
7348                        })
7349                    }
7350                    0x54f3949246a03e74 => {
7351                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7352                        let mut req = fidl::new_empty!(
7353                            LinkableLinkIntoRequest,
7354                            fdomain_client::fidl::FDomainResourceDialect
7355                        );
7356                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
7357                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7358                        Ok(FileRequest::LinkInto {
7359                            dst_parent_token: req.dst_parent_token,
7360                            dst: req.dst,
7361
7362                            responder: FileLinkIntoResponder {
7363                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7364                                tx_id: header.tx_id,
7365                            },
7366                        })
7367                    }
7368                    0x20d8a7aba2168a79 => {
7369                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7370                        let mut req = fidl::new_empty!(
7371                            fdomain_fuchsia_unknown::CloneableCloneRequest,
7372                            fdomain_client::fidl::FDomainResourceDialect
7373                        );
7374                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7375                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7376                        Ok(FileRequest::Clone { request: req.request, control_handle })
7377                    }
7378                    0x5ac5d459ad7f657e => {
7379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7380                        let mut req = fidl::new_empty!(
7381                            fidl::encoding::EmptyPayload,
7382                            fdomain_client::fidl::FDomainResourceDialect
7383                        );
7384                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7385                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7386                        Ok(FileRequest::Close {
7387                            responder: FileCloseResponder {
7388                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7389                                tx_id: header.tx_id,
7390                            },
7391                        })
7392                    }
7393                    0x2658edee9decfc06 => {
7394                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7395                        let mut req = fidl::new_empty!(
7396                            fidl::encoding::EmptyPayload,
7397                            fdomain_client::fidl::FDomainResourceDialect
7398                        );
7399                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7400                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7401                        Ok(FileRequest::Query {
7402                            responder: FileQueryResponder {
7403                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7404                                tx_id: header.tx_id,
7405                            },
7406                        })
7407                    }
7408                    0x5a61678f293ce16f => {
7409                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7410                        let mut req = fidl::new_empty!(
7411                            NodeDeprecatedCloneRequest,
7412                            fdomain_client::fidl::FDomainResourceDialect
7413                        );
7414                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7415                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7416                        Ok(FileRequest::DeprecatedClone {
7417                            flags: req.flags,
7418                            object: req.object,
7419
7420                            control_handle,
7421                        })
7422                    }
7423                    0x78985e216314dafd => {
7424                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7425                        let mut req = fidl::new_empty!(
7426                            fidl::encoding::EmptyPayload,
7427                            fdomain_client::fidl::FDomainResourceDialect
7428                        );
7429                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7430                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7431                        Ok(FileRequest::DeprecatedGetAttr {
7432                            responder: FileDeprecatedGetAttrResponder {
7433                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7434                                tx_id: header.tx_id,
7435                            },
7436                        })
7437                    }
7438                    0x4186c0f40d938f46 => {
7439                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7440                        let mut req = fidl::new_empty!(
7441                            NodeDeprecatedSetAttrRequest,
7442                            fdomain_client::fidl::FDomainResourceDialect
7443                        );
7444                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
7445                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7446                        Ok(FileRequest::DeprecatedSetAttr {
7447                            flags: req.flags,
7448                            attributes: req.attributes,
7449
7450                            responder: FileDeprecatedSetAttrResponder {
7451                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7452                                tx_id: header.tx_id,
7453                            },
7454                        })
7455                    }
7456                    0x5b88fffb8eda3aa1 => {
7457                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7458                        let mut req = fidl::new_empty!(
7459                            fidl::encoding::EmptyPayload,
7460                            fdomain_client::fidl::FDomainResourceDialect
7461                        );
7462                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7463                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7464                        Ok(FileRequest::DeprecatedGetFlags {
7465                            responder: FileDeprecatedGetFlagsResponder {
7466                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7467                                tx_id: header.tx_id,
7468                            },
7469                        })
7470                    }
7471                    0x5295b76c71fde733 => {
7472                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7473                        let mut req = fidl::new_empty!(
7474                            NodeDeprecatedSetFlagsRequest,
7475                            fdomain_client::fidl::FDomainResourceDialect
7476                        );
7477                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7478                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7479                        Ok(FileRequest::DeprecatedSetFlags {
7480                            flags: req.flags,
7481
7482                            responder: FileDeprecatedSetFlagsResponder {
7483                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7484                                tx_id: header.tx_id,
7485                            },
7486                        })
7487                    }
7488                    0x176eb318f64ec23 => {
7489                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7490                        let mut req = fidl::new_empty!(
7491                            fidl::encoding::EmptyPayload,
7492                            fdomain_client::fidl::FDomainResourceDialect
7493                        );
7494                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7495                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7496                        Ok(FileRequest::GetFlags {
7497                            responder: FileGetFlagsResponder {
7498                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7499                                tx_id: header.tx_id,
7500                            },
7501                        })
7502                    }
7503                    0x55a8028685791ea8 => {
7504                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7505                        let mut req = fidl::new_empty!(
7506                            NodeSetFlagsRequest,
7507                            fdomain_client::fidl::FDomainResourceDialect
7508                        );
7509                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
7510                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7511                        Ok(FileRequest::SetFlags {
7512                            flags: req.flags,
7513
7514                            responder: FileSetFlagsResponder {
7515                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7516                                tx_id: header.tx_id,
7517                            },
7518                        })
7519                    }
7520                    0x6f344a1c6b0a0610 => {
7521                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7522                        let mut req = fidl::new_empty!(
7523                            fidl::encoding::EmptyPayload,
7524                            fdomain_client::fidl::FDomainResourceDialect
7525                        );
7526                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7527                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7528                        Ok(FileRequest::QueryFilesystem {
7529                            responder: FileQueryFilesystemResponder {
7530                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7531                                tx_id: header.tx_id,
7532                            },
7533                        })
7534                    }
7535                    0x3d4396a638ea053b => {
7536                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7537                        let mut req = fidl::new_empty!(
7538                            NodeGetAttributesRequest,
7539                            fdomain_client::fidl::FDomainResourceDialect
7540                        );
7541                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7542                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7543                        Ok(FileRequest::GetAttributes {
7544                            query: req.query,
7545
7546                            responder: FileGetAttributesResponder {
7547                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7548                                tx_id: header.tx_id,
7549                            },
7550                        })
7551                    }
7552                    0x3308c1da5a89bf08 => {
7553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7554                        let mut req = fidl::new_empty!(
7555                            MutableNodeAttributes,
7556                            fdomain_client::fidl::FDomainResourceDialect
7557                        );
7558                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
7559                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7560                        Ok(FileRequest::UpdateAttributes {
7561                            payload: req,
7562                            responder: FileUpdateAttributesResponder {
7563                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7564                                tx_id: header.tx_id,
7565                            },
7566                        })
7567                    }
7568                    0x2c5c27ca0ab5dc49 => {
7569                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7570                        let mut req = fidl::new_empty!(
7571                            fidl::encoding::EmptyPayload,
7572                            fdomain_client::fidl::FDomainResourceDialect
7573                        );
7574                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7575                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7576                        Ok(FileRequest::Sync {
7577                            responder: FileSyncResponder {
7578                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7579                                tx_id: header.tx_id,
7580                            },
7581                        })
7582                    }
7583                    0x4b61033de007fcd0 => {
7584                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7585                        let mut req = fidl::new_empty!(
7586                            NodeListExtendedAttributesRequest,
7587                            fdomain_client::fidl::FDomainResourceDialect
7588                        );
7589                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
7590                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7591                        Ok(FileRequest::ListExtendedAttributes {
7592                            iterator: req.iterator,
7593
7594                            control_handle,
7595                        })
7596                    }
7597                    0x45ffa3ccfdeb76db => {
7598                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7599                        let mut req = fidl::new_empty!(
7600                            NodeGetExtendedAttributeRequest,
7601                            fdomain_client::fidl::FDomainResourceDialect
7602                        );
7603                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7604                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7605                        Ok(FileRequest::GetExtendedAttribute {
7606                            name: req.name,
7607
7608                            responder: FileGetExtendedAttributeResponder {
7609                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7610                                tx_id: header.tx_id,
7611                            },
7612                        })
7613                    }
7614                    0x4a951362f681f23c => {
7615                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7616                        let mut req = fidl::new_empty!(
7617                            NodeSetExtendedAttributeRequest,
7618                            fdomain_client::fidl::FDomainResourceDialect
7619                        );
7620                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7621                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7622                        Ok(FileRequest::SetExtendedAttribute {
7623                            name: req.name,
7624                            value: req.value,
7625                            mode: req.mode,
7626
7627                            responder: FileSetExtendedAttributeResponder {
7628                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7629                                tx_id: header.tx_id,
7630                            },
7631                        })
7632                    }
7633                    0x7a0b9f3a9bf9032d => {
7634                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7635                        let mut req = fidl::new_empty!(
7636                            NodeRemoveExtendedAttributeRequest,
7637                            fdomain_client::fidl::FDomainResourceDialect
7638                        );
7639                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
7640                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7641                        Ok(FileRequest::RemoveExtendedAttribute {
7642                            name: req.name,
7643
7644                            responder: FileRemoveExtendedAttributeResponder {
7645                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7646                                tx_id: header.tx_id,
7647                            },
7648                        })
7649                    }
7650                    0x57e419a298c8ede => {
7651                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7652                        let mut req = fidl::new_empty!(
7653                            ReadableReadRequest,
7654                            fdomain_client::fidl::FDomainResourceDialect
7655                        );
7656                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
7657                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7658                        Ok(FileRequest::Read {
7659                            count: req.count,
7660
7661                            responder: FileReadResponder {
7662                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7663                                tx_id: header.tx_id,
7664                            },
7665                        })
7666                    }
7667                    0x6a31437832469f82 => {
7668                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7669                        let mut req = fidl::new_empty!(
7670                            WritableWriteRequest,
7671                            fdomain_client::fidl::FDomainResourceDialect
7672                        );
7673                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
7674                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7675                        Ok(FileRequest::Write {
7676                            data: req.data,
7677
7678                            responder: FileWriteResponder {
7679                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7680                                tx_id: header.tx_id,
7681                            },
7682                        })
7683                    }
7684                    0x68b5ac00c62906bc => {
7685                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7686                        let mut req = fidl::new_empty!(
7687                            fidl::encoding::EmptyPayload,
7688                            fdomain_client::fidl::FDomainResourceDialect
7689                        );
7690                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7691                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7692                        Ok(FileRequest::Describe {
7693                            responder: FileDescribeResponder {
7694                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7695                                tx_id: header.tx_id,
7696                            },
7697                        })
7698                    }
7699                    0x78079168162c5207 => {
7700                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7701                        let mut req = fidl::new_empty!(
7702                            FileSeekRequest,
7703                            fdomain_client::fidl::FDomainResourceDialect
7704                        );
7705                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
7706                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7707                        Ok(FileRequest::Seek {
7708                            origin: req.origin,
7709                            offset: req.offset,
7710
7711                            responder: FileSeekResponder {
7712                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7713                                tx_id: header.tx_id,
7714                            },
7715                        })
7716                    }
7717                    0x1607a293a60d723e => {
7718                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7719                        let mut req = fidl::new_empty!(
7720                            FileReadAtRequest,
7721                            fdomain_client::fidl::FDomainResourceDialect
7722                        );
7723                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
7724                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7725                        Ok(FileRequest::ReadAt {
7726                            count: req.count,
7727                            offset: req.offset,
7728
7729                            responder: FileReadAtResponder {
7730                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7731                                tx_id: header.tx_id,
7732                            },
7733                        })
7734                    }
7735                    0x793eefc0045e792b => {
7736                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7737                        let mut req = fidl::new_empty!(
7738                            FileWriteAtRequest,
7739                            fdomain_client::fidl::FDomainResourceDialect
7740                        );
7741                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
7742                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7743                        Ok(FileRequest::WriteAt {
7744                            data: req.data,
7745                            offset: req.offset,
7746
7747                            responder: FileWriteAtResponder {
7748                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7749                                tx_id: header.tx_id,
7750                            },
7751                        })
7752                    }
7753                    0x2b80825f0535743a => {
7754                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7755                        let mut req = fidl::new_empty!(
7756                            FileResizeRequest,
7757                            fdomain_client::fidl::FDomainResourceDialect
7758                        );
7759                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
7760                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7761                        Ok(FileRequest::Resize {
7762                            length: req.length,
7763
7764                            responder: FileResizeResponder {
7765                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7766                                tx_id: header.tx_id,
7767                            },
7768                        })
7769                    }
7770                    0xa6a9e654cbf62b => {
7771                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7772                        let mut req = fidl::new_empty!(
7773                            FileGetBackingMemoryRequest,
7774                            fdomain_client::fidl::FDomainResourceDialect
7775                        );
7776                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
7777                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7778                        Ok(FileRequest::GetBackingMemory {
7779                            flags: req.flags,
7780
7781                            responder: FileGetBackingMemoryResponder {
7782                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7783                                tx_id: header.tx_id,
7784                            },
7785                        })
7786                    }
7787                    0x77fa0c330b57fd2e => {
7788                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7789                        let mut req = fidl::new_empty!(
7790                            FileAllocateRequest,
7791                            fdomain_client::fidl::FDomainResourceDialect
7792                        );
7793                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
7794                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7795                        Ok(FileRequest::Allocate {
7796                            offset: req.offset,
7797                            length: req.length,
7798                            mode: req.mode,
7799
7800                            responder: FileAllocateResponder {
7801                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7802                                tx_id: header.tx_id,
7803                            },
7804                        })
7805                    }
7806                    0x2c421ec3faaeb8bb => {
7807                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7808                        let mut req = fidl::new_empty!(
7809                            FileEnableVerityRequest,
7810                            fdomain_client::fidl::FDomainResourceDialect
7811                        );
7812                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
7813                        let control_handle = FileControlHandle { inner: this.inner.clone() };
7814                        Ok(FileRequest::EnableVerity {
7815                            options: req.options,
7816
7817                            responder: FileEnableVerityResponder {
7818                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7819                                tx_id: header.tx_id,
7820                            },
7821                        })
7822                    }
7823                    _ if header.tx_id == 0
7824                        && header
7825                            .dynamic_flags()
7826                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7827                    {
7828                        Ok(FileRequest::_UnknownMethod {
7829                            ordinal: header.ordinal,
7830                            control_handle: FileControlHandle { inner: this.inner.clone() },
7831                            method_type: fidl::MethodType::OneWay,
7832                        })
7833                    }
7834                    _ if header
7835                        .dynamic_flags()
7836                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7837                    {
7838                        this.inner.send_framework_err(
7839                            fidl::encoding::FrameworkErr::UnknownMethod,
7840                            header.tx_id,
7841                            header.ordinal,
7842                            header.dynamic_flags(),
7843                            (bytes, handles),
7844                        )?;
7845                        Ok(FileRequest::_UnknownMethod {
7846                            ordinal: header.ordinal,
7847                            control_handle: FileControlHandle { inner: this.inner.clone() },
7848                            method_type: fidl::MethodType::TwoWay,
7849                        })
7850                    }
7851                    _ => Err(fidl::Error::UnknownOrdinal {
7852                        ordinal: header.ordinal,
7853                        protocol_name:
7854                            <FileMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7855                    }),
7856                }))
7857            },
7858        )
7859    }
7860}
7861
7862/// A [`Node`] which contains a sequence of bytes of definite length.
7863///
7864/// NOTE: cloned connections do not share their seek offset with their source
7865/// connection.
7866#[derive(Debug)]
7867pub enum FileRequest {
7868    /// Acquires an advisory lock on the underlying file.
7869    ///
7870    /// The lock lasts until either this connection is closed or
7871    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7872    /// explicitly.
7873    ///
7874    /// Advisory locks are purely advisory. They do not prevent actual read or
7875    /// write operations from occurring on the file, either through this
7876    /// connection or through other connections.
7877    ///
7878    /// This method requires the following rights:
7879    ///
7880    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7881    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7882    ///   [`AdvisoryLockType.WRITE`].
7883    ///
7884    /// # Errors
7885    ///
7886    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7887    ///   example, another connection might hold a conflicting lock type.
7888    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7889    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7890    ///   to acquire the given type of lock.
7891    AdvisoryLock {
7892        request: AdvisoryLockRequest,
7893        responder: FileAdvisoryLockResponder,
7894    },
7895    /// Creates a link to this this object with name `dst` in the directory represented by
7896    /// `dst_parent_token`.
7897    ///
7898    /// `dst` must be a resolved object name. Including "/" in the string will return
7899    /// `ZX_ERR_INVALID_ARGS`.
7900    ///
7901    /// This method requires the maximal set of rights supported by the filesystem for this object.
7902    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7903    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7904    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7905    /// `ZX_ERR_ACCESS_DENIED`.
7906    ///
7907    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7908    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7909    ///
7910    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7911    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7912    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7913    ///
7914    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7915    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7916    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7917    LinkInto {
7918        dst_parent_token: fdomain_client::Event,
7919        dst: String,
7920        responder: FileLinkIntoResponder,
7921    },
7922    Clone {
7923        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
7924        control_handle: FileControlHandle,
7925    },
7926    /// Terminates the connection.
7927    ///
7928    /// After calling `Close`, the client must not send any other requests.
7929    ///
7930    /// Servers, after sending the status response, should close the connection
7931    /// regardless of status and without sending an epitaph.
7932    ///
7933    /// Closing the client end of the channel should be semantically equivalent
7934    /// to calling `Close` without knowing when the close has completed or its
7935    /// status.
7936    Close {
7937        responder: FileCloseResponder,
7938    },
7939    Query {
7940        responder: FileQueryResponder,
7941    },
7942    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7943    DeprecatedClone {
7944        flags: OpenFlags,
7945        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
7946        control_handle: FileControlHandle,
7947    },
7948    /// DEPRECATED - Use `Node.GetAttributes` instead.
7949    DeprecatedGetAttr {
7950        responder: FileDeprecatedGetAttrResponder,
7951    },
7952    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7953    DeprecatedSetAttr {
7954        flags: NodeAttributeFlags,
7955        attributes: NodeAttributes,
7956        responder: FileDeprecatedSetAttrResponder,
7957    },
7958    /// [DEPRECATED - Use new GetFlags method instead.]
7959    DeprecatedGetFlags {
7960        responder: FileDeprecatedGetFlagsResponder,
7961    },
7962    /// [DEPRECATED - Use new SetFlags method instead.]
7963    DeprecatedSetFlags {
7964        flags: OpenFlags,
7965        responder: FileDeprecatedSetFlagsResponder,
7966    },
7967    /// Queries the flags that apply to this node after it has been opened/created. This method does
7968    /// not require any rights.
7969    ///
7970    /// Note that the final set of flags that apply to the connection may differ from those
7971    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7972    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7973    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7974    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7975    GetFlags {
7976        responder: FileGetFlagsResponder,
7977    },
7978    /// Sets the flags that apply to this node after it has been opened. This method does not
7979    /// require any rights.
7980    ///
7981    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7982    /// clear append mode.
7983    ///
7984    /// Errors:
7985    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7986    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7987    SetFlags {
7988        flags: Flags,
7989        responder: FileSetFlagsResponder,
7990    },
7991    /// Query the filesystem for filesystem-specific information.
7992    QueryFilesystem {
7993        responder: FileQueryFilesystemResponder,
7994    },
7995    /// Acquires information about the node.
7996    ///
7997    /// The attributes of a node should be stable, independent of the
7998    /// specific protocol used to access it.
7999    ///
8000    /// If a particular attribute is not applicable or not supported,
8001    /// filesystems should leave the corresponding field absent.
8002    ///
8003    /// + `query` a bit-mask specifying which attributes to fetch. The server
8004    ///   should not return more than necessary.
8005    /// - `attributes` the returned attributes.
8006    ///
8007    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8008    GetAttributes {
8009        query: NodeAttributesQuery,
8010        responder: FileGetAttributesResponder,
8011    },
8012    /// Updates information about the node.
8013    ///
8014    /// + `attributes` the presence of a table field in `attributes` indicates
8015    /// the intent to update the corresponding attribute.
8016    ///
8017    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8018    ///
8019    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8020    UpdateAttributes {
8021        payload: MutableNodeAttributes,
8022        responder: FileUpdateAttributesResponder,
8023    },
8024    /// Synchronizes updates to the node to the underlying media, if it exists.
8025    ///
8026    /// This method will return when the filesystem server has flushed the
8027    /// relevant updates to the underlying media, but does not guarantee the
8028    /// underlying media has persisted the information, nor that any information
8029    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8030    /// between operations.
8031    ///
8032    /// This method does not require any rights.
8033    Sync {
8034        responder: FileSyncResponder,
8035    },
8036    /// Creates an iterator over all the extended attribute names associated
8037    /// with this node. If an error occurs it is returned as an epitaph on the
8038    /// iterator request channel, and then the channel is closed.
8039    ///
8040    /// GetExtendedAttributes can be used with any of these names to retrieve
8041    /// the associated value.
8042    ///
8043    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8044    ListExtendedAttributes {
8045        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
8046        control_handle: FileControlHandle,
8047    },
8048    /// Get the value associated with the given attribute `name` for this node.
8049    ///
8050    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8051    /// particular structure is imposed on them.
8052    ///
8053    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8054    GetExtendedAttribute {
8055        name: Vec<u8>,
8056        responder: FileGetExtendedAttributeResponder,
8057    },
8058    /// Set the value for the given attribute `name` to `value` for this node.
8059    ///
8060    /// The attribute name may exist, in which case the attribute is updated.
8061    /// If the attribute doesn't exist, it is created. The name should have no
8062    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8063    ///
8064    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8065    SetExtendedAttribute {
8066        name: Vec<u8>,
8067        value: ExtendedAttributeValue,
8068        mode: SetExtendedAttributeMode,
8069        responder: FileSetExtendedAttributeResponder,
8070    },
8071    /// Remove the specified extended attribute.
8072    ///
8073    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8074    ///
8075    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8076    RemoveExtendedAttribute {
8077        name: Vec<u8>,
8078        responder: FileRemoveExtendedAttributeResponder,
8079    },
8080    /// Reads up to 'count' bytes at the seek offset.
8081    /// The seek offset is moved forward by the number of bytes read.
8082    ///
8083    /// ## Invariants
8084    ///
8085    /// * The returned `data.length` will never be greater than `count`.
8086    /// * If `data.length` is less than `count`, it means that the seek offset
8087    ///   has reached the end of file as part of this operation.
8088    /// * If `data.length` is zero while `count` is not, it means that the
8089    ///   seek offset is already at or beyond the end of file, and no data could
8090    ///   be read.
8091    /// * If `count` is zero, the server should perform all the checks ensuring
8092    ///   read access without actually read anything, and return an empty
8093    ///   `data` vector.
8094    ///
8095    /// This method requires the [`Rights.READ_BYTES`] right.
8096    ///
8097    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8098    Read {
8099        count: u64,
8100        responder: FileReadResponder,
8101    },
8102    /// Writes data at the seek offset.
8103    /// The seek offset is moved forward by the number of bytes written.
8104    /// If the file is in append mode, the seek offset is first set to the end
8105    /// of the file, followed by the write, in one atomic step.
8106    ///
8107    /// The file size may grow if the seek offset plus `data.length` is beyond
8108    /// the current end of file.
8109    ///
8110    /// + request `data` the byte buffer to write to the file.
8111    /// - response `actual_count` the number of bytes written.
8112    ///
8113    /// ## Invariants
8114    ///
8115    /// * The returned `actual_count` will never be greater than `data.length`.
8116    /// * If the server is unable to write all the data due to e.g. not enough
8117    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8118    ///   could be written, an error is returned.
8119    /// * If `data.length` is zero, the server should perform all the checks
8120    ///   ensuring write access without mutating the file and return a
8121    ///   successful write of zero bytes.  The seek offset is still updated if
8122    ///   in append mode.
8123    ///
8124    /// This method requires the [`Rights.WRITE_BYTES`] right.
8125    Write {
8126        data: Vec<u8>,
8127        responder: FileWriteResponder,
8128    },
8129    Describe {
8130        responder: FileDescribeResponder,
8131    },
8132    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8133    /// will occur. The seek offset is specific to each file connection.
8134    ///
8135    /// + request `origin` the reference point where `offset` will be based on.
8136    /// + request `offset` the number of bytes to seek.
8137    /// - response `offset_from_start` the adjusted seek offset, from the start
8138    ///   of the file.
8139    ///
8140    /// This method does not require any rights.
8141    Seek {
8142        origin: SeekOrigin,
8143        offset: i64,
8144        responder: FileSeekResponder,
8145    },
8146    /// Reads up to 'count' bytes at the provided offset.
8147    /// Does not affect the seek offset.
8148    ///
8149    /// ## Invariants
8150    ///
8151    /// * The returned `data.length` will never be greater than `count`.
8152    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8153    ///   the end of file as part of this operation.
8154    /// * If `data.length` is zero while `count` is not, it means that `offset`
8155    ///   is at or past the end of file, and no data can be read.
8156    /// * If `count` is zero, the server should perform all the checks ensuring
8157    ///   read access without actually reading anything, and return an empty
8158    ///   `data` vector.
8159    ///
8160    /// This method requires the [`Rights.READ_BYTES`] right.
8161    ///
8162    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8163    ReadAt {
8164        count: u64,
8165        offset: u64,
8166        responder: FileReadAtResponder,
8167    },
8168    /// Writes data at the provided offset.
8169    /// Does not affect the seek offset.
8170    ///
8171    /// The file size may grow if `offset` plus `data.length` is past the
8172    /// current end of file.
8173    ///
8174    /// + request `data` the byte buffer to write to the file.
8175    /// + request `offset` the offset from start of the file to begin writing.
8176    /// - response `actual_count` the number of bytes written.
8177    ///
8178    /// ## Invariants
8179    ///
8180    /// * The returned `actual_count` will never be greater than `data.length`.
8181    /// * If the server is unable to write all the data due to e.g. not enough
8182    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8183    ///   could be written, an error is returned.
8184    /// * If `data.length` is zero, the server should perform all the checks
8185    ///   ensuring write access without mutating the file, and will return a
8186    ///   successful write of zero bytes.
8187    ///
8188    /// This method requires the [`Rights.WRITE_BYTES`] right.
8189    WriteAt {
8190        data: Vec<u8>,
8191        offset: u64,
8192        responder: FileWriteAtResponder,
8193    },
8194    /// Shrinks or grows the file size to 'length' bytes.
8195    ///
8196    /// If file size is reduced by this operation, the extra trailing data'
8197    /// is discarded.
8198    /// If file size is increased by this operation, the extended area appears
8199    /// as if it was zeroed.
8200    ///
8201    /// This method requires the [`Rights.WRITE_BYTES`] right.
8202    Resize {
8203        length: u64,
8204        responder: FileResizeResponder,
8205    },
8206    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8207    /// with the requested access rights.
8208    ///
8209    /// Implementations are not required to implement files backed by VMOs so
8210    /// this request may fail. Additionally, implementations may only support
8211    /// a certain subset of the flags. Clients should be prepared with fallback
8212    /// behavior if this request fails.
8213    ///
8214    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8215    /// implementation is free to choose the semantics of the returned VMO.
8216    ///
8217    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8218    /// - response `vmo` the requested [`zx.Handle:VMO`].
8219    /// * error a [`zx.Status`] value indicating the failure.
8220    ///
8221    /// This method requires the following rights:
8222    ///
8223    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8224    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8225    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8226    GetBackingMemory {
8227        flags: VmoFlags,
8228        responder: FileGetBackingMemoryResponder,
8229    },
8230    /// Pre-allocate on-disk space for this file.
8231    Allocate {
8232        offset: u64,
8233        length: u64,
8234        mode: AllocateMode,
8235        responder: FileAllocateResponder,
8236    },
8237    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8238    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8239    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8240    /// rejected. This method can take some time to complete as it depends on the size of the file.
8241    /// This method can be aborted by closing the connection that this method was issued on.
8242    ///
8243    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8244    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8245    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8246    /// Also returns any error that might arise from reading the file, or from flushing the file,
8247    /// such as `ZX_ERR_IO`.
8248    EnableVerity {
8249        options: VerificationOptions,
8250        responder: FileEnableVerityResponder,
8251    },
8252    /// An interaction was received which does not match any known method.
8253    #[non_exhaustive]
8254    _UnknownMethod {
8255        /// Ordinal of the method that was called.
8256        ordinal: u64,
8257        control_handle: FileControlHandle,
8258        method_type: fidl::MethodType,
8259    },
8260}
8261
8262impl FileRequest {
8263    #[allow(irrefutable_let_patterns)]
8264    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
8265        if let FileRequest::AdvisoryLock { request, responder } = self {
8266            Some((request, responder))
8267        } else {
8268            None
8269        }
8270    }
8271
8272    #[allow(irrefutable_let_patterns)]
8273    pub fn into_link_into(self) -> Option<(fdomain_client::Event, String, FileLinkIntoResponder)> {
8274        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
8275            Some((dst_parent_token, dst, responder))
8276        } else {
8277            None
8278        }
8279    }
8280
8281    #[allow(irrefutable_let_patterns)]
8282    pub fn into_clone(
8283        self,
8284    ) -> Option<(
8285        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
8286        FileControlHandle,
8287    )> {
8288        if let FileRequest::Clone { request, control_handle } = self {
8289            Some((request, control_handle))
8290        } else {
8291            None
8292        }
8293    }
8294
8295    #[allow(irrefutable_let_patterns)]
8296    pub fn into_close(self) -> Option<(FileCloseResponder)> {
8297        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
8298    }
8299
8300    #[allow(irrefutable_let_patterns)]
8301    pub fn into_query(self) -> Option<(FileQueryResponder)> {
8302        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
8303    }
8304
8305    #[allow(irrefutable_let_patterns)]
8306    pub fn into_deprecated_clone(
8307        self,
8308    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, FileControlHandle)> {
8309        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
8310            Some((flags, object, control_handle))
8311        } else {
8312            None
8313        }
8314    }
8315
8316    #[allow(irrefutable_let_patterns)]
8317    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
8318        if let FileRequest::DeprecatedGetAttr { responder } = self {
8319            Some((responder))
8320        } else {
8321            None
8322        }
8323    }
8324
8325    #[allow(irrefutable_let_patterns)]
8326    pub fn into_deprecated_set_attr(
8327        self,
8328    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
8329        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
8330            Some((flags, attributes, responder))
8331        } else {
8332            None
8333        }
8334    }
8335
8336    #[allow(irrefutable_let_patterns)]
8337    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
8338        if let FileRequest::DeprecatedGetFlags { responder } = self {
8339            Some((responder))
8340        } else {
8341            None
8342        }
8343    }
8344
8345    #[allow(irrefutable_let_patterns)]
8346    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
8347        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
8348            Some((flags, responder))
8349        } else {
8350            None
8351        }
8352    }
8353
8354    #[allow(irrefutable_let_patterns)]
8355    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
8356        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
8357    }
8358
8359    #[allow(irrefutable_let_patterns)]
8360    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
8361        if let FileRequest::SetFlags { flags, responder } = self {
8362            Some((flags, responder))
8363        } else {
8364            None
8365        }
8366    }
8367
8368    #[allow(irrefutable_let_patterns)]
8369    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
8370        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
8371    }
8372
8373    #[allow(irrefutable_let_patterns)]
8374    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
8375        if let FileRequest::GetAttributes { query, responder } = self {
8376            Some((query, responder))
8377        } else {
8378            None
8379        }
8380    }
8381
8382    #[allow(irrefutable_let_patterns)]
8383    pub fn into_update_attributes(
8384        self,
8385    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
8386        if let FileRequest::UpdateAttributes { payload, responder } = self {
8387            Some((payload, responder))
8388        } else {
8389            None
8390        }
8391    }
8392
8393    #[allow(irrefutable_let_patterns)]
8394    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
8395        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
8396    }
8397
8398    #[allow(irrefutable_let_patterns)]
8399    pub fn into_list_extended_attributes(
8400        self,
8401    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
8402    {
8403        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
8404            Some((iterator, control_handle))
8405        } else {
8406            None
8407        }
8408    }
8409
8410    #[allow(irrefutable_let_patterns)]
8411    pub fn into_get_extended_attribute(
8412        self,
8413    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
8414        if let FileRequest::GetExtendedAttribute { name, responder } = self {
8415            Some((name, responder))
8416        } else {
8417            None
8418        }
8419    }
8420
8421    #[allow(irrefutable_let_patterns)]
8422    pub fn into_set_extended_attribute(
8423        self,
8424    ) -> Option<(
8425        Vec<u8>,
8426        ExtendedAttributeValue,
8427        SetExtendedAttributeMode,
8428        FileSetExtendedAttributeResponder,
8429    )> {
8430        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
8431            Some((name, value, mode, responder))
8432        } else {
8433            None
8434        }
8435    }
8436
8437    #[allow(irrefutable_let_patterns)]
8438    pub fn into_remove_extended_attribute(
8439        self,
8440    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
8441        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
8442            Some((name, responder))
8443        } else {
8444            None
8445        }
8446    }
8447
8448    #[allow(irrefutable_let_patterns)]
8449    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
8450        if let FileRequest::Read { count, responder } = self {
8451            Some((count, responder))
8452        } else {
8453            None
8454        }
8455    }
8456
8457    #[allow(irrefutable_let_patterns)]
8458    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
8459        if let FileRequest::Write { data, responder } = self {
8460            Some((data, responder))
8461        } else {
8462            None
8463        }
8464    }
8465
8466    #[allow(irrefutable_let_patterns)]
8467    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
8468        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
8469    }
8470
8471    #[allow(irrefutable_let_patterns)]
8472    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
8473        if let FileRequest::Seek { origin, offset, responder } = self {
8474            Some((origin, offset, responder))
8475        } else {
8476            None
8477        }
8478    }
8479
8480    #[allow(irrefutable_let_patterns)]
8481    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
8482        if let FileRequest::ReadAt { count, offset, responder } = self {
8483            Some((count, offset, responder))
8484        } else {
8485            None
8486        }
8487    }
8488
8489    #[allow(irrefutable_let_patterns)]
8490    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
8491        if let FileRequest::WriteAt { data, offset, responder } = self {
8492            Some((data, offset, responder))
8493        } else {
8494            None
8495        }
8496    }
8497
8498    #[allow(irrefutable_let_patterns)]
8499    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
8500        if let FileRequest::Resize { length, responder } = self {
8501            Some((length, responder))
8502        } else {
8503            None
8504        }
8505    }
8506
8507    #[allow(irrefutable_let_patterns)]
8508    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
8509        if let FileRequest::GetBackingMemory { flags, responder } = self {
8510            Some((flags, responder))
8511        } else {
8512            None
8513        }
8514    }
8515
8516    #[allow(irrefutable_let_patterns)]
8517    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
8518        if let FileRequest::Allocate { offset, length, mode, responder } = self {
8519            Some((offset, length, mode, responder))
8520        } else {
8521            None
8522        }
8523    }
8524
8525    #[allow(irrefutable_let_patterns)]
8526    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
8527        if let FileRequest::EnableVerity { options, responder } = self {
8528            Some((options, responder))
8529        } else {
8530            None
8531        }
8532    }
8533
8534    /// Name of the method defined in FIDL
8535    pub fn method_name(&self) -> &'static str {
8536        match *self {
8537            FileRequest::AdvisoryLock { .. } => "advisory_lock",
8538            FileRequest::LinkInto { .. } => "link_into",
8539            FileRequest::Clone { .. } => "clone",
8540            FileRequest::Close { .. } => "close",
8541            FileRequest::Query { .. } => "query",
8542            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
8543            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
8544            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
8545            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
8546            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
8547            FileRequest::GetFlags { .. } => "get_flags",
8548            FileRequest::SetFlags { .. } => "set_flags",
8549            FileRequest::QueryFilesystem { .. } => "query_filesystem",
8550            FileRequest::GetAttributes { .. } => "get_attributes",
8551            FileRequest::UpdateAttributes { .. } => "update_attributes",
8552            FileRequest::Sync { .. } => "sync",
8553            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
8554            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
8555            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
8556            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
8557            FileRequest::Read { .. } => "read",
8558            FileRequest::Write { .. } => "write",
8559            FileRequest::Describe { .. } => "describe",
8560            FileRequest::Seek { .. } => "seek",
8561            FileRequest::ReadAt { .. } => "read_at",
8562            FileRequest::WriteAt { .. } => "write_at",
8563            FileRequest::Resize { .. } => "resize",
8564            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
8565            FileRequest::Allocate { .. } => "allocate",
8566            FileRequest::EnableVerity { .. } => "enable_verity",
8567            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8568                "unknown one-way method"
8569            }
8570            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8571                "unknown two-way method"
8572            }
8573        }
8574    }
8575}
8576
8577#[derive(Debug, Clone)]
8578pub struct FileControlHandle {
8579    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8580}
8581
8582impl fdomain_client::fidl::ControlHandle for FileControlHandle {
8583    fn shutdown(&self) {
8584        self.inner.shutdown()
8585    }
8586
8587    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8588        self.inner.shutdown_with_epitaph(status)
8589    }
8590
8591    fn is_closed(&self) -> bool {
8592        self.inner.channel().is_closed()
8593    }
8594    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8595        self.inner.channel().on_closed()
8596    }
8597}
8598
8599impl FileControlHandle {
8600    pub fn send_on_open_(
8601        &self,
8602        mut s: i32,
8603        mut info: Option<NodeInfoDeprecated>,
8604    ) -> Result<(), fidl::Error> {
8605        self.inner.send::<NodeOnOpenRequest>(
8606            (s, info.as_mut()),
8607            0,
8608            0x7fc7bbb1dbfd1972,
8609            fidl::encoding::DynamicFlags::FLEXIBLE,
8610        )
8611    }
8612
8613    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
8614        self.inner.send::<Representation>(
8615            &mut payload,
8616            0,
8617            0x5cb40567d80a510c,
8618            fidl::encoding::DynamicFlags::empty(),
8619        )
8620    }
8621}
8622
8623#[must_use = "FIDL methods require a response to be sent"]
8624#[derive(Debug)]
8625pub struct FileAdvisoryLockResponder {
8626    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8627    tx_id: u32,
8628}
8629
8630/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8631/// if the responder is dropped without sending a response, so that the client
8632/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8633impl std::ops::Drop for FileAdvisoryLockResponder {
8634    fn drop(&mut self) {
8635        self.control_handle.shutdown();
8636        // Safety: drops once, never accessed again
8637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8638    }
8639}
8640
8641impl fdomain_client::fidl::Responder for FileAdvisoryLockResponder {
8642    type ControlHandle = FileControlHandle;
8643
8644    fn control_handle(&self) -> &FileControlHandle {
8645        &self.control_handle
8646    }
8647
8648    fn drop_without_shutdown(mut self) {
8649        // Safety: drops once, never accessed again due to mem::forget
8650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8651        // Prevent Drop from running (which would shut down the channel)
8652        std::mem::forget(self);
8653    }
8654}
8655
8656impl FileAdvisoryLockResponder {
8657    /// Sends a response to the FIDL transaction.
8658    ///
8659    /// Sets the channel to shutdown if an error occurs.
8660    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8661        let _result = self.send_raw(result);
8662        if _result.is_err() {
8663            self.control_handle.shutdown();
8664        }
8665        self.drop_without_shutdown();
8666        _result
8667    }
8668
8669    /// Similar to "send" but does not shutdown the channel if an error occurs.
8670    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8671        let _result = self.send_raw(result);
8672        self.drop_without_shutdown();
8673        _result
8674    }
8675
8676    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8677        self.control_handle
8678            .inner
8679            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8680                result,
8681                self.tx_id,
8682                0x6ee9c0ad53ec87aa,
8683                fidl::encoding::DynamicFlags::empty(),
8684            )
8685    }
8686}
8687
8688#[must_use = "FIDL methods require a response to be sent"]
8689#[derive(Debug)]
8690pub struct FileLinkIntoResponder {
8691    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8692    tx_id: u32,
8693}
8694
8695/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8696/// if the responder is dropped without sending a response, so that the client
8697/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8698impl std::ops::Drop for FileLinkIntoResponder {
8699    fn drop(&mut self) {
8700        self.control_handle.shutdown();
8701        // Safety: drops once, never accessed again
8702        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8703    }
8704}
8705
8706impl fdomain_client::fidl::Responder for FileLinkIntoResponder {
8707    type ControlHandle = FileControlHandle;
8708
8709    fn control_handle(&self) -> &FileControlHandle {
8710        &self.control_handle
8711    }
8712
8713    fn drop_without_shutdown(mut self) {
8714        // Safety: drops once, never accessed again due to mem::forget
8715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8716        // Prevent Drop from running (which would shut down the channel)
8717        std::mem::forget(self);
8718    }
8719}
8720
8721impl FileLinkIntoResponder {
8722    /// Sends a response to the FIDL transaction.
8723    ///
8724    /// Sets the channel to shutdown if an error occurs.
8725    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8726        let _result = self.send_raw(result);
8727        if _result.is_err() {
8728            self.control_handle.shutdown();
8729        }
8730        self.drop_without_shutdown();
8731        _result
8732    }
8733
8734    /// Similar to "send" but does not shutdown the channel if an error occurs.
8735    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8736        let _result = self.send_raw(result);
8737        self.drop_without_shutdown();
8738        _result
8739    }
8740
8741    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8742        self.control_handle
8743            .inner
8744            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8745                result,
8746                self.tx_id,
8747                0x54f3949246a03e74,
8748                fidl::encoding::DynamicFlags::empty(),
8749            )
8750    }
8751}
8752
8753#[must_use = "FIDL methods require a response to be sent"]
8754#[derive(Debug)]
8755pub struct FileCloseResponder {
8756    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8757    tx_id: u32,
8758}
8759
8760/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8761/// if the responder is dropped without sending a response, so that the client
8762/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8763impl std::ops::Drop for FileCloseResponder {
8764    fn drop(&mut self) {
8765        self.control_handle.shutdown();
8766        // Safety: drops once, never accessed again
8767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8768    }
8769}
8770
8771impl fdomain_client::fidl::Responder for FileCloseResponder {
8772    type ControlHandle = FileControlHandle;
8773
8774    fn control_handle(&self) -> &FileControlHandle {
8775        &self.control_handle
8776    }
8777
8778    fn drop_without_shutdown(mut self) {
8779        // Safety: drops once, never accessed again due to mem::forget
8780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8781        // Prevent Drop from running (which would shut down the channel)
8782        std::mem::forget(self);
8783    }
8784}
8785
8786impl FileCloseResponder {
8787    /// Sends a response to the FIDL transaction.
8788    ///
8789    /// Sets the channel to shutdown if an error occurs.
8790    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8791        let _result = self.send_raw(result);
8792        if _result.is_err() {
8793            self.control_handle.shutdown();
8794        }
8795        self.drop_without_shutdown();
8796        _result
8797    }
8798
8799    /// Similar to "send" but does not shutdown the channel if an error occurs.
8800    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8801        let _result = self.send_raw(result);
8802        self.drop_without_shutdown();
8803        _result
8804    }
8805
8806    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8807        self.control_handle
8808            .inner
8809            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8810                result,
8811                self.tx_id,
8812                0x5ac5d459ad7f657e,
8813                fidl::encoding::DynamicFlags::empty(),
8814            )
8815    }
8816}
8817
8818#[must_use = "FIDL methods require a response to be sent"]
8819#[derive(Debug)]
8820pub struct FileQueryResponder {
8821    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8822    tx_id: u32,
8823}
8824
8825/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8826/// if the responder is dropped without sending a response, so that the client
8827/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8828impl std::ops::Drop for FileQueryResponder {
8829    fn drop(&mut self) {
8830        self.control_handle.shutdown();
8831        // Safety: drops once, never accessed again
8832        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8833    }
8834}
8835
8836impl fdomain_client::fidl::Responder for FileQueryResponder {
8837    type ControlHandle = FileControlHandle;
8838
8839    fn control_handle(&self) -> &FileControlHandle {
8840        &self.control_handle
8841    }
8842
8843    fn drop_without_shutdown(mut self) {
8844        // Safety: drops once, never accessed again due to mem::forget
8845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8846        // Prevent Drop from running (which would shut down the channel)
8847        std::mem::forget(self);
8848    }
8849}
8850
8851impl FileQueryResponder {
8852    /// Sends a response to the FIDL transaction.
8853    ///
8854    /// Sets the channel to shutdown if an error occurs.
8855    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8856        let _result = self.send_raw(protocol);
8857        if _result.is_err() {
8858            self.control_handle.shutdown();
8859        }
8860        self.drop_without_shutdown();
8861        _result
8862    }
8863
8864    /// Similar to "send" but does not shutdown the channel if an error occurs.
8865    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8866        let _result = self.send_raw(protocol);
8867        self.drop_without_shutdown();
8868        _result
8869    }
8870
8871    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
8872        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
8873            (protocol,),
8874            self.tx_id,
8875            0x2658edee9decfc06,
8876            fidl::encoding::DynamicFlags::empty(),
8877        )
8878    }
8879}
8880
8881#[must_use = "FIDL methods require a response to be sent"]
8882#[derive(Debug)]
8883pub struct FileDeprecatedGetAttrResponder {
8884    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8885    tx_id: u32,
8886}
8887
8888/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8889/// if the responder is dropped without sending a response, so that the client
8890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8891impl std::ops::Drop for FileDeprecatedGetAttrResponder {
8892    fn drop(&mut self) {
8893        self.control_handle.shutdown();
8894        // Safety: drops once, never accessed again
8895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8896    }
8897}
8898
8899impl fdomain_client::fidl::Responder for FileDeprecatedGetAttrResponder {
8900    type ControlHandle = FileControlHandle;
8901
8902    fn control_handle(&self) -> &FileControlHandle {
8903        &self.control_handle
8904    }
8905
8906    fn drop_without_shutdown(mut self) {
8907        // Safety: drops once, never accessed again due to mem::forget
8908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8909        // Prevent Drop from running (which would shut down the channel)
8910        std::mem::forget(self);
8911    }
8912}
8913
8914impl FileDeprecatedGetAttrResponder {
8915    /// Sends a response to the FIDL transaction.
8916    ///
8917    /// Sets the channel to shutdown if an error occurs.
8918    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8919        let _result = self.send_raw(s, attributes);
8920        if _result.is_err() {
8921            self.control_handle.shutdown();
8922        }
8923        self.drop_without_shutdown();
8924        _result
8925    }
8926
8927    /// Similar to "send" but does not shutdown the channel if an error occurs.
8928    pub fn send_no_shutdown_on_err(
8929        self,
8930        mut s: i32,
8931        mut attributes: &NodeAttributes,
8932    ) -> Result<(), fidl::Error> {
8933        let _result = self.send_raw(s, attributes);
8934        self.drop_without_shutdown();
8935        _result
8936    }
8937
8938    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
8939        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
8940            (s, attributes),
8941            self.tx_id,
8942            0x78985e216314dafd,
8943            fidl::encoding::DynamicFlags::empty(),
8944        )
8945    }
8946}
8947
8948#[must_use = "FIDL methods require a response to be sent"]
8949#[derive(Debug)]
8950pub struct FileDeprecatedSetAttrResponder {
8951    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
8952    tx_id: u32,
8953}
8954
8955/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
8956/// if the responder is dropped without sending a response, so that the client
8957/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8958impl std::ops::Drop for FileDeprecatedSetAttrResponder {
8959    fn drop(&mut self) {
8960        self.control_handle.shutdown();
8961        // Safety: drops once, never accessed again
8962        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8963    }
8964}
8965
8966impl fdomain_client::fidl::Responder for FileDeprecatedSetAttrResponder {
8967    type ControlHandle = FileControlHandle;
8968
8969    fn control_handle(&self) -> &FileControlHandle {
8970        &self.control_handle
8971    }
8972
8973    fn drop_without_shutdown(mut self) {
8974        // Safety: drops once, never accessed again due to mem::forget
8975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8976        // Prevent Drop from running (which would shut down the channel)
8977        std::mem::forget(self);
8978    }
8979}
8980
8981impl FileDeprecatedSetAttrResponder {
8982    /// Sends a response to the FIDL transaction.
8983    ///
8984    /// Sets the channel to shutdown if an error occurs.
8985    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
8986        let _result = self.send_raw(s);
8987        if _result.is_err() {
8988            self.control_handle.shutdown();
8989        }
8990        self.drop_without_shutdown();
8991        _result
8992    }
8993
8994    /// Similar to "send" but does not shutdown the channel if an error occurs.
8995    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
8996        let _result = self.send_raw(s);
8997        self.drop_without_shutdown();
8998        _result
8999    }
9000
9001    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9002        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
9003            (s,),
9004            self.tx_id,
9005            0x4186c0f40d938f46,
9006            fidl::encoding::DynamicFlags::empty(),
9007        )
9008    }
9009}
9010
9011#[must_use = "FIDL methods require a response to be sent"]
9012#[derive(Debug)]
9013pub struct FileDeprecatedGetFlagsResponder {
9014    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9015    tx_id: u32,
9016}
9017
9018/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9019/// if the responder is dropped without sending a response, so that the client
9020/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9021impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
9022    fn drop(&mut self) {
9023        self.control_handle.shutdown();
9024        // Safety: drops once, never accessed again
9025        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9026    }
9027}
9028
9029impl fdomain_client::fidl::Responder for FileDeprecatedGetFlagsResponder {
9030    type ControlHandle = FileControlHandle;
9031
9032    fn control_handle(&self) -> &FileControlHandle {
9033        &self.control_handle
9034    }
9035
9036    fn drop_without_shutdown(mut self) {
9037        // Safety: drops once, never accessed again due to mem::forget
9038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9039        // Prevent Drop from running (which would shut down the channel)
9040        std::mem::forget(self);
9041    }
9042}
9043
9044impl FileDeprecatedGetFlagsResponder {
9045    /// Sends a response to the FIDL transaction.
9046    ///
9047    /// Sets the channel to shutdown if an error occurs.
9048    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9049        let _result = self.send_raw(s, flags);
9050        if _result.is_err() {
9051            self.control_handle.shutdown();
9052        }
9053        self.drop_without_shutdown();
9054        _result
9055    }
9056
9057    /// Similar to "send" but does not shutdown the channel if an error occurs.
9058    pub fn send_no_shutdown_on_err(
9059        self,
9060        mut s: i32,
9061        mut flags: OpenFlags,
9062    ) -> Result<(), fidl::Error> {
9063        let _result = self.send_raw(s, flags);
9064        self.drop_without_shutdown();
9065        _result
9066    }
9067
9068    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
9069        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
9070            (s, flags),
9071            self.tx_id,
9072            0x5b88fffb8eda3aa1,
9073            fidl::encoding::DynamicFlags::empty(),
9074        )
9075    }
9076}
9077
9078#[must_use = "FIDL methods require a response to be sent"]
9079#[derive(Debug)]
9080pub struct FileDeprecatedSetFlagsResponder {
9081    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9082    tx_id: u32,
9083}
9084
9085/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9086/// if the responder is dropped without sending a response, so that the client
9087/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9088impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
9089    fn drop(&mut self) {
9090        self.control_handle.shutdown();
9091        // Safety: drops once, never accessed again
9092        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9093    }
9094}
9095
9096impl fdomain_client::fidl::Responder for FileDeprecatedSetFlagsResponder {
9097    type ControlHandle = FileControlHandle;
9098
9099    fn control_handle(&self) -> &FileControlHandle {
9100        &self.control_handle
9101    }
9102
9103    fn drop_without_shutdown(mut self) {
9104        // Safety: drops once, never accessed again due to mem::forget
9105        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9106        // Prevent Drop from running (which would shut down the channel)
9107        std::mem::forget(self);
9108    }
9109}
9110
9111impl FileDeprecatedSetFlagsResponder {
9112    /// Sends a response to the FIDL transaction.
9113    ///
9114    /// Sets the channel to shutdown if an error occurs.
9115    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
9116        let _result = self.send_raw(s);
9117        if _result.is_err() {
9118            self.control_handle.shutdown();
9119        }
9120        self.drop_without_shutdown();
9121        _result
9122    }
9123
9124    /// Similar to "send" but does not shutdown the channel if an error occurs.
9125    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
9126        let _result = self.send_raw(s);
9127        self.drop_without_shutdown();
9128        _result
9129    }
9130
9131    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
9132        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
9133            (s,),
9134            self.tx_id,
9135            0x5295b76c71fde733,
9136            fidl::encoding::DynamicFlags::empty(),
9137        )
9138    }
9139}
9140
9141#[must_use = "FIDL methods require a response to be sent"]
9142#[derive(Debug)]
9143pub struct FileGetFlagsResponder {
9144    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9145    tx_id: u32,
9146}
9147
9148/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9149/// if the responder is dropped without sending a response, so that the client
9150/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9151impl std::ops::Drop for FileGetFlagsResponder {
9152    fn drop(&mut self) {
9153        self.control_handle.shutdown();
9154        // Safety: drops once, never accessed again
9155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9156    }
9157}
9158
9159impl fdomain_client::fidl::Responder for FileGetFlagsResponder {
9160    type ControlHandle = FileControlHandle;
9161
9162    fn control_handle(&self) -> &FileControlHandle {
9163        &self.control_handle
9164    }
9165
9166    fn drop_without_shutdown(mut self) {
9167        // Safety: drops once, never accessed again due to mem::forget
9168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9169        // Prevent Drop from running (which would shut down the channel)
9170        std::mem::forget(self);
9171    }
9172}
9173
9174impl FileGetFlagsResponder {
9175    /// Sends a response to the FIDL transaction.
9176    ///
9177    /// Sets the channel to shutdown if an error occurs.
9178    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9179        let _result = self.send_raw(result);
9180        if _result.is_err() {
9181            self.control_handle.shutdown();
9182        }
9183        self.drop_without_shutdown();
9184        _result
9185    }
9186
9187    /// Similar to "send" but does not shutdown the channel if an error occurs.
9188    pub fn send_no_shutdown_on_err(
9189        self,
9190        mut result: Result<Flags, i32>,
9191    ) -> Result<(), fidl::Error> {
9192        let _result = self.send_raw(result);
9193        self.drop_without_shutdown();
9194        _result
9195    }
9196
9197    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
9198        self.control_handle
9199            .inner
9200            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
9201                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
9202                self.tx_id,
9203                0x176eb318f64ec23,
9204                fidl::encoding::DynamicFlags::FLEXIBLE,
9205            )
9206    }
9207}
9208
9209#[must_use = "FIDL methods require a response to be sent"]
9210#[derive(Debug)]
9211pub struct FileSetFlagsResponder {
9212    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9213    tx_id: u32,
9214}
9215
9216/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9217/// if the responder is dropped without sending a response, so that the client
9218/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9219impl std::ops::Drop for FileSetFlagsResponder {
9220    fn drop(&mut self) {
9221        self.control_handle.shutdown();
9222        // Safety: drops once, never accessed again
9223        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9224    }
9225}
9226
9227impl fdomain_client::fidl::Responder for FileSetFlagsResponder {
9228    type ControlHandle = FileControlHandle;
9229
9230    fn control_handle(&self) -> &FileControlHandle {
9231        &self.control_handle
9232    }
9233
9234    fn drop_without_shutdown(mut self) {
9235        // Safety: drops once, never accessed again due to mem::forget
9236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9237        // Prevent Drop from running (which would shut down the channel)
9238        std::mem::forget(self);
9239    }
9240}
9241
9242impl FileSetFlagsResponder {
9243    /// Sends a response to the FIDL transaction.
9244    ///
9245    /// Sets the channel to shutdown if an error occurs.
9246    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9247        let _result = self.send_raw(result);
9248        if _result.is_err() {
9249            self.control_handle.shutdown();
9250        }
9251        self.drop_without_shutdown();
9252        _result
9253    }
9254
9255    /// Similar to "send" but does not shutdown the channel if an error occurs.
9256    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9257        let _result = self.send_raw(result);
9258        self.drop_without_shutdown();
9259        _result
9260    }
9261
9262    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9263        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9264            fidl::encoding::EmptyStruct,
9265            i32,
9266        >>(
9267            fidl::encoding::FlexibleResult::new(result),
9268            self.tx_id,
9269            0x55a8028685791ea8,
9270            fidl::encoding::DynamicFlags::FLEXIBLE,
9271        )
9272    }
9273}
9274
9275#[must_use = "FIDL methods require a response to be sent"]
9276#[derive(Debug)]
9277pub struct FileQueryFilesystemResponder {
9278    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9279    tx_id: u32,
9280}
9281
9282/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9283/// if the responder is dropped without sending a response, so that the client
9284/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9285impl std::ops::Drop for FileQueryFilesystemResponder {
9286    fn drop(&mut self) {
9287        self.control_handle.shutdown();
9288        // Safety: drops once, never accessed again
9289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9290    }
9291}
9292
9293impl fdomain_client::fidl::Responder for FileQueryFilesystemResponder {
9294    type ControlHandle = FileControlHandle;
9295
9296    fn control_handle(&self) -> &FileControlHandle {
9297        &self.control_handle
9298    }
9299
9300    fn drop_without_shutdown(mut self) {
9301        // Safety: drops once, never accessed again due to mem::forget
9302        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9303        // Prevent Drop from running (which would shut down the channel)
9304        std::mem::forget(self);
9305    }
9306}
9307
9308impl FileQueryFilesystemResponder {
9309    /// Sends a response to the FIDL transaction.
9310    ///
9311    /// Sets the channel to shutdown if an error occurs.
9312    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9313        let _result = self.send_raw(s, info);
9314        if _result.is_err() {
9315            self.control_handle.shutdown();
9316        }
9317        self.drop_without_shutdown();
9318        _result
9319    }
9320
9321    /// Similar to "send" but does not shutdown the channel if an error occurs.
9322    pub fn send_no_shutdown_on_err(
9323        self,
9324        mut s: i32,
9325        mut info: Option<&FilesystemInfo>,
9326    ) -> Result<(), fidl::Error> {
9327        let _result = self.send_raw(s, info);
9328        self.drop_without_shutdown();
9329        _result
9330    }
9331
9332    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
9333        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
9334            (s, info),
9335            self.tx_id,
9336            0x6f344a1c6b0a0610,
9337            fidl::encoding::DynamicFlags::empty(),
9338        )
9339    }
9340}
9341
9342#[must_use = "FIDL methods require a response to be sent"]
9343#[derive(Debug)]
9344pub struct FileGetAttributesResponder {
9345    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9346    tx_id: u32,
9347}
9348
9349/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9350/// if the responder is dropped without sending a response, so that the client
9351/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9352impl std::ops::Drop for FileGetAttributesResponder {
9353    fn drop(&mut self) {
9354        self.control_handle.shutdown();
9355        // Safety: drops once, never accessed again
9356        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9357    }
9358}
9359
9360impl fdomain_client::fidl::Responder for FileGetAttributesResponder {
9361    type ControlHandle = FileControlHandle;
9362
9363    fn control_handle(&self) -> &FileControlHandle {
9364        &self.control_handle
9365    }
9366
9367    fn drop_without_shutdown(mut self) {
9368        // Safety: drops once, never accessed again due to mem::forget
9369        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9370        // Prevent Drop from running (which would shut down the channel)
9371        std::mem::forget(self);
9372    }
9373}
9374
9375impl FileGetAttributesResponder {
9376    /// Sends a response to the FIDL transaction.
9377    ///
9378    /// Sets the channel to shutdown if an error occurs.
9379    pub fn send(
9380        self,
9381        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9382    ) -> Result<(), fidl::Error> {
9383        let _result = self.send_raw(result);
9384        if _result.is_err() {
9385            self.control_handle.shutdown();
9386        }
9387        self.drop_without_shutdown();
9388        _result
9389    }
9390
9391    /// Similar to "send" but does not shutdown the channel if an error occurs.
9392    pub fn send_no_shutdown_on_err(
9393        self,
9394        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9395    ) -> Result<(), fidl::Error> {
9396        let _result = self.send_raw(result);
9397        self.drop_without_shutdown();
9398        _result
9399    }
9400
9401    fn send_raw(
9402        &self,
9403        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
9404    ) -> Result<(), fidl::Error> {
9405        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
9406            result,
9407            self.tx_id,
9408            0x3d4396a638ea053b,
9409            fidl::encoding::DynamicFlags::empty(),
9410        )
9411    }
9412}
9413
9414#[must_use = "FIDL methods require a response to be sent"]
9415#[derive(Debug)]
9416pub struct FileUpdateAttributesResponder {
9417    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9418    tx_id: u32,
9419}
9420
9421/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9422/// if the responder is dropped without sending a response, so that the client
9423/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9424impl std::ops::Drop for FileUpdateAttributesResponder {
9425    fn drop(&mut self) {
9426        self.control_handle.shutdown();
9427        // Safety: drops once, never accessed again
9428        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9429    }
9430}
9431
9432impl fdomain_client::fidl::Responder for FileUpdateAttributesResponder {
9433    type ControlHandle = FileControlHandle;
9434
9435    fn control_handle(&self) -> &FileControlHandle {
9436        &self.control_handle
9437    }
9438
9439    fn drop_without_shutdown(mut self) {
9440        // Safety: drops once, never accessed again due to mem::forget
9441        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9442        // Prevent Drop from running (which would shut down the channel)
9443        std::mem::forget(self);
9444    }
9445}
9446
9447impl FileUpdateAttributesResponder {
9448    /// Sends a response to the FIDL transaction.
9449    ///
9450    /// Sets the channel to shutdown if an error occurs.
9451    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9452        let _result = self.send_raw(result);
9453        if _result.is_err() {
9454            self.control_handle.shutdown();
9455        }
9456        self.drop_without_shutdown();
9457        _result
9458    }
9459
9460    /// Similar to "send" but does not shutdown the channel if an error occurs.
9461    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9462        let _result = self.send_raw(result);
9463        self.drop_without_shutdown();
9464        _result
9465    }
9466
9467    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9468        self.control_handle
9469            .inner
9470            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9471                result,
9472                self.tx_id,
9473                0x3308c1da5a89bf08,
9474                fidl::encoding::DynamicFlags::empty(),
9475            )
9476    }
9477}
9478
9479#[must_use = "FIDL methods require a response to be sent"]
9480#[derive(Debug)]
9481pub struct FileSyncResponder {
9482    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9483    tx_id: u32,
9484}
9485
9486/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9487/// if the responder is dropped without sending a response, so that the client
9488/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9489impl std::ops::Drop for FileSyncResponder {
9490    fn drop(&mut self) {
9491        self.control_handle.shutdown();
9492        // Safety: drops once, never accessed again
9493        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9494    }
9495}
9496
9497impl fdomain_client::fidl::Responder for FileSyncResponder {
9498    type ControlHandle = FileControlHandle;
9499
9500    fn control_handle(&self) -> &FileControlHandle {
9501        &self.control_handle
9502    }
9503
9504    fn drop_without_shutdown(mut self) {
9505        // Safety: drops once, never accessed again due to mem::forget
9506        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9507        // Prevent Drop from running (which would shut down the channel)
9508        std::mem::forget(self);
9509    }
9510}
9511
9512impl FileSyncResponder {
9513    /// Sends a response to the FIDL transaction.
9514    ///
9515    /// Sets the channel to shutdown if an error occurs.
9516    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9517        let _result = self.send_raw(result);
9518        if _result.is_err() {
9519            self.control_handle.shutdown();
9520        }
9521        self.drop_without_shutdown();
9522        _result
9523    }
9524
9525    /// Similar to "send" but does not shutdown the channel if an error occurs.
9526    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9527        let _result = self.send_raw(result);
9528        self.drop_without_shutdown();
9529        _result
9530    }
9531
9532    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9533        self.control_handle
9534            .inner
9535            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9536                result,
9537                self.tx_id,
9538                0x2c5c27ca0ab5dc49,
9539                fidl::encoding::DynamicFlags::empty(),
9540            )
9541    }
9542}
9543
9544#[must_use = "FIDL methods require a response to be sent"]
9545#[derive(Debug)]
9546pub struct FileGetExtendedAttributeResponder {
9547    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9548    tx_id: u32,
9549}
9550
9551/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9552/// if the responder is dropped without sending a response, so that the client
9553/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9554impl std::ops::Drop for FileGetExtendedAttributeResponder {
9555    fn drop(&mut self) {
9556        self.control_handle.shutdown();
9557        // Safety: drops once, never accessed again
9558        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9559    }
9560}
9561
9562impl fdomain_client::fidl::Responder for FileGetExtendedAttributeResponder {
9563    type ControlHandle = FileControlHandle;
9564
9565    fn control_handle(&self) -> &FileControlHandle {
9566        &self.control_handle
9567    }
9568
9569    fn drop_without_shutdown(mut self) {
9570        // Safety: drops once, never accessed again due to mem::forget
9571        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9572        // Prevent Drop from running (which would shut down the channel)
9573        std::mem::forget(self);
9574    }
9575}
9576
9577impl FileGetExtendedAttributeResponder {
9578    /// Sends a response to the FIDL transaction.
9579    ///
9580    /// Sets the channel to shutdown if an error occurs.
9581    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9582        let _result = self.send_raw(result);
9583        if _result.is_err() {
9584            self.control_handle.shutdown();
9585        }
9586        self.drop_without_shutdown();
9587        _result
9588    }
9589
9590    /// Similar to "send" but does not shutdown the channel if an error occurs.
9591    pub fn send_no_shutdown_on_err(
9592        self,
9593        mut result: Result<ExtendedAttributeValue, i32>,
9594    ) -> Result<(), fidl::Error> {
9595        let _result = self.send_raw(result);
9596        self.drop_without_shutdown();
9597        _result
9598    }
9599
9600    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
9601        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
9602            result.as_mut().map_err(|e| *e),
9603            self.tx_id,
9604            0x45ffa3ccfdeb76db,
9605            fidl::encoding::DynamicFlags::empty(),
9606        )
9607    }
9608}
9609
9610#[must_use = "FIDL methods require a response to be sent"]
9611#[derive(Debug)]
9612pub struct FileSetExtendedAttributeResponder {
9613    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9614    tx_id: u32,
9615}
9616
9617/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9618/// if the responder is dropped without sending a response, so that the client
9619/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9620impl std::ops::Drop for FileSetExtendedAttributeResponder {
9621    fn drop(&mut self) {
9622        self.control_handle.shutdown();
9623        // Safety: drops once, never accessed again
9624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9625    }
9626}
9627
9628impl fdomain_client::fidl::Responder for FileSetExtendedAttributeResponder {
9629    type ControlHandle = FileControlHandle;
9630
9631    fn control_handle(&self) -> &FileControlHandle {
9632        &self.control_handle
9633    }
9634
9635    fn drop_without_shutdown(mut self) {
9636        // Safety: drops once, never accessed again due to mem::forget
9637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9638        // Prevent Drop from running (which would shut down the channel)
9639        std::mem::forget(self);
9640    }
9641}
9642
9643impl FileSetExtendedAttributeResponder {
9644    /// Sends a response to the FIDL transaction.
9645    ///
9646    /// Sets the channel to shutdown if an error occurs.
9647    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9648        let _result = self.send_raw(result);
9649        if _result.is_err() {
9650            self.control_handle.shutdown();
9651        }
9652        self.drop_without_shutdown();
9653        _result
9654    }
9655
9656    /// Similar to "send" but does not shutdown the channel if an error occurs.
9657    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9658        let _result = self.send_raw(result);
9659        self.drop_without_shutdown();
9660        _result
9661    }
9662
9663    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9664        self.control_handle
9665            .inner
9666            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9667                result,
9668                self.tx_id,
9669                0x4a951362f681f23c,
9670                fidl::encoding::DynamicFlags::empty(),
9671            )
9672    }
9673}
9674
9675#[must_use = "FIDL methods require a response to be sent"]
9676#[derive(Debug)]
9677pub struct FileRemoveExtendedAttributeResponder {
9678    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9679    tx_id: u32,
9680}
9681
9682/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9683/// if the responder is dropped without sending a response, so that the client
9684/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9685impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
9686    fn drop(&mut self) {
9687        self.control_handle.shutdown();
9688        // Safety: drops once, never accessed again
9689        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9690    }
9691}
9692
9693impl fdomain_client::fidl::Responder for FileRemoveExtendedAttributeResponder {
9694    type ControlHandle = FileControlHandle;
9695
9696    fn control_handle(&self) -> &FileControlHandle {
9697        &self.control_handle
9698    }
9699
9700    fn drop_without_shutdown(mut self) {
9701        // Safety: drops once, never accessed again due to mem::forget
9702        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9703        // Prevent Drop from running (which would shut down the channel)
9704        std::mem::forget(self);
9705    }
9706}
9707
9708impl FileRemoveExtendedAttributeResponder {
9709    /// Sends a response to the FIDL transaction.
9710    ///
9711    /// Sets the channel to shutdown if an error occurs.
9712    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9713        let _result = self.send_raw(result);
9714        if _result.is_err() {
9715            self.control_handle.shutdown();
9716        }
9717        self.drop_without_shutdown();
9718        _result
9719    }
9720
9721    /// Similar to "send" but does not shutdown the channel if an error occurs.
9722    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9723        let _result = self.send_raw(result);
9724        self.drop_without_shutdown();
9725        _result
9726    }
9727
9728    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
9729        self.control_handle
9730            .inner
9731            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
9732                result,
9733                self.tx_id,
9734                0x7a0b9f3a9bf9032d,
9735                fidl::encoding::DynamicFlags::empty(),
9736            )
9737    }
9738}
9739
9740#[must_use = "FIDL methods require a response to be sent"]
9741#[derive(Debug)]
9742pub struct FileReadResponder {
9743    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9744    tx_id: u32,
9745}
9746
9747/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9748/// if the responder is dropped without sending a response, so that the client
9749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9750impl std::ops::Drop for FileReadResponder {
9751    fn drop(&mut self) {
9752        self.control_handle.shutdown();
9753        // Safety: drops once, never accessed again
9754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9755    }
9756}
9757
9758impl fdomain_client::fidl::Responder for FileReadResponder {
9759    type ControlHandle = FileControlHandle;
9760
9761    fn control_handle(&self) -> &FileControlHandle {
9762        &self.control_handle
9763    }
9764
9765    fn drop_without_shutdown(mut self) {
9766        // Safety: drops once, never accessed again due to mem::forget
9767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9768        // Prevent Drop from running (which would shut down the channel)
9769        std::mem::forget(self);
9770    }
9771}
9772
9773impl FileReadResponder {
9774    /// Sends a response to the FIDL transaction.
9775    ///
9776    /// Sets the channel to shutdown if an error occurs.
9777    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9778        let _result = self.send_raw(result);
9779        if _result.is_err() {
9780            self.control_handle.shutdown();
9781        }
9782        self.drop_without_shutdown();
9783        _result
9784    }
9785
9786    /// Similar to "send" but does not shutdown the channel if an error occurs.
9787    pub fn send_no_shutdown_on_err(
9788        self,
9789        mut result: Result<&[u8], i32>,
9790    ) -> Result<(), fidl::Error> {
9791        let _result = self.send_raw(result);
9792        self.drop_without_shutdown();
9793        _result
9794    }
9795
9796    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
9797        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
9798            result.map(|data| (data,)),
9799            self.tx_id,
9800            0x57e419a298c8ede,
9801            fidl::encoding::DynamicFlags::empty(),
9802        )
9803    }
9804}
9805
9806#[must_use = "FIDL methods require a response to be sent"]
9807#[derive(Debug)]
9808pub struct FileWriteResponder {
9809    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9810    tx_id: u32,
9811}
9812
9813/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9814/// if the responder is dropped without sending a response, so that the client
9815/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9816impl std::ops::Drop for FileWriteResponder {
9817    fn drop(&mut self) {
9818        self.control_handle.shutdown();
9819        // Safety: drops once, never accessed again
9820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9821    }
9822}
9823
9824impl fdomain_client::fidl::Responder for FileWriteResponder {
9825    type ControlHandle = FileControlHandle;
9826
9827    fn control_handle(&self) -> &FileControlHandle {
9828        &self.control_handle
9829    }
9830
9831    fn drop_without_shutdown(mut self) {
9832        // Safety: drops once, never accessed again due to mem::forget
9833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9834        // Prevent Drop from running (which would shut down the channel)
9835        std::mem::forget(self);
9836    }
9837}
9838
9839impl FileWriteResponder {
9840    /// Sends a response to the FIDL transaction.
9841    ///
9842    /// Sets the channel to shutdown if an error occurs.
9843    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9844        let _result = self.send_raw(result);
9845        if _result.is_err() {
9846            self.control_handle.shutdown();
9847        }
9848        self.drop_without_shutdown();
9849        _result
9850    }
9851
9852    /// Similar to "send" but does not shutdown the channel if an error occurs.
9853    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9854        let _result = self.send_raw(result);
9855        self.drop_without_shutdown();
9856        _result
9857    }
9858
9859    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9860        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
9861            result.map(|actual_count| (actual_count,)),
9862            self.tx_id,
9863            0x6a31437832469f82,
9864            fidl::encoding::DynamicFlags::empty(),
9865        )
9866    }
9867}
9868
9869#[must_use = "FIDL methods require a response to be sent"]
9870#[derive(Debug)]
9871pub struct FileDescribeResponder {
9872    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9873    tx_id: u32,
9874}
9875
9876/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9877/// if the responder is dropped without sending a response, so that the client
9878/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9879impl std::ops::Drop for FileDescribeResponder {
9880    fn drop(&mut self) {
9881        self.control_handle.shutdown();
9882        // Safety: drops once, never accessed again
9883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9884    }
9885}
9886
9887impl fdomain_client::fidl::Responder for FileDescribeResponder {
9888    type ControlHandle = FileControlHandle;
9889
9890    fn control_handle(&self) -> &FileControlHandle {
9891        &self.control_handle
9892    }
9893
9894    fn drop_without_shutdown(mut self) {
9895        // Safety: drops once, never accessed again due to mem::forget
9896        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9897        // Prevent Drop from running (which would shut down the channel)
9898        std::mem::forget(self);
9899    }
9900}
9901
9902impl FileDescribeResponder {
9903    /// Sends a response to the FIDL transaction.
9904    ///
9905    /// Sets the channel to shutdown if an error occurs.
9906    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9907        let _result = self.send_raw(payload);
9908        if _result.is_err() {
9909            self.control_handle.shutdown();
9910        }
9911        self.drop_without_shutdown();
9912        _result
9913    }
9914
9915    /// Similar to "send" but does not shutdown the channel if an error occurs.
9916    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9917        let _result = self.send_raw(payload);
9918        self.drop_without_shutdown();
9919        _result
9920    }
9921
9922    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
9923        self.control_handle.inner.send::<FileInfo>(
9924            &mut payload,
9925            self.tx_id,
9926            0x68b5ac00c62906bc,
9927            fidl::encoding::DynamicFlags::empty(),
9928        )
9929    }
9930}
9931
9932#[must_use = "FIDL methods require a response to be sent"]
9933#[derive(Debug)]
9934pub struct FileSeekResponder {
9935    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9936    tx_id: u32,
9937}
9938
9939/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
9940/// if the responder is dropped without sending a response, so that the client
9941/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9942impl std::ops::Drop for FileSeekResponder {
9943    fn drop(&mut self) {
9944        self.control_handle.shutdown();
9945        // Safety: drops once, never accessed again
9946        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9947    }
9948}
9949
9950impl fdomain_client::fidl::Responder for FileSeekResponder {
9951    type ControlHandle = FileControlHandle;
9952
9953    fn control_handle(&self) -> &FileControlHandle {
9954        &self.control_handle
9955    }
9956
9957    fn drop_without_shutdown(mut self) {
9958        // Safety: drops once, never accessed again due to mem::forget
9959        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9960        // Prevent Drop from running (which would shut down the channel)
9961        std::mem::forget(self);
9962    }
9963}
9964
9965impl FileSeekResponder {
9966    /// Sends a response to the FIDL transaction.
9967    ///
9968    /// Sets the channel to shutdown if an error occurs.
9969    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9970        let _result = self.send_raw(result);
9971        if _result.is_err() {
9972            self.control_handle.shutdown();
9973        }
9974        self.drop_without_shutdown();
9975        _result
9976    }
9977
9978    /// Similar to "send" but does not shutdown the channel if an error occurs.
9979    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9980        let _result = self.send_raw(result);
9981        self.drop_without_shutdown();
9982        _result
9983    }
9984
9985    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
9986        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
9987            result.map(|offset_from_start| (offset_from_start,)),
9988            self.tx_id,
9989            0x78079168162c5207,
9990            fidl::encoding::DynamicFlags::empty(),
9991        )
9992    }
9993}
9994
9995#[must_use = "FIDL methods require a response to be sent"]
9996#[derive(Debug)]
9997pub struct FileReadAtResponder {
9998    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
9999    tx_id: u32,
10000}
10001
10002/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10003/// if the responder is dropped without sending a response, so that the client
10004/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10005impl std::ops::Drop for FileReadAtResponder {
10006    fn drop(&mut self) {
10007        self.control_handle.shutdown();
10008        // Safety: drops once, never accessed again
10009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10010    }
10011}
10012
10013impl fdomain_client::fidl::Responder for FileReadAtResponder {
10014    type ControlHandle = FileControlHandle;
10015
10016    fn control_handle(&self) -> &FileControlHandle {
10017        &self.control_handle
10018    }
10019
10020    fn drop_without_shutdown(mut self) {
10021        // Safety: drops once, never accessed again due to mem::forget
10022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10023        // Prevent Drop from running (which would shut down the channel)
10024        std::mem::forget(self);
10025    }
10026}
10027
10028impl FileReadAtResponder {
10029    /// Sends a response to the FIDL transaction.
10030    ///
10031    /// Sets the channel to shutdown if an error occurs.
10032    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10033        let _result = self.send_raw(result);
10034        if _result.is_err() {
10035            self.control_handle.shutdown();
10036        }
10037        self.drop_without_shutdown();
10038        _result
10039    }
10040
10041    /// Similar to "send" but does not shutdown the channel if an error occurs.
10042    pub fn send_no_shutdown_on_err(
10043        self,
10044        mut result: Result<&[u8], i32>,
10045    ) -> Result<(), fidl::Error> {
10046        let _result = self.send_raw(result);
10047        self.drop_without_shutdown();
10048        _result
10049    }
10050
10051    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
10052        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
10053            result.map(|data| (data,)),
10054            self.tx_id,
10055            0x1607a293a60d723e,
10056            fidl::encoding::DynamicFlags::empty(),
10057        )
10058    }
10059}
10060
10061#[must_use = "FIDL methods require a response to be sent"]
10062#[derive(Debug)]
10063pub struct FileWriteAtResponder {
10064    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10065    tx_id: u32,
10066}
10067
10068/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10069/// if the responder is dropped without sending a response, so that the client
10070/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10071impl std::ops::Drop for FileWriteAtResponder {
10072    fn drop(&mut self) {
10073        self.control_handle.shutdown();
10074        // Safety: drops once, never accessed again
10075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10076    }
10077}
10078
10079impl fdomain_client::fidl::Responder for FileWriteAtResponder {
10080    type ControlHandle = FileControlHandle;
10081
10082    fn control_handle(&self) -> &FileControlHandle {
10083        &self.control_handle
10084    }
10085
10086    fn drop_without_shutdown(mut self) {
10087        // Safety: drops once, never accessed again due to mem::forget
10088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10089        // Prevent Drop from running (which would shut down the channel)
10090        std::mem::forget(self);
10091    }
10092}
10093
10094impl FileWriteAtResponder {
10095    /// Sends a response to the FIDL transaction.
10096    ///
10097    /// Sets the channel to shutdown if an error occurs.
10098    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10099        let _result = self.send_raw(result);
10100        if _result.is_err() {
10101            self.control_handle.shutdown();
10102        }
10103        self.drop_without_shutdown();
10104        _result
10105    }
10106
10107    /// Similar to "send" but does not shutdown the channel if an error occurs.
10108    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10109        let _result = self.send_raw(result);
10110        self.drop_without_shutdown();
10111        _result
10112    }
10113
10114    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
10115        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
10116            result.map(|actual_count| (actual_count,)),
10117            self.tx_id,
10118            0x793eefc0045e792b,
10119            fidl::encoding::DynamicFlags::empty(),
10120        )
10121    }
10122}
10123
10124#[must_use = "FIDL methods require a response to be sent"]
10125#[derive(Debug)]
10126pub struct FileResizeResponder {
10127    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10128    tx_id: u32,
10129}
10130
10131/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10132/// if the responder is dropped without sending a response, so that the client
10133/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10134impl std::ops::Drop for FileResizeResponder {
10135    fn drop(&mut self) {
10136        self.control_handle.shutdown();
10137        // Safety: drops once, never accessed again
10138        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10139    }
10140}
10141
10142impl fdomain_client::fidl::Responder for FileResizeResponder {
10143    type ControlHandle = FileControlHandle;
10144
10145    fn control_handle(&self) -> &FileControlHandle {
10146        &self.control_handle
10147    }
10148
10149    fn drop_without_shutdown(mut self) {
10150        // Safety: drops once, never accessed again due to mem::forget
10151        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10152        // Prevent Drop from running (which would shut down the channel)
10153        std::mem::forget(self);
10154    }
10155}
10156
10157impl FileResizeResponder {
10158    /// Sends a response to the FIDL transaction.
10159    ///
10160    /// Sets the channel to shutdown if an error occurs.
10161    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10162        let _result = self.send_raw(result);
10163        if _result.is_err() {
10164            self.control_handle.shutdown();
10165        }
10166        self.drop_without_shutdown();
10167        _result
10168    }
10169
10170    /// Similar to "send" but does not shutdown the channel if an error occurs.
10171    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10172        let _result = self.send_raw(result);
10173        self.drop_without_shutdown();
10174        _result
10175    }
10176
10177    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10178        self.control_handle
10179            .inner
10180            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10181                result,
10182                self.tx_id,
10183                0x2b80825f0535743a,
10184                fidl::encoding::DynamicFlags::empty(),
10185            )
10186    }
10187}
10188
10189#[must_use = "FIDL methods require a response to be sent"]
10190#[derive(Debug)]
10191pub struct FileGetBackingMemoryResponder {
10192    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10193    tx_id: u32,
10194}
10195
10196/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10197/// if the responder is dropped without sending a response, so that the client
10198/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10199impl std::ops::Drop for FileGetBackingMemoryResponder {
10200    fn drop(&mut self) {
10201        self.control_handle.shutdown();
10202        // Safety: drops once, never accessed again
10203        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10204    }
10205}
10206
10207impl fdomain_client::fidl::Responder for FileGetBackingMemoryResponder {
10208    type ControlHandle = FileControlHandle;
10209
10210    fn control_handle(&self) -> &FileControlHandle {
10211        &self.control_handle
10212    }
10213
10214    fn drop_without_shutdown(mut self) {
10215        // Safety: drops once, never accessed again due to mem::forget
10216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10217        // Prevent Drop from running (which would shut down the channel)
10218        std::mem::forget(self);
10219    }
10220}
10221
10222impl FileGetBackingMemoryResponder {
10223    /// Sends a response to the FIDL transaction.
10224    ///
10225    /// Sets the channel to shutdown if an error occurs.
10226    pub fn send(self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10227        let _result = self.send_raw(result);
10228        if _result.is_err() {
10229            self.control_handle.shutdown();
10230        }
10231        self.drop_without_shutdown();
10232        _result
10233    }
10234
10235    /// Similar to "send" but does not shutdown the channel if an error occurs.
10236    pub fn send_no_shutdown_on_err(
10237        self,
10238        mut result: Result<fdomain_client::Vmo, i32>,
10239    ) -> Result<(), fidl::Error> {
10240        let _result = self.send_raw(result);
10241        self.drop_without_shutdown();
10242        _result
10243    }
10244
10245    fn send_raw(&self, mut result: Result<fdomain_client::Vmo, i32>) -> Result<(), fidl::Error> {
10246        self.control_handle
10247            .inner
10248            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
10249                result.map(|vmo| (vmo,)),
10250                self.tx_id,
10251                0xa6a9e654cbf62b,
10252                fidl::encoding::DynamicFlags::empty(),
10253            )
10254    }
10255}
10256
10257#[must_use = "FIDL methods require a response to be sent"]
10258#[derive(Debug)]
10259pub struct FileAllocateResponder {
10260    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10261    tx_id: u32,
10262}
10263
10264/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10265/// if the responder is dropped without sending a response, so that the client
10266/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10267impl std::ops::Drop for FileAllocateResponder {
10268    fn drop(&mut self) {
10269        self.control_handle.shutdown();
10270        // Safety: drops once, never accessed again
10271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10272    }
10273}
10274
10275impl fdomain_client::fidl::Responder for FileAllocateResponder {
10276    type ControlHandle = FileControlHandle;
10277
10278    fn control_handle(&self) -> &FileControlHandle {
10279        &self.control_handle
10280    }
10281
10282    fn drop_without_shutdown(mut self) {
10283        // Safety: drops once, never accessed again due to mem::forget
10284        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10285        // Prevent Drop from running (which would shut down the channel)
10286        std::mem::forget(self);
10287    }
10288}
10289
10290impl FileAllocateResponder {
10291    /// Sends a response to the FIDL transaction.
10292    ///
10293    /// Sets the channel to shutdown if an error occurs.
10294    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10295        let _result = self.send_raw(result);
10296        if _result.is_err() {
10297            self.control_handle.shutdown();
10298        }
10299        self.drop_without_shutdown();
10300        _result
10301    }
10302
10303    /// Similar to "send" but does not shutdown the channel if an error occurs.
10304    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10305        let _result = self.send_raw(result);
10306        self.drop_without_shutdown();
10307        _result
10308    }
10309
10310    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10311        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10312            fidl::encoding::EmptyStruct,
10313            i32,
10314        >>(
10315            fidl::encoding::FlexibleResult::new(result),
10316            self.tx_id,
10317            0x77fa0c330b57fd2e,
10318            fidl::encoding::DynamicFlags::FLEXIBLE,
10319        )
10320    }
10321}
10322
10323#[must_use = "FIDL methods require a response to be sent"]
10324#[derive(Debug)]
10325pub struct FileEnableVerityResponder {
10326    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10327    tx_id: u32,
10328}
10329
10330/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10331/// if the responder is dropped without sending a response, so that the client
10332/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10333impl std::ops::Drop for FileEnableVerityResponder {
10334    fn drop(&mut self) {
10335        self.control_handle.shutdown();
10336        // Safety: drops once, never accessed again
10337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10338    }
10339}
10340
10341impl fdomain_client::fidl::Responder for FileEnableVerityResponder {
10342    type ControlHandle = FileControlHandle;
10343
10344    fn control_handle(&self) -> &FileControlHandle {
10345        &self.control_handle
10346    }
10347
10348    fn drop_without_shutdown(mut self) {
10349        // Safety: drops once, never accessed again due to mem::forget
10350        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10351        // Prevent Drop from running (which would shut down the channel)
10352        std::mem::forget(self);
10353    }
10354}
10355
10356impl FileEnableVerityResponder {
10357    /// Sends a response to the FIDL transaction.
10358    ///
10359    /// Sets the channel to shutdown if an error occurs.
10360    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10361        let _result = self.send_raw(result);
10362        if _result.is_err() {
10363            self.control_handle.shutdown();
10364        }
10365        self.drop_without_shutdown();
10366        _result
10367    }
10368
10369    /// Similar to "send" but does not shutdown the channel if an error occurs.
10370    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10371        let _result = self.send_raw(result);
10372        self.drop_without_shutdown();
10373        _result
10374    }
10375
10376    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10377        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10378            fidl::encoding::EmptyStruct,
10379            i32,
10380        >>(
10381            fidl::encoding::FlexibleResult::new(result),
10382            self.tx_id,
10383            0x2c421ec3faaeb8bb,
10384            fidl::encoding::DynamicFlags::FLEXIBLE,
10385        )
10386    }
10387}
10388
10389#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10390pub struct LinkableMarker;
10391
10392impl fdomain_client::fidl::ProtocolMarker for LinkableMarker {
10393    type Proxy = LinkableProxy;
10394    type RequestStream = LinkableRequestStream;
10395
10396    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
10397}
10398pub type LinkableLinkIntoResult = Result<(), i32>;
10399
10400pub trait LinkableProxyInterface: Send + Sync {
10401    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
10402        + Send;
10403    fn r#link_into(
10404        &self,
10405        dst_parent_token: fdomain_client::Event,
10406        dst: &str,
10407    ) -> Self::LinkIntoResponseFut;
10408}
10409
10410#[derive(Debug, Clone)]
10411pub struct LinkableProxy {
10412    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10413}
10414
10415impl fdomain_client::fidl::Proxy for LinkableProxy {
10416    type Protocol = LinkableMarker;
10417
10418    fn from_channel(inner: fdomain_client::Channel) -> Self {
10419        Self::new(inner)
10420    }
10421
10422    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10423        self.client.into_channel().map_err(|client| Self { client })
10424    }
10425
10426    fn as_channel(&self) -> &fdomain_client::Channel {
10427        self.client.as_channel()
10428    }
10429}
10430
10431impl LinkableProxy {
10432    /// Create a new Proxy for fuchsia.io/Linkable.
10433    pub fn new(channel: fdomain_client::Channel) -> Self {
10434        let protocol_name = <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10435        Self { client: fidl::client::Client::new(channel, protocol_name) }
10436    }
10437
10438    /// Get a Stream of events from the remote end of the protocol.
10439    ///
10440    /// # Panics
10441    ///
10442    /// Panics if the event stream was already taken.
10443    pub fn take_event_stream(&self) -> LinkableEventStream {
10444        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
10445    }
10446
10447    /// Creates a link to this this object with name `dst` in the directory represented by
10448    /// `dst_parent_token`.
10449    ///
10450    /// `dst` must be a resolved object name. Including "/" in the string will return
10451    /// `ZX_ERR_INVALID_ARGS`.
10452    ///
10453    /// This method requires the maximal set of rights supported by the filesystem for this object.
10454    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10455    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10456    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10457    /// `ZX_ERR_ACCESS_DENIED`.
10458    ///
10459    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10460    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10461    ///
10462    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10463    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10464    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10465    ///
10466    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10467    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10468    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10469    pub fn r#link_into(
10470        &self,
10471        mut dst_parent_token: fdomain_client::Event,
10472        mut dst: &str,
10473    ) -> fidl::client::QueryResponseFut<
10474        LinkableLinkIntoResult,
10475        fdomain_client::fidl::FDomainResourceDialect,
10476    > {
10477        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
10478    }
10479}
10480
10481impl LinkableProxyInterface for LinkableProxy {
10482    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
10483        LinkableLinkIntoResult,
10484        fdomain_client::fidl::FDomainResourceDialect,
10485    >;
10486    fn r#link_into(
10487        &self,
10488        mut dst_parent_token: fdomain_client::Event,
10489        mut dst: &str,
10490    ) -> Self::LinkIntoResponseFut {
10491        fn _decode(
10492            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10493        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
10494            let _response = fidl::client::decode_transaction_body::<
10495                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10496                fdomain_client::fidl::FDomainResourceDialect,
10497                0x54f3949246a03e74,
10498            >(_buf?)?;
10499            Ok(_response.map(|x| x))
10500        }
10501        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
10502            (dst_parent_token, dst),
10503            0x54f3949246a03e74,
10504            fidl::encoding::DynamicFlags::empty(),
10505            _decode,
10506        )
10507    }
10508}
10509
10510pub struct LinkableEventStream {
10511    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
10512}
10513
10514impl std::marker::Unpin for LinkableEventStream {}
10515
10516impl futures::stream::FusedStream for LinkableEventStream {
10517    fn is_terminated(&self) -> bool {
10518        self.event_receiver.is_terminated()
10519    }
10520}
10521
10522impl futures::Stream for LinkableEventStream {
10523    type Item = Result<LinkableEvent, fidl::Error>;
10524
10525    fn poll_next(
10526        mut self: std::pin::Pin<&mut Self>,
10527        cx: &mut std::task::Context<'_>,
10528    ) -> std::task::Poll<Option<Self::Item>> {
10529        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10530            &mut self.event_receiver,
10531            cx
10532        )?) {
10533            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
10534            None => std::task::Poll::Ready(None),
10535        }
10536    }
10537}
10538
10539#[derive(Debug)]
10540pub enum LinkableEvent {}
10541
10542impl LinkableEvent {
10543    /// Decodes a message buffer as a [`LinkableEvent`].
10544    fn decode(
10545        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10546    ) -> Result<LinkableEvent, fidl::Error> {
10547        let (bytes, _handles) = buf.split_mut();
10548        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10549        debug_assert_eq!(tx_header.tx_id, 0);
10550        match tx_header.ordinal {
10551            _ => Err(fidl::Error::UnknownOrdinal {
10552                ordinal: tx_header.ordinal,
10553                protocol_name: <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10554            }),
10555        }
10556    }
10557}
10558
10559/// A Stream of incoming requests for fuchsia.io/Linkable.
10560pub struct LinkableRequestStream {
10561    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10562    is_terminated: bool,
10563}
10564
10565impl std::marker::Unpin for LinkableRequestStream {}
10566
10567impl futures::stream::FusedStream for LinkableRequestStream {
10568    fn is_terminated(&self) -> bool {
10569        self.is_terminated
10570    }
10571}
10572
10573impl fdomain_client::fidl::RequestStream for LinkableRequestStream {
10574    type Protocol = LinkableMarker;
10575    type ControlHandle = LinkableControlHandle;
10576
10577    fn from_channel(channel: fdomain_client::Channel) -> Self {
10578        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10579    }
10580
10581    fn control_handle(&self) -> Self::ControlHandle {
10582        LinkableControlHandle { inner: self.inner.clone() }
10583    }
10584
10585    fn into_inner(
10586        self,
10587    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
10588    {
10589        (self.inner, self.is_terminated)
10590    }
10591
10592    fn from_inner(
10593        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10594        is_terminated: bool,
10595    ) -> Self {
10596        Self { inner, is_terminated }
10597    }
10598}
10599
10600impl futures::Stream for LinkableRequestStream {
10601    type Item = Result<LinkableRequest, fidl::Error>;
10602
10603    fn poll_next(
10604        mut self: std::pin::Pin<&mut Self>,
10605        cx: &mut std::task::Context<'_>,
10606    ) -> std::task::Poll<Option<Self::Item>> {
10607        let this = &mut *self;
10608        if this.inner.check_shutdown(cx) {
10609            this.is_terminated = true;
10610            return std::task::Poll::Ready(None);
10611        }
10612        if this.is_terminated {
10613            panic!("polled LinkableRequestStream after completion");
10614        }
10615        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
10616            |bytes, handles| {
10617                match this.inner.channel().read_etc(cx, bytes, handles) {
10618                    std::task::Poll::Ready(Ok(())) => {}
10619                    std::task::Poll::Pending => return std::task::Poll::Pending,
10620                    std::task::Poll::Ready(Err(None)) => {
10621                        this.is_terminated = true;
10622                        return std::task::Poll::Ready(None);
10623                    }
10624                    std::task::Poll::Ready(Err(Some(e))) => {
10625                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10626                            e.into(),
10627                        ))));
10628                    }
10629                }
10630
10631                // A message has been received from the channel
10632                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10633
10634                std::task::Poll::Ready(Some(match header.ordinal {
10635                    0x54f3949246a03e74 => {
10636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10637                        let mut req = fidl::new_empty!(
10638                            LinkableLinkIntoRequest,
10639                            fdomain_client::fidl::FDomainResourceDialect
10640                        );
10641                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
10642                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
10643                        Ok(LinkableRequest::LinkInto {
10644                            dst_parent_token: req.dst_parent_token,
10645                            dst: req.dst,
10646
10647                            responder: LinkableLinkIntoResponder {
10648                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10649                                tx_id: header.tx_id,
10650                            },
10651                        })
10652                    }
10653                    _ => Err(fidl::Error::UnknownOrdinal {
10654                        ordinal: header.ordinal,
10655                        protocol_name:
10656                            <LinkableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
10657                    }),
10658                }))
10659            },
10660        )
10661    }
10662}
10663
10664#[derive(Debug)]
10665pub enum LinkableRequest {
10666    /// Creates a link to this this object with name `dst` in the directory represented by
10667    /// `dst_parent_token`.
10668    ///
10669    /// `dst` must be a resolved object name. Including "/" in the string will return
10670    /// `ZX_ERR_INVALID_ARGS`.
10671    ///
10672    /// This method requires the maximal set of rights supported by the filesystem for this object.
10673    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
10674    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
10675    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
10676    /// `ZX_ERR_ACCESS_DENIED`.
10677    ///
10678    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
10679    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
10680    ///
10681    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
10682    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
10683    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
10684    ///
10685    /// This method does not have the same atomicity properties has the `Directory::Link` method,
10686    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
10687    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
10688    LinkInto {
10689        dst_parent_token: fdomain_client::Event,
10690        dst: String,
10691        responder: LinkableLinkIntoResponder,
10692    },
10693}
10694
10695impl LinkableRequest {
10696    #[allow(irrefutable_let_patterns)]
10697    pub fn into_link_into(
10698        self,
10699    ) -> Option<(fdomain_client::Event, String, LinkableLinkIntoResponder)> {
10700        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
10701            Some((dst_parent_token, dst, responder))
10702        } else {
10703            None
10704        }
10705    }
10706
10707    /// Name of the method defined in FIDL
10708    pub fn method_name(&self) -> &'static str {
10709        match *self {
10710            LinkableRequest::LinkInto { .. } => "link_into",
10711        }
10712    }
10713}
10714
10715#[derive(Debug, Clone)]
10716pub struct LinkableControlHandle {
10717    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
10718}
10719
10720impl fdomain_client::fidl::ControlHandle for LinkableControlHandle {
10721    fn shutdown(&self) {
10722        self.inner.shutdown()
10723    }
10724
10725    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10726        self.inner.shutdown_with_epitaph(status)
10727    }
10728
10729    fn is_closed(&self) -> bool {
10730        self.inner.channel().is_closed()
10731    }
10732    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
10733        self.inner.channel().on_closed()
10734    }
10735}
10736
10737impl LinkableControlHandle {}
10738
10739#[must_use = "FIDL methods require a response to be sent"]
10740#[derive(Debug)]
10741pub struct LinkableLinkIntoResponder {
10742    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
10743    tx_id: u32,
10744}
10745
10746/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
10747/// if the responder is dropped without sending a response, so that the client
10748/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10749impl std::ops::Drop for LinkableLinkIntoResponder {
10750    fn drop(&mut self) {
10751        self.control_handle.shutdown();
10752        // Safety: drops once, never accessed again
10753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10754    }
10755}
10756
10757impl fdomain_client::fidl::Responder for LinkableLinkIntoResponder {
10758    type ControlHandle = LinkableControlHandle;
10759
10760    fn control_handle(&self) -> &LinkableControlHandle {
10761        &self.control_handle
10762    }
10763
10764    fn drop_without_shutdown(mut self) {
10765        // Safety: drops once, never accessed again due to mem::forget
10766        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10767        // Prevent Drop from running (which would shut down the channel)
10768        std::mem::forget(self);
10769    }
10770}
10771
10772impl LinkableLinkIntoResponder {
10773    /// Sends a response to the FIDL transaction.
10774    ///
10775    /// Sets the channel to shutdown if an error occurs.
10776    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10777        let _result = self.send_raw(result);
10778        if _result.is_err() {
10779            self.control_handle.shutdown();
10780        }
10781        self.drop_without_shutdown();
10782        _result
10783    }
10784
10785    /// Similar to "send" but does not shutdown the channel if an error occurs.
10786    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10787        let _result = self.send_raw(result);
10788        self.drop_without_shutdown();
10789        _result
10790    }
10791
10792    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10793        self.control_handle
10794            .inner
10795            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10796                result,
10797                self.tx_id,
10798                0x54f3949246a03e74,
10799                fidl::encoding::DynamicFlags::empty(),
10800            )
10801    }
10802}
10803
10804#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10805pub struct NodeMarker;
10806
10807impl fdomain_client::fidl::ProtocolMarker for NodeMarker {
10808    type Proxy = NodeProxy;
10809    type RequestStream = NodeRequestStream;
10810
10811    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
10812}
10813impl fdomain_client::fidl::DiscoverableProtocolMarker for NodeMarker {}
10814pub type NodeGetFlagsResult = Result<Flags, i32>;
10815pub type NodeSetFlagsResult = Result<(), i32>;
10816pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
10817pub type NodeUpdateAttributesResult = Result<(), i32>;
10818pub type NodeSyncResult = Result<(), i32>;
10819pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
10820pub type NodeSetExtendedAttributeResult = Result<(), i32>;
10821pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
10822
10823pub trait NodeProxyInterface: Send + Sync {
10824    fn r#clone(
10825        &self,
10826        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10827    ) -> Result<(), fidl::Error>;
10828    type CloseResponseFut: std::future::Future<
10829            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
10830        > + Send;
10831    fn r#close(&self) -> Self::CloseResponseFut;
10832    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
10833    fn r#query(&self) -> Self::QueryResponseFut;
10834    fn r#deprecated_clone(
10835        &self,
10836        flags: OpenFlags,
10837        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10838    ) -> Result<(), fidl::Error>;
10839    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
10840        + Send;
10841    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
10842    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
10843    fn r#deprecated_set_attr(
10844        &self,
10845        flags: NodeAttributeFlags,
10846        attributes: &NodeAttributes,
10847    ) -> Self::DeprecatedSetAttrResponseFut;
10848    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
10849        + Send;
10850    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
10851    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
10852        + Send;
10853    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
10854    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
10855        + Send;
10856    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
10857    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
10858        + Send;
10859    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
10860    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
10861        + Send;
10862    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
10863    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
10864        + Send;
10865    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
10866    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
10867        + Send;
10868    fn r#update_attributes(
10869        &self,
10870        payload: &MutableNodeAttributes,
10871    ) -> Self::UpdateAttributesResponseFut;
10872    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
10873    fn r#sync(&self) -> Self::SyncResponseFut;
10874    fn r#list_extended_attributes(
10875        &self,
10876        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
10877    ) -> Result<(), fidl::Error>;
10878    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
10879        + Send;
10880    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
10881    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
10882        + Send;
10883    fn r#set_extended_attribute(
10884        &self,
10885        name: &[u8],
10886        value: ExtendedAttributeValue,
10887        mode: SetExtendedAttributeMode,
10888    ) -> Self::SetExtendedAttributeResponseFut;
10889    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
10890        + Send;
10891    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
10892}
10893
10894#[derive(Debug, Clone)]
10895pub struct NodeProxy {
10896    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
10897}
10898
10899impl fdomain_client::fidl::Proxy for NodeProxy {
10900    type Protocol = NodeMarker;
10901
10902    fn from_channel(inner: fdomain_client::Channel) -> Self {
10903        Self::new(inner)
10904    }
10905
10906    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
10907        self.client.into_channel().map_err(|client| Self { client })
10908    }
10909
10910    fn as_channel(&self) -> &fdomain_client::Channel {
10911        self.client.as_channel()
10912    }
10913}
10914
10915impl NodeProxy {
10916    /// Create a new Proxy for fuchsia.io/Node.
10917    pub fn new(channel: fdomain_client::Channel) -> Self {
10918        let protocol_name = <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
10919        Self { client: fidl::client::Client::new(channel, protocol_name) }
10920    }
10921
10922    /// Get a Stream of events from the remote end of the protocol.
10923    ///
10924    /// # Panics
10925    ///
10926    /// Panics if the event stream was already taken.
10927    pub fn take_event_stream(&self) -> NodeEventStream {
10928        NodeEventStream { event_receiver: self.client.take_event_receiver() }
10929    }
10930
10931    pub fn r#clone(
10932        &self,
10933        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
10934    ) -> Result<(), fidl::Error> {
10935        NodeProxyInterface::r#clone(self, request)
10936    }
10937
10938    /// Terminates the connection.
10939    ///
10940    /// After calling `Close`, the client must not send any other requests.
10941    ///
10942    /// Servers, after sending the status response, should close the connection
10943    /// regardless of status and without sending an epitaph.
10944    ///
10945    /// Closing the client end of the channel should be semantically equivalent
10946    /// to calling `Close` without knowing when the close has completed or its
10947    /// status.
10948    pub fn r#close(
10949        &self,
10950    ) -> fidl::client::QueryResponseFut<
10951        fdomain_fuchsia_unknown::CloseableCloseResult,
10952        fdomain_client::fidl::FDomainResourceDialect,
10953    > {
10954        NodeProxyInterface::r#close(self)
10955    }
10956
10957    pub fn r#query(
10958        &self,
10959    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
10960        NodeProxyInterface::r#query(self)
10961    }
10962
10963    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
10964    pub fn r#deprecated_clone(
10965        &self,
10966        mut flags: OpenFlags,
10967        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
10968    ) -> Result<(), fidl::Error> {
10969        NodeProxyInterface::r#deprecated_clone(self, flags, object)
10970    }
10971
10972    /// DEPRECATED - Use `Node.GetAttributes` instead.
10973    pub fn r#deprecated_get_attr(
10974        &self,
10975    ) -> fidl::client::QueryResponseFut<
10976        (i32, NodeAttributes),
10977        fdomain_client::fidl::FDomainResourceDialect,
10978    > {
10979        NodeProxyInterface::r#deprecated_get_attr(self)
10980    }
10981
10982    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
10983    pub fn r#deprecated_set_attr(
10984        &self,
10985        mut flags: NodeAttributeFlags,
10986        mut attributes: &NodeAttributes,
10987    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
10988        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
10989    }
10990
10991    /// [DEPRECATED - Use new GetFlags method instead.]
10992    pub fn r#deprecated_get_flags(
10993        &self,
10994    ) -> fidl::client::QueryResponseFut<
10995        (i32, OpenFlags),
10996        fdomain_client::fidl::FDomainResourceDialect,
10997    > {
10998        NodeProxyInterface::r#deprecated_get_flags(self)
10999    }
11000
11001    /// [DEPRECATED - Use new SetFlags method instead.]
11002    pub fn r#deprecated_set_flags(
11003        &self,
11004        mut flags: OpenFlags,
11005    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
11006        NodeProxyInterface::r#deprecated_set_flags(self, flags)
11007    }
11008
11009    /// Queries the flags that apply to this node after it has been opened/created. This method does
11010    /// not require any rights.
11011    ///
11012    /// Note that the final set of flags that apply to the connection may differ from those
11013    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
11014    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
11015    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
11016    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
11017    pub fn r#get_flags(
11018        &self,
11019    ) -> fidl::client::QueryResponseFut<
11020        NodeGetFlagsResult,
11021        fdomain_client::fidl::FDomainResourceDialect,
11022    > {
11023        NodeProxyInterface::r#get_flags(self)
11024    }
11025
11026    /// Sets the flags that apply to this node after it has been opened. This method does not
11027    /// require any rights.
11028    ///
11029    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
11030    /// clear append mode.
11031    ///
11032    /// Errors:
11033    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
11034    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
11035    pub fn r#set_flags(
11036        &self,
11037        mut flags: Flags,
11038    ) -> fidl::client::QueryResponseFut<
11039        NodeSetFlagsResult,
11040        fdomain_client::fidl::FDomainResourceDialect,
11041    > {
11042        NodeProxyInterface::r#set_flags(self, flags)
11043    }
11044
11045    /// Query the filesystem for filesystem-specific information.
11046    pub fn r#query_filesystem(
11047        &self,
11048    ) -> fidl::client::QueryResponseFut<
11049        (i32, Option<Box<FilesystemInfo>>),
11050        fdomain_client::fidl::FDomainResourceDialect,
11051    > {
11052        NodeProxyInterface::r#query_filesystem(self)
11053    }
11054
11055    /// Acquires information about the node.
11056    ///
11057    /// The attributes of a node should be stable, independent of the
11058    /// specific protocol used to access it.
11059    ///
11060    /// If a particular attribute is not applicable or not supported,
11061    /// filesystems should leave the corresponding field absent.
11062    ///
11063    /// + `query` a bit-mask specifying which attributes to fetch. The server
11064    ///   should not return more than necessary.
11065    /// - `attributes` the returned attributes.
11066    ///
11067    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11068    pub fn r#get_attributes(
11069        &self,
11070        mut query: NodeAttributesQuery,
11071    ) -> fidl::client::QueryResponseFut<
11072        NodeGetAttributesResult,
11073        fdomain_client::fidl::FDomainResourceDialect,
11074    > {
11075        NodeProxyInterface::r#get_attributes(self, query)
11076    }
11077
11078    /// Updates information about the node.
11079    ///
11080    /// + `attributes` the presence of a table field in `attributes` indicates
11081    /// the intent to update the corresponding attribute.
11082    ///
11083    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
11084    ///
11085    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11086    pub fn r#update_attributes(
11087        &self,
11088        mut payload: &MutableNodeAttributes,
11089    ) -> fidl::client::QueryResponseFut<
11090        NodeUpdateAttributesResult,
11091        fdomain_client::fidl::FDomainResourceDialect,
11092    > {
11093        NodeProxyInterface::r#update_attributes(self, payload)
11094    }
11095
11096    /// Synchronizes updates to the node to the underlying media, if it exists.
11097    ///
11098    /// This method will return when the filesystem server has flushed the
11099    /// relevant updates to the underlying media, but does not guarantee the
11100    /// underlying media has persisted the information, nor that any information
11101    /// is committed to hardware. Clients may use `Sync` to ensure ordering
11102    /// between operations.
11103    ///
11104    /// This method does not require any rights.
11105    pub fn r#sync(
11106        &self,
11107    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
11108    {
11109        NodeProxyInterface::r#sync(self)
11110    }
11111
11112    /// Creates an iterator over all the extended attribute names associated
11113    /// with this node. If an error occurs it is returned as an epitaph on the
11114    /// iterator request channel, and then the channel is closed.
11115    ///
11116    /// GetExtendedAttributes can be used with any of these names to retrieve
11117    /// the associated value.
11118    ///
11119    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11120    pub fn r#list_extended_attributes(
11121        &self,
11122        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11123    ) -> Result<(), fidl::Error> {
11124        NodeProxyInterface::r#list_extended_attributes(self, iterator)
11125    }
11126
11127    /// Get the value associated with the given attribute `name` for this node.
11128    ///
11129    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
11130    /// particular structure is imposed on them.
11131    ///
11132    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
11133    pub fn r#get_extended_attribute(
11134        &self,
11135        mut name: &[u8],
11136    ) -> fidl::client::QueryResponseFut<
11137        NodeGetExtendedAttributeResult,
11138        fdomain_client::fidl::FDomainResourceDialect,
11139    > {
11140        NodeProxyInterface::r#get_extended_attribute(self, name)
11141    }
11142
11143    /// Set the value for the given attribute `name` to `value` for this node.
11144    ///
11145    /// The attribute name may exist, in which case the attribute is updated.
11146    /// If the attribute doesn't exist, it is created. The name should have no
11147    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
11148    ///
11149    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11150    pub fn r#set_extended_attribute(
11151        &self,
11152        mut name: &[u8],
11153        mut value: ExtendedAttributeValue,
11154        mut mode: SetExtendedAttributeMode,
11155    ) -> fidl::client::QueryResponseFut<
11156        NodeSetExtendedAttributeResult,
11157        fdomain_client::fidl::FDomainResourceDialect,
11158    > {
11159        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
11160    }
11161
11162    /// Remove the specified extended attribute.
11163    ///
11164    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
11165    ///
11166    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
11167    pub fn r#remove_extended_attribute(
11168        &self,
11169        mut name: &[u8],
11170    ) -> fidl::client::QueryResponseFut<
11171        NodeRemoveExtendedAttributeResult,
11172        fdomain_client::fidl::FDomainResourceDialect,
11173    > {
11174        NodeProxyInterface::r#remove_extended_attribute(self, name)
11175    }
11176}
11177
11178impl NodeProxyInterface for NodeProxy {
11179    fn r#clone(
11180        &self,
11181        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
11182    ) -> Result<(), fidl::Error> {
11183        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
11184            (request,),
11185            0x20d8a7aba2168a79,
11186            fidl::encoding::DynamicFlags::empty(),
11187        )
11188    }
11189
11190    type CloseResponseFut = fidl::client::QueryResponseFut<
11191        fdomain_fuchsia_unknown::CloseableCloseResult,
11192        fdomain_client::fidl::FDomainResourceDialect,
11193    >;
11194    fn r#close(&self) -> Self::CloseResponseFut {
11195        fn _decode(
11196            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11197        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
11198            let _response = fidl::client::decode_transaction_body::<
11199                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11200                fdomain_client::fidl::FDomainResourceDialect,
11201                0x5ac5d459ad7f657e,
11202            >(_buf?)?;
11203            Ok(_response.map(|x| x))
11204        }
11205        self.client.send_query_and_decode::<
11206            fidl::encoding::EmptyPayload,
11207            fdomain_fuchsia_unknown::CloseableCloseResult,
11208        >(
11209            (),
11210            0x5ac5d459ad7f657e,
11211            fidl::encoding::DynamicFlags::empty(),
11212            _decode,
11213        )
11214    }
11215
11216    type QueryResponseFut =
11217        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
11218    fn r#query(&self) -> Self::QueryResponseFut {
11219        fn _decode(
11220            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11221        ) -> Result<Vec<u8>, fidl::Error> {
11222            let _response = fidl::client::decode_transaction_body::<
11223                fdomain_fuchsia_unknown::QueryableQueryResponse,
11224                fdomain_client::fidl::FDomainResourceDialect,
11225                0x2658edee9decfc06,
11226            >(_buf?)?;
11227            Ok(_response.protocol)
11228        }
11229        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
11230            (),
11231            0x2658edee9decfc06,
11232            fidl::encoding::DynamicFlags::empty(),
11233            _decode,
11234        )
11235    }
11236
11237    fn r#deprecated_clone(
11238        &self,
11239        mut flags: OpenFlags,
11240        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
11241    ) -> Result<(), fidl::Error> {
11242        self.client.send::<NodeDeprecatedCloneRequest>(
11243            (flags, object),
11244            0x5a61678f293ce16f,
11245            fidl::encoding::DynamicFlags::FLEXIBLE,
11246        )
11247    }
11248
11249    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
11250        (i32, NodeAttributes),
11251        fdomain_client::fidl::FDomainResourceDialect,
11252    >;
11253    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
11254        fn _decode(
11255            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11256        ) -> Result<(i32, NodeAttributes), fidl::Error> {
11257            let _response = fidl::client::decode_transaction_body::<
11258                NodeDeprecatedGetAttrResponse,
11259                fdomain_client::fidl::FDomainResourceDialect,
11260                0x78985e216314dafd,
11261            >(_buf?)?;
11262            Ok((_response.s, _response.attributes))
11263        }
11264        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
11265            (),
11266            0x78985e216314dafd,
11267            fidl::encoding::DynamicFlags::empty(),
11268            _decode,
11269        )
11270    }
11271
11272    type DeprecatedSetAttrResponseFut =
11273        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11274    fn r#deprecated_set_attr(
11275        &self,
11276        mut flags: NodeAttributeFlags,
11277        mut attributes: &NodeAttributes,
11278    ) -> Self::DeprecatedSetAttrResponseFut {
11279        fn _decode(
11280            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11281        ) -> Result<i32, fidl::Error> {
11282            let _response = fidl::client::decode_transaction_body::<
11283                NodeDeprecatedSetAttrResponse,
11284                fdomain_client::fidl::FDomainResourceDialect,
11285                0x4186c0f40d938f46,
11286            >(_buf?)?;
11287            Ok(_response.s)
11288        }
11289        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
11290            (flags, attributes),
11291            0x4186c0f40d938f46,
11292            fidl::encoding::DynamicFlags::empty(),
11293            _decode,
11294        )
11295    }
11296
11297    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
11298        (i32, OpenFlags),
11299        fdomain_client::fidl::FDomainResourceDialect,
11300    >;
11301    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
11302        fn _decode(
11303            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11304        ) -> Result<(i32, OpenFlags), fidl::Error> {
11305            let _response = fidl::client::decode_transaction_body::<
11306                NodeDeprecatedGetFlagsResponse,
11307                fdomain_client::fidl::FDomainResourceDialect,
11308                0x5b88fffb8eda3aa1,
11309            >(_buf?)?;
11310            Ok((_response.s, _response.flags))
11311        }
11312        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
11313            (),
11314            0x5b88fffb8eda3aa1,
11315            fidl::encoding::DynamicFlags::empty(),
11316            _decode,
11317        )
11318    }
11319
11320    type DeprecatedSetFlagsResponseFut =
11321        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
11322    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
11323        fn _decode(
11324            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11325        ) -> Result<i32, fidl::Error> {
11326            let _response = fidl::client::decode_transaction_body::<
11327                NodeDeprecatedSetFlagsResponse,
11328                fdomain_client::fidl::FDomainResourceDialect,
11329                0x5295b76c71fde733,
11330            >(_buf?)?;
11331            Ok(_response.s)
11332        }
11333        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
11334            (flags,),
11335            0x5295b76c71fde733,
11336            fidl::encoding::DynamicFlags::empty(),
11337            _decode,
11338        )
11339    }
11340
11341    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
11342        NodeGetFlagsResult,
11343        fdomain_client::fidl::FDomainResourceDialect,
11344    >;
11345    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
11346        fn _decode(
11347            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11348        ) -> Result<NodeGetFlagsResult, fidl::Error> {
11349            let _response = fidl::client::decode_transaction_body::<
11350                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
11351                fdomain_client::fidl::FDomainResourceDialect,
11352                0x176eb318f64ec23,
11353            >(_buf?)?
11354            .into_result_fdomain::<NodeMarker>("get_flags")?;
11355            Ok(_response.map(|x| x.flags))
11356        }
11357        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
11358            (),
11359            0x176eb318f64ec23,
11360            fidl::encoding::DynamicFlags::FLEXIBLE,
11361            _decode,
11362        )
11363    }
11364
11365    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
11366        NodeSetFlagsResult,
11367        fdomain_client::fidl::FDomainResourceDialect,
11368    >;
11369    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
11370        fn _decode(
11371            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11372        ) -> Result<NodeSetFlagsResult, fidl::Error> {
11373            let _response = fidl::client::decode_transaction_body::<
11374                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
11375                fdomain_client::fidl::FDomainResourceDialect,
11376                0x55a8028685791ea8,
11377            >(_buf?)?
11378            .into_result_fdomain::<NodeMarker>("set_flags")?;
11379            Ok(_response.map(|x| x))
11380        }
11381        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
11382            (flags,),
11383            0x55a8028685791ea8,
11384            fidl::encoding::DynamicFlags::FLEXIBLE,
11385            _decode,
11386        )
11387    }
11388
11389    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
11390        (i32, Option<Box<FilesystemInfo>>),
11391        fdomain_client::fidl::FDomainResourceDialect,
11392    >;
11393    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
11394        fn _decode(
11395            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11396        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
11397            let _response = fidl::client::decode_transaction_body::<
11398                NodeQueryFilesystemResponse,
11399                fdomain_client::fidl::FDomainResourceDialect,
11400                0x6f344a1c6b0a0610,
11401            >(_buf?)?;
11402            Ok((_response.s, _response.info))
11403        }
11404        self.client.send_query_and_decode::<
11405            fidl::encoding::EmptyPayload,
11406            (i32, Option<Box<FilesystemInfo>>),
11407        >(
11408            (),
11409            0x6f344a1c6b0a0610,
11410            fidl::encoding::DynamicFlags::empty(),
11411            _decode,
11412        )
11413    }
11414
11415    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
11416        NodeGetAttributesResult,
11417        fdomain_client::fidl::FDomainResourceDialect,
11418    >;
11419    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
11420        fn _decode(
11421            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11422        ) -> Result<NodeGetAttributesResult, fidl::Error> {
11423            let _response = fidl::client::decode_transaction_body::<
11424                fidl::encoding::ResultType<NodeAttributes2, i32>,
11425                fdomain_client::fidl::FDomainResourceDialect,
11426                0x3d4396a638ea053b,
11427            >(_buf?)?;
11428            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
11429        }
11430        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
11431            (query,),
11432            0x3d4396a638ea053b,
11433            fidl::encoding::DynamicFlags::empty(),
11434            _decode,
11435        )
11436    }
11437
11438    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
11439        NodeUpdateAttributesResult,
11440        fdomain_client::fidl::FDomainResourceDialect,
11441    >;
11442    fn r#update_attributes(
11443        &self,
11444        mut payload: &MutableNodeAttributes,
11445    ) -> Self::UpdateAttributesResponseFut {
11446        fn _decode(
11447            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11448        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
11449            let _response = fidl::client::decode_transaction_body::<
11450                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11451                fdomain_client::fidl::FDomainResourceDialect,
11452                0x3308c1da5a89bf08,
11453            >(_buf?)?;
11454            Ok(_response.map(|x| x))
11455        }
11456        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
11457            payload,
11458            0x3308c1da5a89bf08,
11459            fidl::encoding::DynamicFlags::empty(),
11460            _decode,
11461        )
11462    }
11463
11464    type SyncResponseFut = fidl::client::QueryResponseFut<
11465        NodeSyncResult,
11466        fdomain_client::fidl::FDomainResourceDialect,
11467    >;
11468    fn r#sync(&self) -> Self::SyncResponseFut {
11469        fn _decode(
11470            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11471        ) -> Result<NodeSyncResult, fidl::Error> {
11472            let _response = fidl::client::decode_transaction_body::<
11473                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11474                fdomain_client::fidl::FDomainResourceDialect,
11475                0x2c5c27ca0ab5dc49,
11476            >(_buf?)?;
11477            Ok(_response.map(|x| x))
11478        }
11479        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
11480            (),
11481            0x2c5c27ca0ab5dc49,
11482            fidl::encoding::DynamicFlags::empty(),
11483            _decode,
11484        )
11485    }
11486
11487    fn r#list_extended_attributes(
11488        &self,
11489        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
11490    ) -> Result<(), fidl::Error> {
11491        self.client.send::<NodeListExtendedAttributesRequest>(
11492            (iterator,),
11493            0x4b61033de007fcd0,
11494            fidl::encoding::DynamicFlags::empty(),
11495        )
11496    }
11497
11498    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11499        NodeGetExtendedAttributeResult,
11500        fdomain_client::fidl::FDomainResourceDialect,
11501    >;
11502    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
11503        fn _decode(
11504            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11505        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
11506            let _response = fidl::client::decode_transaction_body::<
11507                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
11508                fdomain_client::fidl::FDomainResourceDialect,
11509                0x45ffa3ccfdeb76db,
11510            >(_buf?)?;
11511            Ok(_response.map(|x| x))
11512        }
11513        self.client.send_query_and_decode::<
11514            NodeGetExtendedAttributeRequest,
11515            NodeGetExtendedAttributeResult,
11516        >(
11517            (name,),
11518            0x45ffa3ccfdeb76db,
11519            fidl::encoding::DynamicFlags::empty(),
11520            _decode,
11521        )
11522    }
11523
11524    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11525        NodeSetExtendedAttributeResult,
11526        fdomain_client::fidl::FDomainResourceDialect,
11527    >;
11528    fn r#set_extended_attribute(
11529        &self,
11530        mut name: &[u8],
11531        mut value: ExtendedAttributeValue,
11532        mut mode: SetExtendedAttributeMode,
11533    ) -> Self::SetExtendedAttributeResponseFut {
11534        fn _decode(
11535            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11536        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
11537            let _response = fidl::client::decode_transaction_body::<
11538                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11539                fdomain_client::fidl::FDomainResourceDialect,
11540                0x4a951362f681f23c,
11541            >(_buf?)?;
11542            Ok(_response.map(|x| x))
11543        }
11544        self.client.send_query_and_decode::<
11545            NodeSetExtendedAttributeRequest,
11546            NodeSetExtendedAttributeResult,
11547        >(
11548            (name, &mut value, mode,),
11549            0x4a951362f681f23c,
11550            fidl::encoding::DynamicFlags::empty(),
11551            _decode,
11552        )
11553    }
11554
11555    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
11556        NodeRemoveExtendedAttributeResult,
11557        fdomain_client::fidl::FDomainResourceDialect,
11558    >;
11559    fn r#remove_extended_attribute(
11560        &self,
11561        mut name: &[u8],
11562    ) -> Self::RemoveExtendedAttributeResponseFut {
11563        fn _decode(
11564            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11565        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
11566            let _response = fidl::client::decode_transaction_body::<
11567                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
11568                fdomain_client::fidl::FDomainResourceDialect,
11569                0x7a0b9f3a9bf9032d,
11570            >(_buf?)?;
11571            Ok(_response.map(|x| x))
11572        }
11573        self.client.send_query_and_decode::<
11574            NodeRemoveExtendedAttributeRequest,
11575            NodeRemoveExtendedAttributeResult,
11576        >(
11577            (name,),
11578            0x7a0b9f3a9bf9032d,
11579            fidl::encoding::DynamicFlags::empty(),
11580            _decode,
11581        )
11582    }
11583}
11584
11585pub struct NodeEventStream {
11586    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
11587}
11588
11589impl std::marker::Unpin for NodeEventStream {}
11590
11591impl futures::stream::FusedStream for NodeEventStream {
11592    fn is_terminated(&self) -> bool {
11593        self.event_receiver.is_terminated()
11594    }
11595}
11596
11597impl futures::Stream for NodeEventStream {
11598    type Item = Result<NodeEvent, fidl::Error>;
11599
11600    fn poll_next(
11601        mut self: std::pin::Pin<&mut Self>,
11602        cx: &mut std::task::Context<'_>,
11603    ) -> std::task::Poll<Option<Self::Item>> {
11604        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11605            &mut self.event_receiver,
11606            cx
11607        )?) {
11608            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
11609            None => std::task::Poll::Ready(None),
11610        }
11611    }
11612}
11613
11614#[derive(Debug)]
11615pub enum NodeEvent {
11616    OnOpen_ {
11617        s: i32,
11618        info: Option<Box<NodeInfoDeprecated>>,
11619    },
11620    OnRepresentation {
11621        payload: Representation,
11622    },
11623    #[non_exhaustive]
11624    _UnknownEvent {
11625        /// Ordinal of the event that was sent.
11626        ordinal: u64,
11627    },
11628}
11629
11630impl NodeEvent {
11631    #[allow(irrefutable_let_patterns)]
11632    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
11633        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
11634    }
11635    #[allow(irrefutable_let_patterns)]
11636    pub fn into_on_representation(self) -> Option<Representation> {
11637        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
11638    }
11639
11640    /// Decodes a message buffer as a [`NodeEvent`].
11641    fn decode(
11642        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11643    ) -> Result<NodeEvent, fidl::Error> {
11644        let (bytes, _handles) = buf.split_mut();
11645        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11646        debug_assert_eq!(tx_header.tx_id, 0);
11647        match tx_header.ordinal {
11648            0x7fc7bbb1dbfd1972 => {
11649                let mut out = fidl::new_empty!(
11650                    NodeOnOpenRequest,
11651                    fdomain_client::fidl::FDomainResourceDialect
11652                );
11653                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
11654                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
11655            }
11656            0x5cb40567d80a510c => {
11657                let mut out =
11658                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
11659                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
11660                Ok((NodeEvent::OnRepresentation { payload: out }))
11661            }
11662            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11663                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11664            }
11665            _ => Err(fidl::Error::UnknownOrdinal {
11666                ordinal: tx_header.ordinal,
11667                protocol_name: <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
11668            }),
11669        }
11670    }
11671}
11672
11673/// A Stream of incoming requests for fuchsia.io/Node.
11674pub struct NodeRequestStream {
11675    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11676    is_terminated: bool,
11677}
11678
11679impl std::marker::Unpin for NodeRequestStream {}
11680
11681impl futures::stream::FusedStream for NodeRequestStream {
11682    fn is_terminated(&self) -> bool {
11683        self.is_terminated
11684    }
11685}
11686
11687impl fdomain_client::fidl::RequestStream for NodeRequestStream {
11688    type Protocol = NodeMarker;
11689    type ControlHandle = NodeControlHandle;
11690
11691    fn from_channel(channel: fdomain_client::Channel) -> Self {
11692        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11693    }
11694
11695    fn control_handle(&self) -> Self::ControlHandle {
11696        NodeControlHandle { inner: self.inner.clone() }
11697    }
11698
11699    fn into_inner(
11700        self,
11701    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
11702    {
11703        (self.inner, self.is_terminated)
11704    }
11705
11706    fn from_inner(
11707        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
11708        is_terminated: bool,
11709    ) -> Self {
11710        Self { inner, is_terminated }
11711    }
11712}
11713
11714impl futures::Stream for NodeRequestStream {
11715    type Item = Result<NodeRequest, fidl::Error>;
11716
11717    fn poll_next(
11718        mut self: std::pin::Pin<&mut Self>,
11719        cx: &mut std::task::Context<'_>,
11720    ) -> std::task::Poll<Option<Self::Item>> {
11721        let this = &mut *self;
11722        if this.inner.check_shutdown(cx) {
11723            this.is_terminated = true;
11724            return std::task::Poll::Ready(None);
11725        }
11726        if this.is_terminated {
11727            panic!("polled NodeRequestStream after completion");
11728        }
11729        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
11730            |bytes, handles| {
11731                match this.inner.channel().read_etc(cx, bytes, handles) {
11732                    std::task::Poll::Ready(Ok(())) => {}
11733                    std::task::Poll::Pending => return std::task::Poll::Pending,
11734                    std::task::Poll::Ready(Err(None)) => {
11735                        this.is_terminated = true;
11736                        return std::task::Poll::Ready(None);
11737                    }
11738                    std::task::Poll::Ready(Err(Some(e))) => {
11739                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11740                            e.into(),
11741                        ))));
11742                    }
11743                }
11744
11745                // A message has been received from the channel
11746                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11747
11748                std::task::Poll::Ready(Some(match header.ordinal {
11749                    0x20d8a7aba2168a79 => {
11750                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11751                        let mut req = fidl::new_empty!(
11752                            fdomain_fuchsia_unknown::CloneableCloneRequest,
11753                            fdomain_client::fidl::FDomainResourceDialect
11754                        );
11755                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11756                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11757                        Ok(NodeRequest::Clone { request: req.request, control_handle })
11758                    }
11759                    0x5ac5d459ad7f657e => {
11760                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11761                        let mut req = fidl::new_empty!(
11762                            fidl::encoding::EmptyPayload,
11763                            fdomain_client::fidl::FDomainResourceDialect
11764                        );
11765                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11766                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11767                        Ok(NodeRequest::Close {
11768                            responder: NodeCloseResponder {
11769                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11770                                tx_id: header.tx_id,
11771                            },
11772                        })
11773                    }
11774                    0x2658edee9decfc06 => {
11775                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11776                        let mut req = fidl::new_empty!(
11777                            fidl::encoding::EmptyPayload,
11778                            fdomain_client::fidl::FDomainResourceDialect
11779                        );
11780                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11781                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11782                        Ok(NodeRequest::Query {
11783                            responder: NodeQueryResponder {
11784                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11785                                tx_id: header.tx_id,
11786                            },
11787                        })
11788                    }
11789                    0x5a61678f293ce16f => {
11790                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11791                        let mut req = fidl::new_empty!(
11792                            NodeDeprecatedCloneRequest,
11793                            fdomain_client::fidl::FDomainResourceDialect
11794                        );
11795                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11796                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11797                        Ok(NodeRequest::DeprecatedClone {
11798                            flags: req.flags,
11799                            object: req.object,
11800
11801                            control_handle,
11802                        })
11803                    }
11804                    0x78985e216314dafd => {
11805                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11806                        let mut req = fidl::new_empty!(
11807                            fidl::encoding::EmptyPayload,
11808                            fdomain_client::fidl::FDomainResourceDialect
11809                        );
11810                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11811                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11812                        Ok(NodeRequest::DeprecatedGetAttr {
11813                            responder: NodeDeprecatedGetAttrResponder {
11814                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11815                                tx_id: header.tx_id,
11816                            },
11817                        })
11818                    }
11819                    0x4186c0f40d938f46 => {
11820                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11821                        let mut req = fidl::new_empty!(
11822                            NodeDeprecatedSetAttrRequest,
11823                            fdomain_client::fidl::FDomainResourceDialect
11824                        );
11825                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
11826                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11827                        Ok(NodeRequest::DeprecatedSetAttr {
11828                            flags: req.flags,
11829                            attributes: req.attributes,
11830
11831                            responder: NodeDeprecatedSetAttrResponder {
11832                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11833                                tx_id: header.tx_id,
11834                            },
11835                        })
11836                    }
11837                    0x5b88fffb8eda3aa1 => {
11838                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11839                        let mut req = fidl::new_empty!(
11840                            fidl::encoding::EmptyPayload,
11841                            fdomain_client::fidl::FDomainResourceDialect
11842                        );
11843                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11844                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11845                        Ok(NodeRequest::DeprecatedGetFlags {
11846                            responder: NodeDeprecatedGetFlagsResponder {
11847                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11848                                tx_id: header.tx_id,
11849                            },
11850                        })
11851                    }
11852                    0x5295b76c71fde733 => {
11853                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11854                        let mut req = fidl::new_empty!(
11855                            NodeDeprecatedSetFlagsRequest,
11856                            fdomain_client::fidl::FDomainResourceDialect
11857                        );
11858                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11859                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11860                        Ok(NodeRequest::DeprecatedSetFlags {
11861                            flags: req.flags,
11862
11863                            responder: NodeDeprecatedSetFlagsResponder {
11864                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11865                                tx_id: header.tx_id,
11866                            },
11867                        })
11868                    }
11869                    0x176eb318f64ec23 => {
11870                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11871                        let mut req = fidl::new_empty!(
11872                            fidl::encoding::EmptyPayload,
11873                            fdomain_client::fidl::FDomainResourceDialect
11874                        );
11875                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11876                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11877                        Ok(NodeRequest::GetFlags {
11878                            responder: NodeGetFlagsResponder {
11879                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11880                                tx_id: header.tx_id,
11881                            },
11882                        })
11883                    }
11884                    0x55a8028685791ea8 => {
11885                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11886                        let mut req = fidl::new_empty!(
11887                            NodeSetFlagsRequest,
11888                            fdomain_client::fidl::FDomainResourceDialect
11889                        );
11890                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
11891                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11892                        Ok(NodeRequest::SetFlags {
11893                            flags: req.flags,
11894
11895                            responder: NodeSetFlagsResponder {
11896                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11897                                tx_id: header.tx_id,
11898                            },
11899                        })
11900                    }
11901                    0x6f344a1c6b0a0610 => {
11902                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11903                        let mut req = fidl::new_empty!(
11904                            fidl::encoding::EmptyPayload,
11905                            fdomain_client::fidl::FDomainResourceDialect
11906                        );
11907                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11908                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11909                        Ok(NodeRequest::QueryFilesystem {
11910                            responder: NodeQueryFilesystemResponder {
11911                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11912                                tx_id: header.tx_id,
11913                            },
11914                        })
11915                    }
11916                    0x3d4396a638ea053b => {
11917                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11918                        let mut req = fidl::new_empty!(
11919                            NodeGetAttributesRequest,
11920                            fdomain_client::fidl::FDomainResourceDialect
11921                        );
11922                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11923                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11924                        Ok(NodeRequest::GetAttributes {
11925                            query: req.query,
11926
11927                            responder: NodeGetAttributesResponder {
11928                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11929                                tx_id: header.tx_id,
11930                            },
11931                        })
11932                    }
11933                    0x3308c1da5a89bf08 => {
11934                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11935                        let mut req = fidl::new_empty!(
11936                            MutableNodeAttributes,
11937                            fdomain_client::fidl::FDomainResourceDialect
11938                        );
11939                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
11940                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11941                        Ok(NodeRequest::UpdateAttributes {
11942                            payload: req,
11943                            responder: NodeUpdateAttributesResponder {
11944                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11945                                tx_id: header.tx_id,
11946                            },
11947                        })
11948                    }
11949                    0x2c5c27ca0ab5dc49 => {
11950                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11951                        let mut req = fidl::new_empty!(
11952                            fidl::encoding::EmptyPayload,
11953                            fdomain_client::fidl::FDomainResourceDialect
11954                        );
11955                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
11956                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11957                        Ok(NodeRequest::Sync {
11958                            responder: NodeSyncResponder {
11959                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11960                                tx_id: header.tx_id,
11961                            },
11962                        })
11963                    }
11964                    0x4b61033de007fcd0 => {
11965                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11966                        let mut req = fidl::new_empty!(
11967                            NodeListExtendedAttributesRequest,
11968                            fdomain_client::fidl::FDomainResourceDialect
11969                        );
11970                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
11971                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11972                        Ok(NodeRequest::ListExtendedAttributes {
11973                            iterator: req.iterator,
11974
11975                            control_handle,
11976                        })
11977                    }
11978                    0x45ffa3ccfdeb76db => {
11979                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11980                        let mut req = fidl::new_empty!(
11981                            NodeGetExtendedAttributeRequest,
11982                            fdomain_client::fidl::FDomainResourceDialect
11983                        );
11984                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
11985                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
11986                        Ok(NodeRequest::GetExtendedAttribute {
11987                            name: req.name,
11988
11989                            responder: NodeGetExtendedAttributeResponder {
11990                                control_handle: std::mem::ManuallyDrop::new(control_handle),
11991                                tx_id: header.tx_id,
11992                            },
11993                        })
11994                    }
11995                    0x4a951362f681f23c => {
11996                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11997                        let mut req = fidl::new_empty!(
11998                            NodeSetExtendedAttributeRequest,
11999                            fdomain_client::fidl::FDomainResourceDialect
12000                        );
12001                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12002                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12003                        Ok(NodeRequest::SetExtendedAttribute {
12004                            name: req.name,
12005                            value: req.value,
12006                            mode: req.mode,
12007
12008                            responder: NodeSetExtendedAttributeResponder {
12009                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12010                                tx_id: header.tx_id,
12011                            },
12012                        })
12013                    }
12014                    0x7a0b9f3a9bf9032d => {
12015                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12016                        let mut req = fidl::new_empty!(
12017                            NodeRemoveExtendedAttributeRequest,
12018                            fdomain_client::fidl::FDomainResourceDialect
12019                        );
12020                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
12021                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
12022                        Ok(NodeRequest::RemoveExtendedAttribute {
12023                            name: req.name,
12024
12025                            responder: NodeRemoveExtendedAttributeResponder {
12026                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12027                                tx_id: header.tx_id,
12028                            },
12029                        })
12030                    }
12031                    _ if header.tx_id == 0
12032                        && header
12033                            .dynamic_flags()
12034                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12035                    {
12036                        Ok(NodeRequest::_UnknownMethod {
12037                            ordinal: header.ordinal,
12038                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12039                            method_type: fidl::MethodType::OneWay,
12040                        })
12041                    }
12042                    _ if header
12043                        .dynamic_flags()
12044                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12045                    {
12046                        this.inner.send_framework_err(
12047                            fidl::encoding::FrameworkErr::UnknownMethod,
12048                            header.tx_id,
12049                            header.ordinal,
12050                            header.dynamic_flags(),
12051                            (bytes, handles),
12052                        )?;
12053                        Ok(NodeRequest::_UnknownMethod {
12054                            ordinal: header.ordinal,
12055                            control_handle: NodeControlHandle { inner: this.inner.clone() },
12056                            method_type: fidl::MethodType::TwoWay,
12057                        })
12058                    }
12059                    _ => Err(fidl::Error::UnknownOrdinal {
12060                        ordinal: header.ordinal,
12061                        protocol_name:
12062                            <NodeMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
12063                    }),
12064                }))
12065            },
12066        )
12067    }
12068}
12069
12070/// Node defines the minimal interface for entities which can be accessed in a filesystem.
12071#[derive(Debug)]
12072pub enum NodeRequest {
12073    Clone {
12074        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12075        control_handle: NodeControlHandle,
12076    },
12077    /// Terminates the connection.
12078    ///
12079    /// After calling `Close`, the client must not send any other requests.
12080    ///
12081    /// Servers, after sending the status response, should close the connection
12082    /// regardless of status and without sending an epitaph.
12083    ///
12084    /// Closing the client end of the channel should be semantically equivalent
12085    /// to calling `Close` without knowing when the close has completed or its
12086    /// status.
12087    Close {
12088        responder: NodeCloseResponder,
12089    },
12090    Query {
12091        responder: NodeQueryResponder,
12092    },
12093    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
12094    DeprecatedClone {
12095        flags: OpenFlags,
12096        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
12097        control_handle: NodeControlHandle,
12098    },
12099    /// DEPRECATED - Use `Node.GetAttributes` instead.
12100    DeprecatedGetAttr {
12101        responder: NodeDeprecatedGetAttrResponder,
12102    },
12103    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
12104    DeprecatedSetAttr {
12105        flags: NodeAttributeFlags,
12106        attributes: NodeAttributes,
12107        responder: NodeDeprecatedSetAttrResponder,
12108    },
12109    /// [DEPRECATED - Use new GetFlags method instead.]
12110    DeprecatedGetFlags {
12111        responder: NodeDeprecatedGetFlagsResponder,
12112    },
12113    /// [DEPRECATED - Use new SetFlags method instead.]
12114    DeprecatedSetFlags {
12115        flags: OpenFlags,
12116        responder: NodeDeprecatedSetFlagsResponder,
12117    },
12118    /// Queries the flags that apply to this node after it has been opened/created. This method does
12119    /// not require any rights.
12120    ///
12121    /// Note that the final set of flags that apply to the connection may differ from those
12122    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
12123    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
12124    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
12125    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
12126    GetFlags {
12127        responder: NodeGetFlagsResponder,
12128    },
12129    /// Sets the flags that apply to this node after it has been opened. This method does not
12130    /// require any rights.
12131    ///
12132    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
12133    /// clear append mode.
12134    ///
12135    /// Errors:
12136    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
12137    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
12138    SetFlags {
12139        flags: Flags,
12140        responder: NodeSetFlagsResponder,
12141    },
12142    /// Query the filesystem for filesystem-specific information.
12143    QueryFilesystem {
12144        responder: NodeQueryFilesystemResponder,
12145    },
12146    /// Acquires information about the node.
12147    ///
12148    /// The attributes of a node should be stable, independent of the
12149    /// specific protocol used to access it.
12150    ///
12151    /// If a particular attribute is not applicable or not supported,
12152    /// filesystems should leave the corresponding field absent.
12153    ///
12154    /// + `query` a bit-mask specifying which attributes to fetch. The server
12155    ///   should not return more than necessary.
12156    /// - `attributes` the returned attributes.
12157    ///
12158    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12159    GetAttributes {
12160        query: NodeAttributesQuery,
12161        responder: NodeGetAttributesResponder,
12162    },
12163    /// Updates information about the node.
12164    ///
12165    /// + `attributes` the presence of a table field in `attributes` indicates
12166    /// the intent to update the corresponding attribute.
12167    ///
12168    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
12169    ///
12170    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12171    UpdateAttributes {
12172        payload: MutableNodeAttributes,
12173        responder: NodeUpdateAttributesResponder,
12174    },
12175    /// Synchronizes updates to the node to the underlying media, if it exists.
12176    ///
12177    /// This method will return when the filesystem server has flushed the
12178    /// relevant updates to the underlying media, but does not guarantee the
12179    /// underlying media has persisted the information, nor that any information
12180    /// is committed to hardware. Clients may use `Sync` to ensure ordering
12181    /// between operations.
12182    ///
12183    /// This method does not require any rights.
12184    Sync {
12185        responder: NodeSyncResponder,
12186    },
12187    /// Creates an iterator over all the extended attribute names associated
12188    /// with this node. If an error occurs it is returned as an epitaph on the
12189    /// iterator request channel, and then the channel is closed.
12190    ///
12191    /// GetExtendedAttributes can be used with any of these names to retrieve
12192    /// the associated value.
12193    ///
12194    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12195    ListExtendedAttributes {
12196        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
12197        control_handle: NodeControlHandle,
12198    },
12199    /// Get the value associated with the given attribute `name` for this node.
12200    ///
12201    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
12202    /// particular structure is imposed on them.
12203    ///
12204    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
12205    GetExtendedAttribute {
12206        name: Vec<u8>,
12207        responder: NodeGetExtendedAttributeResponder,
12208    },
12209    /// Set the value for the given attribute `name` to `value` for this node.
12210    ///
12211    /// The attribute name may exist, in which case the attribute is updated.
12212    /// If the attribute doesn't exist, it is created. The name should have no
12213    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
12214    ///
12215    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12216    SetExtendedAttribute {
12217        name: Vec<u8>,
12218        value: ExtendedAttributeValue,
12219        mode: SetExtendedAttributeMode,
12220        responder: NodeSetExtendedAttributeResponder,
12221    },
12222    /// Remove the specified extended attribute.
12223    ///
12224    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
12225    ///
12226    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
12227    RemoveExtendedAttribute {
12228        name: Vec<u8>,
12229        responder: NodeRemoveExtendedAttributeResponder,
12230    },
12231    /// An interaction was received which does not match any known method.
12232    #[non_exhaustive]
12233    _UnknownMethod {
12234        /// Ordinal of the method that was called.
12235        ordinal: u64,
12236        control_handle: NodeControlHandle,
12237        method_type: fidl::MethodType,
12238    },
12239}
12240
12241impl NodeRequest {
12242    #[allow(irrefutable_let_patterns)]
12243    pub fn into_clone(
12244        self,
12245    ) -> Option<(
12246        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
12247        NodeControlHandle,
12248    )> {
12249        if let NodeRequest::Clone { request, control_handle } = self {
12250            Some((request, control_handle))
12251        } else {
12252            None
12253        }
12254    }
12255
12256    #[allow(irrefutable_let_patterns)]
12257    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
12258        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
12259    }
12260
12261    #[allow(irrefutable_let_patterns)]
12262    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
12263        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
12264    }
12265
12266    #[allow(irrefutable_let_patterns)]
12267    pub fn into_deprecated_clone(
12268        self,
12269    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, NodeControlHandle)> {
12270        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
12271            Some((flags, object, control_handle))
12272        } else {
12273            None
12274        }
12275    }
12276
12277    #[allow(irrefutable_let_patterns)]
12278    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
12279        if let NodeRequest::DeprecatedGetAttr { responder } = self {
12280            Some((responder))
12281        } else {
12282            None
12283        }
12284    }
12285
12286    #[allow(irrefutable_let_patterns)]
12287    pub fn into_deprecated_set_attr(
12288        self,
12289    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
12290        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
12291            Some((flags, attributes, responder))
12292        } else {
12293            None
12294        }
12295    }
12296
12297    #[allow(irrefutable_let_patterns)]
12298    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
12299        if let NodeRequest::DeprecatedGetFlags { responder } = self {
12300            Some((responder))
12301        } else {
12302            None
12303        }
12304    }
12305
12306    #[allow(irrefutable_let_patterns)]
12307    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
12308        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
12309            Some((flags, responder))
12310        } else {
12311            None
12312        }
12313    }
12314
12315    #[allow(irrefutable_let_patterns)]
12316    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
12317        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
12318    }
12319
12320    #[allow(irrefutable_let_patterns)]
12321    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
12322        if let NodeRequest::SetFlags { flags, responder } = self {
12323            Some((flags, responder))
12324        } else {
12325            None
12326        }
12327    }
12328
12329    #[allow(irrefutable_let_patterns)]
12330    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
12331        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
12332    }
12333
12334    #[allow(irrefutable_let_patterns)]
12335    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
12336        if let NodeRequest::GetAttributes { query, responder } = self {
12337            Some((query, responder))
12338        } else {
12339            None
12340        }
12341    }
12342
12343    #[allow(irrefutable_let_patterns)]
12344    pub fn into_update_attributes(
12345        self,
12346    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
12347        if let NodeRequest::UpdateAttributes { payload, responder } = self {
12348            Some((payload, responder))
12349        } else {
12350            None
12351        }
12352    }
12353
12354    #[allow(irrefutable_let_patterns)]
12355    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
12356        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
12357    }
12358
12359    #[allow(irrefutable_let_patterns)]
12360    pub fn into_list_extended_attributes(
12361        self,
12362    ) -> Option<(fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
12363    {
12364        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
12365            Some((iterator, control_handle))
12366        } else {
12367            None
12368        }
12369    }
12370
12371    #[allow(irrefutable_let_patterns)]
12372    pub fn into_get_extended_attribute(
12373        self,
12374    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
12375        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
12376            Some((name, responder))
12377        } else {
12378            None
12379        }
12380    }
12381
12382    #[allow(irrefutable_let_patterns)]
12383    pub fn into_set_extended_attribute(
12384        self,
12385    ) -> Option<(
12386        Vec<u8>,
12387        ExtendedAttributeValue,
12388        SetExtendedAttributeMode,
12389        NodeSetExtendedAttributeResponder,
12390    )> {
12391        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
12392            Some((name, value, mode, responder))
12393        } else {
12394            None
12395        }
12396    }
12397
12398    #[allow(irrefutable_let_patterns)]
12399    pub fn into_remove_extended_attribute(
12400        self,
12401    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
12402        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
12403            Some((name, responder))
12404        } else {
12405            None
12406        }
12407    }
12408
12409    /// Name of the method defined in FIDL
12410    pub fn method_name(&self) -> &'static str {
12411        match *self {
12412            NodeRequest::Clone { .. } => "clone",
12413            NodeRequest::Close { .. } => "close",
12414            NodeRequest::Query { .. } => "query",
12415            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
12416            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
12417            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
12418            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
12419            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
12420            NodeRequest::GetFlags { .. } => "get_flags",
12421            NodeRequest::SetFlags { .. } => "set_flags",
12422            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
12423            NodeRequest::GetAttributes { .. } => "get_attributes",
12424            NodeRequest::UpdateAttributes { .. } => "update_attributes",
12425            NodeRequest::Sync { .. } => "sync",
12426            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
12427            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
12428            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
12429            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
12430            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12431                "unknown one-way method"
12432            }
12433            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12434                "unknown two-way method"
12435            }
12436        }
12437    }
12438}
12439
12440#[derive(Debug, Clone)]
12441pub struct NodeControlHandle {
12442    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
12443}
12444
12445impl fdomain_client::fidl::ControlHandle for NodeControlHandle {
12446    fn shutdown(&self) {
12447        self.inner.shutdown()
12448    }
12449
12450    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12451        self.inner.shutdown_with_epitaph(status)
12452    }
12453
12454    fn is_closed(&self) -> bool {
12455        self.inner.channel().is_closed()
12456    }
12457    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
12458        self.inner.channel().on_closed()
12459    }
12460}
12461
12462impl NodeControlHandle {
12463    pub fn send_on_open_(
12464        &self,
12465        mut s: i32,
12466        mut info: Option<NodeInfoDeprecated>,
12467    ) -> Result<(), fidl::Error> {
12468        self.inner.send::<NodeOnOpenRequest>(
12469            (s, info.as_mut()),
12470            0,
12471            0x7fc7bbb1dbfd1972,
12472            fidl::encoding::DynamicFlags::FLEXIBLE,
12473        )
12474    }
12475
12476    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
12477        self.inner.send::<Representation>(
12478            &mut payload,
12479            0,
12480            0x5cb40567d80a510c,
12481            fidl::encoding::DynamicFlags::empty(),
12482        )
12483    }
12484}
12485
12486#[must_use = "FIDL methods require a response to be sent"]
12487#[derive(Debug)]
12488pub struct NodeCloseResponder {
12489    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12490    tx_id: u32,
12491}
12492
12493/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12494/// if the responder is dropped without sending a response, so that the client
12495/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12496impl std::ops::Drop for NodeCloseResponder {
12497    fn drop(&mut self) {
12498        self.control_handle.shutdown();
12499        // Safety: drops once, never accessed again
12500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12501    }
12502}
12503
12504impl fdomain_client::fidl::Responder for NodeCloseResponder {
12505    type ControlHandle = NodeControlHandle;
12506
12507    fn control_handle(&self) -> &NodeControlHandle {
12508        &self.control_handle
12509    }
12510
12511    fn drop_without_shutdown(mut self) {
12512        // Safety: drops once, never accessed again due to mem::forget
12513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12514        // Prevent Drop from running (which would shut down the channel)
12515        std::mem::forget(self);
12516    }
12517}
12518
12519impl NodeCloseResponder {
12520    /// Sends a response to the FIDL transaction.
12521    ///
12522    /// Sets the channel to shutdown if an error occurs.
12523    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12524        let _result = self.send_raw(result);
12525        if _result.is_err() {
12526            self.control_handle.shutdown();
12527        }
12528        self.drop_without_shutdown();
12529        _result
12530    }
12531
12532    /// Similar to "send" but does not shutdown the channel if an error occurs.
12533    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12534        let _result = self.send_raw(result);
12535        self.drop_without_shutdown();
12536        _result
12537    }
12538
12539    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12540        self.control_handle
12541            .inner
12542            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12543                result,
12544                self.tx_id,
12545                0x5ac5d459ad7f657e,
12546                fidl::encoding::DynamicFlags::empty(),
12547            )
12548    }
12549}
12550
12551#[must_use = "FIDL methods require a response to be sent"]
12552#[derive(Debug)]
12553pub struct NodeQueryResponder {
12554    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12555    tx_id: u32,
12556}
12557
12558/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12559/// if the responder is dropped without sending a response, so that the client
12560/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12561impl std::ops::Drop for NodeQueryResponder {
12562    fn drop(&mut self) {
12563        self.control_handle.shutdown();
12564        // Safety: drops once, never accessed again
12565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12566    }
12567}
12568
12569impl fdomain_client::fidl::Responder for NodeQueryResponder {
12570    type ControlHandle = NodeControlHandle;
12571
12572    fn control_handle(&self) -> &NodeControlHandle {
12573        &self.control_handle
12574    }
12575
12576    fn drop_without_shutdown(mut self) {
12577        // Safety: drops once, never accessed again due to mem::forget
12578        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12579        // Prevent Drop from running (which would shut down the channel)
12580        std::mem::forget(self);
12581    }
12582}
12583
12584impl NodeQueryResponder {
12585    /// Sends a response to the FIDL transaction.
12586    ///
12587    /// Sets the channel to shutdown if an error occurs.
12588    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12589        let _result = self.send_raw(protocol);
12590        if _result.is_err() {
12591            self.control_handle.shutdown();
12592        }
12593        self.drop_without_shutdown();
12594        _result
12595    }
12596
12597    /// Similar to "send" but does not shutdown the channel if an error occurs.
12598    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12599        let _result = self.send_raw(protocol);
12600        self.drop_without_shutdown();
12601        _result
12602    }
12603
12604    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
12605        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
12606            (protocol,),
12607            self.tx_id,
12608            0x2658edee9decfc06,
12609            fidl::encoding::DynamicFlags::empty(),
12610        )
12611    }
12612}
12613
12614#[must_use = "FIDL methods require a response to be sent"]
12615#[derive(Debug)]
12616pub struct NodeDeprecatedGetAttrResponder {
12617    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12618    tx_id: u32,
12619}
12620
12621/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12622/// if the responder is dropped without sending a response, so that the client
12623/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12624impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
12625    fn drop(&mut self) {
12626        self.control_handle.shutdown();
12627        // Safety: drops once, never accessed again
12628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12629    }
12630}
12631
12632impl fdomain_client::fidl::Responder for NodeDeprecatedGetAttrResponder {
12633    type ControlHandle = NodeControlHandle;
12634
12635    fn control_handle(&self) -> &NodeControlHandle {
12636        &self.control_handle
12637    }
12638
12639    fn drop_without_shutdown(mut self) {
12640        // Safety: drops once, never accessed again due to mem::forget
12641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12642        // Prevent Drop from running (which would shut down the channel)
12643        std::mem::forget(self);
12644    }
12645}
12646
12647impl NodeDeprecatedGetAttrResponder {
12648    /// Sends a response to the FIDL transaction.
12649    ///
12650    /// Sets the channel to shutdown if an error occurs.
12651    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12652        let _result = self.send_raw(s, attributes);
12653        if _result.is_err() {
12654            self.control_handle.shutdown();
12655        }
12656        self.drop_without_shutdown();
12657        _result
12658    }
12659
12660    /// Similar to "send" but does not shutdown the channel if an error occurs.
12661    pub fn send_no_shutdown_on_err(
12662        self,
12663        mut s: i32,
12664        mut attributes: &NodeAttributes,
12665    ) -> Result<(), fidl::Error> {
12666        let _result = self.send_raw(s, attributes);
12667        self.drop_without_shutdown();
12668        _result
12669    }
12670
12671    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
12672        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
12673            (s, attributes),
12674            self.tx_id,
12675            0x78985e216314dafd,
12676            fidl::encoding::DynamicFlags::empty(),
12677        )
12678    }
12679}
12680
12681#[must_use = "FIDL methods require a response to be sent"]
12682#[derive(Debug)]
12683pub struct NodeDeprecatedSetAttrResponder {
12684    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12685    tx_id: u32,
12686}
12687
12688/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12689/// if the responder is dropped without sending a response, so that the client
12690/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12691impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
12692    fn drop(&mut self) {
12693        self.control_handle.shutdown();
12694        // Safety: drops once, never accessed again
12695        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12696    }
12697}
12698
12699impl fdomain_client::fidl::Responder for NodeDeprecatedSetAttrResponder {
12700    type ControlHandle = NodeControlHandle;
12701
12702    fn control_handle(&self) -> &NodeControlHandle {
12703        &self.control_handle
12704    }
12705
12706    fn drop_without_shutdown(mut self) {
12707        // Safety: drops once, never accessed again due to mem::forget
12708        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12709        // Prevent Drop from running (which would shut down the channel)
12710        std::mem::forget(self);
12711    }
12712}
12713
12714impl NodeDeprecatedSetAttrResponder {
12715    /// Sends a response to the FIDL transaction.
12716    ///
12717    /// Sets the channel to shutdown if an error occurs.
12718    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12719        let _result = self.send_raw(s);
12720        if _result.is_err() {
12721            self.control_handle.shutdown();
12722        }
12723        self.drop_without_shutdown();
12724        _result
12725    }
12726
12727    /// Similar to "send" but does not shutdown the channel if an error occurs.
12728    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12729        let _result = self.send_raw(s);
12730        self.drop_without_shutdown();
12731        _result
12732    }
12733
12734    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12735        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
12736            (s,),
12737            self.tx_id,
12738            0x4186c0f40d938f46,
12739            fidl::encoding::DynamicFlags::empty(),
12740        )
12741    }
12742}
12743
12744#[must_use = "FIDL methods require a response to be sent"]
12745#[derive(Debug)]
12746pub struct NodeDeprecatedGetFlagsResponder {
12747    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12748    tx_id: u32,
12749}
12750
12751/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12752/// if the responder is dropped without sending a response, so that the client
12753/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12754impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
12755    fn drop(&mut self) {
12756        self.control_handle.shutdown();
12757        // Safety: drops once, never accessed again
12758        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12759    }
12760}
12761
12762impl fdomain_client::fidl::Responder for NodeDeprecatedGetFlagsResponder {
12763    type ControlHandle = NodeControlHandle;
12764
12765    fn control_handle(&self) -> &NodeControlHandle {
12766        &self.control_handle
12767    }
12768
12769    fn drop_without_shutdown(mut self) {
12770        // Safety: drops once, never accessed again due to mem::forget
12771        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12772        // Prevent Drop from running (which would shut down the channel)
12773        std::mem::forget(self);
12774    }
12775}
12776
12777impl NodeDeprecatedGetFlagsResponder {
12778    /// Sends a response to the FIDL transaction.
12779    ///
12780    /// Sets the channel to shutdown if an error occurs.
12781    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12782        let _result = self.send_raw(s, flags);
12783        if _result.is_err() {
12784            self.control_handle.shutdown();
12785        }
12786        self.drop_without_shutdown();
12787        _result
12788    }
12789
12790    /// Similar to "send" but does not shutdown the channel if an error occurs.
12791    pub fn send_no_shutdown_on_err(
12792        self,
12793        mut s: i32,
12794        mut flags: OpenFlags,
12795    ) -> Result<(), fidl::Error> {
12796        let _result = self.send_raw(s, flags);
12797        self.drop_without_shutdown();
12798        _result
12799    }
12800
12801    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
12802        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
12803            (s, flags),
12804            self.tx_id,
12805            0x5b88fffb8eda3aa1,
12806            fidl::encoding::DynamicFlags::empty(),
12807        )
12808    }
12809}
12810
12811#[must_use = "FIDL methods require a response to be sent"]
12812#[derive(Debug)]
12813pub struct NodeDeprecatedSetFlagsResponder {
12814    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12815    tx_id: u32,
12816}
12817
12818/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12819/// if the responder is dropped without sending a response, so that the client
12820/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12821impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
12822    fn drop(&mut self) {
12823        self.control_handle.shutdown();
12824        // Safety: drops once, never accessed again
12825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12826    }
12827}
12828
12829impl fdomain_client::fidl::Responder for NodeDeprecatedSetFlagsResponder {
12830    type ControlHandle = NodeControlHandle;
12831
12832    fn control_handle(&self) -> &NodeControlHandle {
12833        &self.control_handle
12834    }
12835
12836    fn drop_without_shutdown(mut self) {
12837        // Safety: drops once, never accessed again due to mem::forget
12838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12839        // Prevent Drop from running (which would shut down the channel)
12840        std::mem::forget(self);
12841    }
12842}
12843
12844impl NodeDeprecatedSetFlagsResponder {
12845    /// Sends a response to the FIDL transaction.
12846    ///
12847    /// Sets the channel to shutdown if an error occurs.
12848    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
12849        let _result = self.send_raw(s);
12850        if _result.is_err() {
12851            self.control_handle.shutdown();
12852        }
12853        self.drop_without_shutdown();
12854        _result
12855    }
12856
12857    /// Similar to "send" but does not shutdown the channel if an error occurs.
12858    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
12859        let _result = self.send_raw(s);
12860        self.drop_without_shutdown();
12861        _result
12862    }
12863
12864    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
12865        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
12866            (s,),
12867            self.tx_id,
12868            0x5295b76c71fde733,
12869            fidl::encoding::DynamicFlags::empty(),
12870        )
12871    }
12872}
12873
12874#[must_use = "FIDL methods require a response to be sent"]
12875#[derive(Debug)]
12876pub struct NodeGetFlagsResponder {
12877    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12878    tx_id: u32,
12879}
12880
12881/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12882/// if the responder is dropped without sending a response, so that the client
12883/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12884impl std::ops::Drop for NodeGetFlagsResponder {
12885    fn drop(&mut self) {
12886        self.control_handle.shutdown();
12887        // Safety: drops once, never accessed again
12888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12889    }
12890}
12891
12892impl fdomain_client::fidl::Responder for NodeGetFlagsResponder {
12893    type ControlHandle = NodeControlHandle;
12894
12895    fn control_handle(&self) -> &NodeControlHandle {
12896        &self.control_handle
12897    }
12898
12899    fn drop_without_shutdown(mut self) {
12900        // Safety: drops once, never accessed again due to mem::forget
12901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12902        // Prevent Drop from running (which would shut down the channel)
12903        std::mem::forget(self);
12904    }
12905}
12906
12907impl NodeGetFlagsResponder {
12908    /// Sends a response to the FIDL transaction.
12909    ///
12910    /// Sets the channel to shutdown if an error occurs.
12911    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12912        let _result = self.send_raw(result);
12913        if _result.is_err() {
12914            self.control_handle.shutdown();
12915        }
12916        self.drop_without_shutdown();
12917        _result
12918    }
12919
12920    /// Similar to "send" but does not shutdown the channel if an error occurs.
12921    pub fn send_no_shutdown_on_err(
12922        self,
12923        mut result: Result<Flags, i32>,
12924    ) -> Result<(), fidl::Error> {
12925        let _result = self.send_raw(result);
12926        self.drop_without_shutdown();
12927        _result
12928    }
12929
12930    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
12931        self.control_handle
12932            .inner
12933            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
12934                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
12935                self.tx_id,
12936                0x176eb318f64ec23,
12937                fidl::encoding::DynamicFlags::FLEXIBLE,
12938            )
12939    }
12940}
12941
12942#[must_use = "FIDL methods require a response to be sent"]
12943#[derive(Debug)]
12944pub struct NodeSetFlagsResponder {
12945    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
12946    tx_id: u32,
12947}
12948
12949/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
12950/// if the responder is dropped without sending a response, so that the client
12951/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12952impl std::ops::Drop for NodeSetFlagsResponder {
12953    fn drop(&mut self) {
12954        self.control_handle.shutdown();
12955        // Safety: drops once, never accessed again
12956        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12957    }
12958}
12959
12960impl fdomain_client::fidl::Responder for NodeSetFlagsResponder {
12961    type ControlHandle = NodeControlHandle;
12962
12963    fn control_handle(&self) -> &NodeControlHandle {
12964        &self.control_handle
12965    }
12966
12967    fn drop_without_shutdown(mut self) {
12968        // Safety: drops once, never accessed again due to mem::forget
12969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12970        // Prevent Drop from running (which would shut down the channel)
12971        std::mem::forget(self);
12972    }
12973}
12974
12975impl NodeSetFlagsResponder {
12976    /// Sends a response to the FIDL transaction.
12977    ///
12978    /// Sets the channel to shutdown if an error occurs.
12979    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12980        let _result = self.send_raw(result);
12981        if _result.is_err() {
12982            self.control_handle.shutdown();
12983        }
12984        self.drop_without_shutdown();
12985        _result
12986    }
12987
12988    /// Similar to "send" but does not shutdown the channel if an error occurs.
12989    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12990        let _result = self.send_raw(result);
12991        self.drop_without_shutdown();
12992        _result
12993    }
12994
12995    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12996        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12997            fidl::encoding::EmptyStruct,
12998            i32,
12999        >>(
13000            fidl::encoding::FlexibleResult::new(result),
13001            self.tx_id,
13002            0x55a8028685791ea8,
13003            fidl::encoding::DynamicFlags::FLEXIBLE,
13004        )
13005    }
13006}
13007
13008#[must_use = "FIDL methods require a response to be sent"]
13009#[derive(Debug)]
13010pub struct NodeQueryFilesystemResponder {
13011    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13012    tx_id: u32,
13013}
13014
13015/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13016/// if the responder is dropped without sending a response, so that the client
13017/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13018impl std::ops::Drop for NodeQueryFilesystemResponder {
13019    fn drop(&mut self) {
13020        self.control_handle.shutdown();
13021        // Safety: drops once, never accessed again
13022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13023    }
13024}
13025
13026impl fdomain_client::fidl::Responder for NodeQueryFilesystemResponder {
13027    type ControlHandle = NodeControlHandle;
13028
13029    fn control_handle(&self) -> &NodeControlHandle {
13030        &self.control_handle
13031    }
13032
13033    fn drop_without_shutdown(mut self) {
13034        // Safety: drops once, never accessed again due to mem::forget
13035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13036        // Prevent Drop from running (which would shut down the channel)
13037        std::mem::forget(self);
13038    }
13039}
13040
13041impl NodeQueryFilesystemResponder {
13042    /// Sends a response to the FIDL transaction.
13043    ///
13044    /// Sets the channel to shutdown if an error occurs.
13045    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13046        let _result = self.send_raw(s, info);
13047        if _result.is_err() {
13048            self.control_handle.shutdown();
13049        }
13050        self.drop_without_shutdown();
13051        _result
13052    }
13053
13054    /// Similar to "send" but does not shutdown the channel if an error occurs.
13055    pub fn send_no_shutdown_on_err(
13056        self,
13057        mut s: i32,
13058        mut info: Option<&FilesystemInfo>,
13059    ) -> Result<(), fidl::Error> {
13060        let _result = self.send_raw(s, info);
13061        self.drop_without_shutdown();
13062        _result
13063    }
13064
13065    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
13066        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
13067            (s, info),
13068            self.tx_id,
13069            0x6f344a1c6b0a0610,
13070            fidl::encoding::DynamicFlags::empty(),
13071        )
13072    }
13073}
13074
13075#[must_use = "FIDL methods require a response to be sent"]
13076#[derive(Debug)]
13077pub struct NodeGetAttributesResponder {
13078    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13079    tx_id: u32,
13080}
13081
13082/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13083/// if the responder is dropped without sending a response, so that the client
13084/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13085impl std::ops::Drop for NodeGetAttributesResponder {
13086    fn drop(&mut self) {
13087        self.control_handle.shutdown();
13088        // Safety: drops once, never accessed again
13089        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13090    }
13091}
13092
13093impl fdomain_client::fidl::Responder for NodeGetAttributesResponder {
13094    type ControlHandle = NodeControlHandle;
13095
13096    fn control_handle(&self) -> &NodeControlHandle {
13097        &self.control_handle
13098    }
13099
13100    fn drop_without_shutdown(mut self) {
13101        // Safety: drops once, never accessed again due to mem::forget
13102        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13103        // Prevent Drop from running (which would shut down the channel)
13104        std::mem::forget(self);
13105    }
13106}
13107
13108impl NodeGetAttributesResponder {
13109    /// Sends a response to the FIDL transaction.
13110    ///
13111    /// Sets the channel to shutdown if an error occurs.
13112    pub fn send(
13113        self,
13114        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13115    ) -> Result<(), fidl::Error> {
13116        let _result = self.send_raw(result);
13117        if _result.is_err() {
13118            self.control_handle.shutdown();
13119        }
13120        self.drop_without_shutdown();
13121        _result
13122    }
13123
13124    /// Similar to "send" but does not shutdown the channel if an error occurs.
13125    pub fn send_no_shutdown_on_err(
13126        self,
13127        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13128    ) -> Result<(), fidl::Error> {
13129        let _result = self.send_raw(result);
13130        self.drop_without_shutdown();
13131        _result
13132    }
13133
13134    fn send_raw(
13135        &self,
13136        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
13137    ) -> Result<(), fidl::Error> {
13138        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
13139            result,
13140            self.tx_id,
13141            0x3d4396a638ea053b,
13142            fidl::encoding::DynamicFlags::empty(),
13143        )
13144    }
13145}
13146
13147#[must_use = "FIDL methods require a response to be sent"]
13148#[derive(Debug)]
13149pub struct NodeUpdateAttributesResponder {
13150    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13151    tx_id: u32,
13152}
13153
13154/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13155/// if the responder is dropped without sending a response, so that the client
13156/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13157impl std::ops::Drop for NodeUpdateAttributesResponder {
13158    fn drop(&mut self) {
13159        self.control_handle.shutdown();
13160        // Safety: drops once, never accessed again
13161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13162    }
13163}
13164
13165impl fdomain_client::fidl::Responder for NodeUpdateAttributesResponder {
13166    type ControlHandle = NodeControlHandle;
13167
13168    fn control_handle(&self) -> &NodeControlHandle {
13169        &self.control_handle
13170    }
13171
13172    fn drop_without_shutdown(mut self) {
13173        // Safety: drops once, never accessed again due to mem::forget
13174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13175        // Prevent Drop from running (which would shut down the channel)
13176        std::mem::forget(self);
13177    }
13178}
13179
13180impl NodeUpdateAttributesResponder {
13181    /// Sends a response to the FIDL transaction.
13182    ///
13183    /// Sets the channel to shutdown if an error occurs.
13184    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13185        let _result = self.send_raw(result);
13186        if _result.is_err() {
13187            self.control_handle.shutdown();
13188        }
13189        self.drop_without_shutdown();
13190        _result
13191    }
13192
13193    /// Similar to "send" but does not shutdown the channel if an error occurs.
13194    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13195        let _result = self.send_raw(result);
13196        self.drop_without_shutdown();
13197        _result
13198    }
13199
13200    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13201        self.control_handle
13202            .inner
13203            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13204                result,
13205                self.tx_id,
13206                0x3308c1da5a89bf08,
13207                fidl::encoding::DynamicFlags::empty(),
13208            )
13209    }
13210}
13211
13212#[must_use = "FIDL methods require a response to be sent"]
13213#[derive(Debug)]
13214pub struct NodeSyncResponder {
13215    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13216    tx_id: u32,
13217}
13218
13219/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13220/// if the responder is dropped without sending a response, so that the client
13221/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13222impl std::ops::Drop for NodeSyncResponder {
13223    fn drop(&mut self) {
13224        self.control_handle.shutdown();
13225        // Safety: drops once, never accessed again
13226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13227    }
13228}
13229
13230impl fdomain_client::fidl::Responder for NodeSyncResponder {
13231    type ControlHandle = NodeControlHandle;
13232
13233    fn control_handle(&self) -> &NodeControlHandle {
13234        &self.control_handle
13235    }
13236
13237    fn drop_without_shutdown(mut self) {
13238        // Safety: drops once, never accessed again due to mem::forget
13239        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13240        // Prevent Drop from running (which would shut down the channel)
13241        std::mem::forget(self);
13242    }
13243}
13244
13245impl NodeSyncResponder {
13246    /// Sends a response to the FIDL transaction.
13247    ///
13248    /// Sets the channel to shutdown if an error occurs.
13249    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13250        let _result = self.send_raw(result);
13251        if _result.is_err() {
13252            self.control_handle.shutdown();
13253        }
13254        self.drop_without_shutdown();
13255        _result
13256    }
13257
13258    /// Similar to "send" but does not shutdown the channel if an error occurs.
13259    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13260        let _result = self.send_raw(result);
13261        self.drop_without_shutdown();
13262        _result
13263    }
13264
13265    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13266        self.control_handle
13267            .inner
13268            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13269                result,
13270                self.tx_id,
13271                0x2c5c27ca0ab5dc49,
13272                fidl::encoding::DynamicFlags::empty(),
13273            )
13274    }
13275}
13276
13277#[must_use = "FIDL methods require a response to be sent"]
13278#[derive(Debug)]
13279pub struct NodeGetExtendedAttributeResponder {
13280    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13281    tx_id: u32,
13282}
13283
13284/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13285/// if the responder is dropped without sending a response, so that the client
13286/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13287impl std::ops::Drop for NodeGetExtendedAttributeResponder {
13288    fn drop(&mut self) {
13289        self.control_handle.shutdown();
13290        // Safety: drops once, never accessed again
13291        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13292    }
13293}
13294
13295impl fdomain_client::fidl::Responder for NodeGetExtendedAttributeResponder {
13296    type ControlHandle = NodeControlHandle;
13297
13298    fn control_handle(&self) -> &NodeControlHandle {
13299        &self.control_handle
13300    }
13301
13302    fn drop_without_shutdown(mut self) {
13303        // Safety: drops once, never accessed again due to mem::forget
13304        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13305        // Prevent Drop from running (which would shut down the channel)
13306        std::mem::forget(self);
13307    }
13308}
13309
13310impl NodeGetExtendedAttributeResponder {
13311    /// Sends a response to the FIDL transaction.
13312    ///
13313    /// Sets the channel to shutdown if an error occurs.
13314    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13315        let _result = self.send_raw(result);
13316        if _result.is_err() {
13317            self.control_handle.shutdown();
13318        }
13319        self.drop_without_shutdown();
13320        _result
13321    }
13322
13323    /// Similar to "send" but does not shutdown the channel if an error occurs.
13324    pub fn send_no_shutdown_on_err(
13325        self,
13326        mut result: Result<ExtendedAttributeValue, i32>,
13327    ) -> Result<(), fidl::Error> {
13328        let _result = self.send_raw(result);
13329        self.drop_without_shutdown();
13330        _result
13331    }
13332
13333    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
13334        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
13335            result.as_mut().map_err(|e| *e),
13336            self.tx_id,
13337            0x45ffa3ccfdeb76db,
13338            fidl::encoding::DynamicFlags::empty(),
13339        )
13340    }
13341}
13342
13343#[must_use = "FIDL methods require a response to be sent"]
13344#[derive(Debug)]
13345pub struct NodeSetExtendedAttributeResponder {
13346    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13347    tx_id: u32,
13348}
13349
13350/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13351/// if the responder is dropped without sending a response, so that the client
13352/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13353impl std::ops::Drop for NodeSetExtendedAttributeResponder {
13354    fn drop(&mut self) {
13355        self.control_handle.shutdown();
13356        // Safety: drops once, never accessed again
13357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13358    }
13359}
13360
13361impl fdomain_client::fidl::Responder for NodeSetExtendedAttributeResponder {
13362    type ControlHandle = NodeControlHandle;
13363
13364    fn control_handle(&self) -> &NodeControlHandle {
13365        &self.control_handle
13366    }
13367
13368    fn drop_without_shutdown(mut self) {
13369        // Safety: drops once, never accessed again due to mem::forget
13370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13371        // Prevent Drop from running (which would shut down the channel)
13372        std::mem::forget(self);
13373    }
13374}
13375
13376impl NodeSetExtendedAttributeResponder {
13377    /// Sends a response to the FIDL transaction.
13378    ///
13379    /// Sets the channel to shutdown if an error occurs.
13380    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13381        let _result = self.send_raw(result);
13382        if _result.is_err() {
13383            self.control_handle.shutdown();
13384        }
13385        self.drop_without_shutdown();
13386        _result
13387    }
13388
13389    /// Similar to "send" but does not shutdown the channel if an error occurs.
13390    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13391        let _result = self.send_raw(result);
13392        self.drop_without_shutdown();
13393        _result
13394    }
13395
13396    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13397        self.control_handle
13398            .inner
13399            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13400                result,
13401                self.tx_id,
13402                0x4a951362f681f23c,
13403                fidl::encoding::DynamicFlags::empty(),
13404            )
13405    }
13406}
13407
13408#[must_use = "FIDL methods require a response to be sent"]
13409#[derive(Debug)]
13410pub struct NodeRemoveExtendedAttributeResponder {
13411    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
13412    tx_id: u32,
13413}
13414
13415/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
13416/// if the responder is dropped without sending a response, so that the client
13417/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13418impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
13419    fn drop(&mut self) {
13420        self.control_handle.shutdown();
13421        // Safety: drops once, never accessed again
13422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13423    }
13424}
13425
13426impl fdomain_client::fidl::Responder for NodeRemoveExtendedAttributeResponder {
13427    type ControlHandle = NodeControlHandle;
13428
13429    fn control_handle(&self) -> &NodeControlHandle {
13430        &self.control_handle
13431    }
13432
13433    fn drop_without_shutdown(mut self) {
13434        // Safety: drops once, never accessed again due to mem::forget
13435        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13436        // Prevent Drop from running (which would shut down the channel)
13437        std::mem::forget(self);
13438    }
13439}
13440
13441impl NodeRemoveExtendedAttributeResponder {
13442    /// Sends a response to the FIDL transaction.
13443    ///
13444    /// Sets the channel to shutdown if an error occurs.
13445    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13446        let _result = self.send_raw(result);
13447        if _result.is_err() {
13448            self.control_handle.shutdown();
13449        }
13450        self.drop_without_shutdown();
13451        _result
13452    }
13453
13454    /// Similar to "send" but does not shutdown the channel if an error occurs.
13455    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13456        let _result = self.send_raw(result);
13457        self.drop_without_shutdown();
13458        _result
13459    }
13460
13461    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
13462        self.control_handle
13463            .inner
13464            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
13465                result,
13466                self.tx_id,
13467                0x7a0b9f3a9bf9032d,
13468                fidl::encoding::DynamicFlags::empty(),
13469            )
13470    }
13471}
13472
13473#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13474pub struct ReadableMarker;
13475
13476impl fdomain_client::fidl::ProtocolMarker for ReadableMarker {
13477    type Proxy = ReadableProxy;
13478    type RequestStream = ReadableRequestStream;
13479
13480    const DEBUG_NAME: &'static str = "(anonymous) Readable";
13481}
13482pub type ReadableReadResult = Result<Vec<u8>, i32>;
13483
13484pub trait ReadableProxyInterface: Send + Sync {
13485    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
13486        + Send;
13487    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
13488}
13489
13490#[derive(Debug, Clone)]
13491pub struct ReadableProxy {
13492    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13493}
13494
13495impl fdomain_client::fidl::Proxy for ReadableProxy {
13496    type Protocol = ReadableMarker;
13497
13498    fn from_channel(inner: fdomain_client::Channel) -> Self {
13499        Self::new(inner)
13500    }
13501
13502    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13503        self.client.into_channel().map_err(|client| Self { client })
13504    }
13505
13506    fn as_channel(&self) -> &fdomain_client::Channel {
13507        self.client.as_channel()
13508    }
13509}
13510
13511impl ReadableProxy {
13512    /// Create a new Proxy for fuchsia.io/Readable.
13513    pub fn new(channel: fdomain_client::Channel) -> Self {
13514        let protocol_name = <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13515        Self { client: fidl::client::Client::new(channel, protocol_name) }
13516    }
13517
13518    /// Get a Stream of events from the remote end of the protocol.
13519    ///
13520    /// # Panics
13521    ///
13522    /// Panics if the event stream was already taken.
13523    pub fn take_event_stream(&self) -> ReadableEventStream {
13524        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
13525    }
13526
13527    /// Reads up to 'count' bytes at the seek offset.
13528    /// The seek offset is moved forward by the number of bytes read.
13529    ///
13530    /// ## Invariants
13531    ///
13532    /// * The returned `data.length` will never be greater than `count`.
13533    /// * If `data.length` is less than `count`, it means that the seek offset
13534    ///   has reached the end of file as part of this operation.
13535    /// * If `data.length` is zero while `count` is not, it means that the
13536    ///   seek offset is already at or beyond the end of file, and no data could
13537    ///   be read.
13538    /// * If `count` is zero, the server should perform all the checks ensuring
13539    ///   read access without actually read anything, and return an empty
13540    ///   `data` vector.
13541    ///
13542    /// This method requires the [`Rights.READ_BYTES`] right.
13543    ///
13544    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13545    pub fn r#read(
13546        &self,
13547        mut count: u64,
13548    ) -> fidl::client::QueryResponseFut<
13549        ReadableReadResult,
13550        fdomain_client::fidl::FDomainResourceDialect,
13551    > {
13552        ReadableProxyInterface::r#read(self, count)
13553    }
13554}
13555
13556impl ReadableProxyInterface for ReadableProxy {
13557    type ReadResponseFut = fidl::client::QueryResponseFut<
13558        ReadableReadResult,
13559        fdomain_client::fidl::FDomainResourceDialect,
13560    >;
13561    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
13562        fn _decode(
13563            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13564        ) -> Result<ReadableReadResult, fidl::Error> {
13565            let _response = fidl::client::decode_transaction_body::<
13566                fidl::encoding::ResultType<ReadableReadResponse, i32>,
13567                fdomain_client::fidl::FDomainResourceDialect,
13568                0x57e419a298c8ede,
13569            >(_buf?)?;
13570            Ok(_response.map(|x| x.data))
13571        }
13572        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
13573            (count,),
13574            0x57e419a298c8ede,
13575            fidl::encoding::DynamicFlags::empty(),
13576            _decode,
13577        )
13578    }
13579}
13580
13581pub struct ReadableEventStream {
13582    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
13583}
13584
13585impl std::marker::Unpin for ReadableEventStream {}
13586
13587impl futures::stream::FusedStream for ReadableEventStream {
13588    fn is_terminated(&self) -> bool {
13589        self.event_receiver.is_terminated()
13590    }
13591}
13592
13593impl futures::Stream for ReadableEventStream {
13594    type Item = Result<ReadableEvent, fidl::Error>;
13595
13596    fn poll_next(
13597        mut self: std::pin::Pin<&mut Self>,
13598        cx: &mut std::task::Context<'_>,
13599    ) -> std::task::Poll<Option<Self::Item>> {
13600        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13601            &mut self.event_receiver,
13602            cx
13603        )?) {
13604            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
13605            None => std::task::Poll::Ready(None),
13606        }
13607    }
13608}
13609
13610#[derive(Debug)]
13611pub enum ReadableEvent {}
13612
13613impl ReadableEvent {
13614    /// Decodes a message buffer as a [`ReadableEvent`].
13615    fn decode(
13616        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13617    ) -> Result<ReadableEvent, fidl::Error> {
13618        let (bytes, _handles) = buf.split_mut();
13619        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13620        debug_assert_eq!(tx_header.tx_id, 0);
13621        match tx_header.ordinal {
13622            _ => Err(fidl::Error::UnknownOrdinal {
13623                ordinal: tx_header.ordinal,
13624                protocol_name: <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13625            }),
13626        }
13627    }
13628}
13629
13630/// A Stream of incoming requests for fuchsia.io/Readable.
13631pub struct ReadableRequestStream {
13632    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13633    is_terminated: bool,
13634}
13635
13636impl std::marker::Unpin for ReadableRequestStream {}
13637
13638impl futures::stream::FusedStream for ReadableRequestStream {
13639    fn is_terminated(&self) -> bool {
13640        self.is_terminated
13641    }
13642}
13643
13644impl fdomain_client::fidl::RequestStream for ReadableRequestStream {
13645    type Protocol = ReadableMarker;
13646    type ControlHandle = ReadableControlHandle;
13647
13648    fn from_channel(channel: fdomain_client::Channel) -> Self {
13649        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13650    }
13651
13652    fn control_handle(&self) -> Self::ControlHandle {
13653        ReadableControlHandle { inner: self.inner.clone() }
13654    }
13655
13656    fn into_inner(
13657        self,
13658    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
13659    {
13660        (self.inner, self.is_terminated)
13661    }
13662
13663    fn from_inner(
13664        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13665        is_terminated: bool,
13666    ) -> Self {
13667        Self { inner, is_terminated }
13668    }
13669}
13670
13671impl futures::Stream for ReadableRequestStream {
13672    type Item = Result<ReadableRequest, fidl::Error>;
13673
13674    fn poll_next(
13675        mut self: std::pin::Pin<&mut Self>,
13676        cx: &mut std::task::Context<'_>,
13677    ) -> std::task::Poll<Option<Self::Item>> {
13678        let this = &mut *self;
13679        if this.inner.check_shutdown(cx) {
13680            this.is_terminated = true;
13681            return std::task::Poll::Ready(None);
13682        }
13683        if this.is_terminated {
13684            panic!("polled ReadableRequestStream after completion");
13685        }
13686        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
13687            |bytes, handles| {
13688                match this.inner.channel().read_etc(cx, bytes, handles) {
13689                    std::task::Poll::Ready(Ok(())) => {}
13690                    std::task::Poll::Pending => return std::task::Poll::Pending,
13691                    std::task::Poll::Ready(Err(None)) => {
13692                        this.is_terminated = true;
13693                        return std::task::Poll::Ready(None);
13694                    }
13695                    std::task::Poll::Ready(Err(Some(e))) => {
13696                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13697                            e.into(),
13698                        ))));
13699                    }
13700                }
13701
13702                // A message has been received from the channel
13703                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13704
13705                std::task::Poll::Ready(Some(match header.ordinal {
13706                    0x57e419a298c8ede => {
13707                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
13708                        let mut req = fidl::new_empty!(
13709                            ReadableReadRequest,
13710                            fdomain_client::fidl::FDomainResourceDialect
13711                        );
13712                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
13713                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
13714                        Ok(ReadableRequest::Read {
13715                            count: req.count,
13716
13717                            responder: ReadableReadResponder {
13718                                control_handle: std::mem::ManuallyDrop::new(control_handle),
13719                                tx_id: header.tx_id,
13720                            },
13721                        })
13722                    }
13723                    _ => Err(fidl::Error::UnknownOrdinal {
13724                        ordinal: header.ordinal,
13725                        protocol_name:
13726                            <ReadableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
13727                    }),
13728                }))
13729            },
13730        )
13731    }
13732}
13733
13734#[derive(Debug)]
13735pub enum ReadableRequest {
13736    /// Reads up to 'count' bytes at the seek offset.
13737    /// The seek offset is moved forward by the number of bytes read.
13738    ///
13739    /// ## Invariants
13740    ///
13741    /// * The returned `data.length` will never be greater than `count`.
13742    /// * If `data.length` is less than `count`, it means that the seek offset
13743    ///   has reached the end of file as part of this operation.
13744    /// * If `data.length` is zero while `count` is not, it means that the
13745    ///   seek offset is already at or beyond the end of file, and no data could
13746    ///   be read.
13747    /// * If `count` is zero, the server should perform all the checks ensuring
13748    ///   read access without actually read anything, and return an empty
13749    ///   `data` vector.
13750    ///
13751    /// This method requires the [`Rights.READ_BYTES`] right.
13752    ///
13753    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
13754    Read { count: u64, responder: ReadableReadResponder },
13755}
13756
13757impl ReadableRequest {
13758    #[allow(irrefutable_let_patterns)]
13759    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
13760        if let ReadableRequest::Read { count, responder } = self {
13761            Some((count, responder))
13762        } else {
13763            None
13764        }
13765    }
13766
13767    /// Name of the method defined in FIDL
13768    pub fn method_name(&self) -> &'static str {
13769        match *self {
13770            ReadableRequest::Read { .. } => "read",
13771        }
13772    }
13773}
13774
13775#[derive(Debug, Clone)]
13776pub struct ReadableControlHandle {
13777    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
13778}
13779
13780impl fdomain_client::fidl::ControlHandle for ReadableControlHandle {
13781    fn shutdown(&self) {
13782        self.inner.shutdown()
13783    }
13784
13785    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
13786        self.inner.shutdown_with_epitaph(status)
13787    }
13788
13789    fn is_closed(&self) -> bool {
13790        self.inner.channel().is_closed()
13791    }
13792    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
13793        self.inner.channel().on_closed()
13794    }
13795}
13796
13797impl ReadableControlHandle {}
13798
13799#[must_use = "FIDL methods require a response to be sent"]
13800#[derive(Debug)]
13801pub struct ReadableReadResponder {
13802    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
13803    tx_id: u32,
13804}
13805
13806/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
13807/// if the responder is dropped without sending a response, so that the client
13808/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
13809impl std::ops::Drop for ReadableReadResponder {
13810    fn drop(&mut self) {
13811        self.control_handle.shutdown();
13812        // Safety: drops once, never accessed again
13813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13814    }
13815}
13816
13817impl fdomain_client::fidl::Responder for ReadableReadResponder {
13818    type ControlHandle = ReadableControlHandle;
13819
13820    fn control_handle(&self) -> &ReadableControlHandle {
13821        &self.control_handle
13822    }
13823
13824    fn drop_without_shutdown(mut self) {
13825        // Safety: drops once, never accessed again due to mem::forget
13826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
13827        // Prevent Drop from running (which would shut down the channel)
13828        std::mem::forget(self);
13829    }
13830}
13831
13832impl ReadableReadResponder {
13833    /// Sends a response to the FIDL transaction.
13834    ///
13835    /// Sets the channel to shutdown if an error occurs.
13836    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
13837        let _result = self.send_raw(result);
13838        if _result.is_err() {
13839            self.control_handle.shutdown();
13840        }
13841        self.drop_without_shutdown();
13842        _result
13843    }
13844
13845    /// Similar to "send" but does not shutdown the channel if an error occurs.
13846    pub fn send_no_shutdown_on_err(
13847        self,
13848        mut result: Result<&[u8], i32>,
13849    ) -> Result<(), fidl::Error> {
13850        let _result = self.send_raw(result);
13851        self.drop_without_shutdown();
13852        _result
13853    }
13854
13855    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
13856        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
13857            result.map(|data| (data,)),
13858            self.tx_id,
13859            0x57e419a298c8ede,
13860            fidl::encoding::DynamicFlags::empty(),
13861        )
13862    }
13863}
13864
13865#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13866pub struct SymlinkMarker;
13867
13868impl fdomain_client::fidl::ProtocolMarker for SymlinkMarker {
13869    type Proxy = SymlinkProxy;
13870    type RequestStream = SymlinkRequestStream;
13871
13872    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
13873}
13874impl fdomain_client::fidl::DiscoverableProtocolMarker for SymlinkMarker {}
13875
13876pub trait SymlinkProxyInterface: Send + Sync {
13877    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
13878        + Send;
13879    fn r#link_into(
13880        &self,
13881        dst_parent_token: fdomain_client::Event,
13882        dst: &str,
13883    ) -> Self::LinkIntoResponseFut;
13884    fn r#clone(
13885        &self,
13886        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
13887    ) -> Result<(), fidl::Error>;
13888    type CloseResponseFut: std::future::Future<
13889            Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
13890        > + Send;
13891    fn r#close(&self) -> Self::CloseResponseFut;
13892    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
13893    fn r#query(&self) -> Self::QueryResponseFut;
13894    fn r#deprecated_clone(
13895        &self,
13896        flags: OpenFlags,
13897        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
13898    ) -> Result<(), fidl::Error>;
13899    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
13900        + Send;
13901    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
13902    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
13903    fn r#deprecated_set_attr(
13904        &self,
13905        flags: NodeAttributeFlags,
13906        attributes: &NodeAttributes,
13907    ) -> Self::DeprecatedSetAttrResponseFut;
13908    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
13909        + Send;
13910    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
13911    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
13912        + Send;
13913    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
13914    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
13915        + Send;
13916    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
13917    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
13918        + Send;
13919    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
13920    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
13921        + Send;
13922    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
13923    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
13924        + Send;
13925    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
13926    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
13927        + Send;
13928    fn r#update_attributes(
13929        &self,
13930        payload: &MutableNodeAttributes,
13931    ) -> Self::UpdateAttributesResponseFut;
13932    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
13933    fn r#sync(&self) -> Self::SyncResponseFut;
13934    fn r#list_extended_attributes(
13935        &self,
13936        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
13937    ) -> Result<(), fidl::Error>;
13938    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
13939        + Send;
13940    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
13941    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
13942        + Send;
13943    fn r#set_extended_attribute(
13944        &self,
13945        name: &[u8],
13946        value: ExtendedAttributeValue,
13947        mode: SetExtendedAttributeMode,
13948    ) -> Self::SetExtendedAttributeResponseFut;
13949    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
13950        + Send;
13951    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
13952    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
13953    fn r#describe(&self) -> Self::DescribeResponseFut;
13954}
13955
13956#[derive(Debug, Clone)]
13957pub struct SymlinkProxy {
13958    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
13959}
13960
13961impl fdomain_client::fidl::Proxy for SymlinkProxy {
13962    type Protocol = SymlinkMarker;
13963
13964    fn from_channel(inner: fdomain_client::Channel) -> Self {
13965        Self::new(inner)
13966    }
13967
13968    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
13969        self.client.into_channel().map_err(|client| Self { client })
13970    }
13971
13972    fn as_channel(&self) -> &fdomain_client::Channel {
13973        self.client.as_channel()
13974    }
13975}
13976
13977impl SymlinkProxy {
13978    /// Create a new Proxy for fuchsia.io/Symlink.
13979    pub fn new(channel: fdomain_client::Channel) -> Self {
13980        let protocol_name = <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
13981        Self { client: fidl::client::Client::new(channel, protocol_name) }
13982    }
13983
13984    /// Get a Stream of events from the remote end of the protocol.
13985    ///
13986    /// # Panics
13987    ///
13988    /// Panics if the event stream was already taken.
13989    pub fn take_event_stream(&self) -> SymlinkEventStream {
13990        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
13991    }
13992
13993    /// Creates a link to this this object with name `dst` in the directory represented by
13994    /// `dst_parent_token`.
13995    ///
13996    /// `dst` must be a resolved object name. Including "/" in the string will return
13997    /// `ZX_ERR_INVALID_ARGS`.
13998    ///
13999    /// This method requires the maximal set of rights supported by the filesystem for this object.
14000    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
14001    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
14002    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
14003    /// `ZX_ERR_ACCESS_DENIED`.
14004    ///
14005    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
14006    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
14007    ///
14008    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
14009    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
14010    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
14011    ///
14012    /// This method does not have the same atomicity properties has the `Directory::Link` method,
14013    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
14014    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
14015    pub fn r#link_into(
14016        &self,
14017        mut dst_parent_token: fdomain_client::Event,
14018        mut dst: &str,
14019    ) -> fidl::client::QueryResponseFut<
14020        LinkableLinkIntoResult,
14021        fdomain_client::fidl::FDomainResourceDialect,
14022    > {
14023        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
14024    }
14025
14026    pub fn r#clone(
14027        &self,
14028        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14029    ) -> Result<(), fidl::Error> {
14030        SymlinkProxyInterface::r#clone(self, request)
14031    }
14032
14033    /// Terminates the connection.
14034    ///
14035    /// After calling `Close`, the client must not send any other requests.
14036    ///
14037    /// Servers, after sending the status response, should close the connection
14038    /// regardless of status and without sending an epitaph.
14039    ///
14040    /// Closing the client end of the channel should be semantically equivalent
14041    /// to calling `Close` without knowing when the close has completed or its
14042    /// status.
14043    pub fn r#close(
14044        &self,
14045    ) -> fidl::client::QueryResponseFut<
14046        fdomain_fuchsia_unknown::CloseableCloseResult,
14047        fdomain_client::fidl::FDomainResourceDialect,
14048    > {
14049        SymlinkProxyInterface::r#close(self)
14050    }
14051
14052    pub fn r#query(
14053        &self,
14054    ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
14055        SymlinkProxyInterface::r#query(self)
14056    }
14057
14058    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14059    pub fn r#deprecated_clone(
14060        &self,
14061        mut flags: OpenFlags,
14062        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14063    ) -> Result<(), fidl::Error> {
14064        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
14065    }
14066
14067    /// DEPRECATED - Use `Node.GetAttributes` instead.
14068    pub fn r#deprecated_get_attr(
14069        &self,
14070    ) -> fidl::client::QueryResponseFut<
14071        (i32, NodeAttributes),
14072        fdomain_client::fidl::FDomainResourceDialect,
14073    > {
14074        SymlinkProxyInterface::r#deprecated_get_attr(self)
14075    }
14076
14077    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14078    pub fn r#deprecated_set_attr(
14079        &self,
14080        mut flags: NodeAttributeFlags,
14081        mut attributes: &NodeAttributes,
14082    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14083        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
14084    }
14085
14086    /// [DEPRECATED - Use new GetFlags method instead.]
14087    pub fn r#deprecated_get_flags(
14088        &self,
14089    ) -> fidl::client::QueryResponseFut<
14090        (i32, OpenFlags),
14091        fdomain_client::fidl::FDomainResourceDialect,
14092    > {
14093        SymlinkProxyInterface::r#deprecated_get_flags(self)
14094    }
14095
14096    /// [DEPRECATED - Use new SetFlags method instead.]
14097    pub fn r#deprecated_set_flags(
14098        &self,
14099        mut flags: OpenFlags,
14100    ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
14101        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
14102    }
14103
14104    /// Queries the flags that apply to this node after it has been opened/created. This method does
14105    /// not require any rights.
14106    ///
14107    /// Note that the final set of flags that apply to the connection may differ from those
14108    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14109    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14110    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14111    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14112    pub fn r#get_flags(
14113        &self,
14114    ) -> fidl::client::QueryResponseFut<
14115        NodeGetFlagsResult,
14116        fdomain_client::fidl::FDomainResourceDialect,
14117    > {
14118        SymlinkProxyInterface::r#get_flags(self)
14119    }
14120
14121    /// Sets the flags that apply to this node after it has been opened. This method does not
14122    /// require any rights.
14123    ///
14124    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14125    /// clear append mode.
14126    ///
14127    /// Errors:
14128    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14129    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14130    pub fn r#set_flags(
14131        &self,
14132        mut flags: Flags,
14133    ) -> fidl::client::QueryResponseFut<
14134        NodeSetFlagsResult,
14135        fdomain_client::fidl::FDomainResourceDialect,
14136    > {
14137        SymlinkProxyInterface::r#set_flags(self, flags)
14138    }
14139
14140    /// Query the filesystem for filesystem-specific information.
14141    pub fn r#query_filesystem(
14142        &self,
14143    ) -> fidl::client::QueryResponseFut<
14144        (i32, Option<Box<FilesystemInfo>>),
14145        fdomain_client::fidl::FDomainResourceDialect,
14146    > {
14147        SymlinkProxyInterface::r#query_filesystem(self)
14148    }
14149
14150    /// Acquires information about the node.
14151    ///
14152    /// The attributes of a node should be stable, independent of the
14153    /// specific protocol used to access it.
14154    ///
14155    /// If a particular attribute is not applicable or not supported,
14156    /// filesystems should leave the corresponding field absent.
14157    ///
14158    /// + `query` a bit-mask specifying which attributes to fetch. The server
14159    ///   should not return more than necessary.
14160    /// - `attributes` the returned attributes.
14161    ///
14162    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14163    pub fn r#get_attributes(
14164        &self,
14165        mut query: NodeAttributesQuery,
14166    ) -> fidl::client::QueryResponseFut<
14167        NodeGetAttributesResult,
14168        fdomain_client::fidl::FDomainResourceDialect,
14169    > {
14170        SymlinkProxyInterface::r#get_attributes(self, query)
14171    }
14172
14173    /// Updates information about the node.
14174    ///
14175    /// + `attributes` the presence of a table field in `attributes` indicates
14176    /// the intent to update the corresponding attribute.
14177    ///
14178    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14179    ///
14180    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14181    pub fn r#update_attributes(
14182        &self,
14183        mut payload: &MutableNodeAttributes,
14184    ) -> fidl::client::QueryResponseFut<
14185        NodeUpdateAttributesResult,
14186        fdomain_client::fidl::FDomainResourceDialect,
14187    > {
14188        SymlinkProxyInterface::r#update_attributes(self, payload)
14189    }
14190
14191    /// Synchronizes updates to the node to the underlying media, if it exists.
14192    ///
14193    /// This method will return when the filesystem server has flushed the
14194    /// relevant updates to the underlying media, but does not guarantee the
14195    /// underlying media has persisted the information, nor that any information
14196    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14197    /// between operations.
14198    ///
14199    /// This method does not require any rights.
14200    pub fn r#sync(
14201        &self,
14202    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fdomain_client::fidl::FDomainResourceDialect>
14203    {
14204        SymlinkProxyInterface::r#sync(self)
14205    }
14206
14207    /// Creates an iterator over all the extended attribute names associated
14208    /// with this node. If an error occurs it is returned as an epitaph on the
14209    /// iterator request channel, and then the channel is closed.
14210    ///
14211    /// GetExtendedAttributes can be used with any of these names to retrieve
14212    /// the associated value.
14213    ///
14214    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14215    pub fn r#list_extended_attributes(
14216        &self,
14217        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14218    ) -> Result<(), fidl::Error> {
14219        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
14220    }
14221
14222    /// Get the value associated with the given attribute `name` for this node.
14223    ///
14224    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14225    /// particular structure is imposed on them.
14226    ///
14227    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14228    pub fn r#get_extended_attribute(
14229        &self,
14230        mut name: &[u8],
14231    ) -> fidl::client::QueryResponseFut<
14232        NodeGetExtendedAttributeResult,
14233        fdomain_client::fidl::FDomainResourceDialect,
14234    > {
14235        SymlinkProxyInterface::r#get_extended_attribute(self, name)
14236    }
14237
14238    /// Set the value for the given attribute `name` to `value` for this node.
14239    ///
14240    /// The attribute name may exist, in which case the attribute is updated.
14241    /// If the attribute doesn't exist, it is created. The name should have no
14242    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14243    ///
14244    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14245    pub fn r#set_extended_attribute(
14246        &self,
14247        mut name: &[u8],
14248        mut value: ExtendedAttributeValue,
14249        mut mode: SetExtendedAttributeMode,
14250    ) -> fidl::client::QueryResponseFut<
14251        NodeSetExtendedAttributeResult,
14252        fdomain_client::fidl::FDomainResourceDialect,
14253    > {
14254        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
14255    }
14256
14257    /// Remove the specified extended attribute.
14258    ///
14259    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14260    ///
14261    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14262    pub fn r#remove_extended_attribute(
14263        &self,
14264        mut name: &[u8],
14265    ) -> fidl::client::QueryResponseFut<
14266        NodeRemoveExtendedAttributeResult,
14267        fdomain_client::fidl::FDomainResourceDialect,
14268    > {
14269        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
14270    }
14271
14272    pub fn r#describe(
14273        &self,
14274    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>
14275    {
14276        SymlinkProxyInterface::r#describe(self)
14277    }
14278}
14279
14280impl SymlinkProxyInterface for SymlinkProxy {
14281    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
14282        LinkableLinkIntoResult,
14283        fdomain_client::fidl::FDomainResourceDialect,
14284    >;
14285    fn r#link_into(
14286        &self,
14287        mut dst_parent_token: fdomain_client::Event,
14288        mut dst: &str,
14289    ) -> Self::LinkIntoResponseFut {
14290        fn _decode(
14291            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14292        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
14293            let _response = fidl::client::decode_transaction_body::<
14294                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14295                fdomain_client::fidl::FDomainResourceDialect,
14296                0x54f3949246a03e74,
14297            >(_buf?)?;
14298            Ok(_response.map(|x| x))
14299        }
14300        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
14301            (dst_parent_token, dst),
14302            0x54f3949246a03e74,
14303            fidl::encoding::DynamicFlags::empty(),
14304            _decode,
14305        )
14306    }
14307
14308    fn r#clone(
14309        &self,
14310        mut request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
14311    ) -> Result<(), fidl::Error> {
14312        self.client.send::<fdomain_fuchsia_unknown::CloneableCloneRequest>(
14313            (request,),
14314            0x20d8a7aba2168a79,
14315            fidl::encoding::DynamicFlags::empty(),
14316        )
14317    }
14318
14319    type CloseResponseFut = fidl::client::QueryResponseFut<
14320        fdomain_fuchsia_unknown::CloseableCloseResult,
14321        fdomain_client::fidl::FDomainResourceDialect,
14322    >;
14323    fn r#close(&self) -> Self::CloseResponseFut {
14324        fn _decode(
14325            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14326        ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
14327            let _response = fidl::client::decode_transaction_body::<
14328                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14329                fdomain_client::fidl::FDomainResourceDialect,
14330                0x5ac5d459ad7f657e,
14331            >(_buf?)?;
14332            Ok(_response.map(|x| x))
14333        }
14334        self.client.send_query_and_decode::<
14335            fidl::encoding::EmptyPayload,
14336            fdomain_fuchsia_unknown::CloseableCloseResult,
14337        >(
14338            (),
14339            0x5ac5d459ad7f657e,
14340            fidl::encoding::DynamicFlags::empty(),
14341            _decode,
14342        )
14343    }
14344
14345    type QueryResponseFut =
14346        fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
14347    fn r#query(&self) -> Self::QueryResponseFut {
14348        fn _decode(
14349            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14350        ) -> Result<Vec<u8>, fidl::Error> {
14351            let _response = fidl::client::decode_transaction_body::<
14352                fdomain_fuchsia_unknown::QueryableQueryResponse,
14353                fdomain_client::fidl::FDomainResourceDialect,
14354                0x2658edee9decfc06,
14355            >(_buf?)?;
14356            Ok(_response.protocol)
14357        }
14358        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
14359            (),
14360            0x2658edee9decfc06,
14361            fidl::encoding::DynamicFlags::empty(),
14362            _decode,
14363        )
14364    }
14365
14366    fn r#deprecated_clone(
14367        &self,
14368        mut flags: OpenFlags,
14369        mut object: fdomain_client::fidl::ServerEnd<NodeMarker>,
14370    ) -> Result<(), fidl::Error> {
14371        self.client.send::<NodeDeprecatedCloneRequest>(
14372            (flags, object),
14373            0x5a61678f293ce16f,
14374            fidl::encoding::DynamicFlags::FLEXIBLE,
14375        )
14376    }
14377
14378    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
14379        (i32, NodeAttributes),
14380        fdomain_client::fidl::FDomainResourceDialect,
14381    >;
14382    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
14383        fn _decode(
14384            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14385        ) -> Result<(i32, NodeAttributes), fidl::Error> {
14386            let _response = fidl::client::decode_transaction_body::<
14387                NodeDeprecatedGetAttrResponse,
14388                fdomain_client::fidl::FDomainResourceDialect,
14389                0x78985e216314dafd,
14390            >(_buf?)?;
14391            Ok((_response.s, _response.attributes))
14392        }
14393        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
14394            (),
14395            0x78985e216314dafd,
14396            fidl::encoding::DynamicFlags::empty(),
14397            _decode,
14398        )
14399    }
14400
14401    type DeprecatedSetAttrResponseFut =
14402        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14403    fn r#deprecated_set_attr(
14404        &self,
14405        mut flags: NodeAttributeFlags,
14406        mut attributes: &NodeAttributes,
14407    ) -> Self::DeprecatedSetAttrResponseFut {
14408        fn _decode(
14409            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14410        ) -> Result<i32, fidl::Error> {
14411            let _response = fidl::client::decode_transaction_body::<
14412                NodeDeprecatedSetAttrResponse,
14413                fdomain_client::fidl::FDomainResourceDialect,
14414                0x4186c0f40d938f46,
14415            >(_buf?)?;
14416            Ok(_response.s)
14417        }
14418        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
14419            (flags, attributes),
14420            0x4186c0f40d938f46,
14421            fidl::encoding::DynamicFlags::empty(),
14422            _decode,
14423        )
14424    }
14425
14426    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
14427        (i32, OpenFlags),
14428        fdomain_client::fidl::FDomainResourceDialect,
14429    >;
14430    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
14431        fn _decode(
14432            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14433        ) -> Result<(i32, OpenFlags), fidl::Error> {
14434            let _response = fidl::client::decode_transaction_body::<
14435                NodeDeprecatedGetFlagsResponse,
14436                fdomain_client::fidl::FDomainResourceDialect,
14437                0x5b88fffb8eda3aa1,
14438            >(_buf?)?;
14439            Ok((_response.s, _response.flags))
14440        }
14441        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
14442            (),
14443            0x5b88fffb8eda3aa1,
14444            fidl::encoding::DynamicFlags::empty(),
14445            _decode,
14446        )
14447    }
14448
14449    type DeprecatedSetFlagsResponseFut =
14450        fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
14451    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
14452        fn _decode(
14453            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14454        ) -> Result<i32, fidl::Error> {
14455            let _response = fidl::client::decode_transaction_body::<
14456                NodeDeprecatedSetFlagsResponse,
14457                fdomain_client::fidl::FDomainResourceDialect,
14458                0x5295b76c71fde733,
14459            >(_buf?)?;
14460            Ok(_response.s)
14461        }
14462        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
14463            (flags,),
14464            0x5295b76c71fde733,
14465            fidl::encoding::DynamicFlags::empty(),
14466            _decode,
14467        )
14468    }
14469
14470    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
14471        NodeGetFlagsResult,
14472        fdomain_client::fidl::FDomainResourceDialect,
14473    >;
14474    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
14475        fn _decode(
14476            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14477        ) -> Result<NodeGetFlagsResult, fidl::Error> {
14478            let _response = fidl::client::decode_transaction_body::<
14479                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
14480                fdomain_client::fidl::FDomainResourceDialect,
14481                0x176eb318f64ec23,
14482            >(_buf?)?
14483            .into_result_fdomain::<SymlinkMarker>("get_flags")?;
14484            Ok(_response.map(|x| x.flags))
14485        }
14486        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
14487            (),
14488            0x176eb318f64ec23,
14489            fidl::encoding::DynamicFlags::FLEXIBLE,
14490            _decode,
14491        )
14492    }
14493
14494    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
14495        NodeSetFlagsResult,
14496        fdomain_client::fidl::FDomainResourceDialect,
14497    >;
14498    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
14499        fn _decode(
14500            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14501        ) -> Result<NodeSetFlagsResult, fidl::Error> {
14502            let _response = fidl::client::decode_transaction_body::<
14503                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
14504                fdomain_client::fidl::FDomainResourceDialect,
14505                0x55a8028685791ea8,
14506            >(_buf?)?
14507            .into_result_fdomain::<SymlinkMarker>("set_flags")?;
14508            Ok(_response.map(|x| x))
14509        }
14510        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
14511            (flags,),
14512            0x55a8028685791ea8,
14513            fidl::encoding::DynamicFlags::FLEXIBLE,
14514            _decode,
14515        )
14516    }
14517
14518    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
14519        (i32, Option<Box<FilesystemInfo>>),
14520        fdomain_client::fidl::FDomainResourceDialect,
14521    >;
14522    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
14523        fn _decode(
14524            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14525        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
14526            let _response = fidl::client::decode_transaction_body::<
14527                NodeQueryFilesystemResponse,
14528                fdomain_client::fidl::FDomainResourceDialect,
14529                0x6f344a1c6b0a0610,
14530            >(_buf?)?;
14531            Ok((_response.s, _response.info))
14532        }
14533        self.client.send_query_and_decode::<
14534            fidl::encoding::EmptyPayload,
14535            (i32, Option<Box<FilesystemInfo>>),
14536        >(
14537            (),
14538            0x6f344a1c6b0a0610,
14539            fidl::encoding::DynamicFlags::empty(),
14540            _decode,
14541        )
14542    }
14543
14544    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
14545        NodeGetAttributesResult,
14546        fdomain_client::fidl::FDomainResourceDialect,
14547    >;
14548    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
14549        fn _decode(
14550            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14551        ) -> Result<NodeGetAttributesResult, fidl::Error> {
14552            let _response = fidl::client::decode_transaction_body::<
14553                fidl::encoding::ResultType<NodeAttributes2, i32>,
14554                fdomain_client::fidl::FDomainResourceDialect,
14555                0x3d4396a638ea053b,
14556            >(_buf?)?;
14557            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
14558        }
14559        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
14560            (query,),
14561            0x3d4396a638ea053b,
14562            fidl::encoding::DynamicFlags::empty(),
14563            _decode,
14564        )
14565    }
14566
14567    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
14568        NodeUpdateAttributesResult,
14569        fdomain_client::fidl::FDomainResourceDialect,
14570    >;
14571    fn r#update_attributes(
14572        &self,
14573        mut payload: &MutableNodeAttributes,
14574    ) -> Self::UpdateAttributesResponseFut {
14575        fn _decode(
14576            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14577        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
14578            let _response = fidl::client::decode_transaction_body::<
14579                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14580                fdomain_client::fidl::FDomainResourceDialect,
14581                0x3308c1da5a89bf08,
14582            >(_buf?)?;
14583            Ok(_response.map(|x| x))
14584        }
14585        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
14586            payload,
14587            0x3308c1da5a89bf08,
14588            fidl::encoding::DynamicFlags::empty(),
14589            _decode,
14590        )
14591    }
14592
14593    type SyncResponseFut = fidl::client::QueryResponseFut<
14594        NodeSyncResult,
14595        fdomain_client::fidl::FDomainResourceDialect,
14596    >;
14597    fn r#sync(&self) -> Self::SyncResponseFut {
14598        fn _decode(
14599            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14600        ) -> Result<NodeSyncResult, fidl::Error> {
14601            let _response = fidl::client::decode_transaction_body::<
14602                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14603                fdomain_client::fidl::FDomainResourceDialect,
14604                0x2c5c27ca0ab5dc49,
14605            >(_buf?)?;
14606            Ok(_response.map(|x| x))
14607        }
14608        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
14609            (),
14610            0x2c5c27ca0ab5dc49,
14611            fidl::encoding::DynamicFlags::empty(),
14612            _decode,
14613        )
14614    }
14615
14616    fn r#list_extended_attributes(
14617        &self,
14618        mut iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
14619    ) -> Result<(), fidl::Error> {
14620        self.client.send::<NodeListExtendedAttributesRequest>(
14621            (iterator,),
14622            0x4b61033de007fcd0,
14623            fidl::encoding::DynamicFlags::empty(),
14624        )
14625    }
14626
14627    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14628        NodeGetExtendedAttributeResult,
14629        fdomain_client::fidl::FDomainResourceDialect,
14630    >;
14631    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14632        fn _decode(
14633            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14634        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14635            let _response = fidl::client::decode_transaction_body::<
14636                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14637                fdomain_client::fidl::FDomainResourceDialect,
14638                0x45ffa3ccfdeb76db,
14639            >(_buf?)?;
14640            Ok(_response.map(|x| x))
14641        }
14642        self.client.send_query_and_decode::<
14643            NodeGetExtendedAttributeRequest,
14644            NodeGetExtendedAttributeResult,
14645        >(
14646            (name,),
14647            0x45ffa3ccfdeb76db,
14648            fidl::encoding::DynamicFlags::empty(),
14649            _decode,
14650        )
14651    }
14652
14653    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14654        NodeSetExtendedAttributeResult,
14655        fdomain_client::fidl::FDomainResourceDialect,
14656    >;
14657    fn r#set_extended_attribute(
14658        &self,
14659        mut name: &[u8],
14660        mut value: ExtendedAttributeValue,
14661        mut mode: SetExtendedAttributeMode,
14662    ) -> Self::SetExtendedAttributeResponseFut {
14663        fn _decode(
14664            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14665        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14666            let _response = fidl::client::decode_transaction_body::<
14667                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14668                fdomain_client::fidl::FDomainResourceDialect,
14669                0x4a951362f681f23c,
14670            >(_buf?)?;
14671            Ok(_response.map(|x| x))
14672        }
14673        self.client.send_query_and_decode::<
14674            NodeSetExtendedAttributeRequest,
14675            NodeSetExtendedAttributeResult,
14676        >(
14677            (name, &mut value, mode,),
14678            0x4a951362f681f23c,
14679            fidl::encoding::DynamicFlags::empty(),
14680            _decode,
14681        )
14682    }
14683
14684    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14685        NodeRemoveExtendedAttributeResult,
14686        fdomain_client::fidl::FDomainResourceDialect,
14687    >;
14688    fn r#remove_extended_attribute(
14689        &self,
14690        mut name: &[u8],
14691    ) -> Self::RemoveExtendedAttributeResponseFut {
14692        fn _decode(
14693            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14694        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14695            let _response = fidl::client::decode_transaction_body::<
14696                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14697                fdomain_client::fidl::FDomainResourceDialect,
14698                0x7a0b9f3a9bf9032d,
14699            >(_buf?)?;
14700            Ok(_response.map(|x| x))
14701        }
14702        self.client.send_query_and_decode::<
14703            NodeRemoveExtendedAttributeRequest,
14704            NodeRemoveExtendedAttributeResult,
14705        >(
14706            (name,),
14707            0x7a0b9f3a9bf9032d,
14708            fidl::encoding::DynamicFlags::empty(),
14709            _decode,
14710        )
14711    }
14712
14713    type DescribeResponseFut =
14714        fidl::client::QueryResponseFut<SymlinkInfo, fdomain_client::fidl::FDomainResourceDialect>;
14715    fn r#describe(&self) -> Self::DescribeResponseFut {
14716        fn _decode(
14717            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14718        ) -> Result<SymlinkInfo, fidl::Error> {
14719            let _response = fidl::client::decode_transaction_body::<
14720                fidl::encoding::FlexibleType<SymlinkInfo>,
14721                fdomain_client::fidl::FDomainResourceDialect,
14722                0x742c2ea5e89831f3,
14723            >(_buf?)?
14724            .into_result_fdomain::<SymlinkMarker>("describe")?;
14725            Ok(_response)
14726        }
14727        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
14728            (),
14729            0x742c2ea5e89831f3,
14730            fidl::encoding::DynamicFlags::FLEXIBLE,
14731            _decode,
14732        )
14733    }
14734}
14735
14736pub struct SymlinkEventStream {
14737    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
14738}
14739
14740impl std::marker::Unpin for SymlinkEventStream {}
14741
14742impl futures::stream::FusedStream for SymlinkEventStream {
14743    fn is_terminated(&self) -> bool {
14744        self.event_receiver.is_terminated()
14745    }
14746}
14747
14748impl futures::Stream for SymlinkEventStream {
14749    type Item = Result<SymlinkEvent, fidl::Error>;
14750
14751    fn poll_next(
14752        mut self: std::pin::Pin<&mut Self>,
14753        cx: &mut std::task::Context<'_>,
14754    ) -> std::task::Poll<Option<Self::Item>> {
14755        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14756            &mut self.event_receiver,
14757            cx
14758        )?) {
14759            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
14760            None => std::task::Poll::Ready(None),
14761        }
14762    }
14763}
14764
14765#[derive(Debug)]
14766pub enum SymlinkEvent {
14767    OnOpen_ {
14768        s: i32,
14769        info: Option<Box<NodeInfoDeprecated>>,
14770    },
14771    OnRepresentation {
14772        payload: Representation,
14773    },
14774    #[non_exhaustive]
14775    _UnknownEvent {
14776        /// Ordinal of the event that was sent.
14777        ordinal: u64,
14778    },
14779}
14780
14781impl SymlinkEvent {
14782    #[allow(irrefutable_let_patterns)]
14783    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14784        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14785    }
14786    #[allow(irrefutable_let_patterns)]
14787    pub fn into_on_representation(self) -> Option<Representation> {
14788        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14789    }
14790
14791    /// Decodes a message buffer as a [`SymlinkEvent`].
14792    fn decode(
14793        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14794    ) -> Result<SymlinkEvent, fidl::Error> {
14795        let (bytes, _handles) = buf.split_mut();
14796        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14797        debug_assert_eq!(tx_header.tx_id, 0);
14798        match tx_header.ordinal {
14799            0x7fc7bbb1dbfd1972 => {
14800                let mut out = fidl::new_empty!(
14801                    NodeOnOpenRequest,
14802                    fdomain_client::fidl::FDomainResourceDialect
14803                );
14804                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14805                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
14806            }
14807            0x5cb40567d80a510c => {
14808                let mut out =
14809                    fidl::new_empty!(Representation, fdomain_client::fidl::FDomainResourceDialect);
14810                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14811                Ok((SymlinkEvent::OnRepresentation { payload: out }))
14812            }
14813            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14814                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14815            }
14816            _ => Err(fidl::Error::UnknownOrdinal {
14817                ordinal: tx_header.ordinal,
14818                protocol_name: <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
14819            }),
14820        }
14821    }
14822}
14823
14824/// A Stream of incoming requests for fuchsia.io/Symlink.
14825pub struct SymlinkRequestStream {
14826    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14827    is_terminated: bool,
14828}
14829
14830impl std::marker::Unpin for SymlinkRequestStream {}
14831
14832impl futures::stream::FusedStream for SymlinkRequestStream {
14833    fn is_terminated(&self) -> bool {
14834        self.is_terminated
14835    }
14836}
14837
14838impl fdomain_client::fidl::RequestStream for SymlinkRequestStream {
14839    type Protocol = SymlinkMarker;
14840    type ControlHandle = SymlinkControlHandle;
14841
14842    fn from_channel(channel: fdomain_client::Channel) -> Self {
14843        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14844    }
14845
14846    fn control_handle(&self) -> Self::ControlHandle {
14847        SymlinkControlHandle { inner: self.inner.clone() }
14848    }
14849
14850    fn into_inner(
14851        self,
14852    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
14853    {
14854        (self.inner, self.is_terminated)
14855    }
14856
14857    fn from_inner(
14858        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
14859        is_terminated: bool,
14860    ) -> Self {
14861        Self { inner, is_terminated }
14862    }
14863}
14864
14865impl futures::Stream for SymlinkRequestStream {
14866    type Item = Result<SymlinkRequest, fidl::Error>;
14867
14868    fn poll_next(
14869        mut self: std::pin::Pin<&mut Self>,
14870        cx: &mut std::task::Context<'_>,
14871    ) -> std::task::Poll<Option<Self::Item>> {
14872        let this = &mut *self;
14873        if this.inner.check_shutdown(cx) {
14874            this.is_terminated = true;
14875            return std::task::Poll::Ready(None);
14876        }
14877        if this.is_terminated {
14878            panic!("polled SymlinkRequestStream after completion");
14879        }
14880        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
14881            |bytes, handles| {
14882                match this.inner.channel().read_etc(cx, bytes, handles) {
14883                    std::task::Poll::Ready(Ok(())) => {}
14884                    std::task::Poll::Pending => return std::task::Poll::Pending,
14885                    std::task::Poll::Ready(Err(None)) => {
14886                        this.is_terminated = true;
14887                        return std::task::Poll::Ready(None);
14888                    }
14889                    std::task::Poll::Ready(Err(Some(e))) => {
14890                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14891                            e.into(),
14892                        ))));
14893                    }
14894                }
14895
14896                // A message has been received from the channel
14897                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14898
14899                std::task::Poll::Ready(Some(match header.ordinal {
14900                    0x54f3949246a03e74 => {
14901                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14902                        let mut req = fidl::new_empty!(
14903                            LinkableLinkIntoRequest,
14904                            fdomain_client::fidl::FDomainResourceDialect
14905                        );
14906                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
14907                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14908                        Ok(SymlinkRequest::LinkInto {
14909                            dst_parent_token: req.dst_parent_token,
14910                            dst: req.dst,
14911
14912                            responder: SymlinkLinkIntoResponder {
14913                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14914                                tx_id: header.tx_id,
14915                            },
14916                        })
14917                    }
14918                    0x20d8a7aba2168a79 => {
14919                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14920                        let mut req = fidl::new_empty!(
14921                            fdomain_fuchsia_unknown::CloneableCloneRequest,
14922                            fdomain_client::fidl::FDomainResourceDialect
14923                        );
14924                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fdomain_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14925                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14926                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
14927                    }
14928                    0x5ac5d459ad7f657e => {
14929                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14930                        let mut req = fidl::new_empty!(
14931                            fidl::encoding::EmptyPayload,
14932                            fdomain_client::fidl::FDomainResourceDialect
14933                        );
14934                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14935                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14936                        Ok(SymlinkRequest::Close {
14937                            responder: SymlinkCloseResponder {
14938                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14939                                tx_id: header.tx_id,
14940                            },
14941                        })
14942                    }
14943                    0x2658edee9decfc06 => {
14944                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14945                        let mut req = fidl::new_empty!(
14946                            fidl::encoding::EmptyPayload,
14947                            fdomain_client::fidl::FDomainResourceDialect
14948                        );
14949                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14950                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14951                        Ok(SymlinkRequest::Query {
14952                            responder: SymlinkQueryResponder {
14953                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14954                                tx_id: header.tx_id,
14955                            },
14956                        })
14957                    }
14958                    0x5a61678f293ce16f => {
14959                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14960                        let mut req = fidl::new_empty!(
14961                            NodeDeprecatedCloneRequest,
14962                            fdomain_client::fidl::FDomainResourceDialect
14963                        );
14964                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14965                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14966                        Ok(SymlinkRequest::DeprecatedClone {
14967                            flags: req.flags,
14968                            object: req.object,
14969
14970                            control_handle,
14971                        })
14972                    }
14973                    0x78985e216314dafd => {
14974                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14975                        let mut req = fidl::new_empty!(
14976                            fidl::encoding::EmptyPayload,
14977                            fdomain_client::fidl::FDomainResourceDialect
14978                        );
14979                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14980                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14981                        Ok(SymlinkRequest::DeprecatedGetAttr {
14982                            responder: SymlinkDeprecatedGetAttrResponder {
14983                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14984                                tx_id: header.tx_id,
14985                            },
14986                        })
14987                    }
14988                    0x4186c0f40d938f46 => {
14989                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14990                        let mut req = fidl::new_empty!(
14991                            NodeDeprecatedSetAttrRequest,
14992                            fdomain_client::fidl::FDomainResourceDialect
14993                        );
14994                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14995                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
14996                        Ok(SymlinkRequest::DeprecatedSetAttr {
14997                            flags: req.flags,
14998                            attributes: req.attributes,
14999
15000                            responder: SymlinkDeprecatedSetAttrResponder {
15001                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15002                                tx_id: header.tx_id,
15003                            },
15004                        })
15005                    }
15006                    0x5b88fffb8eda3aa1 => {
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::DeprecatedGetFlags {
15015                            responder: SymlinkDeprecatedGetFlagsResponder {
15016                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15017                                tx_id: header.tx_id,
15018                            },
15019                        })
15020                    }
15021                    0x5295b76c71fde733 => {
15022                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15023                        let mut req = fidl::new_empty!(
15024                            NodeDeprecatedSetFlagsRequest,
15025                            fdomain_client::fidl::FDomainResourceDialect
15026                        );
15027                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15028                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15029                        Ok(SymlinkRequest::DeprecatedSetFlags {
15030                            flags: req.flags,
15031
15032                            responder: SymlinkDeprecatedSetFlagsResponder {
15033                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15034                                tx_id: header.tx_id,
15035                            },
15036                        })
15037                    }
15038                    0x176eb318f64ec23 => {
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::GetFlags {
15047                            responder: SymlinkGetFlagsResponder {
15048                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15049                                tx_id: header.tx_id,
15050                            },
15051                        })
15052                    }
15053                    0x55a8028685791ea8 => {
15054                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15055                        let mut req = fidl::new_empty!(
15056                            NodeSetFlagsRequest,
15057                            fdomain_client::fidl::FDomainResourceDialect
15058                        );
15059                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
15060                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15061                        Ok(SymlinkRequest::SetFlags {
15062                            flags: req.flags,
15063
15064                            responder: SymlinkSetFlagsResponder {
15065                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15066                                tx_id: header.tx_id,
15067                            },
15068                        })
15069                    }
15070                    0x6f344a1c6b0a0610 => {
15071                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15072                        let mut req = fidl::new_empty!(
15073                            fidl::encoding::EmptyPayload,
15074                            fdomain_client::fidl::FDomainResourceDialect
15075                        );
15076                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15077                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15078                        Ok(SymlinkRequest::QueryFilesystem {
15079                            responder: SymlinkQueryFilesystemResponder {
15080                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15081                                tx_id: header.tx_id,
15082                            },
15083                        })
15084                    }
15085                    0x3d4396a638ea053b => {
15086                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15087                        let mut req = fidl::new_empty!(
15088                            NodeGetAttributesRequest,
15089                            fdomain_client::fidl::FDomainResourceDialect
15090                        );
15091                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15092                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15093                        Ok(SymlinkRequest::GetAttributes {
15094                            query: req.query,
15095
15096                            responder: SymlinkGetAttributesResponder {
15097                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15098                                tx_id: header.tx_id,
15099                            },
15100                        })
15101                    }
15102                    0x3308c1da5a89bf08 => {
15103                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15104                        let mut req = fidl::new_empty!(
15105                            MutableNodeAttributes,
15106                            fdomain_client::fidl::FDomainResourceDialect
15107                        );
15108                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
15109                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15110                        Ok(SymlinkRequest::UpdateAttributes {
15111                            payload: req,
15112                            responder: SymlinkUpdateAttributesResponder {
15113                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15114                                tx_id: header.tx_id,
15115                            },
15116                        })
15117                    }
15118                    0x2c5c27ca0ab5dc49 => {
15119                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15120                        let mut req = fidl::new_empty!(
15121                            fidl::encoding::EmptyPayload,
15122                            fdomain_client::fidl::FDomainResourceDialect
15123                        );
15124                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15125                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15126                        Ok(SymlinkRequest::Sync {
15127                            responder: SymlinkSyncResponder {
15128                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15129                                tx_id: header.tx_id,
15130                            },
15131                        })
15132                    }
15133                    0x4b61033de007fcd0 => {
15134                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
15135                        let mut req = fidl::new_empty!(
15136                            NodeListExtendedAttributesRequest,
15137                            fdomain_client::fidl::FDomainResourceDialect
15138                        );
15139                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
15140                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15141                        Ok(SymlinkRequest::ListExtendedAttributes {
15142                            iterator: req.iterator,
15143
15144                            control_handle,
15145                        })
15146                    }
15147                    0x45ffa3ccfdeb76db => {
15148                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15149                        let mut req = fidl::new_empty!(
15150                            NodeGetExtendedAttributeRequest,
15151                            fdomain_client::fidl::FDomainResourceDialect
15152                        );
15153                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15154                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15155                        Ok(SymlinkRequest::GetExtendedAttribute {
15156                            name: req.name,
15157
15158                            responder: SymlinkGetExtendedAttributeResponder {
15159                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15160                                tx_id: header.tx_id,
15161                            },
15162                        })
15163                    }
15164                    0x4a951362f681f23c => {
15165                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15166                        let mut req = fidl::new_empty!(
15167                            NodeSetExtendedAttributeRequest,
15168                            fdomain_client::fidl::FDomainResourceDialect
15169                        );
15170                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15171                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15172                        Ok(SymlinkRequest::SetExtendedAttribute {
15173                            name: req.name,
15174                            value: req.value,
15175                            mode: req.mode,
15176
15177                            responder: SymlinkSetExtendedAttributeResponder {
15178                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15179                                tx_id: header.tx_id,
15180                            },
15181                        })
15182                    }
15183                    0x7a0b9f3a9bf9032d => {
15184                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15185                        let mut req = fidl::new_empty!(
15186                            NodeRemoveExtendedAttributeRequest,
15187                            fdomain_client::fidl::FDomainResourceDialect
15188                        );
15189                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
15190                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15191                        Ok(SymlinkRequest::RemoveExtendedAttribute {
15192                            name: req.name,
15193
15194                            responder: SymlinkRemoveExtendedAttributeResponder {
15195                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15196                                tx_id: header.tx_id,
15197                            },
15198                        })
15199                    }
15200                    0x742c2ea5e89831f3 => {
15201                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
15202                        let mut req = fidl::new_empty!(
15203                            fidl::encoding::EmptyPayload,
15204                            fdomain_client::fidl::FDomainResourceDialect
15205                        );
15206                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
15207                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
15208                        Ok(SymlinkRequest::Describe {
15209                            responder: SymlinkDescribeResponder {
15210                                control_handle: std::mem::ManuallyDrop::new(control_handle),
15211                                tx_id: header.tx_id,
15212                            },
15213                        })
15214                    }
15215                    _ if header.tx_id == 0
15216                        && header
15217                            .dynamic_flags()
15218                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15219                    {
15220                        Ok(SymlinkRequest::_UnknownMethod {
15221                            ordinal: header.ordinal,
15222                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15223                            method_type: fidl::MethodType::OneWay,
15224                        })
15225                    }
15226                    _ if header
15227                        .dynamic_flags()
15228                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
15229                    {
15230                        this.inner.send_framework_err(
15231                            fidl::encoding::FrameworkErr::UnknownMethod,
15232                            header.tx_id,
15233                            header.ordinal,
15234                            header.dynamic_flags(),
15235                            (bytes, handles),
15236                        )?;
15237                        Ok(SymlinkRequest::_UnknownMethod {
15238                            ordinal: header.ordinal,
15239                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
15240                            method_type: fidl::MethodType::TwoWay,
15241                        })
15242                    }
15243                    _ => Err(fidl::Error::UnknownOrdinal {
15244                        ordinal: header.ordinal,
15245                        protocol_name:
15246                            <SymlinkMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
15247                    }),
15248                }))
15249            },
15250        )
15251    }
15252}
15253
15254/// A ['Node'] which contains a symbolic link.
15255#[derive(Debug)]
15256pub enum SymlinkRequest {
15257    /// Creates a link to this this object with name `dst` in the directory represented by
15258    /// `dst_parent_token`.
15259    ///
15260    /// `dst` must be a resolved object name. Including "/" in the string will return
15261    /// `ZX_ERR_INVALID_ARGS`.
15262    ///
15263    /// This method requires the maximal set of rights supported by the filesystem for this object.
15264    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
15265    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
15266    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
15267    /// `ZX_ERR_ACCESS_DENIED`.
15268    ///
15269    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
15270    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
15271    ///
15272    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
15273    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
15274    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
15275    ///
15276    /// This method does not have the same atomicity properties has the `Directory::Link` method,
15277    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
15278    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
15279    LinkInto {
15280        dst_parent_token: fdomain_client::Event,
15281        dst: String,
15282        responder: SymlinkLinkIntoResponder,
15283    },
15284    Clone {
15285        request: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15286        control_handle: SymlinkControlHandle,
15287    },
15288    /// Terminates the connection.
15289    ///
15290    /// After calling `Close`, the client must not send any other requests.
15291    ///
15292    /// Servers, after sending the status response, should close the connection
15293    /// regardless of status and without sending an epitaph.
15294    ///
15295    /// Closing the client end of the channel should be semantically equivalent
15296    /// to calling `Close` without knowing when the close has completed or its
15297    /// status.
15298    Close {
15299        responder: SymlinkCloseResponder,
15300    },
15301    Query {
15302        responder: SymlinkQueryResponder,
15303    },
15304    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
15305    DeprecatedClone {
15306        flags: OpenFlags,
15307        object: fdomain_client::fidl::ServerEnd<NodeMarker>,
15308        control_handle: SymlinkControlHandle,
15309    },
15310    /// DEPRECATED - Use `Node.GetAttributes` instead.
15311    DeprecatedGetAttr {
15312        responder: SymlinkDeprecatedGetAttrResponder,
15313    },
15314    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
15315    DeprecatedSetAttr {
15316        flags: NodeAttributeFlags,
15317        attributes: NodeAttributes,
15318        responder: SymlinkDeprecatedSetAttrResponder,
15319    },
15320    /// [DEPRECATED - Use new GetFlags method instead.]
15321    DeprecatedGetFlags {
15322        responder: SymlinkDeprecatedGetFlagsResponder,
15323    },
15324    /// [DEPRECATED - Use new SetFlags method instead.]
15325    DeprecatedSetFlags {
15326        flags: OpenFlags,
15327        responder: SymlinkDeprecatedSetFlagsResponder,
15328    },
15329    /// Queries the flags that apply to this node after it has been opened/created. This method does
15330    /// not require any rights.
15331    ///
15332    /// Note that the final set of flags that apply to the connection may differ from those
15333    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
15334    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
15335    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
15336    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
15337    GetFlags {
15338        responder: SymlinkGetFlagsResponder,
15339    },
15340    /// Sets the flags that apply to this node after it has been opened. This method does not
15341    /// require any rights.
15342    ///
15343    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
15344    /// clear append mode.
15345    ///
15346    /// Errors:
15347    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
15348    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
15349    SetFlags {
15350        flags: Flags,
15351        responder: SymlinkSetFlagsResponder,
15352    },
15353    /// Query the filesystem for filesystem-specific information.
15354    QueryFilesystem {
15355        responder: SymlinkQueryFilesystemResponder,
15356    },
15357    /// Acquires information about the node.
15358    ///
15359    /// The attributes of a node should be stable, independent of the
15360    /// specific protocol used to access it.
15361    ///
15362    /// If a particular attribute is not applicable or not supported,
15363    /// filesystems should leave the corresponding field absent.
15364    ///
15365    /// + `query` a bit-mask specifying which attributes to fetch. The server
15366    ///   should not return more than necessary.
15367    /// - `attributes` the returned attributes.
15368    ///
15369    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15370    GetAttributes {
15371        query: NodeAttributesQuery,
15372        responder: SymlinkGetAttributesResponder,
15373    },
15374    /// Updates information about the node.
15375    ///
15376    /// + `attributes` the presence of a table field in `attributes` indicates
15377    /// the intent to update the corresponding attribute.
15378    ///
15379    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
15380    ///
15381    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15382    UpdateAttributes {
15383        payload: MutableNodeAttributes,
15384        responder: SymlinkUpdateAttributesResponder,
15385    },
15386    /// Synchronizes updates to the node to the underlying media, if it exists.
15387    ///
15388    /// This method will return when the filesystem server has flushed the
15389    /// relevant updates to the underlying media, but does not guarantee the
15390    /// underlying media has persisted the information, nor that any information
15391    /// is committed to hardware. Clients may use `Sync` to ensure ordering
15392    /// between operations.
15393    ///
15394    /// This method does not require any rights.
15395    Sync {
15396        responder: SymlinkSyncResponder,
15397    },
15398    /// Creates an iterator over all the extended attribute names associated
15399    /// with this node. If an error occurs it is returned as an epitaph on the
15400    /// iterator request channel, and then the channel is closed.
15401    ///
15402    /// GetExtendedAttributes can be used with any of these names to retrieve
15403    /// the associated value.
15404    ///
15405    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15406    ListExtendedAttributes {
15407        iterator: fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15408        control_handle: SymlinkControlHandle,
15409    },
15410    /// Get the value associated with the given attribute `name` for this node.
15411    ///
15412    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
15413    /// particular structure is imposed on them.
15414    ///
15415    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
15416    GetExtendedAttribute {
15417        name: Vec<u8>,
15418        responder: SymlinkGetExtendedAttributeResponder,
15419    },
15420    /// Set the value for the given attribute `name` to `value` for this node.
15421    ///
15422    /// The attribute name may exist, in which case the attribute is updated.
15423    /// If the attribute doesn't exist, it is created. The name should have no
15424    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
15425    ///
15426    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15427    SetExtendedAttribute {
15428        name: Vec<u8>,
15429        value: ExtendedAttributeValue,
15430        mode: SetExtendedAttributeMode,
15431        responder: SymlinkSetExtendedAttributeResponder,
15432    },
15433    /// Remove the specified extended attribute.
15434    ///
15435    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
15436    ///
15437    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
15438    RemoveExtendedAttribute {
15439        name: Vec<u8>,
15440        responder: SymlinkRemoveExtendedAttributeResponder,
15441    },
15442    Describe {
15443        responder: SymlinkDescribeResponder,
15444    },
15445    /// An interaction was received which does not match any known method.
15446    #[non_exhaustive]
15447    _UnknownMethod {
15448        /// Ordinal of the method that was called.
15449        ordinal: u64,
15450        control_handle: SymlinkControlHandle,
15451        method_type: fidl::MethodType,
15452    },
15453}
15454
15455impl SymlinkRequest {
15456    #[allow(irrefutable_let_patterns)]
15457    pub fn into_link_into(
15458        self,
15459    ) -> Option<(fdomain_client::Event, String, SymlinkLinkIntoResponder)> {
15460        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
15461            Some((dst_parent_token, dst, responder))
15462        } else {
15463            None
15464        }
15465    }
15466
15467    #[allow(irrefutable_let_patterns)]
15468    pub fn into_clone(
15469        self,
15470    ) -> Option<(
15471        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_unknown::CloneableMarker>,
15472        SymlinkControlHandle,
15473    )> {
15474        if let SymlinkRequest::Clone { request, control_handle } = self {
15475            Some((request, control_handle))
15476        } else {
15477            None
15478        }
15479    }
15480
15481    #[allow(irrefutable_let_patterns)]
15482    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
15483        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
15484    }
15485
15486    #[allow(irrefutable_let_patterns)]
15487    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
15488        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
15489    }
15490
15491    #[allow(irrefutable_let_patterns)]
15492    pub fn into_deprecated_clone(
15493        self,
15494    ) -> Option<(OpenFlags, fdomain_client::fidl::ServerEnd<NodeMarker>, SymlinkControlHandle)>
15495    {
15496        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
15497            Some((flags, object, control_handle))
15498        } else {
15499            None
15500        }
15501    }
15502
15503    #[allow(irrefutable_let_patterns)]
15504    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
15505        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
15506            Some((responder))
15507        } else {
15508            None
15509        }
15510    }
15511
15512    #[allow(irrefutable_let_patterns)]
15513    pub fn into_deprecated_set_attr(
15514        self,
15515    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
15516        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
15517            Some((flags, attributes, responder))
15518        } else {
15519            None
15520        }
15521    }
15522
15523    #[allow(irrefutable_let_patterns)]
15524    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
15525        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
15526            Some((responder))
15527        } else {
15528            None
15529        }
15530    }
15531
15532    #[allow(irrefutable_let_patterns)]
15533    pub fn into_deprecated_set_flags(
15534        self,
15535    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
15536        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
15537            Some((flags, responder))
15538        } else {
15539            None
15540        }
15541    }
15542
15543    #[allow(irrefutable_let_patterns)]
15544    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
15545        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
15546    }
15547
15548    #[allow(irrefutable_let_patterns)]
15549    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
15550        if let SymlinkRequest::SetFlags { flags, responder } = self {
15551            Some((flags, responder))
15552        } else {
15553            None
15554        }
15555    }
15556
15557    #[allow(irrefutable_let_patterns)]
15558    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
15559        if let SymlinkRequest::QueryFilesystem { responder } = self {
15560            Some((responder))
15561        } else {
15562            None
15563        }
15564    }
15565
15566    #[allow(irrefutable_let_patterns)]
15567    pub fn into_get_attributes(
15568        self,
15569    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
15570        if let SymlinkRequest::GetAttributes { query, responder } = self {
15571            Some((query, responder))
15572        } else {
15573            None
15574        }
15575    }
15576
15577    #[allow(irrefutable_let_patterns)]
15578    pub fn into_update_attributes(
15579        self,
15580    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
15581        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
15582            Some((payload, responder))
15583        } else {
15584            None
15585        }
15586    }
15587
15588    #[allow(irrefutable_let_patterns)]
15589    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
15590        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
15591    }
15592
15593    #[allow(irrefutable_let_patterns)]
15594    pub fn into_list_extended_attributes(
15595        self,
15596    ) -> Option<(
15597        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
15598        SymlinkControlHandle,
15599    )> {
15600        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
15601            Some((iterator, control_handle))
15602        } else {
15603            None
15604        }
15605    }
15606
15607    #[allow(irrefutable_let_patterns)]
15608    pub fn into_get_extended_attribute(
15609        self,
15610    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
15611        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
15612            Some((name, responder))
15613        } else {
15614            None
15615        }
15616    }
15617
15618    #[allow(irrefutable_let_patterns)]
15619    pub fn into_set_extended_attribute(
15620        self,
15621    ) -> Option<(
15622        Vec<u8>,
15623        ExtendedAttributeValue,
15624        SetExtendedAttributeMode,
15625        SymlinkSetExtendedAttributeResponder,
15626    )> {
15627        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
15628            Some((name, value, mode, responder))
15629        } else {
15630            None
15631        }
15632    }
15633
15634    #[allow(irrefutable_let_patterns)]
15635    pub fn into_remove_extended_attribute(
15636        self,
15637    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
15638        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
15639            Some((name, responder))
15640        } else {
15641            None
15642        }
15643    }
15644
15645    #[allow(irrefutable_let_patterns)]
15646    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
15647        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
15648    }
15649
15650    /// Name of the method defined in FIDL
15651    pub fn method_name(&self) -> &'static str {
15652        match *self {
15653            SymlinkRequest::LinkInto { .. } => "link_into",
15654            SymlinkRequest::Clone { .. } => "clone",
15655            SymlinkRequest::Close { .. } => "close",
15656            SymlinkRequest::Query { .. } => "query",
15657            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
15658            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
15659            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
15660            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
15661            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
15662            SymlinkRequest::GetFlags { .. } => "get_flags",
15663            SymlinkRequest::SetFlags { .. } => "set_flags",
15664            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
15665            SymlinkRequest::GetAttributes { .. } => "get_attributes",
15666            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
15667            SymlinkRequest::Sync { .. } => "sync",
15668            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
15669            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
15670            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
15671            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
15672            SymlinkRequest::Describe { .. } => "describe",
15673            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
15674                "unknown one-way method"
15675            }
15676            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
15677                "unknown two-way method"
15678            }
15679        }
15680    }
15681}
15682
15683#[derive(Debug, Clone)]
15684pub struct SymlinkControlHandle {
15685    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
15686}
15687
15688impl fdomain_client::fidl::ControlHandle for SymlinkControlHandle {
15689    fn shutdown(&self) {
15690        self.inner.shutdown()
15691    }
15692
15693    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
15694        self.inner.shutdown_with_epitaph(status)
15695    }
15696
15697    fn is_closed(&self) -> bool {
15698        self.inner.channel().is_closed()
15699    }
15700    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
15701        self.inner.channel().on_closed()
15702    }
15703}
15704
15705impl SymlinkControlHandle {
15706    pub fn send_on_open_(
15707        &self,
15708        mut s: i32,
15709        mut info: Option<NodeInfoDeprecated>,
15710    ) -> Result<(), fidl::Error> {
15711        self.inner.send::<NodeOnOpenRequest>(
15712            (s, info.as_mut()),
15713            0,
15714            0x7fc7bbb1dbfd1972,
15715            fidl::encoding::DynamicFlags::FLEXIBLE,
15716        )
15717    }
15718
15719    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
15720        self.inner.send::<Representation>(
15721            &mut payload,
15722            0,
15723            0x5cb40567d80a510c,
15724            fidl::encoding::DynamicFlags::empty(),
15725        )
15726    }
15727}
15728
15729#[must_use = "FIDL methods require a response to be sent"]
15730#[derive(Debug)]
15731pub struct SymlinkLinkIntoResponder {
15732    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15733    tx_id: u32,
15734}
15735
15736/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15737/// if the responder is dropped without sending a response, so that the client
15738/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15739impl std::ops::Drop for SymlinkLinkIntoResponder {
15740    fn drop(&mut self) {
15741        self.control_handle.shutdown();
15742        // Safety: drops once, never accessed again
15743        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15744    }
15745}
15746
15747impl fdomain_client::fidl::Responder for SymlinkLinkIntoResponder {
15748    type ControlHandle = SymlinkControlHandle;
15749
15750    fn control_handle(&self) -> &SymlinkControlHandle {
15751        &self.control_handle
15752    }
15753
15754    fn drop_without_shutdown(mut self) {
15755        // Safety: drops once, never accessed again due to mem::forget
15756        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15757        // Prevent Drop from running (which would shut down the channel)
15758        std::mem::forget(self);
15759    }
15760}
15761
15762impl SymlinkLinkIntoResponder {
15763    /// Sends a response to the FIDL transaction.
15764    ///
15765    /// Sets the channel to shutdown if an error occurs.
15766    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15767        let _result = self.send_raw(result);
15768        if _result.is_err() {
15769            self.control_handle.shutdown();
15770        }
15771        self.drop_without_shutdown();
15772        _result
15773    }
15774
15775    /// Similar to "send" but does not shutdown the channel if an error occurs.
15776    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15777        let _result = self.send_raw(result);
15778        self.drop_without_shutdown();
15779        _result
15780    }
15781
15782    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15783        self.control_handle
15784            .inner
15785            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15786                result,
15787                self.tx_id,
15788                0x54f3949246a03e74,
15789                fidl::encoding::DynamicFlags::empty(),
15790            )
15791    }
15792}
15793
15794#[must_use = "FIDL methods require a response to be sent"]
15795#[derive(Debug)]
15796pub struct SymlinkCloseResponder {
15797    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15798    tx_id: u32,
15799}
15800
15801/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15802/// if the responder is dropped without sending a response, so that the client
15803/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15804impl std::ops::Drop for SymlinkCloseResponder {
15805    fn drop(&mut self) {
15806        self.control_handle.shutdown();
15807        // Safety: drops once, never accessed again
15808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15809    }
15810}
15811
15812impl fdomain_client::fidl::Responder for SymlinkCloseResponder {
15813    type ControlHandle = SymlinkControlHandle;
15814
15815    fn control_handle(&self) -> &SymlinkControlHandle {
15816        &self.control_handle
15817    }
15818
15819    fn drop_without_shutdown(mut self) {
15820        // Safety: drops once, never accessed again due to mem::forget
15821        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15822        // Prevent Drop from running (which would shut down the channel)
15823        std::mem::forget(self);
15824    }
15825}
15826
15827impl SymlinkCloseResponder {
15828    /// Sends a response to the FIDL transaction.
15829    ///
15830    /// Sets the channel to shutdown if an error occurs.
15831    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15832        let _result = self.send_raw(result);
15833        if _result.is_err() {
15834            self.control_handle.shutdown();
15835        }
15836        self.drop_without_shutdown();
15837        _result
15838    }
15839
15840    /// Similar to "send" but does not shutdown the channel if an error occurs.
15841    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15842        let _result = self.send_raw(result);
15843        self.drop_without_shutdown();
15844        _result
15845    }
15846
15847    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15848        self.control_handle
15849            .inner
15850            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15851                result,
15852                self.tx_id,
15853                0x5ac5d459ad7f657e,
15854                fidl::encoding::DynamicFlags::empty(),
15855            )
15856    }
15857}
15858
15859#[must_use = "FIDL methods require a response to be sent"]
15860#[derive(Debug)]
15861pub struct SymlinkQueryResponder {
15862    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15863    tx_id: u32,
15864}
15865
15866/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15867/// if the responder is dropped without sending a response, so that the client
15868/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15869impl std::ops::Drop for SymlinkQueryResponder {
15870    fn drop(&mut self) {
15871        self.control_handle.shutdown();
15872        // Safety: drops once, never accessed again
15873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15874    }
15875}
15876
15877impl fdomain_client::fidl::Responder for SymlinkQueryResponder {
15878    type ControlHandle = SymlinkControlHandle;
15879
15880    fn control_handle(&self) -> &SymlinkControlHandle {
15881        &self.control_handle
15882    }
15883
15884    fn drop_without_shutdown(mut self) {
15885        // Safety: drops once, never accessed again due to mem::forget
15886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15887        // Prevent Drop from running (which would shut down the channel)
15888        std::mem::forget(self);
15889    }
15890}
15891
15892impl SymlinkQueryResponder {
15893    /// Sends a response to the FIDL transaction.
15894    ///
15895    /// Sets the channel to shutdown if an error occurs.
15896    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15897        let _result = self.send_raw(protocol);
15898        if _result.is_err() {
15899            self.control_handle.shutdown();
15900        }
15901        self.drop_without_shutdown();
15902        _result
15903    }
15904
15905    /// Similar to "send" but does not shutdown the channel if an error occurs.
15906    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15907        let _result = self.send_raw(protocol);
15908        self.drop_without_shutdown();
15909        _result
15910    }
15911
15912    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15913        self.control_handle.inner.send::<fdomain_fuchsia_unknown::QueryableQueryResponse>(
15914            (protocol,),
15915            self.tx_id,
15916            0x2658edee9decfc06,
15917            fidl::encoding::DynamicFlags::empty(),
15918        )
15919    }
15920}
15921
15922#[must_use = "FIDL methods require a response to be sent"]
15923#[derive(Debug)]
15924pub struct SymlinkDeprecatedGetAttrResponder {
15925    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15926    tx_id: u32,
15927}
15928
15929/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15930/// if the responder is dropped without sending a response, so that the client
15931/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15932impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
15933    fn drop(&mut self) {
15934        self.control_handle.shutdown();
15935        // Safety: drops once, never accessed again
15936        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15937    }
15938}
15939
15940impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetAttrResponder {
15941    type ControlHandle = SymlinkControlHandle;
15942
15943    fn control_handle(&self) -> &SymlinkControlHandle {
15944        &self.control_handle
15945    }
15946
15947    fn drop_without_shutdown(mut self) {
15948        // Safety: drops once, never accessed again due to mem::forget
15949        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15950        // Prevent Drop from running (which would shut down the channel)
15951        std::mem::forget(self);
15952    }
15953}
15954
15955impl SymlinkDeprecatedGetAttrResponder {
15956    /// Sends a response to the FIDL transaction.
15957    ///
15958    /// Sets the channel to shutdown if an error occurs.
15959    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15960        let _result = self.send_raw(s, attributes);
15961        if _result.is_err() {
15962            self.control_handle.shutdown();
15963        }
15964        self.drop_without_shutdown();
15965        _result
15966    }
15967
15968    /// Similar to "send" but does not shutdown the channel if an error occurs.
15969    pub fn send_no_shutdown_on_err(
15970        self,
15971        mut s: i32,
15972        mut attributes: &NodeAttributes,
15973    ) -> Result<(), fidl::Error> {
15974        let _result = self.send_raw(s, attributes);
15975        self.drop_without_shutdown();
15976        _result
15977    }
15978
15979    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15980        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15981            (s, attributes),
15982            self.tx_id,
15983            0x78985e216314dafd,
15984            fidl::encoding::DynamicFlags::empty(),
15985        )
15986    }
15987}
15988
15989#[must_use = "FIDL methods require a response to be sent"]
15990#[derive(Debug)]
15991pub struct SymlinkDeprecatedSetAttrResponder {
15992    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
15993    tx_id: u32,
15994}
15995
15996/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
15997/// if the responder is dropped without sending a response, so that the client
15998/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15999impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
16000    fn drop(&mut self) {
16001        self.control_handle.shutdown();
16002        // Safety: drops once, never accessed again
16003        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16004    }
16005}
16006
16007impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetAttrResponder {
16008    type ControlHandle = SymlinkControlHandle;
16009
16010    fn control_handle(&self) -> &SymlinkControlHandle {
16011        &self.control_handle
16012    }
16013
16014    fn drop_without_shutdown(mut self) {
16015        // Safety: drops once, never accessed again due to mem::forget
16016        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16017        // Prevent Drop from running (which would shut down the channel)
16018        std::mem::forget(self);
16019    }
16020}
16021
16022impl SymlinkDeprecatedSetAttrResponder {
16023    /// Sends a response to the FIDL transaction.
16024    ///
16025    /// Sets the channel to shutdown if an error occurs.
16026    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16027        let _result = self.send_raw(s);
16028        if _result.is_err() {
16029            self.control_handle.shutdown();
16030        }
16031        self.drop_without_shutdown();
16032        _result
16033    }
16034
16035    /// Similar to "send" but does not shutdown the channel if an error occurs.
16036    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16037        let _result = self.send_raw(s);
16038        self.drop_without_shutdown();
16039        _result
16040    }
16041
16042    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16043        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
16044            (s,),
16045            self.tx_id,
16046            0x4186c0f40d938f46,
16047            fidl::encoding::DynamicFlags::empty(),
16048        )
16049    }
16050}
16051
16052#[must_use = "FIDL methods require a response to be sent"]
16053#[derive(Debug)]
16054pub struct SymlinkDeprecatedGetFlagsResponder {
16055    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16056    tx_id: u32,
16057}
16058
16059/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16060/// if the responder is dropped without sending a response, so that the client
16061/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16062impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
16063    fn drop(&mut self) {
16064        self.control_handle.shutdown();
16065        // Safety: drops once, never accessed again
16066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16067    }
16068}
16069
16070impl fdomain_client::fidl::Responder for SymlinkDeprecatedGetFlagsResponder {
16071    type ControlHandle = SymlinkControlHandle;
16072
16073    fn control_handle(&self) -> &SymlinkControlHandle {
16074        &self.control_handle
16075    }
16076
16077    fn drop_without_shutdown(mut self) {
16078        // Safety: drops once, never accessed again due to mem::forget
16079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16080        // Prevent Drop from running (which would shut down the channel)
16081        std::mem::forget(self);
16082    }
16083}
16084
16085impl SymlinkDeprecatedGetFlagsResponder {
16086    /// Sends a response to the FIDL transaction.
16087    ///
16088    /// Sets the channel to shutdown if an error occurs.
16089    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16090        let _result = self.send_raw(s, flags);
16091        if _result.is_err() {
16092            self.control_handle.shutdown();
16093        }
16094        self.drop_without_shutdown();
16095        _result
16096    }
16097
16098    /// Similar to "send" but does not shutdown the channel if an error occurs.
16099    pub fn send_no_shutdown_on_err(
16100        self,
16101        mut s: i32,
16102        mut flags: OpenFlags,
16103    ) -> Result<(), fidl::Error> {
16104        let _result = self.send_raw(s, flags);
16105        self.drop_without_shutdown();
16106        _result
16107    }
16108
16109    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
16110        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
16111            (s, flags),
16112            self.tx_id,
16113            0x5b88fffb8eda3aa1,
16114            fidl::encoding::DynamicFlags::empty(),
16115        )
16116    }
16117}
16118
16119#[must_use = "FIDL methods require a response to be sent"]
16120#[derive(Debug)]
16121pub struct SymlinkDeprecatedSetFlagsResponder {
16122    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16123    tx_id: u32,
16124}
16125
16126/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16127/// if the responder is dropped without sending a response, so that the client
16128/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16129impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
16130    fn drop(&mut self) {
16131        self.control_handle.shutdown();
16132        // Safety: drops once, never accessed again
16133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16134    }
16135}
16136
16137impl fdomain_client::fidl::Responder for SymlinkDeprecatedSetFlagsResponder {
16138    type ControlHandle = SymlinkControlHandle;
16139
16140    fn control_handle(&self) -> &SymlinkControlHandle {
16141        &self.control_handle
16142    }
16143
16144    fn drop_without_shutdown(mut self) {
16145        // Safety: drops once, never accessed again due to mem::forget
16146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16147        // Prevent Drop from running (which would shut down the channel)
16148        std::mem::forget(self);
16149    }
16150}
16151
16152impl SymlinkDeprecatedSetFlagsResponder {
16153    /// Sends a response to the FIDL transaction.
16154    ///
16155    /// Sets the channel to shutdown if an error occurs.
16156    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
16157        let _result = self.send_raw(s);
16158        if _result.is_err() {
16159            self.control_handle.shutdown();
16160        }
16161        self.drop_without_shutdown();
16162        _result
16163    }
16164
16165    /// Similar to "send" but does not shutdown the channel if an error occurs.
16166    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
16167        let _result = self.send_raw(s);
16168        self.drop_without_shutdown();
16169        _result
16170    }
16171
16172    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
16173        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
16174            (s,),
16175            self.tx_id,
16176            0x5295b76c71fde733,
16177            fidl::encoding::DynamicFlags::empty(),
16178        )
16179    }
16180}
16181
16182#[must_use = "FIDL methods require a response to be sent"]
16183#[derive(Debug)]
16184pub struct SymlinkGetFlagsResponder {
16185    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16186    tx_id: u32,
16187}
16188
16189/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16190/// if the responder is dropped without sending a response, so that the client
16191/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16192impl std::ops::Drop for SymlinkGetFlagsResponder {
16193    fn drop(&mut self) {
16194        self.control_handle.shutdown();
16195        // Safety: drops once, never accessed again
16196        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16197    }
16198}
16199
16200impl fdomain_client::fidl::Responder for SymlinkGetFlagsResponder {
16201    type ControlHandle = SymlinkControlHandle;
16202
16203    fn control_handle(&self) -> &SymlinkControlHandle {
16204        &self.control_handle
16205    }
16206
16207    fn drop_without_shutdown(mut self) {
16208        // Safety: drops once, never accessed again due to mem::forget
16209        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16210        // Prevent Drop from running (which would shut down the channel)
16211        std::mem::forget(self);
16212    }
16213}
16214
16215impl SymlinkGetFlagsResponder {
16216    /// Sends a response to the FIDL transaction.
16217    ///
16218    /// Sets the channel to shutdown if an error occurs.
16219    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16220        let _result = self.send_raw(result);
16221        if _result.is_err() {
16222            self.control_handle.shutdown();
16223        }
16224        self.drop_without_shutdown();
16225        _result
16226    }
16227
16228    /// Similar to "send" but does not shutdown the channel if an error occurs.
16229    pub fn send_no_shutdown_on_err(
16230        self,
16231        mut result: Result<Flags, i32>,
16232    ) -> Result<(), fidl::Error> {
16233        let _result = self.send_raw(result);
16234        self.drop_without_shutdown();
16235        _result
16236    }
16237
16238    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
16239        self.control_handle
16240            .inner
16241            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
16242                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
16243                self.tx_id,
16244                0x176eb318f64ec23,
16245                fidl::encoding::DynamicFlags::FLEXIBLE,
16246            )
16247    }
16248}
16249
16250#[must_use = "FIDL methods require a response to be sent"]
16251#[derive(Debug)]
16252pub struct SymlinkSetFlagsResponder {
16253    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16254    tx_id: u32,
16255}
16256
16257/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16258/// if the responder is dropped without sending a response, so that the client
16259/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16260impl std::ops::Drop for SymlinkSetFlagsResponder {
16261    fn drop(&mut self) {
16262        self.control_handle.shutdown();
16263        // Safety: drops once, never accessed again
16264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16265    }
16266}
16267
16268impl fdomain_client::fidl::Responder for SymlinkSetFlagsResponder {
16269    type ControlHandle = SymlinkControlHandle;
16270
16271    fn control_handle(&self) -> &SymlinkControlHandle {
16272        &self.control_handle
16273    }
16274
16275    fn drop_without_shutdown(mut self) {
16276        // Safety: drops once, never accessed again due to mem::forget
16277        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16278        // Prevent Drop from running (which would shut down the channel)
16279        std::mem::forget(self);
16280    }
16281}
16282
16283impl SymlinkSetFlagsResponder {
16284    /// Sends a response to the FIDL transaction.
16285    ///
16286    /// Sets the channel to shutdown if an error occurs.
16287    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16288        let _result = self.send_raw(result);
16289        if _result.is_err() {
16290            self.control_handle.shutdown();
16291        }
16292        self.drop_without_shutdown();
16293        _result
16294    }
16295
16296    /// Similar to "send" but does not shutdown the channel if an error occurs.
16297    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16298        let _result = self.send_raw(result);
16299        self.drop_without_shutdown();
16300        _result
16301    }
16302
16303    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16304        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
16305            fidl::encoding::EmptyStruct,
16306            i32,
16307        >>(
16308            fidl::encoding::FlexibleResult::new(result),
16309            self.tx_id,
16310            0x55a8028685791ea8,
16311            fidl::encoding::DynamicFlags::FLEXIBLE,
16312        )
16313    }
16314}
16315
16316#[must_use = "FIDL methods require a response to be sent"]
16317#[derive(Debug)]
16318pub struct SymlinkQueryFilesystemResponder {
16319    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16320    tx_id: u32,
16321}
16322
16323/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16324/// if the responder is dropped without sending a response, so that the client
16325/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16326impl std::ops::Drop for SymlinkQueryFilesystemResponder {
16327    fn drop(&mut self) {
16328        self.control_handle.shutdown();
16329        // Safety: drops once, never accessed again
16330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16331    }
16332}
16333
16334impl fdomain_client::fidl::Responder for SymlinkQueryFilesystemResponder {
16335    type ControlHandle = SymlinkControlHandle;
16336
16337    fn control_handle(&self) -> &SymlinkControlHandle {
16338        &self.control_handle
16339    }
16340
16341    fn drop_without_shutdown(mut self) {
16342        // Safety: drops once, never accessed again due to mem::forget
16343        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16344        // Prevent Drop from running (which would shut down the channel)
16345        std::mem::forget(self);
16346    }
16347}
16348
16349impl SymlinkQueryFilesystemResponder {
16350    /// Sends a response to the FIDL transaction.
16351    ///
16352    /// Sets the channel to shutdown if an error occurs.
16353    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16354        let _result = self.send_raw(s, info);
16355        if _result.is_err() {
16356            self.control_handle.shutdown();
16357        }
16358        self.drop_without_shutdown();
16359        _result
16360    }
16361
16362    /// Similar to "send" but does not shutdown the channel if an error occurs.
16363    pub fn send_no_shutdown_on_err(
16364        self,
16365        mut s: i32,
16366        mut info: Option<&FilesystemInfo>,
16367    ) -> Result<(), fidl::Error> {
16368        let _result = self.send_raw(s, info);
16369        self.drop_without_shutdown();
16370        _result
16371    }
16372
16373    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
16374        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
16375            (s, info),
16376            self.tx_id,
16377            0x6f344a1c6b0a0610,
16378            fidl::encoding::DynamicFlags::empty(),
16379        )
16380    }
16381}
16382
16383#[must_use = "FIDL methods require a response to be sent"]
16384#[derive(Debug)]
16385pub struct SymlinkGetAttributesResponder {
16386    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16387    tx_id: u32,
16388}
16389
16390/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16391/// if the responder is dropped without sending a response, so that the client
16392/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16393impl std::ops::Drop for SymlinkGetAttributesResponder {
16394    fn drop(&mut self) {
16395        self.control_handle.shutdown();
16396        // Safety: drops once, never accessed again
16397        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16398    }
16399}
16400
16401impl fdomain_client::fidl::Responder for SymlinkGetAttributesResponder {
16402    type ControlHandle = SymlinkControlHandle;
16403
16404    fn control_handle(&self) -> &SymlinkControlHandle {
16405        &self.control_handle
16406    }
16407
16408    fn drop_without_shutdown(mut self) {
16409        // Safety: drops once, never accessed again due to mem::forget
16410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16411        // Prevent Drop from running (which would shut down the channel)
16412        std::mem::forget(self);
16413    }
16414}
16415
16416impl SymlinkGetAttributesResponder {
16417    /// Sends a response to the FIDL transaction.
16418    ///
16419    /// Sets the channel to shutdown if an error occurs.
16420    pub fn send(
16421        self,
16422        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16423    ) -> Result<(), fidl::Error> {
16424        let _result = self.send_raw(result);
16425        if _result.is_err() {
16426            self.control_handle.shutdown();
16427        }
16428        self.drop_without_shutdown();
16429        _result
16430    }
16431
16432    /// Similar to "send" but does not shutdown the channel if an error occurs.
16433    pub fn send_no_shutdown_on_err(
16434        self,
16435        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16436    ) -> Result<(), fidl::Error> {
16437        let _result = self.send_raw(result);
16438        self.drop_without_shutdown();
16439        _result
16440    }
16441
16442    fn send_raw(
16443        &self,
16444        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
16445    ) -> Result<(), fidl::Error> {
16446        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
16447            result,
16448            self.tx_id,
16449            0x3d4396a638ea053b,
16450            fidl::encoding::DynamicFlags::empty(),
16451        )
16452    }
16453}
16454
16455#[must_use = "FIDL methods require a response to be sent"]
16456#[derive(Debug)]
16457pub struct SymlinkUpdateAttributesResponder {
16458    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16459    tx_id: u32,
16460}
16461
16462/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16463/// if the responder is dropped without sending a response, so that the client
16464/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16465impl std::ops::Drop for SymlinkUpdateAttributesResponder {
16466    fn drop(&mut self) {
16467        self.control_handle.shutdown();
16468        // Safety: drops once, never accessed again
16469        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16470    }
16471}
16472
16473impl fdomain_client::fidl::Responder for SymlinkUpdateAttributesResponder {
16474    type ControlHandle = SymlinkControlHandle;
16475
16476    fn control_handle(&self) -> &SymlinkControlHandle {
16477        &self.control_handle
16478    }
16479
16480    fn drop_without_shutdown(mut self) {
16481        // Safety: drops once, never accessed again due to mem::forget
16482        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16483        // Prevent Drop from running (which would shut down the channel)
16484        std::mem::forget(self);
16485    }
16486}
16487
16488impl SymlinkUpdateAttributesResponder {
16489    /// Sends a response to the FIDL transaction.
16490    ///
16491    /// Sets the channel to shutdown if an error occurs.
16492    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16493        let _result = self.send_raw(result);
16494        if _result.is_err() {
16495            self.control_handle.shutdown();
16496        }
16497        self.drop_without_shutdown();
16498        _result
16499    }
16500
16501    /// Similar to "send" but does not shutdown the channel if an error occurs.
16502    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16503        let _result = self.send_raw(result);
16504        self.drop_without_shutdown();
16505        _result
16506    }
16507
16508    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16509        self.control_handle
16510            .inner
16511            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16512                result,
16513                self.tx_id,
16514                0x3308c1da5a89bf08,
16515                fidl::encoding::DynamicFlags::empty(),
16516            )
16517    }
16518}
16519
16520#[must_use = "FIDL methods require a response to be sent"]
16521#[derive(Debug)]
16522pub struct SymlinkSyncResponder {
16523    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16524    tx_id: u32,
16525}
16526
16527/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16528/// if the responder is dropped without sending a response, so that the client
16529/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16530impl std::ops::Drop for SymlinkSyncResponder {
16531    fn drop(&mut self) {
16532        self.control_handle.shutdown();
16533        // Safety: drops once, never accessed again
16534        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16535    }
16536}
16537
16538impl fdomain_client::fidl::Responder for SymlinkSyncResponder {
16539    type ControlHandle = SymlinkControlHandle;
16540
16541    fn control_handle(&self) -> &SymlinkControlHandle {
16542        &self.control_handle
16543    }
16544
16545    fn drop_without_shutdown(mut self) {
16546        // Safety: drops once, never accessed again due to mem::forget
16547        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16548        // Prevent Drop from running (which would shut down the channel)
16549        std::mem::forget(self);
16550    }
16551}
16552
16553impl SymlinkSyncResponder {
16554    /// Sends a response to the FIDL transaction.
16555    ///
16556    /// Sets the channel to shutdown if an error occurs.
16557    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16558        let _result = self.send_raw(result);
16559        if _result.is_err() {
16560            self.control_handle.shutdown();
16561        }
16562        self.drop_without_shutdown();
16563        _result
16564    }
16565
16566    /// Similar to "send" but does not shutdown the channel if an error occurs.
16567    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16568        let _result = self.send_raw(result);
16569        self.drop_without_shutdown();
16570        _result
16571    }
16572
16573    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16574        self.control_handle
16575            .inner
16576            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16577                result,
16578                self.tx_id,
16579                0x2c5c27ca0ab5dc49,
16580                fidl::encoding::DynamicFlags::empty(),
16581            )
16582    }
16583}
16584
16585#[must_use = "FIDL methods require a response to be sent"]
16586#[derive(Debug)]
16587pub struct SymlinkGetExtendedAttributeResponder {
16588    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16589    tx_id: u32,
16590}
16591
16592/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16593/// if the responder is dropped without sending a response, so that the client
16594/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16595impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
16596    fn drop(&mut self) {
16597        self.control_handle.shutdown();
16598        // Safety: drops once, never accessed again
16599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16600    }
16601}
16602
16603impl fdomain_client::fidl::Responder for SymlinkGetExtendedAttributeResponder {
16604    type ControlHandle = SymlinkControlHandle;
16605
16606    fn control_handle(&self) -> &SymlinkControlHandle {
16607        &self.control_handle
16608    }
16609
16610    fn drop_without_shutdown(mut self) {
16611        // Safety: drops once, never accessed again due to mem::forget
16612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16613        // Prevent Drop from running (which would shut down the channel)
16614        std::mem::forget(self);
16615    }
16616}
16617
16618impl SymlinkGetExtendedAttributeResponder {
16619    /// Sends a response to the FIDL transaction.
16620    ///
16621    /// Sets the channel to shutdown if an error occurs.
16622    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16623        let _result = self.send_raw(result);
16624        if _result.is_err() {
16625            self.control_handle.shutdown();
16626        }
16627        self.drop_without_shutdown();
16628        _result
16629    }
16630
16631    /// Similar to "send" but does not shutdown the channel if an error occurs.
16632    pub fn send_no_shutdown_on_err(
16633        self,
16634        mut result: Result<ExtendedAttributeValue, i32>,
16635    ) -> Result<(), fidl::Error> {
16636        let _result = self.send_raw(result);
16637        self.drop_without_shutdown();
16638        _result
16639    }
16640
16641    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
16642        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
16643            result.as_mut().map_err(|e| *e),
16644            self.tx_id,
16645            0x45ffa3ccfdeb76db,
16646            fidl::encoding::DynamicFlags::empty(),
16647        )
16648    }
16649}
16650
16651#[must_use = "FIDL methods require a response to be sent"]
16652#[derive(Debug)]
16653pub struct SymlinkSetExtendedAttributeResponder {
16654    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16655    tx_id: u32,
16656}
16657
16658/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16659/// if the responder is dropped without sending a response, so that the client
16660/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16661impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
16662    fn drop(&mut self) {
16663        self.control_handle.shutdown();
16664        // Safety: drops once, never accessed again
16665        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16666    }
16667}
16668
16669impl fdomain_client::fidl::Responder for SymlinkSetExtendedAttributeResponder {
16670    type ControlHandle = SymlinkControlHandle;
16671
16672    fn control_handle(&self) -> &SymlinkControlHandle {
16673        &self.control_handle
16674    }
16675
16676    fn drop_without_shutdown(mut self) {
16677        // Safety: drops once, never accessed again due to mem::forget
16678        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16679        // Prevent Drop from running (which would shut down the channel)
16680        std::mem::forget(self);
16681    }
16682}
16683
16684impl SymlinkSetExtendedAttributeResponder {
16685    /// Sends a response to the FIDL transaction.
16686    ///
16687    /// Sets the channel to shutdown if an error occurs.
16688    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16689        let _result = self.send_raw(result);
16690        if _result.is_err() {
16691            self.control_handle.shutdown();
16692        }
16693        self.drop_without_shutdown();
16694        _result
16695    }
16696
16697    /// Similar to "send" but does not shutdown the channel if an error occurs.
16698    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16699        let _result = self.send_raw(result);
16700        self.drop_without_shutdown();
16701        _result
16702    }
16703
16704    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16705        self.control_handle
16706            .inner
16707            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16708                result,
16709                self.tx_id,
16710                0x4a951362f681f23c,
16711                fidl::encoding::DynamicFlags::empty(),
16712            )
16713    }
16714}
16715
16716#[must_use = "FIDL methods require a response to be sent"]
16717#[derive(Debug)]
16718pub struct SymlinkRemoveExtendedAttributeResponder {
16719    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16720    tx_id: u32,
16721}
16722
16723/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16724/// if the responder is dropped without sending a response, so that the client
16725/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16726impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
16727    fn drop(&mut self) {
16728        self.control_handle.shutdown();
16729        // Safety: drops once, never accessed again
16730        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16731    }
16732}
16733
16734impl fdomain_client::fidl::Responder for SymlinkRemoveExtendedAttributeResponder {
16735    type ControlHandle = SymlinkControlHandle;
16736
16737    fn control_handle(&self) -> &SymlinkControlHandle {
16738        &self.control_handle
16739    }
16740
16741    fn drop_without_shutdown(mut self) {
16742        // Safety: drops once, never accessed again due to mem::forget
16743        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16744        // Prevent Drop from running (which would shut down the channel)
16745        std::mem::forget(self);
16746    }
16747}
16748
16749impl SymlinkRemoveExtendedAttributeResponder {
16750    /// Sends a response to the FIDL transaction.
16751    ///
16752    /// Sets the channel to shutdown if an error occurs.
16753    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16754        let _result = self.send_raw(result);
16755        if _result.is_err() {
16756            self.control_handle.shutdown();
16757        }
16758        self.drop_without_shutdown();
16759        _result
16760    }
16761
16762    /// Similar to "send" but does not shutdown the channel if an error occurs.
16763    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16764        let _result = self.send_raw(result);
16765        self.drop_without_shutdown();
16766        _result
16767    }
16768
16769    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
16770        self.control_handle
16771            .inner
16772            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
16773                result,
16774                self.tx_id,
16775                0x7a0b9f3a9bf9032d,
16776                fidl::encoding::DynamicFlags::empty(),
16777            )
16778    }
16779}
16780
16781#[must_use = "FIDL methods require a response to be sent"]
16782#[derive(Debug)]
16783pub struct SymlinkDescribeResponder {
16784    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
16785    tx_id: u32,
16786}
16787
16788/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
16789/// if the responder is dropped without sending a response, so that the client
16790/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16791impl std::ops::Drop for SymlinkDescribeResponder {
16792    fn drop(&mut self) {
16793        self.control_handle.shutdown();
16794        // Safety: drops once, never accessed again
16795        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16796    }
16797}
16798
16799impl fdomain_client::fidl::Responder for SymlinkDescribeResponder {
16800    type ControlHandle = SymlinkControlHandle;
16801
16802    fn control_handle(&self) -> &SymlinkControlHandle {
16803        &self.control_handle
16804    }
16805
16806    fn drop_without_shutdown(mut self) {
16807        // Safety: drops once, never accessed again due to mem::forget
16808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16809        // Prevent Drop from running (which would shut down the channel)
16810        std::mem::forget(self);
16811    }
16812}
16813
16814impl SymlinkDescribeResponder {
16815    /// Sends a response to the FIDL transaction.
16816    ///
16817    /// Sets the channel to shutdown if an error occurs.
16818    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16819        let _result = self.send_raw(payload);
16820        if _result.is_err() {
16821            self.control_handle.shutdown();
16822        }
16823        self.drop_without_shutdown();
16824        _result
16825    }
16826
16827    /// Similar to "send" but does not shutdown the channel if an error occurs.
16828    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16829        let _result = self.send_raw(payload);
16830        self.drop_without_shutdown();
16831        _result
16832    }
16833
16834    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
16835        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
16836            fidl::encoding::Flexible::new(payload),
16837            self.tx_id,
16838            0x742c2ea5e89831f3,
16839            fidl::encoding::DynamicFlags::FLEXIBLE,
16840        )
16841    }
16842}
16843
16844#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16845pub struct WritableMarker;
16846
16847impl fdomain_client::fidl::ProtocolMarker for WritableMarker {
16848    type Proxy = WritableProxy;
16849    type RequestStream = WritableRequestStream;
16850
16851    const DEBUG_NAME: &'static str = "(anonymous) Writable";
16852}
16853pub type WritableWriteResult = Result<u64, i32>;
16854
16855pub trait WritableProxyInterface: Send + Sync {
16856    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
16857        + Send;
16858    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
16859}
16860
16861#[derive(Debug, Clone)]
16862pub struct WritableProxy {
16863    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
16864}
16865
16866impl fdomain_client::fidl::Proxy for WritableProxy {
16867    type Protocol = WritableMarker;
16868
16869    fn from_channel(inner: fdomain_client::Channel) -> Self {
16870        Self::new(inner)
16871    }
16872
16873    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
16874        self.client.into_channel().map_err(|client| Self { client })
16875    }
16876
16877    fn as_channel(&self) -> &fdomain_client::Channel {
16878        self.client.as_channel()
16879    }
16880}
16881
16882impl WritableProxy {
16883    /// Create a new Proxy for fuchsia.io/Writable.
16884    pub fn new(channel: fdomain_client::Channel) -> Self {
16885        let protocol_name = <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
16886        Self { client: fidl::client::Client::new(channel, protocol_name) }
16887    }
16888
16889    /// Get a Stream of events from the remote end of the protocol.
16890    ///
16891    /// # Panics
16892    ///
16893    /// Panics if the event stream was already taken.
16894    pub fn take_event_stream(&self) -> WritableEventStream {
16895        WritableEventStream { event_receiver: self.client.take_event_receiver() }
16896    }
16897
16898    /// Writes data at the seek offset.
16899    /// The seek offset is moved forward by the number of bytes written.
16900    /// If the file is in append mode, the seek offset is first set to the end
16901    /// of the file, followed by the write, in one atomic step.
16902    ///
16903    /// The file size may grow if the seek offset plus `data.length` is beyond
16904    /// the current end of file.
16905    ///
16906    /// + request `data` the byte buffer to write to the file.
16907    /// - response `actual_count` the number of bytes written.
16908    ///
16909    /// ## Invariants
16910    ///
16911    /// * The returned `actual_count` will never be greater than `data.length`.
16912    /// * If the server is unable to write all the data due to e.g. not enough
16913    ///   space, `actual_count` may be less than `data.length`.  If no bytes
16914    ///   could be written, an error is returned.
16915    /// * If `data.length` is zero, the server should perform all the checks
16916    ///   ensuring write access without mutating the file and return a
16917    ///   successful write of zero bytes.  The seek offset is still updated if
16918    ///   in append mode.
16919    ///
16920    /// This method requires the [`Rights.WRITE_BYTES`] right.
16921    pub fn r#write(
16922        &self,
16923        mut data: &[u8],
16924    ) -> fidl::client::QueryResponseFut<
16925        WritableWriteResult,
16926        fdomain_client::fidl::FDomainResourceDialect,
16927    > {
16928        WritableProxyInterface::r#write(self, data)
16929    }
16930}
16931
16932impl WritableProxyInterface for WritableProxy {
16933    type WriteResponseFut = fidl::client::QueryResponseFut<
16934        WritableWriteResult,
16935        fdomain_client::fidl::FDomainResourceDialect,
16936    >;
16937    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
16938        fn _decode(
16939            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16940        ) -> Result<WritableWriteResult, fidl::Error> {
16941            let _response = fidl::client::decode_transaction_body::<
16942                fidl::encoding::ResultType<WritableWriteResponse, i32>,
16943                fdomain_client::fidl::FDomainResourceDialect,
16944                0x6a31437832469f82,
16945            >(_buf?)?;
16946            Ok(_response.map(|x| x.actual_count))
16947        }
16948        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
16949            (data,),
16950            0x6a31437832469f82,
16951            fidl::encoding::DynamicFlags::empty(),
16952            _decode,
16953        )
16954    }
16955}
16956
16957pub struct WritableEventStream {
16958    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
16959}
16960
16961impl std::marker::Unpin for WritableEventStream {}
16962
16963impl futures::stream::FusedStream for WritableEventStream {
16964    fn is_terminated(&self) -> bool {
16965        self.event_receiver.is_terminated()
16966    }
16967}
16968
16969impl futures::Stream for WritableEventStream {
16970    type Item = Result<WritableEvent, fidl::Error>;
16971
16972    fn poll_next(
16973        mut self: std::pin::Pin<&mut Self>,
16974        cx: &mut std::task::Context<'_>,
16975    ) -> std::task::Poll<Option<Self::Item>> {
16976        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16977            &mut self.event_receiver,
16978            cx
16979        )?) {
16980            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
16981            None => std::task::Poll::Ready(None),
16982        }
16983    }
16984}
16985
16986#[derive(Debug)]
16987pub enum WritableEvent {}
16988
16989impl WritableEvent {
16990    /// Decodes a message buffer as a [`WritableEvent`].
16991    fn decode(
16992        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16993    ) -> Result<WritableEvent, fidl::Error> {
16994        let (bytes, _handles) = buf.split_mut();
16995        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16996        debug_assert_eq!(tx_header.tx_id, 0);
16997        match tx_header.ordinal {
16998            _ => Err(fidl::Error::UnknownOrdinal {
16999                ordinal: tx_header.ordinal,
17000                protocol_name: <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17001            }),
17002        }
17003    }
17004}
17005
17006/// A Stream of incoming requests for fuchsia.io/Writable.
17007pub struct WritableRequestStream {
17008    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17009    is_terminated: bool,
17010}
17011
17012impl std::marker::Unpin for WritableRequestStream {}
17013
17014impl futures::stream::FusedStream for WritableRequestStream {
17015    fn is_terminated(&self) -> bool {
17016        self.is_terminated
17017    }
17018}
17019
17020impl fdomain_client::fidl::RequestStream for WritableRequestStream {
17021    type Protocol = WritableMarker;
17022    type ControlHandle = WritableControlHandle;
17023
17024    fn from_channel(channel: fdomain_client::Channel) -> Self {
17025        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
17026    }
17027
17028    fn control_handle(&self) -> Self::ControlHandle {
17029        WritableControlHandle { inner: self.inner.clone() }
17030    }
17031
17032    fn into_inner(
17033        self,
17034    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
17035    {
17036        (self.inner, self.is_terminated)
17037    }
17038
17039    fn from_inner(
17040        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17041        is_terminated: bool,
17042    ) -> Self {
17043        Self { inner, is_terminated }
17044    }
17045}
17046
17047impl futures::Stream for WritableRequestStream {
17048    type Item = Result<WritableRequest, fidl::Error>;
17049
17050    fn poll_next(
17051        mut self: std::pin::Pin<&mut Self>,
17052        cx: &mut std::task::Context<'_>,
17053    ) -> std::task::Poll<Option<Self::Item>> {
17054        let this = &mut *self;
17055        if this.inner.check_shutdown(cx) {
17056            this.is_terminated = true;
17057            return std::task::Poll::Ready(None);
17058        }
17059        if this.is_terminated {
17060            panic!("polled WritableRequestStream after completion");
17061        }
17062        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
17063            |bytes, handles| {
17064                match this.inner.channel().read_etc(cx, bytes, handles) {
17065                    std::task::Poll::Ready(Ok(())) => {}
17066                    std::task::Poll::Pending => return std::task::Poll::Pending,
17067                    std::task::Poll::Ready(Err(None)) => {
17068                        this.is_terminated = true;
17069                        return std::task::Poll::Ready(None);
17070                    }
17071                    std::task::Poll::Ready(Err(Some(e))) => {
17072                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
17073                            e.into(),
17074                        ))));
17075                    }
17076                }
17077
17078                // A message has been received from the channel
17079                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
17080
17081                std::task::Poll::Ready(Some(match header.ordinal {
17082                    0x6a31437832469f82 => {
17083                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
17084                        let mut req = fidl::new_empty!(
17085                            WritableWriteRequest,
17086                            fdomain_client::fidl::FDomainResourceDialect
17087                        );
17088                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
17089                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
17090                        Ok(WritableRequest::Write {
17091                            data: req.data,
17092
17093                            responder: WritableWriteResponder {
17094                                control_handle: std::mem::ManuallyDrop::new(control_handle),
17095                                tx_id: header.tx_id,
17096                            },
17097                        })
17098                    }
17099                    _ => Err(fidl::Error::UnknownOrdinal {
17100                        ordinal: header.ordinal,
17101                        protocol_name:
17102                            <WritableMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
17103                    }),
17104                }))
17105            },
17106        )
17107    }
17108}
17109
17110#[derive(Debug)]
17111pub enum WritableRequest {
17112    /// Writes data at the seek offset.
17113    /// The seek offset is moved forward by the number of bytes written.
17114    /// If the file is in append mode, the seek offset is first set to the end
17115    /// of the file, followed by the write, in one atomic step.
17116    ///
17117    /// The file size may grow if the seek offset plus `data.length` is beyond
17118    /// the current end of file.
17119    ///
17120    /// + request `data` the byte buffer to write to the file.
17121    /// - response `actual_count` the number of bytes written.
17122    ///
17123    /// ## Invariants
17124    ///
17125    /// * The returned `actual_count` will never be greater than `data.length`.
17126    /// * If the server is unable to write all the data due to e.g. not enough
17127    ///   space, `actual_count` may be less than `data.length`.  If no bytes
17128    ///   could be written, an error is returned.
17129    /// * If `data.length` is zero, the server should perform all the checks
17130    ///   ensuring write access without mutating the file and return a
17131    ///   successful write of zero bytes.  The seek offset is still updated if
17132    ///   in append mode.
17133    ///
17134    /// This method requires the [`Rights.WRITE_BYTES`] right.
17135    Write { data: Vec<u8>, responder: WritableWriteResponder },
17136}
17137
17138impl WritableRequest {
17139    #[allow(irrefutable_let_patterns)]
17140    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
17141        if let WritableRequest::Write { data, responder } = self {
17142            Some((data, responder))
17143        } else {
17144            None
17145        }
17146    }
17147
17148    /// Name of the method defined in FIDL
17149    pub fn method_name(&self) -> &'static str {
17150        match *self {
17151            WritableRequest::Write { .. } => "write",
17152        }
17153    }
17154}
17155
17156#[derive(Debug, Clone)]
17157pub struct WritableControlHandle {
17158    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
17159}
17160
17161impl fdomain_client::fidl::ControlHandle for WritableControlHandle {
17162    fn shutdown(&self) {
17163        self.inner.shutdown()
17164    }
17165
17166    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
17167        self.inner.shutdown_with_epitaph(status)
17168    }
17169
17170    fn is_closed(&self) -> bool {
17171        self.inner.channel().is_closed()
17172    }
17173    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
17174        self.inner.channel().on_closed()
17175    }
17176}
17177
17178impl WritableControlHandle {}
17179
17180#[must_use = "FIDL methods require a response to be sent"]
17181#[derive(Debug)]
17182pub struct WritableWriteResponder {
17183    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
17184    tx_id: u32,
17185}
17186
17187/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
17188/// if the responder is dropped without sending a response, so that the client
17189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
17190impl std::ops::Drop for WritableWriteResponder {
17191    fn drop(&mut self) {
17192        self.control_handle.shutdown();
17193        // Safety: drops once, never accessed again
17194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17195    }
17196}
17197
17198impl fdomain_client::fidl::Responder for WritableWriteResponder {
17199    type ControlHandle = WritableControlHandle;
17200
17201    fn control_handle(&self) -> &WritableControlHandle {
17202        &self.control_handle
17203    }
17204
17205    fn drop_without_shutdown(mut self) {
17206        // Safety: drops once, never accessed again due to mem::forget
17207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
17208        // Prevent Drop from running (which would shut down the channel)
17209        std::mem::forget(self);
17210    }
17211}
17212
17213impl WritableWriteResponder {
17214    /// Sends a response to the FIDL transaction.
17215    ///
17216    /// Sets the channel to shutdown if an error occurs.
17217    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17218        let _result = self.send_raw(result);
17219        if _result.is_err() {
17220            self.control_handle.shutdown();
17221        }
17222        self.drop_without_shutdown();
17223        _result
17224    }
17225
17226    /// Similar to "send" but does not shutdown the channel if an error occurs.
17227    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17228        let _result = self.send_raw(result);
17229        self.drop_without_shutdown();
17230        _result
17231    }
17232
17233    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
17234        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
17235            result.map(|actual_count| (actual_count,)),
17236            self.tx_id,
17237            0x6a31437832469f82,
17238            fidl::encoding::DynamicFlags::empty(),
17239        )
17240    }
17241}
17242
17243mod internal {
17244    use super::*;
17245
17246    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
17247        type Borrowed<'a> = &'a mut Self;
17248        fn take_or_borrow<'a>(
17249            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17250        ) -> Self::Borrowed<'a> {
17251            value
17252        }
17253    }
17254
17255    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
17256        type Owned = Self;
17257
17258        #[inline(always)]
17259        fn inline_align(_context: fidl::encoding::Context) -> usize {
17260            8
17261        }
17262
17263        #[inline(always)]
17264        fn inline_size(_context: fidl::encoding::Context) -> usize {
17265            40
17266        }
17267    }
17268
17269    unsafe impl
17270        fidl::encoding::Encode<
17271            DirectoryCreateSymlinkRequest,
17272            fdomain_client::fidl::FDomainResourceDialect,
17273        > for &mut DirectoryCreateSymlinkRequest
17274    {
17275        #[inline]
17276        unsafe fn encode(
17277            self,
17278            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17279            offset: usize,
17280            _depth: fidl::encoding::Depth,
17281        ) -> fidl::Result<()> {
17282            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17283            // Delegate to tuple encoding.
17284            fidl::encoding::Encode::<
17285                DirectoryCreateSymlinkRequest,
17286                fdomain_client::fidl::FDomainResourceDialect,
17287            >::encode(
17288                (
17289                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17290                        &self.name,
17291                    ),
17292                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
17293                        &self.target,
17294                    ),
17295                    <fidl::encoding::Optional<
17296                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17297                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17298                        &mut self.connection
17299                    ),
17300                ),
17301                encoder,
17302                offset,
17303                _depth,
17304            )
17305        }
17306    }
17307    unsafe impl<
17308        T0: fidl::encoding::Encode<
17309                fidl::encoding::BoundedString<255>,
17310                fdomain_client::fidl::FDomainResourceDialect,
17311            >,
17312        T1: fidl::encoding::Encode<
17313                fidl::encoding::Vector<u8, 4095>,
17314                fdomain_client::fidl::FDomainResourceDialect,
17315            >,
17316        T2: fidl::encoding::Encode<
17317                fidl::encoding::Optional<
17318                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17319                >,
17320                fdomain_client::fidl::FDomainResourceDialect,
17321            >,
17322    >
17323        fidl::encoding::Encode<
17324            DirectoryCreateSymlinkRequest,
17325            fdomain_client::fidl::FDomainResourceDialect,
17326        > for (T0, T1, T2)
17327    {
17328        #[inline]
17329        unsafe fn encode(
17330            self,
17331            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17332            offset: usize,
17333            depth: fidl::encoding::Depth,
17334        ) -> fidl::Result<()> {
17335            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
17336            // Zero out padding regions. There's no need to apply masks
17337            // because the unmasked parts will be overwritten by fields.
17338            unsafe {
17339                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
17340                (ptr as *mut u64).write_unaligned(0);
17341            }
17342            // Write the fields.
17343            self.0.encode(encoder, offset + 0, depth)?;
17344            self.1.encode(encoder, offset + 16, depth)?;
17345            self.2.encode(encoder, offset + 32, depth)?;
17346            Ok(())
17347        }
17348    }
17349
17350    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17351        for DirectoryCreateSymlinkRequest
17352    {
17353        #[inline(always)]
17354        fn new_empty() -> Self {
17355            Self {
17356                name: fidl::new_empty!(
17357                    fidl::encoding::BoundedString<255>,
17358                    fdomain_client::fidl::FDomainResourceDialect
17359                ),
17360                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect),
17361                connection: fidl::new_empty!(
17362                    fidl::encoding::Optional<
17363                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17364                    >,
17365                    fdomain_client::fidl::FDomainResourceDialect
17366                ),
17367            }
17368        }
17369
17370        #[inline]
17371        unsafe fn decode(
17372            &mut self,
17373            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17374            offset: usize,
17375            _depth: fidl::encoding::Depth,
17376        ) -> fidl::Result<()> {
17377            decoder.debug_check_bounds::<Self>(offset);
17378            // Verify that padding bytes are zero.
17379            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
17380            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17381            let mask = 0xffffffff00000000u64;
17382            let maskedval = padval & mask;
17383            if maskedval != 0 {
17384                return Err(fidl::Error::NonZeroPadding {
17385                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
17386                });
17387            }
17388            fidl::decode!(
17389                fidl::encoding::BoundedString<255>,
17390                fdomain_client::fidl::FDomainResourceDialect,
17391                &mut self.name,
17392                decoder,
17393                offset + 0,
17394                _depth
17395            )?;
17396            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fdomain_client::fidl::FDomainResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
17397            fidl::decode!(
17398                fidl::encoding::Optional<
17399                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SymlinkMarker>>,
17400                >,
17401                fdomain_client::fidl::FDomainResourceDialect,
17402                &mut self.connection,
17403                decoder,
17404                offset + 32,
17405                _depth
17406            )?;
17407            Ok(())
17408        }
17409    }
17410
17411    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
17412        type Borrowed<'a> = &'a mut Self;
17413        fn take_or_borrow<'a>(
17414            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17415        ) -> Self::Borrowed<'a> {
17416            value
17417        }
17418    }
17419
17420    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
17421        type Owned = Self;
17422
17423        #[inline(always)]
17424        fn inline_align(_context: fidl::encoding::Context) -> usize {
17425            8
17426        }
17427
17428        #[inline(always)]
17429        fn inline_size(_context: fidl::encoding::Context) -> usize {
17430            32
17431        }
17432    }
17433
17434    unsafe impl
17435        fidl::encoding::Encode<
17436            DirectoryDeprecatedOpenRequest,
17437            fdomain_client::fidl::FDomainResourceDialect,
17438        > for &mut DirectoryDeprecatedOpenRequest
17439    {
17440        #[inline]
17441        unsafe fn encode(
17442            self,
17443            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17444            offset: usize,
17445            _depth: fidl::encoding::Depth,
17446        ) -> fidl::Result<()> {
17447            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17448            // Delegate to tuple encoding.
17449            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17450                (
17451                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17452                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
17453                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17454                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17455                ),
17456                encoder, offset, _depth
17457            )
17458        }
17459    }
17460    unsafe impl<
17461        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
17462        T1: fidl::encoding::Encode<ModeType, fdomain_client::fidl::FDomainResourceDialect>,
17463        T2: fidl::encoding::Encode<
17464                fidl::encoding::BoundedString<4095>,
17465                fdomain_client::fidl::FDomainResourceDialect,
17466            >,
17467        T3: fidl::encoding::Encode<
17468                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17469                fdomain_client::fidl::FDomainResourceDialect,
17470            >,
17471    >
17472        fidl::encoding::Encode<
17473            DirectoryDeprecatedOpenRequest,
17474            fdomain_client::fidl::FDomainResourceDialect,
17475        > for (T0, T1, T2, T3)
17476    {
17477        #[inline]
17478        unsafe fn encode(
17479            self,
17480            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17481            offset: usize,
17482            depth: fidl::encoding::Depth,
17483        ) -> fidl::Result<()> {
17484            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
17485            // Zero out padding regions. There's no need to apply masks
17486            // because the unmasked parts will be overwritten by fields.
17487            unsafe {
17488                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
17489                (ptr as *mut u64).write_unaligned(0);
17490            }
17491            // Write the fields.
17492            self.0.encode(encoder, offset + 0, depth)?;
17493            self.1.encode(encoder, offset + 4, depth)?;
17494            self.2.encode(encoder, offset + 8, depth)?;
17495            self.3.encode(encoder, offset + 24, depth)?;
17496            Ok(())
17497        }
17498    }
17499
17500    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17501        for DirectoryDeprecatedOpenRequest
17502    {
17503        #[inline(always)]
17504        fn new_empty() -> Self {
17505            Self {
17506                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
17507                mode: fidl::new_empty!(ModeType, fdomain_client::fidl::FDomainResourceDialect),
17508                path: fidl::new_empty!(
17509                    fidl::encoding::BoundedString<4095>,
17510                    fdomain_client::fidl::FDomainResourceDialect
17511                ),
17512                object: fidl::new_empty!(
17513                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17514                    fdomain_client::fidl::FDomainResourceDialect
17515                ),
17516            }
17517        }
17518
17519        #[inline]
17520        unsafe fn decode(
17521            &mut self,
17522            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17523            offset: usize,
17524            _depth: fidl::encoding::Depth,
17525        ) -> fidl::Result<()> {
17526            decoder.debug_check_bounds::<Self>(offset);
17527            // Verify that padding bytes are zero.
17528            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
17529            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17530            let mask = 0xffffffff00000000u64;
17531            let maskedval = padval & mask;
17532            if maskedval != 0 {
17533                return Err(fidl::Error::NonZeroPadding {
17534                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
17535                });
17536            }
17537            fidl::decode!(
17538                OpenFlags,
17539                fdomain_client::fidl::FDomainResourceDialect,
17540                &mut self.flags,
17541                decoder,
17542                offset + 0,
17543                _depth
17544            )?;
17545            fidl::decode!(
17546                ModeType,
17547                fdomain_client::fidl::FDomainResourceDialect,
17548                &mut self.mode,
17549                decoder,
17550                offset + 4,
17551                _depth
17552            )?;
17553            fidl::decode!(
17554                fidl::encoding::BoundedString<4095>,
17555                fdomain_client::fidl::FDomainResourceDialect,
17556                &mut self.path,
17557                decoder,
17558                offset + 8,
17559                _depth
17560            )?;
17561            fidl::decode!(
17562                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
17563                fdomain_client::fidl::FDomainResourceDialect,
17564                &mut self.object,
17565                decoder,
17566                offset + 24,
17567                _depth
17568            )?;
17569            Ok(())
17570        }
17571    }
17572
17573    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
17574        type Borrowed<'a> = &'a mut Self;
17575        fn take_or_borrow<'a>(
17576            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17577        ) -> Self::Borrowed<'a> {
17578            value
17579        }
17580    }
17581
17582    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
17583        type Owned = Self;
17584
17585        #[inline(always)]
17586        fn inline_align(_context: fidl::encoding::Context) -> usize {
17587            4
17588        }
17589
17590        #[inline(always)]
17591        fn inline_size(_context: fidl::encoding::Context) -> usize {
17592            8
17593        }
17594    }
17595
17596    unsafe impl
17597        fidl::encoding::Encode<
17598            DirectoryGetTokenResponse,
17599            fdomain_client::fidl::FDomainResourceDialect,
17600        > for &mut DirectoryGetTokenResponse
17601    {
17602        #[inline]
17603        unsafe fn encode(
17604            self,
17605            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17606            offset: usize,
17607            _depth: fidl::encoding::Depth,
17608        ) -> fidl::Result<()> {
17609            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
17610            // Delegate to tuple encoding.
17611            fidl::encoding::Encode::<
17612                DirectoryGetTokenResponse,
17613                fdomain_client::fidl::FDomainResourceDialect,
17614            >::encode(
17615                (
17616                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
17617                    <fidl::encoding::Optional<
17618                        fidl::encoding::HandleType<
17619                            fdomain_client::NullableHandle,
17620                            { fidl::ObjectType::NONE.into_raw() },
17621                            2147483648,
17622                        >,
17623                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17624                        &mut self.token
17625                    ),
17626                ),
17627                encoder,
17628                offset,
17629                _depth,
17630            )
17631        }
17632    }
17633    unsafe impl<
17634        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
17635        T1: fidl::encoding::Encode<
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        fidl::encoding::Encode<
17647            DirectoryGetTokenResponse,
17648            fdomain_client::fidl::FDomainResourceDialect,
17649        > for (T0, T1)
17650    {
17651        #[inline]
17652        unsafe fn encode(
17653            self,
17654            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17655            offset: usize,
17656            depth: fidl::encoding::Depth,
17657        ) -> fidl::Result<()> {
17658            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
17659            // Zero out padding regions. There's no need to apply masks
17660            // because the unmasked parts will be overwritten by fields.
17661            // Write the fields.
17662            self.0.encode(encoder, offset + 0, depth)?;
17663            self.1.encode(encoder, offset + 4, depth)?;
17664            Ok(())
17665        }
17666    }
17667
17668    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17669        for DirectoryGetTokenResponse
17670    {
17671        #[inline(always)]
17672        fn new_empty() -> Self {
17673            Self {
17674                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
17675                token: fidl::new_empty!(
17676                    fidl::encoding::Optional<
17677                        fidl::encoding::HandleType<
17678                            fdomain_client::NullableHandle,
17679                            { fidl::ObjectType::NONE.into_raw() },
17680                            2147483648,
17681                        >,
17682                    >,
17683                    fdomain_client::fidl::FDomainResourceDialect
17684                ),
17685            }
17686        }
17687
17688        #[inline]
17689        unsafe fn decode(
17690            &mut self,
17691            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17692            offset: usize,
17693            _depth: fidl::encoding::Depth,
17694        ) -> fidl::Result<()> {
17695            decoder.debug_check_bounds::<Self>(offset);
17696            // Verify that padding bytes are zero.
17697            fidl::decode!(
17698                i32,
17699                fdomain_client::fidl::FDomainResourceDialect,
17700                &mut self.s,
17701                decoder,
17702                offset + 0,
17703                _depth
17704            )?;
17705            fidl::decode!(
17706                fidl::encoding::Optional<
17707                    fidl::encoding::HandleType<
17708                        fdomain_client::NullableHandle,
17709                        { fidl::ObjectType::NONE.into_raw() },
17710                        2147483648,
17711                    >,
17712                >,
17713                fdomain_client::fidl::FDomainResourceDialect,
17714                &mut self.token,
17715                decoder,
17716                offset + 4,
17717                _depth
17718            )?;
17719            Ok(())
17720        }
17721    }
17722
17723    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
17724        type Borrowed<'a> = &'a mut Self;
17725        fn take_or_borrow<'a>(
17726            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17727        ) -> Self::Borrowed<'a> {
17728            value
17729        }
17730    }
17731
17732    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
17733        type Owned = Self;
17734
17735        #[inline(always)]
17736        fn inline_align(_context: fidl::encoding::Context) -> usize {
17737            8
17738        }
17739
17740        #[inline(always)]
17741        fn inline_size(_context: fidl::encoding::Context) -> usize {
17742            40
17743        }
17744    }
17745
17746    unsafe impl
17747        fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
17748        for &mut DirectoryLinkRequest
17749    {
17750        #[inline]
17751        unsafe fn encode(
17752            self,
17753            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17754            offset: usize,
17755            _depth: fidl::encoding::Depth,
17756        ) -> fidl::Result<()> {
17757            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
17758            // Delegate to tuple encoding.
17759            fidl::encoding::Encode::<
17760                DirectoryLinkRequest,
17761                fdomain_client::fidl::FDomainResourceDialect,
17762            >::encode(
17763                (
17764                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17765                        &self.src,
17766                    ),
17767                    <fidl::encoding::HandleType<
17768                        fdomain_client::NullableHandle,
17769                        { fidl::ObjectType::NONE.into_raw() },
17770                        2147483648,
17771                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17772                        &mut self.dst_parent_token,
17773                    ),
17774                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
17775                        &self.dst,
17776                    ),
17777                ),
17778                encoder,
17779                offset,
17780                _depth,
17781            )
17782        }
17783    }
17784    unsafe impl<
17785        T0: fidl::encoding::Encode<
17786                fidl::encoding::BoundedString<255>,
17787                fdomain_client::fidl::FDomainResourceDialect,
17788            >,
17789        T1: fidl::encoding::Encode<
17790                fidl::encoding::HandleType<
17791                    fdomain_client::NullableHandle,
17792                    { fidl::ObjectType::NONE.into_raw() },
17793                    2147483648,
17794                >,
17795                fdomain_client::fidl::FDomainResourceDialect,
17796            >,
17797        T2: fidl::encoding::Encode<
17798                fidl::encoding::BoundedString<255>,
17799                fdomain_client::fidl::FDomainResourceDialect,
17800            >,
17801    > fidl::encoding::Encode<DirectoryLinkRequest, fdomain_client::fidl::FDomainResourceDialect>
17802        for (T0, T1, T2)
17803    {
17804        #[inline]
17805        unsafe fn encode(
17806            self,
17807            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17808            offset: usize,
17809            depth: fidl::encoding::Depth,
17810        ) -> fidl::Result<()> {
17811            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
17812            // Zero out padding regions. There's no need to apply masks
17813            // because the unmasked parts will be overwritten by fields.
17814            unsafe {
17815                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
17816                (ptr as *mut u64).write_unaligned(0);
17817            }
17818            // Write the fields.
17819            self.0.encode(encoder, offset + 0, depth)?;
17820            self.1.encode(encoder, offset + 16, depth)?;
17821            self.2.encode(encoder, offset + 24, depth)?;
17822            Ok(())
17823        }
17824    }
17825
17826    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17827        for DirectoryLinkRequest
17828    {
17829        #[inline(always)]
17830        fn new_empty() -> Self {
17831            Self {
17832                src: fidl::new_empty!(
17833                    fidl::encoding::BoundedString<255>,
17834                    fdomain_client::fidl::FDomainResourceDialect
17835                ),
17836                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
17837                dst: fidl::new_empty!(
17838                    fidl::encoding::BoundedString<255>,
17839                    fdomain_client::fidl::FDomainResourceDialect
17840                ),
17841            }
17842        }
17843
17844        #[inline]
17845        unsafe fn decode(
17846            &mut self,
17847            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17848            offset: usize,
17849            _depth: fidl::encoding::Depth,
17850        ) -> fidl::Result<()> {
17851            decoder.debug_check_bounds::<Self>(offset);
17852            // Verify that padding bytes are zero.
17853            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
17854            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17855            let mask = 0xffffffff00000000u64;
17856            let maskedval = padval & mask;
17857            if maskedval != 0 {
17858                return Err(fidl::Error::NonZeroPadding {
17859                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
17860                });
17861            }
17862            fidl::decode!(
17863                fidl::encoding::BoundedString<255>,
17864                fdomain_client::fidl::FDomainResourceDialect,
17865                &mut self.src,
17866                decoder,
17867                offset + 0,
17868                _depth
17869            )?;
17870            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)?;
17871            fidl::decode!(
17872                fidl::encoding::BoundedString<255>,
17873                fdomain_client::fidl::FDomainResourceDialect,
17874                &mut self.dst,
17875                decoder,
17876                offset + 24,
17877                _depth
17878            )?;
17879            Ok(())
17880        }
17881    }
17882
17883    impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
17884        type Borrowed<'a> = &'a mut Self;
17885        fn take_or_borrow<'a>(
17886            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17887        ) -> Self::Borrowed<'a> {
17888            value
17889        }
17890    }
17891
17892    unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
17893        type Owned = Self;
17894
17895        #[inline(always)]
17896        fn inline_align(_context: fidl::encoding::Context) -> usize {
17897            8
17898        }
17899
17900        #[inline(always)]
17901        fn inline_size(_context: fidl::encoding::Context) -> usize {
17902            48
17903        }
17904    }
17905
17906    unsafe impl
17907        fidl::encoding::Encode<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
17908        for &mut DirectoryOpenRequest
17909    {
17910        #[inline]
17911        unsafe fn encode(
17912            self,
17913            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17914            offset: usize,
17915            _depth: fidl::encoding::Depth,
17916        ) -> fidl::Result<()> {
17917            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
17918            // Delegate to tuple encoding.
17919            fidl::encoding::Encode::<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
17920                (
17921                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
17922                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
17923                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
17924                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
17925                ),
17926                encoder, offset, _depth
17927            )
17928        }
17929    }
17930    unsafe impl<
17931        T0: fidl::encoding::Encode<
17932                fidl::encoding::BoundedString<4095>,
17933                fdomain_client::fidl::FDomainResourceDialect,
17934            >,
17935        T1: fidl::encoding::Encode<Flags, fdomain_client::fidl::FDomainResourceDialect>,
17936        T2: fidl::encoding::Encode<Options, fdomain_client::fidl::FDomainResourceDialect>,
17937        T3: fidl::encoding::Encode<
17938                fidl::encoding::HandleType<
17939                    fdomain_client::Channel,
17940                    { fidl::ObjectType::CHANNEL.into_raw() },
17941                    2147483648,
17942                >,
17943                fdomain_client::fidl::FDomainResourceDialect,
17944            >,
17945    > fidl::encoding::Encode<DirectoryOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
17946        for (T0, T1, T2, T3)
17947    {
17948        #[inline]
17949        unsafe fn encode(
17950            self,
17951            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17952            offset: usize,
17953            depth: fidl::encoding::Depth,
17954        ) -> fidl::Result<()> {
17955            encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
17956            // Zero out padding regions. There's no need to apply masks
17957            // because the unmasked parts will be overwritten by fields.
17958            unsafe {
17959                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
17960                (ptr as *mut u64).write_unaligned(0);
17961            }
17962            // Write the fields.
17963            self.0.encode(encoder, offset + 0, depth)?;
17964            self.1.encode(encoder, offset + 16, depth)?;
17965            self.2.encode(encoder, offset + 24, depth)?;
17966            self.3.encode(encoder, offset + 40, depth)?;
17967            Ok(())
17968        }
17969    }
17970
17971    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
17972        for DirectoryOpenRequest
17973    {
17974        #[inline(always)]
17975        fn new_empty() -> Self {
17976            Self {
17977                path: fidl::new_empty!(
17978                    fidl::encoding::BoundedString<4095>,
17979                    fdomain_client::fidl::FDomainResourceDialect
17980                ),
17981                flags: fidl::new_empty!(Flags, fdomain_client::fidl::FDomainResourceDialect),
17982                options: fidl::new_empty!(Options, fdomain_client::fidl::FDomainResourceDialect),
17983                object: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
17984            }
17985        }
17986
17987        #[inline]
17988        unsafe fn decode(
17989            &mut self,
17990            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
17991            offset: usize,
17992            _depth: fidl::encoding::Depth,
17993        ) -> fidl::Result<()> {
17994            decoder.debug_check_bounds::<Self>(offset);
17995            // Verify that padding bytes are zero.
17996            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
17997            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17998            let mask = 0xffffffff00000000u64;
17999            let maskedval = padval & mask;
18000            if maskedval != 0 {
18001                return Err(fidl::Error::NonZeroPadding {
18002                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
18003                });
18004            }
18005            fidl::decode!(
18006                fidl::encoding::BoundedString<4095>,
18007                fdomain_client::fidl::FDomainResourceDialect,
18008                &mut self.path,
18009                decoder,
18010                offset + 0,
18011                _depth
18012            )?;
18013            fidl::decode!(
18014                Flags,
18015                fdomain_client::fidl::FDomainResourceDialect,
18016                &mut self.flags,
18017                decoder,
18018                offset + 16,
18019                _depth
18020            )?;
18021            fidl::decode!(
18022                Options,
18023                fdomain_client::fidl::FDomainResourceDialect,
18024                &mut self.options,
18025                decoder,
18026                offset + 24,
18027                _depth
18028            )?;
18029            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)?;
18030            Ok(())
18031        }
18032    }
18033
18034    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
18035        type Borrowed<'a> = &'a mut Self;
18036        fn take_or_borrow<'a>(
18037            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18038        ) -> Self::Borrowed<'a> {
18039            value
18040        }
18041    }
18042
18043    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
18044        type Owned = Self;
18045
18046        #[inline(always)]
18047        fn inline_align(_context: fidl::encoding::Context) -> usize {
18048            8
18049        }
18050
18051        #[inline(always)]
18052        fn inline_size(_context: fidl::encoding::Context) -> usize {
18053            40
18054        }
18055    }
18056
18057    unsafe impl
18058        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18059        for &mut DirectoryRenameRequest
18060    {
18061        #[inline]
18062        unsafe fn encode(
18063            self,
18064            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18065            offset: usize,
18066            _depth: fidl::encoding::Depth,
18067        ) -> fidl::Result<()> {
18068            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18069            // Delegate to tuple encoding.
18070            fidl::encoding::Encode::<
18071                DirectoryRenameRequest,
18072                fdomain_client::fidl::FDomainResourceDialect,
18073            >::encode(
18074                (
18075                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18076                        &self.src,
18077                    ),
18078                    <fidl::encoding::HandleType<
18079                        fdomain_client::Event,
18080                        { fidl::ObjectType::EVENT.into_raw() },
18081                        2147483648,
18082                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18083                        &mut self.dst_parent_token,
18084                    ),
18085                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18086                        &self.dst,
18087                    ),
18088                ),
18089                encoder,
18090                offset,
18091                _depth,
18092            )
18093        }
18094    }
18095    unsafe impl<
18096        T0: fidl::encoding::Encode<
18097                fidl::encoding::BoundedString<255>,
18098                fdomain_client::fidl::FDomainResourceDialect,
18099            >,
18100        T1: fidl::encoding::Encode<
18101                fidl::encoding::HandleType<
18102                    fdomain_client::Event,
18103                    { fidl::ObjectType::EVENT.into_raw() },
18104                    2147483648,
18105                >,
18106                fdomain_client::fidl::FDomainResourceDialect,
18107            >,
18108        T2: fidl::encoding::Encode<
18109                fidl::encoding::BoundedString<255>,
18110                fdomain_client::fidl::FDomainResourceDialect,
18111            >,
18112    >
18113        fidl::encoding::Encode<DirectoryRenameRequest, fdomain_client::fidl::FDomainResourceDialect>
18114        for (T0, T1, T2)
18115    {
18116        #[inline]
18117        unsafe fn encode(
18118            self,
18119            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18120            offset: usize,
18121            depth: fidl::encoding::Depth,
18122        ) -> fidl::Result<()> {
18123            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
18124            // Zero out padding regions. There's no need to apply masks
18125            // because the unmasked parts will be overwritten by fields.
18126            unsafe {
18127                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18128                (ptr as *mut u64).write_unaligned(0);
18129            }
18130            // Write the fields.
18131            self.0.encode(encoder, offset + 0, depth)?;
18132            self.1.encode(encoder, offset + 16, depth)?;
18133            self.2.encode(encoder, offset + 24, depth)?;
18134            Ok(())
18135        }
18136    }
18137
18138    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18139        for DirectoryRenameRequest
18140    {
18141        #[inline(always)]
18142        fn new_empty() -> Self {
18143            Self {
18144                src: fidl::new_empty!(
18145                    fidl::encoding::BoundedString<255>,
18146                    fdomain_client::fidl::FDomainResourceDialect
18147                ),
18148                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18149                dst: fidl::new_empty!(
18150                    fidl::encoding::BoundedString<255>,
18151                    fdomain_client::fidl::FDomainResourceDialect
18152                ),
18153            }
18154        }
18155
18156        #[inline]
18157        unsafe fn decode(
18158            &mut self,
18159            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18160            offset: usize,
18161            _depth: fidl::encoding::Depth,
18162        ) -> fidl::Result<()> {
18163            decoder.debug_check_bounds::<Self>(offset);
18164            // Verify that padding bytes are zero.
18165            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18166            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18167            let mask = 0xffffffff00000000u64;
18168            let maskedval = padval & mask;
18169            if maskedval != 0 {
18170                return Err(fidl::Error::NonZeroPadding {
18171                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18172                });
18173            }
18174            fidl::decode!(
18175                fidl::encoding::BoundedString<255>,
18176                fdomain_client::fidl::FDomainResourceDialect,
18177                &mut self.src,
18178                decoder,
18179                offset + 0,
18180                _depth
18181            )?;
18182            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)?;
18183            fidl::decode!(
18184                fidl::encoding::BoundedString<255>,
18185                fdomain_client::fidl::FDomainResourceDialect,
18186                &mut self.dst,
18187                decoder,
18188                offset + 24,
18189                _depth
18190            )?;
18191            Ok(())
18192        }
18193    }
18194
18195    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
18196        type Borrowed<'a> = &'a mut Self;
18197        fn take_or_borrow<'a>(
18198            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18199        ) -> Self::Borrowed<'a> {
18200            value
18201        }
18202    }
18203
18204    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
18205        type Owned = Self;
18206
18207        #[inline(always)]
18208        fn inline_align(_context: fidl::encoding::Context) -> usize {
18209            4
18210        }
18211
18212        #[inline(always)]
18213        fn inline_size(_context: fidl::encoding::Context) -> usize {
18214            12
18215        }
18216    }
18217
18218    unsafe impl
18219        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18220        for &mut DirectoryWatchRequest
18221    {
18222        #[inline]
18223        unsafe fn encode(
18224            self,
18225            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18226            offset: usize,
18227            _depth: fidl::encoding::Depth,
18228        ) -> fidl::Result<()> {
18229            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18230            // Delegate to tuple encoding.
18231            fidl::encoding::Encode::<
18232                DirectoryWatchRequest,
18233                fdomain_client::fidl::FDomainResourceDialect,
18234            >::encode(
18235                (
18236                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
18237                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
18238                    <fidl::encoding::Endpoint<
18239                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18240                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18241                        &mut self.watcher
18242                    ),
18243                ),
18244                encoder,
18245                offset,
18246                _depth,
18247            )
18248        }
18249    }
18250    unsafe impl<
18251        T0: fidl::encoding::Encode<WatchMask, fdomain_client::fidl::FDomainResourceDialect>,
18252        T1: fidl::encoding::Encode<u32, fdomain_client::fidl::FDomainResourceDialect>,
18253        T2: fidl::encoding::Encode<
18254                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18255                fdomain_client::fidl::FDomainResourceDialect,
18256            >,
18257    >
18258        fidl::encoding::Encode<DirectoryWatchRequest, fdomain_client::fidl::FDomainResourceDialect>
18259        for (T0, T1, T2)
18260    {
18261        #[inline]
18262        unsafe fn encode(
18263            self,
18264            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18265            offset: usize,
18266            depth: fidl::encoding::Depth,
18267        ) -> fidl::Result<()> {
18268            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
18269            // Zero out padding regions. There's no need to apply masks
18270            // because the unmasked parts will be overwritten by fields.
18271            // Write the fields.
18272            self.0.encode(encoder, offset + 0, depth)?;
18273            self.1.encode(encoder, offset + 4, depth)?;
18274            self.2.encode(encoder, offset + 8, depth)?;
18275            Ok(())
18276        }
18277    }
18278
18279    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18280        for DirectoryWatchRequest
18281    {
18282        #[inline(always)]
18283        fn new_empty() -> Self {
18284            Self {
18285                mask: fidl::new_empty!(WatchMask, fdomain_client::fidl::FDomainResourceDialect),
18286                options: fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect),
18287                watcher: fidl::new_empty!(
18288                    fidl::encoding::Endpoint<
18289                        fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>,
18290                    >,
18291                    fdomain_client::fidl::FDomainResourceDialect
18292                ),
18293            }
18294        }
18295
18296        #[inline]
18297        unsafe fn decode(
18298            &mut self,
18299            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18300            offset: usize,
18301            _depth: fidl::encoding::Depth,
18302        ) -> fidl::Result<()> {
18303            decoder.debug_check_bounds::<Self>(offset);
18304            // Verify that padding bytes are zero.
18305            fidl::decode!(
18306                WatchMask,
18307                fdomain_client::fidl::FDomainResourceDialect,
18308                &mut self.mask,
18309                decoder,
18310                offset + 0,
18311                _depth
18312            )?;
18313            fidl::decode!(
18314                u32,
18315                fdomain_client::fidl::FDomainResourceDialect,
18316                &mut self.options,
18317                decoder,
18318                offset + 4,
18319                _depth
18320            )?;
18321            fidl::decode!(
18322                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<DirectoryWatcherMarker>>,
18323                fdomain_client::fidl::FDomainResourceDialect,
18324                &mut self.watcher,
18325                decoder,
18326                offset + 8,
18327                _depth
18328            )?;
18329            Ok(())
18330        }
18331    }
18332
18333    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
18334        type Borrowed<'a> = &'a mut Self;
18335        fn take_or_borrow<'a>(
18336            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18337        ) -> Self::Borrowed<'a> {
18338            value
18339        }
18340    }
18341
18342    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
18343        type Owned = Self;
18344
18345        #[inline(always)]
18346        fn inline_align(_context: fidl::encoding::Context) -> usize {
18347            8
18348        }
18349
18350        #[inline(always)]
18351        fn inline_size(_context: fidl::encoding::Context) -> usize {
18352            24
18353        }
18354    }
18355
18356    unsafe impl
18357        fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18358        for &mut FileAllocateRequest
18359    {
18360        #[inline]
18361        unsafe fn encode(
18362            self,
18363            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18364            offset: usize,
18365            _depth: fidl::encoding::Depth,
18366        ) -> fidl::Result<()> {
18367            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18368            // Delegate to tuple encoding.
18369            fidl::encoding::Encode::<
18370                FileAllocateRequest,
18371                fdomain_client::fidl::FDomainResourceDialect,
18372            >::encode(
18373                (
18374                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
18375                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
18376                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
18377                ),
18378                encoder,
18379                offset,
18380                _depth,
18381            )
18382        }
18383    }
18384    unsafe impl<
18385        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18386        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
18387        T2: fidl::encoding::Encode<AllocateMode, fdomain_client::fidl::FDomainResourceDialect>,
18388    > fidl::encoding::Encode<FileAllocateRequest, fdomain_client::fidl::FDomainResourceDialect>
18389        for (T0, T1, T2)
18390    {
18391        #[inline]
18392        unsafe fn encode(
18393            self,
18394            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18395            offset: usize,
18396            depth: fidl::encoding::Depth,
18397        ) -> fidl::Result<()> {
18398            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
18399            // Zero out padding regions. There's no need to apply masks
18400            // because the unmasked parts will be overwritten by fields.
18401            unsafe {
18402                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
18403                (ptr as *mut u64).write_unaligned(0);
18404            }
18405            // Write the fields.
18406            self.0.encode(encoder, offset + 0, depth)?;
18407            self.1.encode(encoder, offset + 8, depth)?;
18408            self.2.encode(encoder, offset + 16, depth)?;
18409            Ok(())
18410        }
18411    }
18412
18413    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18414        for FileAllocateRequest
18415    {
18416        #[inline(always)]
18417        fn new_empty() -> Self {
18418            Self {
18419                offset: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18420                length: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
18421                mode: fidl::new_empty!(AllocateMode, fdomain_client::fidl::FDomainResourceDialect),
18422            }
18423        }
18424
18425        #[inline]
18426        unsafe fn decode(
18427            &mut self,
18428            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18429            offset: usize,
18430            _depth: fidl::encoding::Depth,
18431        ) -> fidl::Result<()> {
18432            decoder.debug_check_bounds::<Self>(offset);
18433            // Verify that padding bytes are zero.
18434            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
18435            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18436            let mask = 0xffffffff00000000u64;
18437            let maskedval = padval & mask;
18438            if maskedval != 0 {
18439                return Err(fidl::Error::NonZeroPadding {
18440                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
18441                });
18442            }
18443            fidl::decode!(
18444                u64,
18445                fdomain_client::fidl::FDomainResourceDialect,
18446                &mut self.offset,
18447                decoder,
18448                offset + 0,
18449                _depth
18450            )?;
18451            fidl::decode!(
18452                u64,
18453                fdomain_client::fidl::FDomainResourceDialect,
18454                &mut self.length,
18455                decoder,
18456                offset + 8,
18457                _depth
18458            )?;
18459            fidl::decode!(
18460                AllocateMode,
18461                fdomain_client::fidl::FDomainResourceDialect,
18462                &mut self.mode,
18463                decoder,
18464                offset + 16,
18465                _depth
18466            )?;
18467            Ok(())
18468        }
18469    }
18470
18471    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
18472        type Borrowed<'a> = &'a mut Self;
18473        fn take_or_borrow<'a>(
18474            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18475        ) -> Self::Borrowed<'a> {
18476            value
18477        }
18478    }
18479
18480    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
18481        type Owned = Self;
18482
18483        #[inline(always)]
18484        fn inline_align(_context: fidl::encoding::Context) -> usize {
18485            8
18486        }
18487
18488        #[inline(always)]
18489        fn inline_size(_context: fidl::encoding::Context) -> usize {
18490            16
18491        }
18492    }
18493
18494    unsafe impl
18495        fidl::encoding::Encode<
18496            FileEnableVerityRequest,
18497            fdomain_client::fidl::FDomainResourceDialect,
18498        > for &mut FileEnableVerityRequest
18499    {
18500        #[inline]
18501        unsafe fn encode(
18502            self,
18503            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18504            offset: usize,
18505            _depth: fidl::encoding::Depth,
18506        ) -> fidl::Result<()> {
18507            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18508            // Delegate to tuple encoding.
18509            fidl::encoding::Encode::<
18510                FileEnableVerityRequest,
18511                fdomain_client::fidl::FDomainResourceDialect,
18512            >::encode(
18513                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
18514                encoder,
18515                offset,
18516                _depth,
18517            )
18518        }
18519    }
18520    unsafe impl<
18521        T0: fidl::encoding::Encode<VerificationOptions, fdomain_client::fidl::FDomainResourceDialect>,
18522    >
18523        fidl::encoding::Encode<
18524            FileEnableVerityRequest,
18525            fdomain_client::fidl::FDomainResourceDialect,
18526        > for (T0,)
18527    {
18528        #[inline]
18529        unsafe fn encode(
18530            self,
18531            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18532            offset: usize,
18533            depth: fidl::encoding::Depth,
18534        ) -> fidl::Result<()> {
18535            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
18536            // Zero out padding regions. There's no need to apply masks
18537            // because the unmasked parts will be overwritten by fields.
18538            // Write the fields.
18539            self.0.encode(encoder, offset + 0, depth)?;
18540            Ok(())
18541        }
18542    }
18543
18544    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18545        for FileEnableVerityRequest
18546    {
18547        #[inline(always)]
18548        fn new_empty() -> Self {
18549            Self {
18550                options: fidl::new_empty!(
18551                    VerificationOptions,
18552                    fdomain_client::fidl::FDomainResourceDialect
18553                ),
18554            }
18555        }
18556
18557        #[inline]
18558        unsafe fn decode(
18559            &mut self,
18560            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18561            offset: usize,
18562            _depth: fidl::encoding::Depth,
18563        ) -> fidl::Result<()> {
18564            decoder.debug_check_bounds::<Self>(offset);
18565            // Verify that padding bytes are zero.
18566            fidl::decode!(
18567                VerificationOptions,
18568                fdomain_client::fidl::FDomainResourceDialect,
18569                &mut self.options,
18570                decoder,
18571                offset + 0,
18572                _depth
18573            )?;
18574            Ok(())
18575        }
18576    }
18577
18578    impl fidl::encoding::ResourceTypeMarker for FileObject {
18579        type Borrowed<'a> = &'a mut Self;
18580        fn take_or_borrow<'a>(
18581            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18582        ) -> Self::Borrowed<'a> {
18583            value
18584        }
18585    }
18586
18587    unsafe impl fidl::encoding::TypeMarker for FileObject {
18588        type Owned = Self;
18589
18590        #[inline(always)]
18591        fn inline_align(_context: fidl::encoding::Context) -> usize {
18592            4
18593        }
18594
18595        #[inline(always)]
18596        fn inline_size(_context: fidl::encoding::Context) -> usize {
18597            8
18598        }
18599    }
18600
18601    unsafe impl fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18602        for &mut FileObject
18603    {
18604        #[inline]
18605        unsafe fn encode(
18606            self,
18607            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18608            offset: usize,
18609            _depth: fidl::encoding::Depth,
18610        ) -> fidl::Result<()> {
18611            encoder.debug_check_bounds::<FileObject>(offset);
18612            // Delegate to tuple encoding.
18613            fidl::encoding::Encode::<FileObject, fdomain_client::fidl::FDomainResourceDialect>::encode(
18614                (
18615                    <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),
18616                    <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),
18617                ),
18618                encoder, offset, _depth
18619            )
18620        }
18621    }
18622    unsafe impl<
18623        T0: fidl::encoding::Encode<
18624                fidl::encoding::Optional<
18625                    fidl::encoding::HandleType<
18626                        fdomain_client::Event,
18627                        { fidl::ObjectType::EVENT.into_raw() },
18628                        2147483648,
18629                    >,
18630                >,
18631                fdomain_client::fidl::FDomainResourceDialect,
18632            >,
18633        T1: fidl::encoding::Encode<
18634                fidl::encoding::Optional<
18635                    fidl::encoding::HandleType<
18636                        fdomain_client::Stream,
18637                        { fidl::ObjectType::STREAM.into_raw() },
18638                        2147483648,
18639                    >,
18640                >,
18641                fdomain_client::fidl::FDomainResourceDialect,
18642            >,
18643    > fidl::encoding::Encode<FileObject, fdomain_client::fidl::FDomainResourceDialect>
18644        for (T0, T1)
18645    {
18646        #[inline]
18647        unsafe fn encode(
18648            self,
18649            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18650            offset: usize,
18651            depth: fidl::encoding::Depth,
18652        ) -> fidl::Result<()> {
18653            encoder.debug_check_bounds::<FileObject>(offset);
18654            // Zero out padding regions. There's no need to apply masks
18655            // because the unmasked parts will be overwritten by fields.
18656            // Write the fields.
18657            self.0.encode(encoder, offset + 0, depth)?;
18658            self.1.encode(encoder, offset + 4, depth)?;
18659            Ok(())
18660        }
18661    }
18662
18663    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileObject {
18664        #[inline(always)]
18665        fn new_empty() -> Self {
18666            Self {
18667                event: fidl::new_empty!(
18668                    fidl::encoding::Optional<
18669                        fidl::encoding::HandleType<
18670                            fdomain_client::Event,
18671                            { fidl::ObjectType::EVENT.into_raw() },
18672                            2147483648,
18673                        >,
18674                    >,
18675                    fdomain_client::fidl::FDomainResourceDialect
18676                ),
18677                stream: fidl::new_empty!(
18678                    fidl::encoding::Optional<
18679                        fidl::encoding::HandleType<
18680                            fdomain_client::Stream,
18681                            { fidl::ObjectType::STREAM.into_raw() },
18682                            2147483648,
18683                        >,
18684                    >,
18685                    fdomain_client::fidl::FDomainResourceDialect
18686                ),
18687            }
18688        }
18689
18690        #[inline]
18691        unsafe fn decode(
18692            &mut self,
18693            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18694            offset: usize,
18695            _depth: fidl::encoding::Depth,
18696        ) -> fidl::Result<()> {
18697            decoder.debug_check_bounds::<Self>(offset);
18698            // Verify that padding bytes are zero.
18699            fidl::decode!(
18700                fidl::encoding::Optional<
18701                    fidl::encoding::HandleType<
18702                        fdomain_client::Event,
18703                        { fidl::ObjectType::EVENT.into_raw() },
18704                        2147483648,
18705                    >,
18706                >,
18707                fdomain_client::fidl::FDomainResourceDialect,
18708                &mut self.event,
18709                decoder,
18710                offset + 0,
18711                _depth
18712            )?;
18713            fidl::decode!(
18714                fidl::encoding::Optional<
18715                    fidl::encoding::HandleType<
18716                        fdomain_client::Stream,
18717                        { fidl::ObjectType::STREAM.into_raw() },
18718                        2147483648,
18719                    >,
18720                >,
18721                fdomain_client::fidl::FDomainResourceDialect,
18722                &mut self.stream,
18723                decoder,
18724                offset + 4,
18725                _depth
18726            )?;
18727            Ok(())
18728        }
18729    }
18730
18731    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
18732        type Borrowed<'a> = &'a mut Self;
18733        fn take_or_borrow<'a>(
18734            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18735        ) -> Self::Borrowed<'a> {
18736            value
18737        }
18738    }
18739
18740    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
18741        type Owned = Self;
18742
18743        #[inline(always)]
18744        fn inline_align(_context: fidl::encoding::Context) -> usize {
18745            4
18746        }
18747
18748        #[inline(always)]
18749        fn inline_size(_context: fidl::encoding::Context) -> usize {
18750            4
18751        }
18752    }
18753
18754    unsafe impl
18755        fidl::encoding::Encode<
18756            FileGetBackingMemoryResponse,
18757            fdomain_client::fidl::FDomainResourceDialect,
18758        > for &mut FileGetBackingMemoryResponse
18759    {
18760        #[inline]
18761        unsafe fn encode(
18762            self,
18763            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18764            offset: usize,
18765            _depth: fidl::encoding::Depth,
18766        ) -> fidl::Result<()> {
18767            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
18768            // Delegate to tuple encoding.
18769            fidl::encoding::Encode::<
18770                FileGetBackingMemoryResponse,
18771                fdomain_client::fidl::FDomainResourceDialect,
18772            >::encode(
18773                (<fidl::encoding::HandleType<
18774                    fdomain_client::Vmo,
18775                    { fidl::ObjectType::VMO.into_raw() },
18776                    2147483648,
18777                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18778                    &mut self.vmo
18779                ),),
18780                encoder,
18781                offset,
18782                _depth,
18783            )
18784        }
18785    }
18786    unsafe impl<
18787        T0: fidl::encoding::Encode<
18788                fidl::encoding::HandleType<
18789                    fdomain_client::Vmo,
18790                    { fidl::ObjectType::VMO.into_raw() },
18791                    2147483648,
18792                >,
18793                fdomain_client::fidl::FDomainResourceDialect,
18794            >,
18795    >
18796        fidl::encoding::Encode<
18797            FileGetBackingMemoryResponse,
18798            fdomain_client::fidl::FDomainResourceDialect,
18799        > for (T0,)
18800    {
18801        #[inline]
18802        unsafe fn encode(
18803            self,
18804            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18805            offset: usize,
18806            depth: fidl::encoding::Depth,
18807        ) -> fidl::Result<()> {
18808            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
18809            // Zero out padding regions. There's no need to apply masks
18810            // because the unmasked parts will be overwritten by fields.
18811            // Write the fields.
18812            self.0.encode(encoder, offset + 0, depth)?;
18813            Ok(())
18814        }
18815    }
18816
18817    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18818        for FileGetBackingMemoryResponse
18819    {
18820        #[inline(always)]
18821        fn new_empty() -> Self {
18822            Self {
18823                vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18824            }
18825        }
18826
18827        #[inline]
18828        unsafe fn decode(
18829            &mut self,
18830            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18831            offset: usize,
18832            _depth: fidl::encoding::Depth,
18833        ) -> fidl::Result<()> {
18834            decoder.debug_check_bounds::<Self>(offset);
18835            // Verify that padding bytes are zero.
18836            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)?;
18837            Ok(())
18838        }
18839    }
18840
18841    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
18842        type Borrowed<'a> = &'a mut Self;
18843        fn take_or_borrow<'a>(
18844            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18845        ) -> Self::Borrowed<'a> {
18846            value
18847        }
18848    }
18849
18850    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
18851        type Owned = Self;
18852
18853        #[inline(always)]
18854        fn inline_align(_context: fidl::encoding::Context) -> usize {
18855            8
18856        }
18857
18858        #[inline(always)]
18859        fn inline_size(_context: fidl::encoding::Context) -> usize {
18860            24
18861        }
18862    }
18863
18864    unsafe impl
18865        fidl::encoding::Encode<
18866            LinkableLinkIntoRequest,
18867            fdomain_client::fidl::FDomainResourceDialect,
18868        > for &mut LinkableLinkIntoRequest
18869    {
18870        #[inline]
18871        unsafe fn encode(
18872            self,
18873            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18874            offset: usize,
18875            _depth: fidl::encoding::Depth,
18876        ) -> fidl::Result<()> {
18877            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
18878            // Delegate to tuple encoding.
18879            fidl::encoding::Encode::<
18880                LinkableLinkIntoRequest,
18881                fdomain_client::fidl::FDomainResourceDialect,
18882            >::encode(
18883                (
18884                    <fidl::encoding::HandleType<
18885                        fdomain_client::Event,
18886                        { fidl::ObjectType::EVENT.into_raw() },
18887                        2147483648,
18888                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18889                        &mut self.dst_parent_token,
18890                    ),
18891                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
18892                        &self.dst,
18893                    ),
18894                ),
18895                encoder,
18896                offset,
18897                _depth,
18898            )
18899        }
18900    }
18901    unsafe impl<
18902        T0: fidl::encoding::Encode<
18903                fidl::encoding::HandleType<
18904                    fdomain_client::Event,
18905                    { fidl::ObjectType::EVENT.into_raw() },
18906                    2147483648,
18907                >,
18908                fdomain_client::fidl::FDomainResourceDialect,
18909            >,
18910        T1: fidl::encoding::Encode<
18911                fidl::encoding::BoundedString<255>,
18912                fdomain_client::fidl::FDomainResourceDialect,
18913            >,
18914    >
18915        fidl::encoding::Encode<
18916            LinkableLinkIntoRequest,
18917            fdomain_client::fidl::FDomainResourceDialect,
18918        > for (T0, T1)
18919    {
18920        #[inline]
18921        unsafe fn encode(
18922            self,
18923            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18924            offset: usize,
18925            depth: fidl::encoding::Depth,
18926        ) -> fidl::Result<()> {
18927            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
18928            // Zero out padding regions. There's no need to apply masks
18929            // because the unmasked parts will be overwritten by fields.
18930            unsafe {
18931                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
18932                (ptr as *mut u64).write_unaligned(0);
18933            }
18934            // Write the fields.
18935            self.0.encode(encoder, offset + 0, depth)?;
18936            self.1.encode(encoder, offset + 8, depth)?;
18937            Ok(())
18938        }
18939    }
18940
18941    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
18942        for LinkableLinkIntoRequest
18943    {
18944        #[inline(always)]
18945        fn new_empty() -> Self {
18946            Self {
18947                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
18948                dst: fidl::new_empty!(
18949                    fidl::encoding::BoundedString<255>,
18950                    fdomain_client::fidl::FDomainResourceDialect
18951                ),
18952            }
18953        }
18954
18955        #[inline]
18956        unsafe fn decode(
18957            &mut self,
18958            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
18959            offset: usize,
18960            _depth: fidl::encoding::Depth,
18961        ) -> fidl::Result<()> {
18962            decoder.debug_check_bounds::<Self>(offset);
18963            // Verify that padding bytes are zero.
18964            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
18965            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18966            let mask = 0xffffffff00000000u64;
18967            let maskedval = padval & mask;
18968            if maskedval != 0 {
18969                return Err(fidl::Error::NonZeroPadding {
18970                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
18971                });
18972            }
18973            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)?;
18974            fidl::decode!(
18975                fidl::encoding::BoundedString<255>,
18976                fdomain_client::fidl::FDomainResourceDialect,
18977                &mut self.dst,
18978                decoder,
18979                offset + 8,
18980                _depth
18981            )?;
18982            Ok(())
18983        }
18984    }
18985
18986    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
18987        type Borrowed<'a> = &'a mut Self;
18988        fn take_or_borrow<'a>(
18989            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18990        ) -> Self::Borrowed<'a> {
18991            value
18992        }
18993    }
18994
18995    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
18996        type Owned = Self;
18997
18998        #[inline(always)]
18999        fn inline_align(_context: fidl::encoding::Context) -> usize {
19000            4
19001        }
19002
19003        #[inline(always)]
19004        fn inline_size(_context: fidl::encoding::Context) -> usize {
19005            8
19006        }
19007    }
19008
19009    unsafe impl
19010        fidl::encoding::Encode<
19011            NodeDeprecatedCloneRequest,
19012            fdomain_client::fidl::FDomainResourceDialect,
19013        > for &mut NodeDeprecatedCloneRequest
19014    {
19015        #[inline]
19016        unsafe fn encode(
19017            self,
19018            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19019            offset: usize,
19020            _depth: fidl::encoding::Depth,
19021        ) -> fidl::Result<()> {
19022            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19023            // Delegate to tuple encoding.
19024            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19025                (
19026                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
19027                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
19028                ),
19029                encoder, offset, _depth
19030            )
19031        }
19032    }
19033    unsafe impl<
19034        T0: fidl::encoding::Encode<OpenFlags, fdomain_client::fidl::FDomainResourceDialect>,
19035        T1: fidl::encoding::Encode<
19036                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19037                fdomain_client::fidl::FDomainResourceDialect,
19038            >,
19039    >
19040        fidl::encoding::Encode<
19041            NodeDeprecatedCloneRequest,
19042            fdomain_client::fidl::FDomainResourceDialect,
19043        > for (T0, T1)
19044    {
19045        #[inline]
19046        unsafe fn encode(
19047            self,
19048            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19049            offset: usize,
19050            depth: fidl::encoding::Depth,
19051        ) -> fidl::Result<()> {
19052            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
19053            // Zero out padding regions. There's no need to apply masks
19054            // because the unmasked parts will be overwritten by fields.
19055            // Write the fields.
19056            self.0.encode(encoder, offset + 0, depth)?;
19057            self.1.encode(encoder, offset + 4, depth)?;
19058            Ok(())
19059        }
19060    }
19061
19062    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19063        for NodeDeprecatedCloneRequest
19064    {
19065        #[inline(always)]
19066        fn new_empty() -> Self {
19067            Self {
19068                flags: fidl::new_empty!(OpenFlags, fdomain_client::fidl::FDomainResourceDialect),
19069                object: fidl::new_empty!(
19070                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19071                    fdomain_client::fidl::FDomainResourceDialect
19072                ),
19073            }
19074        }
19075
19076        #[inline]
19077        unsafe fn decode(
19078            &mut self,
19079            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19080            offset: usize,
19081            _depth: fidl::encoding::Depth,
19082        ) -> fidl::Result<()> {
19083            decoder.debug_check_bounds::<Self>(offset);
19084            // Verify that padding bytes are zero.
19085            fidl::decode!(
19086                OpenFlags,
19087                fdomain_client::fidl::FDomainResourceDialect,
19088                &mut self.flags,
19089                decoder,
19090                offset + 0,
19091                _depth
19092            )?;
19093            fidl::decode!(
19094                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<NodeMarker>>,
19095                fdomain_client::fidl::FDomainResourceDialect,
19096                &mut self.object,
19097                decoder,
19098                offset + 4,
19099                _depth
19100            )?;
19101            Ok(())
19102        }
19103    }
19104
19105    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
19106        type Borrowed<'a> = &'a mut Self;
19107        fn take_or_borrow<'a>(
19108            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19109        ) -> Self::Borrowed<'a> {
19110            value
19111        }
19112    }
19113
19114    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
19115        type Owned = Self;
19116
19117        #[inline(always)]
19118        fn inline_align(_context: fidl::encoding::Context) -> usize {
19119            4
19120        }
19121
19122        #[inline(always)]
19123        fn inline_size(_context: fidl::encoding::Context) -> usize {
19124            4
19125        }
19126    }
19127
19128    unsafe impl
19129        fidl::encoding::Encode<
19130            NodeListExtendedAttributesRequest,
19131            fdomain_client::fidl::FDomainResourceDialect,
19132        > for &mut NodeListExtendedAttributesRequest
19133    {
19134        #[inline]
19135        unsafe fn encode(
19136            self,
19137            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19138            offset: usize,
19139            _depth: fidl::encoding::Depth,
19140        ) -> fidl::Result<()> {
19141            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19142            // Delegate to tuple encoding.
19143            fidl::encoding::Encode::<
19144                NodeListExtendedAttributesRequest,
19145                fdomain_client::fidl::FDomainResourceDialect,
19146            >::encode(
19147                (<fidl::encoding::Endpoint<
19148                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19149                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19150                    &mut self.iterator
19151                ),),
19152                encoder,
19153                offset,
19154                _depth,
19155            )
19156        }
19157    }
19158    unsafe impl<
19159        T0: fidl::encoding::Encode<
19160                fidl::encoding::Endpoint<
19161                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19162                >,
19163                fdomain_client::fidl::FDomainResourceDialect,
19164            >,
19165    >
19166        fidl::encoding::Encode<
19167            NodeListExtendedAttributesRequest,
19168            fdomain_client::fidl::FDomainResourceDialect,
19169        > for (T0,)
19170    {
19171        #[inline]
19172        unsafe fn encode(
19173            self,
19174            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19175            offset: usize,
19176            depth: fidl::encoding::Depth,
19177        ) -> fidl::Result<()> {
19178            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
19179            // Zero out padding regions. There's no need to apply masks
19180            // because the unmasked parts will be overwritten by fields.
19181            // Write the fields.
19182            self.0.encode(encoder, offset + 0, depth)?;
19183            Ok(())
19184        }
19185    }
19186
19187    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19188        for NodeListExtendedAttributesRequest
19189    {
19190        #[inline(always)]
19191        fn new_empty() -> Self {
19192            Self {
19193                iterator: fidl::new_empty!(
19194                    fidl::encoding::Endpoint<
19195                        fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19196                    >,
19197                    fdomain_client::fidl::FDomainResourceDialect
19198                ),
19199            }
19200        }
19201
19202        #[inline]
19203        unsafe fn decode(
19204            &mut self,
19205            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19206            offset: usize,
19207            _depth: fidl::encoding::Depth,
19208        ) -> fidl::Result<()> {
19209            decoder.debug_check_bounds::<Self>(offset);
19210            // Verify that padding bytes are zero.
19211            fidl::decode!(
19212                fidl::encoding::Endpoint<
19213                    fdomain_client::fidl::ServerEnd<ExtendedAttributeIteratorMarker>,
19214                >,
19215                fdomain_client::fidl::FDomainResourceDialect,
19216                &mut self.iterator,
19217                decoder,
19218                offset + 0,
19219                _depth
19220            )?;
19221            Ok(())
19222        }
19223    }
19224
19225    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
19226        type Borrowed<'a> = &'a mut Self;
19227        fn take_or_borrow<'a>(
19228            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19229        ) -> Self::Borrowed<'a> {
19230            value
19231        }
19232    }
19233
19234    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
19235        type Owned = Self;
19236
19237        #[inline(always)]
19238        fn inline_align(_context: fidl::encoding::Context) -> usize {
19239            8
19240        }
19241
19242        #[inline(always)]
19243        fn inline_size(_context: fidl::encoding::Context) -> usize {
19244            24
19245        }
19246    }
19247
19248    unsafe impl
19249        fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19250        for &mut NodeOnOpenRequest
19251    {
19252        #[inline]
19253        unsafe fn encode(
19254            self,
19255            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19256            offset: usize,
19257            _depth: fidl::encoding::Depth,
19258        ) -> fidl::Result<()> {
19259            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19260            // Delegate to tuple encoding.
19261            fidl::encoding::Encode::<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
19262                (
19263                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
19264                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
19265                ),
19266                encoder, offset, _depth
19267            )
19268        }
19269    }
19270    unsafe impl<
19271        T0: fidl::encoding::Encode<i32, fdomain_client::fidl::FDomainResourceDialect>,
19272        T1: fidl::encoding::Encode<
19273                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19274                fdomain_client::fidl::FDomainResourceDialect,
19275            >,
19276    > fidl::encoding::Encode<NodeOnOpenRequest, fdomain_client::fidl::FDomainResourceDialect>
19277        for (T0, T1)
19278    {
19279        #[inline]
19280        unsafe fn encode(
19281            self,
19282            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19283            offset: usize,
19284            depth: fidl::encoding::Depth,
19285        ) -> fidl::Result<()> {
19286            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
19287            // Zero out padding regions. There's no need to apply masks
19288            // because the unmasked parts will be overwritten by fields.
19289            unsafe {
19290                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
19291                (ptr as *mut u64).write_unaligned(0);
19292            }
19293            // Write the fields.
19294            self.0.encode(encoder, offset + 0, depth)?;
19295            self.1.encode(encoder, offset + 8, depth)?;
19296            Ok(())
19297        }
19298    }
19299
19300    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19301        for NodeOnOpenRequest
19302    {
19303        #[inline(always)]
19304        fn new_empty() -> Self {
19305            Self {
19306                s: fidl::new_empty!(i32, fdomain_client::fidl::FDomainResourceDialect),
19307                info: fidl::new_empty!(
19308                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19309                    fdomain_client::fidl::FDomainResourceDialect
19310                ),
19311            }
19312        }
19313
19314        #[inline]
19315        unsafe fn decode(
19316            &mut self,
19317            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19318            offset: usize,
19319            _depth: fidl::encoding::Depth,
19320        ) -> fidl::Result<()> {
19321            decoder.debug_check_bounds::<Self>(offset);
19322            // Verify that padding bytes are zero.
19323            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
19324            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19325            let mask = 0xffffffff00000000u64;
19326            let maskedval = padval & mask;
19327            if maskedval != 0 {
19328                return Err(fidl::Error::NonZeroPadding {
19329                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
19330                });
19331            }
19332            fidl::decode!(
19333                i32,
19334                fdomain_client::fidl::FDomainResourceDialect,
19335                &mut self.s,
19336                decoder,
19337                offset + 0,
19338                _depth
19339            )?;
19340            fidl::decode!(
19341                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
19342                fdomain_client::fidl::FDomainResourceDialect,
19343                &mut self.info,
19344                decoder,
19345                offset + 8,
19346                _depth
19347            )?;
19348            Ok(())
19349        }
19350    }
19351
19352    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
19353        type Borrowed<'a> = &'a mut Self;
19354        fn take_or_borrow<'a>(
19355            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19356        ) -> Self::Borrowed<'a> {
19357            value
19358        }
19359    }
19360
19361    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
19362        type Owned = Self;
19363
19364        #[inline(always)]
19365        fn inline_align(_context: fidl::encoding::Context) -> usize {
19366            8
19367        }
19368
19369        #[inline(always)]
19370        fn inline_size(_context: fidl::encoding::Context) -> usize {
19371            40
19372        }
19373    }
19374
19375    unsafe impl
19376        fidl::encoding::Encode<
19377            NodeSetExtendedAttributeRequest,
19378            fdomain_client::fidl::FDomainResourceDialect,
19379        > for &mut NodeSetExtendedAttributeRequest
19380    {
19381        #[inline]
19382        unsafe fn encode(
19383            self,
19384            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19385            offset: usize,
19386            _depth: fidl::encoding::Depth,
19387        ) -> fidl::Result<()> {
19388            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19389            // Delegate to tuple encoding.
19390            fidl::encoding::Encode::<
19391                NodeSetExtendedAttributeRequest,
19392                fdomain_client::fidl::FDomainResourceDialect,
19393            >::encode(
19394                (
19395                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
19396                        &self.name,
19397                    ),
19398                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19399                        &mut self.value,
19400                    ),
19401                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
19402                        &self.mode,
19403                    ),
19404                ),
19405                encoder,
19406                offset,
19407                _depth,
19408            )
19409        }
19410    }
19411    unsafe impl<
19412        T0: fidl::encoding::Encode<
19413                fidl::encoding::Vector<u8, 255>,
19414                fdomain_client::fidl::FDomainResourceDialect,
19415            >,
19416        T1: fidl::encoding::Encode<
19417                ExtendedAttributeValue,
19418                fdomain_client::fidl::FDomainResourceDialect,
19419            >,
19420        T2: fidl::encoding::Encode<
19421                SetExtendedAttributeMode,
19422                fdomain_client::fidl::FDomainResourceDialect,
19423            >,
19424    >
19425        fidl::encoding::Encode<
19426            NodeSetExtendedAttributeRequest,
19427            fdomain_client::fidl::FDomainResourceDialect,
19428        > for (T0, T1, T2)
19429    {
19430        #[inline]
19431        unsafe fn encode(
19432            self,
19433            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19434            offset: usize,
19435            depth: fidl::encoding::Depth,
19436        ) -> fidl::Result<()> {
19437            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
19438            // Zero out padding regions. There's no need to apply masks
19439            // because the unmasked parts will be overwritten by fields.
19440            unsafe {
19441                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
19442                (ptr as *mut u64).write_unaligned(0);
19443            }
19444            // Write the fields.
19445            self.0.encode(encoder, offset + 0, depth)?;
19446            self.1.encode(encoder, offset + 16, depth)?;
19447            self.2.encode(encoder, offset + 32, depth)?;
19448            Ok(())
19449        }
19450    }
19451
19452    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
19453        for NodeSetExtendedAttributeRequest
19454    {
19455        #[inline(always)]
19456        fn new_empty() -> Self {
19457            Self {
19458                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect),
19459                value: fidl::new_empty!(
19460                    ExtendedAttributeValue,
19461                    fdomain_client::fidl::FDomainResourceDialect
19462                ),
19463                mode: fidl::new_empty!(
19464                    SetExtendedAttributeMode,
19465                    fdomain_client::fidl::FDomainResourceDialect
19466                ),
19467            }
19468        }
19469
19470        #[inline]
19471        unsafe fn decode(
19472            &mut self,
19473            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19474            offset: usize,
19475            _depth: fidl::encoding::Depth,
19476        ) -> fidl::Result<()> {
19477            decoder.debug_check_bounds::<Self>(offset);
19478            // Verify that padding bytes are zero.
19479            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
19480            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19481            let mask = 0xffffffff00000000u64;
19482            let maskedval = padval & mask;
19483            if maskedval != 0 {
19484                return Err(fidl::Error::NonZeroPadding {
19485                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
19486                });
19487            }
19488            fidl::decode!(fidl::encoding::Vector<u8, 255>, fdomain_client::fidl::FDomainResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
19489            fidl::decode!(
19490                ExtendedAttributeValue,
19491                fdomain_client::fidl::FDomainResourceDialect,
19492                &mut self.value,
19493                decoder,
19494                offset + 16,
19495                _depth
19496            )?;
19497            fidl::decode!(
19498                SetExtendedAttributeMode,
19499                fdomain_client::fidl::FDomainResourceDialect,
19500                &mut self.mode,
19501                decoder,
19502                offset + 32,
19503                _depth
19504            )?;
19505            Ok(())
19506        }
19507    }
19508
19509    impl ConnectionInfo {
19510        #[inline(always)]
19511        fn max_ordinal_present(&self) -> u64 {
19512            if let Some(_) = self.rights {
19513                return 1;
19514            }
19515            0
19516        }
19517    }
19518
19519    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
19520        type Borrowed<'a> = &'a mut Self;
19521        fn take_or_borrow<'a>(
19522            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19523        ) -> Self::Borrowed<'a> {
19524            value
19525        }
19526    }
19527
19528    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
19529        type Owned = Self;
19530
19531        #[inline(always)]
19532        fn inline_align(_context: fidl::encoding::Context) -> usize {
19533            8
19534        }
19535
19536        #[inline(always)]
19537        fn inline_size(_context: fidl::encoding::Context) -> usize {
19538            16
19539        }
19540    }
19541
19542    unsafe impl fidl::encoding::Encode<ConnectionInfo, fdomain_client::fidl::FDomainResourceDialect>
19543        for &mut ConnectionInfo
19544    {
19545        unsafe fn encode(
19546            self,
19547            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19548            offset: usize,
19549            mut depth: fidl::encoding::Depth,
19550        ) -> fidl::Result<()> {
19551            encoder.debug_check_bounds::<ConnectionInfo>(offset);
19552            // Vector header
19553            let max_ordinal: u64 = self.max_ordinal_present();
19554            encoder.write_num(max_ordinal, offset);
19555            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19556            // Calling encoder.out_of_line_offset(0) is not allowed.
19557            if max_ordinal == 0 {
19558                return Ok(());
19559            }
19560            depth.increment()?;
19561            let envelope_size = 8;
19562            let bytes_len = max_ordinal as usize * envelope_size;
19563            #[allow(unused_variables)]
19564            let offset = encoder.out_of_line_offset(bytes_len);
19565            let mut _prev_end_offset: usize = 0;
19566            if 1 > max_ordinal {
19567                return Ok(());
19568            }
19569
19570            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19571            // are envelope_size bytes.
19572            let cur_offset: usize = (1 - 1) * envelope_size;
19573
19574            // Zero reserved fields.
19575            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19576
19577            // Safety:
19578            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19579            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19580            //   envelope_size bytes, there is always sufficient room.
19581            fidl::encoding::encode_in_envelope_optional::<
19582                Operations,
19583                fdomain_client::fidl::FDomainResourceDialect,
19584            >(
19585                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
19586                encoder,
19587                offset + cur_offset,
19588                depth,
19589            )?;
19590
19591            _prev_end_offset = cur_offset + envelope_size;
19592
19593            Ok(())
19594        }
19595    }
19596
19597    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for ConnectionInfo {
19598        #[inline(always)]
19599        fn new_empty() -> Self {
19600            Self::default()
19601        }
19602
19603        unsafe fn decode(
19604            &mut self,
19605            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19606            offset: usize,
19607            mut depth: fidl::encoding::Depth,
19608        ) -> fidl::Result<()> {
19609            decoder.debug_check_bounds::<Self>(offset);
19610            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19611                None => return Err(fidl::Error::NotNullable),
19612                Some(len) => len,
19613            };
19614            // Calling decoder.out_of_line_offset(0) is not allowed.
19615            if len == 0 {
19616                return Ok(());
19617            };
19618            depth.increment()?;
19619            let envelope_size = 8;
19620            let bytes_len = len * envelope_size;
19621            let offset = decoder.out_of_line_offset(bytes_len)?;
19622            // Decode the envelope for each type.
19623            let mut _next_ordinal_to_read = 0;
19624            let mut next_offset = offset;
19625            let end_offset = offset + bytes_len;
19626            _next_ordinal_to_read += 1;
19627            if next_offset >= end_offset {
19628                return Ok(());
19629            }
19630
19631            // Decode unknown envelopes for gaps in ordinals.
19632            while _next_ordinal_to_read < 1 {
19633                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19634                _next_ordinal_to_read += 1;
19635                next_offset += envelope_size;
19636            }
19637
19638            let next_out_of_line = decoder.next_out_of_line();
19639            let handles_before = decoder.remaining_handles();
19640            if let Some((inlined, num_bytes, num_handles)) =
19641                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19642            {
19643                let member_inline_size =
19644                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19645                if inlined != (member_inline_size <= 4) {
19646                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19647                }
19648                let inner_offset;
19649                let mut inner_depth = depth.clone();
19650                if inlined {
19651                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19652                    inner_offset = next_offset;
19653                } else {
19654                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19655                    inner_depth.increment()?;
19656                }
19657                let val_ref = self.rights.get_or_insert_with(|| {
19658                    fidl::new_empty!(Operations, fdomain_client::fidl::FDomainResourceDialect)
19659                });
19660                fidl::decode!(
19661                    Operations,
19662                    fdomain_client::fidl::FDomainResourceDialect,
19663                    val_ref,
19664                    decoder,
19665                    inner_offset,
19666                    inner_depth
19667                )?;
19668                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19669                {
19670                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19671                }
19672                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19673                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19674                }
19675            }
19676
19677            next_offset += envelope_size;
19678
19679            // Decode the remaining unknown envelopes.
19680            while next_offset < end_offset {
19681                _next_ordinal_to_read += 1;
19682                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19683                next_offset += envelope_size;
19684            }
19685
19686            Ok(())
19687        }
19688    }
19689
19690    impl FileInfo {
19691        #[inline(always)]
19692        fn max_ordinal_present(&self) -> u64 {
19693            if let Some(_) = self.attributes {
19694                return 4;
19695            }
19696            if let Some(_) = self.stream {
19697                return 3;
19698            }
19699            if let Some(_) = self.observer {
19700                return 2;
19701            }
19702            if let Some(_) = self.is_append {
19703                return 1;
19704            }
19705            0
19706        }
19707    }
19708
19709    impl fidl::encoding::ResourceTypeMarker for FileInfo {
19710        type Borrowed<'a> = &'a mut Self;
19711        fn take_or_borrow<'a>(
19712            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19713        ) -> Self::Borrowed<'a> {
19714            value
19715        }
19716    }
19717
19718    unsafe impl fidl::encoding::TypeMarker for FileInfo {
19719        type Owned = Self;
19720
19721        #[inline(always)]
19722        fn inline_align(_context: fidl::encoding::Context) -> usize {
19723            8
19724        }
19725
19726        #[inline(always)]
19727        fn inline_size(_context: fidl::encoding::Context) -> usize {
19728            16
19729        }
19730    }
19731
19732    unsafe impl fidl::encoding::Encode<FileInfo, fdomain_client::fidl::FDomainResourceDialect>
19733        for &mut FileInfo
19734    {
19735        unsafe fn encode(
19736            self,
19737            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19738            offset: usize,
19739            mut depth: fidl::encoding::Depth,
19740        ) -> fidl::Result<()> {
19741            encoder.debug_check_bounds::<FileInfo>(offset);
19742            // Vector header
19743            let max_ordinal: u64 = self.max_ordinal_present();
19744            encoder.write_num(max_ordinal, offset);
19745            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19746            // Calling encoder.out_of_line_offset(0) is not allowed.
19747            if max_ordinal == 0 {
19748                return Ok(());
19749            }
19750            depth.increment()?;
19751            let envelope_size = 8;
19752            let bytes_len = max_ordinal as usize * envelope_size;
19753            #[allow(unused_variables)]
19754            let offset = encoder.out_of_line_offset(bytes_len);
19755            let mut _prev_end_offset: usize = 0;
19756            if 1 > max_ordinal {
19757                return Ok(());
19758            }
19759
19760            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19761            // are envelope_size bytes.
19762            let cur_offset: usize = (1 - 1) * envelope_size;
19763
19764            // Zero reserved fields.
19765            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19766
19767            // Safety:
19768            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19769            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19770            //   envelope_size bytes, there is always sufficient room.
19771            fidl::encoding::encode_in_envelope_optional::<
19772                bool,
19773                fdomain_client::fidl::FDomainResourceDialect,
19774            >(
19775                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19776                encoder,
19777                offset + cur_offset,
19778                depth,
19779            )?;
19780
19781            _prev_end_offset = cur_offset + envelope_size;
19782            if 2 > max_ordinal {
19783                return Ok(());
19784            }
19785
19786            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19787            // are envelope_size bytes.
19788            let cur_offset: usize = (2 - 1) * envelope_size;
19789
19790            // Zero reserved fields.
19791            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19792
19793            // Safety:
19794            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19795            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19796            //   envelope_size bytes, there is always sufficient room.
19797            fidl::encoding::encode_in_envelope_optional::<
19798                fidl::encoding::HandleType<
19799                    fdomain_client::Event,
19800                    { fidl::ObjectType::EVENT.into_raw() },
19801                    2147483648,
19802                >,
19803                fdomain_client::fidl::FDomainResourceDialect,
19804            >(
19805                self.observer.as_mut().map(
19806                    <fidl::encoding::HandleType<
19807                        fdomain_client::Event,
19808                        { fidl::ObjectType::EVENT.into_raw() },
19809                        2147483648,
19810                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
19811                ),
19812                encoder,
19813                offset + cur_offset,
19814                depth,
19815            )?;
19816
19817            _prev_end_offset = cur_offset + envelope_size;
19818            if 3 > max_ordinal {
19819                return Ok(());
19820            }
19821
19822            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19823            // are envelope_size bytes.
19824            let cur_offset: usize = (3 - 1) * envelope_size;
19825
19826            // Zero reserved fields.
19827            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19828
19829            // Safety:
19830            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19831            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19832            //   envelope_size bytes, there is always sufficient room.
19833            fidl::encoding::encode_in_envelope_optional::<
19834                fidl::encoding::HandleType<
19835                    fdomain_client::Stream,
19836                    { fidl::ObjectType::STREAM.into_raw() },
19837                    2147483648,
19838                >,
19839                fdomain_client::fidl::FDomainResourceDialect,
19840            >(
19841                self.stream.as_mut().map(
19842                    <fidl::encoding::HandleType<
19843                        fdomain_client::Stream,
19844                        { fidl::ObjectType::STREAM.into_raw() },
19845                        2147483648,
19846                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
19847                ),
19848                encoder,
19849                offset + cur_offset,
19850                depth,
19851            )?;
19852
19853            _prev_end_offset = cur_offset + envelope_size;
19854            if 4 > max_ordinal {
19855                return Ok(());
19856            }
19857
19858            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19859            // are envelope_size bytes.
19860            let cur_offset: usize = (4 - 1) * envelope_size;
19861
19862            // Zero reserved fields.
19863            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19864
19865            // Safety:
19866            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19867            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19868            //   envelope_size bytes, there is always sufficient room.
19869            fidl::encoding::encode_in_envelope_optional::<
19870                NodeAttributes2,
19871                fdomain_client::fidl::FDomainResourceDialect,
19872            >(
19873                self.attributes
19874                    .as_ref()
19875                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
19876                encoder,
19877                offset + cur_offset,
19878                depth,
19879            )?;
19880
19881            _prev_end_offset = cur_offset + envelope_size;
19882
19883            Ok(())
19884        }
19885    }
19886
19887    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for FileInfo {
19888        #[inline(always)]
19889        fn new_empty() -> Self {
19890            Self::default()
19891        }
19892
19893        unsafe fn decode(
19894            &mut self,
19895            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
19896            offset: usize,
19897            mut depth: fidl::encoding::Depth,
19898        ) -> fidl::Result<()> {
19899            decoder.debug_check_bounds::<Self>(offset);
19900            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19901                None => return Err(fidl::Error::NotNullable),
19902                Some(len) => len,
19903            };
19904            // Calling decoder.out_of_line_offset(0) is not allowed.
19905            if len == 0 {
19906                return Ok(());
19907            };
19908            depth.increment()?;
19909            let envelope_size = 8;
19910            let bytes_len = len * envelope_size;
19911            let offset = decoder.out_of_line_offset(bytes_len)?;
19912            // Decode the envelope for each type.
19913            let mut _next_ordinal_to_read = 0;
19914            let mut next_offset = offset;
19915            let end_offset = offset + bytes_len;
19916            _next_ordinal_to_read += 1;
19917            if next_offset >= end_offset {
19918                return Ok(());
19919            }
19920
19921            // Decode unknown envelopes for gaps in ordinals.
19922            while _next_ordinal_to_read < 1 {
19923                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19924                _next_ordinal_to_read += 1;
19925                next_offset += envelope_size;
19926            }
19927
19928            let next_out_of_line = decoder.next_out_of_line();
19929            let handles_before = decoder.remaining_handles();
19930            if let Some((inlined, num_bytes, num_handles)) =
19931                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19932            {
19933                let member_inline_size =
19934                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19935                if inlined != (member_inline_size <= 4) {
19936                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19937                }
19938                let inner_offset;
19939                let mut inner_depth = depth.clone();
19940                if inlined {
19941                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19942                    inner_offset = next_offset;
19943                } else {
19944                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19945                    inner_depth.increment()?;
19946                }
19947                let val_ref = self.is_append.get_or_insert_with(|| {
19948                    fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect)
19949                });
19950                fidl::decode!(
19951                    bool,
19952                    fdomain_client::fidl::FDomainResourceDialect,
19953                    val_ref,
19954                    decoder,
19955                    inner_offset,
19956                    inner_depth
19957                )?;
19958                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19959                {
19960                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19961                }
19962                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19963                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19964                }
19965            }
19966
19967            next_offset += envelope_size;
19968            _next_ordinal_to_read += 1;
19969            if next_offset >= end_offset {
19970                return Ok(());
19971            }
19972
19973            // Decode unknown envelopes for gaps in ordinals.
19974            while _next_ordinal_to_read < 2 {
19975                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19976                _next_ordinal_to_read += 1;
19977                next_offset += envelope_size;
19978            }
19979
19980            let next_out_of_line = decoder.next_out_of_line();
19981            let handles_before = decoder.remaining_handles();
19982            if let Some((inlined, num_bytes, num_handles)) =
19983                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19984            {
19985                let member_inline_size = <fidl::encoding::HandleType<
19986                    fdomain_client::Event,
19987                    { fidl::ObjectType::EVENT.into_raw() },
19988                    2147483648,
19989                > as fidl::encoding::TypeMarker>::inline_size(
19990                    decoder.context
19991                );
19992                if inlined != (member_inline_size <= 4) {
19993                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19994                }
19995                let inner_offset;
19996                let mut inner_depth = depth.clone();
19997                if inlined {
19998                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19999                    inner_offset = next_offset;
20000                } else {
20001                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20002                    inner_depth.increment()?;
20003                }
20004                let val_ref =
20005                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));
20006                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)?;
20007                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20008                {
20009                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20010                }
20011                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20012                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20013                }
20014            }
20015
20016            next_offset += envelope_size;
20017            _next_ordinal_to_read += 1;
20018            if next_offset >= end_offset {
20019                return Ok(());
20020            }
20021
20022            // Decode unknown envelopes for gaps in ordinals.
20023            while _next_ordinal_to_read < 3 {
20024                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20025                _next_ordinal_to_read += 1;
20026                next_offset += envelope_size;
20027            }
20028
20029            let next_out_of_line = decoder.next_out_of_line();
20030            let handles_before = decoder.remaining_handles();
20031            if let Some((inlined, num_bytes, num_handles)) =
20032                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20033            {
20034                let member_inline_size = <fidl::encoding::HandleType<
20035                    fdomain_client::Stream,
20036                    { fidl::ObjectType::STREAM.into_raw() },
20037                    2147483648,
20038                > as fidl::encoding::TypeMarker>::inline_size(
20039                    decoder.context
20040                );
20041                if inlined != (member_inline_size <= 4) {
20042                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20043                }
20044                let inner_offset;
20045                let mut inner_depth = depth.clone();
20046                if inlined {
20047                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20048                    inner_offset = next_offset;
20049                } else {
20050                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20051                    inner_depth.increment()?;
20052                }
20053                let val_ref =
20054                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));
20055                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)?;
20056                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20057                {
20058                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20059                }
20060                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20061                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20062                }
20063            }
20064
20065            next_offset += envelope_size;
20066            _next_ordinal_to_read += 1;
20067            if next_offset >= end_offset {
20068                return Ok(());
20069            }
20070
20071            // Decode unknown envelopes for gaps in ordinals.
20072            while _next_ordinal_to_read < 4 {
20073                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20074                _next_ordinal_to_read += 1;
20075                next_offset += envelope_size;
20076            }
20077
20078            let next_out_of_line = decoder.next_out_of_line();
20079            let handles_before = decoder.remaining_handles();
20080            if let Some((inlined, num_bytes, num_handles)) =
20081                fidl::encoding::decode_envelope_header(decoder, next_offset)?
20082            {
20083                let member_inline_size =
20084                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20085                if inlined != (member_inline_size <= 4) {
20086                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
20087                }
20088                let inner_offset;
20089                let mut inner_depth = depth.clone();
20090                if inlined {
20091                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20092                    inner_offset = next_offset;
20093                } else {
20094                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20095                    inner_depth.increment()?;
20096                }
20097                let val_ref = self.attributes.get_or_insert_with(|| {
20098                    fidl::new_empty!(NodeAttributes2, fdomain_client::fidl::FDomainResourceDialect)
20099                });
20100                fidl::decode!(
20101                    NodeAttributes2,
20102                    fdomain_client::fidl::FDomainResourceDialect,
20103                    val_ref,
20104                    decoder,
20105                    inner_offset,
20106                    inner_depth
20107                )?;
20108                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20109                {
20110                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
20111                }
20112                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20113                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20114                }
20115            }
20116
20117            next_offset += envelope_size;
20118
20119            // Decode the remaining unknown envelopes.
20120            while next_offset < end_offset {
20121                _next_ordinal_to_read += 1;
20122                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20123                next_offset += envelope_size;
20124            }
20125
20126            Ok(())
20127        }
20128    }
20129
20130    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
20131        type Borrowed<'a> = &'a mut Self;
20132        fn take_or_borrow<'a>(
20133            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20134        ) -> Self::Borrowed<'a> {
20135            value
20136        }
20137    }
20138
20139    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
20140        type Owned = Self;
20141
20142        #[inline(always)]
20143        fn inline_align(_context: fidl::encoding::Context) -> usize {
20144            8
20145        }
20146
20147        #[inline(always)]
20148        fn inline_size(_context: fidl::encoding::Context) -> usize {
20149            16
20150        }
20151    }
20152
20153    unsafe impl
20154        fidl::encoding::Encode<ExtendedAttributeValue, fdomain_client::fidl::FDomainResourceDialect>
20155        for &mut ExtendedAttributeValue
20156    {
20157        #[inline]
20158        unsafe fn encode(
20159            self,
20160            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20161            offset: usize,
20162            _depth: fidl::encoding::Depth,
20163        ) -> fidl::Result<()> {
20164            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
20165            encoder.write_num::<u64>(self.ordinal(), offset);
20166            match self {
20167                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
20168                    fidl::encoding::Vector<u8, 32768>,
20169                    fdomain_client::fidl::FDomainResourceDialect,
20170                >(
20171                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
20172                        val,
20173                    ),
20174                    encoder,
20175                    offset + 8,
20176                    _depth,
20177                ),
20178                ExtendedAttributeValue::Buffer(ref mut val) => {
20179                    fidl::encoding::encode_in_envelope::<
20180                        fidl::encoding::HandleType<
20181                            fdomain_client::Vmo,
20182                            { fidl::ObjectType::VMO.into_raw() },
20183                            2147483648,
20184                        >,
20185                        fdomain_client::fidl::FDomainResourceDialect,
20186                    >(
20187                        <fidl::encoding::HandleType<
20188                            fdomain_client::Vmo,
20189                            { fidl::ObjectType::VMO.into_raw() },
20190                            2147483648,
20191                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20192                            val
20193                        ),
20194                        encoder,
20195                        offset + 8,
20196                        _depth,
20197                    )
20198                }
20199                ExtendedAttributeValue::__SourceBreaking { .. } => {
20200                    Err(fidl::Error::UnknownUnionTag)
20201                }
20202            }
20203        }
20204    }
20205
20206    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20207        for ExtendedAttributeValue
20208    {
20209        #[inline(always)]
20210        fn new_empty() -> Self {
20211            Self::__SourceBreaking { unknown_ordinal: 0 }
20212        }
20213
20214        #[inline]
20215        unsafe fn decode(
20216            &mut self,
20217            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20218            offset: usize,
20219            mut depth: fidl::encoding::Depth,
20220        ) -> fidl::Result<()> {
20221            decoder.debug_check_bounds::<Self>(offset);
20222            #[allow(unused_variables)]
20223            let next_out_of_line = decoder.next_out_of_line();
20224            let handles_before = decoder.remaining_handles();
20225            let (ordinal, inlined, num_bytes, num_handles) =
20226                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20227
20228            let member_inline_size = match ordinal {
20229                1 => {
20230                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
20231                        decoder.context,
20232                    )
20233                }
20234                2 => <fidl::encoding::HandleType<
20235                    fdomain_client::Vmo,
20236                    { fidl::ObjectType::VMO.into_raw() },
20237                    2147483648,
20238                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20239                0 => return Err(fidl::Error::UnknownUnionTag),
20240                _ => num_bytes as usize,
20241            };
20242
20243            if inlined != (member_inline_size <= 4) {
20244                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20245            }
20246            let _inner_offset;
20247            if inlined {
20248                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20249                _inner_offset = offset + 8;
20250            } else {
20251                depth.increment()?;
20252                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20253            }
20254            match ordinal {
20255                1 => {
20256                    #[allow(irrefutable_let_patterns)]
20257                    if let ExtendedAttributeValue::Bytes(_) = self {
20258                        // Do nothing, read the value into the object
20259                    } else {
20260                        // Initialize `self` to the right variant
20261                        *self = ExtendedAttributeValue::Bytes(
20262                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect),
20263                        );
20264                    }
20265                    #[allow(irrefutable_let_patterns)]
20266                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
20267                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20268                    } else {
20269                        unreachable!()
20270                    }
20271                }
20272                2 => {
20273                    #[allow(irrefutable_let_patterns)]
20274                    if let ExtendedAttributeValue::Buffer(_) = self {
20275                        // Do nothing, read the value into the object
20276                    } else {
20277                        // Initialize `self` to the right variant
20278                        *self = ExtendedAttributeValue::Buffer(
20279                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
20280                        );
20281                    }
20282                    #[allow(irrefutable_let_patterns)]
20283                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
20284                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
20285                    } else {
20286                        unreachable!()
20287                    }
20288                }
20289                #[allow(deprecated)]
20290                ordinal => {
20291                    for _ in 0..num_handles {
20292                        decoder.drop_next_handle()?;
20293                    }
20294                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
20295                }
20296            }
20297            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20298                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20299            }
20300            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20301                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20302            }
20303            Ok(())
20304        }
20305    }
20306
20307    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
20308        type Borrowed<'a> = &'a mut Self;
20309        fn take_or_borrow<'a>(
20310            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20311        ) -> Self::Borrowed<'a> {
20312            value
20313        }
20314    }
20315
20316    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
20317        type Owned = Self;
20318
20319        #[inline(always)]
20320        fn inline_align(_context: fidl::encoding::Context) -> usize {
20321            8
20322        }
20323
20324        #[inline(always)]
20325        fn inline_size(_context: fidl::encoding::Context) -> usize {
20326            16
20327        }
20328    }
20329
20330    unsafe impl
20331        fidl::encoding::Encode<NodeInfoDeprecated, fdomain_client::fidl::FDomainResourceDialect>
20332        for &mut NodeInfoDeprecated
20333    {
20334        #[inline]
20335        unsafe fn encode(
20336            self,
20337            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20338            offset: usize,
20339            _depth: fidl::encoding::Depth,
20340        ) -> fidl::Result<()> {
20341            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
20342            encoder.write_num::<u64>(self.ordinal(), offset);
20343            match self {
20344                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
20345                    Service,
20346                    fdomain_client::fidl::FDomainResourceDialect,
20347                >(
20348                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
20349                    encoder,
20350                    offset + 8,
20351                    _depth,
20352                ),
20353                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20354                    FileObject,
20355                    fdomain_client::fidl::FDomainResourceDialect,
20356                >(
20357                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20358                    encoder,
20359                    offset + 8,
20360                    _depth,
20361                ),
20362                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20363                    DirectoryObject,
20364                    fdomain_client::fidl::FDomainResourceDialect,
20365                >(
20366                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20367                    encoder,
20368                    offset + 8,
20369                    _depth,
20370                ),
20371                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20372                    SymlinkObject,
20373                    fdomain_client::fidl::FDomainResourceDialect,
20374                >(
20375                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
20376                    encoder,
20377                    offset + 8,
20378                    _depth,
20379                ),
20380            }
20381        }
20382    }
20383
20384    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
20385        for NodeInfoDeprecated
20386    {
20387        #[inline(always)]
20388        fn new_empty() -> Self {
20389            Self::Service(fidl::new_empty!(Service, fdomain_client::fidl::FDomainResourceDialect))
20390        }
20391
20392        #[inline]
20393        unsafe fn decode(
20394            &mut self,
20395            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20396            offset: usize,
20397            mut depth: fidl::encoding::Depth,
20398        ) -> fidl::Result<()> {
20399            decoder.debug_check_bounds::<Self>(offset);
20400            #[allow(unused_variables)]
20401            let next_out_of_line = decoder.next_out_of_line();
20402            let handles_before = decoder.remaining_handles();
20403            let (ordinal, inlined, num_bytes, num_handles) =
20404                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20405
20406            let member_inline_size = match ordinal {
20407                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20408                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20409                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20410                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20411                _ => return Err(fidl::Error::UnknownUnionTag),
20412            };
20413
20414            if inlined != (member_inline_size <= 4) {
20415                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20416            }
20417            let _inner_offset;
20418            if inlined {
20419                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20420                _inner_offset = offset + 8;
20421            } else {
20422                depth.increment()?;
20423                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20424            }
20425            match ordinal {
20426                1 => {
20427                    #[allow(irrefutable_let_patterns)]
20428                    if let NodeInfoDeprecated::Service(_) = self {
20429                        // Do nothing, read the value into the object
20430                    } else {
20431                        // Initialize `self` to the right variant
20432                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
20433                            Service,
20434                            fdomain_client::fidl::FDomainResourceDialect
20435                        ));
20436                    }
20437                    #[allow(irrefutable_let_patterns)]
20438                    if let NodeInfoDeprecated::Service(ref mut val) = self {
20439                        fidl::decode!(
20440                            Service,
20441                            fdomain_client::fidl::FDomainResourceDialect,
20442                            val,
20443                            decoder,
20444                            _inner_offset,
20445                            depth
20446                        )?;
20447                    } else {
20448                        unreachable!()
20449                    }
20450                }
20451                2 => {
20452                    #[allow(irrefutable_let_patterns)]
20453                    if let NodeInfoDeprecated::File(_) = self {
20454                        // Do nothing, read the value into the object
20455                    } else {
20456                        // Initialize `self` to the right variant
20457                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
20458                            FileObject,
20459                            fdomain_client::fidl::FDomainResourceDialect
20460                        ));
20461                    }
20462                    #[allow(irrefutable_let_patterns)]
20463                    if let NodeInfoDeprecated::File(ref mut val) = self {
20464                        fidl::decode!(
20465                            FileObject,
20466                            fdomain_client::fidl::FDomainResourceDialect,
20467                            val,
20468                            decoder,
20469                            _inner_offset,
20470                            depth
20471                        )?;
20472                    } else {
20473                        unreachable!()
20474                    }
20475                }
20476                3 => {
20477                    #[allow(irrefutable_let_patterns)]
20478                    if let NodeInfoDeprecated::Directory(_) = self {
20479                        // Do nothing, read the value into the object
20480                    } else {
20481                        // Initialize `self` to the right variant
20482                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
20483                            DirectoryObject,
20484                            fdomain_client::fidl::FDomainResourceDialect
20485                        ));
20486                    }
20487                    #[allow(irrefutable_let_patterns)]
20488                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
20489                        fidl::decode!(
20490                            DirectoryObject,
20491                            fdomain_client::fidl::FDomainResourceDialect,
20492                            val,
20493                            decoder,
20494                            _inner_offset,
20495                            depth
20496                        )?;
20497                    } else {
20498                        unreachable!()
20499                    }
20500                }
20501                4 => {
20502                    #[allow(irrefutable_let_patterns)]
20503                    if let NodeInfoDeprecated::Symlink(_) = self {
20504                        // Do nothing, read the value into the object
20505                    } else {
20506                        // Initialize `self` to the right variant
20507                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
20508                            SymlinkObject,
20509                            fdomain_client::fidl::FDomainResourceDialect
20510                        ));
20511                    }
20512                    #[allow(irrefutable_let_patterns)]
20513                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
20514                        fidl::decode!(
20515                            SymlinkObject,
20516                            fdomain_client::fidl::FDomainResourceDialect,
20517                            val,
20518                            decoder,
20519                            _inner_offset,
20520                            depth
20521                        )?;
20522                    } else {
20523                        unreachable!()
20524                    }
20525                }
20526                ordinal => panic!("unexpected ordinal {:?}", ordinal),
20527            }
20528            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20529                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20530            }
20531            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20532                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20533            }
20534            Ok(())
20535        }
20536    }
20537
20538    impl fidl::encoding::ResourceTypeMarker for Representation {
20539        type Borrowed<'a> = &'a mut Self;
20540        fn take_or_borrow<'a>(
20541            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20542        ) -> Self::Borrowed<'a> {
20543            value
20544        }
20545    }
20546
20547    unsafe impl fidl::encoding::TypeMarker for Representation {
20548        type Owned = Self;
20549
20550        #[inline(always)]
20551        fn inline_align(_context: fidl::encoding::Context) -> usize {
20552            8
20553        }
20554
20555        #[inline(always)]
20556        fn inline_size(_context: fidl::encoding::Context) -> usize {
20557            16
20558        }
20559    }
20560
20561    unsafe impl fidl::encoding::Encode<Representation, fdomain_client::fidl::FDomainResourceDialect>
20562        for &mut Representation
20563    {
20564        #[inline]
20565        unsafe fn encode(
20566            self,
20567            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20568            offset: usize,
20569            _depth: fidl::encoding::Depth,
20570        ) -> fidl::Result<()> {
20571            encoder.debug_check_bounds::<Representation>(offset);
20572            encoder.write_num::<u64>(self.ordinal(), offset);
20573            match self {
20574                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
20575                    NodeInfo,
20576                    fdomain_client::fidl::FDomainResourceDialect,
20577                >(
20578                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20579                    encoder,
20580                    offset + 8,
20581                    _depth,
20582                ),
20583                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
20584                    DirectoryInfo,
20585                    fdomain_client::fidl::FDomainResourceDialect,
20586                >(
20587                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20588                    encoder,
20589                    offset + 8,
20590                    _depth,
20591                ),
20592                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
20593                    FileInfo,
20594                    fdomain_client::fidl::FDomainResourceDialect,
20595                >(
20596                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
20597                    encoder,
20598                    offset + 8,
20599                    _depth,
20600                ),
20601                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
20602                    SymlinkInfo,
20603                    fdomain_client::fidl::FDomainResourceDialect,
20604                >(
20605                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
20606                    encoder,
20607                    offset + 8,
20608                    _depth,
20609                ),
20610                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
20611            }
20612        }
20613    }
20614
20615    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Representation {
20616        #[inline(always)]
20617        fn new_empty() -> Self {
20618            Self::__SourceBreaking { unknown_ordinal: 0 }
20619        }
20620
20621        #[inline]
20622        unsafe fn decode(
20623            &mut self,
20624            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
20625            offset: usize,
20626            mut depth: fidl::encoding::Depth,
20627        ) -> fidl::Result<()> {
20628            decoder.debug_check_bounds::<Self>(offset);
20629            #[allow(unused_variables)]
20630            let next_out_of_line = decoder.next_out_of_line();
20631            let handles_before = decoder.remaining_handles();
20632            let (ordinal, inlined, num_bytes, num_handles) =
20633                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
20634
20635            let member_inline_size = match ordinal {
20636                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20637                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20638                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20639                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20640                0 => return Err(fidl::Error::UnknownUnionTag),
20641                _ => num_bytes as usize,
20642            };
20643
20644            if inlined != (member_inline_size <= 4) {
20645                return Err(fidl::Error::InvalidInlineBitInEnvelope);
20646            }
20647            let _inner_offset;
20648            if inlined {
20649                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
20650                _inner_offset = offset + 8;
20651            } else {
20652                depth.increment()?;
20653                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20654            }
20655            match ordinal {
20656                1 => {
20657                    #[allow(irrefutable_let_patterns)]
20658                    if let Representation::Node(_) = self {
20659                        // Do nothing, read the value into the object
20660                    } else {
20661                        // Initialize `self` to the right variant
20662                        *self = Representation::Node(fidl::new_empty!(
20663                            NodeInfo,
20664                            fdomain_client::fidl::FDomainResourceDialect
20665                        ));
20666                    }
20667                    #[allow(irrefutable_let_patterns)]
20668                    if let Representation::Node(ref mut val) = self {
20669                        fidl::decode!(
20670                            NodeInfo,
20671                            fdomain_client::fidl::FDomainResourceDialect,
20672                            val,
20673                            decoder,
20674                            _inner_offset,
20675                            depth
20676                        )?;
20677                    } else {
20678                        unreachable!()
20679                    }
20680                }
20681                2 => {
20682                    #[allow(irrefutable_let_patterns)]
20683                    if let Representation::Directory(_) = self {
20684                        // Do nothing, read the value into the object
20685                    } else {
20686                        // Initialize `self` to the right variant
20687                        *self = Representation::Directory(fidl::new_empty!(
20688                            DirectoryInfo,
20689                            fdomain_client::fidl::FDomainResourceDialect
20690                        ));
20691                    }
20692                    #[allow(irrefutable_let_patterns)]
20693                    if let Representation::Directory(ref mut val) = self {
20694                        fidl::decode!(
20695                            DirectoryInfo,
20696                            fdomain_client::fidl::FDomainResourceDialect,
20697                            val,
20698                            decoder,
20699                            _inner_offset,
20700                            depth
20701                        )?;
20702                    } else {
20703                        unreachable!()
20704                    }
20705                }
20706                3 => {
20707                    #[allow(irrefutable_let_patterns)]
20708                    if let Representation::File(_) = self {
20709                        // Do nothing, read the value into the object
20710                    } else {
20711                        // Initialize `self` to the right variant
20712                        *self = Representation::File(fidl::new_empty!(
20713                            FileInfo,
20714                            fdomain_client::fidl::FDomainResourceDialect
20715                        ));
20716                    }
20717                    #[allow(irrefutable_let_patterns)]
20718                    if let Representation::File(ref mut val) = self {
20719                        fidl::decode!(
20720                            FileInfo,
20721                            fdomain_client::fidl::FDomainResourceDialect,
20722                            val,
20723                            decoder,
20724                            _inner_offset,
20725                            depth
20726                        )?;
20727                    } else {
20728                        unreachable!()
20729                    }
20730                }
20731                4 => {
20732                    #[allow(irrefutable_let_patterns)]
20733                    if let Representation::Symlink(_) = self {
20734                        // Do nothing, read the value into the object
20735                    } else {
20736                        // Initialize `self` to the right variant
20737                        *self = Representation::Symlink(fidl::new_empty!(
20738                            SymlinkInfo,
20739                            fdomain_client::fidl::FDomainResourceDialect
20740                        ));
20741                    }
20742                    #[allow(irrefutable_let_patterns)]
20743                    if let Representation::Symlink(ref mut val) = self {
20744                        fidl::decode!(
20745                            SymlinkInfo,
20746                            fdomain_client::fidl::FDomainResourceDialect,
20747                            val,
20748                            decoder,
20749                            _inner_offset,
20750                            depth
20751                        )?;
20752                    } else {
20753                        unreachable!()
20754                    }
20755                }
20756                #[allow(deprecated)]
20757                ordinal => {
20758                    for _ in 0..num_handles {
20759                        decoder.drop_next_handle()?;
20760                    }
20761                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
20762                }
20763            }
20764            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
20765                return Err(fidl::Error::InvalidNumBytesInEnvelope);
20766            }
20767            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20768                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20769            }
20770            Ok(())
20771        }
20772    }
20773}